@pingux/astro 2.9.2 → 2.13.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/lib/README.md +6 -2
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
- package/lib/cjs/components/AccordionGroup/Accordion.styles.js +1 -2
- package/lib/cjs/components/AccordionGroup/AccordionGroup.mdx +41 -0
- package/lib/cjs/components/ArrayField/ArrayField.mdx +34 -0
- package/lib/cjs/components/AstroWrapper/AstroWrapper.mdx +16 -0
- package/lib/cjs/components/Avatar/Avatar.mdx +14 -0
- package/lib/cjs/components/Badge/Badge.mdx +24 -0
- package/lib/cjs/components/Box/Box.d.ts +4 -0
- package/lib/cjs/components/Box/Box.js +4 -19
- package/lib/cjs/components/Box/Box.mdx +23 -0
- package/lib/cjs/components/Box/Box.styles.d.ts +6 -0
- package/lib/cjs/components/Box/Box.test.d.ts +1 -0
- package/lib/cjs/components/Box/Box.test.js +2 -6
- package/lib/cjs/components/Box/index.d.ts +1 -0
- package/lib/cjs/components/Bracket/Bracket.mdx +17 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
- package/lib/cjs/components/Button/Button.mdx +40 -0
- package/lib/cjs/components/Button/Button.stories.js +30 -5
- package/lib/cjs/components/Button/Buttons.styles.js +25 -7
- package/lib/cjs/components/Calendar/Calendar.mdx +39 -0
- package/lib/cjs/components/Callout/Callout.mdx +28 -0
- package/lib/cjs/components/Card/Card.mdx +32 -0
- package/lib/cjs/components/CheckboxField/CheckboxField.mdx +42 -0
- package/lib/cjs/components/CodeView/CodeView.mdx +23 -0
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
- package/lib/cjs/components/ColorField/ColorField.mdx +38 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.mdx +66 -0
- package/lib/cjs/components/CopyText/CopyText.mdx +23 -0
- package/lib/cjs/components/DataTable/DataTable.mdx +54 -0
- package/lib/cjs/components/DatePicker/DatePicker.mdx +49 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -1
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
- package/lib/cjs/components/FileInputField/FileInputField.mdx +33 -0
- package/lib/cjs/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/cjs/components/Icon/Icon.d.ts +4 -0
- package/lib/cjs/components/Icon/Icon.js +4 -27
- package/lib/cjs/components/Icon/Icon.mdx +49 -0
- package/lib/cjs/components/Icon/Icon.stories.d.ts +8 -0
- package/lib/cjs/components/Icon/Icon.test.d.ts +1 -0
- package/lib/cjs/components/Icon/index.d.ts +1 -0
- package/lib/cjs/components/IconBadge/IconBadge.mdx +14 -0
- package/lib/cjs/components/IconButton/IconButton.mdx +33 -0
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
- package/lib/cjs/components/Image/Image.mdx +28 -0
- package/lib/cjs/components/ImageUploadField/ImageUploadField.mdx +38 -0
- package/lib/cjs/components/Link/Link.mdx +27 -0
- package/lib/cjs/components/LinkSelectField/LinkSelectField.mdx +47 -0
- package/lib/cjs/components/ListItem/ListItem.mdx +21 -0
- package/lib/cjs/components/ListView/ListView.mdx +44 -0
- package/lib/cjs/components/ListView/ListView.stories.js +93 -47
- package/lib/cjs/components/Loader/Loader.d.ts +4 -0
- package/lib/cjs/components/Loader/Loader.js +0 -14
- package/lib/cjs/components/Loader/Loader.mdx +29 -0
- package/lib/cjs/components/Loader/Loader.styles.d.ts +53 -0
- package/lib/cjs/components/Loader/Loader.test.d.ts +1 -0
- package/lib/cjs/components/Loader/index.d.ts +1 -0
- package/lib/cjs/components/Menu/Menu.mdx +43 -0
- package/lib/cjs/components/Messages/Messages.mdx +35 -0
- package/lib/cjs/components/Modal/Modal.mdx +59 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.mdx +44 -0
- package/lib/cjs/components/NavBar/NavBar.mdx +42 -0
- package/lib/cjs/components/NumberField/NumberField.mdx +39 -0
- package/lib/cjs/components/OverlayPanel/OverlayPanel.mdx +39 -0
- package/lib/cjs/components/PasswordField/PasswordField.mdx +33 -0
- package/lib/cjs/components/PopoverContainer/PopoverContainer.d.ts +9 -0
- package/lib/cjs/components/PopoverContainer/PopoverContainer.js +7 -38
- package/lib/cjs/components/PopoverContainer/index.d.ts +2 -0
- package/lib/cjs/components/PopoverMenu/PopoverMenu.mdx +53 -0
- package/lib/cjs/components/RadioGroupField/RadioGroupField.mdx +41 -0
- package/lib/cjs/components/RequirementsList/RequirementsList.mdx +17 -0
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
- package/lib/cjs/components/ScrollBox/ScrollBox.mdx +17 -0
- package/lib/cjs/components/SearchField/SearchField.mdx +33 -0
- package/lib/cjs/components/SelectField/SelectField.mdx +46 -0
- package/lib/cjs/components/Separator/Separator.mdx +19 -0
- package/lib/cjs/components/Stepper/Stepper.mdx +41 -0
- package/lib/cjs/components/SwitchField/SwitchField.mdx +36 -0
- package/lib/cjs/components/Table/Table.mdx +30 -0
- package/lib/cjs/components/TableCell/TableCell.d.ts +12 -0
- package/lib/cjs/components/TableCell/TableCell.js +0 -5
- package/lib/cjs/components/TableCell/TableCell.test.d.ts +1 -0
- package/lib/cjs/components/TableCell/index.d.ts +1 -0
- package/lib/cjs/components/Tabs/Tabs.mdx +40 -0
- package/lib/cjs/components/Text/Text.d.ts +4 -0
- package/lib/cjs/components/Text/Text.js +3 -7
- package/lib/cjs/components/Text/Text.mdx +13 -0
- package/lib/cjs/components/Text/Text.stories.d.ts +6 -0
- package/lib/cjs/components/Text/Text.styles.d.ts +286 -0
- package/lib/cjs/components/Text/Text.test.d.ts +1 -0
- package/lib/cjs/components/Text/index.d.ts +1 -0
- package/lib/cjs/components/TextAreaField/TextAreaField.mdx +34 -0
- package/lib/cjs/components/TextField/TextField.mdx +34 -0
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.mdx +21 -0
- package/lib/cjs/docs/Props.stories.mdx +35 -0
- package/lib/cjs/docs/Welcome.stories.mdx +149 -0
- package/lib/cjs/docs/hooks/useDebounce.stories.mdx +59 -0
- package/lib/cjs/docs/hooks/useModalState.stories.mdx +83 -0
- package/lib/cjs/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
- package/lib/cjs/docs/theme/AstroNanoTheme.stories.mdx +174 -0
- package/lib/cjs/docs/theme/AstroTheme.stories.mdx +20 -0
- package/lib/cjs/docs/theme/CustomThemes.stories.mdx +70 -0
- package/lib/cjs/docs/theme/StylingGuideline.stories.mdx +116 -0
- package/lib/cjs/docs/utils/messagesReducer.stories.mdx +64 -0
- package/lib/cjs/experimental/EditButton/EditButton.js +63 -0
- package/lib/cjs/experimental/EditButton/EditButton.mdx +9 -0
- package/lib/cjs/experimental/EditButton/EditButton.stories.js +91 -0
- package/lib/cjs/experimental/EditButton/EditButton.test.js +71 -0
- package/lib/cjs/experimental/EditButton/index.js +14 -0
- package/lib/cjs/experimental/ListView/ListView.mdx +47 -0
- package/lib/cjs/experimental/ListView/ListView.stories.js +742 -0
- package/lib/cjs/experimental/ListViewItem/ListViewItem.js +23 -5
- package/lib/cjs/experimental/ListViewItem/ListViewItem.mdx +36 -0
- package/lib/cjs/experimental/ListViewItem/ListViewItem.stories.js +31 -7
- package/lib/cjs/experimental/ListViewItem/ListViewItem.test.js +51 -7
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.js +1 -4
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
- package/lib/cjs/experimental/ListViewItem/controls/ListViewItemSwitchField.js +1 -0
- package/lib/cjs/experimental/ListViewItem/listViewItemAttributes.js +28 -13
- package/lib/cjs/experimental/PanelHeader/PanelHeader.js +88 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.mdx +19 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.stories.js +71 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.styles.js +38 -0
- package/lib/cjs/experimental/PanelHeader/PanelHeader.test.js +46 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +34 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +31 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +25 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.js +27 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +36 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +58 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +27 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +41 -0
- package/lib/cjs/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +25 -0
- package/lib/cjs/experimental/PanelHeader/index.js +14 -0
- package/lib/cjs/experimental/README.stories.mdx +7 -0
- package/lib/cjs/experimental/SaveBar/SaveBar.mdx +13 -0
- package/lib/cjs/experimental/recipes/ListAndPanel.stories.js +1 -1
- package/lib/cjs/hooks/usePropWarning/usePropWarning.js +1 -1
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.js +2 -2
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.js +1 -1
- package/lib/cjs/index.d.ts +173 -0
- package/lib/cjs/index.js +53 -1
- package/lib/cjs/recipes/{AttributesAndPingOneMapping.stories.js → AttributeMapping.stories.js} +392 -132
- package/lib/cjs/styles/colors.js +1 -1
- package/lib/cjs/styles/variants/README.md +98 -0
- package/lib/cjs/styles/variants/variants.js +2 -0
- package/lib/cjs/types/box.d.ts +10 -0
- package/lib/cjs/types/box.js +6 -0
- package/lib/cjs/types/icon.d.ts +34 -0
- package/lib/cjs/types/icon.js +6 -0
- package/lib/cjs/types/index.d.ts +7 -0
- package/lib/cjs/types/index.js +86 -0
- package/lib/cjs/types/loader.d.ts +14 -0
- package/lib/cjs/types/loader.js +6 -0
- package/lib/cjs/types/mdx.d.js +1 -0
- package/lib/cjs/types/popoverContainer.d.ts +23 -0
- package/lib/cjs/types/popoverContainer.js +6 -0
- package/lib/cjs/types/shared/dom.d.ts +9 -0
- package/lib/cjs/types/shared/dom.js +6 -0
- package/lib/cjs/types/shared/index.d.ts +3 -0
- package/lib/cjs/types/shared/index.js +42 -0
- package/lib/cjs/types/shared/style.d.ts +11 -0
- package/lib/cjs/types/shared/style.js +6 -0
- package/lib/cjs/types/shared/test.d.ts +3 -0
- package/lib/cjs/types/shared/test.js +6 -0
- package/lib/cjs/types/shared/utils.d.ts +1 -0
- package/lib/cjs/types/shared/utils.js +6 -0
- package/lib/cjs/types/tableCell.d.ts +5 -0
- package/lib/cjs/types/tableCell.js +6 -0
- package/lib/cjs/types/text.d.ts +3 -0
- package/lib/cjs/types/text.js +6 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.mdx +40 -0
- package/lib/components/AccordionGroup/Accordion.styles.js +1 -2
- package/lib/components/AccordionGroup/AccordionGroup.mdx +41 -0
- package/lib/components/ArrayField/ArrayField.mdx +34 -0
- package/lib/components/AstroWrapper/AstroWrapper.mdx +16 -0
- package/lib/components/Avatar/Avatar.mdx +14 -0
- package/lib/components/Badge/Badge.mdx +24 -0
- package/lib/components/Box/Box.js +4 -19
- package/lib/components/Box/Box.mdx +23 -0
- package/lib/components/Box/Box.test.js +2 -6
- package/lib/components/Bracket/Bracket.mdx +17 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.mdx +40 -0
- package/lib/components/Button/Button.mdx +40 -0
- package/lib/components/Button/Button.stories.js +30 -5
- package/lib/components/Button/Buttons.styles.js +25 -7
- package/lib/components/Calendar/Calendar.mdx +39 -0
- package/lib/components/Callout/Callout.mdx +28 -0
- package/lib/components/Card/Card.mdx +32 -0
- package/lib/components/CheckboxField/CheckboxField.mdx +42 -0
- package/lib/components/CodeView/CodeView.mdx +23 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.mdx +29 -0
- package/lib/components/ColorField/ColorField.mdx +38 -0
- package/lib/components/ComboBoxField/ComboBoxField.mdx +66 -0
- package/lib/components/CopyText/CopyText.mdx +23 -0
- package/lib/components/DataTable/DataTable.mdx +54 -0
- package/lib/components/DatePicker/DatePicker.mdx +49 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +2 -1
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.mdx +36 -0
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +29 -45
- package/lib/components/FileInputField/FileInputField.mdx +33 -0
- package/lib/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/components/Icon/Icon.js +2 -25
- package/lib/components/Icon/Icon.mdx +49 -0
- package/lib/components/IconBadge/IconBadge.mdx +14 -0
- package/lib/components/IconButton/IconButton.mdx +33 -0
- package/lib/components/IconButtonToggle/IconButtonToggle.mdx +31 -0
- package/lib/components/Image/Image.mdx +28 -0
- package/lib/components/ImageUploadField/ImageUploadField.mdx +38 -0
- package/lib/components/Link/Link.mdx +27 -0
- package/lib/components/LinkSelectField/LinkSelectField.mdx +47 -0
- package/lib/components/ListItem/ListItem.mdx +21 -0
- package/lib/components/ListView/ListView.mdx +44 -0
- package/lib/components/ListView/ListView.stories.js +94 -48
- package/lib/components/Loader/Loader.js +0 -14
- package/lib/components/Loader/Loader.mdx +29 -0
- package/lib/components/Menu/Menu.mdx +43 -0
- package/lib/components/Messages/Messages.mdx +35 -0
- package/lib/components/Modal/Modal.mdx +59 -0
- package/lib/components/MultivaluesField/MultivaluesField.mdx +44 -0
- package/lib/components/NavBar/NavBar.mdx +42 -0
- package/lib/components/NumberField/NumberField.mdx +39 -0
- package/lib/components/OverlayPanel/OverlayPanel.mdx +39 -0
- package/lib/components/PasswordField/PasswordField.mdx +33 -0
- package/lib/components/PopoverContainer/PopoverContainer.js +7 -38
- package/lib/components/PopoverMenu/PopoverMenu.mdx +53 -0
- package/lib/components/RadioGroupField/RadioGroupField.mdx +41 -0
- package/lib/components/RequirementsList/RequirementsList.mdx +17 -0
- package/lib/components/RockerButtonGroup/RockerButtonGroup.mdx +36 -0
- package/lib/components/ScrollBox/ScrollBox.mdx +17 -0
- package/lib/components/SearchField/SearchField.mdx +33 -0
- package/lib/components/SelectField/SelectField.mdx +46 -0
- package/lib/components/Separator/Separator.mdx +19 -0
- package/lib/components/Stepper/Stepper.mdx +41 -0
- package/lib/components/SwitchField/SwitchField.mdx +36 -0
- package/lib/components/Table/Table.mdx +30 -0
- package/lib/components/TableCell/TableCell.js +0 -5
- package/lib/components/Tabs/Tabs.mdx +40 -0
- package/lib/components/Text/Text.js +3 -7
- package/lib/components/Text/Text.mdx +13 -0
- package/lib/components/TextAreaField/TextAreaField.mdx +34 -0
- package/lib/components/TextField/TextField.mdx +34 -0
- package/lib/components/TimeZonePicker/TimeZonePicker.mdx +18 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.mdx +21 -0
- package/lib/docs/Props.stories.mdx +35 -0
- package/lib/docs/Welcome.stories.mdx +149 -0
- package/lib/docs/hooks/useDebounce.stories.mdx +59 -0
- package/lib/docs/hooks/useModalState.stories.mdx +83 -0
- package/lib/docs/hooks/useOverlayPanelState.stories.mdx +84 -0
- package/lib/docs/theme/AstroNanoTheme.stories.mdx +174 -0
- package/lib/docs/theme/AstroTheme.stories.mdx +20 -0
- package/lib/docs/theme/CustomThemes.stories.mdx +70 -0
- package/lib/docs/theme/StylingGuideline.stories.mdx +116 -0
- package/lib/docs/utils/messagesReducer.stories.mdx +64 -0
- package/lib/experimental/EditButton/EditButton.js +50 -0
- package/lib/experimental/EditButton/EditButton.mdx +9 -0
- package/lib/experimental/EditButton/EditButton.stories.js +75 -0
- package/lib/experimental/EditButton/EditButton.test.js +68 -0
- package/lib/experimental/EditButton/index.js +1 -0
- package/lib/experimental/ListView/ListView.mdx +47 -0
- package/lib/experimental/ListView/ListView.stories.js +729 -0
- package/lib/experimental/ListViewItem/ListViewItem.js +24 -6
- package/lib/experimental/ListViewItem/ListViewItem.mdx +36 -0
- package/lib/experimental/ListViewItem/ListViewItem.stories.js +28 -5
- package/lib/experimental/ListViewItem/ListViewItem.test.js +45 -1
- package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.js +1 -4
- package/lib/experimental/ListViewItem/controls/ListViewItemEditButton.stories.js +4 -1
- package/lib/experimental/ListViewItem/controls/ListViewItemSwitchField.js +1 -0
- package/lib/experimental/ListViewItem/listViewItemAttributes.js +25 -12
- package/lib/experimental/PanelHeader/PanelHeader.js +75 -0
- package/lib/experimental/PanelHeader/PanelHeader.mdx +19 -0
- package/lib/experimental/PanelHeader/PanelHeader.stories.js +59 -0
- package/lib/experimental/PanelHeader/PanelHeader.styles.js +30 -0
- package/lib/experimental/PanelHeader/PanelHeader.test.js +43 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.js +25 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.stories.js +21 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderCloseButton.test.js +22 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.js +18 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.stories.js +26 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderMenu.test.js +55 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.js +18 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.stories.js +32 -0
- package/lib/experimental/PanelHeader/controls/PanelHeaderSwitchField.test.js +22 -0
- package/lib/experimental/PanelHeader/index.js +1 -0
- package/lib/experimental/README.stories.mdx +7 -0
- package/lib/experimental/SaveBar/SaveBar.mdx +13 -0
- package/lib/experimental/recipes/ListAndPanel.stories.js +1 -1
- package/lib/hooks/usePropWarning/usePropWarning.js +1 -1
- package/lib/hooks/useStatusClasses/useStatusClasses.js +2 -2
- package/lib/hooks/useTShirtSize/useTShirtSize.js +1 -1
- package/lib/index.js +6 -0
- package/lib/recipes/AttributeMapping.stories.js +540 -0
- package/lib/styles/colors.js +1 -1
- package/lib/styles/variants/README.md +98 -0
- package/lib/styles/variants/variants.js +2 -0
- package/lib/types/box.js +1 -0
- package/lib/types/icon.js +1 -0
- package/lib/types/index.js +7 -0
- package/lib/types/loader.js +1 -0
- package/lib/types/mdx.d.js +0 -0
- package/lib/types/popoverContainer.js +1 -0
- package/lib/types/shared/dom.js +1 -0
- package/lib/types/shared/index.js +3 -0
- package/lib/types/shared/style.js +1 -0
- package/lib/types/shared/test.js +1 -0
- package/lib/types/shared/utils.js +1 -0
- package/lib/types/tableCell.js +1 -0
- package/lib/types/text.js +1 -0
- package/package.json +19 -5
- package/CHANGELOG.md +0 -2565
- package/NOTICE +0 -2481
- package/NOTICE.html +0 -9174
- package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +0 -254
- package/lib/recipes/AttributeMappingReadOnlyField.stories.js +0 -243
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +0 -282
@@ -0,0 +1,98 @@
|
|
1
|
+
# Variant Naming Conventions
|
2
|
+
|
3
|
+
Variant names should be camel case so that dot notation can be used, e.g. `delete theme.buttons.myButton`.
|
4
|
+
|
5
|
+
When it comes to mapping the variant within the theme, the foundation of a component is the main differentiator. There are two types currently:
|
6
|
+
1. Components which leverage a Theme UI base
|
7
|
+
2. Custom components or layout components, often built on the `Box` component
|
8
|
+
|
9
|
+
If a component is built on top of a Theme UI component, we follow their existing [variant groups](https://theme-ui.com/components/variants), e.g. any variant for an `IconButton` should be placed within the `buttons` object in the theme because it uses the `IconButton` from Theme UI as its base.
|
10
|
+
|
11
|
+
If a component is custom or used for layout purposes, it will often have `Box` as its base. For these components, we create our own variant group for it under the `variants` object in the theme, e.g. `variants.modal`. Within this object is typically where internal layout variants will go for that component, e.g. `variants.modal.container`. NOTE: You don't need to specify `variants` in the naming, it's just used here for demo purposes.
|
12
|
+
|
13
|
+
|
14
|
+
## Example of component with Theme UI base
|
15
|
+
|
16
|
+
In the example below, `MyBadge` utilizes the Astro `Badge` component which is based on the Theme UI `Badge` component. The object within `MyBadge.styles.js` would then be exported as part of the theme within the `badges` object.
|
17
|
+
|
18
|
+
```js
|
19
|
+
// `src/components/MyBadge/MyBadge.js`
|
20
|
+
const MyBadge = () => <Badge variant="myBadge" />;
|
21
|
+
|
22
|
+
// `src/components/MyBadge/MyBadge.styles.js`
|
23
|
+
const myBadge = { backgroundColor: 'red' };
|
24
|
+
export default { myBadge };
|
25
|
+
|
26
|
+
// `src/styles/variants/index.js`
|
27
|
+
import defaultBadges from '../../components/Badge/Badge.styles';
|
28
|
+
import myBadge from '../../components/MyBadge/MyBadge.styles';
|
29
|
+
export const badges = { ...defaultBadges, ...myBadge };
|
30
|
+
|
31
|
+
// `src/styles/theme.js`
|
32
|
+
import { badges } from './variants';
|
33
|
+
const theme = { badges };
|
34
|
+
```
|
35
|
+
|
36
|
+
This results in a `theme` object as such:
|
37
|
+
|
38
|
+
```json
|
39
|
+
{
|
40
|
+
"badges": {
|
41
|
+
"myBadge": { "backgroundColor": "red" }
|
42
|
+
}
|
43
|
+
}
|
44
|
+
```
|
45
|
+
|
46
|
+
## Example of custom component and internal layout components
|
47
|
+
|
48
|
+
In the example below, `MyComponent` is custom and has `Box` as its foundation. It also includes layout components and a `Button`. Since the `Button` component is built on a Theme UI base, it will follow the variant naming rules for those types of components. The object within `MyComponent.styles.js` should then be exported as part of the theme within the `variants` object.
|
49
|
+
|
50
|
+
```js
|
51
|
+
// `src/components/MyComponent/MyComponent.js`
|
52
|
+
const MyComponent = () => (
|
53
|
+
<Box variant="myComponent.container">
|
54
|
+
<Box variant="myComponent.leftSide" />
|
55
|
+
<Box variant="myComponent.rightSide" />
|
56
|
+
{/* The Button variant is exported differently in the theme */}
|
57
|
+
<Button variant="myComponentButton">Click me</Button>
|
58
|
+
</Box>
|
59
|
+
);
|
60
|
+
|
61
|
+
// `src/components/MyComponent/MyComponent.styles.js`
|
62
|
+
export const myComponentButton = { backgroundColor: 'critical' };
|
63
|
+
const container = { paddingTop: 'xl' };
|
64
|
+
const leftSide = { width: '100px', backgroundColor: 'green' };
|
65
|
+
const rightSide = { width: '20px', backgroundColor: 'orange' };
|
66
|
+
export default { container, leftSide, rightSide };
|
67
|
+
|
68
|
+
// `src/styles/variants/variants.js`
|
69
|
+
import myComponent from '../../components/MyComponent/MyComponent.styles';
|
70
|
+
export default { myComponent };
|
71
|
+
|
72
|
+
// `src/styles/variants/index.js`
|
73
|
+
import defaultButtons from '../../components/Button/Button.styles';
|
74
|
+
import { myComponentButton } from '../../components/MyComponent/MyComponent.styles';
|
75
|
+
export const buttons = { ...defaultButtons, myComponentButton };
|
76
|
+
export { default as variants } from './variants';
|
77
|
+
|
78
|
+
// `src/styles/theme.js`
|
79
|
+
import { buttons, variants } from './variants';
|
80
|
+
const theme = { buttons, variants };
|
81
|
+
```
|
82
|
+
|
83
|
+
This results in a `theme` object as such:
|
84
|
+
|
85
|
+
```json
|
86
|
+
{
|
87
|
+
"buttons": {
|
88
|
+
"myComponentButton": { "backgroundColor": "critical" }
|
89
|
+
},
|
90
|
+
"variants": {
|
91
|
+
"myComponent": {
|
92
|
+
"container": { "paddingTop": "xl" },
|
93
|
+
"leftSide": { "width": "100px", "backgroundColor": "green" },
|
94
|
+
"rightSide": { "width": "20px", "backgroundColor": "orange" }
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
```
|
@@ -50,6 +50,7 @@ var _Table = _interopRequireDefault(require("../../components/Table/Table.styles
|
|
50
50
|
var tab = _interopRequireWildcard(require("../../components/Tabs/Tabs.style"));
|
51
51
|
var _TimeZone = _interopRequireDefault(require("../../components/TimeZonePicker/TimeZone.styles"));
|
52
52
|
var _Tooltip = _interopRequireDefault(require("../../components/TooltipTrigger/Tooltip.styles"));
|
53
|
+
var _PanelHeader = _interopRequireDefault(require("../../experimental/PanelHeader/PanelHeader.styles"));
|
53
54
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
54
55
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
55
56
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
@@ -81,6 +82,7 @@ var _default = _objectSpread({
|
|
81
82
|
navBar: _NavBar["default"],
|
82
83
|
overlayPanel: _OverlayPanel["default"],
|
83
84
|
popoverMenu: _PopoverMenu["default"],
|
85
|
+
panelHeader: _PanelHeader["default"],
|
84
86
|
rockerButton: _RockerButton["default"],
|
85
87
|
scrollBox: _ScrollBox["default"],
|
86
88
|
separator: _Separator["default"],
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { StylePropertyValue } from 'theme-ui';
|
2
|
+
import { DOMAttributes, StyleProps } from './shared';
|
3
|
+
export interface BoxProps extends StyleProps, DOMAttributes {
|
4
|
+
/** The background color of the box. */
|
5
|
+
bg?: StylePropertyValue<string | undefined>;
|
6
|
+
/** When true, display as a row rather than a column. */
|
7
|
+
isRow?: boolean;
|
8
|
+
/** Whether the box is disabled. */
|
9
|
+
isDisabled?: boolean;
|
10
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
import { TestingAttributes } from './shared/test';
|
3
|
+
import { DOMAttributes, StyleProps } from './shared';
|
4
|
+
export type SVGComponentProps = {
|
5
|
+
title?: string;
|
6
|
+
};
|
7
|
+
export type IconTypeExtended = ReactNode & {
|
8
|
+
type: {
|
9
|
+
name: string;
|
10
|
+
};
|
11
|
+
} | React.ElementType;
|
12
|
+
export interface IconProps extends StyleProps, DOMAttributes, TestingAttributes {
|
13
|
+
/**
|
14
|
+
* The title associated with the icon. It is recommended that icons always have an associated
|
15
|
+
* title in order to allow a better user experience for those using screen readers.
|
16
|
+
* The **`id`** in the title object will be the id of the title and
|
17
|
+
* is also what will be supplied to the **`aria-labelledby`** attribute in the SVG.
|
18
|
+
* The **`name`** in the title object will be the content of the title.
|
19
|
+
* This prop can only be used when importing the icon from [@pingux/mdi-react](https://www.npmjs.com/package/@pingux/mdi-react).
|
20
|
+
* */
|
21
|
+
title?: {
|
22
|
+
id?: string;
|
23
|
+
name: string;
|
24
|
+
};
|
25
|
+
/** The icon to render. */
|
26
|
+
icon: IconTypeExtended;
|
27
|
+
/**
|
28
|
+
* The size of the icon container. If given a number value, it will be converted to pixels.
|
29
|
+
* Tshirt sizing is recommended and can be passed to the size prop as 'xs', 'sm' , 'md'
|
30
|
+
* rendering 15, 20, and 25 pixel svg containers. */
|
31
|
+
size?: number | string;
|
32
|
+
/** A theme-aware prop to set the icon's color. */
|
33
|
+
color?: string;
|
34
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7;
|
4
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
var _box = require("./box");
|
11
|
+
_forEachInstanceProperty(_context = _Object$keys(_box)).call(_context, function (key) {
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
13
|
+
if (key in exports && exports[key] === _box[key]) return;
|
14
|
+
_Object$defineProperty(exports, key, {
|
15
|
+
enumerable: true,
|
16
|
+
get: function get() {
|
17
|
+
return _box[key];
|
18
|
+
}
|
19
|
+
});
|
20
|
+
});
|
21
|
+
var _icon = require("./icon");
|
22
|
+
_forEachInstanceProperty(_context2 = _Object$keys(_icon)).call(_context2, function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
if (key in exports && exports[key] === _icon[key]) return;
|
25
|
+
_Object$defineProperty(exports, key, {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _icon[key];
|
29
|
+
}
|
30
|
+
});
|
31
|
+
});
|
32
|
+
var _loader = require("./loader");
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_loader)).call(_context3, function (key) {
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
35
|
+
if (key in exports && exports[key] === _loader[key]) return;
|
36
|
+
_Object$defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _loader[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
var _popoverContainer = require("./popoverContainer");
|
44
|
+
_forEachInstanceProperty(_context4 = _Object$keys(_popoverContainer)).call(_context4, function (key) {
|
45
|
+
if (key === "default" || key === "__esModule") return;
|
46
|
+
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
47
|
+
_Object$defineProperty(exports, key, {
|
48
|
+
enumerable: true,
|
49
|
+
get: function get() {
|
50
|
+
return _popoverContainer[key];
|
51
|
+
}
|
52
|
+
});
|
53
|
+
});
|
54
|
+
var _shared = require("./shared");
|
55
|
+
_forEachInstanceProperty(_context5 = _Object$keys(_shared)).call(_context5, function (key) {
|
56
|
+
if (key === "default" || key === "__esModule") return;
|
57
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
58
|
+
_Object$defineProperty(exports, key, {
|
59
|
+
enumerable: true,
|
60
|
+
get: function get() {
|
61
|
+
return _shared[key];
|
62
|
+
}
|
63
|
+
});
|
64
|
+
});
|
65
|
+
var _tableCell = require("./tableCell");
|
66
|
+
_forEachInstanceProperty(_context6 = _Object$keys(_tableCell)).call(_context6, function (key) {
|
67
|
+
if (key === "default" || key === "__esModule") return;
|
68
|
+
if (key in exports && exports[key] === _tableCell[key]) return;
|
69
|
+
_Object$defineProperty(exports, key, {
|
70
|
+
enumerable: true,
|
71
|
+
get: function get() {
|
72
|
+
return _tableCell[key];
|
73
|
+
}
|
74
|
+
});
|
75
|
+
});
|
76
|
+
var _text = require("./text");
|
77
|
+
_forEachInstanceProperty(_context7 = _Object$keys(_text)).call(_context7, function (key) {
|
78
|
+
if (key === "default" || key === "__esModule") return;
|
79
|
+
if (key in exports && exports[key] === _text[key]) return;
|
80
|
+
_Object$defineProperty(exports, key, {
|
81
|
+
enumerable: true,
|
82
|
+
get: function get() {
|
83
|
+
return _text[key];
|
84
|
+
}
|
85
|
+
});
|
86
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { StyleProps } from './shared';
|
2
|
+
export interface LoaderProps extends StyleProps {
|
3
|
+
/**
|
4
|
+
* Color key from theme or string value.
|
5
|
+
* Default color inherits the font color.
|
6
|
+
*/
|
7
|
+
color?: string;
|
8
|
+
/**
|
9
|
+
* Size as number or pixel / em / rem value.
|
10
|
+
* Sizes can either be a string such as xs, sm, md, etc or numeric size with unit such as 15px.
|
11
|
+
* Default size inherits the font size.
|
12
|
+
*/
|
13
|
+
size?: number | string;
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { DOMAttributes, Modify, StyleProps } from './shared';
|
2
|
+
type PopoverPlacement = 'top' | 'right' | 'bottom' | 'left';
|
3
|
+
type StylePropsExtended = Modify<StyleProps, {
|
4
|
+
direction?: PopoverPlacement;
|
5
|
+
}>;
|
6
|
+
export interface PopoverArrowProps extends DOMAttributes, StylePropsExtended {
|
7
|
+
arrowCrossOffset?: string;
|
8
|
+
}
|
9
|
+
export interface PopoverContainerProps extends StylePropsExtended, DOMAttributes {
|
10
|
+
placement?: string;
|
11
|
+
arrowProps?: PopoverArrowProps;
|
12
|
+
arrowCrossOffset?: string;
|
13
|
+
onClose?(): unknown;
|
14
|
+
isNotClosedOnBlur?: boolean;
|
15
|
+
hasNoArrow?: boolean;
|
16
|
+
isKeyboardDismissDisabled?: boolean;
|
17
|
+
isNonModal?: boolean;
|
18
|
+
isDismissable?: boolean;
|
19
|
+
}
|
20
|
+
export interface PopoverWrapperProps extends PopoverContainerProps {
|
21
|
+
isOpen?: boolean;
|
22
|
+
}
|
23
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React, { AriaAttributes, DOMAttributes as ReactDOMAttributes } from 'react';
|
2
|
+
export type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & Record<string, unknown>);
|
3
|
+
export interface FocusableElement extends Element, HTMLOrSVGElement {
|
4
|
+
}
|
5
|
+
export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, ReactDOMAttributes<T> {
|
6
|
+
role?: AriaRole | undefined;
|
7
|
+
className?: string | undefined;
|
8
|
+
}
|
9
|
+
export type ReactRef = React.Ref<HTMLElement>;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _context, _context2, _context3;
|
4
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
|
+
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
8
|
+
value: true
|
9
|
+
});
|
10
|
+
var _dom = require("./dom");
|
11
|
+
_forEachInstanceProperty(_context = _Object$keys(_dom)).call(_context, function (key) {
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
13
|
+
if (key in exports && exports[key] === _dom[key]) return;
|
14
|
+
_Object$defineProperty(exports, key, {
|
15
|
+
enumerable: true,
|
16
|
+
get: function get() {
|
17
|
+
return _dom[key];
|
18
|
+
}
|
19
|
+
});
|
20
|
+
});
|
21
|
+
var _style = require("./style");
|
22
|
+
_forEachInstanceProperty(_context2 = _Object$keys(_style)).call(_context2, function (key) {
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
24
|
+
if (key in exports && exports[key] === _style[key]) return;
|
25
|
+
_Object$defineProperty(exports, key, {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _style[key];
|
29
|
+
}
|
30
|
+
});
|
31
|
+
});
|
32
|
+
var _utils = require("./utils");
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_utils)).call(_context3, function (key) {
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
35
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
36
|
+
_Object$defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _utils[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { SxProp, ThemeUICSSObject, ThemeUICSSProperties } from 'theme-ui';
|
3
|
+
export type SxObject = {
|
4
|
+
[styleKey: string]: ThemeUICSSObject;
|
5
|
+
};
|
6
|
+
export interface StyleProps extends ThemeUICSSProperties, SxProp {
|
7
|
+
/** The styling variation of the element. */
|
8
|
+
variant?: string;
|
9
|
+
/** The base HTML tag name or React component type to render */
|
10
|
+
as?: string | React.ReactNode | React.ElementType;
|
11
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type Modify<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/AccordionGridGroup/AccordionGridGroup" />
|
4
|
+
|
5
|
+
# AccordionGridGroup
|
6
|
+
|
7
|
+
The AccordionGrid component combines the look and functionality of a grid with that of an accordion, and is a composite component with two children:
|
8
|
+
- The header, which controls the expansion of the body.
|
9
|
+
- The body, which renders the content.
|
10
|
+
|
11
|
+
The purpose of this component is to allow keyboard interaction with the children passed into the body and header. Use it to pass complex or focusable components into an accordion component.
|
12
|
+
It should have clear, concise labels, and should not be used for small amounts of static text. Use [Box](./?path=/story/components-box--default) instead.
|
13
|
+
|
14
|
+
### Required components
|
15
|
+
|
16
|
+
This component requires the Header, Body and Item originating from [react-stately/collections](https://react-spectrum.adobe.com/react-stately/collections.html).
|
17
|
+
|
18
|
+
### Accessibility
|
19
|
+
|
20
|
+
This component should adhere to the [WAI-ARIA Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion) accessibility guidelines.
|
21
|
+
|
22
|
+
#### Keyboard Navigation
|
23
|
+
|
24
|
+
These keys provide additional functionality to the component.
|
25
|
+
|
26
|
+
| Keys | Functions |
|
27
|
+
| ---- | --------- |
|
28
|
+
| Space or Enter | When focus is on the header panel of a collapsed section, these keys toggle the component. |
|
29
|
+
| Tab | Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.|
|
30
|
+
| Shift + Tab | Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence. |
|
31
|
+
| Arrow Keys | All components are accessible using arrow keys. |
|
32
|
+
|
33
|
+
#### Screen readers
|
34
|
+
|
35
|
+
This component uses the following attributes to assist screen readers:
|
36
|
+
|
37
|
+
- The accordion grid item header button uses the **`aria-selected`** attribute to indicate the selection state of the row.
|
38
|
+
- The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.
|
39
|
+
- The **`aria-multiselectable`** attribute indicates that the user can toggle numerous items from the grid.
|
40
|
+
- The grid uses the **`aria-label`** attribute to provide an accessible name.
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/AccordionGroup/AccordionGroup" />
|
4
|
+
|
5
|
+
# AccordionGroup
|
6
|
+
|
7
|
+
Accordions are for grouping big chunks of content into easier-to-scan headers, which the user can expand when they want to read what is associated with that header.
|
8
|
+
|
9
|
+
Accordions should be used:
|
10
|
+
- To organize related information.
|
11
|
+
- To shorten pages and reduce scrolling when it’s not crucial that users review the content.
|
12
|
+
- When white space is at a minimum and content cannot be displayed all at once.
|
13
|
+
|
14
|
+
Accordions should not have focusable items as children.
|
15
|
+
|
16
|
+
It is built on React Aria [useAccordion](https://reactspectrum.blob.core.windows.net/reactspectrum/d77b35e970e5549f66b47a83f07423f5c93b7297/docs/react-aria/useAccordion.html).
|
17
|
+
|
18
|
+
### Required components
|
19
|
+
|
20
|
+
This component requires Item originating from [react-stately/collections](https://react-spectrum.adobe.com/react-stately/collections.html).
|
21
|
+
|
22
|
+
### Accessibility
|
23
|
+
|
24
|
+
This component should adhere to the [WAI-ARIA Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/examples/accordion) accessibility guidelines.
|
25
|
+
|
26
|
+
#### Keyboard Navigation
|
27
|
+
|
28
|
+
These keys provide additional functionality to the component.
|
29
|
+
|
30
|
+
| Keys | Functions |
|
31
|
+
| ---- | --------- |
|
32
|
+
| Space or Enter | When focus is on the accordion header of a collapsed section, these keys expand the section. |
|
33
|
+
| Tab | Moves focus to the next focusable component. All focusable components in the accordion are included in the page tab sequence.|
|
34
|
+
| Shift + Tab | Moves focus to the previous focusable component. All focusable components in the accordion are included in the page tab sequence. |
|
35
|
+
|
36
|
+
#### Screen readers
|
37
|
+
|
38
|
+
This component uses the following attributes to assist screen readers:
|
39
|
+
- The accordion header button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.
|
40
|
+
- When expanded, the **`aria-controls`** attribute is added to the button pointing to the content. The button uses **`aria-label`** to provide an accessible name.
|
41
|
+
- The **`aria-labelledby`** attribute is added to the entire accordion component, which is supplied with the button ID.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/ArrayField/ArrayField" />
|
4
|
+
|
5
|
+
# ArrayField
|
6
|
+
|
7
|
+
The component displays array collections to provide useful functions and optimizations for arrays.
|
8
|
+
|
9
|
+
ArrayField should:
|
10
|
+
- Be used for dynamic-sized arrays/lists.
|
11
|
+
- Be used with common array/list manipulations.
|
12
|
+
- Be used to create an instance or collect information.
|
13
|
+
|
14
|
+
### Required Components
|
15
|
+
|
16
|
+
This component requires the appropriate field component ([TextField](./?path=/story/form-textfield--default) or [SelectField](./?path=/story/form-selectfield--default)) and the ArrayFieldDeleteButton.
|
17
|
+
|
18
|
+
### Accessibility
|
19
|
+
|
20
|
+
#### Keyboard Navigation
|
21
|
+
|
22
|
+
These keys provide additional functionality to the component.
|
23
|
+
|
24
|
+
| Keys | Functions |
|
25
|
+
| ---- | ---- |
|
26
|
+
| Space or Enter | When focused, selects the item. |
|
27
|
+
| Tab | Moves focus to the next focusable component and follows the page tab sequence. |
|
28
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
29
|
+
|
30
|
+
#### Screen Readers
|
31
|
+
|
32
|
+
This component uses the following attributes to assist screen readers:
|
33
|
+
- The input uses the **`aria-invalid`** attribute to alert users that the values entered are not in the expected format.
|
34
|
+
- The field and buttons use the **`aria-label`** attribute to provide accessible names.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/AstroWrapper/AstroWrapper" />
|
4
|
+
|
5
|
+
# AstroWrapper
|
6
|
+
|
7
|
+
The AstroWrapper component provides a standard background, global styles, and the Astro theme, by default. This component should be used:
|
8
|
+
- Sparingly and cautiously when altering the default theme.
|
9
|
+
- With the **`themeOverrides`** prop to change some base theme properties.
|
10
|
+
- When targeting multiple components on a global scale.
|
11
|
+
|
12
|
+
It should not be used for minor CSS alterations. Use sx objects instead.
|
13
|
+
|
14
|
+
### Required components
|
15
|
+
|
16
|
+
This component can be used independently and does not require additional components.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Avatar/Avatar" />
|
4
|
+
|
5
|
+
# Avatar
|
6
|
+
|
7
|
+
Avatars are graphical representations of a user, and are usually photos, illustrations, or the user’s initials. When photos or illustrations aren’t available, the user’s initials are used instead.
|
8
|
+
The alternate text used on the image cannot be empty as it describes the function/appearance of the image.
|
9
|
+
|
10
|
+
This component is built on [Avatar from Theme-UI](https://theme-ui.com/components/avatar/).
|
11
|
+
|
12
|
+
### Required components
|
13
|
+
|
14
|
+
This component can be used independently and does not require additional components.
|