@pingux/astro 2.0.0-alpha.1 → 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 +35 -0
- package/NOTICE +2481 -0
- 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 +0 -15
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +19 -72
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +8 -37
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +20 -100
- package/lib/cjs/components/AccordionGridGroup/index.js +0 -4
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.js +24 -58
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +21 -54
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +32 -71
- package/lib/cjs/components/AccordionGridItem/index.js +0 -4
- package/lib/cjs/components/AccordionGroup/Accordion.styles.js +0 -17
- package/lib/cjs/components/AccordionGroup/AccordionGroup.js +15 -54
- package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +5 -37
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +18 -117
- package/lib/cjs/components/AccordionGroup/index.js +0 -4
- package/lib/cjs/components/AccordionItem/AccordionItem.js +37 -70
- package/lib/cjs/components/AccordionItem/index.js +0 -4
- package/lib/cjs/components/ArrayField/ArrayField.js +28 -96
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +7 -42
- 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/Badge/Badge.js +14 -54
- package/lib/cjs/components/Badge/Badge.stories.js +15 -52
- package/lib/cjs/components/Badge/Badge.styles.js +0 -29
- package/lib/cjs/components/Badge/Badge.test.js +6 -23
- package/lib/cjs/components/Badge/index.js +0 -4
- package/lib/cjs/components/Box/Box.js +21 -63
- package/lib/cjs/components/Box/Box.stories.js +47 -71
- package/lib/cjs/components/Box/Box.styles.js +0 -2
- 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 +3 -21
- package/lib/cjs/components/Bracket/Bracket.stories.js +1 -13
- package/lib/cjs/components/Bracket/Bracket.styles.js +0 -2
- 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 +0 -15
- package/lib/cjs/components/Breadcrumbs/BreadcrumbItem.js +8 -50
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +8 -38
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +2 -18
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.test.js +5 -23
- package/lib/cjs/components/Breadcrumbs/index.js +2 -8
- package/lib/cjs/components/Button/Button.js +34 -80
- package/lib/cjs/components/Button/Button.stories.js +4 -30
- package/lib/cjs/components/Button/Button.test.js +6 -43
- package/lib/cjs/components/Button/Buttons.styles.js +0 -28
- 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 +0 -2
- 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/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 +20 -78
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +34 -81
- 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 +24 -66
- package/lib/cjs/components/CodeView/CodeView.stories.js +5 -26
- package/lib/cjs/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 +28 -61
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +11 -57
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.styles.js +0 -23
- 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 +2 -13
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +2 -14
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +17 -48
- 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 +3 -19
- 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 +39 -94
- package/lib/cjs/components/ColorField/ColorField.stories.js +10 -40
- package/lib/cjs/components/ColorField/ColorField.styles.js +1 -17
- package/lib/cjs/components/ColorField/ColorField.test.js +2 -21
- package/lib/cjs/components/ColorField/index.js +0 -4
- package/lib/cjs/components/ComboBox/ComboBox.styles.js +0 -17
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +38 -74
- package/lib/cjs/components/ComboBox/index.js +0 -4
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +59 -150
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +50 -141
- 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 +1 -18
- package/lib/cjs/components/CopyText/CopyText.js +28 -71
- package/lib/cjs/components/CopyText/CopyText.stories.js +1 -19
- package/lib/cjs/components/CopyText/CopyText.styles.js +0 -15
- 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 +58 -152
- package/lib/cjs/components/DataTable/DataTable.stories.js +21 -69
- package/lib/cjs/components/DataTable/DataTable.styles.js +0 -18
- package/lib/cjs/components/DataTable/DataTable.test.js +81 -221
- package/lib/cjs/components/DataTable/DataTableBadge.js +2 -17
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +0 -6
- 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 +2 -14
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +61 -139
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +48 -123
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +29 -97
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumb.styles.js +0 -15
- package/lib/cjs/components/EnvironmentBreadcrumb/index.js +0 -4
- package/lib/cjs/components/FieldHelperText/FieldHelperText.js +4 -27
- package/lib/cjs/components/FieldHelperText/FieldHelperText.stories.js +1 -17
- package/lib/cjs/components/FieldHelperText/FieldHelperText.styles.js +0 -16
- 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 +41 -116
- package/lib/cjs/components/FileInputField/FileInputField.stories.js +20 -66
- package/lib/cjs/components/FileInputField/FileInputField.styles.js +0 -15
- package/lib/cjs/components/FileInputField/FileInputField.test.js +2 -47
- package/lib/cjs/components/FileInputField/FileItem.js +10 -36
- package/lib/cjs/components/FileInputField/FileSelect.js +6 -31
- package/lib/cjs/components/FileInputField/index.js +0 -4
- package/lib/cjs/components/HelpHint/HelpHint.js +5 -26
- package/lib/cjs/components/HelpHint/HelpHint.stories.js +2 -16
- package/lib/cjs/components/HelpHint/HelpHint.styles.js +0 -15
- 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 +4 -35
- 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 +32 -79
- package/lib/cjs/components/IconButton/IconButton.stories.js +7 -29
- package/lib/cjs/components/IconButton/IconButton.styles.js +3 -32
- 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/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 +16 -41
- package/lib/cjs/components/ImageUploadField/ImageUploadField.js +9 -58
- package/lib/cjs/components/ImageUploadField/ImageUploadField.stories.js +58 -107
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +34 -97
- package/lib/cjs/components/ImageUploadField/ImageUploadFieldBase.js +22 -62
- package/lib/cjs/components/ImageUploadField/imageUpload.js +0 -17
- 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/components/Input/Input.styles.js +8 -23
- 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/components/Label/Label.styles.js +7 -20
- 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 +21 -51
- package/lib/cjs/components/Link/Link.stories.js +4 -16
- package/lib/cjs/components/Link/Link.styles.js +0 -17
- 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 +23 -81
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +17 -72
- 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 +39 -81
- package/lib/cjs/components/ListBox/ListBox.styles.js +0 -15
- package/lib/cjs/components/ListBox/ListBox.test.js +18 -43
- package/lib/cjs/components/ListBox/ListBoxContext.js +0 -6
- package/lib/cjs/components/ListBox/ListBoxSection.js +12 -35
- 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 +11 -33
- package/lib/cjs/components/ListItem/ListItem.stories.js +2 -20
- package/lib/cjs/components/ListItem/ListItem.styles.js +0 -2
- package/lib/cjs/components/ListItem/ListItem.test.js +3 -15
- package/lib/cjs/components/ListItem/index.js +0 -4
- package/lib/cjs/components/ListView/ListView.js +22 -77
- package/lib/cjs/components/ListView/ListView.stories.js +52 -97
- package/lib/cjs/components/ListView/ListView.test.js +34 -93
- 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 +35 -64
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +0 -16
- 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/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 +14 -65
- package/lib/cjs/components/Menu/Menu.stories.js +5 -16
- package/lib/cjs/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 +47 -86
- package/lib/cjs/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 +26 -64
- package/lib/cjs/components/Messages/Message.styles.js +0 -2
- package/lib/cjs/components/Messages/Messages.js +5 -28
- package/lib/cjs/components/Messages/Messages.reducer.js +0 -18
- package/lib/cjs/components/Messages/Messages.stories.js +20 -79
- package/lib/cjs/components/Messages/Messages.test.js +6 -59
- 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 +30 -81
- package/lib/cjs/components/Modal/Modal.stories.js +2 -12
- package/lib/cjs/components/Modal/Modal.styles.js +0 -17
- 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 +81 -201
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +55 -126
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +27 -218
- 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 +4 -35
- package/lib/cjs/components/NavBar/NavBar.styles.js +0 -24
- 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 +31 -63
- package/lib/cjs/components/NavBarSection/NavBarItemBody.js +9 -33
- package/lib/cjs/components/NavBarSection/NavBarItemBody.test.js +2 -9
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +11 -39
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +10 -35
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +11 -40
- package/lib/cjs/components/NavBarSection/NavBarSection.js +15 -63
- package/lib/cjs/components/NavBarSection/index.js +2 -12
- package/lib/cjs/components/NumberField/NumberField.js +24 -95
- package/lib/cjs/components/NumberField/NumberField.stories.js +4 -48
- package/lib/cjs/components/NumberField/NumberField.styles.js +1 -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 +14 -47
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +41 -84
- package/lib/cjs/components/OverlayPanel/OverlayPanel.styles.js +0 -2
- 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 +38 -117
- package/lib/cjs/components/PasswordField/PasswordField.stories.js +71 -160
- 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 +34 -70
- 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 +27 -72
- package/lib/cjs/components/PopoverMenu/PopoverMenu.stories.js +19 -42
- package/lib/cjs/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 +5 -17
- package/lib/cjs/components/Radio/index.js +0 -4
- package/lib/cjs/components/RadioField/RadioField.js +24 -79
- 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 +18 -65
- 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 +15 -48
- package/lib/cjs/components/RockerButton/RockerButton.styles.js +0 -17
- package/lib/cjs/components/RockerButton/index.js +0 -14
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.js +8 -47
- 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 +23 -60
- package/lib/cjs/components/ScrollBox/ScrollBox.stories.js +1 -12
- package/lib/cjs/components/ScrollBox/ScrollBox.styles.js +0 -2
- package/lib/cjs/components/ScrollBox/ScrollBox.test.js +0 -24
- package/lib/cjs/components/ScrollBox/index.js +0 -4
- package/lib/cjs/components/SearchField/Search.styles.js +0 -2
- package/lib/cjs/components/SearchField/SearchField.js +26 -101
- package/lib/cjs/components/SearchField/SearchField.stories.js +8 -53
- package/lib/cjs/components/SearchField/SearchField.test.js +4 -73
- package/lib/cjs/components/SearchField/index.js +0 -4
- package/lib/cjs/components/SelectField/Select.styles.js +3 -20
- package/lib/cjs/components/SelectField/SelectField.js +4 -60
- package/lib/cjs/components/SelectField/SelectField.stories.js +17 -80
- package/lib/cjs/components/SelectField/SelectField.test.js +11 -41
- package/lib/cjs/components/SelectField/index.js +0 -4
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +23 -81
- 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 +9 -31
- package/lib/cjs/components/Separator/Separator.stories.js +3 -15
- package/lib/cjs/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 +11 -34
- package/lib/cjs/components/Stepper/Stepper.constants.js +0 -2
- package/lib/cjs/components/Stepper/Stepper.js +15 -56
- package/lib/cjs/components/Stepper/Stepper.stories.js +12 -30
- package/lib/cjs/components/Stepper/Stepper.styles.js +2 -17
- 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 +1 -16
- package/lib/cjs/components/Switch/Switch.styles.js +0 -15
- package/lib/cjs/components/Switch/index.js +0 -4
- package/lib/cjs/components/SwitchField/SwitchField.js +37 -98
- package/lib/cjs/components/SwitchField/SwitchField.stories.js +6 -48
- 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 +38 -71
- package/lib/cjs/components/Tab/index.js +0 -14
- package/lib/cjs/components/TabPicker/TabPicker.js +37 -85
- package/lib/cjs/components/TabPicker/index.js +0 -4
- package/lib/cjs/components/Table/Table.js +2 -12
- package/lib/cjs/components/Table/Table.stories.js +4 -22
- package/lib/cjs/components/Table/Table.styles.js +0 -17
- 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 +2 -12
- package/lib/cjs/components/TableBody/index.js +0 -4
- package/lib/cjs/components/TableCaption/TableCaption.js +2 -12
- package/lib/cjs/components/TableCaption/index.js +0 -4
- package/lib/cjs/components/TableCell/TableCell.js +3 -14
- 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 +2 -12
- package/lib/cjs/components/TableRow/index.js +0 -4
- package/lib/cjs/components/Tabs/Tabs.js +17 -77
- package/lib/cjs/components/Tabs/Tabs.stories.js +6 -51
- package/lib/cjs/components/Tabs/Tabs.style.js +0 -17
- 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/components/Text/Text.styles.js +0 -20
- 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/components/TextArea/TextArea.styles.js +1 -16
- 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 +19 -83
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +23 -77
- 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 +13 -73
- package/lib/cjs/components/TextField/TextField.stories.js +40 -112
- 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 +0 -2
- package/lib/cjs/components/TimeZonePicker/TimeZonePicker.js +21 -80
- 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 +4 -25
- package/lib/cjs/components/TooltipTrigger/Tooltip.styles.js +1 -21
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.js +36 -81
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +1 -34
- 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 +115 -159
- package/lib/cjs/hooks/useField/useField.test.js +57 -73
- 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 +2 -7
- 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 +2 -11
- package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.test.js +3 -7
- 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 +69 -107
- 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 +175 -516
- package/lib/cjs/recipes/ApplicationSearchDropdown.stories.js +23 -70
- package/lib/cjs/recipes/Arrow.stories.js +0 -10
- package/lib/cjs/recipes/AttributeMappingReadOnlyField.stories.js +5 -21
- package/lib/cjs/recipes/AttributesAndPingOneMapping.stories.js +16 -51
- package/lib/cjs/recipes/CollapsiblePanel.stories.js +13 -55
- package/lib/cjs/recipes/ConditionalFilter.stories.js +3 -18
- package/lib/cjs/recipes/CopyToClipboard.stories.js +1 -11
- package/lib/cjs/recipes/CountryPicker.stories.js +15 -53
- package/lib/cjs/recipes/DatePicker.stories.js +24 -58
- 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 +17 -63
- package/lib/cjs/recipes/LinkedListView.stories.js +29 -54
- package/lib/cjs/recipes/ListAndPanel.stories.js +42 -74
- package/lib/cjs/recipes/LogoTabs.stories.js +8 -41
- package/lib/cjs/recipes/MaskedValue.stories.js +9 -32
- package/lib/cjs/recipes/NeutralInput.stories.js +0 -9
- package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +2 -19
- 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 +5 -36
- package/lib/cjs/recipes/ScrollableListView.stories.js +9 -36
- package/lib/cjs/recipes/SelectedFieldOverlay.story.js +0 -12
- package/lib/cjs/recipes/Slider.stories.js +20 -60
- 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 +48 -92
- package/lib/cjs/styles/breakpoints.js +0 -2
- package/lib/cjs/styles/colors.js +15 -39
- package/lib/cjs/styles/forms/index.js +0 -31
- 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 +0 -9
- package/lib/cjs/styles/theme.js +3 -27
- package/lib/cjs/styles/themeOverrides/index.js +2 -6
- package/lib/cjs/styles/themeOverrides/stories/AccordionGroup.chromatic.stories.js +0 -10
- package/lib/cjs/styles/themeOverrides/stories/Button.chromatic.stories.js +0 -20
- package/lib/cjs/styles/themeOverrides/stories/EnvironmentBreadcrumb.chromatic.stories.js +7 -38
- package/lib/cjs/styles/themeOverrides/stories/IconButton.chromatic.stories.js +0 -13
- package/lib/cjs/styles/themeOverrides/stories/Label.chromatic.stories.js +0 -10
- package/lib/cjs/styles/themeOverrides/stories/Link.chromatic.stories.js +1 -11
- package/lib/cjs/styles/themeOverrides/stories/NavBar.chromatic.stories.js +0 -22
- package/lib/cjs/styles/themeOverrides/stories/NumberField.chromatic.stories.js +0 -10
- package/lib/cjs/styles/themeOverrides/stories/RockerButtonGroup.chromatic.stories.js +0 -10
- package/lib/cjs/styles/themeOverrides/stories/SearchField.chromatic.stories.js +0 -12
- package/lib/cjs/styles/themeOverrides/stories/SelectField.chromatic.stories.js +0 -11
- package/lib/cjs/styles/themeOverrides/uiLibraryOverride.js +0 -15
- package/lib/cjs/styles/themeOverrides/withUiLibraryCss.js +0 -17
- package/lib/cjs/styles/themes/astro-nano/astro-nano.js +1 -20
- 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 +4 -36
- package/lib/cjs/styles/variants/variants.js +4 -56
- 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 +2 -12
- 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/fieldAttributes.js +0 -15
- 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 +0 -3
- package/lib/components/AccordionGridGroup/AccordionGridGroup.js +15 -37
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +9 -13
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +17 -11
- package/lib/components/AccordionGridItem/AccordionGridItem.js +24 -34
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +21 -32
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +33 -48
- package/lib/components/AccordionGroup/Accordion.styles.js +1 -6
- package/lib/components/AccordionGroup/AccordionGroup.js +16 -28
- package/lib/components/AccordionGroup/AccordionGroup.stories.js +5 -6
- package/lib/components/AccordionGroup/AccordionGroup.test.js +12 -20
- package/lib/components/AccordionItem/AccordionItem.js +38 -48
- package/lib/components/ArrayField/ArrayField.js +29 -60
- package/lib/components/ArrayField/ArrayField.stories.js +7 -17
- 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/Badge/Badge.js +14 -27
- package/lib/components/Badge/Badge.stories.js +15 -26
- package/lib/components/Badge/Badge.styles.js +1 -14
- package/lib/components/Badge/Badge.test.js +3 -7
- package/lib/components/Box/Box.js +15 -32
- package/lib/components/Box/Box.stories.js +7 -11
- package/lib/components/Box/Box.test.js +7 -7
- package/lib/components/Bracket/Bracket.js +4 -6
- package/lib/components/Bracket/Bracket.stories.js +1 -1
- package/lib/components/Bracket/Bracket.test.js +3 -4
- package/lib/components/Breadcrumbs/Breadcrumb.styles.js +0 -3
- package/lib/components/Breadcrumbs/BreadcrumbItem.js +9 -28
- package/lib/components/Breadcrumbs/Breadcrumbs.js +9 -18
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +2 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.test.js +5 -6
- package/lib/components/Breadcrumbs/index.js +2 -2
- package/lib/components/Button/Button.js +36 -57
- package/lib/components/Button/Button.stories.js +6 -5
- package/lib/components/Button/Button.test.js +6 -5
- package/lib/components/Button/Buttons.styles.js +0 -12
- 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.test.js +4 -8
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/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 +22 -51
- package/lib/components/CheckboxField/CheckboxField.stories.js +33 -42
- package/lib/components/CheckboxField/CheckboxField.test.js +23 -23
- package/lib/components/CodeView/CodeView.js +23 -35
- package/lib/components/CodeView/CodeView.stories.js +5 -6
- package/lib/components/CodeView/CodeView.test.js +20 -24
- package/lib/components/CollapsiblePanel/CollapsiblePanel.js +22 -35
- package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +13 -21
- package/lib/components/CollapsiblePanel/CollapsiblePanel.styles.js +1 -8
- package/lib/components/CollapsiblePanel/CollapsiblePanel.test.js +2 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.js +2 -5
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelBadge.test.js +2 -3
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +17 -27
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +2 -3
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.js +3 -8
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.test.js +2 -3
- package/lib/components/ColorField/ColorField.js +40 -61
- package/lib/components/ColorField/ColorField.stories.js +10 -14
- package/lib/components/ColorField/ColorField.styles.js +1 -4
- package/lib/components/ColorField/ColorField.test.js +2 -3
- package/lib/components/ComboBox/ComboBox.styles.js +0 -5
- package/lib/components/ComboBox/ComboBoxInput.js +38 -44
- package/lib/components/ComboBoxField/ComboBoxField.js +61 -117
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +50 -68
- package/lib/components/ComboBoxField/ComboBoxField.test.js +153 -159
- package/lib/components/CopyText/CopyButton.js +1 -1
- package/lib/components/CopyText/CopyText.js +28 -53
- package/lib/components/CopyText/CopyText.stories.js +1 -1
- package/lib/components/CopyText/CopyText.styles.js +0 -3
- package/lib/components/CopyText/CopyText.test.js +333 -372
- package/lib/components/DataTable/DataTable.js +58 -122
- package/lib/components/DataTable/DataTable.stories.js +20 -31
- package/lib/components/DataTable/DataTable.styles.js +0 -7
- package/lib/components/DataTable/DataTable.test.js +82 -172
- package/lib/components/DataTable/DataTableBadge.js +1 -1
- package/lib/components/DataTable/DataTableBadge.test.js +0 -2
- 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 +2 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +61 -102
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.stories.js +46 -84
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +24 -26
- package/lib/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumb.styles.js +0 -3
- package/lib/components/FieldHelperText/FieldHelperText.js +5 -8
- package/lib/components/FieldHelperText/FieldHelperText.stories.js +1 -1
- package/lib/components/FieldHelperText/FieldHelperText.styles.js +0 -5
- package/lib/components/FieldHelperText/FieldHelperText.test.js +6 -12
- package/lib/components/FileInputField/FileInputField.js +41 -77
- package/lib/components/FileInputField/FileInputField.stories.js +11 -18
- package/lib/components/FileInputField/FileInputField.styles.js +0 -3
- package/lib/components/FileInputField/FileInputField.test.js +2 -7
- package/lib/components/FileInputField/FileItem.js +11 -18
- package/lib/components/FileInputField/FileSelect.js +6 -13
- package/lib/components/HelpHint/HelpHint.js +4 -8
- package/lib/components/HelpHint/HelpHint.stories.js +2 -2
- package/lib/components/HelpHint/HelpHint.styles.js +0 -3
- package/lib/components/HelpHint/HelpHint.test.js +3 -4
- package/lib/components/Icon/Icon.js +4 -11
- package/lib/components/Icon/Icon.stories.js +4 -6
- 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 +34 -56
- package/lib/components/IconButton/IconButton.stories.js +8 -7
- package/lib/components/IconButton/IconButton.styles.js +3 -12
- 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 +16 -25
- package/lib/components/ImageUploadField/ImageUploadField.js +10 -30
- package/lib/components/ImageUploadField/ImageUploadField.stories.js +58 -69
- package/lib/components/ImageUploadField/ImageUploadField.test.js +34 -44
- package/lib/components/ImageUploadField/ImageUploadFieldBase.js +16 -27
- package/lib/components/ImageUploadField/imageUpload.js +0 -5
- package/lib/components/Input/Input.js +4 -11
- package/lib/components/Input/Input.styles.js +10 -9
- 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/components/Label/Label.styles.js +8 -7
- package/lib/components/Label/Label.test.js +4 -7
- package/lib/components/Link/Link.js +22 -35
- package/lib/components/Link/Link.stories.js +4 -4
- package/lib/components/Link/Link.styles.js +0 -5
- package/lib/components/Link/Link.test.js +2 -3
- package/lib/components/LinkSelectField/LinkSelectField.js +23 -54
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +17 -24
- package/lib/components/LinkSelectField/LinkSelectField.test.js +24 -21
- package/lib/components/ListBox/ListBox.js +40 -48
- package/lib/components/ListBox/ListBox.styles.js +0 -3
- package/lib/components/ListBox/ListBox.test.js +17 -15
- package/lib/components/ListBox/ListBoxSection.js +13 -18
- package/lib/components/ListBox/Option.js +25 -36
- package/lib/components/ListItem/ListItem.js +12 -16
- package/lib/components/ListItem/ListItem.stories.js +2 -2
- package/lib/components/ListItem/ListItem.test.js +3 -4
- package/lib/components/ListView/ListView.js +23 -45
- package/lib/components/ListView/ListView.stories.js +28 -45
- package/lib/components/ListView/ListView.test.js +34 -47
- package/lib/components/ListViewItem/ListViewItem.js +35 -46
- package/lib/components/ListViewItem/ListViewItem.styles.js +0 -5
- package/lib/components/Loader/Loader.js +2 -4
- package/lib/components/Loader/Loader.stories.js +2 -3
- package/lib/components/Loader/Loader.styles.js +0 -9
- package/lib/components/Loader/Loader.test.js +2 -3
- package/lib/components/Menu/Menu.js +14 -36
- package/lib/components/Menu/Menu.stories.js +3 -3
- package/lib/components/Menu/Menu.test.js +21 -15
- package/lib/components/MenuItem/MenuItem.js +47 -67
- package/lib/components/MenuItem/MenuItem.test.js +8 -13
- package/lib/components/Messages/Message.js +27 -43
- package/lib/components/Messages/Messages.js +5 -8
- 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 +6 -17
- 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 +31 -56
- package/lib/components/Modal/Modal.stories.js +3 -2
- package/lib/components/Modal/Modal.styles.js +0 -5
- 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 +82 -163
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +55 -84
- package/lib/components/MultivaluesField/MultivaluesField.test.js +27 -34
- package/lib/components/NavBar/NavBar.js +14 -27
- package/lib/components/NavBar/NavBar.stories.js +4 -10
- package/lib/components/NavBar/NavBar.styles.js +0 -10
- package/lib/components/NavBar/NavBar.test.js +12 -28
- package/lib/components/NavBarSection/NavBarItem.js +32 -45
- package/lib/components/NavBarSection/NavBarItemBody.js +10 -19
- package/lib/components/NavBarSection/NavBarItemBody.test.js +2 -5
- package/lib/components/NavBarSection/NavBarItemButton.js +12 -22
- package/lib/components/NavBarSection/NavBarItemHeader.js +10 -20
- package/lib/components/NavBarSection/NavBarItemLink.js +12 -23
- package/lib/components/NavBarSection/NavBarSection.js +15 -47
- package/lib/components/NavBarSection/index.js +2 -2
- package/lib/components/NumberField/NumberField.js +24 -63
- package/lib/components/NumberField/NumberField.stories.js +4 -8
- package/lib/components/NumberField/NumberField.styles.js +1 -7
- package/lib/components/NumberField/NumberField.test.js +5 -6
- package/lib/components/OverlayPanel/OverlayPanel.js +16 -29
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +39 -59
- 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 +39 -83
- package/lib/components/PasswordField/PasswordField.stories.js +71 -110
- package/lib/components/PasswordField/PasswordField.test.js +24 -21
- package/lib/components/PopoverContainer/PopoverContainer.js +34 -48
- package/lib/components/PopoverContainer/PopoverContainer.test.js +4 -6
- package/lib/components/PopoverMenu/PopoverMenu.js +28 -48
- 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/components/Radio/Radio.styles.js +6 -6
- package/lib/components/RadioField/RadioField.js +25 -52
- package/lib/components/RadioField/RadioField.test.js +2 -3
- package/lib/components/RadioGroupField/RadioGroupField.js +19 -36
- 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 +16 -25
- package/lib/components/RockerButton/RockerButton.styles.js +0 -5
- package/lib/components/RockerButtonGroup/RockerButtonGroup.js +8 -18
- package/lib/components/RockerButtonGroup/RockerButtonGroup.stories.js +6 -7
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +7 -12
- package/lib/components/ScrollBox/ScrollBox.js +23 -37
- package/lib/components/ScrollBox/ScrollBox.stories.js +1 -1
- package/lib/components/ScrollBox/ScrollBox.test.js +0 -3
- package/lib/components/SearchField/SearchField.js +27 -75
- package/lib/components/SearchField/SearchField.stories.js +12 -18
- package/lib/components/SearchField/SearchField.test.js +4 -5
- package/lib/components/SelectField/Select.styles.js +3 -5
- package/lib/components/SelectField/SelectField.js +6 -37
- package/lib/components/SelectField/SelectField.stories.js +17 -24
- package/lib/components/SelectField/SelectField.test.js +11 -16
- package/lib/components/SelectFieldBase/SelectFieldBase.js +24 -49
- 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/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 +9 -12
- package/lib/components/Stepper/Stepper.js +13 -32
- package/lib/components/Stepper/Stepper.stories.js +13 -12
- package/lib/components/Stepper/Stepper.styles.js +2 -5
- 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/components/Switch/Switch.styles.js +0 -3
- package/lib/components/SwitchField/SwitchField.js +39 -69
- package/lib/components/SwitchField/SwitchField.stories.js +6 -10
- package/lib/components/SwitchField/SwitchField.test.js +2 -3
- package/lib/components/Tab/Tab.js +39 -50
- package/lib/components/TabPicker/TabPicker.js +38 -59
- package/lib/components/Table/Table.js +2 -5
- package/lib/components/Table/Table.stories.js +4 -5
- package/lib/components/Table/Table.styles.js +0 -6
- package/lib/components/Table/Table.test.js +7 -9
- package/lib/components/TableBody/TableBody.js +2 -5
- package/lib/components/TableCaption/TableCaption.js +2 -5
- package/lib/components/TableCell/TableCell.js +3 -6
- package/lib/components/TableCell/TableCell.test.js +4 -5
- package/lib/components/TableHead/TableHead.js +2 -5
- package/lib/components/TableRow/TableRow.js +2 -5
- package/lib/components/Tabs/Tabs.js +17 -46
- package/lib/components/Tabs/Tabs.stories.js +6 -12
- package/lib/components/Tabs/Tabs.style.js +1 -4
- 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/components/Text/Text.styles.js +0 -9
- package/lib/components/Text/Text.test.js +11 -17
- package/lib/components/TextArea/TextArea.js +2 -2
- package/lib/components/TextArea/TextArea.styles.js +2 -4
- package/lib/components/TextArea/TextArea.test.js +3 -4
- package/lib/components/TextAreaField/TextAreaField.js +21 -61
- package/lib/components/TextAreaField/TextAreaField.stories.js +8 -13
- package/lib/components/TextAreaField/TextAreaField.test.js +5 -10
- package/lib/components/TextField/TextField.js +15 -48
- package/lib/components/TextField/TextField.stories.js +18 -26
- package/lib/components/TextField/TextField.test.js +4 -8
- package/lib/components/TimeZonePicker/TimeZonePicker.js +21 -51
- package/lib/components/TimeZonePicker/TimeZonePicker.test.js +3 -7
- package/lib/components/TooltipTrigger/Tooltip.js +4 -7
- package/lib/components/TooltipTrigger/Tooltip.styles.js +1 -8
- package/lib/components/TooltipTrigger/TooltipTrigger.js +37 -61
- package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +1 -1
- 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 +112 -135
- package/lib/hooks/useField/useField.test.js +58 -60
- package/lib/hooks/useImageUploadState/useImageUploadState.js +21 -37
- package/lib/hooks/useLabelHeight/useLabelHeight.js +4 -10
- package/lib/hooks/useModalState/useModalState.js +3 -4
- 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 +3 -8
- package/lib/hooks/useOverlayPanelState/useOverlayPanelState.test.js +3 -4
- 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 +70 -83
- 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 +28 -28
- package/lib/recipes/ApplicationSearchDropdown.stories.js +25 -42
- package/lib/recipes/AttributeMappingReadOnlyField.stories.js +6 -9
- package/lib/recipes/AttributesAndPingOneMapping.stories.js +18 -33
- package/lib/recipes/CollapsiblePanel.stories.js +15 -25
- package/lib/recipes/ConditionalFilter.stories.js +4 -7
- package/lib/recipes/CopyToClipboard.stories.js +1 -1
- package/lib/recipes/CountryPicker.stories.js +15 -32
- package/lib/recipes/DatePicker.stories.js +24 -33
- package/lib/recipes/EditableInput.stories.js +34 -57
- package/lib/recipes/FlippableCaretMenuButton.stories.js +18 -33
- package/lib/recipes/LinkedListView.stories.js +30 -40
- package/lib/recipes/ListAndPanel.stories.js +42 -50
- package/lib/recipes/LogoTabs.stories.js +8 -16
- package/lib/recipes/MaskedValue.stories.js +9 -13
- package/lib/recipes/OneWayToBidirectionalArrow.stories.js +3 -6
- 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 +5 -16
- package/lib/recipes/ScrollableListView.stories.js +10 -16
- package/lib/recipes/Slider.stories.js +20 -37
- 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 +2 -5
- 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.js +3 -6
- package/lib/styles/themeOverrides/index.js +1 -1
- package/lib/styles/themeOverrides/stories/EnvironmentBreadcrumb.chromatic.stories.js +8 -15
- package/lib/styles/themeOverrides/stories/Link.chromatic.stories.js +1 -1
- package/lib/styles/themeOverrides/stories/NavBar.chromatic.stories.js +1 -5
- package/lib/styles/themeOverrides/stories/SearchField.chromatic.stories.js +0 -1
- package/lib/styles/themeOverrides/uiLibraryOverride.js +0 -3
- package/lib/styles/themeOverrides/withUiLibraryCss.js +0 -3
- package/lib/styles/themes/astro-nano/astro-nano.js +1 -4
- 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 +2 -5
- package/lib/styles/variants/variants.js +4 -7
- package/lib/utils/devUtils/constants/htmlElements.js +1 -0
- package/lib/utils/devUtils/constants/variants.js +4 -5
- 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/fieldAttributes.js +0 -3
- 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 +41 -15
- package/lib/cjs/components/PageHeader/index.js +0 -18
- package/lib/components/PageHeader/index.js +0 -1
@@ -6,22 +6,26 @@ 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 _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
14
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
15
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
9
16
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
10
17
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
11
18
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
12
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
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 _context5; _forEachInstanceProperty(_context5 = ["next", "throw", "return"]).call(_context5, 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 _context6; 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(_context6 = this.tryEntries).call(_context6, 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
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
14
21
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
15
|
-
|
16
22
|
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; }
|
17
|
-
|
18
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
19
|
-
|
20
24
|
import React, { useRef, useState } from 'react';
|
21
|
-
import { Image, ImageUploadField, OverlayProvider } from '
|
25
|
+
import { Image, ImageUploadField, OverlayProvider } from '../..';
|
26
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
22
27
|
import { ariaAttributeBaseArgTypes } from '../../utils/devUtils/props/ariaAttributes';
|
23
28
|
import { inputFieldAttributeBaseArgTypes } from '../../utils/devUtils/props/fieldAttributes';
|
24
|
-
import statuses from '../../utils/devUtils/constants/statuses';
|
25
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
26
30
|
export default {
|
27
31
|
title: 'Form/ImageUploadField',
|
@@ -93,13 +97,15 @@ export default {
|
|
93
97
|
}, ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes)
|
94
98
|
};
|
95
99
|
export var Default = function Default(args) {
|
96
|
-
return (
|
100
|
+
return (
|
101
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
97
102
|
// readers when an overlay opens.
|
98
103
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, args))
|
99
104
|
);
|
100
105
|
};
|
101
106
|
export var CustomDefaultImage = function CustomDefaultImage() {
|
102
|
-
return (
|
107
|
+
return (
|
108
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
103
109
|
// readers when an overlay opens.
|
104
110
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, {
|
105
111
|
label: "Upload Image",
|
@@ -110,7 +116,8 @@ export var CustomDefaultImage = function CustomDefaultImage() {
|
|
110
116
|
);
|
111
117
|
};
|
112
118
|
export var CustomItemText = function CustomItemText() {
|
113
|
-
return (
|
119
|
+
return (
|
120
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
114
121
|
// readers when an overlay opens.
|
115
122
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, {
|
116
123
|
label: "Upload Image",
|
@@ -122,7 +129,8 @@ export var CustomItemText = function CustomItemText() {
|
|
122
129
|
);
|
123
130
|
};
|
124
131
|
export var ComponentAsDefaultImage = function ComponentAsDefaultImage() {
|
125
|
-
return (
|
132
|
+
return (
|
133
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
126
134
|
// readers when an overlay opens.
|
127
135
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, {
|
128
136
|
label: "Upload Image with component as default image",
|
@@ -136,65 +144,57 @@ export var ComponentAsDefaultImage = function ComponentAsDefaultImage() {
|
|
136
144
|
};
|
137
145
|
export var ExistingImage = function ExistingImage() {
|
138
146
|
var _useState = useState('https://picsum.photos/id/1025/200/300'),
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
147
|
+
_useState2 = _slicedToArray(_useState, 2),
|
148
|
+
previewImage = _useState2[0],
|
149
|
+
setPreviewImage = _useState2[1];
|
143
150
|
var _useState3 = useState(null),
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
151
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
152
|
+
error = _useState4[0],
|
153
|
+
setError = _useState4[1];
|
148
154
|
var _useState5 = useState(false),
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
155
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
156
|
+
isLoading = _useState6[0],
|
157
|
+
setIsLoading = _useState6[1];
|
153
158
|
|
159
|
+
// When controlling the previewImage yourself, it's important to handle updating the state
|
154
160
|
var handleChange = /*#__PURE__*/function () {
|
155
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(e) {
|
161
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
156
162
|
var _e$target;
|
157
|
-
|
158
163
|
var files, reader;
|
159
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
164
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
160
165
|
while (1) {
|
161
166
|
switch (_context.prev = _context.next) {
|
162
167
|
case 0:
|
163
168
|
// Clear errors
|
164
|
-
setError(undefined);
|
165
|
-
|
166
|
-
setIsLoading(true);
|
169
|
+
setError(undefined);
|
170
|
+
// Turn on loading indicator
|
171
|
+
setIsLoading(true);
|
167
172
|
|
173
|
+
// Handle setting the preview image
|
168
174
|
files = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.files[0];
|
169
175
|
reader = new FileReader();
|
170
|
-
|
171
176
|
reader.onload = function (_ref2) {
|
172
177
|
var result = _ref2.target.result;
|
173
178
|
setPreviewImage(result);
|
174
179
|
};
|
175
|
-
|
176
180
|
_context.prev = 5;
|
177
181
|
_context.next = 8;
|
178
182
|
return new _Promise(function (resolve) {
|
179
183
|
return _setTimeout(resolve, 3000);
|
180
184
|
});
|
181
|
-
|
182
185
|
case 8:
|
183
186
|
// Trigger the preview image callback
|
184
187
|
reader.readAsDataURL(files);
|
185
188
|
_context.next = 15;
|
186
189
|
break;
|
187
|
-
|
188
190
|
case 11:
|
189
191
|
_context.prev = 11;
|
190
192
|
_context.t0 = _context["catch"](5);
|
191
193
|
setPreviewImage(undefined);
|
192
194
|
setError('There was an error...');
|
193
|
-
|
194
195
|
case 15:
|
195
196
|
// Unset loading indicator
|
196
197
|
setIsLoading(false);
|
197
|
-
|
198
198
|
case 16:
|
199
199
|
case "end":
|
200
200
|
return _context.stop();
|
@@ -202,13 +202,12 @@ export var ExistingImage = function ExistingImage() {
|
|
202
202
|
}
|
203
203
|
}, _callee, null, [[5, 11]]);
|
204
204
|
}));
|
205
|
-
|
206
205
|
return function handleChange(_x) {
|
207
206
|
return _ref.apply(this, arguments);
|
208
207
|
};
|
209
208
|
}();
|
210
|
-
|
211
|
-
|
209
|
+
return (
|
210
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
212
211
|
// readers when an overlay opens.
|
213
212
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, {
|
214
213
|
label: "Upload Image",
|
@@ -224,67 +223,59 @@ export var ExistingImage = function ExistingImage() {
|
|
224
223
|
};
|
225
224
|
export var ErrorOnUpload = function ErrorOnUpload() {
|
226
225
|
var _useState7 = useState(true),
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
226
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
227
|
+
shouldError = _useState8[0],
|
228
|
+
setShouldError = _useState8[1];
|
231
229
|
var _useState9 = useState(null),
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
230
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
231
|
+
previewImage = _useState10[0],
|
232
|
+
setPreviewImage = _useState10[1];
|
236
233
|
var _useState11 = useState(null),
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
234
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
235
|
+
error = _useState12[0],
|
236
|
+
setError = _useState12[1];
|
241
237
|
var _useState13 = useState(false),
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
var errorRef = useRef(shouldError); // When controlling the previewImage yourself, it's important to handle updating the state
|
238
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
239
|
+
isLoading = _useState14[0],
|
240
|
+
setIsLoading = _useState14[1];
|
241
|
+
var errorRef = useRef(shouldError);
|
247
242
|
|
243
|
+
// When controlling the previewImage yourself, it's important to handle updating the state
|
248
244
|
var handler = /*#__PURE__*/function () {
|
249
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
|
245
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
250
246
|
var _e$target2;
|
251
|
-
|
252
247
|
var files, reader;
|
253
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
248
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
254
249
|
while (1) {
|
255
250
|
switch (_context2.prev = _context2.next) {
|
256
251
|
case 0:
|
257
252
|
// Clear errors
|
258
|
-
setError(undefined);
|
259
|
-
|
260
|
-
setIsLoading(true);
|
253
|
+
setError(undefined);
|
254
|
+
// Turn on loading indicator
|
255
|
+
setIsLoading(true);
|
261
256
|
|
257
|
+
// Handle setting the preview image
|
262
258
|
files = (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.files[0];
|
263
259
|
reader = new FileReader();
|
264
|
-
|
265
260
|
reader.onload = function (_ref4) {
|
266
261
|
var result = _ref4.target.result;
|
267
262
|
setPreviewImage(result);
|
268
263
|
};
|
269
|
-
|
270
264
|
_context2.prev = 5;
|
271
265
|
_context2.next = 8;
|
272
266
|
return new _Promise(function (resolve, reject) {
|
273
267
|
return _setTimeout(errorRef.current ? reject : resolve, 3000);
|
274
268
|
});
|
275
|
-
|
276
269
|
case 8:
|
277
270
|
// Trigger the preview image callback
|
278
271
|
reader.readAsDataURL(files);
|
279
272
|
_context2.next = 15;
|
280
273
|
break;
|
281
|
-
|
282
274
|
case 11:
|
283
275
|
_context2.prev = 11;
|
284
276
|
_context2.t0 = _context2["catch"](5);
|
285
277
|
setPreviewImage(null);
|
286
278
|
setError('There was an error...');
|
287
|
-
|
288
279
|
case 15:
|
289
280
|
// Unset loading indicator
|
290
281
|
setIsLoading(false);
|
@@ -292,7 +283,6 @@ export var ErrorOnUpload = function ErrorOnUpload() {
|
|
292
283
|
setShouldError(function (current) {
|
293
284
|
return !current;
|
294
285
|
});
|
295
|
-
|
296
286
|
case 18:
|
297
287
|
case "end":
|
298
288
|
return _context2.stop();
|
@@ -300,13 +290,12 @@ export var ErrorOnUpload = function ErrorOnUpload() {
|
|
300
290
|
}
|
301
291
|
}, _callee2, null, [[5, 11]]);
|
302
292
|
}));
|
303
|
-
|
304
293
|
return function handler(_x2) {
|
305
294
|
return _ref3.apply(this, arguments);
|
306
295
|
};
|
307
296
|
}();
|
308
|
-
|
309
|
-
|
297
|
+
return (
|
298
|
+
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
310
299
|
// readers when an overlay opens.
|
311
300
|
___EmotionJSX(OverlayProvider, null, ___EmotionJSX(ImageUploadField, {
|
312
301
|
label: "Upload Image",
|
@@ -1,7 +1,17 @@
|
|
1
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
1
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
2
3
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
3
|
-
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
4
|
+
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 _context7; _forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, 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 _context8; 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(_context8 = this.tryEntries).call(_context8, 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
5
|
import _URL from "@babel/runtime-corejs3/core-js-stable/url";
|
6
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
7
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
8
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
9
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
10
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
11
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
12
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
13
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
14
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
5
15
|
import React from 'react';
|
6
16
|
import { fireEvent } from '@testing-library/react';
|
7
17
|
import userEvent from '@testing-library/user-event';
|
@@ -43,18 +53,15 @@ beforeAll(function () {
|
|
43
53
|
afterAll(function () {
|
44
54
|
_URL.createObjectURL = originalValue;
|
45
55
|
});
|
46
|
-
|
47
56
|
var getComponent = function getComponent() {
|
48
57
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
49
|
-
|
50
58
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
51
|
-
|
52
|
-
|
53
|
-
|
59
|
+
_ref$renderFn = _ref.renderFn,
|
60
|
+
renderFn = _ref$renderFn === void 0 ? render : _ref$renderFn;
|
54
61
|
return renderFn(___EmotionJSX(ImageUploadField, _extends({}, defaultProps, props)));
|
55
|
-
};
|
56
|
-
|
62
|
+
};
|
57
63
|
|
64
|
+
// Need to be added to each test file to test accessibility using axe.
|
58
65
|
axeTest(getComponent);
|
59
66
|
test('should render image upload component by default', function () {
|
60
67
|
getComponent();
|
@@ -72,9 +79,9 @@ test('should render div with icon when focused', function () {
|
|
72
79
|
imageUploadButton.blur();
|
73
80
|
expect(hoveredPreview).not.toBeInTheDocument();
|
74
81
|
});
|
75
|
-
test('should upload a file', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
82
|
+
test('should upload a file', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
76
83
|
var imageUploadButton, imageUploadInput, imagePreview;
|
77
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
84
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
78
85
|
while (1) {
|
79
86
|
switch (_context.prev = _context.next) {
|
80
87
|
case 0:
|
@@ -89,12 +96,10 @@ test('should upload a file', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regen
|
|
89
96
|
});
|
90
97
|
_context.next = 7;
|
91
98
|
return screen.findByTestId(imageUploadImagePreview);
|
92
|
-
|
93
99
|
case 7:
|
94
100
|
imagePreview = _context.sent;
|
95
101
|
expect(imagePreview).toBeInTheDocument();
|
96
102
|
expect(imagePreview).toHaveAttribute('src');
|
97
|
-
|
98
103
|
case 10:
|
99
104
|
case "end":
|
100
105
|
return _context.stop();
|
@@ -102,9 +107,9 @@ test('should upload a file', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regen
|
|
102
107
|
}
|
103
108
|
}, _callee);
|
104
109
|
})));
|
105
|
-
test('should upload a file if label clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
110
|
+
test('should upload a file if label clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
106
111
|
var imageUploadLabel, imageUploadInput, imagePreview;
|
107
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
112
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
108
113
|
while (1) {
|
109
114
|
switch (_context2.prev = _context2.next) {
|
110
115
|
case 0:
|
@@ -119,12 +124,10 @@ test('should upload a file if label clicked', /*#__PURE__*/_asyncToGenerator( /*
|
|
119
124
|
});
|
120
125
|
_context2.next = 7;
|
121
126
|
return screen.findByTestId(imageUploadImagePreview);
|
122
|
-
|
123
127
|
case 7:
|
124
128
|
imagePreview = _context2.sent;
|
125
129
|
expect(imagePreview).toBeInTheDocument();
|
126
130
|
expect(imagePreview).toHaveAttribute('src');
|
127
|
-
|
128
131
|
case 10:
|
129
132
|
case "end":
|
130
133
|
return _context2.stop();
|
@@ -132,9 +135,9 @@ test('should upload a file if label clicked', /*#__PURE__*/_asyncToGenerator( /*
|
|
132
135
|
}
|
133
136
|
}, _callee2);
|
134
137
|
})));
|
135
|
-
test('should show the menu if image preview is clicked when preview image exists', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
138
|
+
test('should show the menu if image preview is clicked when preview image exists', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
136
139
|
var imagePreview;
|
137
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
140
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
138
141
|
while (1) {
|
139
142
|
switch (_context3.prev = _context3.next) {
|
140
143
|
case 0:
|
@@ -146,16 +149,15 @@ test('should show the menu if image preview is clicked when preview image exists
|
|
146
149
|
});
|
147
150
|
_context3.next = 4;
|
148
151
|
return screen.findByTestId(imageUploadImagePreview);
|
149
|
-
|
150
152
|
case 4:
|
151
153
|
imagePreview = _context3.sent;
|
152
154
|
expect(imagePreview).toBeInTheDocument();
|
153
|
-
expect(imagePreview).toHaveAttribute('src');
|
155
|
+
expect(imagePreview).toHaveAttribute('src');
|
154
156
|
|
157
|
+
// Click on the image preview button
|
155
158
|
userEvent.click(screen.getByRole('button'));
|
156
159
|
expect(screen.getByText('Upload New Image')).toBeInTheDocument();
|
157
160
|
expect(screen.getByText('Remove Image')).toBeInTheDocument();
|
158
|
-
|
159
161
|
case 10:
|
160
162
|
case "end":
|
161
163
|
return _context3.stop();
|
@@ -163,9 +165,9 @@ test('should show the menu if image preview is clicked when preview image exists
|
|
163
165
|
}
|
164
166
|
}, _callee3);
|
165
167
|
})));
|
166
|
-
test('should change image if the corresponding menu option clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
168
|
+
test('should change image if the corresponding menu option clicked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
167
169
|
var imagePreview;
|
168
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
170
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
169
171
|
while (1) {
|
170
172
|
switch (_context4.prev = _context4.next) {
|
171
173
|
case 0:
|
@@ -177,16 +179,13 @@ test('should change image if the corresponding menu option clicked', /*#__PURE__
|
|
177
179
|
});
|
178
180
|
_context4.next = 4;
|
179
181
|
return screen.findByTestId(imageUploadImagePreview);
|
180
|
-
|
181
182
|
case 4:
|
182
183
|
imagePreview = _context4.sent;
|
183
184
|
expect(imagePreview).toBeInTheDocument();
|
184
185
|
expect(imagePreview).toHaveAttribute('src');
|
185
|
-
|
186
186
|
_URL.createObjectURL.mockImplementationOnce(function () {
|
187
187
|
return testImageURL2;
|
188
188
|
});
|
189
|
-
|
190
189
|
userEvent.click(screen.getByTestId(testButtonId));
|
191
190
|
userEvent.click(screen.getByText('Upload New Image'));
|
192
191
|
fireEvent.change(screen.getByTestId('image-upload-input'), {
|
@@ -197,12 +196,10 @@ test('should change image if the corresponding menu option clicked', /*#__PURE__
|
|
197
196
|
_context4.t0 = expect;
|
198
197
|
_context4.next = 14;
|
199
198
|
return screen.findByTestId(imageUploadImagePreview);
|
200
|
-
|
201
199
|
case 14:
|
202
200
|
_context4.t1 = _context4.sent;
|
203
201
|
(0, _context4.t0)(_context4.t1).toBeInTheDocument();
|
204
202
|
expect(imagePreview).toHaveAttribute('src');
|
205
|
-
|
206
203
|
case 17:
|
207
204
|
case "end":
|
208
205
|
return _context4.stop();
|
@@ -222,9 +219,9 @@ test('should call onChange cb (when provided) when a file is uploaded', function
|
|
222
219
|
});
|
223
220
|
expect(testOnChange).toHaveBeenCalledTimes(1);
|
224
221
|
});
|
225
|
-
test('should call onRemove cb (when provided) when a file is uploaded', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
222
|
+
test('should call onRemove cb (when provided) when a file is uploaded', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
226
223
|
var testOnRemove, imagePreview;
|
227
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
224
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
228
225
|
while (1) {
|
229
226
|
switch (_context5.prev = _context5.next) {
|
230
227
|
case 0:
|
@@ -239,21 +236,18 @@ test('should call onRemove cb (when provided) when a file is uploaded', /*#__PUR
|
|
239
236
|
});
|
240
237
|
_context5.next = 5;
|
241
238
|
return screen.findByTestId(imageUploadImagePreview);
|
242
|
-
|
243
239
|
case 5:
|
244
240
|
imagePreview = _context5.sent;
|
245
241
|
userEvent.click(screen.getByTestId(testButtonId));
|
246
242
|
_context5.t0 = expect;
|
247
243
|
_context5.next = 10;
|
248
244
|
return screen.findByTestId(imageUploadImagePreview);
|
249
|
-
|
250
245
|
case 10:
|
251
246
|
_context5.t1 = _context5.sent;
|
252
247
|
(0, _context5.t0)(_context5.t1).toBeInTheDocument();
|
253
248
|
userEvent.click(screen.getByText('Remove Image'));
|
254
249
|
expect(imagePreview).not.toBeInTheDocument();
|
255
250
|
expect(testOnRemove).toHaveBeenCalledTimes(1);
|
256
|
-
|
257
251
|
case 15:
|
258
252
|
case "end":
|
259
253
|
return _context5.stop();
|
@@ -298,8 +292,7 @@ test('should render default preview image if defined initially', function () {
|
|
298
292
|
});
|
299
293
|
test('should render new preview image if defined later', function () {
|
300
294
|
var _getComponent = getComponent(),
|
301
|
-
|
302
|
-
|
295
|
+
rerender = _getComponent.rerender;
|
303
296
|
expect(screen.queryByTestId(imageUploadNoImagePreview)).toBeInTheDocument();
|
304
297
|
expect(screen.queryByTestId(imageUploadImagePreview)).not.toBeInTheDocument();
|
305
298
|
getComponent({
|
@@ -312,8 +305,7 @@ test('should render new preview image if defined later', function () {
|
|
312
305
|
});
|
313
306
|
test('should render loader if isLoading prop is true', function () {
|
314
307
|
var _getComponent2 = getComponent(),
|
315
|
-
|
316
|
-
|
308
|
+
rerender = _getComponent2.rerender;
|
317
309
|
expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
|
318
310
|
getComponent({
|
319
311
|
isLoading: true
|
@@ -324,8 +316,7 @@ test('should render loader if isLoading prop is true', function () {
|
|
324
316
|
});
|
325
317
|
test('should render loader if isLoading prop is true', function () {
|
326
318
|
var _getComponent3 = getComponent(),
|
327
|
-
|
328
|
-
|
319
|
+
rerender = _getComponent3.rerender;
|
329
320
|
expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
|
330
321
|
getComponent({
|
331
322
|
isLoading: true
|
@@ -355,9 +346,9 @@ test('loader size can be changed via the prop', function () {
|
|
355
346
|
'font-size': "".concat(testLoaderSize, "px")
|
356
347
|
});
|
357
348
|
});
|
358
|
-
test('should show the menu if label clicked when preview image exists with custom uploads', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
349
|
+
test('should show the menu if label clicked when preview image exists with custom uploads', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
359
350
|
var customUploadProp, customRemoveProp, imagePreview;
|
360
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
351
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
361
352
|
while (1) {
|
362
353
|
switch (_context6.prev = _context6.next) {
|
363
354
|
case 0:
|
@@ -374,16 +365,15 @@ test('should show the menu if label clicked when preview image exists with custo
|
|
374
365
|
});
|
375
366
|
_context6.next = 6;
|
376
367
|
return screen.findByTestId(imageUploadImagePreview);
|
377
|
-
|
378
368
|
case 6:
|
379
369
|
imagePreview = _context6.sent;
|
380
370
|
expect(imagePreview).toBeInTheDocument();
|
381
|
-
expect(imagePreview).toHaveAttribute('src');
|
371
|
+
expect(imagePreview).toHaveAttribute('src');
|
382
372
|
|
373
|
+
// Click on the image preview button
|
383
374
|
userEvent.click(screen.getByRole('button'));
|
384
375
|
expect(screen.getByText(customUploadProp)).toBeInTheDocument();
|
385
376
|
expect(screen.getByText(customRemoveProp)).toBeInTheDocument();
|
386
|
-
|
387
377
|
case 12:
|
388
378
|
case "end":
|
389
379
|
return _context6.stop();
|
@@ -9,46 +9,35 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
11
|
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
12
|
-
|
13
12
|
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
13
|
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; }
|
16
|
-
|
17
14
|
import React, { forwardRef, useMemo, useRef } from 'react';
|
15
|
+
import { useVisuallyHidden } from 'react-aria';
|
18
16
|
import omit from 'lodash/omit';
|
19
17
|
import PropTypes from 'prop-types';
|
20
|
-
import {
|
21
|
-
import { PopoverMenu } from '../../index';
|
18
|
+
import { Box, FieldHelperText, Input, Label, PopoverMenu } from '../..';
|
22
19
|
import useField from '../../hooks/useField';
|
23
|
-
import FieldHelperText from '../FieldHelperText';
|
24
|
-
import Input from '../Input';
|
25
|
-
import Box from '../Box';
|
26
|
-
import Label from '../Label';
|
27
20
|
import statuses from '../../utils/devUtils/constants/statuses';
|
28
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
29
22
|
var ImageUploadFieldBase = /*#__PURE__*/forwardRef(function (props, inputRef) {
|
30
23
|
var children = props.children,
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
24
|
+
fileName = props.fileName,
|
25
|
+
fileTypes = props.fileTypes,
|
26
|
+
handleInputChange = props.handleInputChange,
|
27
|
+
handleLabelClick = props.handleLabelClick,
|
28
|
+
handleOpenMenuChange = props.handleOpenMenuChange,
|
29
|
+
helperText = props.helperText,
|
30
|
+
isImageType = props.isImageType,
|
31
|
+
isMenuOpen = props.isMenuOpen,
|
32
|
+
status = props.status;
|
41
33
|
var _useField = useField(_objectSpread({}, omit(props, ['onRemove']))),
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
fieldContainerProps = _useField.fieldContainerProps,
|
35
|
+
fieldControlInputProps = _useField.fieldControlInputProps,
|
36
|
+
fieldControlWrapperProps = _useField.fieldControlWrapperProps,
|
37
|
+
fieldLabelProps = _useField.fieldLabelProps;
|
47
38
|
var labelRef = useRef();
|
48
|
-
|
49
39
|
var _useVisuallyHidden = useVisuallyHidden(),
|
50
|
-
|
51
|
-
|
40
|
+
visuallyHiddenProps = _useVisuallyHidden.visuallyHiddenProps;
|
52
41
|
var acceptableInputTypes = useMemo(function () {
|
53
42
|
return "".concat(fileTypes === null || fileTypes === void 0 ? void 0 : fileTypes.join('/*, '), "/*");
|
54
43
|
}, [fileTypes]);
|