@pingux/astro 2.9.2 → 2.13.0-alpha.4
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.js +145 -27
- package/lib/cjs/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +40 -7
- package/lib/cjs/components/HelpHint/HelpHint.styles.js +9 -1
- package/lib/cjs/components/HelpHint/HelpHint.test.js +202 -30
- 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/Link/Link.styles.js +10 -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/Tooltip.styles.js +2 -1
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +2 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.mdx +23 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +47 -1
- 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/cjs/utils/designUtils/figmaLinks.js +2 -1
- 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.js +148 -30
- package/lib/components/HelpHint/HelpHint.mdx +32 -0
- package/lib/components/HelpHint/HelpHint.stories.js +37 -6
- package/lib/components/HelpHint/HelpHint.styles.js +9 -1
- package/lib/components/HelpHint/HelpHint.test.js +202 -30
- 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/Link/Link.styles.js +10 -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/Tooltip.styles.js +1 -1
- package/lib/components/TooltipTrigger/TooltipTrigger.js +2 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.mdx +23 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.test.js +48 -2
- 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/lib/utils/designUtils/figmaLinks.js +2 -1
- package/package.json +20 -6
- 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,66 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/ComboBoxField/ComboBoxField" />
|
4
|
+
|
5
|
+
# ComboBoxField
|
6
|
+
|
7
|
+
The ComboBoxField combines the features of a textbox and a listbox.
|
8
|
+
This component provides a more compact way to present a list of choices, as the list is hidden until you click the drop-down arrow.
|
9
|
+
A combo box also gives you the ability to enter a value that is not in the list.
|
10
|
+
|
11
|
+
Use this component for large complex lists, ideally sorted. Do not use this component:
|
12
|
+
- If the list will never have more than 6 items.
|
13
|
+
- With small lists where one option is pre-selected by default. Use the [RadioGroupField](./?path=/docs/form-radiogroupfield--default) instead.
|
14
|
+
|
15
|
+
This component uses [useComboBox](https://react-spectrum.adobe.com/react-aria/useComboBox.html) from React
|
16
|
+
Aria and [useComboBoxState](https://react-spectrum.adobe.com/react-stately/useComboBoxState.html)
|
17
|
+
from React Stately.
|
18
|
+
|
19
|
+
### Required Components
|
20
|
+
|
21
|
+
This component is built using [useOverLayTrigger](https://react-spectrum.adobe.com/react-aria/useOverlayTrigger.html), and requires the
|
22
|
+
react-aria [OverlayProvider](https://react-spectrum.adobe.com/react-aria/useOverlayTrigger.html#:~:text=contained%20in%20an-,OverlayProvider,-%2C%20which%20is%20used),
|
23
|
+
exported from Astro and Item originating from [react-stately/collections](https://react-spectrum.adobe.com/react-stately/collections.html).
|
24
|
+
|
25
|
+
### Accessibility
|
26
|
+
|
27
|
+
This component should adhere to the [WAI-ARIA ComboBox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) accessibility guidelines.
|
28
|
+
|
29
|
+
#### Keyboard Navigation
|
30
|
+
|
31
|
+
These keys provide additional functionality to the component.
|
32
|
+
|
33
|
+
| Keys | Functions |
|
34
|
+
| ---- | ---- |
|
35
|
+
| Tab | Focuses the field and follows the page tab sequence. |
|
36
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
37
|
+
| Space or Enter | Selects the component when it is focused. |
|
38
|
+
| Down arrow | Opens the popover if it isn’t already open. |
|
39
|
+
| Up and down arrows | Can be used to move through the selection in the popover. |
|
40
|
+
| Typing in input field | Adds focus to it and opens the popover. |
|
41
|
+
| Home(Fn + Right Arrow Key) Or Control/Command + Home | Shifts the focus to the first item in the listbox. |
|
42
|
+
| End(Fn + Left Arrow Key) Or Control/Command + End | Shifts the focus to the last item in the listbox. |
|
43
|
+
| Esc | Pressing the escape key closes the overlay and adds focus to the previously focused component. |
|
44
|
+
|
45
|
+
#### Screen Readers
|
46
|
+
This component uses the following attributes to assist screen readers:
|
47
|
+
|
48
|
+
Input:
|
49
|
+
- The input uses **`aria-expanded`** to indicate the expansion/collapse of the listbox.
|
50
|
+
- When expanded **`aria-controls`** is added to the input pointing to the ListBox.
|
51
|
+
- The input has **`aria-labelledby`** supplied with label ID and **`aria-activedescendent`** identifies the currently focused option from the list.
|
52
|
+
- The label uses **`aria-hidden`** to hide its content from assistive technology.
|
53
|
+
- The **`aria-autocomplete`** list model displays all the possible values in the pop-up list.
|
54
|
+
- The Input has **`aria-invalid`** set to true when the entered value does not conform to the expected format.
|
55
|
+
|
56
|
+
Button:
|
57
|
+
- The trigger button uses **`aria-expanded`** to indicate the expansion/collapse of content.
|
58
|
+
- The attribute **`aria-haspopup`** has “True” set as the value, which indicates that the type of popup content is a Listbox.
|
59
|
+
- The button and label ID are supplied to **`aria-labelledby`** to reference it.
|
60
|
+
- When expanded **`aria-controls`** is added to the input pointing to the listbox.
|
61
|
+
|
62
|
+
Option:
|
63
|
+
- The ListBox has the label and its ID supplied to **`aria-labelledby`** and **`aria-label`** provides an accessible name to the component.
|
64
|
+
- Each ListBox option has the default **`aria-disabled`** set as false and **`aria-selected`** to indicate the currently selected option.
|
65
|
+
- The **`aria-posinset`** attribute defines an element's number or position in the current set of list items.
|
66
|
+
- The **`aria-setsize`** attribute defines the number of items in the current set of list items.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/CopyText/CopyText" />
|
4
|
+
|
5
|
+
# CopyText
|
6
|
+
|
7
|
+
CopyText allows users to copy information by clicking on the text or a nearby CopyButton. These components should have labels that match the action.
|
8
|
+
Do not override the colors used for this component for accessibility reasons, and ensure tooltip text is included.
|
9
|
+
|
10
|
+
### Required Components
|
11
|
+
|
12
|
+
This component requires the [Text](./?path=/docs/components-text--default) component.
|
13
|
+
|
14
|
+
### Accessibility
|
15
|
+
|
16
|
+
#### Keyboard Navigation
|
17
|
+
|
18
|
+
These keys provide additional functionality to the component.
|
19
|
+
|
20
|
+
| Keys | Functions |
|
21
|
+
| ---- | --------- |
|
22
|
+
| Space or Enter | Selects the button. |
|
23
|
+
| Tab | Focuses the button and follows the page tab sequence.|
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/DataTable/DataTable" />
|
4
|
+
|
5
|
+
# DataTable
|
6
|
+
|
7
|
+
DataTables are containers that display data in rows, columns, and cells, which allows users to quickly scan, sort, and compare information. This component was inspired by [TableView](https://react-spectrum.adobe.com/react-spectrum/TableView.html)
|
8
|
+
from React Spectrum and build using [useTableState](https://react-spectrum.adobe.com/react-stately/useTableState.html)
|
9
|
+
from React Stately.
|
10
|
+
|
11
|
+
Columns are defined within the DataTableHeader component with the DataTableColumn component, and rows are defined within the DataTableBody component with the DataTableRow component.
|
12
|
+
Rows contain DataTableCell components that correspond to each column.
|
13
|
+
|
14
|
+
DataTables should:
|
15
|
+
- Contain vertically aligned content.
|
16
|
+
- Use multiple heading rows for higher-level column groupings.
|
17
|
+
- Use column dividers sparingly.
|
18
|
+
|
19
|
+
They should not use different indicators to represent empty fields.
|
20
|
+
|
21
|
+
### Required Components
|
22
|
+
|
23
|
+
This component requires these additional React Spectrum components:
|
24
|
+
- [TableHeader](https://react-spectrum.adobe.com/react-aria/useTable.html#:~:text=defined%20using%20the-,TableHeader,-%2C%20Column%2C) aliased DataTableHeader
|
25
|
+
- [Column](https://react-spectrum.adobe.com/react-aria/useTable.html#:~:text=the%20TableHeader%2C-,Column,-%2C%20TableBody%2C) aliased DataTableColumn
|
26
|
+
- [Cell](https://react-spectrum.adobe.com/react-aria/useTable.html#:~:text=Row%2C%20and-,Cell,-components%2C%20which%20support) aliased DataTableCell
|
27
|
+
- [Row](https://react-spectrum.adobe.com/react-aria/useTable.html#:~:text=%2C%20TableBody%2C-,Row,-%2C%20and%20Cell%20components) aliased DataTableRow
|
28
|
+
- [TableBody](https://react-spectrum.adobe.com/react-aria/useTable.html#:~:text=%2C%20Column%2C-,TableBody,-%2C%20Row%2C%20and) aliased DataTableBody
|
29
|
+
|
30
|
+
### Accessibility
|
31
|
+
|
32
|
+
#### Keyboard Navigation
|
33
|
+
|
34
|
+
These keys provide additional functionality to the component.
|
35
|
+
|
36
|
+
| Keys | Functions |
|
37
|
+
| ---- | --------- |
|
38
|
+
| Tab | Moves focus to the next focusable component. All focusable components in the table are included in the page tab sequence. |
|
39
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
40
|
+
| Space or Enter | Focuses the component and triggers an action if one is associated with it. |
|
41
|
+
| Arrow keys | Can be used to navigate between the components in the table. |
|
42
|
+
| Focus on a row and scroll down | Shifts the focus to the entire table, not the previously focused row. |
|
43
|
+
| Home or page up | Shifts the focus to the first row. |
|
44
|
+
| End or page down | Shifts the focus to the last visible row. |
|
45
|
+
|
46
|
+
#### Screen Readers
|
47
|
+
|
48
|
+
This component uses the following attributes to assist screen readers:
|
49
|
+
- The **`aria-label`** attribute is used to provide an accessible name.
|
50
|
+
- The **`aria-rowcount`** and **`aria-columncount`** attributes are used to indicate the total number of rows and columns in the grid structure.
|
51
|
+
- The DataTableHeader uses the **`aria-rowindex`** attribute and DataTableColumn uses the **`aria-colindex`** attribute to enumerate the header row and columns.
|
52
|
+
- In the body component, the DataTableRow uses the **`aria-labelledby`** attribute and the grid ID to identify the component and the **`aria-rowindex`** attribute is passed to each row.
|
53
|
+
- Each DataTableCell uses the **`aria-colindex`** attribute to enumerate the columns within each row.
|
54
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/DatePicker/DatePicker" />
|
4
|
+
|
5
|
+
# DatePicker
|
6
|
+
|
7
|
+
Date pickers allow users to select specific past, present, or future dates.
|
8
|
+
This component combines the [Calendar](./?path=/docs/components-calendar--default) component with the DateField component and can be localized to meet your needs.
|
9
|
+
|
10
|
+
This component is built on [useDatePicker](https://react-spectrum.adobe.com/react-aria/useDatePicker.html) from React Aria
|
11
|
+
and [useDatePickerState](https://react-spectrum.adobe.com/react-stately/useDatePickerState.html) from React Stately.
|
12
|
+
|
13
|
+
Properties not specified are passed to the underlying DateField component.
|
14
|
+
|
15
|
+
### Required components
|
16
|
+
|
17
|
+
This component can be used independently and does not require additional components.
|
18
|
+
|
19
|
+
### Accessibility
|
20
|
+
|
21
|
+
This component should adhere to the [WAI-ARIA DatePicker](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/) accessibility guidelines.
|
22
|
+
|
23
|
+
#### Keyboard Navigation
|
24
|
+
|
25
|
+
These keys provide additional functionality to the component.
|
26
|
+
|
27
|
+
| Keys | Functions |
|
28
|
+
| ---- | --------- |
|
29
|
+
| Space or Enter | Opens the popover when the trigger is focused, selects the date when a date is focused, and navigates to the calendar pages when the navigational buttons are focused. |
|
30
|
+
| Tab | Focuses the field and follows the page tab sequence. |
|
31
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
32
|
+
| Pressing Home:(Fn + Right Arrow Key) Or Control or Command + Home | Shifts the focus to the first calendar date. |
|
33
|
+
| Pressing Home:(Fn + left Arrow Key) Or Control or Command + End | Shifts the focus to the last calendar date. |
|
34
|
+
| Up and down Arrow keys | When segments are focused, it increments and decrements dates starting from the present day. |
|
35
|
+
| Left and right arrows | Moves focus between segments. |
|
36
|
+
| Page up | Changes the grid of dates to the previous month. |
|
37
|
+
| Page down | Changes the grid of dates to the next month. |
|
38
|
+
| Shift + page up | Changes the grid of dates to the same month in the previous year. |
|
39
|
+
| Shift+ page down | Changes the grid of dates to the same month in the next year. |
|
40
|
+
| Esc | Closes the overlay and shifts focus to the trigger. |
|
41
|
+
|
42
|
+
#### Screen Readers
|
43
|
+
|
44
|
+
This component uses the following attributes to assist screen readers:
|
45
|
+
|
46
|
+
- The hidden input, DateField, and all three spin buttons have an **`aria-labelledby`** attribute pointing to the label ID, along with the **`aria-label`** attribute for an accessible name.
|
47
|
+
- Each spin button has the **`aria-valuenow`** attribute that defines the current value and it is always used with its text alternative, **`aria-valuetext`**.
|
48
|
+
The spin buttons also have the **`aria-valuemin`** and **`aria-valuemax`** attributes to specify the minimum and maximum values allowed for a range widget.
|
49
|
+
- The **`aria-selected`** attribute is added to the grid cell when a date is selected, and **`aria-disabled`** is set to “false” by default.
|
@@ -138,7 +138,8 @@ var EnvironmentBreadcrumb = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
138
138
|
onSelectionChange: handleSelectionChange,
|
139
139
|
selectedKeys: selectedKeys,
|
140
140
|
selectionMode: 'single',
|
141
|
-
disallowEmptySelection:
|
141
|
+
disallowEmptySelection: true,
|
142
|
+
allowDuplicateSelectionEvents: true
|
142
143
|
};
|
143
144
|
var listBoxState = useListState(listBoxProps);
|
144
145
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/EnvironmentBreadcrumb/EnvironmentBreadcrumb" />
|
4
|
+
|
5
|
+
# EnvironmentBreadcrumb
|
6
|
+
|
7
|
+
EnvironmentBreadcrumb shows users where they are within the environment hierarchy.
|
8
|
+
They take up little space but still provide context for the user’s place in the hierarchy, but should be treated as secondary navigation and never entirely replace the primary navigation.
|
9
|
+
|
10
|
+
### Required components
|
11
|
+
|
12
|
+
This component requires the [Badge](./?path=/docs/components-badge--default),
|
13
|
+
[Box](./?path=/story/components-box--default), [Text](./?path=/docs/components-text--default) components and
|
14
|
+
Item from [react-stately/collections](https://react-spectrum.adobe.com/react-stately/collections.html).
|
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 breadcrumb item. |
|
25
|
+
| Tab | Focuses the breadcrumb item and follows the page tab sequence. |
|
26
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
27
|
+
| Arrow keys | Can be used to navigate between the items in the dropdown list. |
|
28
|
+
| Esc | Closes the popover when it is expanded. |
|
29
|
+
|
30
|
+
#### Screen readers
|
31
|
+
|
32
|
+
This component uses the following attributes to assist screen readers:
|
33
|
+
- Each breadcrumb item uses an **`aria-label`** attribute to provide an accessible name.
|
34
|
+
- The trigger button uses the **`aria-expanded`** attribute to indicate when the content expands and collapses.
|
35
|
+
- When expanded, **`aria-controls`** is added to the button pointing to the pop-up content.
|
36
|
+
- The **`aria-haspopup`** attribute describes the type of content presented.
|
@@ -110,10 +110,7 @@ var environmentsWithSections = [{
|
|
110
110
|
}]
|
111
111
|
}];
|
112
112
|
export var Default = function Default(args) {
|
113
|
-
var _useState = useState(
|
114
|
-
name: 'Snail',
|
115
|
-
isSandbox: true
|
116
|
-
}),
|
113
|
+
var _useState = useState(defaultEnvironments[0]),
|
117
114
|
_useState2 = _slicedToArray(_useState, 2),
|
118
115
|
selectedEnvironment = _useState2[0],
|
119
116
|
setSelectedEnvironment = _useState2[1];
|
@@ -156,10 +153,7 @@ export var Default = function Default(args) {
|
|
156
153
|
});
|
157
154
|
};
|
158
155
|
export var DefaultClosed = function DefaultClosed(args) {
|
159
|
-
var _useState3 = useState(
|
160
|
-
name: 'Snail',
|
161
|
-
isSandbox: true
|
162
|
-
}),
|
156
|
+
var _useState3 = useState(defaultEnvironments[0]),
|
163
157
|
_useState4 = _slicedToArray(_useState3, 2),
|
164
158
|
selectedEnvironment = _useState4[0],
|
165
159
|
setSelectedEnvironment = _useState4[1];
|
@@ -211,9 +205,7 @@ export var WithSections = function WithSections() {
|
|
211
205
|
_useState8 = _slicedToArray(_useState7, 2),
|
212
206
|
filteredOptionsNumber = _useState8[0],
|
213
207
|
setFilteredOptionsNumber = _useState8[1];
|
214
|
-
var _useState9 = useState(
|
215
|
-
name: 'Consumer Banking Prod'
|
216
|
-
}),
|
208
|
+
var _useState9 = useState(environmentsWithSections[0].options[0]),
|
217
209
|
_useState10 = _slicedToArray(_useState9, 2),
|
218
210
|
selectedEnvironment = _useState10[0],
|
219
211
|
setSelectedEnvironment = _useState10[1];
|
@@ -317,10 +309,7 @@ export var OrgLevel = function OrgLevel() {
|
|
317
309
|
});
|
318
310
|
};
|
319
311
|
export var DefaultOpen = function DefaultOpen() {
|
320
|
-
var _useState11 = useState(
|
321
|
-
name: 'Dog',
|
322
|
-
isSandbox: true
|
323
|
-
}),
|
312
|
+
var _useState11 = useState(defaultEnvironments[0]),
|
324
313
|
_useState12 = _slicedToArray(_useState11, 2),
|
325
314
|
selectedEnvironment = _useState12[0],
|
326
315
|
setSelectedEnvironment = _useState12[1];
|
@@ -368,10 +357,7 @@ export var ControlledMenu = function ControlledMenu() {
|
|
368
357
|
_useState14 = _slicedToArray(_useState13, 2),
|
369
358
|
isOpen = _useState14[0],
|
370
359
|
setIsOpen = _useState14[1];
|
371
|
-
var _useState15 = useState(
|
372
|
-
name: 'Shark',
|
373
|
-
isSandbox: true
|
374
|
-
}),
|
360
|
+
var _useState15 = useState(defaultEnvironments[0]),
|
375
361
|
_useState16 = _slicedToArray(_useState15, 2),
|
376
362
|
selectedEnvironment = _useState16[0],
|
377
363
|
setSelectedEnvironment = _useState16[1];
|
@@ -416,32 +402,6 @@ export var ControlledMenu = function ControlledMenu() {
|
|
416
402
|
});
|
417
403
|
};
|
418
404
|
export var RightAlignedBadges = function RightAlignedBadges(args) {
|
419
|
-
var _useState17 = useState({
|
420
|
-
name: 'Snail',
|
421
|
-
isSandbox: true
|
422
|
-
}),
|
423
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
424
|
-
selectedEnvironment = _useState18[0],
|
425
|
-
setSelectedEnvironment = _useState18[1];
|
426
|
-
var envNode = ___EmotionJSX(Box, {
|
427
|
-
isRow: true
|
428
|
-
}, ___EmotionJSX(Text, {
|
429
|
-
color: "inherit"
|
430
|
-
}, selectedEnvironment.name), selectedEnvironment.isSandbox ? ___EmotionJSX(Badge, {
|
431
|
-
label: "SANDBOX",
|
432
|
-
variant: "environmentBadge",
|
433
|
-
bg: "neutral.40"
|
434
|
-
}) : null);
|
435
|
-
var findEnvObj = function findEnvObj(envName) {
|
436
|
-
return _findInstanceProperty(defaultEnvironments).call(defaultEnvironments, function (_ref11) {
|
437
|
-
var name = _ref11.name;
|
438
|
-
return name === envName;
|
439
|
-
});
|
440
|
-
};
|
441
|
-
var handleSelectionChange = function handleSelectionChange(newEnvName) {
|
442
|
-
var envObj = findEnvObj(newEnvName);
|
443
|
-
setSelectedEnvironment(_objectSpread({}, envObj));
|
444
|
-
};
|
445
405
|
var items = [{
|
446
406
|
name: 'Default'
|
447
407
|
}, {
|
@@ -471,6 +431,30 @@ export var RightAlignedBadges = function RightAlignedBadges(args) {
|
|
471
431
|
}, {
|
472
432
|
name: 'Mouse'
|
473
433
|
}];
|
434
|
+
var _useState17 = useState(items[0]),
|
435
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
436
|
+
selectedEnvironment = _useState18[0],
|
437
|
+
setSelectedEnvironment = _useState18[1];
|
438
|
+
var envNode = ___EmotionJSX(Box, {
|
439
|
+
isRow: true,
|
440
|
+
key: selectedEnvironment.name
|
441
|
+
}, ___EmotionJSX(Text, {
|
442
|
+
color: "inherit"
|
443
|
+
}, selectedEnvironment.name), selectedEnvironment.isSandbox ? ___EmotionJSX(Badge, {
|
444
|
+
label: "SANDBOX",
|
445
|
+
variant: "environmentBadge",
|
446
|
+
bg: "neutral.40"
|
447
|
+
}) : null);
|
448
|
+
var findEnvObj = function findEnvObj(envName) {
|
449
|
+
return _findInstanceProperty(items).call(items, function (_ref11) {
|
450
|
+
var name = _ref11.name;
|
451
|
+
return name === envName;
|
452
|
+
});
|
453
|
+
};
|
454
|
+
var handleSelectionChange = function handleSelectionChange(newEnvName) {
|
455
|
+
var envObj = findEnvObj(newEnvName);
|
456
|
+
setSelectedEnvironment(_objectSpread({}, envObj));
|
457
|
+
};
|
474
458
|
return ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, args, {
|
475
459
|
items: items,
|
476
460
|
name: "Globochem",
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/FileInputField/FileInputField" />
|
4
|
+
|
5
|
+
# FileInputField
|
6
|
+
|
7
|
+
The FileInputField component allows users to upload files by clicking the button or dragging and dropping the files to a specific location.
|
8
|
+
We use [react-dropzone](https://react-dropzone.js.org/) for the drag-and-drop functionality.
|
9
|
+
|
10
|
+
This component should have clear, concise file names and labels that guide users through the upload process, and should not allow users to upload executable files, such as .exe, .bin, .app files.
|
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
|
+
| Tab | Focuses the field and follows the page tab sequence. |
|
25
|
+
| Shift + Tab | Moves focus to the previous focusable component. |
|
26
|
+
| Space or Enter | Selects the component when it is focused. |
|
27
|
+
|
28
|
+
#### Screen Readers
|
29
|
+
|
30
|
+
This component uses the following attributes to assist screen readers:
|
31
|
+
- This component uses the **`aria-label`** to provide an accessible name and has **`aria-labelledby`** attribute, supplied with the label ID.
|
32
|
+
- Upon uploading the file, the Button component, with the name of the uploaded file, displays with **`aria-describedby`** attribute, which references the helpText if passed along.
|
33
|
+
- The delete button has an **`aria-label`** to provide an accessible name.
|
@@ -1,14 +1,16 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["children", "
|
4
|
-
import
|
5
|
-
import
|
4
|
+
var _excluded = ["align", "arrowCrossOffset", "children", "className", "closeDelay", "direction", "hasNoArrow", "iconButtonProps", "isDarkMode", "isNotFlippable", "offset", "popoverProps"];
|
5
|
+
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
6
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
7
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
8
|
+
import { FocusScope, mergeProps, useFocusRing, useFocusWithin, useOverlayPosition, useOverlayTrigger } from 'react-aria';
|
9
|
+
import { useOverlayTriggerState } from 'react-stately';
|
6
10
|
import { useHover } from '@react-aria/interactions';
|
7
11
|
import PropTypes from 'prop-types';
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import IconButton from '../IconButton';
|
11
|
-
import TooltipTrigger, { Tooltip } from '../TooltipTrigger';
|
12
|
+
import { Box, Icon, IconButton, PopoverContainer } from '../..';
|
13
|
+
import { useStatusClasses } from '../../hooks';
|
12
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
15
|
var HelpIcon = function HelpIcon() {
|
14
16
|
return ___EmotionJSX("svg", {
|
@@ -26,42 +28,158 @@ var HelpIcon = function HelpIcon() {
|
|
26
28
|
}));
|
27
29
|
};
|
28
30
|
var HelpHint = /*#__PURE__*/forwardRef(function (props, ref) {
|
29
|
-
var
|
30
|
-
|
31
|
+
var _context;
|
32
|
+
var align = props.align,
|
33
|
+
arrowCrossOffset = props.arrowCrossOffset,
|
34
|
+
children = props.children,
|
35
|
+
className = props.className,
|
36
|
+
closeDelay = props.closeDelay,
|
37
|
+
direction = props.direction,
|
38
|
+
hasNoArrow = props.hasNoArrow,
|
31
39
|
iconButtonProps = props.iconButtonProps,
|
40
|
+
isDarkMode = props.isDarkMode,
|
41
|
+
isNotFlippable = props.isNotFlippable,
|
42
|
+
offset = props.offset,
|
43
|
+
popoverProps = props.popoverProps,
|
32
44
|
others = _objectWithoutProperties(props, _excluded);
|
33
|
-
var
|
34
|
-
|
45
|
+
var _useState = useState(false),
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
47
|
+
isFocusWithinOverlay = _useState2[0],
|
48
|
+
setIsFocusWithinOverlay = _useState2[1];
|
49
|
+
var _useFocusWithin = useFocusWithin({
|
50
|
+
onFocusWithinChange: function onFocusWithinChange(isFocusWithin) {
|
51
|
+
return setIsFocusWithinOverlay(isFocusWithin);
|
52
|
+
}
|
53
|
+
}),
|
54
|
+
focusWithinProps = _useFocusWithin.focusWithinProps;
|
55
|
+
var overlayRef = useRef();
|
56
|
+
var triggerRef = useRef(null);
|
35
57
|
var _useFocusRing = useFocusRing(),
|
36
58
|
focusProps = _useFocusRing.focusProps,
|
37
59
|
isFocusVisible = _useFocusRing.isFocusVisible;
|
38
60
|
var _useHover = useHover({}),
|
39
61
|
hoverProps = _useHover.hoverProps,
|
40
62
|
isHovered = _useHover.isHovered;
|
41
|
-
var
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
63
|
+
var _useHover2 = useHover({}),
|
64
|
+
overlayHoverProps = _useHover2.hoverProps,
|
65
|
+
isOverlayHovered = _useHover2.isHovered;
|
66
|
+
var popoverState = useOverlayTriggerState({});
|
67
|
+
var open = popoverState.open,
|
68
|
+
close = popoverState.close,
|
69
|
+
isOpen = popoverState.isOpen;
|
70
|
+
var _useOverlayTrigger = useOverlayTrigger({
|
71
|
+
type: 'dialog'
|
72
|
+
}, popoverState, triggerRef),
|
73
|
+
triggerProps = _useOverlayTrigger.triggerProps,
|
74
|
+
overlayProps = _useOverlayTrigger.overlayProps;
|
75
|
+
|
76
|
+
/* istanbul ignore next */
|
77
|
+
useImperativeHandle(ref, function () {
|
78
|
+
return triggerRef.current;
|
79
|
+
});
|
80
|
+
|
81
|
+
// Set a timeout to close the overlay upon hover / focus loss,
|
82
|
+
// but keep it open if the trigger or overlay are hovered again before it closes.
|
83
|
+
useEffect(function () {
|
84
|
+
var timeout;
|
85
|
+
if (isHovered || isOverlayHovered || isFocusWithinOverlay) {
|
86
|
+
open();
|
87
|
+
} else {
|
88
|
+
timeout = _setTimeout(close, closeDelay || 1000);
|
89
|
+
}
|
90
|
+
return function () {
|
91
|
+
clearTimeout(timeout);
|
92
|
+
};
|
93
|
+
}, [isHovered, isOverlayHovered, isFocusWithinOverlay, open, close, closeDelay]);
|
94
|
+
useEffect(function () {
|
95
|
+
if (isOpen) {
|
96
|
+
return triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current.setAttribute('aria-expanded', 'true');
|
97
|
+
}
|
98
|
+
return triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current.setAttribute('aria-expanded', 'false');
|
99
|
+
}, [isOpen]);
|
100
|
+
var _useOverlayPosition = useOverlayPosition({
|
101
|
+
targetRef: triggerRef,
|
102
|
+
overlayRef: overlayRef,
|
103
|
+
placement: _concatInstanceProperty(_context = "".concat(direction, " ")).call(_context, align),
|
104
|
+
offset: 15,
|
105
|
+
isOpen: isOpen,
|
106
|
+
onClose: close,
|
107
|
+
shouldUpdatePosition: true,
|
108
|
+
shouldFlip: !isNotFlippable
|
109
|
+
}),
|
110
|
+
positionProps = _useOverlayPosition.overlayProps,
|
111
|
+
placement = _useOverlayPosition.placement;
|
112
|
+
var _useStatusClasses = useStatusClasses(className, {
|
113
|
+
isDarkMode: isDarkMode
|
114
|
+
}),
|
115
|
+
classNames = _useStatusClasses.classNames;
|
116
|
+
return ___EmotionJSX(Box, _extends({}, others, {
|
117
|
+
ref: ref
|
118
|
+
}), ___EmotionJSX(IconButton, _extends({
|
119
|
+
ref: triggerRef,
|
50
120
|
"aria-label": "label help hint",
|
51
121
|
"data-testid": "help-hint__button",
|
52
|
-
"
|
53
|
-
}, iconButtonProps,
|
122
|
+
variant: "hintButton"
|
123
|
+
}, mergeProps(triggerProps, iconButtonProps, focusProps, hoverProps)), ___EmotionJSX(Icon, {
|
54
124
|
icon: HelpIcon
|
55
|
-
})), ___EmotionJSX(
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
125
|
+
})), ___EmotionJSX(PopoverContainer, _extends({
|
126
|
+
arrowCrossOffset: arrowCrossOffset,
|
127
|
+
arrowProps: {
|
128
|
+
width: '8px',
|
129
|
+
height: '4px'
|
130
|
+
},
|
131
|
+
className: classNames,
|
132
|
+
direction: direction,
|
133
|
+
hasNoArrow: hasNoArrow,
|
134
|
+
isDismissable: !isOpen,
|
135
|
+
isNonModal: true,
|
136
|
+
isOpen: isOpen,
|
137
|
+
onClose: close,
|
138
|
+
placement: placement,
|
139
|
+
ref: overlayRef
|
140
|
+
}, mergeProps(overlayProps, positionProps, popoverProps, overlayHoverProps), focusWithinProps), ___EmotionJSX(FocusScope, {
|
141
|
+
restoreFocus: true,
|
142
|
+
autoFocus: isFocusVisible
|
143
|
+
}, ___EmotionJSX(Box, {
|
144
|
+
variant: "helpHint.popoverContainer"
|
145
|
+
}, children))));
|
60
146
|
});
|
61
147
|
HelpHint.propTypes = {
|
62
|
-
/** Props object that is spread directly into the
|
63
|
-
|
148
|
+
/** Props object that is spread directly into the popover element. */
|
149
|
+
popoverProps: PropTypes.shape({}),
|
64
150
|
/** Props object that is spread directly into the IconButton element. */
|
65
|
-
iconButtonProps: PropTypes.shape({})
|
151
|
+
iconButtonProps: PropTypes.shape({}),
|
152
|
+
/** Defaults to true, displays dark popover with white text */
|
153
|
+
isDarkMode: PropTypes.bool,
|
154
|
+
/** Where the popover menu opens relative to its trigger. */
|
155
|
+
direction: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
156
|
+
/**
|
157
|
+
* Whether the popover is prevented from flipping directions when insufficient space is
|
158
|
+
* available for the given `direction` placement.
|
159
|
+
*/
|
160
|
+
isNotFlippable: PropTypes.bool,
|
161
|
+
/** Alignment of the popover menu relative to the trigger. */
|
162
|
+
align: PropTypes.oneOf(['start', 'end', 'middle']),
|
163
|
+
/**
|
164
|
+
* Allows to add an arrow to popover container
|
165
|
+
*/
|
166
|
+
hasNoArrow: PropTypes.bool,
|
167
|
+
/** Popover offset relative to its trigger. */
|
168
|
+
offset: PropTypes.number,
|
169
|
+
/** Arrow offset relative to the left of the popover.
|
170
|
+
* Must be passed as a px or percentage. */
|
171
|
+
arrowCrossOffset: PropTypes.string,
|
172
|
+
/** The additional offset applied along the cross axis
|
173
|
+
* between the element and its anchor element. */
|
174
|
+
crossOffset: PropTypes.number,
|
175
|
+
/** Amount of time before the popover closes */
|
176
|
+
closeDelay: PropTypes.number
|
177
|
+
};
|
178
|
+
HelpHint.defaultProps = {
|
179
|
+
align: 'middle',
|
180
|
+
direction: 'top',
|
181
|
+
hasNoArrow: false,
|
182
|
+
isDarkMode: true,
|
183
|
+
isNotFlippable: false
|
66
184
|
};
|
67
185
|
export default HelpHint;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Components/HelpHint/HelpHint" />
|
4
|
+
|
5
|
+
# HelpHint
|
6
|
+
|
7
|
+
HelpHints display information intended to help users enter, select or provide the appropriate information in a field. This component can be customized, and consists of the [TooltipTrigger](./?path=/docs/components-tooltiptrigger--default) and [IconButton](./?path=/docs/components-iconbutton--default).
|
8
|
+
|
9
|
+
When implementing this component, use short, clear language and a text size relative to the trigger button. They should not block important information when the popover displays, nor should it be used to communicate important information.
|
10
|
+
|
11
|
+
### Required Components
|
12
|
+
|
13
|
+
This component can be used independently and does not require additional components.
|
14
|
+
|
15
|
+
### Accessibility
|
16
|
+
This component adheres to [WAI-ARIA Button](https://www.w3.org/TR/wai-aria-practices-1.1/examples/button/button.html) accessibility guidelines.
|
17
|
+
|
18
|
+
#### Keyboard Navigation
|
19
|
+
|
20
|
+
These keys provide additional functionality to the component.
|
21
|
+
|
22
|
+
| Aria Attribute | Role |
|
23
|
+
| ---- | ---- |
|
24
|
+
| Space or Enter | Selects the help hint. |
|
25
|
+
| Tab | Focuses the help hint and follows the page tab sequence. |
|
26
|
+
|
27
|
+
#### Screen Readers
|
28
|
+
|
29
|
+
This component uses the following attributes to assist screen readers:
|
30
|
+
- The trigger button uses **`aria-expanded`** to indicate the expansion and collapse of the popover.
|
31
|
+
- The **`aria-live`** attribute announces the dynamic changes in live region content.
|
32
|
+
|