@pingux/astro 2.9.1 → 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 +20 -6
- package/CHANGELOG.md +0 -2554
- 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
package/README.md
CHANGED
@@ -14,9 +14,13 @@ Yarn:
|
|
14
14
|
|
15
15
|
## Requirements
|
16
16
|
|
17
|
-
- Node:
|
17
|
+
- Node: 18+
|
18
18
|
- React: 16.8+
|
19
19
|
|
20
|
+
## Typescript
|
21
|
+
|
22
|
+
Run `yarn dlx @yarnpkg/sdks vscode` and reload the window to configure vscode for TypeScript.
|
23
|
+
|
20
24
|
## Usage
|
21
25
|
|
22
26
|
All apps should be wrapped in an `<AstroWrapper>` for full functionality and styling.
|
@@ -89,4 +93,4 @@ ESLint packages or versions these features may stop working. Run this command ag
|
|
89
93
|
|
90
94
|
## Licensing
|
91
95
|
|
92
|
-
This project is licensed under the Apache license. See the [LICENSE](LICENSE) file for more information.
|
96
|
+
This project is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for more information.
|
package/lib/README.md
CHANGED
@@ -14,9 +14,13 @@ Yarn:
|
|
14
14
|
|
15
15
|
## Requirements
|
16
16
|
|
17
|
-
- Node:
|
17
|
+
- Node: 18+
|
18
18
|
- React: 16.8+
|
19
19
|
|
20
|
+
## Typescript
|
21
|
+
|
22
|
+
Run `yarn dlx @yarnpkg/sdks vscode` and reload the window to configure vscode for TypeScript.
|
23
|
+
|
20
24
|
## Usage
|
21
25
|
|
22
26
|
All apps should be wrapped in an `<AstroWrapper>` for full functionality and styling.
|
@@ -89,4 +93,4 @@ ESLint packages or versions these features may stop working. Run this command ag
|
|
89
93
|
|
90
94
|
## Licensing
|
91
95
|
|
92
|
-
This project is licensed under the Apache license. See the [LICENSE](LICENSE) file for more information.
|
96
|
+
This project is licensed under the Apache 2.0 license. See the [LICENSE](LICENSE) file for more information.
|
@@ -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.
|
@@ -48,8 +48,7 @@ var header = _objectSpread(_objectSpread({}, _Buttons.base), {}, {
|
|
48
48
|
display: 'inline-flex',
|
49
49
|
bg: 'transparent',
|
50
50
|
color: 'neutral.10',
|
51
|
-
|
52
|
-
paddingRight: '5px',
|
51
|
+
padding: '0 5px',
|
53
52
|
flexGrow: 0,
|
54
53
|
fontWeight: 700,
|
55
54
|
'&.is-hovered': {
|
@@ -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.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Badge/Badge" />
|
4
|
+
|
5
|
+
# Badge
|
6
|
+
|
7
|
+
Badges are compact Box components used as filtering cues or contextual support. They should be clearly labeled and should not be used as buttons.
|
8
|
+
|
9
|
+
This component uses [props from Theme-UI](https://theme-ui.com/sx-prop).
|
10
|
+
|
11
|
+
### Required Components
|
12
|
+
|
13
|
+
This component can be used independently and does not require additional components.
|
14
|
+
|
15
|
+
### Accessibility
|
16
|
+
|
17
|
+
#### Keyboard Navigation
|
18
|
+
|
19
|
+
Badge itself is not focusable. However, when components are added to it, these keys provide additional functionality.
|
20
|
+
|
21
|
+
| Keys | Functions |
|
22
|
+
| ---- | --------- |
|
23
|
+
| Space or Enter | Selects the component. |
|
24
|
+
| Tab | Focuses the component and follows the page tab sequence. |
|
@@ -21,9 +21,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
21
21
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
22
22
|
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
23
23
|
var _react = _interopRequireWildcard(require("react"));
|
24
|
-
var _propTypes = require("@styled-system/prop-types");
|
25
24
|
var _lodash = require("lodash");
|
26
|
-
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
27
25
|
var _styledSystem = require("styled-system");
|
28
26
|
var _themeUi = require("theme-ui");
|
29
27
|
var _hooks = require("../../hooks");
|
@@ -34,11 +32,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
34
32
|
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; }
|
35
33
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
36
34
|
var ExtendedBox = /*#__PURE__*/(0, _base["default"])(_themeUi.Box, process.env.NODE_ENV === "production" ? {
|
37
|
-
target: "
|
35
|
+
target: "ejf9h0h0"
|
38
36
|
} : {
|
39
|
-
target: "
|
37
|
+
target: "ejf9h0h0",
|
40
38
|
label: "ExtendedBox"
|
41
|
-
})(_styledSystem.layout, _styledSystem.flexbox, _styledSystem.typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
39
|
+
})(_styledSystem.layout, _styledSystem.flexbox, _styledSystem.typography, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0JveC9Cb3gudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNvQiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9Cb3gvQm94LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmLCB1c2VNZW1vIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgdG9OdW1iZXIgfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHsgZmxleGJveCwgbGF5b3V0LCB0eXBvZ3JhcGh5IH0gZnJvbSAnc3R5bGVkLXN5c3RlbSc7XG5pbXBvcnQgeyBCb3ggYXMgVGhlbWVVSUJveCB9IGZyb20gJ3RoZW1lLXVpJztcblxuaW1wb3J0IHsgdXNlUHJvcFdhcm5pbmcsIHVzZVN0YXR1c0NsYXNzZXMgfSBmcm9tICcuLi8uLi9ob29rcyc7XG5pbXBvcnQgeyBCb3hQcm9wcywgUmVhY3RSZWYgfSBmcm9tICcuLi8uLi90eXBlcyc7XG5cbmNvbnN0IEV4dGVuZGVkQm94ID0gc3R5bGVkKFRoZW1lVUlCb3gpKFxuICBsYXlvdXQsXG4gIGZsZXhib3gsXG4gIHR5cG9ncmFwaHksXG4pO1xuXG5jb25zdCBCb3ggPSBmb3J3YXJkUmVmKChwcm9wczogQm94UHJvcHMsIHJlZjogUmVhY3RSZWYpID0+IHtcbiAgY29uc3Qge1xuICAgIGZsZXhEaXJlY3Rpb24sXG4gICAgZ2FwLFxuICAgIGlzUm93LFxuICAgIGlzRGlzYWJsZWQsXG4gICAgY2xhc3NOYW1lLFxuICAgIGZvbnRTaXplLFxuICAgIHN4LFxuICAgIC4uLm90aGVyc1xuICB9ID0gcHJvcHM7XG4gIGNvbnN0IGZkID0gZmxleERpcmVjdGlvbiB8fCBpc1JvdyA/ICdyb3cnIDogJ2NvbHVtbic7XG4gIGNvbnN0IGN1c3RvbSA9IHsgLi4uc3ggfTtcblxuICBjb25zdCB7IGNsYXNzTmFtZXMgfSA9IHVzZVN0YXR1c0NsYXNzZXMoY2xhc3NOYW1lLCB7IGlzRGlzYWJsZWQgfSk7XG4gIHVzZVByb3BXYXJuaW5nKHByb3BzLCAnZGlzYWJsZWQnLCAnaXNEaXNhYmxlZCcpO1xuXG4gIGlmIChnYXApIHtcbiAgICBjdXN0b21bJyYgPiAqICsgKjpub3QoOmZpcnN0LW9mLXR5cGU6bm90KHN0eWxlKTpub3QoOmZpcnN0LW9mLXR5cGUgfiAqKSknXSA9IHtcbiAgICAgIFtmZCA9PT0gJ3JvdycgPyAnbWFyZ2luTGVmdCcgOiAnbWFyZ2luVG9wJ106IGdhcCxcbiAgICB9O1xuICB9XG5cbiAgY29uc3QgY3VzdG9tRm9udFNpemUgPSB1c2VNZW1vKCgpID0+IHtcbiAgICBjb25zdCBudW1lcmljYWxGb250U2l6ZSA9IHRvTnVtYmVyKGZvbnRTaXplKTtcbiAgICBpZiAoTnVtYmVyLmlzTmFOKG51bWVyaWNhbEZvbnRTaXplKSkge1xuICAgICAgcmV0dXJuIGZvbnRTaXplO1xuICAgIH1cbiAgICByZXR1cm4gbnVtZXJpY2FsRm9udFNpemU7XG4gIH0sIFtmb250U2l6ZV0pO1xuXG4gIHJldHVybiAoXG4gICAgPEV4dGVuZGVkQm94XG4gICAgICBjbGFzc05hbWU9e2NsYXNzTmFtZXN9XG4gICAgICByZWY9e3JlZn1cbiAgICAgIGRpc3BsYXk9XCJmbGV4XCJcbiAgICAgIGZsZXhEaXJlY3Rpb249e2ZkfVxuICAgICAgdmFyaWFudD1cImJveC5iYXNlXCJcbiAgICAgIGZvbnRTaXplPXtjdXN0b21Gb250U2l6ZX1cbiAgICAgIHsuLi5vdGhlcnN9XG4gICAgICBzeD17Y3VzdG9tfVxuICAgIC8+XG4gICk7XG59KTtcblxuQm94LmRlZmF1bHRQcm9wcyA9IHtcbiAgYXM6ICdkaXYnLFxuICBpc1JvdzogZmFsc2UsXG4gIGlzRGlzYWJsZWQ6IGZhbHNlLFxufTtcblxuQm94LmRpc3BsYXlOYW1lID0gJ0JveCc7XG5cbmV4cG9ydCBkZWZhdWx0IEJveDtcbiJdfQ== */");
|
42
40
|
var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
43
41
|
var flexDirection = props.flexDirection,
|
44
42
|
gap = props.gap,
|
@@ -56,7 +54,7 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
56
54
|
classNames = _useStatusClasses.classNames;
|
57
55
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
58
56
|
if (gap) {
|
59
|
-
custom['& > * + *:not(:first-
|
57
|
+
custom['& > * + *:not(:first-of-type:not(style):not(:first-of-type ~ *))'] = (0, _defineProperty2["default"])({}, fd === 'row' ? 'marginLeft' : 'marginTop', gap);
|
60
58
|
}
|
61
59
|
var customFontSize = (0, _react.useMemo)(function () {
|
62
60
|
var numericalFontSize = (0, _lodash.toNumber)(fontSize);
|
@@ -76,19 +74,6 @@ var Box = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
76
74
|
sx: custom
|
77
75
|
}));
|
78
76
|
});
|
79
|
-
Box.propTypes = {
|
80
|
-
/** The background color of the box. */
|
81
|
-
bg: _propTypes2["default"].string,
|
82
|
-
/** Whether the box is disabled. */
|
83
|
-
isDisabled: _propTypes2["default"].oneOfType([_propTypes2["default"].bool, _propTypes2["default"].object]),
|
84
|
-
/** The base HTML tag name or React component type to render */
|
85
|
-
as: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].elementType]),
|
86
|
-
/** When true, display as a row rather than a column. */
|
87
|
-
isRow: _propTypes2["default"].bool,
|
88
|
-
/** Gap between items, whether in a row or column. */
|
89
|
-
gap: _propTypes.propType,
|
90
|
-
fontSize: _propTypes2["default"].oneOfType([_propTypes2["default"].string, _propTypes2["default"].number])
|
91
|
-
};
|
92
77
|
Box.defaultProps = {
|
93
78
|
as: 'div',
|
94
79
|
isRow: false,
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Box/Box" />
|
4
|
+
|
5
|
+
# Box
|
6
|
+
|
7
|
+
A Box is a flex-based component that can be used as a container for text, form controls, or other components.
|
8
|
+
You can customize the colors, margins, and padding surrounding the objects in the box.
|
9
|
+
|
10
|
+
This component should be used to style form controls, or as a container.
|
11
|
+
It should not be used for large, complex layouts. Use a [React Spectrum Grid](https://react-spectrum.adobe.com/react-spectrum/Grid.html) instead.
|
12
|
+
|
13
|
+
The Box is built on [Box-Theme UI](https://theme-ui.com/components/box/)
|
14
|
+
and accepts most [Styled System style props](https://styled-system.com/table/).
|
15
|
+
|
16
|
+
### Required components
|
17
|
+
|
18
|
+
- This component can be used independently and does not require additional components.
|
19
|
+
|
20
|
+
### Accessibility
|
21
|
+
|
22
|
+
This component adheres to the [WCAG 2.1 - 1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)
|
23
|
+
accessibility guidelines.
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -46,9 +46,7 @@ test('box with default gap', function () {
|
|
46
46
|
gap: '30px'
|
47
47
|
});
|
48
48
|
var box = _react3.screen.getByTestId(testId);
|
49
|
-
expect(box).toHaveStyle('margin-top: 0px'
|
50
|
-
target: '> * + *'
|
51
|
-
});
|
49
|
+
expect(box).toHaveStyle('margin-top: 0px');
|
52
50
|
});
|
53
51
|
test('box as row with gap', function () {
|
54
52
|
getComponent({
|
@@ -56,7 +54,5 @@ test('box as row with gap', function () {
|
|
56
54
|
gap: '30px'
|
57
55
|
});
|
58
56
|
var box = _react3.screen.getByTestId(testId);
|
59
|
-
expect(box).toHaveStyle('margin-left: 0px'
|
60
|
-
target: '> * + *'
|
61
|
-
});
|
57
|
+
expect(box).toHaveStyle('margin-left: 0px');
|
62
58
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Box';
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Bracket/Bracket" />
|
4
|
+
|
5
|
+
# Bracket
|
6
|
+
|
7
|
+
The Bracket component displays information in a hierarchical view of the content structure.
|
8
|
+
Items such as headings, directories, and subitems are displayed in a tree structure, which shows how these items are related to each other.
|
9
|
+
|
10
|
+
Brackets should avoid cross-referencing. Try separating the content into sections instead.
|
11
|
+
Brackets shouldn’t display too many levels of depth to avoid overflow.
|
12
|
+
|
13
|
+
### Required components
|
14
|
+
|
15
|
+
This component requires the [Badge](./?path=/docs/components-badge--default),[Box](./?path=/story/components-box--default), and [Text](./?path=/docs/components-text--default) components.
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Breadcrumbs/Breadcrumbs" />
|
4
|
+
|
5
|
+
# Breadcrumbs
|
6
|
+
|
7
|
+
Breadcrumbs display a hierarchy of links to the current page or resource in an application. They are effective in products and experiences that have a large amount of content organized in a hierarchy of more than two levels.
|
8
|
+
They take up little space but still provide context for the user’s place in the navigation hierarchy, but should be treated as secondary navigation and never entirely replace the primary navigation.
|
9
|
+
|
10
|
+
There are two different types of breadcrumbs:
|
11
|
+
- **Location-based**: Illustrate the hierarchy and show users where they are within that hierarchy.
|
12
|
+
- **Path-based**: Show the steps the user took to get to the current page, rather than reflecting the site’s information architecture.
|
13
|
+
|
14
|
+
It is built on React Aria [useBreadcrumbs](https://react-spectrum.adobe.com/react-aria/useBreadcrumbs.html) from React-Aria.
|
15
|
+
|
16
|
+
### Required components
|
17
|
+
|
18
|
+
This component requires Item originating from [react-stately/collections](https://react-spectrum.adobe.com/react-stately/collections.html).
|
19
|
+
|
20
|
+
### Accessibility
|
21
|
+
|
22
|
+
This component should adhere to the [WAI-ARIA Breadcrumbs](https://www.w3.org/WAI/ARIA/apg/example-index/breadcrumb/index.html) accessibility guidelines.
|
23
|
+
|
24
|
+
#### Keyboard Navigation
|
25
|
+
|
26
|
+
These keys provide additional functionality to the component.
|
27
|
+
|
28
|
+
| Keys | Functions |
|
29
|
+
| ---- | --------- |
|
30
|
+
| Space or Enter | Selects the item and navigates to the associated location. |
|
31
|
+
| Tab | Moves focus to the next focusable component and follows the page tab sequence. |
|
32
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
33
|
+
|
34
|
+
#### Screen readers
|
35
|
+
|
36
|
+
This component uses the following attributes to assist screen readers:
|
37
|
+
|
38
|
+
- The Breadcrumbs and BreadcrumbItems components use the **`aria-label`** attribute to provide an accessible name.
|
39
|
+
- The Icon component uses the **`aria-hidden`** attribute to hide its content from assistive technology.
|
40
|
+
- The last BreadcrumbItem component uses the **`aria-current`** attribute to indicate that the user is currently viewing that page.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Button/Button" />
|
4
|
+
|
5
|
+
# Button
|
6
|
+
|
7
|
+
Buttons are used to trigger actions or events and can contain an icon or a text label. The style used depends on its type:
|
8
|
+
|
9
|
+
- **Primary buttons**: Indicate the call to action on the page. Primary buttons should only appear once per screen (not including the application header, modal dialog, or side panel).
|
10
|
+
- **Secondary buttons**: Secondary buttons, the default, often have text labels and can only be used in conjunction with a primary button. As part of a pair, the secondary button’s function is to perform the negative action of the set, such as “Cancel” or “Back.”
|
11
|
+
- **Tertiary buttons**: Indicate that lower-priority tasks can be accomplished, and are often used in sections of the UI that have less space, such as cards, lists, or tables.
|
12
|
+
- **Danger buttons**: Use these buttons for:
|
13
|
+
|
14
|
+
- Dangerous actions, such as those that lose or destroy data.
|
15
|
+
- Primary danger buttons should only be used when the dangerous action is the most likely action, such as the affirmative Delete action in a deletion confirmation dialog.
|
16
|
+
- Secondary and tertiary variants can also be used for actions related to current errors, such as resolving them or viewing their details.
|
17
|
+
|
18
|
+
This component is built on [Button from Theme-UI](https://theme-ui.com/components/button)
|
19
|
+
|
20
|
+
### Required components
|
21
|
+
|
22
|
+
This component can be used independently and does not require additional components.
|
23
|
+
|
24
|
+
### Accessibility
|
25
|
+
|
26
|
+
This component should adhere to the [WAI-ARIA Button](https://www.w3.org/TR/wai-aria-practices-1.1/examples/button/button.html) accessibility guidelines.
|
27
|
+
|
28
|
+
#### Keyboard Navigation
|
29
|
+
|
30
|
+
These keys provide additional functionality to the component.
|
31
|
+
|
32
|
+
| Keys | Functions |
|
33
|
+
| ---- | --------- |
|
34
|
+
| Space or Enter | Selects the button. |
|
35
|
+
| Tab | Focuses the button and follows the page tab sequence. |
|
36
|
+
|
37
|
+
#### Screen readers.
|
38
|
+
|
39
|
+
This component uses the **`aria-label`** attribute to provide an accessible name.
|
40
|
+
|
@@ -17,8 +17,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
17
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
18
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
19
19
|
var _react = _interopRequireDefault(require("react"));
|
20
|
-
var _AddCircleIcon = _interopRequireDefault(require("@pingux/mdi-react/AddCircleIcon"));
|
21
20
|
var _CreateIcon = _interopRequireDefault(require("@pingux/mdi-react/CreateIcon"));
|
21
|
+
var _PlusIcon = _interopRequireDefault(require("@pingux/mdi-react/PlusIcon"));
|
22
22
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
23
23
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
24
24
|
var _index = require("../../index");
|
@@ -68,13 +68,14 @@ var Disabled = function Disabled() {
|
|
68
68
|
exports.Disabled = Disabled;
|
69
69
|
var TextIconButton = function TextIconButton() {
|
70
70
|
return (0, _react2.jsx)(_index.Button, {
|
71
|
-
mb: "sm"
|
71
|
+
mb: "sm",
|
72
|
+
variant: "withIcon"
|
72
73
|
}, (0, _react2.jsx)(_index.Box, {
|
73
74
|
isRow: true,
|
74
75
|
alignItems: "center"
|
75
76
|
}, (0, _react2.jsx)(_index.Icon, {
|
76
|
-
icon:
|
77
|
-
mr: "
|
77
|
+
icon: _PlusIcon["default"],
|
78
|
+
mr: "xs",
|
78
79
|
color: "active",
|
79
80
|
size: 20,
|
80
81
|
title: {
|
@@ -89,10 +90,34 @@ var InlineButton = function InlineButton() {
|
|
89
90
|
mr: "auto",
|
90
91
|
variant: "inline"
|
91
92
|
}, "Inline"), (0, _react2.jsx)(_index.Button, {
|
93
|
+
mb: "sm",
|
94
|
+
mr: "auto",
|
95
|
+
variant: "inlineWithIcon"
|
96
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
97
|
+
icon: _PlusIcon["default"],
|
98
|
+
mr: "xs",
|
99
|
+
color: "active",
|
100
|
+
size: 15,
|
101
|
+
title: {
|
102
|
+
name: 'Add Circle Icon'
|
103
|
+
}
|
104
|
+
}), "Inline with icon"), (0, _react2.jsx)(_index.Button, {
|
92
105
|
mb: "sm",
|
93
106
|
mr: "auto",
|
94
107
|
variant: "inlinePrimary"
|
95
|
-
}, "Inline primary"))
|
108
|
+
}, "Inline primary"), (0, _react2.jsx)(_index.Button, {
|
109
|
+
mb: "sm",
|
110
|
+
mr: "auto",
|
111
|
+
variant: "inlinePrimaryWithIcon"
|
112
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
113
|
+
icon: _PlusIcon["default"],
|
114
|
+
mr: "xs",
|
115
|
+
color: "active",
|
116
|
+
size: 15,
|
117
|
+
title: {
|
118
|
+
name: 'Add Circle Icon'
|
119
|
+
}
|
120
|
+
}), "Inline primary with icon"));
|
96
121
|
};
|
97
122
|
exports.InlineButton = InlineButton;
|
98
123
|
var ColorBlockButton = function ColorBlockButton(args) {
|
@@ -19,10 +19,10 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
19
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
20
20
|
var base = _objectSpread({
|
21
21
|
cursor: 'pointer',
|
22
|
-
height:
|
23
|
-
lineHeight: '
|
22
|
+
height: '37px',
|
23
|
+
lineHeight: '115%',
|
24
24
|
minWidth: 'min-content',
|
25
|
-
|
25
|
+
padding: '10px 15px',
|
26
26
|
outline: 'none',
|
27
27
|
display: 'inline-flex',
|
28
28
|
alignItems: 'center',
|
@@ -83,6 +83,15 @@ var primary = _objectSpread(_objectSpread({}, base), {}, {
|
|
83
83
|
},
|
84
84
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
85
85
|
});
|
86
|
+
var withIcon = _objectSpread(_objectSpread({}, base), {}, {
|
87
|
+
padding: '8.5px 15px 8.5px 10px',
|
88
|
+
bg: 'white',
|
89
|
+
border: '1px solid',
|
90
|
+
borderColor: 'active',
|
91
|
+
'&.is-hovered': _objectSpread({}, defaultHover),
|
92
|
+
'&.is-pressed': _objectSpread({}, defaultActive),
|
93
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
94
|
+
});
|
86
95
|
var success = _objectSpread(_objectSpread({}, base), {}, {
|
87
96
|
display: 'inline-flex',
|
88
97
|
bg: 'success.bright',
|
@@ -110,7 +119,7 @@ var critical = _objectSpread(_objectSpread({}, base), {}, {
|
|
110
119
|
var inline = _objectSpread(_objectSpread({}, base), {}, {
|
111
120
|
display: 'inline-flex',
|
112
121
|
bg: 'white',
|
113
|
-
height: '
|
122
|
+
height: '21px',
|
114
123
|
lineHeight: 1,
|
115
124
|
fontSize: 'sm',
|
116
125
|
borderRadius: '15px',
|
@@ -134,6 +143,12 @@ var inlinePrimary = _objectSpread(_objectSpread(_objectSpread({}, inline), defau
|
|
134
143
|
borderColor: 'accent.20'
|
135
144
|
})
|
136
145
|
});
|
146
|
+
var inlineWithIcon = _objectSpread(_objectSpread({}, inline), {}, {
|
147
|
+
padding: '3px 15px 3px 10px'
|
148
|
+
});
|
149
|
+
var inlinePrimaryWithIcon = _objectSpread(_objectSpread({}, inlinePrimary), {}, {
|
150
|
+
padding: '3px 15px 3px 10px'
|
151
|
+
});
|
137
152
|
var text = _objectSpread(_objectSpread({}, base), {}, {
|
138
153
|
display: 'inline-flex',
|
139
154
|
bg: 'transparent',
|
@@ -190,8 +205,8 @@ var colorBlock = {
|
|
190
205
|
outline: 'none',
|
191
206
|
cursor: 'pointer',
|
192
207
|
width: 150,
|
193
|
-
|
194
|
-
p: '5px 15px',
|
208
|
+
height: '40px',
|
209
|
+
p: '5px 10px 5px 15px',
|
195
210
|
display: 'flex',
|
196
211
|
justifyContent: 'space-between',
|
197
212
|
alignItems: 'center',
|
@@ -265,6 +280,9 @@ var _default = {
|
|
265
280
|
primary: primary,
|
266
281
|
quiet: quiet,
|
267
282
|
success: success,
|
268
|
-
colorBlock: colorBlock
|
283
|
+
colorBlock: colorBlock,
|
284
|
+
withIcon: withIcon,
|
285
|
+
inlineWithIcon: inlineWithIcon,
|
286
|
+
inlinePrimaryWithIcon: inlinePrimaryWithIcon
|
269
287
|
};
|
270
288
|
exports["default"] = _default;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/Calendar/Calendar" />
|
4
|
+
|
5
|
+
# Calendar
|
6
|
+
|
7
|
+
The calendar component displays months in a grid-like view and gives users the ability to quickly go through months and years to select a specific date.
|
8
|
+
|
9
|
+
This component is built on [useCalendar](https://react-spectrum.adobe.com/react-aria/useCalendar.html#usecalendar-1), [useCalendarGrid](https://react-spectrum.adobe.com/react-aria/useCalendar.html#usecalendargrid), and
|
10
|
+
[useCalendarCell](https://react-spectrum.adobe.com/react-aria/useCalendar.html#usecalendarcell) from React Aria, and [useCalendarState](https://react-spectrum.adobe.com/react-stately/useCalendarState.html) from React Stately.
|
11
|
+
|
12
|
+
### Required components
|
13
|
+
|
14
|
+
This component can be used independently and does not require additional components.
|
15
|
+
|
16
|
+
### Accessibility
|
17
|
+
|
18
|
+
#### Keyboard Navigation
|
19
|
+
|
20
|
+
These keys provide additional functionality to the component.
|
21
|
+
|
22
|
+
| Keys | Functions |
|
23
|
+
| ---- | --------- |
|
24
|
+
| Space or Enter | Selects the date when a date is focused, and navigates to the calendar pages when the navigational buttons are focused. |
|
25
|
+
| Tab | Components in the calendar are focusable and follow the page tab sequence. |
|
26
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
27
|
+
| Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home | Shifts the focus to the first calendar date. |
|
28
|
+
| Pressing Home:(Fn + left Arrow Key) Or Control or Command + End | Shifts the focus to the last calendar date. |
|
29
|
+
| Arrow key | Navigates up, down, right, and left across the calendar. |
|
30
|
+
| Page up | Changes the grid of dates to the previous month. |
|
31
|
+
| Page down | Changes the grid of dates to the next month. |
|
32
|
+
| Shift + page up | Changes the grid of dates to the same month in the previous year. |
|
33
|
+
| Shift+ page down | Changes the grid of dates to the same month in the next year. |
|
34
|
+
|
35
|
+
#### Screen Readers
|
36
|
+
|
37
|
+
This component uses the following attributes to assist screen readers:
|
38
|
+
- The **`aria-label`** attribute is used to provide an accessible name.
|
39
|
+
- In each data cell, the **`aria-selected`** attribute is set to “true” when a date is selected, and **`aria-disabled`** is set to “false” by default.
|