@pingux/astro 2.221.6 → 2.234.0-alpha.0
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/lib/cjs/components/AccordionGridGroup/AccordionGrid.styles.d.ts +50 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.d.ts +14 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +6 -56
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +2 -1
- package/lib/cjs/components/AccordionGridGroup/index.d.ts +1 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.d.ts +3 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.js +12 -20
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.d.ts +4 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +9 -15
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.d.ts +4 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +10 -23
- package/lib/cjs/components/AccordionGridItem/index.d.ts +1 -0
- package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +12 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +43 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.d.ts +3 -0
- package/lib/cjs/components/AccordionItem/AccordionItem.js +4 -2
- package/lib/cjs/components/ArrayField/ArrayField.js +30 -13
- package/lib/cjs/components/ArrayField/ArrayField.mdx +5 -1
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +127 -90
- package/lib/cjs/components/ArrayField/ArrayField.styles.d.ts +9 -0
- package/lib/cjs/components/ArrayField/ArrayField.styles.js +41 -0
- package/lib/cjs/components/ArrayField/ArrayField.test.js +202 -30
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.js +21 -8
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.styles.d.ts +5 -0
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.styles.js +21 -0
- package/lib/cjs/components/ArrayField/arrayFieldAttributes.d.ts +1 -99
- package/lib/cjs/components/ArrayField/arrayFieldAttributes.js +3 -2
- package/lib/cjs/components/AstroProvider/AstroProvider.d.ts +16 -0
- package/lib/cjs/components/AstroProvider/AstroProvider.js +10 -34
- package/lib/cjs/components/AstroProvider/PageWrapper.test.js +49 -4
- package/lib/cjs/components/AstroProvider/index.d.ts +2 -0
- package/lib/cjs/components/Badge/Badge.js +20 -11
- package/lib/cjs/components/Badge/Badge.mdx +6 -0
- package/lib/cjs/components/Badge/Badge.stories.js +64 -19
- package/lib/cjs/components/Badge/Badge.styles.d.ts +266 -0
- package/lib/cjs/components/Badge/Badge.styles.js +24 -4
- package/lib/cjs/components/Badge/Badge.test.js +165 -1
- package/lib/cjs/components/Badge/BadgeHelpHint.d.ts +8 -0
- package/lib/cjs/components/Badge/BadgeHelpHint.js +84 -0
- package/lib/cjs/components/Badge/Convenience/DefaultBadge.js +5 -2
- package/lib/cjs/components/Badge/Convenience/ErrorCalloutBadge.js +5 -4
- package/lib/cjs/components/Badge/Convenience/InfoCalloutBadge.js +5 -4
- package/lib/cjs/components/Badge/Convenience/SuccessCalloutBadge.js +5 -4
- package/lib/cjs/components/Badge/Convenience/WarningCalloutBadge.js +5 -4
- package/lib/cjs/components/Checkbox/Checkbox.d.ts +9 -0
- package/lib/cjs/components/Checkbox/Checkbox.styles.d.ts +15 -0
- package/lib/cjs/components/Checkbox/CheckboxBase.d.ts +4 -0
- package/lib/cjs/components/Checkbox/CheckboxBase.js +100 -49
- package/lib/cjs/components/Checkbox/CheckboxIcons.d.ts +15 -0
- package/lib/cjs/components/Checkbox/CheckboxIcons.js +122 -0
- package/lib/cjs/components/Checkbox/index.d.ts +1 -0
- package/lib/cjs/components/CheckboxField/CheckboxField.js +5 -1
- package/lib/cjs/components/CheckboxField/CheckboxField.stories.js +1 -1
- package/lib/cjs/components/CheckboxField/CheckboxField.test.js +41 -5
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.d.ts +4 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.js +89 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.mdx +69 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.stories.js +118 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.styles.d.ts +8 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.styles.js +40 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroup.test.js +485 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroupItem.d.ts +4 -0
- package/lib/cjs/components/CheckboxFieldGroup/CheckboxFieldGroupItem.js +112 -0
- package/lib/cjs/components/CheckboxFieldGroup/checkboxFieldGroupAttributes.d.ts +2 -0
- package/lib/cjs/components/CheckboxFieldGroup/checkboxFieldGroupAttributes.js +108 -0
- package/lib/cjs/components/CheckboxFieldGroup/index.d.ts +3 -0
- package/lib/cjs/components/CheckboxFieldGroup/index.js +27 -0
- package/lib/cjs/components/CodeView/CodeView.js +3 -2
- package/lib/cjs/components/CodeView/CodeView.stories.js +44 -1
- package/lib/cjs/components/CodeView/CodeView.test.js +84 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +18 -1
- package/lib/cjs/components/CopyText/CopyButton.js +1 -2
- package/lib/cjs/components/DatePicker/DatePicker.test.js +1 -1
- package/lib/cjs/components/EmptyState/EmptyState.d.ts +4 -0
- package/lib/cjs/components/EmptyState/EmptyState.js +66 -0
- package/lib/cjs/components/EmptyState/EmptyState.mdx +44 -0
- package/lib/cjs/components/EmptyState/EmptyState.stories.js +88 -0
- package/lib/cjs/components/EmptyState/EmptyState.styles.d.ts +13 -0
- package/lib/cjs/components/EmptyState/EmptyState.styles.js +22 -0
- package/lib/cjs/components/EmptyState/EmptyState.test.js +223 -0
- package/lib/cjs/components/EmptyState/emptyStateAttributes.d.ts +99 -0
- package/lib/cjs/components/EmptyState/emptyStateAttributes.js +49 -0
- package/lib/cjs/components/EmptyState/index.d.ts +1 -0
- package/lib/cjs/components/EmptyState/index.js +14 -0
- package/lib/cjs/components/HelpHint/HelpHint.js +38 -83
- package/lib/cjs/components/IconBadge/IconBadge.d.ts +2 -0
- package/lib/cjs/components/IconBadge/IconBadge.js +39 -20
- package/lib/cjs/components/IconBadge/IconBadge.mdx +5 -1
- package/lib/cjs/components/IconBadge/IconBadge.stories.js +50 -7
- package/lib/cjs/components/IconBadge/IconBadge.styles.d.ts +19 -0
- package/lib/cjs/components/IconBadge/IconBadge.styles.js +27 -0
- package/lib/cjs/components/IconBadge/IconBadge.test.js +67 -14
- package/lib/cjs/components/IconButton/IconButton.styles.d.ts +3 -0
- package/lib/cjs/components/IconButton/IconButton.styles.js +4 -0
- package/lib/cjs/components/LabelValuePairs/LabelValuePairs.stories.js +1 -0
- package/lib/cjs/components/LabelValuePairs/LabelValuePairs.test.js +18 -1
- package/lib/cjs/components/LabelValuePairs/LabelValuePairsLabel.js +1 -2
- package/lib/cjs/components/ListView/ListView.js +28 -4
- package/lib/cjs/components/ListView/ListView.stories.js +110 -62
- package/lib/cjs/components/ListView/ListView.test.js +80 -0
- package/lib/cjs/components/ListView/ListViewTypes.d.ts +5 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +28 -7
- package/lib/cjs/components/ListViewItem/ListViewItem.stories.js +2 -5
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +7 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.test.js +36 -5
- package/lib/cjs/components/ListViewItem/listViewItemAttributes.js +9 -1
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +8 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +23 -1
- package/lib/cjs/components/NavBar/NavBar.styles.d.ts +11 -1
- package/lib/cjs/components/PageHeader/PageHeader.js +9 -4
- package/lib/cjs/components/PageHeader/PageHeader.mdx +3 -0
- package/lib/cjs/components/PageHeader/PageHeader.stories.js +14 -4
- package/lib/cjs/components/PageHeader/PageHeader.test.js +57 -3
- package/lib/cjs/components/PanelHeader/PanelHeader.js +36 -8
- package/lib/cjs/components/PanelHeader/PanelHeader.stories.js +2 -5
- package/lib/cjs/components/PanelHeader/PanelHeader.test.js +46 -4
- package/lib/cjs/components/RangeCalendar/RangeCalendar.js +1 -1
- package/lib/cjs/components/RangeCalendar/RangeCalendar.mdx +4 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendar.test.js +30 -0
- package/lib/cjs/components/RangeCalendar/RangeCalendarGrid.js +1 -0
- package/lib/cjs/components/SelectField/SelectField.stories.js +14 -1
- package/lib/cjs/components/Tab/Tab.js +38 -6
- package/lib/cjs/components/Tab/getSlotText.d.ts +6 -0
- package/lib/cjs/components/Tab/getSlotText.js +21 -0
- package/lib/cjs/components/Tab/getSlotText.test.js +23 -0
- package/lib/cjs/components/TabPicker/TabPicker.js +9 -4
- package/lib/cjs/components/Tabs/Tabs.stories.js +63 -14
- package/lib/cjs/components/Tabs/Tabs.storyData.d.ts +1 -0
- package/lib/cjs/components/Tabs/Tabs.storyData.js +8 -0
- package/lib/cjs/components/Tabs/Tabs.style.d.ts +5 -0
- package/lib/cjs/components/Tabs/Tabs.style.js +7 -2
- package/lib/cjs/components/Tabs/Tabs.test.js +85 -37
- package/lib/cjs/context/CheckboxFieldGroupContext/index.d.ts +10 -0
- package/lib/cjs/context/CheckboxFieldGroupContext/index.js +17 -0
- package/lib/cjs/hooks/index.d.ts +1 -0
- package/lib/cjs/hooks/index.js +7 -0
- package/lib/cjs/hooks/useField/useField.d.ts +78 -78
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +14 -0
- package/lib/cjs/hooks/useHelpHintPopover/index.d.ts +2 -0
- package/lib/cjs/hooks/useHelpHintPopover/index.js +32 -0
- package/lib/cjs/hooks/useHelpHintPopover/useHelpHintPopover.d.ts +25 -0
- package/lib/cjs/hooks/useHelpHintPopover/useHelpHintPopover.js +137 -0
- package/lib/cjs/hooks/usePagination/usePagination.d.ts +94 -94
- package/lib/cjs/index.d.ts +4 -0
- package/lib/cjs/index.js +114 -69
- package/lib/cjs/styles/forms/index.js +23 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +17 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +18 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +7 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.d.ts +90 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.js +76 -29
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/box.d.ts +14 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/box.js +22 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +20 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +20 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/comboBox.d.ts +3 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/comboBox.js +4 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.d.ts +45 -8
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.js +34 -10
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/listview.d.ts +29 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/listview.js +30 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.d.ts +5 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/text.js +5 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +52 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +12 -1
- package/lib/cjs/styles/themeOverrides/onyxSideNav.d.ts +6 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +6 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.js +3 -1
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +7 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.js +3 -0
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.d.ts +9 -0
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.js +5 -2
- package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +17 -0
- package/lib/cjs/styles/themes/next-gen/colors/twoTone.d.ts +18 -0
- package/lib/cjs/styles/themes/next-gen/colors/twoTone.js +21 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +5 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +5 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +7 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/index.js +3 -1
- package/lib/cjs/styles/themes/next-gen/forms.d.ts +83 -4
- package/lib/cjs/styles/themes/next-gen/forms.js +51 -8
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +472 -72
- package/lib/cjs/styles/themes/next-gen/spacing.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/spacing.js +2 -1
- package/lib/cjs/styles/themes/next-gen/variants/arrayField.d.ts +9 -0
- package/lib/cjs/styles/themes/next-gen/variants/arrayField.js +71 -0
- package/lib/cjs/styles/themes/next-gen/variants/arrayFieldDeleteButton.d.ts +5 -0
- package/lib/cjs/styles/themes/next-gen/variants/arrayFieldDeleteButton.js +44 -0
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +243 -33
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +77 -28
- package/lib/cjs/styles/themes/next-gen/variants/box.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/variants/box.js +7 -4
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +41 -29
- package/lib/cjs/styles/themes/next-gen/variants/button.js +25 -2
- package/lib/cjs/styles/themes/next-gen/variants/images.d.ts +6 -1
- package/lib/cjs/styles/themes/next-gen/variants/images.js +8 -1
- package/lib/cjs/styles/themes/next-gen/variants/label.js +33 -1
- package/lib/cjs/styles/themes/next-gen/variants/listview.d.ts +33 -0
- package/lib/cjs/styles/themes/next-gen/variants/listview.js +36 -1
- package/lib/cjs/styles/themes/next-gen/variants/rangeCalendar.d.ts +10 -0
- package/lib/cjs/styles/themes/next-gen/variants/rangeCalendar.js +15 -4
- package/lib/cjs/styles/themes/next-gen/variants/tabs.d.ts +9 -0
- package/lib/cjs/styles/themes/next-gen/variants/tabs.js +12 -3
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +5 -1
- package/lib/cjs/styles/themes/next-gen/variants/text.js +6 -2
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +103 -6
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +30 -4
- package/lib/cjs/styles/variants/variants.js +8 -0
- package/lib/cjs/types/AccordionGridGroup.d.ts +36 -0
- package/lib/cjs/types/AccordionGridGroup.js +6 -0
- package/lib/cjs/types/AccordionGridItem.d.ts +52 -0
- package/lib/cjs/types/AccordionGridItem.js +6 -0
- package/lib/cjs/types/AstroProvider.d.ts +32 -0
- package/lib/cjs/types/AstroProvider.js +6 -0
- package/lib/cjs/types/Checkbox.d.ts +44 -0
- package/lib/cjs/types/Checkbox.js +6 -0
- package/lib/cjs/types/badge.d.ts +6 -0
- package/lib/cjs/types/checkboxFieldGroup.d.ts +48 -0
- package/lib/cjs/types/checkboxFieldGroup.js +6 -0
- package/lib/cjs/types/codeView.d.ts +3 -0
- package/lib/cjs/types/emptyState.d.ts +27 -0
- package/lib/cjs/types/emptyState.js +6 -0
- package/lib/cjs/types/iconBadge.d.ts +6 -0
- package/lib/cjs/types/index.d.ts +7 -0
- package/lib/cjs/types/index.js +147 -70
- package/lib/cjs/types/item.d.ts +5 -0
- package/lib/cjs/types/listView.d.ts +3 -0
- package/lib/cjs/types/table.d.ts +2 -0
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +3 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +4 -1
- package/lib/components/AccordionGridGroup/AccordionGridGroup.js +6 -56
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +2 -1
- package/lib/components/AccordionGridItem/AccordionGridItem.js +12 -20
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +9 -15
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +10 -23
- package/lib/components/AccordionGroup/AccordionGroup.stories.js +11 -0
- package/lib/components/AccordionGroup/AccordionGroup.test.js +43 -1
- package/lib/components/AccordionItem/AccordionItem.js +5 -3
- package/lib/components/ArrayField/ArrayField.js +30 -13
- package/lib/components/ArrayField/ArrayField.mdx +5 -1
- package/lib/components/ArrayField/ArrayField.stories.js +126 -89
- package/lib/components/ArrayField/ArrayField.styles.js +34 -0
- package/lib/components/ArrayField/ArrayField.test.js +202 -30
- package/lib/components/ArrayField/ArrayFieldDeleteButton.js +21 -8
- package/lib/components/ArrayField/ArrayFieldDeleteButton.styles.js +14 -0
- package/lib/components/ArrayField/arrayFieldAttributes.js +3 -2
- package/lib/components/AstroProvider/AstroProvider.js +10 -34
- package/lib/components/AstroProvider/PageWrapper.test.js +46 -0
- package/lib/components/Badge/Badge.js +20 -11
- package/lib/components/Badge/Badge.mdx +6 -0
- package/lib/components/Badge/Badge.stories.js +64 -19
- package/lib/components/Badge/Badge.styles.js +25 -5
- package/lib/components/Badge/Badge.test.js +166 -2
- package/lib/components/Badge/BadgeHelpHint.js +74 -0
- package/lib/components/Badge/Convenience/DefaultBadge.js +5 -2
- package/lib/components/Badge/Convenience/ErrorCalloutBadge.js +5 -4
- package/lib/components/Badge/Convenience/InfoCalloutBadge.js +5 -4
- package/lib/components/Badge/Convenience/SuccessCalloutBadge.js +5 -4
- package/lib/components/Badge/Convenience/WarningCalloutBadge.js +5 -4
- package/lib/components/Checkbox/CheckboxBase.js +99 -48
- package/lib/components/Checkbox/CheckboxIcons.js +114 -0
- package/lib/components/CheckboxField/CheckboxField.js +6 -2
- package/lib/components/CheckboxField/CheckboxField.stories.js +1 -1
- package/lib/components/CheckboxField/CheckboxField.test.js +41 -5
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroup.js +79 -0
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroup.mdx +69 -0
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroup.stories.js +111 -0
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroup.styles.js +33 -0
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroup.test.js +481 -0
- package/lib/components/CheckboxFieldGroup/CheckboxFieldGroupItem.js +101 -0
- package/lib/components/CheckboxFieldGroup/checkboxFieldGroupAttributes.js +101 -0
- package/lib/components/CheckboxFieldGroup/index.js +3 -0
- package/lib/components/CodeView/CodeView.js +3 -2
- package/lib/components/CodeView/CodeView.stories.js +44 -1
- package/lib/components/CodeView/CodeView.test.js +85 -1
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +18 -1
- package/lib/components/CopyText/CopyButton.js +1 -2
- package/lib/components/DatePicker/DatePicker.test.js +1 -1
- package/lib/components/EmptyState/EmptyState.js +54 -0
- package/lib/components/EmptyState/EmptyState.mdx +44 -0
- package/lib/components/EmptyState/EmptyState.stories.js +81 -0
- package/lib/components/EmptyState/EmptyState.styles.js +15 -0
- package/lib/components/EmptyState/EmptyState.test.js +220 -0
- package/lib/components/EmptyState/emptyStateAttributes.js +42 -0
- package/lib/components/EmptyState/index.js +1 -0
- package/lib/components/HelpHint/HelpHint.js +41 -86
- package/lib/components/IconBadge/IconBadge.js +43 -24
- package/lib/components/IconBadge/IconBadge.mdx +5 -1
- package/lib/components/IconBadge/IconBadge.stories.js +50 -7
- package/lib/components/IconBadge/IconBadge.styles.js +20 -0
- package/lib/components/IconBadge/IconBadge.test.js +54 -1
- package/lib/components/IconButton/IconButton.styles.js +4 -0
- package/lib/components/LabelValuePairs/LabelValuePairs.stories.js +1 -0
- package/lib/components/LabelValuePairs/LabelValuePairs.test.js +19 -2
- package/lib/components/LabelValuePairs/LabelValuePairsLabel.js +1 -2
- package/lib/components/ListView/ListView.js +28 -4
- package/lib/components/ListView/ListView.stories.js +106 -58
- package/lib/components/ListView/ListView.test.js +80 -0
- package/lib/components/ListViewItem/ListViewItem.js +28 -5
- package/lib/components/ListViewItem/ListViewItem.stories.js +3 -6
- package/lib/components/ListViewItem/ListViewItem.styles.js +7 -0
- package/lib/components/ListViewItem/ListViewItem.test.js +33 -2
- package/lib/components/ListViewItem/listViewItemAttributes.js +9 -1
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +8 -0
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +23 -1
- package/lib/components/PageHeader/PageHeader.js +9 -4
- package/lib/components/PageHeader/PageHeader.mdx +3 -0
- package/lib/components/PageHeader/PageHeader.stories.js +15 -5
- package/lib/components/PageHeader/PageHeader.test.js +58 -4
- package/lib/components/PanelHeader/PanelHeader.js +37 -9
- package/lib/components/PanelHeader/PanelHeader.stories.js +3 -6
- package/lib/components/PanelHeader/PanelHeader.test.js +47 -5
- package/lib/components/RangeCalendar/RangeCalendar.js +1 -1
- package/lib/components/RangeCalendar/RangeCalendar.mdx +4 -0
- package/lib/components/RangeCalendar/RangeCalendar.test.js +30 -0
- package/lib/components/RangeCalendar/RangeCalendarGrid.js +1 -0
- package/lib/components/SelectField/SelectField.stories.js +13 -0
- package/lib/components/Tab/Tab.js +39 -3
- package/lib/components/Tab/getSlotText.js +15 -0
- package/lib/components/Tab/getSlotText.test.js +21 -0
- package/lib/components/TabPicker/TabPicker.js +10 -5
- package/lib/components/Tabs/Tabs.stories.js +62 -11
- package/lib/components/Tabs/Tabs.storyData.js +1 -0
- package/lib/components/Tabs/Tabs.style.js +6 -1
- package/lib/components/Tabs/Tabs.test.js +85 -37
- package/lib/context/CheckboxFieldGroupContext/index.js +10 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useHelpHintPopover/index.js +2 -0
- package/lib/hooks/useHelpHintPopover/useHelpHintPopover.js +130 -0
- package/lib/index.js +4 -0
- package/lib/styles/forms/index.js +22 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +18 -1
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/badges.js +76 -29
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/box.js +15 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +20 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/comboBox.js +4 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/forms.js +33 -9
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/listview.js +30 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/text.js +5 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +12 -1
- package/lib/styles/themes/astro/customProperties/icons.js +3 -1
- package/lib/styles/themes/astro/customProperties/index.js +3 -0
- package/lib/styles/themes/next-gen/codeView/codeView.js +5 -2
- package/lib/styles/themes/next-gen/colors/twoTone.js +19 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +5 -3
- package/lib/styles/themes/next-gen/customProperties/icons.js +5 -1
- package/lib/styles/themes/next-gen/customProperties/index.js +3 -1
- package/lib/styles/themes/next-gen/forms.js +50 -7
- package/lib/styles/themes/next-gen/spacing.js +2 -1
- package/lib/styles/themes/next-gen/variants/arrayField.js +64 -0
- package/lib/styles/themes/next-gen/variants/arrayFieldDeleteButton.js +37 -0
- package/lib/styles/themes/next-gen/variants/badges.js +77 -28
- package/lib/styles/themes/next-gen/variants/box.js +7 -4
- package/lib/styles/themes/next-gen/variants/button.js +25 -2
- package/lib/styles/themes/next-gen/variants/images.js +7 -1
- package/lib/styles/themes/next-gen/variants/label.js +33 -1
- package/lib/styles/themes/next-gen/variants/listview.js +35 -1
- package/lib/styles/themes/next-gen/variants/rangeCalendar.js +15 -4
- package/lib/styles/themes/next-gen/variants/tabs.js +11 -2
- package/lib/styles/themes/next-gen/variants/text.js +6 -2
- package/lib/styles/themes/next-gen/variants/variants.js +31 -5
- package/lib/styles/variants/variants.js +8 -0
- package/lib/types/AccordionGridGroup.js +1 -0
- package/lib/types/AccordionGridItem.js +1 -0
- package/lib/types/AstroProvider.js +1 -0
- package/lib/types/Checkbox.js +1 -0
- package/lib/types/checkboxFieldGroup.js +1 -0
- package/lib/types/emptyState.js +1 -0
- package/lib/types/index.js +7 -0
- package/lib/utils/designUtils/figmaLinks.js +4 -1
- package/package.json +2 -2
|
@@ -20,6 +20,7 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
|
20
20
|
import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
|
|
21
21
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
22
22
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
23
|
+
var _context;
|
|
23
24
|
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (_Object$getPrototypeOf ? _Object$getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && _reverseInstanceProperty(o).call(o)); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
24
25
|
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof _Symbol && _Symbol$iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
25
26
|
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
@@ -29,6 +30,7 @@ function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c
|
|
|
29
30
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof _Symbol ? _Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = _Object$create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: _bindInstanceProperty(d).call(d, e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = _Object$getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(c); function f(e) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = _Object$create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
30
31
|
function _regeneratorDefine2(e, r, n, t) { var i = _Object$defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
31
32
|
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
33
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
32
34
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
33
35
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
34
36
|
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
|
|
@@ -37,9 +39,8 @@ import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
|
|
37
39
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
38
40
|
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
39
41
|
import _fillInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/fill";
|
|
40
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
41
42
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
43
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context13, _context14; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context13 = ownKeys(Object(t), !0)).call(_context13, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context14 = ownKeys(Object(t))).call(_context14, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
43
44
|
import React, { useRef, useState } from 'react';
|
|
44
45
|
import { useAsyncList } from 'react-stately';
|
|
45
46
|
import ClockTimeEightOutlineIcon from '@pingux/mdi-react/ClockTimeEightOutlineIcon';
|
|
@@ -49,9 +50,10 @@ import isChromatic from 'chromatic/isChromatic';
|
|
|
49
50
|
import { action } from 'storybook/actions';
|
|
50
51
|
import { fn } from 'storybook/test';
|
|
51
52
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
52
|
-
import { Box, Button, IconWrapper, Item, ListView, ListViewItem, ListViewItemChart, ListViewItemMenu, ListViewItemSwitchField, SearchField, Text } from '../..';
|
|
53
|
+
import { Box, Button, EmptyState, IconWrapper, Item, ListView, ListViewItem, ListViewItemChart, ListViewItemMenu, ListViewItemSwitchField, SearchField, Text } from '../..';
|
|
53
54
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
54
55
|
import animals from '../../utils/devUtils/constants/animals';
|
|
56
|
+
import { userImage } from '../../utils/devUtils/constants/images';
|
|
55
57
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
|
56
58
|
import { chartData } from '../ListViewItem/controls/chart/chartData';
|
|
57
59
|
import ListViewReadme from './ListView.mdx';
|
|
@@ -80,7 +82,7 @@ export default {
|
|
|
80
82
|
var items = [{
|
|
81
83
|
key: 'Aardvark',
|
|
82
84
|
name: 'Aardvark',
|
|
83
|
-
id: '
|
|
85
|
+
id: '11111111111',
|
|
84
86
|
icon: CogIcon,
|
|
85
87
|
iconWrapperProps: {
|
|
86
88
|
size: 'sm',
|
|
@@ -89,7 +91,7 @@ var items = [{
|
|
|
89
91
|
}, {
|
|
90
92
|
key: 'Kangaroo',
|
|
91
93
|
name: 'Kangaroo',
|
|
92
|
-
id: '
|
|
94
|
+
id: '1111111',
|
|
93
95
|
icon: ClockTimeEightOutlineIcon,
|
|
94
96
|
iconWrapperProps: {
|
|
95
97
|
size: 'sm',
|
|
@@ -105,6 +107,16 @@ var items = [{
|
|
|
105
107
|
color: 'indigo'
|
|
106
108
|
}
|
|
107
109
|
}];
|
|
110
|
+
var defaultStoryItems = _concatInstanceProperty(_context = []).call(_context, items, [{
|
|
111
|
+
key: 'Panda',
|
|
112
|
+
name: 'Panda',
|
|
113
|
+
id: '4',
|
|
114
|
+
image: {
|
|
115
|
+
src: userImage,
|
|
116
|
+
alt: 'avatar',
|
|
117
|
+
'aria-label': 'avatar'
|
|
118
|
+
}
|
|
119
|
+
}]);
|
|
108
120
|
var props = {
|
|
109
121
|
disabledKeys: ['Snake']
|
|
110
122
|
};
|
|
@@ -135,7 +147,7 @@ var ExampleContent = function ExampleContent(contentProps) {
|
|
|
135
147
|
alignItems: 'center'
|
|
136
148
|
},
|
|
137
149
|
gap: "lg"
|
|
138
|
-
}, ___EmotionJSX(IconWrapper, {
|
|
150
|
+
}, icon && ___EmotionJSX(IconWrapper, {
|
|
139
151
|
icon: icon,
|
|
140
152
|
size: "sm",
|
|
141
153
|
title: {
|
|
@@ -166,19 +178,17 @@ var Controls = function Controls() {
|
|
|
166
178
|
export var Default = function Default(_ref) {
|
|
167
179
|
var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
168
180
|
return ___EmotionJSX(ListView, _extends({}, props, args, {
|
|
169
|
-
items:
|
|
181
|
+
items: defaultStoryItems
|
|
170
182
|
}), function (item) {
|
|
171
183
|
return ___EmotionJSX(Item, {
|
|
172
184
|
key: item.name
|
|
173
185
|
}, ___EmotionJSX(ListViewItem, {
|
|
174
186
|
data: {
|
|
175
187
|
text: item.name,
|
|
176
|
-
icon: item.icon
|
|
177
|
-
|
|
178
|
-
iconProps: {
|
|
179
|
-
color: 'text.secondary'
|
|
188
|
+
icon: item.icon,
|
|
189
|
+
image: item.image
|
|
180
190
|
},
|
|
181
|
-
|
|
191
|
+
colorId: item.id
|
|
182
192
|
}, ___EmotionJSX(Controls, null)));
|
|
183
193
|
});
|
|
184
194
|
};
|
|
@@ -247,8 +257,8 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
247
257
|
var getMockData = /*#__PURE__*/function () {
|
|
248
258
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(signal, cursor) {
|
|
249
259
|
var pageNumber;
|
|
250
|
-
return _regeneratorRuntime().wrap(function _callee$(
|
|
251
|
-
while (1) switch (
|
|
260
|
+
return _regeneratorRuntime().wrap(function _callee$(_context2) {
|
|
261
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
252
262
|
case 0:
|
|
253
263
|
pageNumber = 1;
|
|
254
264
|
if (cursor) {
|
|
@@ -256,21 +266,21 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
256
266
|
}
|
|
257
267
|
// With this we will emulate load even with mocked API, except for Chromatic runs
|
|
258
268
|
if (args.useMockData) {
|
|
259
|
-
|
|
269
|
+
_context2.next = 5;
|
|
260
270
|
break;
|
|
261
271
|
}
|
|
262
|
-
|
|
272
|
+
_context2.next = 5;
|
|
263
273
|
return new _Promise(function (resolve) {
|
|
264
274
|
return _setTimeout(resolve, cursor ? 2000 : 3000);
|
|
265
275
|
});
|
|
266
276
|
case 5:
|
|
267
|
-
return
|
|
277
|
+
return _context2.abrupt("return", {
|
|
268
278
|
items: _sliceInstanceProperty(animals).call(animals, (pageNumber - 1) * 10, pageNumber * 10),
|
|
269
279
|
cursor: "mock-".concat(pageNumber + 1)
|
|
270
280
|
});
|
|
271
281
|
case 6:
|
|
272
282
|
case "end":
|
|
273
|
-
return
|
|
283
|
+
return _context2.stop();
|
|
274
284
|
}
|
|
275
285
|
}, _callee);
|
|
276
286
|
}));
|
|
@@ -281,17 +291,17 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
281
291
|
var fetchApiData = /*#__PURE__*/function () {
|
|
282
292
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(signal, cursor, filterText) {
|
|
283
293
|
var res, json;
|
|
284
|
-
return _regeneratorRuntime().wrap(function _callee2$(
|
|
285
|
-
while (1) switch (
|
|
294
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context3) {
|
|
295
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
286
296
|
case 0:
|
|
287
297
|
if (!args.useMockData) {
|
|
288
|
-
|
|
298
|
+
_context3.next = 2;
|
|
289
299
|
break;
|
|
290
300
|
}
|
|
291
|
-
return
|
|
301
|
+
return _context3.abrupt("return", getMockData(null, null));
|
|
292
302
|
case 2:
|
|
293
|
-
|
|
294
|
-
|
|
303
|
+
_context3.prev = 2;
|
|
304
|
+
_context3.next = 5;
|
|
295
305
|
return _Promise.race([
|
|
296
306
|
// If no cursor is available, then we're loading the first page,
|
|
297
307
|
// filtering the results returned via a query string that
|
|
@@ -306,27 +316,27 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
306
316
|
}, 8000);
|
|
307
317
|
})]);
|
|
308
318
|
case 5:
|
|
309
|
-
res =
|
|
310
|
-
|
|
319
|
+
res = _context3.sent;
|
|
320
|
+
_context3.next = 8;
|
|
311
321
|
return res.json();
|
|
312
322
|
case 8:
|
|
313
|
-
json =
|
|
314
|
-
|
|
323
|
+
json = _context3.sent;
|
|
324
|
+
_context3.next = 11;
|
|
315
325
|
return new _Promise(function (resolve) {
|
|
316
326
|
return _setTimeout(resolve, cursor ? 8000 : 8000);
|
|
317
327
|
});
|
|
318
328
|
case 11:
|
|
319
|
-
return
|
|
329
|
+
return _context3.abrupt("return", {
|
|
320
330
|
items: json.results,
|
|
321
331
|
cursor: json.next
|
|
322
332
|
});
|
|
323
333
|
case 14:
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return
|
|
334
|
+
_context3.prev = 14;
|
|
335
|
+
_context3.t0 = _context3["catch"](2);
|
|
336
|
+
return _context3.abrupt("return", getMockData(null, null));
|
|
327
337
|
case 17:
|
|
328
338
|
case "end":
|
|
329
|
-
return
|
|
339
|
+
return _context3.stop();
|
|
330
340
|
}
|
|
331
341
|
}, _callee2, null, [[2, 14]]);
|
|
332
342
|
}));
|
|
@@ -338,8 +348,8 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
338
348
|
load: function load(_ref6) {
|
|
339
349
|
return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
340
350
|
var signal, cursor, filterText;
|
|
341
|
-
return _regeneratorRuntime().wrap(function _callee3$(
|
|
342
|
-
while (1) switch (
|
|
351
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context4) {
|
|
352
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
343
353
|
case 0:
|
|
344
354
|
signal = _ref6.signal, cursor = _ref6.cursor, filterText = _ref6.filterText;
|
|
345
355
|
if (cursor) {
|
|
@@ -349,15 +359,15 @@ export var InfiniteLoadingList = function InfiniteLoadingList(args) {
|
|
|
349
359
|
|
|
350
360
|
// check if we are mocking pages
|
|
351
361
|
if (!(cursor && _includesInstanceProperty(cursor).call(cursor, 'mock'))) {
|
|
352
|
-
|
|
362
|
+
_context4.next = 4;
|
|
353
363
|
break;
|
|
354
364
|
}
|
|
355
|
-
return
|
|
365
|
+
return _context4.abrupt("return", getMockData(signal, cursor));
|
|
356
366
|
case 4:
|
|
357
|
-
return
|
|
367
|
+
return _context4.abrupt("return", fetchApiData(signal, cursor, filterText));
|
|
358
368
|
case 5:
|
|
359
369
|
case "end":
|
|
360
|
-
return
|
|
370
|
+
return _context4.stop();
|
|
361
371
|
}
|
|
362
372
|
}, _callee3);
|
|
363
373
|
}))();
|
|
@@ -450,11 +460,11 @@ WithCharts.parameters = {
|
|
|
450
460
|
}
|
|
451
461
|
};
|
|
452
462
|
export var OnLoadPrev = function OnLoadPrev() {
|
|
453
|
-
var
|
|
454
|
-
var initialItems = _mapInstanceProperty(
|
|
463
|
+
var _context5, _context6;
|
|
464
|
+
var initialItems = _mapInstanceProperty(_context5 = _fillInstanceProperty(_context6 = new Array(10)).call(_context6, {
|
|
455
465
|
key: 'string',
|
|
456
466
|
name: 'string'
|
|
457
|
-
})).call(
|
|
467
|
+
})).call(_context5, function (_, index) {
|
|
458
468
|
return {
|
|
459
469
|
name: "name: ".concat(index),
|
|
460
470
|
key: "name: ".concat(index),
|
|
@@ -479,21 +489,21 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
479
489
|
setLoadingState = _useState0[1];
|
|
480
490
|
var onLoadMore = /*#__PURE__*/function () {
|
|
481
491
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
482
|
-
var
|
|
492
|
+
var _context7, _context8, _context9;
|
|
483
493
|
var newItems;
|
|
484
|
-
return _regeneratorRuntime().wrap(function _callee4$(
|
|
485
|
-
while (1) switch (
|
|
494
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context0) {
|
|
495
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
486
496
|
case 0:
|
|
487
497
|
setLoadingState(loadingStates.LOADING_MORE);
|
|
488
|
-
|
|
498
|
+
_context0.next = 3;
|
|
489
499
|
return new _Promise(function (resolve) {
|
|
490
500
|
return _setTimeout(resolve, 3000);
|
|
491
501
|
});
|
|
492
502
|
case 3:
|
|
493
|
-
newItems = _mapInstanceProperty(
|
|
503
|
+
newItems = _mapInstanceProperty(_context7 = _fillInstanceProperty(_context8 = new Array(10)).call(_context8, {
|
|
494
504
|
key: 'string',
|
|
495
505
|
name: 'string'
|
|
496
|
-
})).call(
|
|
506
|
+
})).call(_context7, function (_, index) {
|
|
497
507
|
return {
|
|
498
508
|
name: "name: ".concat(maxNum + index),
|
|
499
509
|
key: "name: ".concat(maxNum + index),
|
|
@@ -501,11 +511,11 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
501
511
|
};
|
|
502
512
|
});
|
|
503
513
|
setMaxNum(maxNum + 10);
|
|
504
|
-
setListItems(_concatInstanceProperty(
|
|
514
|
+
setListItems(_concatInstanceProperty(_context9 = []).call(_context9, listItems, newItems));
|
|
505
515
|
setLoadingState(loadingStates.IDLE);
|
|
506
516
|
case 7:
|
|
507
517
|
case "end":
|
|
508
|
-
return
|
|
518
|
+
return _context0.stop();
|
|
509
519
|
}
|
|
510
520
|
}, _callee4);
|
|
511
521
|
}));
|
|
@@ -515,21 +525,21 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
515
525
|
}();
|
|
516
526
|
var onLoadPrev = /*#__PURE__*/function () {
|
|
517
527
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
518
|
-
var
|
|
528
|
+
var _context1, _context10, _context11;
|
|
519
529
|
var newItems;
|
|
520
|
-
return _regeneratorRuntime().wrap(function _callee5$(
|
|
521
|
-
while (1) switch (
|
|
530
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context12) {
|
|
531
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
522
532
|
case 0:
|
|
523
533
|
setLoadingState(loadingStates.LOADING_MORE_PREPEND);
|
|
524
|
-
|
|
534
|
+
_context12.next = 3;
|
|
525
535
|
return new _Promise(function (resolve) {
|
|
526
536
|
return _setTimeout(resolve, 3000);
|
|
527
537
|
});
|
|
528
538
|
case 3:
|
|
529
|
-
newItems = _mapInstanceProperty(
|
|
539
|
+
newItems = _mapInstanceProperty(_context1 = _fillInstanceProperty(_context10 = new Array(10)).call(_context10, {
|
|
530
540
|
key: 'string',
|
|
531
541
|
name: 'string'
|
|
532
|
-
})).call(
|
|
542
|
+
})).call(_context1, function (_, index) {
|
|
533
543
|
return {
|
|
534
544
|
name: "name: ".concat(minNum - (index + 1)),
|
|
535
545
|
key: "name: ".concat(minNum - (index + 1)),
|
|
@@ -537,11 +547,11 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
537
547
|
};
|
|
538
548
|
});
|
|
539
549
|
setMinNum(minNum - 10);
|
|
540
|
-
setListItems(_concatInstanceProperty(
|
|
550
|
+
setListItems(_concatInstanceProperty(_context11 = []).call(_context11, newItems, listItems));
|
|
541
551
|
setLoadingState(loadingStates.IDLE);
|
|
542
552
|
case 7:
|
|
543
553
|
case "end":
|
|
544
|
-
return
|
|
554
|
+
return _context12.stop();
|
|
545
555
|
}
|
|
546
556
|
}, _callee5);
|
|
547
557
|
}));
|
|
@@ -571,4 +581,42 @@ export var OnLoadPrev = function OnLoadPrev() {
|
|
|
571
581
|
}
|
|
572
582
|
}, ___EmotionJSX(Controls, null)));
|
|
573
583
|
}));
|
|
584
|
+
};
|
|
585
|
+
export var OnyxDefaultEmptyState = function OnyxDefaultEmptyState() {
|
|
586
|
+
return ___EmotionJSX(Box, {
|
|
587
|
+
height: "300px"
|
|
588
|
+
}, ___EmotionJSX(ListView, {
|
|
589
|
+
items: [],
|
|
590
|
+
"aria-label": "Empty Onyx ListView"
|
|
591
|
+
}));
|
|
592
|
+
};
|
|
593
|
+
export var AstroEmptyList = function AstroEmptyList() {
|
|
594
|
+
return ___EmotionJSX(Box, {
|
|
595
|
+
height: "300px"
|
|
596
|
+
}, ___EmotionJSX(ListView, {
|
|
597
|
+
items: [],
|
|
598
|
+
"aria-label": "Empty Astro ListView"
|
|
599
|
+
}));
|
|
600
|
+
};
|
|
601
|
+
export var CustomRenderEmptyState = function CustomRenderEmptyState() {
|
|
602
|
+
return ___EmotionJSX(Box, {
|
|
603
|
+
height: "300px"
|
|
604
|
+
}, ___EmotionJSX(ListView, {
|
|
605
|
+
items: [],
|
|
606
|
+
"aria-label": "ListView with a custom empty state",
|
|
607
|
+
renderEmptyState: function renderEmptyState() {
|
|
608
|
+
return ___EmotionJSX(EmptyState, {
|
|
609
|
+
heading: "No results",
|
|
610
|
+
description: "Try adjusting your search."
|
|
611
|
+
}, ___EmotionJSX(Button, {
|
|
612
|
+
variant: "primary",
|
|
613
|
+
sx: {
|
|
614
|
+
mt: 'md'
|
|
615
|
+
},
|
|
616
|
+
onPress: function onPress() {
|
|
617
|
+
return action('Add Item pressed')();
|
|
618
|
+
}
|
|
619
|
+
}, "Add Item"));
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
574
622
|
};
|
|
@@ -39,6 +39,8 @@ import { FocusScope } from 'react-aria';
|
|
|
39
39
|
import { Item } from 'react-stately';
|
|
40
40
|
import userEvent from '@testing-library/user-event';
|
|
41
41
|
import _ from 'lodash';
|
|
42
|
+
import onyxDarkTheme from '../../styles/themeOverrides/nextGenDarkMode';
|
|
43
|
+
import onyxTheme from '../../styles/themes/next-gen';
|
|
42
44
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
|
43
45
|
import { act, fireEvent, render, screen } from '../../utils/testUtils/testWrapper';
|
|
44
46
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
@@ -439,6 +441,84 @@ test('renders neither loader nor item if the component is given no items nor a l
|
|
|
439
441
|
expect(screen.queryByRole('progressbar')).not.toBeInTheDocument();
|
|
440
442
|
expect(screen.queryByRole('gridcell')).not.toBeInTheDocument();
|
|
441
443
|
});
|
|
444
|
+
test.each([['Onyx', onyxTheme], ['Onyx dark', onyxDarkTheme]])('empty ListView renders the default EmptyState in the %s theme', function (_themeName, providerTheme) {
|
|
445
|
+
getComponentEmpty({}, {
|
|
446
|
+
renderFn: function renderFn(ui) {
|
|
447
|
+
return render(ui, {
|
|
448
|
+
providerTheme: providerTheme
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
expect(screen.getByText('No items exist')).toBeInTheDocument();
|
|
453
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
454
|
+
});
|
|
455
|
+
test('empty ListView renders nothing in the Astro theme', function () {
|
|
456
|
+
getComponentEmpty();
|
|
457
|
+
expect(screen.queryByText('No items exist')).not.toBeInTheDocument();
|
|
458
|
+
});
|
|
459
|
+
test('empty ListView renders the custom renderEmptyState in the Astro theme', function () {
|
|
460
|
+
getComponentEmpty({
|
|
461
|
+
renderEmptyState: function renderEmptyState() {
|
|
462
|
+
return ___EmotionJSX("div", {
|
|
463
|
+
"data-testid": "custom-empty"
|
|
464
|
+
}, "No items");
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
expect(screen.getByTestId('custom-empty')).toBeInTheDocument();
|
|
468
|
+
});
|
|
469
|
+
test.each([['Onyx', onyxTheme], ['Onyx dark', onyxDarkTheme]])('renderEmptyState takes priority over the default EmptyState in the %s theme', function (_themeName, providerTheme) {
|
|
470
|
+
getComponentEmpty({
|
|
471
|
+
renderEmptyState: function renderEmptyState() {
|
|
472
|
+
return ___EmotionJSX("div", {
|
|
473
|
+
"data-testid": "custom-empty"
|
|
474
|
+
}, "No items");
|
|
475
|
+
}
|
|
476
|
+
}, {
|
|
477
|
+
renderFn: function renderFn(ui) {
|
|
478
|
+
return render(ui, {
|
|
479
|
+
providerTheme: providerTheme
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
expect(screen.getByTestId('custom-empty')).toBeInTheDocument();
|
|
484
|
+
expect(screen.queryByText('No items exist')).not.toBeInTheDocument();
|
|
485
|
+
});
|
|
486
|
+
test('populated ListView renders its items in the Onyx theme', function () {
|
|
487
|
+
getComponent({}, {
|
|
488
|
+
renderFn: function renderFn(ui) {
|
|
489
|
+
return render(ui, {
|
|
490
|
+
providerTheme: onyxTheme
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
var options = screen.getAllByRole('gridcell');
|
|
495
|
+
expect(options).toHaveLength(items.length);
|
|
496
|
+
expect(options[0]).toHaveAttribute('data-id', items[0].name);
|
|
497
|
+
});
|
|
498
|
+
test('loading ListView does not render the default EmptyState in the Onyx theme', function () {
|
|
499
|
+
getComponentEmpty({
|
|
500
|
+
loadingState: loadingStates.LOADING
|
|
501
|
+
}, {
|
|
502
|
+
renderFn: function renderFn(ui) {
|
|
503
|
+
return render(ui, {
|
|
504
|
+
providerTheme: onyxTheme
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
expect(screen.getByRole('alert')).toBeInTheDocument();
|
|
509
|
+
expect(screen.queryByText('No items exist')).not.toBeInTheDocument();
|
|
510
|
+
});
|
|
511
|
+
test('loading ListView does not render renderEmptyState', function () {
|
|
512
|
+
getComponentEmpty({
|
|
513
|
+
loadingState: loadingStates.LOADING,
|
|
514
|
+
renderEmptyState: function renderEmptyState() {
|
|
515
|
+
return ___EmotionJSX("div", {
|
|
516
|
+
"data-testid": "custom-empty"
|
|
517
|
+
}, "No items");
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
expect(screen.queryByTestId('custom-empty')).not.toBeInTheDocument();
|
|
521
|
+
});
|
|
442
522
|
test('Item accepts a data-id and the data-id can be found in the DOM', function () {
|
|
443
523
|
getComponent();
|
|
444
524
|
var options = screen.getAllByRole('gridcell');
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "data", "iconProps", "iconWrapperProps", "isHovered", "isSelected", "linkProps", "onHoverChange", "onHoverEnd", "onHoverStart", "slots"];
|
|
4
|
+
var _excluded = ["children", "className", "data", "iconProps", "iconWrapperProps", "isHovered", "isSelected", "linkProps", "onHoverChange", "onHoverEnd", "onHoverStart", "slots", "colorId"];
|
|
5
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
7
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
9
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
10
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
11
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
12
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
13
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
14
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
15
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
5
16
|
import React, { forwardRef } from 'react';
|
|
6
17
|
import { useHover } from '@react-aria/interactions';
|
|
7
18
|
import { Box, Icon, IconWrapper, Image, Text } from '../..';
|
|
@@ -25,6 +36,7 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
25
36
|
onHoverEnd = _ref.onHoverEnd,
|
|
26
37
|
onHoverStart = _ref.onHoverStart,
|
|
27
38
|
slots = _ref.slots,
|
|
39
|
+
colorId = _ref.colorId,
|
|
28
40
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
29
41
|
var icon = data.icon,
|
|
30
42
|
image = data.image,
|
|
@@ -57,8 +69,12 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
57
69
|
name: _concatInstanceProperty(_context = "".concat(text)).call(_context, LIST_ITEM_ICON)
|
|
58
70
|
},
|
|
59
71
|
isCircle: true,
|
|
60
|
-
colorId: others.id
|
|
61
|
-
}, iconWrapperProps
|
|
72
|
+
colorId: colorId || others.id
|
|
73
|
+
}, iconWrapperProps, {
|
|
74
|
+
iconProps: _objectSpread(_objectSpread({
|
|
75
|
+
size: 'sm'
|
|
76
|
+
}, iconProps), iconWrapperProps === null || iconWrapperProps === void 0 ? void 0 : iconWrapperProps.iconProps)
|
|
77
|
+
})) : ___EmotionJSX(Box, {
|
|
62
78
|
width: "25px",
|
|
63
79
|
variant: "listViewItem.iconContainer"
|
|
64
80
|
}, ___EmotionJSX(Icon, _extends({
|
|
@@ -69,13 +85,20 @@ var ListViewItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
69
85
|
name: _concatInstanceProperty(_context2 = "".concat(text)).call(_context2, LIST_ITEM_ICON)
|
|
70
86
|
}
|
|
71
87
|
}, iconProps))));
|
|
72
|
-
var renderImage = !icon && image && ___EmotionJSX(Box, {
|
|
88
|
+
var renderImage = !icon && image && (isOnyx ? ___EmotionJSX(Box, {
|
|
89
|
+
variant: "listViewItem.imageContainer"
|
|
90
|
+
}, ___EmotionJSX(Image, {
|
|
91
|
+
src: image.src,
|
|
92
|
+
alt: image.alt,
|
|
93
|
+
"aria-label": image['aria-label'],
|
|
94
|
+
variant: "images.avatar"
|
|
95
|
+
})) : ___EmotionJSX(Box, {
|
|
73
96
|
width: "35px"
|
|
74
97
|
}, ___EmotionJSX(Image, {
|
|
75
98
|
src: image.src,
|
|
76
99
|
alt: image.alt,
|
|
77
100
|
"aria-label": image['aria-label']
|
|
78
|
-
}));
|
|
101
|
+
})));
|
|
79
102
|
var renderData = ___EmotionJSX(Box, {
|
|
80
103
|
isRow: true,
|
|
81
104
|
alignItems: "center"
|
|
@@ -7,7 +7,7 @@ import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
|
7
7
|
import { Badge, Box, IconWrapper, ListView, ListViewItem, ListViewItemChart, ListViewItemMenu, ListViewItemSwitchField, SearchField, Separator, Text } from '../..';
|
|
8
8
|
import { useGetTheme } from '../../hooks';
|
|
9
9
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
10
|
-
import {
|
|
10
|
+
import { userImage } from '../../utils/devUtils/constants/images';
|
|
11
11
|
import { chartData } from './controls/chart/chartData';
|
|
12
12
|
import ListViewItemReadMe from './ListViewItem.mdx';
|
|
13
13
|
import { listViewItemArgTypes } from './listViewItemAttributes';
|
|
@@ -53,10 +53,7 @@ export var Default = function Default() {
|
|
|
53
53
|
icon: AccountIcon,
|
|
54
54
|
text: 'Fons Vernall'
|
|
55
55
|
},
|
|
56
|
-
|
|
57
|
-
size: 'sm',
|
|
58
|
-
color: 'blue'
|
|
59
|
-
}
|
|
56
|
+
colorId: "11111111111"
|
|
60
57
|
}));
|
|
61
58
|
};
|
|
62
59
|
Default.parameters = {
|
|
@@ -88,7 +85,7 @@ export var WithImage = function WithImage() {
|
|
|
88
85
|
return ___EmotionJSX(Wrapper, null, ___EmotionJSX(ListViewItem, {
|
|
89
86
|
data: {
|
|
90
87
|
image: {
|
|
91
|
-
src:
|
|
88
|
+
src: userImage,
|
|
92
89
|
alt: 'avatar',
|
|
93
90
|
'aria-label': 'avatar'
|
|
94
91
|
},
|
|
@@ -103,6 +103,12 @@ var iconWrapper = {
|
|
|
103
103
|
var imageWrapper = _objectSpread(_objectSpread({}, iconWrapper), {}, {
|
|
104
104
|
ml: 'sm'
|
|
105
105
|
});
|
|
106
|
+
var imageContainer = {
|
|
107
|
+
width: '35px',
|
|
108
|
+
flexShrink: 0,
|
|
109
|
+
display: 'flex',
|
|
110
|
+
justifyContent: 'center'
|
|
111
|
+
};
|
|
106
112
|
var leftOfDataWrapper = _objectSpread(_objectSpread({}, iconWrapper), {}, {
|
|
107
113
|
ml: 0
|
|
108
114
|
});
|
|
@@ -152,6 +158,7 @@ export default {
|
|
|
152
158
|
container: container,
|
|
153
159
|
controls: controls,
|
|
154
160
|
iconWrapper: iconWrapper,
|
|
161
|
+
imageContainer: imageContainer,
|
|
155
162
|
imageWrapper: imageWrapper,
|
|
156
163
|
leftOfDataWrapper: leftOfDataWrapper,
|
|
157
164
|
linkedViewContainer: linkedViewContainer,
|
|
@@ -10,11 +10,11 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
|
10
10
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
11
11
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
12
12
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
|
16
16
|
import { act } from '@testing-library/react';
|
|
17
|
-
import { ListViewItem, ListViewItemSwitchField } from '../..';
|
|
17
|
+
import { AstroProvider, ListViewItem, ListViewItemSwitchField, OnyxDarkTheme, OnyxTheme } from '../..';
|
|
18
18
|
import { pingImg } from '../../utils/devUtils/constants/images';
|
|
19
19
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
|
20
20
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
@@ -36,6 +36,13 @@ var getComponent = function getComponent() {
|
|
|
36
36
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
37
|
return render(___EmotionJSX(ListViewItem, _extends({}, defaultProps, props)));
|
|
38
38
|
};
|
|
39
|
+
var getComponentOnyx = function getComponentOnyx() {
|
|
40
|
+
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : OnyxTheme;
|
|
41
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
42
|
+
return render(___EmotionJSX(AstroProvider, {
|
|
43
|
+
themeOverrides: [theme]
|
|
44
|
+
}, ___EmotionJSX(ListViewItem, _extends({}, defaultProps, props))));
|
|
45
|
+
};
|
|
39
46
|
var fallbackImageObj = null;
|
|
40
47
|
jest.mock('../../hooks/useFallbackImage', function () {
|
|
41
48
|
return function (props) {
|
|
@@ -78,6 +85,30 @@ describe('ListViewItem', function () {
|
|
|
78
85
|
});
|
|
79
86
|
screen.getByText(TEST_TEXT);
|
|
80
87
|
});
|
|
88
|
+
test.each([['Onyx light', OnyxTheme], ['Onyx dark', OnyxDarkTheme]])('renders an 18px icon in %s ListViewItem', function (_, theme) {
|
|
89
|
+
var _context2;
|
|
90
|
+
getComponentOnyx(theme, {
|
|
91
|
+
id: 'test-id',
|
|
92
|
+
iconWrapperProps: {
|
|
93
|
+
color: 'green'
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
var icon = screen.getByRole('img', {
|
|
97
|
+
name: _concatInstanceProperty(_context2 = "".concat(defaultProps.data.text)).call(_context2, LIST_ITEM_ICON)
|
|
98
|
+
});
|
|
99
|
+
expect(icon).toHaveStyleRule('width', '18px');
|
|
100
|
+
expect(icon).toHaveStyleRule('height', '18px');
|
|
101
|
+
});
|
|
102
|
+
test('passes colorId to the avatar', function () {
|
|
103
|
+
var _context3;
|
|
104
|
+
getComponentOnyx(OnyxTheme, {
|
|
105
|
+
colorId: 'my-color-id'
|
|
106
|
+
});
|
|
107
|
+
var avatar = screen.getByRole('img', {
|
|
108
|
+
name: _concatInstanceProperty(_context3 = "".concat(defaultProps.data.text)).call(_context3, LIST_ITEM_ICON)
|
|
109
|
+
}).parentElement;
|
|
110
|
+
expect(avatar).toBeInTheDocument();
|
|
111
|
+
});
|
|
81
112
|
test('renders icon if both icon and image are passed', function () {
|
|
82
113
|
getComponent();
|
|
83
114
|
var icon = screen.getByRole('img');
|