@pingux/astro 1.42.2 → 2.0.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/CHANGELOG.md +0 -24
- package/README.md +25 -2
- package/lib/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +11 -11
- package/lib/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +4 -4
- package/lib/Patterns/ListAndPanelPattern.stories.hidden.js +9 -12
- package/lib/Patterns/MessagesPattern.stories.hidden.js +3 -7
- package/lib/Patterns/SaveBarPattern.stories.hidden.js +5 -6
- package/lib/Patterns/UnsavedChangesPattern.stories.hidden.js +12 -20
- package/lib/cjs/Patterns/AttributeMappingDisplayViewPattern.stories.hidden.js +10 -20
- package/lib/cjs/Patterns/AttributeMappingEditViewPattern.stories.hidden.js +4 -16
- package/lib/cjs/Patterns/ListAndPanelPattern.stories.hidden.js +8 -33
- package/lib/cjs/Patterns/MessagesPattern.stories.hidden.js +3 -22
- package/lib/cjs/Patterns/SaveBarPattern.stories.hidden.js +5 -21
- package/lib/cjs/Patterns/UnsavedChangesPattern.stories.hidden.js +11 -34
- package/lib/cjs/components/AccordionGridGroup/AccordionGrid.styles.js +70 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +21 -74
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +13 -65
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +26 -106
- package/lib/cjs/components/AccordionGridGroup/index.js +0 -4
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.js +27 -61
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +24 -57
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +37 -78
- package/lib/cjs/components/AccordionGridItem/index.js +0 -4
- package/lib/cjs/components/AccordionGroup/Accordion.styles.js +69 -0
- package/lib/cjs/components/AccordionGroup/AccordionGroup.js +16 -55
- package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +12 -44
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +30 -129
- package/lib/cjs/components/AccordionGroup/index.js +0 -4
- package/lib/cjs/components/AccordionItem/AccordionItem.js +42 -77
- package/lib/cjs/components/AccordionItem/index.js +0 -4
- package/lib/cjs/components/ArrayField/ArrayField.js +43 -113
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +11 -46
- package/lib/cjs/components/ArrayField/ArrayField.test.js +2 -31
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.js +3 -14
- package/lib/cjs/components/ArrayField/index.js +0 -6
- package/lib/cjs/components/AstroWrapper/AstroWrapper.js +19 -48
- package/lib/cjs/components/AstroWrapper/AstroWrapper.stories.js +0 -13
- package/lib/cjs/components/AstroWrapper/AstroWrapper.test.js +4 -12
- package/lib/cjs/components/AstroWrapper/PageWrapper.test.js +6 -13
- package/lib/cjs/components/AstroWrapper/index.js +0 -14
- package/lib/cjs/components/Avatar/Avatar.js +0 -15
- package/lib/cjs/components/Avatar/Avatar.stories.js +3 -15
- package/lib/cjs/components/Avatar/Avatar.test.js +2 -15
- package/lib/cjs/components/Avatar/index.js +0 -4
- package/lib/cjs/components/{Chip → Badge}/Badge.js +15 -55
- package/lib/cjs/components/{Chip → Badge}/Badge.stories.js +43 -77
- package/lib/cjs/components/Badge/Badge.styles.js +162 -0
- package/lib/cjs/components/{Chip → Badge}/Badge.test.js +10 -27
- package/lib/cjs/components/{Chip → Badge}/index.js +2 -6
- package/lib/cjs/components/Box/Box.js +22 -64
- package/lib/cjs/components/Box/Box.stories.js +47 -71
- package/lib/cjs/{styles/variants/tooltip.js → components/Box/Box.styles.js} +3 -5
- package/lib/cjs/components/Box/Box.test.js +11 -28
- package/lib/cjs/components/Box/index.js +0 -4
- package/lib/cjs/components/Bracket/Bracket.js +4 -22
- package/lib/cjs/components/Bracket/Bracket.stories.js +8 -19
- package/lib/cjs/components/Bracket/Bracket.styles.js +17 -0
- package/lib/cjs/components/Bracket/Bracket.test.js +3 -13
- package/lib/cjs/components/Bracket/index.js +0 -4
- package/lib/cjs/components/Breadcrumbs/Breadcrumb.styles.js +50 -0
- package/lib/cjs/components/Breadcrumbs/BreadcrumbItem.js +11 -55
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +12 -44
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +5 -21
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +10 -28
- package/lib/cjs/components/Breadcrumbs/index.js +2 -8
- package/lib/cjs/components/Button/Button.js +37 -96
- package/lib/cjs/components/Button/Button.stories.js +5 -31
- package/lib/cjs/components/Button/Button.test.js +6 -43
- package/lib/cjs/components/Button/Buttons.styles.js +248 -0
- package/lib/cjs/components/Button/constants.js +0 -2
- package/lib/cjs/components/Button/index.js +0 -4
- package/lib/cjs/components/Callout/Callout.js +3 -19
- package/lib/cjs/components/Callout/Callout.stories.js +3 -22
- package/lib/cjs/components/Callout/Callout.test.js +0 -20
- package/lib/cjs/components/Callout/index.js +0 -4
- package/lib/cjs/components/Card/Card.js +35 -69
- package/lib/cjs/components/Card/Card.stories.js +1 -17
- package/lib/cjs/components/Card/Card.styles.js +21 -0
- package/lib/cjs/components/Card/Card.test.js +4 -33
- package/lib/cjs/components/Card/index.js +0 -4
- package/lib/cjs/components/Checkbox/Checkbox.js +0 -13
- package/lib/cjs/{styles/forms/checkbox.js → components/Checkbox/Checkbox.styles.js} +1 -2
- package/lib/cjs/components/Checkbox/Checkbox.test.js +5 -13
- package/lib/cjs/components/Checkbox/CheckboxBase.js +2 -19
- package/lib/cjs/components/Checkbox/index.js +0 -4
- package/lib/cjs/components/CheckboxField/CheckboxField.js +31 -94
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +38 -98
- package/lib/cjs/components/CheckboxField/CheckboxField.test.js +24 -60
- package/lib/cjs/components/CheckboxField/index.js +0 -4
- package/lib/cjs/components/CodeView/CodeView.js +26 -68
- package/lib/cjs/components/CodeView/CodeView.stories.js +15 -26
- package/lib/cjs/{styles/variants/codeView.js → components/CodeView/CodeView.styles.js} +0 -2
- package/lib/cjs/components/CodeView/CodeView.test.js +20 -57
- package/lib/cjs/components/CodeView/index.js +0 -4
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.js +34 -69
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +13 -59
- package/lib/cjs/{styles/variants/collapsiblePanel.js → components/CollapsiblePanel/CollapsiblePanel.styles.js} +64 -28
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.test.js +2 -14
- package/lib/cjs/components/CollapsiblePanel/index.js +0 -4
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +4 -15
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +2 -14
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +20 -51
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +2 -31
- package/lib/cjs/components/CollapsiblePanelContainer/index.js +0 -4
- package/lib/cjs/components/CollapsiblePanelItem/CollapsiblePanelItem.js +4 -20
- package/lib/cjs/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +2 -18
- package/lib/cjs/components/CollapsiblePanelItem/index.js +0 -4
- package/lib/cjs/components/ColorField/ColorField.js +53 -117
- package/lib/cjs/components/ColorField/ColorField.stories.js +13 -56
- package/lib/cjs/{styles/forms/comboBox.js → components/ColorField/ColorField.styles.js} +8 -24
- package/lib/cjs/components/ColorField/ColorField.test.js +2 -41
- package/lib/cjs/components/ColorField/index.js +0 -4
- package/lib/cjs/{styles/forms/radio.js → components/ComboBox/ComboBox.styles.js} +25 -34
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +49 -89
- package/lib/cjs/components/ComboBox/index.js +0 -4
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +67 -162
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +53 -144
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +148 -361
- package/lib/cjs/components/ComboBoxField/index.js +0 -4
- package/lib/cjs/components/CopyText/CopyButton.js +3 -21
- package/lib/cjs/components/CopyText/CopyText.js +36 -81
- package/lib/cjs/components/CopyText/CopyText.stories.js +1 -19
- package/lib/cjs/components/CopyText/CopyText.styles.js +54 -0
- package/lib/cjs/components/CopyText/CopyText.test.js +333 -414
- package/lib/cjs/components/CopyText/index.js +0 -4
- package/lib/cjs/components/DataTable/DataTable.js +98 -172
- package/lib/cjs/components/DataTable/DataTable.stories.js +25 -73
- package/lib/cjs/components/DataTable/DataTable.styles.js +3 -21
- package/lib/cjs/components/DataTable/DataTable.test.js +88 -228
- package/lib/cjs/components/DataTable/{DataTableChip.js → DataTableBadge.js} +6 -21
- package/lib/cjs/components/DataTable/{DataTableChip.test.js → DataTableBadge.test.js} +1 -7
- package/lib/cjs/components/DataTable/DataTableMenu.js +0 -13
- package/lib/cjs/components/DataTable/DataTableMenu.test.js +0 -6
- package/lib/cjs/components/DataTable/DataTableMultiLine.js +1 -17
- package/lib/cjs/components/DataTable/DataTableMultiLine.test.js +0 -7
- package/lib/cjs/components/DataTable/DataTableVirtualizer.js +31 -52
- package/lib/cjs/components/DataTable/index.js +5 -17
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +68 -150
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +65 -140
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +28 -98
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumb.styles.js +54 -0
- package/lib/cjs/components/EnvironmentBreadcrumb/index.js +0 -4
- package/lib/cjs/components/FieldHelperText/FieldHelperText.js +5 -28
- package/lib/cjs/components/FieldHelperText/FieldHelperText.stories.js +1 -17
- package/lib/cjs/{styles/variants/bidirectionalIconButton.js → components/FieldHelperText/FieldHelperText.styles.js} +20 -32
- package/lib/cjs/components/FieldHelperText/FieldHelperText.test.js +6 -24
- package/lib/cjs/components/FieldHelperText/index.js +0 -4
- package/lib/cjs/components/FileInputField/FileInputField.js +51 -123
- package/lib/cjs/components/FileInputField/FileInputField.stories.js +23 -67
- package/lib/cjs/components/FileInputField/FileInputField.styles.js +63 -0
- package/lib/cjs/components/FileInputField/FileInputField.test.js +2 -47
- package/lib/cjs/components/FileInputField/FileItem.js +13 -39
- package/lib/cjs/components/FileInputField/FileSelect.js +7 -32
- package/lib/cjs/components/FileInputField/index.js +0 -4
- package/lib/cjs/components/HelpHint/HelpHint.js +7 -29
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +2 -16
- package/lib/cjs/components/HelpHint/HelpHint.styles.js +59 -0
- package/lib/cjs/components/HelpHint/HelpHint.test.js +3 -23
- package/lib/cjs/components/HelpHint/index.js +0 -4
- package/lib/cjs/components/Icon/Icon.js +4 -32
- package/lib/cjs/components/Icon/Icon.stories.js +5 -36
- package/lib/cjs/components/Icon/Icon.test.js +4 -21
- package/lib/cjs/components/Icon/NoticeIcon.js +2 -23
- package/lib/cjs/components/Icon/NoticeIcon.test.js +0 -10
- package/lib/cjs/components/Icon/index.js +0 -4
- package/lib/cjs/components/IconBadge/IconBadge.js +8 -36
- package/lib/cjs/components/IconBadge/IconBadge.stories.js +2 -15
- package/lib/cjs/components/IconBadge/IconBadge.test.js +2 -14
- package/lib/cjs/components/IconBadge/index.js +0 -4
- package/lib/cjs/components/IconButton/IconButton.js +37 -86
- package/lib/cjs/components/IconButton/IconButton.stories.js +9 -31
- package/lib/cjs/components/IconButton/IconButton.styles.js +165 -0
- package/lib/cjs/components/IconButton/IconButton.test.js +6 -53
- package/lib/cjs/components/IconButton/index.js +0 -4
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +10 -30
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.stories.js +4 -26
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.test.js +3 -18
- package/lib/cjs/components/IconButtonToggle/index.js +0 -4
- package/lib/cjs/components/Image/Image.js +28 -84
- package/lib/cjs/components/Image/Image.stories.js +8 -43
- package/lib/cjs/{styles/variants/images.js → components/Image/Image.styles.js} +0 -2
- package/lib/cjs/components/Image/Image.test.js +5 -41
- package/lib/cjs/components/Image/index.js +0 -4
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +19 -46
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +12 -59
- package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +61 -108
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +34 -97
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +24 -63
- package/lib/cjs/components/ImageUploadField/imageUpload.js +52 -0
- package/lib/cjs/components/ImageUploadField/index.js +0 -4
- package/lib/cjs/components/Input/Input.js +5 -27
- package/lib/cjs/components/Input/Input.stories.js +0 -14
- package/lib/cjs/{styles/forms/input.js → components/Input/Input.styles.js} +28 -37
- package/lib/cjs/components/Input/Input.test.js +3 -25
- package/lib/cjs/components/Input/index.js +0 -4
- package/lib/cjs/components/Label/Label.js +19 -48
- package/lib/cjs/components/Label/Label.stories.js +1 -16
- package/lib/cjs/{styles/forms/label.js → components/Label/Label.styles.js} +11 -24
- package/lib/cjs/components/Label/Label.test.js +4 -26
- package/lib/cjs/components/Label/constants.js +0 -2
- package/lib/cjs/components/Label/index.js +0 -4
- package/lib/cjs/components/Link/Link.js +24 -58
- package/lib/cjs/components/Link/Link.stories.js +6 -18
- package/lib/cjs/{styles/variants/links.js → components/Link/Link.styles.js} +3 -20
- package/lib/cjs/components/Link/Link.test.js +2 -26
- package/lib/cjs/components/Link/index.js +0 -4
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +32 -99
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +26 -80
- package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +24 -58
- package/lib/cjs/components/LinkSelectField/index.js +0 -4
- package/lib/cjs/components/ListBox/ListBox.js +41 -83
- package/lib/cjs/{styles/variants/listBox.js → components/ListBox/ListBox.styles.js} +11 -18
- package/lib/cjs/components/ListBox/ListBox.test.js +20 -45
- package/lib/cjs/components/ListBox/ListBoxContext.js +0 -6
- package/lib/cjs/components/ListBox/ListBoxSection.js +14 -37
- package/lib/cjs/components/ListBox/Option.js +24 -62
- package/lib/cjs/components/ListBox/index.js +0 -6
- package/lib/cjs/components/ListItem/ListItem.js +22 -69
- package/lib/cjs/components/ListItem/ListItem.stories.js +26 -125
- package/lib/cjs/components/ListItem/ListItem.styles.js +29 -0
- package/lib/cjs/components/ListItem/ListItem.test.js +14 -70
- package/lib/cjs/components/ListItem/index.js +0 -4
- package/lib/cjs/components/ListView/ListView.js +23 -85
- package/lib/cjs/components/ListView/ListView.stories.js +58 -105
- package/lib/cjs/components/ListView/ListView.test.js +41 -100
- package/lib/cjs/components/ListView/ListViewContext.js +0 -6
- package/lib/cjs/components/ListView/index.js +0 -4
- package/lib/cjs/components/ListViewItem/ListViewItem.js +42 -75
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +72 -0
- package/lib/cjs/components/ListViewItem/index.js +0 -4
- package/lib/cjs/components/Loader/Loader.js +2 -18
- package/lib/cjs/components/Loader/Loader.stories.js +2 -17
- package/lib/cjs/{styles/variants/loader.js → components/Loader/Loader.styles.js} +0 -22
- package/lib/cjs/components/Loader/Loader.test.js +2 -12
- package/lib/cjs/components/Loader/index.js +0 -4
- package/lib/cjs/components/Menu/Menu.js +25 -92
- package/lib/cjs/components/Menu/Menu.stories.js +11 -44
- package/lib/cjs/{styles/variants/menu.js → components/Menu/Menu.styles.js} +0 -2
- package/lib/cjs/components/Menu/Menu.test.js +20 -67
- package/lib/cjs/components/Menu/index.js +0 -4
- package/lib/cjs/components/MenuItem/MenuItem.js +50 -91
- package/lib/cjs/{styles/variants/menuItem.js → components/MenuItem/MenuItem.styles.js} +0 -2
- package/lib/cjs/components/MenuItem/MenuItem.test.js +7 -65
- package/lib/cjs/components/MenuItem/index.js +0 -4
- package/lib/cjs/components/Messages/Message.js +29 -67
- package/lib/cjs/components/Messages/Message.styles.js +108 -0
- package/lib/cjs/components/Messages/Messages.js +6 -29
- package/lib/cjs/components/Messages/Messages.reducer.js +0 -18
- package/lib/cjs/components/Messages/Messages.stories.js +32 -91
- package/lib/cjs/components/Messages/Messages.test.js +10 -63
- package/lib/cjs/components/Messages/index.js +2 -16
- package/lib/cjs/components/Messages/utils/index.js +0 -6
- package/lib/cjs/components/Messages/utils/messagesReducer.js +9 -51
- package/lib/cjs/components/Messages/utils/multiMessagesReducer.js +7 -43
- package/lib/cjs/components/Messages/utils/tests/messagesReducer.test.js +5 -23
- package/lib/cjs/components/Messages/utils/tests/multiMessagesReducer.test.js +7 -26
- package/lib/cjs/components/Modal/Modal.js +37 -103
- package/lib/cjs/components/Modal/Modal.stories.js +2 -12
- package/lib/cjs/{styles/variants/modal.js → components/Modal/Modal.styles.js} +13 -33
- package/lib/cjs/components/Modal/index.js +0 -4
- package/lib/cjs/components/Modal/tests/Modal.integration.test.js +11 -26
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +14 -52
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +92 -215
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +64 -133
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +41 -232
- package/lib/cjs/components/MultivaluesField/index.js +0 -4
- package/lib/cjs/components/NavBar/NavBar.js +14 -46
- package/lib/cjs/components/NavBar/NavBar.stories.js +5 -36
- package/lib/cjs/{styles/variants/navBar.js → components/NavBar/NavBar.styles.js} +89 -27
- package/lib/cjs/components/NavBar/NavBar.test.js +27 -145
- package/lib/cjs/components/NavBar/index.js +0 -4
- package/lib/cjs/components/NavBarSection/NavBarItem.js +37 -71
- package/lib/cjs/components/NavBarSection/NavBarItemBody.js +10 -34
- package/lib/cjs/components/NavBarSection/NavBarItemBody.test.js +2 -9
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +12 -40
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +11 -36
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +12 -41
- package/lib/cjs/components/NavBarSection/NavBarSection.js +17 -65
- package/lib/cjs/components/NavBarSection/index.js +2 -12
- package/lib/cjs/components/NumberField/NumberField.js +46 -115
- package/lib/cjs/components/NumberField/NumberField.stories.js +7 -49
- package/lib/cjs/{styles/variants/numberField.js → components/NumberField/NumberField.styles.js} +11 -20
- package/lib/cjs/components/NumberField/NumberField.test.js +5 -48
- package/lib/cjs/components/NumberField/index.js +0 -4
- package/lib/cjs/components/OverlayPanel/OverlayPanel.js +17 -50
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +62 -104
- package/lib/cjs/{styles/variants/overlayPanel.js → components/OverlayPanel/OverlayPanel.styles.js} +6 -8
- package/lib/cjs/components/OverlayPanel/OverlayPanel.test.js +2 -33
- package/lib/cjs/components/OverlayPanel/index.js +0 -4
- package/lib/cjs/components/PageHeader/PageHeader.js +5 -22
- package/lib/cjs/components/PageHeader/PageHeader.stories.js +4 -15
- package/lib/cjs/components/PageHeader/PageHeader.test.js +3 -13
- package/lib/cjs/components/PasswordField/PasswordField.js +54 -138
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +74 -161
- package/lib/cjs/components/PasswordField/PasswordField.test.js +41 -75
- package/lib/cjs/components/PasswordField/index.js +0 -4
- package/lib/cjs/components/PopoverContainer/PopoverContainer.js +39 -99
- package/lib/cjs/components/PopoverContainer/PopoverContainer.test.js +4 -16
- package/lib/cjs/components/PopoverContainer/index.js +0 -14
- package/lib/cjs/components/PopoverMenu/PopoverMenu.js +35 -84
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +19 -42
- package/lib/cjs/{styles/variants/popoverMenu.js → components/PopoverMenu/PopoverMenu.styles.js} +0 -2
- package/lib/cjs/components/PopoverMenu/PopoverMenu.test.js +14 -69
- package/lib/cjs/components/PopoverMenu/index.js +0 -4
- package/lib/cjs/components/Radio/Radio.js +0 -13
- package/lib/cjs/components/Radio/Radio.styles.js +63 -0
- package/lib/cjs/components/Radio/index.js +0 -4
- package/lib/cjs/components/RadioField/RadioField.js +34 -93
- package/lib/cjs/components/RadioField/RadioField.test.js +2 -27
- package/lib/cjs/components/RadioField/index.js +0 -14
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +26 -69
- package/lib/cjs/components/RadioGroupField/RadioGroupField.stories.js +5 -43
- package/lib/cjs/components/RadioGroupField/RadioGroupField.test.js +22 -55
- package/lib/cjs/components/RadioGroupField/index.js +0 -4
- package/lib/cjs/components/RequirementsList/RequirementsList.js +5 -33
- package/lib/cjs/components/RequirementsList/RequirementsList.stories.js +1 -12
- package/lib/cjs/components/RequirementsList/RequirementsList.test.js +13 -26
- package/lib/cjs/components/RequirementsList/index.js +0 -4
- package/lib/cjs/components/RockerButton/RockerButton.js +19 -52
- package/lib/cjs/components/RockerButton/RockerButton.styles.js +55 -0
- package/lib/cjs/components/RockerButton/index.js +0 -14
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.js +13 -52
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.stories.js +12 -37
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.test.js +7 -34
- package/lib/cjs/components/RockerButtonGroup/index.js +0 -14
- package/lib/cjs/components/ScrollBox/ScrollBox.js +26 -63
- package/lib/cjs/components/ScrollBox/ScrollBox.stories.js +1 -12
- package/lib/cjs/components/ScrollBox/ScrollBox.styles.js +51 -0
- package/lib/cjs/components/ScrollBox/ScrollBox.test.js +0 -24
- package/lib/cjs/components/ScrollBox/index.js +0 -4
- package/lib/cjs/{styles/forms/search.js → components/SearchField/Search.styles.js} +4 -6
- package/lib/cjs/components/SearchField/SearchField.js +35 -116
- package/lib/cjs/components/SearchField/SearchField.stories.js +11 -57
- package/lib/cjs/components/SearchField/SearchField.test.js +4 -73
- package/lib/cjs/components/SearchField/index.js +0 -4
- package/lib/cjs/{styles/forms/select.js → components/SelectField/Select.styles.js} +8 -25
- package/lib/cjs/components/SelectField/SelectField.js +8 -68
- package/lib/cjs/components/SelectField/SelectField.stories.js +28 -90
- package/lib/cjs/components/SelectField/SelectField.test.js +13 -43
- package/lib/cjs/components/SelectField/index.js +0 -4
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +38 -93
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.test.js +39 -143
- package/lib/cjs/components/SelectFieldBase/index.js +0 -4
- package/lib/cjs/components/Separator/Separator.js +10 -32
- package/lib/cjs/components/Separator/Separator.stories.js +3 -15
- package/lib/cjs/{styles/variants/separator.js → components/Separator/Separator.styles.js} +0 -17
- package/lib/cjs/components/Separator/Separator.test.js +2 -13
- package/lib/cjs/components/Separator/index.js +0 -4
- package/lib/cjs/components/Stepper/Line.js +5 -20
- package/lib/cjs/components/Stepper/Step.js +7 -27
- package/lib/cjs/components/Stepper/Stepper.constants.js +0 -2
- package/lib/cjs/components/Stepper/Stepper.js +12 -49
- package/lib/cjs/components/Stepper/Stepper.stories.js +12 -32
- package/lib/cjs/{styles/variants/stepper.js → components/Stepper/Stepper.styles.js} +6 -21
- package/lib/cjs/components/Stepper/Stepper.test.js +30 -62
- package/lib/cjs/components/Stepper/index.js +2 -8
- package/lib/cjs/components/Switch/Switch.js +2 -17
- package/lib/cjs/{styles/forms/switch.js → components/Switch/Switch.styles.js} +2 -17
- package/lib/cjs/components/Switch/index.js +0 -4
- package/lib/cjs/components/SwitchField/SwitchField.js +47 -116
- package/lib/cjs/components/SwitchField/SwitchField.stories.js +8 -51
- package/lib/cjs/components/SwitchField/SwitchField.test.js +2 -44
- package/lib/cjs/components/SwitchField/index.js +0 -4
- package/lib/cjs/components/Tab/Tab.js +45 -82
- package/lib/cjs/components/Tab/index.js +0 -14
- package/lib/cjs/components/TabPicker/TabPicker.js +40 -88
- package/lib/cjs/components/TabPicker/index.js +0 -4
- package/lib/cjs/components/Table/Table.js +3 -13
- package/lib/cjs/components/Table/Table.stories.js +4 -22
- package/lib/cjs/{styles/variants/table.js → components/Table/Table.styles.js} +15 -32
- package/lib/cjs/components/Table/Table.test.js +7 -25
- package/lib/cjs/components/Table/index.js +0 -4
- package/lib/cjs/components/TableBody/TableBody.js +3 -13
- package/lib/cjs/components/TableBody/index.js +0 -4
- package/lib/cjs/components/TableCaption/TableCaption.js +3 -13
- package/lib/cjs/components/TableCaption/index.js +0 -4
- package/lib/cjs/components/TableCell/TableCell.js +4 -15
- package/lib/cjs/components/TableCell/TableCell.test.js +4 -19
- package/lib/cjs/components/TableCell/index.js +0 -4
- package/lib/cjs/components/TableHead/TableHead.js +2 -12
- package/lib/cjs/components/TableHead/index.js +0 -4
- package/lib/cjs/components/TableRow/TableRow.js +3 -13
- package/lib/cjs/components/TableRow/index.js +0 -4
- package/lib/cjs/components/Tabs/Tabs.js +21 -81
- package/lib/cjs/components/Tabs/Tabs.stories.js +7 -52
- package/lib/cjs/{styles/variants/tabs.js → components/Tabs/Tabs.style.js} +15 -19
- package/lib/cjs/components/Tabs/Tabs.test.js +87 -180
- package/lib/cjs/components/Tabs/index.js +0 -14
- package/lib/cjs/components/Text/Text.js +3 -15
- package/lib/cjs/components/Text/Text.stories.js +17 -42
- package/lib/cjs/{styles/variants/text.js → components/Text/Text.styles.js} +4 -215
- package/lib/cjs/components/Text/Text.test.js +11 -38
- package/lib/cjs/components/Text/index.js +0 -4
- package/lib/cjs/components/TextArea/TextArea.js +3 -14
- package/lib/cjs/{styles/forms/textarea.js → components/TextArea/TextArea.styles.js} +28 -20
- package/lib/cjs/components/TextArea/TextArea.test.js +3 -13
- package/lib/cjs/components/TextArea/index.js +0 -4
- package/lib/cjs/components/TextAreaField/TextAreaField.js +34 -104
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +26 -81
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +4 -43
- package/lib/cjs/components/TextAreaField/index.js +0 -4
- package/lib/cjs/components/TextField/TextField.js +20 -88
- package/lib/cjs/components/TextField/TextField.stories.js +43 -113
- package/lib/cjs/components/TextField/TextField.test.js +4 -48
- package/lib/cjs/components/TextField/index.js +0 -4
- package/lib/cjs/components/TimeZonePicker/TimeZone.styles.js +38 -0
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.js +25 -84
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.stories.js +0 -11
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.test.js +3 -27
- package/lib/cjs/components/TimeZonePicker/index.js +0 -4
- package/lib/cjs/components/TimeZonePicker/timezones.js +0 -2
- package/lib/cjs/components/TooltipTrigger/Tooltip.js +8 -29
- package/lib/cjs/components/TooltipTrigger/Tooltip.styles.js +73 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +41 -88
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +7 -40
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.test.js +6 -41
- package/lib/cjs/components/TooltipTrigger/index.js +2 -8
- package/lib/cjs/context/AccordionContext/index.js +0 -7
- package/lib/cjs/context/AccordionGridContext/index.js +0 -6
- package/lib/cjs/context/BadgeContext/index.js +0 -4
- package/lib/cjs/context/DataTableContext/index.js +0 -12
- package/lib/cjs/context/MenuContext/index.js +0 -6
- package/lib/cjs/context/NavBarContext/index.js +0 -6
- package/lib/cjs/context/TooltipContext/index.js +0 -7
- package/lib/cjs/docs/design/ColorDocumentation.stories.js +2 -12
- package/lib/cjs/docs/design/ContainerSizes.stories.js +3 -14
- package/lib/cjs/docs/design/Spacing.stories.js +4 -21
- package/lib/cjs/docs/design/Typography.stories.js +19 -37
- package/lib/cjs/docs/theme/ThemeDocumentation.js +0 -9
- package/lib/cjs/hooks/index.js +1 -37
- package/lib/cjs/hooks/useAriaLabelWarning/index.js +0 -4
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +0 -6
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -5
- package/lib/cjs/hooks/useColumnStyles/index.js +0 -4
- package/lib/cjs/hooks/useColumnStyles/useColumnStyles.js +3 -12
- package/lib/cjs/hooks/useComponentToggle/index.js +0 -4
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +7 -21
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +23 -44
- package/lib/cjs/hooks/useCopyToClipboard/index.js +0 -4
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +12 -20
- package/lib/cjs/hooks/useCopyToClipboard/useCopyToClipboard.test.js +11 -22
- package/lib/cjs/hooks/useDebounce/index.js +0 -4
- package/lib/cjs/hooks/useDebounce/useDebounce.js +4 -14
- package/lib/cjs/hooks/useDebounce/useDebounce.test.js +14 -18
- package/lib/cjs/hooks/useDeprecationWarning/index.js +0 -4
- package/lib/cjs/hooks/useDeprecationWarning/useDeprecationWarning.js +7 -18
- package/lib/cjs/hooks/useDeprecationWarning/useDeprecationWarning.test.js +9 -20
- package/lib/cjs/hooks/useDevelopmentWarning/index.js +0 -4
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.js +1 -6
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -5
- package/lib/cjs/hooks/useFallbackImage/index.js +0 -4
- package/lib/cjs/hooks/useFallbackImage/useFallbackImage.js +4 -11
- package/lib/cjs/hooks/useFallbackImage/useFallbackImage.test.js +8 -24
- package/lib/cjs/hooks/useField/index.js +0 -4
- package/lib/cjs/hooks/useField/useField.js +129 -150
- package/lib/cjs/hooks/useField/useField.test.js +112 -89
- package/lib/cjs/hooks/useImageUploadState/index.js +0 -4
- package/lib/cjs/hooks/useImageUploadState/useImageUploadState.js +21 -43
- package/lib/cjs/hooks/useLabelHeight/index.js +0 -4
- package/lib/cjs/hooks/useLabelHeight/useLabelHeight.js +4 -15
- package/lib/cjs/hooks/useModalState/index.js +0 -4
- package/lib/cjs/hooks/useModalState/useModalState.js +4 -9
- package/lib/cjs/hooks/useModalState/useModalState.test.js +23 -32
- package/lib/cjs/hooks/useNavBarPress/index.js +0 -4
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.js +1 -8
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.test.js +16 -23
- package/lib/cjs/hooks/useOverlayPanelState/index.js +0 -4
- package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.js +4 -13
- package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.test.js +5 -8
- package/lib/cjs/hooks/useProgressiveState/index.js +0 -4
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.js +0 -7
- package/lib/cjs/hooks/useProgressiveState/useProgressiveState.test.js +13 -42
- package/lib/cjs/hooks/usePropWarning/index.js +0 -4
- package/lib/cjs/hooks/usePropWarning/usePropWarning.js +3 -13
- package/lib/cjs/hooks/usePropWarning/usePropWarning.test.js +1 -5
- package/lib/cjs/hooks/useRockerButton/index.js +0 -4
- package/lib/cjs/hooks/useRockerButton/useRockerButton.js +8 -27
- package/lib/cjs/hooks/useSelectField/index.js +0 -4
- package/lib/cjs/hooks/useSelectField/useSelectField.js +79 -119
- package/lib/cjs/hooks/useStatusClasses/index.js +0 -4
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.js +1 -9
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.test.js +12 -21
- package/lib/cjs/hooks/useTShirtSize/index.js +0 -4
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.js +1 -7
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.test.js +10 -20
- package/lib/cjs/index.js +187 -573
- package/lib/cjs/recipes/ApplicationSearchDropdown.stories.js +26 -73
- package/lib/cjs/recipes/Arrow.stories.js +0 -10
- package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +9 -25
- package/lib/cjs/recipes/AttributesAndPingOneMapping.stories.js +16 -51
- package/lib/cjs/recipes/CollapsiblePanel.stories.js +16 -58
- package/lib/cjs/recipes/ConditionalFilter.stories.js +24 -39
- package/lib/cjs/recipes/CopyToClipboard.stories.js +1 -11
- package/lib/cjs/recipes/CountryPicker.stories.js +18 -56
- package/lib/cjs/recipes/DatePicker.stories.js +70 -61
- package/lib/cjs/recipes/DraggableBox.stories.js +0 -13
- package/lib/cjs/recipes/EditableInput.stories.js +32 -80
- package/lib/cjs/recipes/FlippableCaretMenuButton.stories.js +18 -64
- package/lib/cjs/recipes/LinkedListView.stories.js +53 -67
- package/lib/cjs/recipes/ListAndPanel.stories.js +66 -159
- package/lib/cjs/recipes/LogoTabs.stories.js +9 -42
- package/lib/cjs/recipes/MaskedValue.stories.js +21 -33
- package/lib/cjs/recipes/NeutralInput.stories.js +0 -9
- package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +4 -21
- package/lib/cjs/recipes/PageHeader.stories.js +0 -10
- package/lib/cjs/recipes/PanelHeader.stories.js +2 -19
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +6 -30
- package/lib/cjs/recipes/RowLineChart.stories.js +178 -124
- package/lib/cjs/recipes/ScrollableListView.stories.js +11 -38
- package/lib/cjs/recipes/SelectedFieldOverlay.story.js +0 -12
- package/lib/cjs/recipes/Slider.stories.js +32 -78
- package/lib/cjs/recipes/StatsCircle.stories.js +0 -11
- package/lib/cjs/recipes/TrialExperienceIndustryButtons.stories.js +1 -25
- package/lib/cjs/recipes/TrialExperienceStatusBar.stories.js +13 -51
- package/lib/cjs/styles/ColorDocumentation.js +49 -93
- package/lib/cjs/styles/breakpoints.js +0 -2
- package/lib/cjs/styles/colors.js +15 -39
- package/lib/cjs/styles/forms/index.js +22 -41
- package/lib/cjs/styles/spacing.js +1 -3
- package/lib/cjs/styles/templates/Nav/HeaderBar.js +4 -26
- package/lib/cjs/styles/templates/Nav/Nav.stories.js +19 -39
- package/lib/cjs/styles/templates/Nav/NavData.js +4 -24
- package/lib/cjs/styles/text.js +0 -9
- package/lib/cjs/styles/theme-ui/ThemeView.js +18 -0
- package/lib/cjs/styles/theme.js +6 -30
- package/lib/cjs/styles/themeOverrides/index.js +2 -6
- package/lib/cjs/styles/themeOverrides/stories/AccordionGroup.chromatic.stories.js +27 -0
- package/lib/cjs/styles/themeOverrides/stories/Button.chromatic.stories.js +52 -0
- package/lib/cjs/styles/themeOverrides/stories/EnvironmentBreadcrumb.chromatic.stories.js +114 -0
- package/lib/cjs/styles/themeOverrides/stories/IconButton.chromatic.stories.js +36 -0
- package/lib/cjs/styles/themeOverrides/stories/Label.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/stories/Link.chromatic.stories.js +24 -0
- package/lib/cjs/styles/themeOverrides/stories/NavBar.chromatic.stories.js +373 -0
- package/lib/cjs/styles/themeOverrides/stories/NumberField.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/stories/RockerButtonGroup.chromatic.stories.js +31 -0
- package/lib/cjs/styles/themeOverrides/stories/SearchField.chromatic.stories.js +28 -0
- package/lib/cjs/styles/themeOverrides/stories/SelectField.chromatic.stories.js +31 -0
- package/lib/cjs/styles/themeOverrides/uiLibraryOverride.js +69 -67
- package/lib/cjs/{components/List/List.js → styles/themeOverrides/withUiLibraryCss.js} +23 -38
- package/lib/cjs/styles/themes/astro-nano/astro-nano.js +20 -39
- package/lib/cjs/styles/themes/astro-nano/index.js +0 -4
- package/lib/cjs/styles/themes/end-user/end-user.js +1 -22
- package/lib/cjs/styles/themes/end-user/index.js +0 -4
- package/lib/cjs/styles/useAstroTheme.js +0 -11
- package/lib/cjs/styles/variants/callout.js +0 -18
- package/lib/cjs/styles/variants/index.js +38 -41
- package/lib/cjs/styles/variants/variants.js +63 -91
- package/lib/cjs/utils/devUtils/constants/animals.js +0 -2
- package/lib/cjs/utils/devUtils/constants/firstNames.js +0 -2
- package/lib/cjs/utils/devUtils/constants/htmlElements.js +1 -3
- package/lib/cjs/utils/devUtils/constants/images.js +0 -2
- package/lib/cjs/utils/devUtils/constants/loadingStates.js +0 -2
- package/lib/cjs/utils/devUtils/constants/orientation.js +0 -2
- package/lib/cjs/utils/devUtils/constants/panelSizes.js +0 -2
- package/lib/cjs/utils/devUtils/constants/statuses.js +0 -2
- package/lib/cjs/utils/devUtils/constants/tShirtSizes.js +0 -2
- package/lib/cjs/utils/devUtils/constants/text.js +0 -2
- package/lib/cjs/utils/devUtils/constants/variants.js +5 -15
- package/lib/cjs/utils/devUtils/createMockData.js +0 -31
- package/lib/cjs/utils/devUtils/decorators/withDeprecationWarning.js +1 -11
- package/lib/cjs/utils/devUtils/props/ariaAttributes.js +2 -28
- package/lib/cjs/utils/devUtils/props/ariaAttributes.test.js +4 -22
- package/lib/cjs/utils/devUtils/props/{hoverProps.js → fieldAttributes.js} +30 -40
- package/lib/cjs/utils/devUtils/props/isIterable.js +6 -21
- package/lib/cjs/utils/devUtils/props/isValidPositiveInt.js +2 -13
- package/lib/cjs/utils/devUtils/styledSystemUtils.js +8 -32
- package/lib/cjs/utils/styleUtils/index.js +0 -4
- package/lib/cjs/utils/testUtils/setupTests.js +5 -11
- package/lib/cjs/utils/testUtils/testAxe.js +15 -19
- package/lib/cjs/utils/testUtils/testTheme.js +0 -2
- package/lib/cjs/utils/testUtils/testWrapper.js +13 -39
- package/lib/components/AccordionGridGroup/AccordionGrid.styles.js +62 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.js +16 -38
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +11 -38
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +18 -12
- package/lib/components/AccordionGridItem/AccordionGridItem.js +26 -36
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +23 -34
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +35 -51
- package/lib/components/AccordionGroup/Accordion.styles.js +61 -0
- package/lib/components/AccordionGroup/AccordionGroup.js +16 -28
- package/lib/components/AccordionGroup/AccordionGroup.stories.js +6 -7
- package/lib/components/AccordionGroup/AccordionGroup.test.js +13 -21
- package/lib/components/AccordionItem/AccordionItem.js +41 -52
- package/lib/components/ArrayField/ArrayField.js +42 -73
- package/lib/components/ArrayField/ArrayField.stories.js +8 -18
- package/lib/components/ArrayField/ArrayField.test.js +2 -5
- package/lib/components/ArrayField/ArrayFieldDeleteButton.js +3 -5
- package/lib/components/AstroWrapper/AstroWrapper.js +17 -26
- package/lib/components/AstroWrapper/AstroWrapper.test.js +4 -4
- package/lib/components/AstroWrapper/PageWrapper.test.js +7 -6
- package/lib/components/Avatar/Avatar.js +0 -1
- package/lib/components/Avatar/Avatar.stories.js +3 -3
- package/lib/components/Avatar/Avatar.test.js +2 -3
- package/lib/components/{Chip → Badge}/Badge.js +15 -28
- package/lib/components/{Chip → Badge}/Badge.stories.js +45 -53
- package/lib/components/Badge/Badge.styles.js +150 -0
- package/lib/components/{Chip → Badge}/Badge.test.js +8 -12
- package/lib/components/Badge/index.js +1 -0
- package/lib/components/Box/Box.js +16 -33
- package/lib/components/Box/Box.stories.js +7 -11
- package/lib/components/Box/Box.styles.js +6 -0
- package/lib/components/Box/Box.test.js +7 -7
- package/lib/components/Bracket/Bracket.js +5 -7
- package/lib/components/Bracket/Bracket.stories.js +8 -7
- package/lib/components/Bracket/Bracket.styles.js +9 -0
- package/lib/components/Bracket/Bracket.test.js +3 -4
- package/lib/components/Breadcrumbs/Breadcrumb.styles.js +42 -0
- package/lib/components/Breadcrumbs/BreadcrumbItem.js +10 -30
- package/lib/components/Breadcrumbs/Breadcrumbs.js +11 -21
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +2 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +7 -8
- package/lib/components/Breadcrumbs/index.js +2 -2
- package/lib/components/Button/Button.js +36 -68
- package/lib/components/Button/Button.stories.js +7 -6
- package/lib/components/Button/Button.test.js +6 -5
- package/lib/components/Button/Buttons.styles.js +234 -0
- package/lib/components/Callout/Callout.js +3 -6
- package/lib/components/Callout/Callout.stories.js +6 -4
- package/lib/components/Callout/Callout.test.js +0 -4
- package/lib/components/Card/Card.js +35 -49
- package/lib/components/Card/Card.stories.js +1 -1
- package/lib/components/Card/Card.styles.js +13 -0
- package/lib/components/Card/Card.test.js +4 -8
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/{styles/forms/checkbox.js → components/Checkbox/Checkbox.styles.js} +1 -0
- package/lib/components/Checkbox/Checkbox.test.js +5 -6
- package/lib/components/Checkbox/CheckboxBase.js +3 -5
- package/lib/components/CheckboxField/CheckboxField.js +31 -66
- package/lib/components/CheckboxField/CheckboxField.stories.js +37 -60
- package/lib/components/CheckboxField/CheckboxField.test.js +23 -23
- package/lib/components/CodeView/CodeView.js +25 -37
- package/lib/components/CodeView/CodeView.stories.js +15 -7
- package/lib/components/CodeView/CodeView.test.js +20 -24
- package/lib/components/CollapsiblePanel/CollapsiblePanel.js +25 -39
- package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +15 -23
- package/lib/{styles/variants/collapsiblePanel.js → components/CollapsiblePanel/CollapsiblePanel.styles.js} +61 -14
- package/lib/components/CollapsiblePanel/CollapsiblePanel.test.js +2 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +4 -7
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +2 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +19 -29
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +2 -3
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.js +4 -9
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +2 -3
- package/lib/components/ColorField/ColorField.js +48 -77
- package/lib/components/ColorField/ColorField.stories.js +13 -31
- package/lib/{styles/forms/comboBox.js → components/ColorField/ColorField.styles.js} +8 -12
- package/lib/components/ColorField/ColorField.test.js +2 -18
- package/lib/{styles/variants/bidirectionalIconButton.js → components/ComboBox/ComboBox.styles.js} +24 -22
- package/lib/components/ComboBox/ComboBoxInput.js +48 -57
- package/lib/components/ComboBoxField/ComboBoxField.js +63 -121
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +52 -70
- package/lib/components/ComboBoxField/ComboBoxField.test.js +153 -159
- package/lib/components/CopyText/CopyButton.js +3 -4
- package/lib/components/CopyText/CopyText.js +31 -57
- package/lib/components/CopyText/CopyText.stories.js +1 -1
- package/lib/components/CopyText/CopyText.styles.js +45 -0
- package/lib/components/CopyText/CopyText.test.js +333 -372
- package/lib/components/DataTable/DataTable.js +84 -125
- package/lib/components/DataTable/DataTable.stories.js +23 -34
- package/lib/components/DataTable/DataTable.styles.js +1 -8
- package/lib/components/DataTable/DataTable.test.js +83 -173
- package/lib/components/DataTable/{DataTableChip.js → DataTableBadge.js} +6 -6
- package/lib/components/DataTable/{DataTableChip.test.js → DataTableBadge.test.js} +2 -4
- package/lib/components/DataTable/DataTableMenu.test.js +0 -2
- package/lib/components/DataTable/DataTableMultiLine.js +1 -2
- package/lib/components/DataTable/DataTableMultiLine.test.js +0 -2
- package/lib/components/DataTable/DataTableVirtualizer.js +31 -35
- package/lib/components/DataTable/index.js +3 -3
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +63 -106
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +65 -103
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +23 -26
- package/lib/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumb.styles.js +46 -0
- package/lib/components/FieldHelperText/FieldHelperText.js +6 -9
- package/lib/components/FieldHelperText/FieldHelperText.stories.js +1 -1
- package/lib/{styles/forms/textarea.js → components/FieldHelperText/FieldHelperText.styles.js} +21 -12
- package/lib/components/FieldHelperText/FieldHelperText.test.js +6 -12
- package/lib/components/FileInputField/FileInputField.js +50 -83
- package/lib/components/FileInputField/FileInputField.stories.js +14 -20
- package/lib/components/FileInputField/FileInputField.styles.js +55 -0
- package/lib/components/FileInputField/FileInputField.test.js +2 -7
- package/lib/components/FileInputField/FileItem.js +13 -20
- package/lib/components/FileInputField/FileSelect.js +7 -14
- package/lib/components/HelpHint/HelpHint.js +7 -12
- package/lib/components/HelpHint/HelpHint.stories.js +2 -2
- package/lib/components/HelpHint/HelpHint.styles.js +50 -0
- package/lib/components/HelpHint/HelpHint.test.js +3 -4
- package/lib/components/Icon/Icon.js +4 -11
- package/lib/components/Icon/Icon.stories.js +5 -7
- package/lib/components/Icon/Icon.test.js +3 -4
- package/lib/components/Icon/NoticeIcon.js +2 -5
- package/lib/components/Icon/NoticeIcon.test.js +0 -2
- package/lib/components/IconBadge/IconBadge.js +8 -18
- package/lib/components/IconBadge/IconBadge.stories.js +2 -2
- package/lib/components/IconBadge/IconBadge.test.js +3 -6
- package/lib/components/IconButton/IconButton.js +37 -59
- package/lib/components/IconButton/IconButton.stories.js +10 -9
- package/lib/components/IconButton/IconButton.styles.js +155 -0
- package/lib/components/IconButton/IconButton.test.js +6 -7
- package/lib/components/IconButtonToggle/IconButtonToggle.js +10 -20
- package/lib/components/IconButtonToggle/IconButtonToggle.stories.js +4 -6
- package/lib/components/IconButtonToggle/IconButtonToggle.test.js +3 -7
- package/lib/components/Image/Image.js +30 -60
- package/lib/components/Image/Image.stories.js +8 -10
- package/lib/components/Image/Image.test.js +5 -13
- package/lib/components/ImageUploadField/ImagePreviewButton.js +17 -27
- package/lib/components/ImageUploadField/ImageUploadField.js +13 -32
- package/lib/components/ImageUploadField/ImageUploadField.stories.js +61 -71
- package/lib/components/ImageUploadField/ImageUploadField.test.js +34 -44
- package/lib/components/ImageUploadField/ImageUploadFieldBase.js +19 -29
- package/lib/components/ImageUploadField/imageUpload.js +44 -0
- package/lib/components/Input/Input.js +4 -11
- package/lib/{styles/forms/input.js → components/Input/Input.styles.js} +26 -19
- package/lib/components/Input/Input.test.js +3 -4
- package/lib/components/Label/Label.js +18 -28
- package/lib/components/Label/Label.stories.js +1 -1
- package/lib/{styles/forms/label.js → components/Label/Label.styles.js} +9 -8
- package/lib/components/Label/Label.test.js +4 -7
- package/lib/components/Link/Link.js +22 -37
- package/lib/components/Link/Link.stories.js +5 -5
- package/lib/{styles/variants/links.js → components/Link/Link.styles.js} +1 -6
- package/lib/components/Link/Link.test.js +2 -3
- package/lib/components/LinkSelectField/LinkSelectField.js +32 -73
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +22 -29
- package/lib/components/LinkSelectField/LinkSelectField.test.js +24 -21
- package/lib/components/ListBox/ListBox.js +41 -49
- package/lib/{styles/variants/listBox.js → components/ListBox/ListBox.styles.js} +9 -4
- package/lib/components/ListBox/ListBox.test.js +17 -15
- package/lib/components/ListBox/ListBoxSection.js +15 -20
- package/lib/components/ListBox/Option.js +25 -36
- package/lib/components/ListItem/ListItem.js +21 -45
- package/lib/components/ListItem/ListItem.stories.js +8 -74
- package/lib/components/ListItem/ListItem.styles.js +21 -0
- package/lib/components/ListItem/ListItem.test.js +14 -50
- package/lib/components/ListView/ListView.js +24 -53
- package/lib/components/ListView/ListView.stories.js +30 -48
- package/lib/components/ListView/ListView.test.js +36 -49
- package/lib/components/ListViewItem/ListViewItem.js +39 -53
- package/lib/components/ListViewItem/ListViewItem.styles.js +64 -0
- package/lib/components/Loader/Loader.js +2 -4
- package/lib/components/Loader/Loader.stories.js +2 -3
- package/lib/{styles/variants/loader.js → components/Loader/Loader.styles.js} +0 -9
- package/lib/components/Loader/Loader.test.js +2 -3
- package/lib/components/Menu/Menu.js +20 -55
- package/lib/components/Menu/Menu.stories.js +6 -21
- package/lib/components/Menu/Menu.test.js +21 -15
- package/lib/components/MenuItem/MenuItem.js +48 -69
- package/lib/components/MenuItem/MenuItem.test.js +8 -13
- package/lib/components/Messages/Message.js +30 -46
- package/lib/components/Messages/Message.styles.js +99 -0
- package/lib/components/Messages/Messages.js +6 -9
- package/lib/components/Messages/Messages.reducer.js +0 -6
- package/lib/components/Messages/Messages.stories.js +20 -38
- package/lib/components/Messages/Messages.test.js +7 -18
- package/lib/components/Messages/index.js +2 -2
- package/lib/components/Messages/utils/messagesReducer.js +10 -26
- package/lib/components/Messages/utils/multiMessagesReducer.js +8 -20
- package/lib/components/Messages/utils/tests/messagesReducer.test.js +6 -10
- package/lib/components/Messages/utils/tests/multiMessagesReducer.test.js +8 -13
- package/lib/components/Modal/Modal.js +32 -69
- package/lib/components/Modal/Modal.stories.js +3 -2
- package/lib/{styles/variants/modal.js → components/Modal/Modal.styles.js} +10 -19
- package/lib/components/Modal/tests/Modal.integration.test.js +13 -12
- package/lib/components/Modal/tests/Modal.unit.test.js +16 -22
- package/lib/components/MultivaluesField/MultivaluesField.js +91 -175
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +64 -92
- package/lib/components/MultivaluesField/MultivaluesField.test.js +41 -48
- package/lib/components/NavBar/NavBar.js +14 -27
- package/lib/components/NavBar/NavBar.stories.js +5 -11
- package/lib/{styles/variants/navBar.js → components/NavBar/NavBar.styles.js} +89 -15
- package/lib/components/NavBar/NavBar.test.js +12 -28
- package/lib/components/NavBarSection/NavBarItem.js +35 -49
- package/lib/components/NavBarSection/NavBarItemBody.js +11 -20
- package/lib/components/NavBarSection/NavBarItemBody.test.js +2 -5
- package/lib/components/NavBarSection/NavBarItemButton.js +13 -23
- package/lib/components/NavBarSection/NavBarItemHeader.js +11 -21
- package/lib/components/NavBarSection/NavBarItemLink.js +13 -24
- package/lib/components/NavBarSection/NavBarSection.js +17 -49
- package/lib/components/NavBarSection/index.js +2 -2
- package/lib/components/NumberField/NumberField.js +43 -80
- package/lib/components/NumberField/NumberField.stories.js +7 -10
- package/lib/{styles/variants/numberField.js → components/NumberField/NumberField.styles.js} +11 -8
- package/lib/components/NumberField/NumberField.test.js +5 -6
- package/lib/components/OverlayPanel/OverlayPanel.js +18 -31
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +56 -73
- package/lib/{styles/variants/overlayPanel.js → components/OverlayPanel/OverlayPanel.styles.js} +6 -6
- package/lib/components/OverlayPanel/OverlayPanel.test.js +2 -3
- package/lib/components/PageHeader/PageHeader.js +5 -6
- package/lib/components/PageHeader/PageHeader.stories.js +4 -4
- package/lib/components/PageHeader/PageHeader.test.js +3 -4
- package/lib/components/PasswordField/PasswordField.js +54 -104
- package/lib/components/PasswordField/PasswordField.stories.js +74 -112
- package/lib/components/PasswordField/PasswordField.test.js +24 -21
- package/lib/components/PopoverContainer/PopoverContainer.js +36 -73
- package/lib/components/PopoverContainer/PopoverContainer.test.js +4 -6
- package/lib/components/PopoverMenu/PopoverMenu.js +30 -52
- package/lib/components/PopoverMenu/PopoverMenu.stories.js +20 -13
- package/lib/components/PopoverMenu/PopoverMenu.test.js +15 -16
- package/lib/components/Radio/Radio.js +1 -1
- package/lib/{styles/forms/radio.js → components/Radio/Radio.styles.js} +28 -6
- package/lib/components/RadioField/RadioField.js +34 -66
- package/lib/components/RadioField/RadioField.test.js +2 -3
- package/lib/components/RadioGroupField/RadioGroupField.js +27 -41
- package/lib/components/RadioGroupField/RadioGroupField.stories.js +5 -9
- package/lib/components/RadioGroupField/RadioGroupField.test.js +21 -13
- package/lib/components/RequirementsList/RequirementsList.js +5 -11
- package/lib/components/RequirementsList/RequirementsList.stories.js +1 -1
- package/lib/components/RequirementsList/RequirementsList.test.js +7 -7
- package/lib/components/RockerButton/RockerButton.js +18 -27
- package/lib/components/RockerButton/RockerButton.styles.js +47 -0
- package/lib/components/RockerButtonGroup/RockerButtonGroup.js +11 -21
- package/lib/components/RockerButtonGroup/RockerButtonGroup.stories.js +6 -7
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +7 -12
- package/lib/components/ScrollBox/ScrollBox.js +26 -40
- package/lib/components/ScrollBox/ScrollBox.stories.js +1 -1
- package/lib/components/ScrollBox/ScrollBox.styles.js +43 -0
- package/lib/components/ScrollBox/ScrollBox.test.js +0 -3
- package/lib/{styles/forms/search.js → components/SearchField/Search.styles.js} +2 -2
- package/lib/components/SearchField/SearchField.js +34 -89
- package/lib/components/SearchField/SearchField.stories.js +15 -23
- package/lib/components/SearchField/SearchField.test.js +4 -5
- package/lib/{styles/forms/select.js → components/SelectField/Select.styles.js} +5 -7
- package/lib/components/SelectField/SelectField.js +9 -45
- package/lib/components/SelectField/SelectField.stories.js +22 -29
- package/lib/components/SelectField/SelectField.test.js +12 -17
- package/lib/components/SelectFieldBase/SelectFieldBase.js +39 -61
- package/lib/components/SelectFieldBase/SelectFieldBase.test.js +40 -39
- package/lib/components/Separator/Separator.js +10 -13
- package/lib/components/Separator/Separator.stories.js +3 -3
- package/lib/{styles/variants/separator.js → components/Separator/Separator.styles.js} +0 -6
- package/lib/components/Separator/Separator.test.js +2 -3
- package/lib/components/Stepper/Line.js +5 -9
- package/lib/components/Stepper/Step.js +7 -9
- package/lib/components/Stepper/Stepper.js +12 -29
- package/lib/components/Stepper/Stepper.stories.js +6 -6
- package/lib/{styles/variants/stepper.js → components/Stepper/Stepper.styles.js} +5 -8
- package/lib/components/Stepper/Stepper.test.js +32 -37
- package/lib/components/Stepper/index.js +2 -2
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/{styles/forms/switch.js → components/Switch/Switch.styles.js} +1 -4
- package/lib/components/SwitchField/SwitchField.js +48 -87
- package/lib/components/SwitchField/SwitchField.stories.js +8 -14
- package/lib/components/SwitchField/SwitchField.test.js +2 -3
- package/lib/components/Tab/Tab.js +41 -54
- package/lib/components/TabPicker/TabPicker.js +40 -61
- package/lib/components/Table/Table.js +3 -6
- package/lib/components/Table/Table.stories.js +4 -5
- package/lib/{styles/variants/table.js → components/Table/Table.styles.js} +15 -21
- package/lib/components/Table/Table.test.js +7 -9
- package/lib/components/TableBody/TableBody.js +3 -6
- package/lib/components/TableCaption/TableCaption.js +3 -6
- package/lib/components/TableCell/TableCell.js +4 -7
- package/lib/components/TableCell/TableCell.test.js +4 -5
- package/lib/components/TableHead/TableHead.js +2 -5
- package/lib/components/TableRow/TableRow.js +3 -6
- package/lib/components/Tabs/Tabs.js +18 -47
- package/lib/components/Tabs/Tabs.stories.js +7 -13
- package/lib/{styles/variants/tabs.js → components/Tabs/Tabs.style.js} +12 -5
- package/lib/components/Tabs/Tabs.test.js +88 -122
- package/lib/components/Text/Text.js +3 -4
- package/lib/components/Text/Text.stories.js +18 -28
- package/lib/{styles/variants/text.js → components/Text/Text.styles.js} +3 -205
- package/lib/components/Text/Text.test.js +11 -17
- package/lib/components/TextArea/TextArea.js +2 -2
- package/lib/components/TextArea/TextArea.styles.js +45 -0
- package/lib/components/TextArea/TextArea.test.js +3 -4
- package/lib/components/TextAreaField/TextAreaField.js +36 -83
- package/lib/components/TextAreaField/TextAreaField.stories.js +11 -18
- package/lib/components/TextAreaField/TextAreaField.test.js +5 -10
- package/lib/components/TextField/TextField.js +22 -64
- package/lib/components/TextField/TextField.stories.js +21 -28
- package/lib/components/TextField/TextField.test.js +4 -8
- package/lib/components/TimeZonePicker/TimeZone.styles.js +30 -0
- package/lib/components/TimeZonePicker/TimeZonePicker.js +25 -55
- package/lib/components/TimeZonePicker/TimeZonePicker.test.js +3 -7
- package/lib/components/TooltipTrigger/Tooltip.js +7 -10
- package/lib/components/TooltipTrigger/Tooltip.styles.js +64 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.js +39 -64
- package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +5 -5
- package/lib/components/TooltipTrigger/TooltipTrigger.test.js +6 -7
- package/lib/components/TooltipTrigger/index.js +2 -2
- package/lib/context/AccordionContext/index.js +0 -1
- package/lib/context/TooltipContext/index.js +0 -1
- package/lib/docs/design/ColorDocumentation.stories.js +1 -1
- package/lib/docs/design/ContainerSizes.stories.js +3 -5
- package/lib/docs/design/Spacing.stories.js +3 -6
- package/lib/docs/design/Typography.stories.js +6 -10
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +1 -2
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -2
- package/lib/hooks/useColumnStyles/useColumnStyles.js +3 -7
- package/lib/hooks/useComponentToggle/useComponentToggle.js +7 -14
- package/lib/hooks/useComponentToggle/useComponentToggle.test.js +25 -25
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.js +13 -15
- package/lib/hooks/useCopyToClipboard/useCopyToClipboard.test.js +11 -10
- package/lib/hooks/useDebounce/useDebounce.js +4 -9
- package/lib/hooks/useDebounce/useDebounce.test.js +14 -15
- package/lib/hooks/useDeprecationWarning/useDeprecationWarning.js +7 -12
- package/lib/hooks/useDeprecationWarning/useDeprecationWarning.test.js +11 -16
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.js +2 -3
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -2
- package/lib/hooks/useFallbackImage/useFallbackImage.js +4 -6
- package/lib/hooks/useFallbackImage/useFallbackImage.test.js +8 -13
- package/lib/hooks/useField/useField.js +126 -124
- package/lib/hooks/useField/useField.test.js +111 -74
- package/lib/hooks/useImageUploadState/useImageUploadState.js +21 -37
- package/lib/hooks/useLabelHeight/useLabelHeight.js +4 -10
- package/lib/hooks/useModalState/useModalState.js +4 -5
- package/lib/hooks/useModalState/useModalState.test.js +24 -30
- package/lib/hooks/useNavBarPress/useNavBarPress.js +1 -5
- package/lib/hooks/useNavBarPress/useNavBarPress.test.js +16 -20
- package/lib/hooks/useOverlayPanelState/useOverlayPanelState.js +4 -9
- package/lib/hooks/useOverlayPanelState/useOverlayPanelState.test.js +5 -5
- package/lib/hooks/useProgressiveState/useProgressiveState.js +1 -4
- package/lib/hooks/useProgressiveState/useProgressiveState.test.js +13 -20
- package/lib/hooks/usePropWarning/usePropWarning.js +3 -6
- package/lib/hooks/usePropWarning/usePropWarning.test.js +1 -2
- package/lib/hooks/useRockerButton/useRockerButton.js +8 -15
- package/lib/hooks/useSelectField/useSelectField.js +73 -86
- package/lib/hooks/useStatusClasses/useStatusClasses.js +2 -3
- package/lib/hooks/useStatusClasses/useStatusClasses.test.js +12 -18
- package/lib/hooks/useTShirtSize/useTShirtSize.js +1 -2
- package/lib/hooks/useTShirtSize/useTShirtSize.test.js +10 -17
- package/lib/index.js +30 -34
- package/lib/recipes/ApplicationSearchDropdown.stories.js +26 -43
- package/lib/recipes/AttributeMappingReadOnlyField.stories.js +10 -13
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +18 -33
- package/lib/recipes/CollapsiblePanel.stories.js +18 -28
- package/lib/recipes/ConditionalFilter.stories.js +25 -28
- package/lib/recipes/CopyToClipboard.stories.js +1 -1
- package/lib/recipes/CountryPicker.stories.js +18 -35
- package/lib/recipes/DatePicker.stories.js +70 -37
- package/lib/recipes/EditableInput.stories.js +34 -57
- package/lib/recipes/FlippableCaretMenuButton.stories.js +18 -33
- package/lib/recipes/LinkedListView.stories.js +49 -47
- package/lib/recipes/ListAndPanel.stories.js +31 -102
- package/lib/recipes/LogoTabs.stories.js +9 -17
- package/lib/recipes/MaskedValue.stories.js +21 -14
- package/lib/recipes/OneWayToBidirectionalArrow.stories.js +5 -8
- package/lib/recipes/PageHeader.stories.js +1 -1
- package/lib/recipes/PanelHeader.stories.js +2 -2
- package/lib/recipes/RadioButtonsWithLinks.stories.js +6 -11
- package/lib/recipes/RowLineChart.stories.js +177 -107
- package/lib/recipes/ScrollableListView.stories.js +11 -17
- package/lib/recipes/Slider.stories.js +23 -43
- package/lib/recipes/TrialExperienceIndustryButtons.stories.js +1 -12
- package/lib/recipes/TrialExperienceStatusBar.stories.js +14 -32
- package/lib/styles/ColorDocumentation.js +48 -62
- package/lib/styles/colors.js +17 -25
- package/lib/styles/forms/index.js +22 -16
- package/lib/styles/spacing.js +1 -1
- package/lib/styles/templates/Nav/HeaderBar.js +4 -9
- package/lib/styles/templates/Nav/Nav.stories.js +6 -9
- package/lib/styles/templates/Nav/NavData.js +5 -11
- package/lib/styles/text.js +1 -5
- package/lib/styles/theme-ui/ThemeView.js +9 -0
- package/lib/styles/theme.js +7 -10
- package/lib/styles/themeOverrides/index.js +1 -1
- package/lib/styles/themeOverrides/stories/AccordionGroup.chromatic.stories.js +17 -0
- package/lib/styles/themeOverrides/stories/Button.chromatic.stories.js +37 -0
- package/lib/styles/themeOverrides/stories/EnvironmentBreadcrumb.chromatic.stories.js +101 -0
- package/lib/styles/themeOverrides/stories/IconButton.chromatic.stories.js +25 -0
- package/lib/styles/themeOverrides/stories/Label.chromatic.stories.js +12 -0
- package/lib/styles/themeOverrides/stories/Link.chromatic.stories.js +14 -0
- package/lib/styles/themeOverrides/stories/NavBar.chromatic.stories.js +363 -0
- package/lib/styles/themeOverrides/stories/NumberField.chromatic.stories.js +12 -0
- package/lib/styles/themeOverrides/stories/RockerButtonGroup.chromatic.stories.js +21 -0
- package/lib/styles/themeOverrides/stories/SearchField.chromatic.stories.js +18 -0
- package/lib/styles/themeOverrides/stories/SelectField.chromatic.stories.js +21 -0
- package/lib/styles/themeOverrides/uiLibraryOverride.js +69 -55
- package/lib/styles/themeOverrides/withUiLibraryCss.js +25 -0
- package/lib/styles/themes/astro-nano/astro-nano.js +20 -23
- package/lib/styles/themes/end-user/end-user.js +1 -11
- package/lib/styles/variants/callout.js +0 -7
- package/lib/styles/variants/index.js +22 -6
- package/lib/styles/variants/variants.js +48 -35
- package/lib/utils/devUtils/constants/htmlElements.js +1 -0
- package/lib/utils/devUtils/constants/variants.js +5 -6
- package/lib/utils/devUtils/createMockData.js +2 -13
- package/lib/utils/devUtils/decorators/withDeprecationWarning.js +1 -5
- package/lib/utils/devUtils/props/ariaAttributes.js +2 -9
- package/lib/utils/devUtils/props/ariaAttributes.test.js +4 -11
- package/lib/utils/devUtils/props/{hoverProps.js → fieldAttributes.js} +26 -24
- package/lib/utils/devUtils/props/isIterable.js +6 -15
- package/lib/utils/devUtils/props/isValidPositiveInt.js +2 -8
- package/lib/utils/devUtils/styledSystemUtils.js +7 -12
- package/lib/utils/testUtils/setupTests.js +5 -4
- package/lib/utils/testUtils/testAxe.js +16 -13
- package/lib/utils/testUtils/testWrapper.js +7 -14
- package/package.json +55 -59
- package/NOTICE.html +0 -4707
- package/lib/cjs/components/ArrayField/ArrayFieldItem.js +0 -50
- package/lib/cjs/components/Chip/Chip.js +0 -58
- package/lib/cjs/components/List/List.stories.js +0 -66
- package/lib/cjs/components/List/List.test.js +0 -36
- package/lib/cjs/components/List/index.js +0 -18
- package/lib/cjs/components/PageHeader/index.js +0 -18
- package/lib/cjs/styles/variants/accordion.js +0 -92
- package/lib/cjs/styles/variants/boxes.js +0 -442
- package/lib/cjs/styles/variants/buttons.js +0 -815
- package/lib/cjs/styles/variants/imageUpload.js +0 -29
- package/lib/cjs/styles/variants/messages.js +0 -53
- package/lib/cjs/styles/variants/rockerbutton.js +0 -25
- package/lib/components/ArrayField/ArrayFieldItem.js +0 -31
- package/lib/components/Chip/Chip.js +0 -38
- package/lib/components/Chip/index.js +0 -1
- package/lib/components/List/List.js +0 -26
- package/lib/components/List/List.stories.js +0 -43
- package/lib/components/List/List.test.js +0 -24
- package/lib/components/List/index.js +0 -1
- package/lib/components/PageHeader/index.js +0 -1
- package/lib/styles/variants/accordion.js +0 -82
- package/lib/styles/variants/boxes.js +0 -421
- package/lib/styles/variants/buttons.js +0 -792
- package/lib/styles/variants/imageUpload.js +0 -19
- package/lib/styles/variants/messages.js +0 -43
- package/lib/styles/variants/rockerbutton.js +0 -15
- package/lib/styles/variants/tooltip.js +0 -6
- /package/lib/{styles/variants/codeView.js → components/CodeView/CodeView.styles.js} +0 -0
- /package/lib/{styles/variants/images.js → components/Image/Image.styles.js} +0 -0
- /package/lib/{styles/variants/menu.js → components/Menu/Menu.styles.js} +0 -0
- /package/lib/{styles/variants/menuItem.js → components/MenuItem/MenuItem.styles.js} +0 -0
- /package/lib/{styles/variants/popoverMenu.js → components/PopoverMenu/PopoverMenu.styles.js} +0 -0
@@ -1,29 +1,34 @@
|
|
1
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
2
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
3
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
4
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
7
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
8
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
9
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
10
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
1
11
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
2
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
3
|
-
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
4
13
|
var useCopyToClipboard = function useCopyToClipboard(value) {
|
5
14
|
var setIsCopied = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
6
|
-
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
15
|
+
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
7
16
|
var textArea, isSuccessful;
|
8
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
17
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
9
18
|
while (1) {
|
10
19
|
switch (_context.prev = _context.next) {
|
11
20
|
case 0:
|
12
21
|
_context.prev = 0;
|
13
|
-
|
14
22
|
if (!navigator.clipboard) {
|
15
23
|
_context.next = 7;
|
16
24
|
break;
|
17
25
|
}
|
18
|
-
|
19
26
|
_context.next = 4;
|
20
27
|
return navigator.clipboard.writeText(value);
|
21
|
-
|
22
28
|
case 4:
|
23
29
|
setIsCopied(true);
|
24
30
|
_context.next = 20;
|
25
31
|
break;
|
26
|
-
|
27
32
|
case 7:
|
28
33
|
// Workaround for copying in insecure origin
|
29
34
|
textArea = document.createElement('textarea');
|
@@ -34,29 +39,23 @@ var useCopyToClipboard = function useCopyToClipboard(value) {
|
|
34
39
|
textArea.select();
|
35
40
|
isSuccessful = document.execCommand('copy');
|
36
41
|
textArea.remove();
|
37
|
-
|
38
42
|
if (!isSuccessful) {
|
39
43
|
_context.next = 19;
|
40
44
|
break;
|
41
45
|
}
|
42
|
-
|
43
46
|
setIsCopied(isSuccessful);
|
44
47
|
_context.next = 20;
|
45
48
|
break;
|
46
|
-
|
47
49
|
case 19:
|
48
50
|
throw new Error('Unable to copy message');
|
49
|
-
|
50
51
|
case 20:
|
51
52
|
_context.next = 25;
|
52
53
|
break;
|
53
|
-
|
54
54
|
case 22:
|
55
55
|
_context.prev = 22;
|
56
56
|
_context.t0 = _context["catch"](0);
|
57
57
|
// eslint-disable-next-line no-console
|
58
58
|
console.error('Failed to copy: ', _context.t0);
|
59
|
-
|
60
59
|
case 25:
|
61
60
|
case "end":
|
62
61
|
return _context.stop();
|
@@ -65,5 +64,4 @@ var useCopyToClipboard = function useCopyToClipboard(value) {
|
|
65
64
|
}, _callee, null, [[0, 22]]);
|
66
65
|
}));
|
67
66
|
};
|
68
|
-
|
69
67
|
export default useCopyToClipboard;
|
@@ -6,19 +6,22 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
6
6
|
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
10
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
11
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
12
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
13
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
14
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
15
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
16
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
9
17
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
10
18
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
12
|
-
|
19
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context4; _forEachInstanceProperty(_context4 = ["next", "throw", "return"]).call(_context4, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context5; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context5 = this.tryEntries).call(_context5, resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
13
20
|
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; }
|
14
|
-
|
15
21
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
|
-
|
17
22
|
import useCopyToClipboard from './useCopyToClipboard';
|
18
23
|
var mockCopyText = 'test';
|
19
|
-
|
20
24
|
var originalClipboard = _objectSpread({}, global.navigator.clipboard);
|
21
|
-
|
22
25
|
var originalExecCommand = global.document.execCommand;
|
23
26
|
beforeEach(function () {
|
24
27
|
global.navigator.clipboard = {
|
@@ -41,9 +44,9 @@ test('should copy text that passed in props', function () {
|
|
41
44
|
copyToClipboard();
|
42
45
|
expect(navigator.clipboard.writeText).toHaveBeenCalledWith(mockCopyText);
|
43
46
|
});
|
44
|
-
test('should call setIsCopied once function will be called', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
47
|
+
test('should call setIsCopied once function will be called', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
45
48
|
var mockSetIsCopied, copyToClipboard;
|
46
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
49
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
47
50
|
while (1) {
|
48
51
|
switch (_context.prev = _context.next) {
|
49
52
|
case 0:
|
@@ -51,10 +54,8 @@ test('should call setIsCopied once function will be called', /*#__PURE__*/_async
|
|
51
54
|
copyToClipboard = useCopyToClipboard(mockCopyText, mockSetIsCopied);
|
52
55
|
_context.next = 4;
|
53
56
|
return copyToClipboard();
|
54
|
-
|
55
57
|
case 4:
|
56
58
|
expect(mockSetIsCopied).toHaveBeenCalledWith(true);
|
57
|
-
|
58
59
|
case 5:
|
59
60
|
case "end":
|
60
61
|
return _context.stop();
|
@@ -1,26 +1,21 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
2
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
3
3
|
import { useEffect, useState } from 'react';
|
4
|
-
|
5
4
|
var useDebounce = function useDebounce(props) {
|
6
5
|
var value = props.value,
|
7
|
-
|
8
|
-
|
6
|
+
delay = props.delay;
|
9
7
|
var _useState = useState(value),
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
_useState2 = _slicedToArray(_useState, 2),
|
9
|
+
debouncedValue = _useState2[0],
|
10
|
+
setDebouncedValue = _useState2[1];
|
14
11
|
useEffect(function () {
|
15
12
|
var handler = _setTimeout(function () {
|
16
13
|
setDebouncedValue(value);
|
17
14
|
}, [delay]);
|
18
|
-
|
19
15
|
return function () {
|
20
16
|
clearTimeout(handler);
|
21
17
|
};
|
22
18
|
}, [value, delay]);
|
23
19
|
return debouncedValue;
|
24
20
|
};
|
25
|
-
|
26
21
|
export default useDebounce;
|
@@ -1,24 +1,23 @@
|
|
1
1
|
import { act, renderHook } from '@testing-library/react-hooks';
|
2
|
-
import useDebounce from '
|
2
|
+
import useDebounce from '.';
|
3
3
|
describe('useDebounce', function () {
|
4
4
|
jest.useFakeTimers();
|
5
5
|
it('Updates value only after `delay` milliseconds have expired', function () {
|
6
6
|
var _renderHook = renderHook(function (_ref) {
|
7
|
-
|
7
|
+
var value = _ref.value,
|
8
8
|
delay = _ref.delay;
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
9
|
+
return useDebounce({
|
10
|
+
value: value,
|
11
|
+
delay: delay
|
12
|
+
});
|
13
|
+
}, {
|
14
|
+
initialProps: {
|
15
|
+
value: 'foo',
|
16
|
+
delay: 500
|
17
|
+
}
|
18
|
+
}),
|
19
|
+
result = _renderHook.result,
|
20
|
+
rerender = _renderHook.rerender;
|
22
21
|
expect(result.current).toBe('foo');
|
23
22
|
act(function () {
|
24
23
|
return jest.advanceTimersByTime(510);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
2
2
|
import { useEffect } from 'react';
|
3
3
|
var alreadyShown = new _Set();
|
4
|
+
|
4
5
|
/**
|
5
6
|
* Provides a development-only console warning on component mount.
|
6
7
|
* @param {String} text - The deprecation warning text. It should describe what is being deprecated,
|
@@ -10,31 +11,25 @@ var alreadyShown = new _Set();
|
|
10
11
|
* @param {boolean} options.onlyOnce - if true then warning will be globally shown just once
|
11
12
|
* e.g. "\`MyField\` will be deprecated in Astro-UI 1.0.0, use \`MyOtherField\` instead."
|
12
13
|
*/
|
13
|
-
|
14
14
|
var useDeprecationWarning = function useDeprecationWarning() {
|
15
15
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
16
|
-
|
17
16
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
_ref$onlyOnce = _ref.onlyOnce,
|
18
|
+
onlyOnce = _ref$onlyOnce === void 0 ? true : _ref$onlyOnce,
|
19
|
+
_ref$isActive = _ref.isActive,
|
20
|
+
isActive = _ref$isActive === void 0 ? true : _ref$isActive;
|
23
21
|
useEffect(function () {
|
24
22
|
if (!isActive) {
|
25
23
|
return;
|
26
24
|
}
|
27
|
-
|
28
25
|
if (onlyOnce && alreadyShown.has(text)) {
|
29
26
|
return;
|
30
27
|
}
|
31
|
-
|
32
28
|
if (process.env.NODE_ENV === 'development') {
|
33
|
-
alreadyShown.add(text);
|
34
|
-
|
29
|
+
alreadyShown.add(text);
|
30
|
+
// eslint-disable-next-line no-console
|
35
31
|
console.warn("".concat(text), '\n', '\n', 'NOTE: This is a development-only warning and will not display in production.');
|
36
32
|
}
|
37
33
|
}, [isActive]);
|
38
34
|
};
|
39
|
-
|
40
35
|
export default useDeprecationWarning;
|
@@ -1,24 +1,22 @@
|
|
1
1
|
import _toArray from "@babel/runtime-corejs3/helpers/esm/toArray";
|
2
2
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
3
3
|
import { renderHook } from '@testing-library/react-hooks';
|
4
|
-
import useDeprecationWarning from './useDeprecationWarning';
|
4
|
+
import useDeprecationWarning from './useDeprecationWarning';
|
5
5
|
|
6
|
+
// since we cannot reset `alreadyShown` inside of module we will generate unique messages
|
6
7
|
var uniqueIndex = 0;
|
7
|
-
|
8
8
|
function generateUniqueMessage() {
|
9
9
|
var message = "Text ".concat(uniqueIndex);
|
10
10
|
uniqueIndex += 1;
|
11
11
|
return message;
|
12
12
|
}
|
13
|
-
|
14
13
|
beforeEach(function () {
|
15
14
|
process.env.NODE_ENV = 'development';
|
16
|
-
|
17
15
|
global.console.warn = function () {
|
18
16
|
return jest.mock();
|
19
17
|
}; // eslint-disable-line no-console
|
20
|
-
|
21
18
|
});
|
19
|
+
|
22
20
|
afterEach(function () {
|
23
21
|
process.env.NODE_ENV = 'test';
|
24
22
|
jest.restoreAllMocks();
|
@@ -69,19 +67,16 @@ test('useDeprecationWarning shows same message for few times if explicitly allow
|
|
69
67
|
test('shows message after isActive is flipped from false to true', function () {
|
70
68
|
var spy = jest.spyOn(console, 'warn');
|
71
69
|
var message = generateUniqueMessage();
|
72
|
-
|
73
70
|
var _renderHook = renderHook(function (_ref) {
|
74
|
-
|
71
|
+
var _ref2 = _toArray(_ref),
|
75
72
|
args = _sliceInstanceProperty(_ref2).call(_ref2, 0);
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
rerender = _renderHook.rerender;
|
84
|
-
|
73
|
+
return useDeprecationWarning.apply(void 0, args);
|
74
|
+
}, {
|
75
|
+
initialProps: [message, {
|
76
|
+
isActive: false
|
77
|
+
}]
|
78
|
+
}),
|
79
|
+
rerender = _renderHook.rerender;
|
85
80
|
rerender([message, {
|
86
81
|
isActive: true
|
87
82
|
}]);
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { useMemo } from 'react';
|
2
|
+
|
2
3
|
/**
|
3
4
|
* Provides a development-only console warning.
|
4
5
|
*/
|
5
|
-
|
6
6
|
var useDevelopmentWarning = function useDevelopmentWarning(_ref) {
|
7
7
|
var message = _ref.message,
|
8
|
-
|
8
|
+
shouldTrigger = _ref.shouldTrigger;
|
9
9
|
useMemo(function () {
|
10
10
|
if (process.env.NODE_ENV === 'development' && shouldTrigger) {
|
11
11
|
// eslint-disable-next-line no-console
|
@@ -13,5 +13,4 @@ var useDevelopmentWarning = function useDevelopmentWarning(_ref) {
|
|
13
13
|
}
|
14
14
|
}, [message, shouldTrigger]);
|
15
15
|
};
|
16
|
-
|
17
16
|
export default useDevelopmentWarning;
|
@@ -3,12 +3,11 @@ import useDevelopmentWarning from './useDevelopmentWarning';
|
|
3
3
|
var message = 'This is test message';
|
4
4
|
beforeEach(function () {
|
5
5
|
process.env.NODE_ENV = 'development';
|
6
|
-
|
7
6
|
global.console.warn = function () {
|
8
7
|
return jest.mock();
|
9
8
|
}; // eslint-disable-line no-console
|
10
|
-
|
11
9
|
});
|
10
|
+
|
12
11
|
afterEach(function () {
|
13
12
|
process.env.NODE_ENV = 'test';
|
14
13
|
jest.restoreAllMocks();
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
2
2
|
import { useEffect, useMemo } from 'react';
|
3
|
-
|
4
3
|
var useFallbackImage = function useFallbackImage(_ref) {
|
5
4
|
var imageSrc = _ref.src,
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
onImageLoad = _ref.onImageLoad,
|
6
|
+
onImageError = _ref.onImageError,
|
7
|
+
fallbackTimeout = _ref.fallbackTimeout,
|
8
|
+
onFallbackTimeout = _ref.onFallbackTimeout;
|
10
9
|
var displayImage = useMemo(function () {
|
11
10
|
return document.createElement('img');
|
12
11
|
}, []);
|
@@ -28,5 +27,4 @@ var useFallbackImage = function useFallbackImage(_ref) {
|
|
28
27
|
}, []);
|
29
28
|
return displayImage;
|
30
29
|
};
|
31
|
-
|
32
30
|
export default useFallbackImage;
|
@@ -7,11 +7,8 @@ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-st
|
|
7
7
|
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
-
|
11
10
|
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; }
|
12
|
-
|
13
11
|
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) { _defineProperty(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; }
|
14
|
-
|
15
12
|
import { renderHook } from '@testing-library/react-hooks';
|
16
13
|
import useFallbackImage from './useFallbackImage';
|
17
14
|
var defaultProps = {
|
@@ -24,10 +21,9 @@ var defaultProps = {
|
|
24
21
|
};
|
25
22
|
test('should return node if all props are correct ', function () {
|
26
23
|
var _renderHook = renderHook(function () {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
return useFallbackImage(defaultProps);
|
25
|
+
}),
|
26
|
+
current = _renderHook.result.current;
|
31
27
|
expect(current).toBeInstanceOf(HTMLImageElement);
|
32
28
|
});
|
33
29
|
test('should not trigger onImageLoad if no fallback passed', function () {
|
@@ -40,12 +36,11 @@ test('should not trigger onImageLoad if no fallback passed', function () {
|
|
40
36
|
});
|
41
37
|
test('should not trigger onImageLoad if component unmounted', function () {
|
42
38
|
var _renderHook2 = renderHook(function () {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
return useFallbackImage(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
40
|
+
fallbackImage: null
|
41
|
+
}));
|
42
|
+
}),
|
43
|
+
unmount = _renderHook2.unmount;
|
49
44
|
unmount();
|
50
45
|
expect(defaultProps.onImageLoad).not.toHaveBeenCalled();
|
51
46
|
});
|