@pingux/astro 2.221.6-alpha.0 → 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
|
@@ -8,10 +8,12 @@ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/obje
|
|
|
8
8
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
11
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; }
|
|
12
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
14
|
import React from 'react';
|
|
14
15
|
import GroupIcon from '@pingux/mdi-react/AccountGroupIcon';
|
|
16
|
+
import AccountMultipleOutlineIcon from '@pingux/mdi-react/AccountMultipleOutlineIcon';
|
|
15
17
|
import ArrowIcon from '@pingux/mdi-react/ArrowTopRightThickIcon';
|
|
16
18
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
17
19
|
import { useGetTheme } from '../../hooks';
|
|
@@ -20,6 +22,19 @@ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
|
20
22
|
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
|
21
23
|
import IconBadgeReadme from './IconBadge.mdx';
|
|
22
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
|
+
var colorIdToHashTo = {
|
|
26
|
+
blue: 'color-13',
|
|
27
|
+
green: 'color-6',
|
|
28
|
+
purple: 'color-7',
|
|
29
|
+
cyan: 'color-5',
|
|
30
|
+
pink: 'color-8',
|
|
31
|
+
orange: 'color-4',
|
|
32
|
+
red: 'color-9',
|
|
33
|
+
yellow: 'color-11',
|
|
34
|
+
teal: 'color-10',
|
|
35
|
+
indigo: 'color-12'
|
|
36
|
+
};
|
|
37
|
+
var twotoneColorNames = ['blue', 'green', 'purple', 'pink', 'red', 'orange', 'yellow', 'teal', 'cyan', 'indigo'];
|
|
23
38
|
export default {
|
|
24
39
|
title: 'Components/IconBadge',
|
|
25
40
|
component: IconBadge,
|
|
@@ -48,6 +63,12 @@ export default {
|
|
|
48
63
|
control: {
|
|
49
64
|
type: 'number'
|
|
50
65
|
}
|
|
66
|
+
},
|
|
67
|
+
colorId: {
|
|
68
|
+
description: 'A unique id used to deterministically assign a twotone color to the child icons (Onyx themes only). Resolved with the same FNV-1a hashing approach as IconWrapper and Avatar.',
|
|
69
|
+
control: {
|
|
70
|
+
type: 'text'
|
|
71
|
+
}
|
|
51
72
|
}
|
|
52
73
|
}, ariaAttributeBaseArgTypes)
|
|
53
74
|
};
|
|
@@ -56,33 +77,55 @@ export var Default = function Default(args) {
|
|
|
56
77
|
_useGetTheme$themeSta = _useGetTheme.themeState,
|
|
57
78
|
isOnyx = _useGetTheme$themeSta.isOnyx,
|
|
58
79
|
isOnyxDark = _useGetTheme$themeSta.isOnyxDark;
|
|
59
|
-
var
|
|
80
|
+
var iconColor = function iconColor() {
|
|
60
81
|
if (isOnyxDark) return 'gray-400';
|
|
61
82
|
if (isOnyx) return 'gray-800';
|
|
62
83
|
return 'badge.iconBadgeFill';
|
|
63
84
|
};
|
|
64
|
-
var
|
|
85
|
+
var circleColor = function circleColor() {
|
|
65
86
|
if (isOnyxDark) return 'gray-700';
|
|
66
87
|
if (isOnyx) return 'gray-100';
|
|
67
88
|
return undefined;
|
|
68
89
|
};
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
if (isOnyx) {
|
|
91
|
+
return ___EmotionJSX(Box, {
|
|
92
|
+
flexWrap: "wrap",
|
|
93
|
+
gap: "md"
|
|
94
|
+
}, _mapInstanceProperty(twotoneColorNames).call(twotoneColorNames, function (colorName) {
|
|
95
|
+
return ___EmotionJSX(IconBadge, {
|
|
96
|
+
key: colorName,
|
|
97
|
+
baseSize: 24,
|
|
98
|
+
circleSize: 10,
|
|
99
|
+
colorId: colorIdToHashTo[colorName]
|
|
100
|
+
}, ___EmotionJSX(Icon, {
|
|
101
|
+
icon: AccountMultipleOutlineIcon,
|
|
102
|
+
title: {
|
|
103
|
+
name: "".concat(colorName, " icon")
|
|
104
|
+
}
|
|
105
|
+
}), ___EmotionJSX(Icon, {
|
|
106
|
+
icon: ArrowIcon,
|
|
107
|
+
size: "xxs",
|
|
108
|
+
title: {
|
|
109
|
+
name: "".concat(colorName, " badge icon")
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
71
114
|
return ___EmotionJSX(Box, null, ___EmotionJSX(IconBadge, _extends({}, args, {
|
|
72
115
|
baseSize: 25,
|
|
73
116
|
circleSize: 15,
|
|
74
|
-
circleColor: circleColor
|
|
117
|
+
circleColor: circleColor()
|
|
75
118
|
}), ___EmotionJSX(Icon, {
|
|
76
119
|
icon: GroupIcon,
|
|
77
120
|
size: "25px",
|
|
78
|
-
color: iconColor,
|
|
121
|
+
color: iconColor(),
|
|
79
122
|
title: {
|
|
80
123
|
name: 'Group Icon'
|
|
81
124
|
}
|
|
82
125
|
}), ___EmotionJSX(Icon, {
|
|
83
126
|
icon: ArrowIcon,
|
|
84
127
|
size: "13px",
|
|
85
|
-
color: iconColor,
|
|
128
|
+
color: iconColor(),
|
|
86
129
|
title: {
|
|
87
130
|
name: 'Arrow Icon'
|
|
88
131
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var container = {
|
|
2
|
+
position: 'relative',
|
|
3
|
+
display: 'flex',
|
|
4
|
+
alignItems: 'top',
|
|
5
|
+
borderRadius: '50%'
|
|
6
|
+
};
|
|
7
|
+
var badgeCircle = {
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
bottom: '-5.5px',
|
|
10
|
+
right: '1px',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
height: '15px',
|
|
14
|
+
width: '15px',
|
|
15
|
+
borderRadius: '50%'
|
|
16
|
+
};
|
|
17
|
+
export default {
|
|
18
|
+
container: container,
|
|
19
|
+
badgeCircle: badgeCircle
|
|
20
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
3
|
import { Icon, IconBadge } from '../../index';
|
|
4
|
+
import { render, screen } from '../../utils/testUtils/testWrapper';
|
|
5
5
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
6
|
+
import getColorFromUUID from '../Avatar/getColorFromUuid';
|
|
7
|
+
import { injectTwotoneColor, resolveTwotonePath } from './IconBadge';
|
|
6
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
9
|
var testId = 'test-icon';
|
|
8
10
|
var defaultProps = {
|
|
@@ -68,4 +70,55 @@ test('iconbadge borderRadius renders correctly', function () {
|
|
|
68
70
|
var icons = screen.getAllByRole('img');
|
|
69
71
|
var secondIcon = icons[1].closest('span');
|
|
70
72
|
expect(secondIcon).toHaveStyle("border-radius: ".concat(circleSize / 2, "px"));
|
|
73
|
+
});
|
|
74
|
+
describe('resolveTwotonePath', function () {
|
|
75
|
+
var colorNames = ['orange', 'cyan', 'green'];
|
|
76
|
+
test('returns a path factory for a valid colorId', function () {
|
|
77
|
+
var path = resolveTwotonePath('uuid-1', colorNames);
|
|
78
|
+
expect(path).not.toBeNull();
|
|
79
|
+
expect(path('text')).toBe("twoTone.text.".concat(getColorFromUUID('uuid-1', colorNames)));
|
|
80
|
+
expect(path('secondary')).toBe("twoTone.secondary.".concat(getColorFromUUID('uuid-1', colorNames)));
|
|
81
|
+
expect(path('bg')).toBe("twoTone.bg.".concat(getColorFromUUID('uuid-1', colorNames)));
|
|
82
|
+
});
|
|
83
|
+
test('returns the same color for the same colorId', function () {
|
|
84
|
+
var firstPath = resolveTwotonePath('uuid-1', colorNames);
|
|
85
|
+
var secondPath = resolveTwotonePath('uuid-1', colorNames);
|
|
86
|
+
expect(firstPath('text')).toBe(secondPath('text'));
|
|
87
|
+
});
|
|
88
|
+
test('returns null when colorId is missing', function () {
|
|
89
|
+
expect(resolveTwotonePath(undefined, colorNames)).toBeNull();
|
|
90
|
+
expect(resolveTwotonePath('', colorNames)).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
test('returns null when twotone color names are missing', function () {
|
|
93
|
+
expect(resolveTwotonePath('uuid-1', undefined)).toBeNull();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('injectTwotoneColor', function () {
|
|
97
|
+
var colorNames = ['orange', 'cyan', 'green'];
|
|
98
|
+
var twotonePath = resolveTwotonePath('uuid-1', colorNames);
|
|
99
|
+
test('injects a twotone color into an icon without a color prop', function () {
|
|
100
|
+
var icon = ___EmotionJSX(Icon, {
|
|
101
|
+
icon: ThisIcon
|
|
102
|
+
});
|
|
103
|
+
var result = injectTwotoneColor(icon, 'text', twotonePath);
|
|
104
|
+
expect(result).toHaveProperty('props.color', twotonePath('text'));
|
|
105
|
+
});
|
|
106
|
+
test('does not override an existing color prop', function () {
|
|
107
|
+
var icon = ___EmotionJSX(Icon, {
|
|
108
|
+
icon: ThisIcon,
|
|
109
|
+
color: "accent.40"
|
|
110
|
+
});
|
|
111
|
+
var result = injectTwotoneColor(icon, 'text', twotonePath);
|
|
112
|
+
expect(result).toHaveProperty('props.color', 'accent.40');
|
|
113
|
+
});
|
|
114
|
+
test('returns the icon unchanged when the twotone path is null', function () {
|
|
115
|
+
var icon = ___EmotionJSX(Icon, {
|
|
116
|
+
icon: ThisIcon
|
|
117
|
+
});
|
|
118
|
+
expect(injectTwotoneColor(icon, 'text', null)).toBe(icon);
|
|
119
|
+
});
|
|
120
|
+
test('returns non-element children unchanged', function () {
|
|
121
|
+
expect(injectTwotoneColor('text', 'text', twotonePath)).toBe('text');
|
|
122
|
+
expect(injectTwotoneColor(null, 'text', twotonePath)).toBeNull();
|
|
123
|
+
});
|
|
71
124
|
});
|
|
@@ -10,6 +10,7 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
|
10
10
|
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; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
import tShirtSizes from '../../styles/themes/astro/customProperties/tShirtSizes';
|
|
13
|
+
import { arrayFieldDeleteButton } from '../ArrayField/ArrayFieldDeleteButton.styles';
|
|
13
14
|
import { badgeDeleteButton, deleteButton, invertedBadgeDeleteButton } from '../Badge/Badge.styles';
|
|
14
15
|
import { defaultActive, defaultFocus, defaultHover } from '../Button/Buttons.styles';
|
|
15
16
|
import { toggle } from '../CollapsiblePanel/CollapsiblePanel.styles';
|
|
@@ -175,6 +176,9 @@ var filter = _objectSpread(_objectSpread({}, base), {}, {
|
|
|
175
176
|
export default {
|
|
176
177
|
base: base,
|
|
177
178
|
bidirectional: bidirectional,
|
|
179
|
+
arrayField: {
|
|
180
|
+
deleteButton: arrayFieldDeleteButton.deleteButton
|
|
181
|
+
},
|
|
178
182
|
badge: {
|
|
179
183
|
deleteButton: deleteButton
|
|
180
184
|
},
|
|
@@ -82,6 +82,7 @@ export var WithLabelIcon = function WithLabelIcon(args) {
|
|
|
82
82
|
});
|
|
83
83
|
return ___EmotionJSX(LabelValuePairs, args, ___EmotionJSX(Pair, null, ___EmotionJSX(PairLabel, null, "Status", ___EmotionJSX(Box, {
|
|
84
84
|
isRow: true,
|
|
85
|
+
ml: "xs",
|
|
85
86
|
gap: "xs",
|
|
86
87
|
alignItems: "center"
|
|
87
88
|
}, icon, ___EmotionJSX(Text, {
|
|
@@ -32,8 +32,9 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
|
|
|
32
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
33
|
import React from 'react';
|
|
34
34
|
import InformationIcon from '@pingux/mdi-react/InformationIcon';
|
|
35
|
+
import { astroTokens, astroTokensDark } from '@pingux/onyx-tokens';
|
|
35
36
|
import userEvent from '@testing-library/user-event';
|
|
36
|
-
import { Icon } from '../../index';
|
|
37
|
+
import { AstroProvider, Icon, OnyxDarkTheme, OnyxTheme } from '../../index';
|
|
37
38
|
import { act, render, screen } from '../../utils/testUtils/testWrapper';
|
|
38
39
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
39
40
|
import LabelValuePairs, { Pair, PairLabel, PairSubvalue, PairValue, ValueTypes } from '.';
|
|
@@ -42,6 +43,12 @@ var originalClipboard = _objectSpread({}, global.navigator.clipboard);
|
|
|
42
43
|
var getComponent = function getComponent(children) {
|
|
43
44
|
return render(___EmotionJSX(LabelValuePairs, null, children));
|
|
44
45
|
};
|
|
46
|
+
var getThemedComponent = function getThemedComponent(theme, children) {
|
|
47
|
+
return render(___EmotionJSX(AstroProvider, {
|
|
48
|
+
themeOverrides: [theme]
|
|
49
|
+
}, ___EmotionJSX(LabelValuePairs, null, children)));
|
|
50
|
+
};
|
|
51
|
+
var valuePair = ___EmotionJSX(Pair, null, ___EmotionJSX(PairLabel, null, "Username"), ___EmotionJSX(PairValue, null, "jsmith"));
|
|
45
52
|
|
|
46
53
|
// Needs to be added to each components test file
|
|
47
54
|
universalComponentTests({
|
|
@@ -50,10 +57,20 @@ universalComponentTests({
|
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
59
|
test('renders a row for each field with a value', function () {
|
|
53
|
-
getComponent(
|
|
60
|
+
getComponent(valuePair);
|
|
54
61
|
expect(screen.getByText('Username')).toBeInTheDocument();
|
|
55
62
|
expect(screen.getByText('jsmith')).toBeInTheDocument();
|
|
56
63
|
});
|
|
64
|
+
describe('value color', function () {
|
|
65
|
+
test('uses the primary Onyx light text color', function () {
|
|
66
|
+
getThemedComponent(OnyxTheme, valuePair);
|
|
67
|
+
expect(screen.getByText('jsmith')).toHaveStyleRule('color', astroTokens.color.font.base);
|
|
68
|
+
});
|
|
69
|
+
test('uses the primary Onyx dark text color', function () {
|
|
70
|
+
getThemedComponent(OnyxDarkTheme, valuePair);
|
|
71
|
+
expect(screen.getByText('jsmith')).toHaveStyleRule('color', astroTokensDark.color.font.base);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
57
74
|
test('rows with falsy value are not rendered unless isLoading is true', function () {
|
|
58
75
|
getComponent(___EmotionJSX(React.Fragment, null, ___EmotionJSX(Pair, null, ___EmotionJSX(PairLabel, null, "Empty Field"), ___EmotionJSX(PairValue, null)), ___EmotionJSX(Pair, null, ___EmotionJSX(PairLabel, null, "Null Field"), ___EmotionJSX(PairValue, null, null)), ___EmotionJSX(Pair, null, ___EmotionJSX(PairLabel, null, "Visible Field"), ___EmotionJSX(PairValue, null, "some value"))));
|
|
59
76
|
expect(screen.queryByText('Empty Field')).not.toBeInTheDocument();
|
|
@@ -32,8 +32,7 @@ var PairLabel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
32
32
|
return ___EmotionJSX(Box, _extends({
|
|
33
33
|
ref: ref,
|
|
34
34
|
isRow: true,
|
|
35
|
-
alignItems: "center"
|
|
36
|
-
gap: "sm"
|
|
35
|
+
alignItems: "center"
|
|
37
36
|
}, others, containerProps), ___EmotionJSX(Text, _extends({}, defaultTextProps, textProps), label), icon, helpHint && ___EmotionJSX(HelpHint, _extends({
|
|
38
37
|
iconButtonProps: {
|
|
39
38
|
'aria-label': "".concat(label, " help hint")
|
|
@@ -10,7 +10,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
11
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
12
12
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
13
|
-
var _excluded = ["containerProps", "disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onLoadPrev", "onSelectionChange", "onExpandedChange", "expandedKeys", "selectedKeys", "selectionMode", "selectionStyle", "items", "onFocus"];
|
|
13
|
+
var _excluded = ["containerProps", "disabledKeys", "isHoverable", "loadingState", "onLoadMore", "onLoadPrev", "onSelectionChange", "onExpandedChange", "expandedKeys", "selectedKeys", "selectionMode", "selectionStyle", "items", "onFocus", "renderEmptyState"];
|
|
14
14
|
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; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
16
|
import React, { forwardRef, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
@@ -19,9 +19,11 @@ import { useTreeState } from 'react-stately';
|
|
|
19
19
|
import { useCollator } from '@react-aria/i18n';
|
|
20
20
|
import { Virtualizer, VirtualizerItem } from '@react-aria/virtualizer';
|
|
21
21
|
import { ListLayout } from '@react-stately/layout';
|
|
22
|
+
import { useGetTheme } from '../../hooks';
|
|
22
23
|
import useLoadPrev from '../../hooks/useLoadPrev';
|
|
23
24
|
import { Box } from '../../index';
|
|
24
25
|
import loadingStates from '../../utils/devUtils/constants/loadingStates';
|
|
26
|
+
import EmptyState from '../EmptyState';
|
|
25
27
|
import Loader from '../Loader';
|
|
26
28
|
import { ListViewContext } from './ListViewContext';
|
|
27
29
|
import ListViewExpandableItem from './ListViewExpandableItem';
|
|
@@ -38,12 +40,14 @@ export function useListLayout(state) {
|
|
|
38
40
|
usage: 'search',
|
|
39
41
|
sensitivity: 'base'
|
|
40
42
|
});
|
|
43
|
+
// placeholderHeight is intentionally omitted: ListLayout falls back to the
|
|
44
|
+
// full visible height for the empty-state placeholder, so the EmptyState
|
|
45
|
+
// can fill and center within the list instead of being clipped to a row.
|
|
41
46
|
var layout = useMemo(function () {
|
|
42
47
|
return new ListLayout({
|
|
43
48
|
estimatedRowHeight: ROW_HEIGHT,
|
|
44
49
|
estimatedHeadingHeight: 26,
|
|
45
50
|
loaderHeight: ROW_HEIGHT,
|
|
46
|
-
placeholderHeight: ROW_HEIGHT,
|
|
47
51
|
collator: collator
|
|
48
52
|
});
|
|
49
53
|
}, [collator, state.collection]);
|
|
@@ -67,11 +71,14 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
67
71
|
selectionStyle = props.selectionStyle,
|
|
68
72
|
items = props.items,
|
|
69
73
|
onFocus = props.onFocus,
|
|
74
|
+
renderEmptyState = props.renderEmptyState,
|
|
70
75
|
others = _objectWithoutProperties(props, _excluded);
|
|
71
76
|
var _useState = useState(null),
|
|
72
77
|
_useState2 = _slicedToArray(_useState, 2),
|
|
73
78
|
hoveredItem = _useState2[0],
|
|
74
79
|
setHoveredItem = _useState2[1];
|
|
80
|
+
var _useGetTheme = useGetTheme(),
|
|
81
|
+
isOnyx = _useGetTheme.themeState.isOnyx;
|
|
75
82
|
var isLoading = loadingState === loadingStates.LOADING_MORE || loadingState === loadingStates.LOADING;
|
|
76
83
|
var isFocusable = selectionMode !== 'none';
|
|
77
84
|
var renderWrapper = function renderWrapper(parent, reusableView) {
|
|
@@ -81,6 +88,16 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
81
88
|
parent: parent
|
|
82
89
|
});
|
|
83
90
|
};
|
|
91
|
+
var renderEmpty = function renderEmpty() {
|
|
92
|
+
// A loading state takes precedence over the empty state. The layout
|
|
93
|
+
// emits a loader node before the placeholder, so this is a defensive
|
|
94
|
+
// guard only.
|
|
95
|
+
/* istanbul ignore if */
|
|
96
|
+
if (isLoading) return null;
|
|
97
|
+
if (renderEmptyState) return renderEmptyState();
|
|
98
|
+
// Default empty state is rendered in the Onyx theme only.
|
|
99
|
+
return isOnyx ? ___EmotionJSX(EmptyState, null) : null;
|
|
100
|
+
};
|
|
84
101
|
var listViewRef = useRef(null);
|
|
85
102
|
|
|
86
103
|
/* istanbul ignore next */
|
|
@@ -164,10 +181,14 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
164
181
|
onScroll: resetHoverState,
|
|
165
182
|
tabIndex: isFocusable ? 0 : -1,
|
|
166
183
|
shouldUseVirtualFocus: !isFocusable
|
|
167
|
-
// added to remove the outline when using keyboard navigation encountered during UIP-7501
|
|
184
|
+
// added to remove the outline when using keyboard navigation encountered during UIP-7501.
|
|
185
|
+
// height: '100%' gives the scroll container a definite height even when
|
|
186
|
+
// the collection is empty, so the virtualizer's visibleRect is non-zero
|
|
187
|
+
// and the empty-state placeholder (sized to visibleRect.height) renders.
|
|
168
188
|
,
|
|
169
189
|
style: {
|
|
170
|
-
outline: 'none'
|
|
190
|
+
outline: 'none',
|
|
191
|
+
height: '100%'
|
|
171
192
|
}
|
|
172
193
|
}), function (type, item) {
|
|
173
194
|
if (type === 'item') {
|
|
@@ -194,6 +215,9 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
194
215
|
}
|
|
195
216
|
});
|
|
196
217
|
}
|
|
218
|
+
if (type === collectionTypes.PLACEHOLDER) {
|
|
219
|
+
return renderEmpty();
|
|
220
|
+
}
|
|
197
221
|
return null;
|
|
198
222
|
})));
|
|
199
223
|
});
|