├── .circleci
└── config.yml
├── .eslintrc.js
├── .github
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
├── renovate.json
└── workflows
│ └── deploy.yml
├── .gitignore
├── .gitmodules
├── .husky
├── .gitignore
└── pre-commit
├── .lintstagedrc
├── .markdownlintrc
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── .stylelintrc
├── LICENSE.md
├── README.md
├── babel.config.js
├── content
├── figma
│ └── assets.yml
├── nav
│ ├── components.yml
│ ├── content.yml
│ ├── design.yml
│ └── patterns.yml
└── news
│ └── news.yml
├── eslint.config.mjs
├── gatsby-browser.js
├── gatsby-config.ts
├── gatsby-node.ts
├── gatsby-ssr.js
├── graphql.config.js
├── package-lock.json
├── package.json
├── plugins
├── gatsby-algolia-docsearch
│ ├── gatsby-ssr.js
│ └── package.json
├── gatsby-remark-figma-assets
│ ├── index.mjs
│ └── package.json
├── gatsby-source-garden-content
│ ├── gatsby-node.ts
│ ├── package.json
│ └── utils.ts
├── gatsby-source-garden-docgen
│ ├── README.md
│ ├── gatsby-node.mjs
│ ├── package.json
│ └── utils.mjs
└── gatsby-transformer-garden-svg
│ ├── gatsby-node.js
│ └── package.json
├── src
├── components
│ ├── GlobalStyles.ts
│ ├── Layout.tsx
│ ├── MarkdownProvider
│ │ ├── components
│ │ │ ├── Alert.tsx
│ │ │ ├── Anchor.ts
│ │ │ ├── BestPractice.tsx
│ │ │ ├── CodeBlock.tsx
│ │ │ ├── CodeExample
│ │ │ │ ├── assets
│ │ │ │ │ └── codesandbox-icon.svg
│ │ │ │ ├── index.tsx
│ │ │ │ └── utils
│ │ │ │ │ └── retrieveCodesandboxParameters.ts
│ │ │ ├── ColorPalette.tsx
│ │ │ ├── ColorShades.tsx
│ │ │ ├── Component.tsx
│ │ │ ├── Configuration.tsx
│ │ │ ├── ImageFigure.tsx
│ │ │ ├── Lists.tsx
│ │ │ ├── Markdown.tsx
│ │ │ ├── ObjectBlock.tsx
│ │ │ ├── OverviewLinks.tsx
│ │ │ ├── PropSheet.tsx
│ │ │ ├── Table.tsx
│ │ │ ├── Typography.tsx
│ │ │ └── Usage.tsx
│ │ └── index.tsx
│ ├── Provider.tsx
│ ├── SEO.tsx
│ ├── index.ts
│ └── types.ts
├── examples
│ ├── accordions
│ │ ├── accordion
│ │ │ ├── AccordionBare.tsx
│ │ │ ├── AccordionDefault.tsx
│ │ │ ├── AccordionExpandable.tsx
│ │ │ └── AccordionSize.tsx
│ │ ├── stepper
│ │ │ ├── StepperDefault.tsx
│ │ │ ├── StepperIcons.tsx
│ │ │ └── StepperLayout.tsx
│ │ └── timeline
│ │ │ ├── TimelineAlternating.tsx
│ │ │ ├── TimelineCustomMedia.tsx
│ │ │ ├── TimelineDefault.tsx
│ │ │ └── TimelineOppositeContent.tsx
│ ├── anchor
│ │ ├── AnchorDanger.tsx
│ │ ├── AnchorDefault.tsx
│ │ ├── AnchorExternal.tsx
│ │ └── AnchorWithoutUnderline.tsx
│ ├── avatar
│ │ ├── AvatarShape.tsx
│ │ ├── AvatarSize.tsx
│ │ ├── AvatarStatus.tsx
│ │ ├── AvatarType.tsx
│ │ ├── StatusIndicatorCaption.tsx
│ │ ├── StatusIndicatorDefault.tsx
│ │ ├── StatusIndicatorSize.tsx
│ │ └── StatusIndicatorType.tsx
│ ├── breadcrumbs
│ │ └── BreadcrumbsDefault.tsx
│ ├── button
│ │ ├── ButtonDanger.tsx
│ │ ├── ButtonDefault.tsx
│ │ ├── ButtonDisabled.tsx
│ │ ├── ButtonMedia.tsx
│ │ ├── ButtonPatternInteraction.tsx
│ │ ├── ButtonSizes.tsx
│ │ ├── ButtonStretched.tsx
│ │ ├── ButtonTypes.tsx
│ │ ├── IconButtonDanger.tsx
│ │ ├── IconButtonDefault.tsx
│ │ ├── IconButtonDisabled.tsx
│ │ ├── IconButtonShapes.tsx
│ │ ├── IconButtonSizes.tsx
│ │ ├── IconButtonTypes.tsx
│ │ ├── SplitButtonDanger.tsx
│ │ ├── SplitButtonDefault.tsx
│ │ ├── SplitButtonDisabled.tsx
│ │ ├── SplitButtonSizes.tsx
│ │ ├── SplitButtonTypes.tsx
│ │ ├── ToggleButtonDefault.tsx
│ │ ├── ToggleButtonDisabled.tsx
│ │ ├── ToggleButtonSizes.tsx
│ │ ├── ToggleButtonTypes.tsx
│ │ ├── ToggleIconButtonDefault.tsx
│ │ ├── ToggleIconButtonDisabled.tsx
│ │ ├── ToggleIconButtonShapes.tsx
│ │ ├── ToggleIconButtonSizes.tsx
│ │ └── ToggleIconButtonTypes.tsx
│ ├── chrome
│ │ ├── ChromeDefault.tsx
│ │ ├── ChromeNavigation.tsx
│ │ ├── ChromeStandaloneHeader.tsx
│ │ ├── GlobalAlert.tsx
│ │ ├── SheetDefault.tsx
│ │ ├── SheetFooters.tsx
│ │ ├── SheetHeaders.tsx
│ │ ├── SheetPlacement.tsx
│ │ └── SheetSize.tsx
│ ├── color-picker
│ │ ├── ColorPickerDefault.tsx
│ │ ├── ColorPickerDialogCustomTrigger.tsx
│ │ ├── ColorPickerDialogDefault.tsx
│ │ ├── ColorPickerDialogFormInput.tsx
│ │ └── ColorPickerOpaque.tsx
│ ├── color-scheme-provider
│ │ └── ColorSchemeProviderDefault.tsx
│ ├── color-swatch
│ │ ├── ColorSwatchCustomTrigger.tsx
│ │ ├── ColorSwatchDefault.tsx
│ │ └── ColorSwatchDialog.tsx
│ ├── combobox
│ │ ├── Autocomplete.tsx
│ │ ├── Default.tsx
│ │ ├── Disabled.tsx
│ │ ├── Grouped.tsx
│ │ ├── Hidden.tsx
│ │ ├── Hint.tsx
│ │ ├── Media.tsx
│ │ ├── Multiselect.tsx
│ │ ├── MultiselectTags.tsx
│ │ ├── Nested.tsx
│ │ ├── NestedMultiselect.tsx
│ │ ├── Search.tsx
│ │ ├── SelectOnly.tsx
│ │ ├── Size.tsx
│ │ └── Validation.tsx
│ ├── date-picker
│ │ ├── DatePickerCustom.tsx
│ │ ├── DatePickerDefault.tsx
│ │ ├── DatePickerLocalization.tsx
│ │ ├── DatePickerRange.tsx
│ │ ├── DatePickerSize.tsx
│ │ └── DatePickerTimeWindow.tsx
│ ├── design
│ │ ├── color
│ │ │ ├── BackgroundVariables.tsx
│ │ │ ├── BorderVariables.tsx
│ │ │ ├── ForegroundVariables.tsx
│ │ │ ├── Purpose.tsx
│ │ │ └── ShadowVariables.tsx
│ │ └── icons
│ │ │ ├── IconShowcase.tsx
│ │ │ ├── IconStyles.tsx
│ │ │ └── SvgSearch.tsx
│ ├── draggable
│ │ ├── DraggableBare.tsx
│ │ ├── DraggableContent.tsx
│ │ ├── DraggableDefault.tsx
│ │ ├── DraggableDisabled.tsx
│ │ ├── DraggableListDefault.tsx
│ │ ├── DraggableListHorizontal.tsx
│ │ ├── DraggableListIndicator.tsx
│ │ ├── DraggablePlaceholder.tsx
│ │ ├── DraggableSize.tsx
│ │ ├── DropzoneDanger.tsx
│ │ └── DropzoneDefault.tsx
│ ├── drawer
│ │ └── DrawerDefault.tsx
│ ├── forms
│ │ ├── checkbox
│ │ │ ├── Default.tsx
│ │ │ ├── Disabled.tsx
│ │ │ ├── Hidden.tsx
│ │ │ ├── Hint.tsx
│ │ │ ├── Indeterminate.tsx
│ │ │ ├── RegularWeightLabel.tsx
│ │ │ └── Validation.tsx
│ │ ├── file-upload
│ │ │ ├── Disabled.tsx
│ │ │ ├── FileList.tsx
│ │ │ ├── FileUpload.tsx
│ │ │ ├── Size.tsx
│ │ │ └── Validation.tsx
│ │ ├── input-group
│ │ │ ├── ButtonPlacement.tsx
│ │ │ ├── Disabled.tsx
│ │ │ ├── InputGroup.tsx
│ │ │ ├── Readonly.tsx
│ │ │ └── Size.tsx
│ │ ├── inputs
│ │ │ ├── Disabled.tsx
│ │ │ ├── FauxInput.tsx
│ │ │ ├── FocusInset.tsx
│ │ │ ├── Hidden.tsx
│ │ │ ├── Hint.tsx
│ │ │ ├── Inline.tsx
│ │ │ ├── Input.tsx
│ │ │ ├── MediaInput.tsx
│ │ │ ├── Placeholder.tsx
│ │ │ ├── ReadOnly.tsx
│ │ │ ├── RegularWeightLabel.tsx
│ │ │ ├── Size.tsx
│ │ │ └── Validation.tsx
│ │ ├── radio
│ │ │ ├── Default.tsx
│ │ │ ├── Disabled.tsx
│ │ │ ├── Hidden.tsx
│ │ │ ├── Hint.tsx
│ │ │ ├── RegularWeightLabel.tsx
│ │ │ └── Validation.tsx
│ │ ├── range
│ │ │ ├── RangeDefault.tsx
│ │ │ ├── RangeDisabled.tsx
│ │ │ ├── RangeHidden.tsx
│ │ │ ├── RangeHint.tsx
│ │ │ └── RangeValidation.tsx
│ │ ├── select
│ │ │ ├── Default.tsx
│ │ │ ├── Disabled.tsx
│ │ │ ├── Hidden.tsx
│ │ │ ├── Hint.tsx
│ │ │ ├── Size.tsx
│ │ │ └── Validation.tsx
│ │ ├── textarea
│ │ │ ├── AutoExpand.tsx
│ │ │ ├── Default.tsx
│ │ │ ├── DragHandles.tsx
│ │ │ └── Hidden.tsx
│ │ ├── tiles
│ │ │ ├── TilesDefault.tsx
│ │ │ ├── TilesDescription.tsx
│ │ │ ├── TilesDisabled.tsx
│ │ │ └── TilesLayout.tsx
│ │ └── toggle
│ │ │ ├── Default.tsx
│ │ │ ├── Disabled.tsx
│ │ │ ├── Hidden.tsx
│ │ │ ├── Hint.tsx
│ │ │ ├── RegularWeightLabel.tsx
│ │ │ └── Validation.tsx
│ ├── grid
│ │ ├── GridAllBreak.tsx
│ │ ├── GridColumnBreaks.tsx
│ │ ├── GridColumnWrapping.tsx
│ │ ├── GridEqual.tsx
│ │ ├── GridEqualMulti.tsx
│ │ ├── GridHorizontal.tsx
│ │ ├── GridNesting.tsx
│ │ ├── GridNoGutters.tsx
│ │ ├── GridOffset.tsx
│ │ ├── GridOneCol.tsx
│ │ ├── GridReordering.tsx
│ │ ├── GridStacked.tsx
│ │ ├── GridVariable.tsx
│ │ └── GridVertical.tsx
│ ├── loaders
│ │ ├── dots
│ │ │ ├── DotsColor.tsx
│ │ │ ├── DotsDefault.tsx
│ │ │ └── DotsSize.tsx
│ │ ├── inline
│ │ │ ├── InlineColor.tsx
│ │ │ ├── InlineDefault.tsx
│ │ │ └── InlineSize.tsx
│ │ ├── progress
│ │ │ ├── ProgressColor.tsx
│ │ │ ├── ProgressDefault.tsx
│ │ │ └── ProgressSize.tsx
│ │ ├── skeleton
│ │ │ ├── SkeletonDefault.tsx
│ │ │ ├── SkeletonLight.tsx
│ │ │ └── SkeletonSize.tsx
│ │ └── spinner
│ │ │ ├── SpinnerColor.tsx
│ │ │ ├── SpinnerDefault.tsx
│ │ │ └── SpinnerSize.tsx
│ ├── menu
│ │ ├── Arrow.tsx
│ │ ├── Button.tsx
│ │ ├── Danger.tsx
│ │ ├── Default.tsx
│ │ ├── Disabled.tsx
│ │ ├── GroupedItems.tsx
│ │ ├── Media.tsx
│ │ ├── Meta.tsx
│ │ ├── Nested.tsx
│ │ ├── Placement.tsx
│ │ └── Size.tsx
│ ├── modal
│ │ ├── ModalDanger.tsx
│ │ ├── ModalDefault.tsx
│ │ └── ModalSize.tsx
│ ├── notifications
│ │ ├── alerts
│ │ │ ├── AlertDefault.tsx
│ │ │ └── AlertType.tsx
│ │ ├── global-alert
│ │ │ ├── GlobalAlertDefault.tsx
│ │ │ └── GlobalAlertTypes.tsx
│ │ ├── notifications
│ │ │ ├── NotificationDefault.tsx
│ │ │ ├── NotificationPlacement.tsx
│ │ │ └── NotificationType.tsx
│ │ └── well
│ │ │ ├── WellDefault.tsx
│ │ │ ├── WellFloating.tsx
│ │ │ ├── WellMultiline.tsx
│ │ │ └── WellRecessed.tsx
│ ├── pagination
│ │ ├── CursorDefault.tsx
│ │ ├── OffsetDefault.tsx
│ │ ├── OffsetGap.tsx
│ │ └── OffsetPadding.tsx
│ ├── pane
│ │ ├── PaneGrid.tsx
│ │ ├── PaneHorizontal.tsx
│ │ ├── PaneHorizontalCollapse.tsx
│ │ ├── PaneVertical.tsx
│ │ ├── PaneVerticalCollapse.tsx
│ │ └── SplitterButtonPosition.tsx
│ ├── table
│ │ ├── TableCaption.tsx
│ │ ├── TableCursorPagination.tsx
│ │ ├── TableDefault.tsx
│ │ ├── TableDraggable.tsx
│ │ ├── TableGroupedRows.tsx
│ │ ├── TableLoading.tsx
│ │ ├── TableOverflow.tsx
│ │ ├── TablePagination.tsx
│ │ ├── TableScroll.tsx
│ │ ├── TableSelectRows.tsx
│ │ ├── TableSize.tsx
│ │ ├── TableSort.tsx
│ │ ├── TableStripedRows.tsx
│ │ ├── TableTruncate.tsx
│ │ ├── TableVerticalScrolling.tsx
│ │ └── TableVirtualized.tsx
│ ├── tabs
│ │ ├── TabsDefault.tsx
│ │ ├── TabsDisabled.tsx
│ │ └── TabsVertical.tsx
│ ├── tags
│ │ ├── TagsAvatar.tsx
│ │ ├── TagsClose.tsx
│ │ ├── TagsColor.tsx
│ │ ├── TagsDefault.tsx
│ │ ├── TagsShape.tsx
│ │ ├── TagsSize.tsx
│ │ └── TagsWeight.tsx
│ ├── theme-provider
│ │ ├── ThemeProviderBranding.tsx
│ │ ├── ThemeProviderDefault.tsx
│ │ ├── ThemeProviderExtension.tsx
│ │ ├── ThemeProviderNesting.tsx
│ │ └── ThemeProviderTargeting.tsx
│ ├── tooltip-dialog
│ │ ├── TooltipDialogDefault.tsx
│ │ └── TooltipDialogPlacement.tsx
│ ├── tooltip
│ │ ├── TooltipDefault.tsx
│ │ ├── TooltipPlacement.tsx
│ │ ├── TooltipSize.tsx
│ │ └── TooltipType.tsx
│ ├── typography
│ │ ├── Blockquote.tsx
│ │ ├── Ellipsis.tsx
│ │ ├── Modifiers.tsx
│ │ ├── TypeScale.tsx
│ │ ├── code-block
│ │ │ ├── Default.tsx
│ │ │ ├── Diff.tsx
│ │ │ ├── Highlighted.tsx
│ │ │ ├── Language.tsx
│ │ │ ├── Light.tsx
│ │ │ ├── Numbered.tsx
│ │ │ └── Size.tsx
│ │ ├── code
│ │ │ ├── Color.tsx
│ │ │ ├── Default.tsx
│ │ │ └── Size.tsx
│ │ ├── lists
│ │ │ ├── Default.tsx
│ │ │ ├── Nesting.tsx
│ │ │ └── Size.tsx
│ │ ├── paragraph
│ │ │ ├── Default.tsx
│ │ │ └── Size.tsx
│ │ └── span
│ │ │ ├── Bold.tsx
│ │ │ ├── Hue.tsx
│ │ │ ├── Icon.tsx
│ │ │ ├── Monospace.tsx
│ │ │ └── StartIcon.tsx
│ └── utilities
│ │ ├── MenuArrowStyles.tsx
│ │ └── components.ts
├── icons
│ ├── components.svg
│ ├── content.svg
│ └── design.svg
├── layouts
│ ├── Home
│ │ ├── components
│ │ │ ├── Foundation.tsx
│ │ │ ├── HomeLink.tsx
│ │ │ ├── News.tsx
│ │ │ ├── Patterns.tsx
│ │ │ ├── Search.tsx
│ │ │ └── SectionCallout.tsx
│ │ └── index.tsx
│ ├── MaxWidth.tsx
│ ├── Root
│ │ ├── components
│ │ │ ├── Footer.tsx
│ │ │ ├── Header.tsx
│ │ │ ├── SearchInput.tsx
│ │ │ └── StyledNavigationLink.tsx
│ │ └── index.tsx
│ ├── Sidebar
│ │ ├── components
│ │ │ ├── DesktopSidebar.tsx
│ │ │ ├── MobileSidebar.tsx
│ │ │ └── NavItemTitle.tsx
│ │ └── index.tsx
│ └── Titled
│ │ ├── components
│ │ ├── Subtitle.tsx
│ │ └── TOC.tsx
│ │ └── index.tsx
└── pages
│ ├── 404.tsx
│ ├── components
│ ├── accordion.mdx
│ ├── alerts.mdx
│ ├── anchor.mdx
│ ├── avatar.mdx
│ ├── breadcrumbs.mdx
│ ├── button.mdx
│ ├── checkbox.mdx
│ ├── chrome.mdx
│ ├── code-block.mdx
│ ├── code.mdx
│ ├── color-picker.mdx
│ ├── color-scheme-provider.mdx
│ ├── color-swatch.mdx
│ ├── combobox.mdx
│ ├── date-picker.mdx
│ ├── dots.mdx
│ ├── draggable.mdx
│ ├── drawer.mdx
│ ├── file-upload.mdx
│ ├── global-alert.mdx
│ ├── grid.mdx
│ ├── icon-button.mdx
│ ├── index.mdx
│ ├── inline.mdx
│ ├── input-group.mdx
│ ├── input.mdx
│ ├── lists.mdx
│ ├── menu.mdx
│ ├── modal.mdx
│ ├── notifications.mdx
│ ├── pagination.mdx
│ ├── palette.mdx
│ ├── pane.mdx
│ ├── paragraph.mdx
│ ├── progress.mdx
│ ├── radio.mdx
│ ├── range.mdx
│ ├── select.mdx
│ ├── sheet.mdx
│ ├── skeleton.mdx
│ ├── span.mdx
│ ├── spinner.mdx
│ ├── split-button.mdx
│ ├── status-indicator.mdx
│ ├── stepper.mdx
│ ├── table.mdx
│ ├── tabs.mdx
│ ├── tags.mdx
│ ├── textarea.mdx
│ ├── theme-object.mdx
│ ├── theme-provider.mdx
│ ├── tiles.mdx
│ ├── timeline.mdx
│ ├── toggle-button.mdx
│ ├── toggle-icon-button.mdx
│ ├── toggle.mdx
│ ├── tooltip-dialog.mdx
│ ├── tooltip.mdx
│ ├── typography.mdx
│ ├── utilities.mdx
│ ├── versions.mdx
│ └── well.mdx
│ ├── content
│ └── index.mdx
│ ├── design
│ ├── color.mdx
│ ├── icons
│ │ ├── chrome-icons.mdx
│ │ ├── index.mdx
│ │ └── library.mdx
│ ├── index.mdx
│ └── palette.mdx
│ ├── index.tsx
│ └── patterns
│ ├── buttons.mdx
│ ├── copy.mdx
│ ├── drag-and-drop.mdx
│ ├── errors.mdx
│ ├── filters.mdx
│ ├── index.mdx
│ ├── loaders.mdx
│ ├── rich-text-editor.mdx
│ ├── save.mdx
│ └── tables
│ └── basic-formatting.mdx
├── static
├── _redirects
├── apple-touch-icon.png
├── browserconfig.xml
├── components
│ └── avatar
│ │ └── user.png
├── favicon.ico
├── google24fd052fab97d4cf.html
├── mask-icon.svg
├── og-image.png
├── tile-wide.png
└── tile.png
├── tsconfig.json
└── utils
├── color-scheme.js
├── deploy.mjs
├── typings
├── react.d.ts
├── remark-react.d.ts
├── smartquotes.d.ts
├── styled.d.ts
├── svg.d.ts
└── yml.d.ts
└── upgrade.js
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | /**
9 | * Disables Gatsby's built-in eslint-loader called by `gatsby develop`.
10 | * @see https://www.gatsbyjs.com/docs/how-to/custom-configuration/eslint/#disabling-eslint
11 | * Rules required by Gatsby for fast-refresh are automatcally applied.
12 | * @see https://github.com/gatsbyjs/gatsby/blob/gatsby%405.13.6/packages/gatsby/src/utils/webpack.config.js#L269
13 | * @see https://github.com/gatsbyjs/gatsby/blob/gatsby%405.13.6/packages/gatsby/src/utils/webpack-utils.ts#L820-L846
14 | * This does not interfere with this project ESLint V9's flat config.
15 | */
16 | module.exports = {};
17 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 |
2 | * @zendeskgarden/maintainers
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Expectations
2 |
3 |
6 |
7 | ## Reality
8 |
9 |
12 |
13 | ## Steps to Reproduce
14 |
15 | 1.
16 | 1.
17 | 1.
18 |
19 | ### Fine Print
20 |
21 | - URL:
22 | - Version:
23 | - Browsers: all
24 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
4 |
5 | ## Description
6 |
7 |
9 |
10 | ## Detail
11 |
12 |
13 |
14 |
15 |
16 | ## Checklist
17 |
18 | - [ ] :ok_hand: website updates are Garden Designer approved (add the designer as a reviewer)
19 | - [ ] :black_nib: copy updates are approved (add the content strategist as a reviewer)
20 | - [ ] :link: considered opportunities for adding cross-reference URLs (grep for keywords)
21 | - [ ] :wheelchair: analyzed via [axe](https://www.deque.com/axe/) and evaluated using VoiceOver
22 | - [ ] :memo: tested in Chrome, Firefox, Safari, Edge
23 |
--------------------------------------------------------------------------------
/.github/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["config:recommended", "group:allNonMajor"],
3 | "rebaseWhen": "behind-base-branch",
4 | "schedule": ["on Monday every 9 weeks of the year starting on the 8th week"],
5 | "postUpdateOptions": ["npmDedupe"]
6 | }
7 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deployment
2 |
3 | on:
4 | # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
5 | workflow_dispatch:
6 | inputs:
7 | branch:
8 | description: 'The branch to deploy'
9 | default: 'main'
10 | required: false
11 | type: string
12 |
13 | env:
14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 | NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
16 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
17 | FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
18 |
19 | jobs:
20 | deploy:
21 | runs-on: ubuntu-latest
22 | environment: production
23 | steps:
24 | - uses: actions/checkout@v4
25 | with:
26 | ref: ${{ github.event.inputs.branch }}
27 | submodules: true
28 |
29 | - uses: actions/setup-node@v4
30 | with:
31 | node-version-file: '.nvmrc'
32 | cache: 'npm'
33 |
34 | - name: build
35 | run: npm ci
36 |
37 | - name: test
38 | run: npm test
39 |
40 | - name: deploy
41 | run: utils/deploy.js
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 | node_modules
3 | public
4 | src/gatsby-types.d.ts
5 | yarn.lock
6 | *.log
7 | .cache/
8 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "react-components"]
2 | path = react-components
3 | url = git@github.com:zendeskgarden/react-components.git
4 |
--------------------------------------------------------------------------------
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npm exec lint-staged
2 |
--------------------------------------------------------------------------------
/.lintstagedrc:
--------------------------------------------------------------------------------
1 | {
2 | "*.{js,ts,tsx}": ["stylelint", "eslint", "prettier --write"],
3 | "*.{md,mdx}": ["markdownlint", "prettier --write"],
4 | "**/package.json": ["prettier-package-json --write"]
5 | }
6 |
--------------------------------------------------------------------------------
/.markdownlintrc:
--------------------------------------------------------------------------------
1 | {
2 | "default": true,
3 | "blanks-around-fences": false,
4 | "code-block-style": false,
5 | "first-line-h1": false,
6 | "first-header-h1": false,
7 | "no-duplicate-heading": {
8 | "siblings_only": true
9 | },
10 | "no-emphasis-as-heading": false,
11 | "no-inline-html": false,
12 | "no-space-in-code": false,
13 | "no-space-in-emphasis": false,
14 | "no-trailing-punctuation": false,
15 | "MD013": {
16 | "line_length": 120,
17 | "tables": false
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | legacy-peer-deps=true
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | lts/*
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .cache
2 | package.json
3 | package-lock.json
4 | public
5 | react-components
6 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 100,
3 | "singleQuote": true,
4 | "trailingComma": "none",
5 | "arrowParens": "avoid"
6 | }
7 |
--------------------------------------------------------------------------------
/.stylelintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["@zendeskgarden/stylelint-config"],
3 | "customSyntax": "postcss-styled-syntax",
4 | "rules": {
5 | "declaration-empty-line-before": null,
6 | "keyframes-name-pattern": null,
7 | "at-rule-empty-line-before": null,
8 | "value-keyword-case": ["lower", { "ignoreKeywords": ["dummyValue"] }],
9 | "block-no-empty": null,
10 | "selector-type-no-unknown": null,
11 | "property-no-unknown": null
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | module.exports = {
9 | presets: ['@babel/preset-react']
10 | };
11 |
--------------------------------------------------------------------------------
/content/nav/content.yml:
--------------------------------------------------------------------------------
1 | - title: Introduction
2 | items:
3 | - id: /content
4 | title: Overview
5 |
--------------------------------------------------------------------------------
/content/nav/design.yml:
--------------------------------------------------------------------------------
1 | - title: Introduction
2 | items:
3 | - id: /design
4 | title: Overview
5 | - title: Foundations
6 | items:
7 | - id: /design/color
8 | title: Color
9 | - id: /design/palette
10 | title: Palette
11 | - title: Icons
12 | items:
13 | - id: /design/icons
14 | title: Overview
15 | - id: /design/icons/library
16 | title: Library
17 | - id: /design/icons/chrome-icons
18 | title: Chrome icons
19 |
--------------------------------------------------------------------------------
/content/nav/patterns.yml:
--------------------------------------------------------------------------------
1 | - title: Introduction
2 | items:
3 | - id: /patterns
4 | title: Overview
5 | - title: Patterns
6 | items:
7 | - title: Buttons
8 | id: /patterns/buttons
9 | - title: Copy
10 | id: /patterns/copy
11 | - title: Drag and drop
12 | id: /patterns/drag-and-drop
13 | - title: Error handling
14 | id: /patterns/errors
15 | - title: Filters
16 | id: /patterns/filters
17 | - title: Loaders
18 | id: /patterns/loaders
19 | - title: Rich-text editor
20 | id: /patterns/rich-text-editor
21 | - title: Save
22 | id: /patterns/save
23 | - title: Tables
24 | items:
25 | - id: /patterns/tables/basic-formatting
26 | title: Basic formatting
27 |
--------------------------------------------------------------------------------
/content/news/news.yml:
--------------------------------------------------------------------------------
1 | - title: Design System Resources
2 | author: Vedran Arnautovic
3 | author_url: https://medium.com/@vedranio
4 | url: https://medium.com/zendesk-creative-blog/design-system-resources-b9119ddf9790
5 |
6 | - title: React containers, some assembly required
7 | author: Ryan Seddon
8 | author_url: https://medium.com/@ryanseddon
9 | url: https://medium.com/zendesk-engineering/react-containers-some-assembly-required-43dd54d879a8
10 |
11 | - title: There's a new shape in town
12 | author: Ginny Wood
13 | author_url: https://medium.com/@ginny_wood
14 | url: https://medium.com/zendesk-creative-blog/theres-a-new-shape-in-town-f45a3a5906ae
15 |
16 | - title: 6 tips for writing effective design system documentation
17 | author: Ross Moody
18 | author_url: https://medium.com/@moodyrooster
19 | url: https://medium.com/zendesk-creative-blog/6-tips-for-writing-effective-design-system-documentation-11c35b44169
20 |
21 | - title: Designing for inclusivity
22 | author: Allison Shaw
23 | author_url: https://www.invisionapp.com/inside-design/author/allison-shaw/
24 | url: https://www.invisionapp.com/inside-design/designing-for-inclusivity/
25 |
--------------------------------------------------------------------------------
/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Provider, Layout } from './src/components';
10 |
11 | export const wrapRootElement = ({ props, element }) => {element} ;
12 |
13 | export const wrapPageElement = ({ props, element }) => {element} ;
14 |
--------------------------------------------------------------------------------
/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Provider, Layout } from './src/components';
10 | import __html from '!!raw-loader!./utils/color-scheme.js';
11 |
12 | export const wrapRootElement = ({ props, element }) => {element} ;
13 |
14 | export const wrapPageElement = ({ props, element }) => {element} ;
15 |
16 | export const onRenderBody = ({
17 | setHtmlAttributes,
18 | setHeadComponents,
19 | setPreBodyComponents,
20 | setPostBodyComponents
21 | }) => {
22 | setHtmlAttributes({ lang: 'en' });
23 |
24 | const version = 2;
25 |
26 | setHeadComponents([
27 |
32 | ]);
33 |
34 | /* eslint-disable-next-line react/no-danger */
35 | setPreBodyComponents([]);
36 |
37 | setPostBodyComponents([
38 |
43 | ]);
44 | };
45 |
--------------------------------------------------------------------------------
/graphql.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | module.exports = require('./.cache/typegen/graphql.config.json');
9 |
--------------------------------------------------------------------------------
/plugins/gatsby-algolia-docsearch/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | const React = require('react');
9 |
10 | exports.onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => {
11 | setHeadComponents([
12 |
17 | ]);
18 |
19 | setPostBodyComponents([
20 |
25 | ]);
26 | };
27 |
--------------------------------------------------------------------------------
/plugins/gatsby-algolia-docsearch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-algolia-docsearch",
4 | "version": "0.0.1"
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/gatsby-remark-figma-assets/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-remark-figma-assets",
4 | "version": "0.0.1",
5 | "main": "index.mjs"
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/gatsby-source-garden-content/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-source-garden-content",
4 | "version": "0.0.0"
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/gatsby-source-garden-docgen/README.md:
--------------------------------------------------------------------------------
1 | ## Usage
2 |
3 | ```graphql
4 | query {
5 | package: gardenReactPackage {
6 | version
7 | name
8 | description
9 | }
10 | components: gardenReactComponent {
11 | name
12 | description
13 | extends
14 | props
15 | }
16 | subcomponents: gardenReactComponent {
17 | name
18 | description
19 | extends
20 | props
21 | }
22 | }
23 | ```
24 |
--------------------------------------------------------------------------------
/plugins/gatsby-source-garden-docgen/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-source-garden-docgen",
4 | "version": "0.0.0"
5 | }
6 |
--------------------------------------------------------------------------------
/plugins/gatsby-transformer-garden-svg/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "gatsby-transformer-garden-svg",
4 | "version": "0.0.1"
5 | }
6 |
--------------------------------------------------------------------------------
/src/components/GlobalStyles.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import { createGlobalStyle } from 'styled-components';
9 |
10 | /**
11 | * Global styling
12 | */
13 | import '@zendeskgarden/css-bedrock/dist/index.css';
14 |
15 | /**
16 | * Ensure Gatsby wrapping nodes are full height
17 | */
18 | export const GlobalStyles = createGlobalStyle`
19 | * {
20 | -ms-overflow-style: -ms-autohiding-scrollbar;
21 | }
22 |
23 | /* see: https://github.com/gatsbyjs/gatsby/issues/37049 */
24 | main a > div:has(svg) {
25 | display: inherit;
26 | position: absolute;
27 | transform: translate(-50%, -10%);
28 | }
29 | `;
30 |
--------------------------------------------------------------------------------
/src/components/Layout.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { PageProps } from 'gatsby';
10 | import RootLayout from 'layouts/Root';
11 | import { SidebarLayout } from 'layouts/Sidebar';
12 | import TitledLayout from 'layouts/Titled';
13 | import { IPageData, IPageContext } from './types';
14 | import { GlobalStyles } from './GlobalStyles';
15 | import { IHeading } from 'layouts/Titled/components/TOC';
16 |
17 | export const Layout: React.FC> = ({
18 | data,
19 | pageContext,
20 | children
21 | }) => {
22 | if (!pageContext?.slug) return children;
23 |
24 | let navigation = [];
25 | let toc: IHeading[] = [];
26 |
27 | if (data?.mdx) {
28 | navigation = data.mdx.navigation || [];
29 | toc = data.mdx.tableOfContents.items || [];
30 | }
31 |
32 | const frontmatter = pageContext.frontmatter || {};
33 |
34 | return (
35 | <>
36 |
37 |
38 |
39 |
40 | {children}
41 |
42 |
43 |
44 | >
45 | );
46 | };
47 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Alert.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import {
11 | Alert as GardenAlert,
12 | IAlertProps as IGardenAlertProps
13 | } from '@zendeskgarden/react-notifications';
14 |
15 | const StyledAlert = styled(GardenAlert)`
16 | margin-bottom: ${p => p.theme.space.xl};
17 | `;
18 |
19 | interface IAlertProps extends IGardenAlertProps {
20 | title: string;
21 | }
22 |
23 | export const Alert = ({ children, title, ...props }: IAlertProps) => (
24 |
25 | {!!title && {title} }
26 | {children}
27 |
28 | );
29 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Anchor.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import styled from 'styled-components';
9 | import { focusStyles, mediaQuery } from '@zendeskgarden/react-theming';
10 | import { Anchor } from '@zendeskgarden/react-buttons';
11 | import { math } from 'polished';
12 |
13 | export const StyledAnchor = styled(Anchor).attrs(props => ({
14 | /* eslint-disable-next-line prefer-named-capture-group */
15 | isExternal: props.href && !/^(#|\/(?!\/))/u.test(props.href)
16 | }))`
17 | &.anchor.before {
18 | position: relative;
19 | margin-left: -${p => math(`${p.theme.space.xs} * 2 + ${p.theme.iconSizes.md}`)};
20 | border-radius: ${p => p.theme.borderRadii.md};
21 | padding: 0 ${p => p.theme.iconSizes.md};
22 | color: transparent;
23 |
24 | ${({ theme }) =>
25 | focusStyles({
26 | theme,
27 | inset: true,
28 | styles: { outlineColor: 'transparent', color: 'inherit' }
29 | })}
30 |
31 | ${p => mediaQuery('down', 'md', p.theme)} {
32 | margin-left: -${p => math(`${p.theme.space.xxs} * 2 + ${p.theme.iconSizes.md}`)};
33 | padding: 0 ${p => p.theme.space.sm};
34 | }
35 |
36 | & svg {
37 | position: absolute;
38 | top: 50%;
39 | transform: translate(-50%, -50%);
40 | visibility: visible;
41 | }
42 | }
43 | `;
44 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/CodeBlock.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import styled from 'styled-components';
9 | import { CodeBlock } from '@zendeskgarden/react-typography';
10 |
11 | export const StyledCodeBlock = styled(CodeBlock).attrs(p => ({
12 | language: p.className ? p.className.replace(/language-/u, '') : undefined,
13 | isLight: p.theme.colors.base === 'light',
14 | containerProps: {
15 | style: { margin: `${p.theme.space.md} 0` }
16 | }
17 | }))`
18 | border-radius: ${p => p.theme.borderRadii.md};
19 | `;
20 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/CodeExample/assets/codesandbox-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Component.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD, Span } from '@zendeskgarden/react-typography';
10 | import { IComponentData } from '../../../components/types';
11 | import { StyledParagraph as Paragraph } from './Typography';
12 | import { Markdown } from './Markdown';
13 |
14 | export const Component: React.FC<{
15 | components: IComponentData[];
16 | componentName: string;
17 | isDescribed: boolean;
18 | }> = ({ components, componentName, isDescribed }) => {
19 | const component = components.find(c => c.name.toLowerCase() === componentName.toLowerCase())!;
20 |
21 | return (
22 | <>
23 | {!!component.extends && (
24 |
25 | Extends{' '}
26 |
27 | {component.extends}
28 |
29 |
30 | )}
31 | {!!isDescribed && (
32 |
33 | {component.description}
34 |
35 | )}
36 | >
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/ImageFigure.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useContext } from 'react';
9 | import styled, { ThemeContext } from 'styled-components';
10 | import { GatsbyImage, IGatsbyImageData } from 'gatsby-plugin-image';
11 | import { getColor } from '@zendeskgarden/react-theming';
12 |
13 | const StyledCaption = styled.figcaption`
14 | margin-bottom: ${props => props.theme.space.md};
15 | text-align: center;
16 | color: ${props => getColor({ theme: props.theme, variable: 'foreground.subtle' })};
17 | `;
18 |
19 | interface IImageFigure {
20 | caption: string;
21 | imageAlt: string;
22 | imageSource: IGatsbyImageData;
23 | }
24 |
25 | export const ImageFigure: React.FC = props => {
26 | const theme = useContext(ThemeContext);
27 |
28 | return (
29 |
30 |
39 | {props.caption}
40 |
41 | );
42 | };
43 |
44 | export const ImageFigCaption = StyledCaption;
45 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Markdown.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import MD, { Options } from 'react-markdown';
10 | import { Code } from '@zendeskgarden/react-typography';
11 | import { StyledAnchor as Anchor } from './Anchor';
12 | import { UL, OL, LI } from './Lists';
13 | import { StyledTable as Table, TR, TH, TD, TBody, THead } from './Table';
14 | import {
15 | StyledH2,
16 | StyledH3,
17 | StyledH4,
18 | StyledH5,
19 | StyledH6,
20 | StyledBlockquote,
21 | StyledHr,
22 | StyledParagraph,
23 | StyledStrong,
24 | StyledEmphasis
25 | } from './Typography';
26 |
27 | export const COMPONENTS = {
28 | h2: StyledH2,
29 | h3: StyledH3,
30 | h4: StyledH4,
31 | h5: StyledH5,
32 | h6: StyledH6,
33 | p: StyledParagraph,
34 | a: Anchor,
35 | blockquote: StyledBlockquote,
36 | hr: StyledHr,
37 | strong: StyledStrong,
38 | em: StyledEmphasis,
39 | code: Code,
40 | ul: UL,
41 | ol: OL,
42 | li: LI,
43 | table: Table,
44 | thead: THead,
45 | tbody: TBody,
46 | tr: TR,
47 | td: TD,
48 | th: TH
49 | } as any;
50 |
51 | export const Markdown: React.FC = ({ children }) => (
52 | {children}
53 | );
54 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/ObjectBlock.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { PropsWithChildren } from 'react';
9 | import { StyledCodeBlock as CodeBlock } from './CodeBlock';
10 |
11 | const replacer = (key: string, value: unknown) => {
12 | let retVal = value;
13 |
14 | if (typeof value === 'function') {
15 | const fn = value.toString();
16 | const start = fn.indexOf('(');
17 | const end = fn.indexOf(')') + 1;
18 |
19 | retVal = `${fn.substring(start, end)} => expression`;
20 | }
21 |
22 | return retVal;
23 | };
24 |
25 | interface IObjectBlockProps extends PropsWithChildren {
26 | replacementPattern?: string;
27 | replacementValue?: string;
28 | }
29 |
30 | export const ObjectBlock: React.FC = props => {
31 | let code = JSON.stringify(props.children, replacer, ' ');
32 |
33 | if (props.replacementPattern && props.replacementValue) {
34 | code = code.replace(props.replacementPattern, props.replacementValue);
35 | }
36 |
37 | return {code} ;
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Table.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { createContext, useContext } from 'react';
9 | import styled from 'styled-components';
10 | import { Table } from '@zendeskgarden/react-tables';
11 |
12 | const TableHeadContext = createContext(false);
13 |
14 | export const StyledTable = styled(Table).attrs({ isReadOnly: true })`
15 | margin-bottom: ${p => p.theme.space.xl};
16 | `;
17 |
18 | export const TBody = Table.Body;
19 | export const TH = Table.HeaderCell;
20 | export const TD = Table.Cell;
21 |
22 | export const THead: React.FC = props => {
23 | return (
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | /**
31 | * Markdown doesn't differentiate between header and body rows.
32 | * This renders the correct component based on the parent element.
33 | */
34 | export const TR: React.FC = props => {
35 | const isWithinHead = useContext(TableHeadContext);
36 |
37 | if (isWithinHead) {
38 | return ;
39 | }
40 |
41 | return ;
42 | };
43 |
--------------------------------------------------------------------------------
/src/components/MarkdownProvider/components/Usage.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { PropsWithChildren } from 'react';
9 | import { css } from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { StyledH4 as Title } from './Typography';
12 |
13 | export const Use: React.FC = props => (
14 |
15 | Used for this
16 | {props.children}
17 |
18 | );
19 |
20 | export const Misuse: React.FC = props => (
21 |
22 | Not for this
23 | {props.children}
24 |
25 | );
26 |
27 | export const Usage: React.FC = props => (
28 | p.theme.space.base * 7}px;
31 | `}
32 | >
33 | {props.children}
34 |
35 | );
36 |
--------------------------------------------------------------------------------
/src/components/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | export { Provider } from './Provider';
9 | export { Layout } from './Layout';
10 | export { SEO } from './SEO';
11 |
--------------------------------------------------------------------------------
/src/components/types.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import { IHeading } from 'layouts/Titled/components/TOC';
9 |
10 | interface IPropData {
11 | description: string;
12 | defaultValue: string;
13 | required: boolean;
14 | type: string;
15 | params?: Record;
16 | returns?: string;
17 | }
18 |
19 | export interface IComponentData {
20 | name: string;
21 | description: string;
22 | extends: string;
23 | props: Record;
24 | }
25 |
26 | export interface IPageData {
27 | mdx?: {
28 | id: string;
29 | excerpt: any;
30 | body: any;
31 | navigation: any;
32 | tableOfContents: IHeading;
33 | package?: {
34 | version: string;
35 | name: string;
36 | description: string;
37 | };
38 | components: [IComponentData];
39 | };
40 | }
41 |
42 | export interface IPageContext {
43 | frontmatter?: {
44 | title?: string;
45 | description?: string;
46 | };
47 | slug?: string;
48 | group?: string;
49 | }
50 |
--------------------------------------------------------------------------------
/src/examples/accordions/stepper/StepperIcons.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Stepper } from '@zendeskgarden/react-accordions';
10 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/12/leaf-stroke.svg';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 | }>Make good use of your location
19 |
20 |
21 | }>Plan your garden's layout
22 |
23 |
24 | }>Buy great seeds
25 |
26 |
27 |
28 |
29 | );
30 |
31 | export default Example;
32 |
--------------------------------------------------------------------------------
/src/examples/anchor/AnchorDanger.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Anchor } from '@zendeskgarden/react-buttons';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Leave without watering
17 |
18 |
19 |
20 | );
21 |
22 | export default Example;
23 |
--------------------------------------------------------------------------------
/src/examples/anchor/AnchorDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Anchor } from '@zendeskgarden/react-buttons';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 | Enter the Garden
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/anchor/AnchorExternal.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Anchor } from '@zendeskgarden/react-buttons';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Learn about weed identification
17 |
18 |
19 |
20 | );
21 |
22 | export default Example;
23 |
--------------------------------------------------------------------------------
/src/examples/anchor/AnchorWithoutUnderline.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Anchor } from '@zendeskgarden/react-buttons';
11 | import { UnorderedList } from '@zendeskgarden/react-typography';
12 | import { Grid } from '@zendeskgarden/react-grid';
13 |
14 | const StyledListItem = styled(UnorderedList.Item)`
15 | list-style: none;
16 | `;
17 |
18 | const Example = () => (
19 |
20 |
21 |
22 |
23 |
24 | Asparagus
25 |
26 |
27 |
28 |
29 | Kale
30 |
31 |
32 |
33 |
34 | Lettuce
35 |
36 |
37 |
38 |
39 |
40 | );
41 |
42 | export default Example;
43 |
--------------------------------------------------------------------------------
/src/examples/avatar/AvatarShape.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { PALETTE } from '@zendeskgarden/react-theming';
10 | import { Avatar } from '@zendeskgarden/react-avatars';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 | import { ReactComponent as ZendeskIcon } from '@zendeskgarden/svg-icons/src/26/zendesk.svg';
13 | import { ReactComponent as UserIcon } from '@zendeskgarden/svg-icons/src/16/user-solo-stroke.svg';
14 |
15 | const Example = () => (
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/avatar/AvatarStatus.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Avatar } from '@zendeskgarden/react-avatars';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { ReactComponent as UserIcon } from '@zendeskgarden/svg-icons/src/16/user-solo-stroke.svg';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/avatar/AvatarType.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Avatar } from '@zendeskgarden/react-avatars';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { ReactComponent as UserIcon } from '@zendeskgarden/svg-icons/src/16/user-solo-stroke.svg';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | ZD
28 |
29 |
30 |
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/avatar/StatusIndicatorCaption.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { StatusIndicator } from '@zendeskgarden/react-avatars';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Foraging for mushrooms
17 |
18 |
19 |
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/avatar/StatusIndicatorDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { StatusIndicator } from '@zendeskgarden/react-avatars';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Offline
17 |
18 |
19 |
20 | );
21 |
22 | export default Example;
23 |
--------------------------------------------------------------------------------
/src/examples/avatar/StatusIndicatorSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { StatusIndicator } from '@zendeskgarden/react-avatars';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Offline
17 |
18 |
19 |
20 |
21 | Offline
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/breadcrumbs/BreadcrumbsDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Anchor } from '@zendeskgarden/react-buttons';
10 | import { Span } from '@zendeskgarden/react-typography';
11 | import { Breadcrumb } from '@zendeskgarden/react-breadcrumbs';
12 | import { Grid } from '@zendeskgarden/react-grid';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 | Flowers
20 |
21 |
22 | Roses
23 |
24 | Floribunda
25 |
26 |
27 |
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonDanger.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => (
13 |
14 |
15 | Default
16 |
17 |
18 |
19 | Primary
20 |
21 |
22 |
23 |
24 | Basic
25 |
26 |
27 |
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => (
13 |
14 |
15 | Button
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => (
13 |
14 |
15 | Disabled
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonMedia.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { ReactComponent as ChevronIcon } from '@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 | Media
22 |
23 |
24 |
25 |
26 | Media
27 |
28 |
29 |
30 |
31 |
32 |
33 | );
34 |
35 | export default Example;
36 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonSizes.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => (
13 |
14 |
15 | Small
16 |
17 |
18 | Default
19 |
20 |
21 | Large
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonStretched.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Button } from '@zendeskgarden/react-buttons';
12 |
13 | const StyledRow = styled(Grid.Row)`
14 | margin-top: ${p => p.theme.space.md};
15 | `;
16 |
17 | const Example = () => (
18 | <>
19 |
20 |
21 | Stretched
22 |
23 |
24 |
25 |
26 |
27 | Also stretched
28 |
29 |
30 |
31 | >
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/button/ButtonTypes.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => (
13 |
14 |
15 | Default
16 |
17 |
18 | Primary
19 |
20 |
21 | Basic
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonDanger.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { Tooltip } from '@zendeskgarden/react-tooltips';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | );
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { Tooltip } from '@zendeskgarden/react-tooltips';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonShapes.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { Tooltip } from '@zendeskgarden/react-tooltips';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonSizes.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { Tooltip } from '@zendeskgarden/react-tooltips';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | );
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/button/IconButtonTypes.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { Tooltip } from '@zendeskgarden/react-tooltips';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | );
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/button/ToggleButtonDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { ToggleButton } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => {
13 | const [pressed, setPressed] = useState(false);
14 |
15 | return (
16 |
17 |
18 | {
21 | setPressed(!pressed);
22 | }}
23 | >
24 | Sprinklers
25 |
26 |
27 |
28 | );
29 | };
30 |
31 | export default Example;
32 |
--------------------------------------------------------------------------------
/src/examples/button/ToggleButtonDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { ToggleButton } from '@zendeskgarden/react-buttons';
11 |
12 | const Example = () => {
13 | const [pressed, setPressed] = useState(false);
14 |
15 | return (
16 |
17 |
18 | {
22 | setPressed(!pressed);
23 | }}
24 | >
25 | Disabled
26 |
27 |
28 |
29 | );
30 | };
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/button/ToggleIconButtonDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { ToggleIconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as StrokeIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { ReactComponent as FillIcon } from '@zendeskgarden/svg-icons/src/16/leaf-fill.svg';
13 | import { Tooltip } from '@zendeskgarden/react-tooltips';
14 |
15 | const Example = () => {
16 | const [pressed, setPressed] = useState(false);
17 |
18 | return (
19 |
20 |
21 |
22 | {
26 | setPressed(!pressed);
27 | }}
28 | >
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/button/ToggleIconButtonDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { ToggleIconButton } from '@zendeskgarden/react-buttons';
11 | import { ReactComponent as StrokeIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
12 | import { ReactComponent as FillIcon } from '@zendeskgarden/svg-icons/src/16/leaf-fill.svg';
13 |
14 | const Example = () => {
15 | const [pressed, setPressed] = useState(false);
16 |
17 | return (
18 |
19 |
20 | {
25 | setPressed(!pressed);
26 | }}
27 | >
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | );
36 | };
37 |
38 | export default Example;
39 |
--------------------------------------------------------------------------------
/src/examples/color-picker/ColorPickerDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { PALETTE } from '@zendeskgarden/react-theming';
10 | import { ColorPicker } from '@zendeskgarden/react-colorpickers';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 | );
20 |
21 | export default Example;
22 |
--------------------------------------------------------------------------------
/src/examples/color-picker/ColorPickerDialogDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { ColorPickerDialog } from '@zendeskgarden/react-colorpickers';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { PALETTE } from '@zendeskgarden/react-theming';
12 |
13 | const Example = () => (
14 |
15 |
16 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/color-picker/ColorPickerOpaque.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { PALETTE } from '@zendeskgarden/react-theming';
10 | import { ColorPicker } from '@zendeskgarden/react-colorpickers';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 | );
20 |
21 | export default Example;
22 |
--------------------------------------------------------------------------------
/src/examples/combobox/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Choose a vegetable
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/combobox/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 |
19 |
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/combobox/Grouped.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, OptGroup, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Fruits and vegetables
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/combobox/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Accessibly hidden label
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/combobox/Hint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 | Choose your favorite plant
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/combobox/SelectOnly.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Combobox, Field, Option } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Houseplant
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/date-picker/DatePickerCustom.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { DatePicker } from '@zendeskgarden/react-datepickers';
10 | import { Field, Input } from '@zendeskgarden/react-forms';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => {
14 | const [state, setState] = useState(new Date());
15 |
16 | const dateFormatter = new Intl.DateTimeFormat('en-US', {
17 | month: '2-digit',
18 | day: '2-digit',
19 | year: 'numeric'
20 | });
21 |
22 | return (
23 |
24 |
25 |
26 | Select a date
27 | dateFormatter.format(date)}
31 | >
32 |
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/date-picker/DatePickerDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { DatePicker } from '@zendeskgarden/react-datepickers';
10 | import { Field, Input } from '@zendeskgarden/react-forms';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => {
14 | const [state, setState] = useState(new Date());
15 |
16 | return (
17 |
18 |
19 |
20 | Select a date
21 |
22 |
23 |
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/date-picker/DatePickerLocalization.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { DatePicker } from '@zendeskgarden/react-datepickers';
10 | import { Field, Input } from '@zendeskgarden/react-forms';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => {
14 | const [state, setState] = useState(new Date());
15 |
16 | return (
17 |
18 |
19 |
20 | Select a date
21 | Arabic localization
22 |
23 |
24 |
25 |
26 |
27 |
28 | );
29 | };
30 |
31 | export default Example;
32 |
--------------------------------------------------------------------------------
/src/examples/date-picker/DatePickerSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import styled from 'styled-components';
10 | import { mediaQuery } from '@zendeskgarden/react-theming';
11 | import { DatePicker } from '@zendeskgarden/react-datepickers';
12 | import { Field, Input } from '@zendeskgarden/react-forms';
13 | import { Grid } from '@zendeskgarden/react-grid';
14 |
15 | const StyledCol = styled(Grid.Col)`
16 | ${p => mediaQuery('down', 'xs', p.theme)} {
17 | margin-top: ${p => p.theme.space.sm};
18 | }
19 | `;
20 |
21 | const Example = () => {
22 | const [state, setState] = useState(new Date());
23 |
24 | return (
25 |
26 |
27 |
28 | Default
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Compact
37 |
38 |
39 |
40 |
41 |
42 |
43 | );
44 | };
45 |
46 | export default Example;
47 |
--------------------------------------------------------------------------------
/src/examples/design/icons/IconStyles.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { MD } from '@zendeskgarden/react-typography';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 | import { ReactComponent as LeafStrokeIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
13 | import { ReactComponent as LeafFillIcon } from '@zendeskgarden/svg-icons/src/16/leaf-fill.svg';
14 | import { getColor } from '@zendeskgarden/react-theming';
15 |
16 | const StyledCol = styled(Grid.Col)`
17 | text-align: center;
18 | color: ${p => getColor({ theme: p.theme, variable: 'foreground.subtle' })};
19 | `;
20 |
21 | const Example = () => {
22 | return (
23 |
24 |
25 |
26 | Stroke (default)
27 |
28 |
29 |
30 | Fill
31 |
32 |
33 | );
34 | };
35 |
36 | export default Example;
37 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableBare.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Draggable } from '@zendeskgarden/react-draggable';
12 | import { mediaQuery } from '@zendeskgarden/react-theming';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 |
24 |
25 | Orange
26 |
27 |
28 |
29 |
30 |
31 | Orange
32 |
33 |
34 |
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Draggable } from '@zendeskgarden/react-draggable';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Apple
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Draggable } from '@zendeskgarden/react-draggable';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Pear
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableListDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { MD } from '@zendeskgarden/react-typography';
11 | import { Draggable, DraggableList } from '@zendeskgarden/react-draggable';
12 | import styled from 'styled-components';
13 |
14 | const items = [
15 | { id: '1', value: 'Pear' },
16 | { id: '2', value: 'Orange' },
17 | { id: '3', value: 'Grapes' },
18 | { id: '4', value: 'Strawberries' }
19 | ];
20 |
21 | const StyledHeading = styled(MD)`
22 | margin-bottom: ${p => p.theme.space.xs};
23 | `;
24 |
25 | const Example = () => (
26 |
27 |
28 |
29 | Favorites
30 |
31 |
32 | {items.map(item => (
33 |
34 |
35 |
36 | {item.value}
37 |
38 |
39 | ))}
40 |
41 |
42 |
43 | );
44 |
45 | export default Example;
46 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableListHorizontal.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { MD } from '@zendeskgarden/react-typography';
11 | import { Draggable, DraggableList } from '@zendeskgarden/react-draggable';
12 | import styled from 'styled-components';
13 |
14 | const items = [
15 | { id: '1', value: 'Pear' },
16 | { id: '2', value: 'Orange' },
17 | { id: '3', value: 'Grapes' }
18 | ];
19 |
20 | const StyledHeading = styled(MD)`
21 | margin-bottom: ${p => p.theme.space.xs};
22 | `;
23 |
24 | const Example = () => (
25 |
26 |
27 |
28 | Favorites
29 |
30 |
31 | {items.map(item => (
32 |
33 |
34 |
35 | {item.value}
36 |
37 |
38 | ))}
39 |
40 |
41 |
42 | );
43 |
44 | export default Example;
45 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggablePlaceholder.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { MD } from '@zendeskgarden/react-typography';
11 | import { Draggable, DraggableList } from '@zendeskgarden/react-draggable';
12 | import styled from 'styled-components';
13 |
14 | const items = [
15 | { id: '1', value: 'Pear' },
16 | { id: '2', value: 'Orange', isPlaceholder: true },
17 | { id: '3', value: 'Grapes' },
18 | { id: '4', value: 'Strawberries' }
19 | ];
20 |
21 | const StyledHeading = styled(MD)`
22 | margin-bottom: ${p => p.theme.space.xs};
23 | `;
24 |
25 | const Example = () => (
26 |
27 |
28 |
29 | Favorites
30 |
31 |
32 | {items.map(item => (
33 |
34 |
35 |
36 | {item.value}
37 |
38 |
39 | ))}
40 |
41 |
42 |
43 | );
44 |
45 | export default Example;
46 |
--------------------------------------------------------------------------------
/src/examples/draggable/DraggableSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Draggable } from '@zendeskgarden/react-draggable';
12 | import { mediaQuery } from '@zendeskgarden/react-theming';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 |
24 |
25 | Raspberry
26 |
27 |
28 |
29 |
30 |
31 | Raspberry
32 |
33 |
34 |
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/forms/checkbox/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Checkbox } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Needs indirect light
18 |
19 |
20 |
21 |
22 | Prefers moist soil
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/checkbox/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Checkbox } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Accessibly hidden label one
18 |
19 |
20 |
21 |
22 | Accessibly hidden label two
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/checkbox/Hint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Field, Checkbox } from '@zendeskgarden/react-forms';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const StyledField = styled(Field)`
14 | margin-top: ${p => p.theme.space.xs};
15 | `;
16 |
17 | const Example = () => (
18 |
19 |
20 |
21 |
22 | Pest resistant
23 | Has natural resistance to bugs and animals
24 |
25 |
26 |
27 |
28 | Needs direct light
29 | Thrives in warm temperatures with lots of sun
30 |
31 |
32 |
33 |
34 | );
35 |
36 | export default Example;
37 |
--------------------------------------------------------------------------------
/src/examples/forms/checkbox/RegularWeightLabel.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Checkbox } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Pest resistant
18 |
19 |
20 |
21 |
22 | Needs direct light
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/checkbox/Validation.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Field, Checkbox } from '@zendeskgarden/react-forms';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const StyledField = styled(Field)`
14 | margin-top: ${p => p.theme.space.xs};
15 | `;
16 |
17 | const Example = () => (
18 |
19 |
20 |
21 |
22 | Pest resistant
23 |
24 | Safe for outdoor beds
25 |
26 |
27 |
28 | Needs direct light
29 |
30 | Requires 4 hours of sun per day
31 |
32 |
33 |
34 | Drought-tolerant
35 |
36 | Not appropriate for greenhouse
37 |
38 |
39 |
40 | );
41 |
42 | export default Example;
43 |
--------------------------------------------------------------------------------
/src/examples/forms/file-upload/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, FileUpload, FileList, File } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Upload a photo of your ailing cactus
17 | Choose a file or drag and drop here
18 |
19 |
20 | prickly-pear.png
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/forms/file-upload/Validation.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { File } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 | Rose.png
16 |
17 |
18 | Thorn.txt
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/input-group/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, InputGroup, Input } from '@zendeskgarden/react-forms';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 | Plant name generator
18 |
19 |
20 |
21 | Generate
22 |
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/input-group/InputGroup.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, InputGroup, Input } from '@zendeskgarden/react-forms';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 | Plant name generator
18 |
19 |
20 |
21 | Generate
22 |
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/input-group/Readonly.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, InputGroup, Input } from '@zendeskgarden/react-forms';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 | Invoice number
18 |
19 |
20 |
21 | Copy
22 |
23 |
24 |
25 |
26 |
27 | );
28 |
29 | export default Example;
30 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/FauxInput.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, FauxInput } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Soil
17 | Loam
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/FocusInset.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Mulch
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Accessibly hidden label
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Hint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Evergreen
17 | Foliage throughout the year
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Inline.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import styled from 'styled-components';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const StyledField = styled(Field)`
14 | display: flex;
15 | align-items: center;
16 | `;
17 |
18 | const StyledLabel = styled(Field.Label)`
19 | margin-${props => (props.theme.rtl ? 'left' : 'right')}: ${props => props.theme.space.sm};
20 | `;
21 |
22 | const Example = () => (
23 |
24 |
25 |
26 | Plant
27 |
28 |
29 |
30 |
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Input.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/MediaInput.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, MediaInput } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { ReactComponent as StartIcon } from '@zendeskgarden/svg-icons/src/16/search-stroke.svg';
12 | import { ReactComponent as EndIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
13 |
14 | const Example = () => (
15 |
16 |
17 |
18 | Prune
19 | } end={ } />
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Placeholder.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/ReadOnly.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Tomato
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/RegularWeightLabel.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Input } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/inputs/Size.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { mediaQuery } from '@zendeskgarden/react-theming';
12 | import { Field, Input } from '@zendeskgarden/react-forms';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 |
24 | Bush
25 |
26 |
27 |
28 |
29 |
30 | Shrub
31 |
32 |
33 |
34 |
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/forms/range/RangeDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Range } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Flowers
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/range/RangeDisabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Range } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Flowers
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/range/RangeHidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Range } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Accessibly hidden label
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/range/RangeHint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Range } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => {
13 | const [rangeValue, setRangeValue] = useState('50');
14 |
15 | return (
16 |
17 |
18 |
19 | Flowers
20 | Plant {rangeValue} flowers
21 | {
24 | setRangeValue(e.target.value);
25 | }}
26 | />
27 |
28 |
29 |
30 | );
31 | };
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/forms/select/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Select } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Houseplant
17 |
18 | Fern
19 | Snake plant
20 | Rubber tree
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/forms/select/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Select } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 |
18 | Cactus
19 |
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/forms/select/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Select } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Accessibly hidden label
17 |
18 |
19 | Choose a houseplant
20 |
21 | Fern
22 | Snake plant
23 | Rubber tree
24 |
25 |
26 |
27 |
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/forms/select/Hint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Field, Select } from '@zendeskgarden/react-forms';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 | Choose your favorite plant
18 |
19 | Orchid
20 | Cactus
21 | Succulent
22 |
23 |
24 |
25 |
26 | );
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/forms/select/Size.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { mediaQuery } from '@zendeskgarden/react-theming';
12 | import { Field, Select } from '@zendeskgarden/react-forms';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 |
24 | Plant
25 |
26 | Succulent
27 | Orchid
28 | Cactus
29 |
30 |
31 |
32 |
33 |
34 | Plant
35 |
36 | Succulent
37 | Orchid
38 | Cactus
39 |
40 |
41 |
42 |
43 | );
44 |
45 | export default Example;
46 |
--------------------------------------------------------------------------------
/src/examples/forms/textarea/AutoExpand.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Textarea } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Soil
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/textarea/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Textarea } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Shrub
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/textarea/DragHandles.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Textarea } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Ivy
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/textarea/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Textarea } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Accessibly hidden label
17 |
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/forms/toggle/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Toggle } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Show flowers
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/forms/toggle/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Toggle } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Show flowers
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/forms/toggle/Hidden.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Toggle } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Accessibly hidden label
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/forms/toggle/Hint.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Toggle } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Show flowers
18 | Display flowers on this page
19 |
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/forms/toggle/RegularWeightLabel.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Field, Toggle } from '@zendeskgarden/react-forms';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Show flowers
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/grid/GridAllBreak.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col
17 |
18 |
19 | Col
20 |
21 |
22 | Col
23 |
24 |
25 | Col
26 |
27 |
28 |
29 |
30 | Col[size=8]
31 |
32 |
33 | Col[size=4]
34 |
35 |
36 |
37 | );
38 |
39 | export default Example;
40 |
--------------------------------------------------------------------------------
/src/examples/grid/GridColumnBreaks.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col[size=6][sm=3]
17 |
18 |
19 | Col[size=6][sm=3]
20 |
21 |
22 |
23 | Col[size=6][sm=3]
24 |
25 |
26 | Col[size=6][sm=3]
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/grid/GridColumnWrapping.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 |
10 | import { MD } from '@zendeskgarden/react-typography';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 | Col[size=9]
18 |
19 |
20 |
21 | Col[size=4]: since 9 + 4 = 13 > 12, this column gets wrapped onto a new line as one
22 | contiguous unit.
23 |
24 |
25 |
26 | Col[size=6]: subsequent columns continue along the new line.
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/grid/GridEqual.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | 1 of 2
17 |
18 |
19 | 2 of 2
20 |
21 |
22 |
23 |
24 | 1 of 3
25 |
26 |
27 | 2 of 3
28 |
29 |
30 | 3 of 3
31 |
32 |
33 |
34 | );
35 |
36 | export default Example;
37 |
--------------------------------------------------------------------------------
/src/examples/grid/GridEqualMulti.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col
17 |
18 |
19 | Col
20 |
21 |
22 |
23 | Col
24 |
25 |
26 | Col
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/grid/GridNesting.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 | Level 1: Col[sm=9]
18 |
19 |
20 | Level 2: Col[size=8][sm=6]
21 |
22 |
23 | Level 2: Col[size=4][sm=6]
24 |
25 |
26 |
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/grid/GridNoGutters.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col[size=12][sm=6][md=8]
17 |
18 |
19 | Col[size=6][md=4]
20 |
21 |
22 |
23 | );
24 |
25 | export default Example;
26 |
--------------------------------------------------------------------------------
/src/examples/grid/GridOffset.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col[md=4]
17 |
18 |
19 | Col[md=4][offsetMd=4]
20 |
21 |
22 |
23 |
24 | Col[md=3][offsetMd=3]
25 |
26 |
27 | Col[md=3][offsetMd=3]
28 |
29 |
30 |
31 |
32 | Col[md=6][offsetMd=3]
33 |
34 |
35 |
36 | );
37 |
38 | export default Example;
39 |
--------------------------------------------------------------------------------
/src/examples/grid/GridOneCol.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | 1 of 3
17 |
18 |
19 | 2 of 3 (wider)
20 |
21 |
22 | 3 of 3
23 |
24 |
25 |
26 |
27 | 1 of 3
28 |
29 |
30 | 2 of 3 (wider)
31 |
32 |
33 | 3 of 3
34 |
35 |
36 |
37 | );
38 |
39 | export default Example;
40 |
--------------------------------------------------------------------------------
/src/examples/grid/GridReordering.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | First, but unordered
17 |
18 |
19 | Second, but last
20 |
21 |
22 | Third, but first
23 |
24 |
25 |
26 |
27 | First, but last
28 |
29 |
30 | Second, but unordered
31 |
32 |
33 | Third, but first
34 |
35 |
36 |
37 | );
38 |
39 | export default Example;
40 |
--------------------------------------------------------------------------------
/src/examples/grid/GridStacked.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Col[sm=8]
17 |
18 |
19 | Col[sm=4]
20 |
21 |
22 |
23 |
24 | Col[sm]
25 |
26 |
27 | Col[sm]
28 |
29 |
30 | Col[sm]
31 |
32 |
33 |
34 | );
35 |
36 | export default Example;
37 |
--------------------------------------------------------------------------------
/src/examples/grid/GridVariable.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | 1 of 3
17 |
18 |
19 | Variable width content
20 |
21 |
22 | 3 of 3
23 |
24 |
25 |
26 |
27 | 1 of 3
28 |
29 |
30 | Variable width content
31 |
32 |
33 | 3 of 3
34 |
35 |
36 |
37 | );
38 |
39 | export default Example;
40 |
--------------------------------------------------------------------------------
/src/examples/loaders/dots/DotsColor.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { PALETTE } from '@zendeskgarden/react-theming';
11 | import { Dots } from '@zendeskgarden/react-loaders';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/loaders/dots/DotsDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Dots } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/loaders/dots/DotsSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Dots } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/loaders/inline/InlineColor.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { PALETTE } from '@zendeskgarden/react-theming';
11 | import { Inline } from '@zendeskgarden/react-loaders';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/loaders/inline/InlineDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Inline } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/loaders/inline/InlineSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Inline } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/loaders/progress/ProgressColor.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Progress } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/loaders/progress/ProgressDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Progress } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/loaders/progress/ProgressSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Progress } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/loaders/skeleton/SkeletonDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { MD, XXL } from '@zendeskgarden/react-typography';
11 | import { Skeleton } from '@zendeskgarden/react-loaders';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | );
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/loaders/skeleton/SkeletonLight.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { getColor } from '@zendeskgarden/react-theming';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 | import { MD, XXL } from '@zendeskgarden/react-typography';
13 | import { Skeleton } from '@zendeskgarden/react-loaders';
14 |
15 | const StyledCol = styled(Grid.Col)`
16 | background-color: ${p => getColor({ theme: p.theme, hue: 'chromeHue', shade: 800 })};
17 | padding: ${p => p.theme.space.md};
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | );
34 |
35 | export default Example;
36 |
--------------------------------------------------------------------------------
/src/examples/loaders/skeleton/SkeletonSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Skeleton } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | );
23 |
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/src/examples/loaders/spinner/SpinnerColor.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { PALETTE } from '@zendeskgarden/react-theming';
11 | import { Spinner } from '@zendeskgarden/react-loaders';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 |
27 | export default Example;
28 |
--------------------------------------------------------------------------------
/src/examples/loaders/spinner/SpinnerDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Spinner } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/loaders/spinner/SpinnerSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Spinner } from '@zendeskgarden/react-loaders';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/menu/Arrow.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { IconButton } from '@zendeskgarden/react-buttons';
11 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
12 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
13 |
14 | const Example = () => {
15 | const handleChange = useCallback>(changes => {
16 | changes.value && alert(`You chose ${changes.value}`);
17 | }, []);
18 |
19 | return (
20 |
21 |
22 | (
25 |
26 |
27 |
28 | )}
29 | onChange={handleChange}
30 | >
31 | - Acacia
32 | - Daisy
33 | - Honeysuckle
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/examples/menu/Button.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { Menu, Item } from '@zendeskgarden/react-dropdowns';
12 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
13 |
14 | const Example = () => {
15 | const handleChange = ({ value }: { value?: string }) => {
16 | value && alert(`You chose ${value}`);
17 | };
18 |
19 | return (
20 |
21 |
22 | (
24 |
25 |
26 |
27 |
28 | Pick flowers
29 |
30 | )}
31 | onChange={handleChange}
32 | >
33 | - Hydrangea
34 | - Petunia
35 | - Lily
36 |
37 |
38 |
39 | );
40 | };
41 |
42 | export default Example;
43 |
--------------------------------------------------------------------------------
/src/examples/menu/Danger.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/16/leaf-stroke.svg';
11 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
12 |
13 | const Example = () => {
14 | const handleChange = useCallback>(changes => {
15 | changes.value && alert(`You chose ${changes.value}`);
16 | }, []);
17 |
18 | return (
19 |
20 |
21 |
22 | -
23 | Acacia
24 |
25 | -
26 | Daisy
27 |
15 planted
28 |
29 | -
30 | Honeysuckle
31 |
32 | } value="candytuft">
33 | Candytuft
34 |
35 |
36 |
37 |
38 | );
39 | };
40 |
41 | export default Example;
42 |
--------------------------------------------------------------------------------
/src/examples/menu/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => {
13 | const handleChange = useCallback>(changes => {
14 | changes.value && alert(`You chose ${changes.value}`);
15 | }, []);
16 |
17 | return (
18 |
19 |
20 |
21 | - Cactus
22 | - Jade plant
23 | - Echeveria
24 |
25 |
26 |
27 | );
28 | };
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/menu/Disabled.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => {
13 | const handleChange = useCallback>(changes => {
14 | changes.value && alert(`You chose ${changes.value}`);
15 | }, []);
16 |
17 | return (
18 |
19 |
20 |
21 | - Maitake
22 | -
23 | Basidirond
24 |
25 | - Crimini
26 |
27 |
28 |
29 | );
30 | };
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/menu/Meta.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => {
13 | const handleChange = useCallback>(changes => {
14 | changes.value && alert(`You chose ${changes.value}`);
15 | }, []);
16 |
17 | return (
18 |
19 |
20 |
21 | -
22 | Avocado
27 available
23 |
24 | -
25 | Potato
5 available
26 |
27 | -
28 | Beet
11 available
29 |
30 |
31 |
32 |
33 | );
34 | };
35 |
36 | export default Example;
37 |
--------------------------------------------------------------------------------
/src/examples/menu/Placement.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => {
13 | const handleChange = useCallback>(changes => {
14 | changes.value && alert(`You chose ${changes.value}`);
15 | }, []);
16 |
17 | return (
18 |
19 |
20 |
26 | - Acacia
27 | - Daisy
28 | - Honeysuckle
29 |
30 |
31 |
32 | );
33 | };
34 |
35 | export default Example;
36 |
--------------------------------------------------------------------------------
/src/examples/menu/Size.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useCallback } from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Menu, Item, IMenuProps } from '@zendeskgarden/react-dropdowns';
11 |
12 | const Example = () => {
13 | const handleChange = useCallback>(changes => {
14 | changes.value && alert(`You chose ${changes.value}`);
15 | }, []);
16 |
17 | return (
18 |
19 |
20 |
21 | - Tomato
22 | - Corn
23 | - Onion
24 |
25 |
26 |
27 |
28 | - Grape tomato
29 | - Baby corn
30 | - Pearl onion
31 |
32 |
33 |
34 | );
35 | };
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/notifications/alerts/AlertDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Alert } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | Warning
14 | Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water
15 |
16 |
17 | );
18 |
19 | export default Example;
20 |
--------------------------------------------------------------------------------
/src/examples/notifications/global-alert/GlobalAlertDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { GlobalAlert } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 |
14 | Info
15 | Gumbo beet greens corn soko endive gumbo gourd.
16 |
17 |
18 |
19 | );
20 |
21 | export default Example;
22 |
--------------------------------------------------------------------------------
/src/examples/notifications/notifications/NotificationDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Notification } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | Info
14 | Turnip greens yarrow ricebean endive cauliflower sea kohlrabi amaranth water
15 |
16 |
17 | );
18 |
19 | export default Example;
20 |
--------------------------------------------------------------------------------
/src/examples/notifications/well/WellDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Well } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | What is a Garden?
14 | Turnip greens yarrow endive cauliflower sea lettuce kohlrabi amaranth water
15 |
16 | );
17 |
18 | export default Example;
19 |
--------------------------------------------------------------------------------
/src/examples/notifications/well/WellFloating.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Well } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | What is a Garden?
14 | Turnip greens yarrow endive cauliflower sea lettuce kohlrabi amaranth water
15 |
16 | );
17 |
18 | export default Example;
19 |
--------------------------------------------------------------------------------
/src/examples/notifications/well/WellMultiline.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Well } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | What is a Garden?
14 |
15 | Turnip greens yarrow endive cauliflower sea lettuce kohlrabi amaranth water. Corn amaranth
16 | salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke.
17 |
18 |
19 | Celery quandong swiss chard chicory earthnut pea potato. Salsify taro catsear garlic. Corn
20 | amaranth salsify bunya nuts nori azuki bean chickweed potato bell pepper artichoke. Turnip
21 | greens yarrow endive cauliflower sea lettuce kohlrabi amaranth water.
22 |
23 |
24 | );
25 |
26 | export default Example;
27 |
--------------------------------------------------------------------------------
/src/examples/notifications/well/WellRecessed.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Well } from '@zendeskgarden/react-notifications';
10 |
11 | const Example = () => (
12 |
13 | What is a Garden?
14 | Turnip greens yarrow endive cauliflower sea lettuce kohlrabi amaranth water
15 |
16 | );
17 |
18 | export default Example;
19 |
--------------------------------------------------------------------------------
/src/examples/pagination/OffsetDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { OffsetPagination } from '@zendeskgarden/react-pagination';
10 |
11 | const Example = () => {
12 | const [page, setPage] = useState(1);
13 |
14 | return (
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Example;
22 |
--------------------------------------------------------------------------------
/src/examples/pagination/OffsetGap.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { OffsetPagination } from '@zendeskgarden/react-pagination';
10 |
11 | const Example = () => {
12 | const [page, setPage] = useState(1);
13 |
14 | return (
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Example;
22 |
--------------------------------------------------------------------------------
/src/examples/pagination/OffsetPadding.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React, { useState } from 'react';
9 | import { OffsetPagination } from '@zendeskgarden/react-pagination';
10 |
11 | const Example = () => {
12 | const [page, setPage] = useState(10);
13 |
14 | return (
15 |
16 |
17 |
24 |
25 | );
26 | };
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsAvatar.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tag } from '@zendeskgarden/react-tags';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { ReactComponent as LeafIcon } from '@zendeskgarden/svg-icons/src/12/leaf-stroke.svg';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 |
19 |
20 | Conifer
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | Conifer
29 |
30 |
31 |
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsColor.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tag } from '@zendeskgarden/react-tags';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Conifer
17 |
18 |
19 |
20 |
21 | Moss
22 |
23 |
24 |
25 |
26 | Cactus
27 |
28 |
29 |
30 |
31 | Succulent
32 |
33 |
34 |
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tag } from '@zendeskgarden/react-tags';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Algae
17 |
18 |
19 |
20 | );
21 |
22 | export default Example;
23 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsShape.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tag } from '@zendeskgarden/react-tags';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Algae
17 |
18 |
19 |
20 |
21 | Moss
22 |
23 |
24 |
25 |
26 | 8
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsSize.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tag } from '@zendeskgarden/react-tags';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Moss
17 |
18 |
19 |
20 |
21 | Algae
22 |
23 |
24 |
25 |
26 | Conifer
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/tags/TagsWeight.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Span } from '@zendeskgarden/react-typography';
10 | import { Tag } from '@zendeskgarden/react-tags';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 | Category Algae
19 |
20 |
21 |
22 |
23 |
24 |
25 | Category Moss
26 |
27 |
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/theme-provider/ThemeProviderBranding.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Button } from '@zendeskgarden/react-buttons';
11 | import { IGardenTheme, ThemeProvider } from '@zendeskgarden/react-theming';
12 |
13 | /* Each Garden example is wrapped by a */
14 | const Example = () => {
15 | const theme = (parentTheme: IGardenTheme) => ({
16 | ...parentTheme,
17 | borderRadii: {
18 | ...parentTheme.borderRadii,
19 | md: '0'
20 | },
21 | colors: {
22 | ...parentTheme.colors,
23 | primaryHue: 'purple'
24 | }
25 | });
26 |
27 | return (
28 |
29 |
30 |
31 | Default
32 |
33 |
34 | Primary
35 |
36 |
37 | Basic
38 |
39 |
40 |
41 | );
42 | };
43 |
44 | export default Example;
45 |
--------------------------------------------------------------------------------
/src/examples/tooltip/TooltipDefault.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tooltip } from '@zendeskgarden/react-tooltips';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Button } from '@zendeskgarden/react-buttons';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 | Hover for a tooltip
18 |
19 |
20 |
21 | );
22 |
23 | export default Example;
24 |
--------------------------------------------------------------------------------
/src/examples/tooltip/TooltipPlacement.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tooltip, ITooltipProps } from '@zendeskgarden/react-tooltips';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Button } from '@zendeskgarden/react-buttons';
12 |
13 | const PLACEMENTS: Record = {
14 | auto: 'auto',
15 | top: 'top',
16 | topStart: 'top-start',
17 | topEnd: 'top-end',
18 | end: 'end',
19 | endTop: 'end-top',
20 | endBottom: 'end-bottom',
21 | bottom: 'bottom',
22 | bottomStart: 'bottom-start',
23 | bottomEnd: 'bottom-end',
24 | start: 'start',
25 | startTop: 'start-top',
26 | startBottom: 'start-bottom'
27 | };
28 |
29 | const Example = () => (
30 |
31 |
32 |
33 | Hover for a tooltip
34 |
35 |
36 |
37 | );
38 |
39 | export default Example;
40 |
--------------------------------------------------------------------------------
/src/examples/tooltip/TooltipType.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Tooltip } from '@zendeskgarden/react-tooltips';
10 | import { Grid } from '@zendeskgarden/react-grid';
11 | import { Button } from '@zendeskgarden/react-buttons';
12 |
13 | const Example = () => (
14 |
15 |
16 |
17 |
18 | Dark tooltip
19 |
20 |
21 |
22 |
23 |
29 | Words of wisdom
30 |
31 | I asked the staff at my local garden center what to grow in my garden. They gave me
32 | some sage advice.
33 |
34 | >
35 | }
36 | >
37 | Light tooltip
38 |
39 |
40 |
41 | );
42 |
43 | export default Example;
44 |
--------------------------------------------------------------------------------
/src/examples/typography/Blockquote.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Blockquote, Paragraph, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 |
13 |
14 | Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth
15 | tatsoi tomatillo melon azuki bean garlic.
16 |
17 | Life begins the day you start a garden.
18 |
19 | Lotus root spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin
20 | onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard
21 | wakame kohlrabi beetroot carrot watercress. Cordn amaranth salsify bunya nuts nori azuki bean
22 | chickweed potato bell pepper artichoke.
23 |
24 |
25 | In garden arrangement, as in all other kinds of decorative work, one has not only to acquire a
26 | knowledge of what to do, but also to gain some wisdom in perceiving what it is well to let
27 | alone.
28 |
29 |
30 | );
31 |
32 | export default Example;
33 |
--------------------------------------------------------------------------------
/src/examples/typography/Ellipsis.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Ellipsis, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 |
13 | Veggies es bonus vobis, proinde vos postulo.
14 | Veggies es bonus vobis, proinde vos postulo.
15 | Veggies es bonus vobis, proinde vos postulo.
16 |
17 | );
18 |
19 | export default Example;
20 |
--------------------------------------------------------------------------------
/src/examples/typography/Modifiers.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 | Veggies es bonus vobis, pronide vos postulo.
14 | Veggies es bonus vobis, pronide vos postulo.
15 | Veggies es bonus vobis, pronide vos postulo.
16 | >
17 | );
18 |
19 | export default Example;
20 |
--------------------------------------------------------------------------------
/src/examples/typography/TypeScale.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { SM, MD, LG, XL, XXL, XXXL } from '@zendeskgarden/react-typography';
11 |
12 | const StyledDiv = styled.div`
13 | margin-top: ${p => p.theme.space.sm};
14 | `;
15 |
16 | const Example = () => (
17 | <>
18 | <SM>Veggies es bonus vobis proinde vos postulo
19 |
20 | <MD>Veggies es bonus vobis proinde vos postulo
21 |
22 |
23 | <LG>Veggies es bonus vobis proinde vos postulo
24 |
25 |
26 | <XL>Veggies es bonus vobis proinde vos postulo
27 |
28 |
29 | <XXL>Veggies es bonus vobis proinde vos postulo
30 |
31 |
32 | <XXXL>Veggies es bonus vobis proinde
33 |
34 | >
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | {`
13 | /**
14 | * Copy the given value to the clipboard.
15 | *
16 | * @param {string} value The value to copy
17 | */
18 | const copy = (value: string) => {
19 | const element = document.createElement('textarea');
20 |
21 | element.readOnly = true;
22 | element.style.position = 'absolute';
23 | element.style.left = '-9999px';
24 | document.body.appendChild(element);
25 | element.value = value;
26 | element.select();
27 | document.execCommand('copy');
28 | element.remove();
29 | };
30 | `}
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Diff.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | {`
13 | @@ -1,18 +1,20 @@
14 | +# A Garden of Roses
15 | +
16 | Roses are red,
17 | Violets are blue,
18 | Sugar is sweet,
19 | And so are you.
20 |
21 | ***
22 |
23 | Roses are red,
24 | -Violets are blue,
25 | -I’m unoriginal,
26 | -This is all I can do.
27 | +My screen is blue,
28 | +The system crashed,
29 | +do {} while (true)
30 |
31 | ***
32 |
33 | Roses are red,
34 | Violets are blue,
35 | -Actually kind of purple,
36 | -Maybe more of a [royal-M400](https://garden.zendesk.com/design/color)?
37 | +TL;DR,
38 | +They differ in hue.
39 | `}
40 | );
41 |
42 | export default Example;
43 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Highlighted.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock, Paragraph } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => {
12 | const code = `
13 | {
14 | "active": true,
15 | "brand_url": "https://garden.zendesk.com",
16 | "created_at": "2014-05-28T12:27:71Z",
17 | "description": "Garden is the design system by Zendesk",
18 | "logo": {
19 | "content_type": "image/png",
20 | "content_url": "https://garden.zendesk.com/og-image.png",
21 | "file_name": "og-image.png",
22 | "size": 29515
23 | },
24 | "name": "Zendesk Garden",
25 | "subdomain": "garden",
26 | "updated_at": "2021-02-11T12:27:71Z",
27 | "url": "https://garden.zendesk.com/page-data/app-data.json"
28 | }
29 | `;
30 |
31 | const highlightLines = [3, 5, 12];
32 |
33 | return (
34 | <>
35 |
36 |
37 | {code}
38 |
39 |
40 |
41 |
42 | {code}
43 |
44 |
45 | >
46 | );
47 | };
48 |
49 | export default Example;
50 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Language.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | {`
13 | /* CSS utility for making hidden content accessible to screen readers */
14 | .sr-only {
15 | position: absolute;
16 | margin: -1px;
17 | border-width: 0;
18 | clip: rect(0, 0, 0, 0);
19 | padding: 0;
20 | width: 1px;
21 | height: 1px;
22 | overflow: hidden;
23 | white-space: nowrap;
24 | }
25 | `}
26 | );
27 |
28 | export default Example;
29 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Light.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | {`
13 | /**
14 | * Copy the given value to the clipboard.
15 | *
16 | * @param {string} value The value to copy
17 | */
18 | const copy = (value: string) => {
19 | const element = document.createElement('textarea');
20 |
21 | element.readOnly = true;
22 | element.style.position = 'absolute';
23 | element.style.left = '-9999px';
24 | document.body.appendChild(element);
25 | element.value = value;
26 | element.select();
27 | document.execCommand('copy');
28 | element.remove();
29 | };
30 | `}
31 | );
32 |
33 | export default Example;
34 |
--------------------------------------------------------------------------------
/src/examples/typography/code-block/Size.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { CodeBlock, Paragraph } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 |
14 | {`
15 | const perrenial = ' Daylily (Hemerocallis) ';
16 |
17 | console.log(\`🌱 \${perrenial.trim()} 🌱\`);
18 | `}
19 |
20 |
21 | {`
22 | const perrenial = ' Daylily (Hemerocallis) ';
23 |
24 | console.log(\`🌱 \${perrenial.trim()} 🌱\`);
25 | `}
26 |
27 |
28 | {`
29 | const perrenial = ' Daylily (Hemerocallis) ';
30 |
31 | console.log(\`🌱 \${perrenial.trim()} 🌱\`);
32 | `}
33 |
34 | >
35 | );
36 |
37 | export default Example;
38 |
--------------------------------------------------------------------------------
/src/examples/typography/code/Color.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { mediaQuery } from '@zendeskgarden/react-theming';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 | import { Code } from '@zendeskgarden/react-typography';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 | Veggies es bonus
24 |
25 |
26 | Veggies es bonus
27 |
28 |
29 | Veggies es bonus
30 |
31 |
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/typography/code/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { Code } from '@zendeskgarden/react-typography';
11 |
12 | const Example = () => (
13 |
14 |
15 | Veggies es bonus vobis
16 |
17 |
18 | );
19 |
20 | export default Example;
21 |
--------------------------------------------------------------------------------
/src/examples/typography/code/Size.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import styled from 'styled-components';
10 | import { mediaQuery } from '@zendeskgarden/react-theming';
11 | import { Grid } from '@zendeskgarden/react-grid';
12 | import { Code } from '@zendeskgarden/react-typography';
13 |
14 | const StyledCol = styled(Grid.Col)`
15 | ${p => mediaQuery('down', 'xs', p.theme)} {
16 | margin-top: ${p => p.theme.space.sm};
17 | }
18 | `;
19 |
20 | const Example = () => (
21 |
22 |
23 | Veggies es bonus
24 |
25 |
26 | Veggies es bonus
27 |
28 |
29 | Veggies es bonus
30 |
31 |
32 | );
33 |
34 | export default Example;
35 |
--------------------------------------------------------------------------------
/src/examples/typography/lists/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Grid } from '@zendeskgarden/react-grid';
10 | import { OrderedList, UnorderedList } from '@zendeskgarden/react-typography';
11 |
12 | const Example = () => (
13 |
14 |
15 |
16 | Plant
17 | Water
18 | Harvest
19 |
20 |
21 |
22 |
23 | Garden trowel
24 | Pruning shears
25 | Hand cultivator
26 |
27 |
28 |
29 | );
30 |
31 | export default Example;
32 |
--------------------------------------------------------------------------------
/src/examples/typography/paragraph/Default.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 |
14 |
15 | Turnip greens yarrow ricebean rutabaga endive cauliflower sear lettuce kohlrabi amaranth
16 | water spinach avacado daikon napa cabbage asparagus winter purslane kale. Celery potato
17 | scallion desert raisin horseradish spinach carrot soko.
18 |
19 |
20 |
21 |
22 | Lotus root spinach fennel kombu maize bamboo shoot green bean swiss chard seakale pumpkin
23 | onion chickpea gram corn pea. Brussels sprout coriander water chestnut gourd swiss chard
24 | wakame kohlrabi beetroot carrot watercress. Cordn amaranth salsify bunya nuts nori azuki
25 | bean chickweed potato bell pepper artichoke.
26 |
27 |
28 | >
29 | );
30 |
31 | export default Example;
32 |
--------------------------------------------------------------------------------
/src/examples/typography/span/Bold.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, Span, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 |
14 |
15 | Veggies es bonus vobis.
16 |
17 |
18 |
19 |
20 | Water spinach arugula pea tatsoi aubergine spring onion bush tomato kale radicchio turnip
21 | chicory salsify pea sprouts fava bean.{' '}
22 | Dandelion zucchini burdock yarrow chickpea dandelion sorrel courgette
23 | turnip greens tigernut soybean radish artichoke wattle seed endive groundnut broccoli
24 | arugula.
25 |
26 |
27 | >
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/typography/span/Hue.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, Span, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 |
14 |
15 | Veggies es bonus vobis.
16 |
17 |
18 |
19 |
20 | Water spinach arugula pea tatsoi aubergine spring onion bush tomato kale radicchio turnip
21 | chicory salsify pea sprouts fava bean.{' '}
22 | Dandelion zucchini burdock yarrow chickpea dandelion {' '}
23 | sorrel courgette turnip greens tigernut soybean radish artichoke wattle seed endive
24 | groundnut broccoli arugula.
25 |
26 |
27 | >
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/typography/span/Icon.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, Span, MD } from '@zendeskgarden/react-typography';
10 | import { ReactComponent as AsteriskIcon } from '@zendeskgarden/svg-icons/src/16/asterisk-stroke.svg';
11 |
12 | const Example = () => (
13 | <>
14 |
15 |
16 |
17 | Veggies es{' '}
18 |
19 |
20 | {' '}
21 | bonus vobis.
22 |
23 |
24 |
25 |
26 |
27 |
28 | Water spinach arugula pea tatsoi aubergine spring onion bush tomato kale radicchio turnip
29 | chicory salsify pea sprouts fava bean. Dandelion zucchini burdock yarrow chickpea
30 | dandelion sorrel courgette turnip greens tigernut soybean radish artichoke wattle seed
31 | endive groundnut broccoli arugula.{' '}
32 |
33 |
34 |
35 |
36 |
37 |
38 | >
39 | );
40 |
41 | export default Example;
42 |
--------------------------------------------------------------------------------
/src/examples/typography/span/Monospace.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, Span, MD } from '@zendeskgarden/react-typography';
10 |
11 | const Example = () => (
12 | <>
13 |
14 |
15 | Veggies es bonus vobis.
16 |
17 |
18 |
19 |
20 | Water spinach arugula pea tatsoi aubergine spring onion bush tomato kale radicchio turnip
21 | chicory salsify pea sprouts fava bean.{' '}
22 | Dandelion zucchini burdock yarrow chickpea dandelion sorrel
23 | courgette turnip greens tigernut soybean radish artichoke wattle seed endive groundnut
24 | broccoli arugula.
25 |
26 |
27 | >
28 | );
29 |
30 | export default Example;
31 |
--------------------------------------------------------------------------------
/src/examples/typography/span/StartIcon.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Paragraph, Span, MD } from '@zendeskgarden/react-typography';
10 | import { ReactComponent as CircleIcon } from '@zendeskgarden/svg-icons/src/16/circle-stroke.svg';
11 |
12 | const Example = () => (
13 | <>
14 |
15 |
16 |
17 |
18 |
19 |
20 | Veggies es bonus vobis.
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Water spinach arugula pea tatsoi aubergine spring onion bush tomato kale radicchio turnip
31 | chicory salsify pea sprouts fava bean. Dandelion zucchini burdock yarrow chickpea
32 | dandelion sorrel courgette turnip greens tigernut soybean radish artichoke wattle seed
33 | endive groundnut broccoli arugula.
34 |
35 |
36 |
37 | >
38 | );
39 |
40 | export default Example;
41 |
--------------------------------------------------------------------------------
/src/icons/components.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/icons/content.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/icons/design.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/layouts/Home/components/HomeLink.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { GatsbyLinkProps } from 'gatsby';
10 | import { Link } from '../../../layouts/Root/components/StyledNavigationLink';
11 | import { css } from 'styled-components';
12 |
13 | export const HomeLink: React.FC, 'ref'>> = ({ children, ...props }) => (
14 |
22 | {children} →
23 |
24 | );
25 |
--------------------------------------------------------------------------------
/src/layouts/Home/index.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { Search } from './components/Search';
10 | import { Foundation } from './components/Foundation';
11 | import { Patterns } from './components/Patterns';
12 | import { News } from './components/News';
13 |
14 | const HomeLayout: React.FC = () => {
15 | return (
16 | <>
17 |
18 |
19 |
20 |
21 | >
22 | );
23 | };
24 |
25 | export default HomeLayout;
26 |
--------------------------------------------------------------------------------
/src/layouts/MaxWidth.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import styled from 'styled-components';
9 |
10 | const MaxWidthLayout = styled.div`
11 | margin-right: auto;
12 | margin-left: auto;
13 | max-width: 1440px;
14 | `;
15 |
16 | export default MaxWidthLayout;
17 |
--------------------------------------------------------------------------------
/src/layouts/Sidebar/components/NavItemTitle.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import React from 'react';
9 | import { PALETTE } from '@zendeskgarden/react-theming';
10 | import { Tag } from '@zendeskgarden/react-tags';
11 |
12 | interface INavItemTitleProps {
13 | children: string;
14 | }
15 |
16 | export const NavItemTitle = ({ children }: INavItemTitleProps) => {
17 | const tags: string[] = [];
18 | const regex = /\s*?\[(?.*?)\]/gmu;
19 | const title = children.replace(regex, (_, tag) => {
20 | tags.push(tag);
21 |
22 | return '';
23 | });
24 |
25 | return (
26 | <>
27 | {title}{' '}
28 | {tags.map((tag, index) => {
29 | let hue;
30 |
31 | switch (tag) {
32 | case 'deprecated':
33 | hue = PALETTE.yellow[200];
34 | break;
35 |
36 | case 'new':
37 | hue = 'green';
38 | break;
39 | }
40 |
41 | return (
42 |
43 | {tag.charAt(0).toUpperCase() + tag.slice(1)}
44 |
45 | );
46 | })}
47 | >
48 | );
49 | };
50 |
--------------------------------------------------------------------------------
/src/layouts/Titled/components/Subtitle.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import styled from 'styled-components';
9 | import { getColor } from '@zendeskgarden/react-theming';
10 | import { LG } from '@zendeskgarden/react-typography';
11 |
12 | export const Subtitle = styled(LG).attrs({ tag: 'p' })`
13 | max-width: 540px;
14 | color: ${p => getColor({ theme: p.theme, variable: 'foreground.subtle' })};
15 | font-size: ${p => p.theme.space.base * 4}px;
16 | `;
17 |
--------------------------------------------------------------------------------
/src/pages/components/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Components overview
3 | description: >
4 | Development instructions for building effective user interfaces.
5 | ---
6 |
7 | import { SEO } from '../../components';
8 |
9 | export function Head(props) {
10 | return ;
11 | }
12 |
13 |
14 |
15 | import { graphql } from 'gatsby';
16 |
17 | export const pageQuery = graphql`
18 | query ($slug: String) {
19 | ...SidebarPageFragment
20 | }
21 | `;
22 |
--------------------------------------------------------------------------------
/src/pages/components/versions.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Versions
3 | description: >
4 | Archive of previous major component versions.
5 | ---
6 |
7 | import { SEO } from '../../components';
8 |
9 | export function Head(props) {
10 | return ;
11 | }
12 |
13 | Garden website release documentation
14 |
15 | - Version 9
16 | - [changelog](https://github.com/zendeskgarden/react-components/blob/main/CHANGELOG.md)
17 | - [migration guide](https://github.com/zendeskgarden/react-components/blob/main/docs/migration.md)
18 | - [Version 8](https://zendeskgarden-v8.netlify.app/)
19 | - [changelog](https://github.com/zendeskgarden/react-components/blob/main/docs/changelogs/v8.md)
20 | - [migration guide](https://github.com/zendeskgarden/react-components/blob/main/docs/migrations/v8.md)
21 | - [Version 7](https://zendeskgarden-v7.netlify.app/)
22 | - [changelog](https://github.com/zendeskgarden/react-components/blob/main/docs/changelogs/v7.md)
23 | - [migration guide](https://github.com/zendeskgarden/react-components/blob/main/docs/migrations/v7.md)
24 | - [Version 6](https://zendeskgarden-v6.netlify.app/)
25 | - [changelog](https://github.com/zendeskgarden/react-components/blob/main/docs/changelogs/v6.md)
26 | - [migration guide](https://github.com/zendeskgarden/react-components/blob/main/docs/migrations/v6.md)
27 |
28 | import { graphql } from 'gatsby';
29 |
30 | export const pageQuery = graphql`
31 | query ($slug: String) {
32 | ...SidebarPageFragment
33 | }
34 | `;
35 |
--------------------------------------------------------------------------------
/src/pages/content/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Content overview
3 | description: >
4 | The principles of language for writing products.
5 | ---
6 |
7 | import { SEO } from '../../components';
8 |
9 | export function Head(props) {
10 | return ;
11 | }
12 |
13 | import { Alert } from '@zendeskgarden/react-notifications';
14 |
15 | Content guidance has been moved to the internal Zendesk space
16 |
17 | import { graphql } from 'gatsby';
18 |
19 | export const pageQuery = graphql`
20 | query ($slug: String) {
21 | ...SidebarPageFragment
22 | }
23 | `;
24 |
--------------------------------------------------------------------------------
/src/pages/design/icons/chrome-icons.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Chrome icons
3 | ---
4 |
5 | import { SEO } from '../../../components';
6 |
7 | export function Head(props) {
8 | return ;
9 | }
10 |
11 | import { graphql } from 'gatsby';
12 |
13 | Below are all the icons currently available to use in the [Chrome](/components/chrome) component.
14 | These icons should only be used within Chrome.
15 |
16 | import { SvgSearch } from '../../../examples/design/icons/SvgSearch';
17 |
18 |
19 |
20 | export const pageQuery = graphql`
21 | query ($slug: String) {
22 | ...SidebarPageFragment
23 | svgIcons: allFile(
24 | filter: {
25 | sourceInstanceName: { eq: "svg-icons" }
26 | relativeDirectory: { eq: "26" }
27 | name: { glob: "!wordmark-*" }
28 | }
29 | sort: { name: ASC }
30 | ) {
31 | totalCount
32 | edges {
33 | node {
34 | name
35 | relativeDirectory
36 | childGardenSvg {
37 | content
38 | }
39 | }
40 | }
41 | }
42 | }
43 | `;
44 |
--------------------------------------------------------------------------------
/src/pages/design/icons/library.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Icon library
3 | ---
4 |
5 | import { SEO } from '../../../components';
6 |
7 | export function Head(props) {
8 | return ;
9 | }
10 |
11 | import { graphql } from 'gatsby';
12 |
13 | ### All icons
14 |
15 | This is a list of all the icons in the Garden library, independent of context.
16 |
17 | import { SvgSearch } from '../../../examples/design/icons/SvgSearch';
18 |
19 |
20 |
21 | export const pageQuery = graphql`
22 | query ($slug: String) {
23 | ...SidebarPageFragment
24 | svgIcons: allFile(
25 | filter: {
26 | sourceInstanceName: { eq: "svg-icons" }
27 | relativeDirectory: { eq: "16" }
28 | name: { glob: "!wordmark-*" }
29 | }
30 | sort: { name: ASC }
31 | ) {
32 | totalCount
33 | edges {
34 | node {
35 | name
36 | relativeDirectory
37 | childGardenSvg {
38 | content
39 | }
40 | }
41 | }
42 | }
43 | }
44 | `;
45 |
--------------------------------------------------------------------------------
/src/pages/design/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Design overview
3 | description: >
4 | Foundations for creating purposeful UI.
5 | ---
6 |
7 | import { SEO } from '../../components';
8 |
9 | export function Head(props) {
10 | return ;
11 | }
12 |
13 |
14 |
15 | import { graphql } from 'gatsby';
16 |
17 | export const pageQuery = graphql`
18 | query ($slug: String) {
19 | ...SidebarPageFragment
20 | }
21 | `;
22 |
--------------------------------------------------------------------------------
/src/pages/patterns/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Patterns overview
3 | description: >
4 | Additional context for how to use components.
5 | ---
6 |
7 | import { SEO } from '../../components';
8 |
9 | export function Head(props) {
10 | return ;
11 | }
12 |
13 |
14 |
15 | import { graphql } from 'gatsby';
16 |
17 | export const pageQuery = graphql`
18 | query ($slug: String) {
19 | ...SidebarPageFragment
20 | }
21 | `;
22 |
--------------------------------------------------------------------------------
/static/_redirects:
--------------------------------------------------------------------------------
1 | # redirect default Netlify subdomain to primary domain
2 | https://zendeskgarden.netlify.app/* https://garden.zendesk.com/:splat 301!
3 |
4 | # redirect domain aliases to primary domain
5 | https://zendesk.garden/* https://garden.zendesk.com/:splat 301!
6 | https://www.zendesk.garden/* https://garden.zendesk.com/:splat 301!
7 |
8 | # redirect css-components to gh-pages
9 | https://garden.zendesk.com/css-components/* https://zendeskgarden.github.io/css-components/:splat 301!
10 |
--------------------------------------------------------------------------------
/static/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/apple-touch-icon.png
--------------------------------------------------------------------------------
/static/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | #03363D
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/static/components/avatar/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/components/avatar/user.png
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/favicon.ico
--------------------------------------------------------------------------------
/static/google24fd052fab97d4cf.html:
--------------------------------------------------------------------------------
1 | google-site-verification: google24fd052fab97d4cf.html
--------------------------------------------------------------------------------
/static/mask-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/og-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/og-image.png
--------------------------------------------------------------------------------
/static/tile-wide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/tile-wide.png
--------------------------------------------------------------------------------
/static/tile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendeskgarden/website/8b46fc646cdfc0c390f342fdc58dc5460b1073d5/static/tile.png
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "jsx": "preserve",
6 | "sourceMap": true,
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "moduleResolution": "node",
10 | "baseUrl": "./",
11 | "paths": {
12 | "components/*": ["src/components/*"],
13 | "layouts/*": ["src/layouts/*"]
14 | },
15 | "allowSyntheticDefaultImports": true,
16 | "esModuleInterop": true,
17 | "experimentalDecorators": true,
18 | "noEmit": true,
19 | "typeRoots": ["./utils/typings", "./node_modules/@types"]
20 | },
21 | "include": [
22 | "./gatsby-config.ts",
23 | "./gatsby-node.ts",
24 | "./plugins/**/*",
25 | "./src/**/*",
26 | "./utils/typings/*.d.ts"
27 | ],
28 | "exclude": ["./react-components"]
29 | }
30 |
--------------------------------------------------------------------------------
/utils/color-scheme.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | (() => {
9 | /* eslint-disable n/no-unsupported-features/node-builtins */
10 | const colorScheme = window.localStorage.getItem('color-scheme');
11 | let isDark;
12 |
13 | if (['dark', 'light', 'system'].includes(colorScheme)) {
14 | isDark =
15 | colorScheme === 'dark' ||
16 | (colorScheme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
17 | } else {
18 | window.localStorage.setItem('color-scheme', 'system');
19 | isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
20 | }
21 |
22 | if (isDark) {
23 | document.documentElement.style.backgroundColor = '#151a1e';
24 | }
25 | })();
26 |
--------------------------------------------------------------------------------
/utils/typings/react.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import {} from 'styled-components/cssprop';
9 |
--------------------------------------------------------------------------------
/utils/typings/remark-react.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | declare module 'remark-react';
9 |
--------------------------------------------------------------------------------
/utils/typings/smartquotes.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | declare module 'smartquotes';
9 |
--------------------------------------------------------------------------------
/utils/typings/styled.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | import 'styled-components';
9 | import { IGardenTheme } from '@zendeskgarden/react-theming';
10 |
11 | declare module 'styled-components' {
12 | export type Hue = Record | string;
13 |
14 | /* eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/naming-convention */
15 | export interface DefaultTheme extends IGardenTheme {}
16 | }
17 |
--------------------------------------------------------------------------------
/utils/typings/svg.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | declare module '*.svg';
9 |
--------------------------------------------------------------------------------
/utils/typings/yml.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright Zendesk, Inc.
3 | *
4 | * Use of this source code is governed under the Apache License, Version 2.0
5 | * found at http://www.apache.org/licenses/LICENSE-2.0.
6 | */
7 |
8 | declare module '*.yml';
9 |
--------------------------------------------------------------------------------