@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
|
@@ -19,9 +19,16 @@ var descriptions = {
|
|
|
19
19
|
isSelected: 'Sets the selected state of the ListItem',
|
|
20
20
|
isPanelHeader: 'A boolean that will adapt the styling of ListIteme to be used as the PanelHeader',
|
|
21
21
|
slots: 'Provides a way to insert markup in specified places.',
|
|
22
|
-
linkProps: 'When present, provides meta click functionality'
|
|
22
|
+
linkProps: 'When present, provides meta click functionality',
|
|
23
|
+
colorId: 'Identifier used to deterministically derive the avatar color when no explicit color is set.'
|
|
23
24
|
};
|
|
24
25
|
export var SharedItemArgTypes = {
|
|
26
|
+
colorId: {
|
|
27
|
+
description: descriptions.colorId,
|
|
28
|
+
control: {
|
|
29
|
+
type: 'text'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
25
32
|
data: {
|
|
26
33
|
description: descriptions.data,
|
|
27
34
|
type: {
|
|
@@ -63,6 +70,7 @@ export var listViewItemArgTypes = _objectSpread(_objectSpread(_objectSpread({
|
|
|
63
70
|
}, SharedItemArgTypes), onHoverArgTypes), ariaAttributeBaseArgTypes);
|
|
64
71
|
export var SharedItemPropTypes = {
|
|
65
72
|
className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
|
|
73
|
+
colorId: PropTypes.string,
|
|
66
74
|
data: PropTypes.shape({
|
|
67
75
|
icon: PropTypes.elementType,
|
|
68
76
|
image: PropTypes.shape({
|
|
@@ -111,11 +111,19 @@ var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
111
111
|
}
|
|
112
112
|
}, [initialItems, mode]);
|
|
113
113
|
var toggleItems = function toggleItems(keys) {
|
|
114
|
+
var _inputRef$current;
|
|
114
115
|
setItems(_filterInstanceProperty(initialItems).call(initialItems, function (item) {
|
|
115
116
|
var _context;
|
|
116
117
|
return !_includesInstanceProperty(_context = _Array$from(keys)).call(_context, item.key);
|
|
117
118
|
}));
|
|
118
119
|
if (onSelectionChange) onSelectionChange(keys);
|
|
120
|
+
// Selecting an option removes it from the list, unmounting its row while
|
|
121
|
+
// focusedKey still points at it — the virtualizer then holds DOM focus on
|
|
122
|
+
// the listbox, so a subsequent outside click never blurs the input and the
|
|
123
|
+
// listbox stays open. Clear the stale focus and return it to the input,
|
|
124
|
+
// matching the post-selection focus state of the Astro theme (UXE-9077).
|
|
125
|
+
selectionManager.setFocusedKey(null);
|
|
126
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
119
127
|
};
|
|
120
128
|
var _useFilter = useFilter({
|
|
121
129
|
sensitivity: 'base'
|
|
@@ -36,7 +36,7 @@ function _regeneratorDefine2(e, r, n, t) { var i = _Object$defineProperty; try {
|
|
|
36
36
|
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
37
37
|
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; }
|
|
38
38
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context12, _context13; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context12 = ownKeys(Object(t), !0)).call(_context12, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context13 = ownKeys(Object(t))).call(_context13, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
39
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
39
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
40
40
|
import PlusCircleMultipleOutlineIcon from '@pingux/mdi-react/PlusCircleMultipleOutlineIcon';
|
|
41
41
|
import { useFilter } from '@react-aria/i18n';
|
|
42
42
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
@@ -299,6 +299,28 @@ export var Default = function Default(args) {
|
|
|
299
299
|
}, item.name);
|
|
300
300
|
}));
|
|
301
301
|
};
|
|
302
|
+
export var DefaultOpen = function DefaultOpen() {
|
|
303
|
+
var inputRef = useRef();
|
|
304
|
+
useEffect(function () {
|
|
305
|
+
var _inputRef$current;
|
|
306
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
307
|
+
}, []);
|
|
308
|
+
return ___EmotionJSX(OverlayProvider
|
|
309
|
+
// note: spacing for demo purpose only so that the select list renders in the correct place
|
|
310
|
+
, {
|
|
311
|
+
style: setOverlayStyle('bottom', true, '50%', '50%', '20%')
|
|
312
|
+
}, ___EmotionJSX(MultivaluesField, {
|
|
313
|
+
items: items,
|
|
314
|
+
label: "Field Label",
|
|
315
|
+
ref: inputRef
|
|
316
|
+
}, function (item) {
|
|
317
|
+
return ___EmotionJSX(Item, {
|
|
318
|
+
key: item.key,
|
|
319
|
+
"data-id": item.name,
|
|
320
|
+
"aria-label": item.name
|
|
321
|
+
}, item.name);
|
|
322
|
+
}));
|
|
323
|
+
};
|
|
302
324
|
export var Uncontrolled = function Uncontrolled(args) {
|
|
303
325
|
var _useState3 = useState(false),
|
|
304
326
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["buttonProps", "children", "title"];
|
|
3
|
+
var _excluded = ["buttonProps", "children", "slots", "title"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import PlusIcon from '@pingux/mdi-react/PlusIcon';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -10,6 +10,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
10
10
|
var PageHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
11
11
|
var buttonProps = _ref.buttonProps,
|
|
12
12
|
children = _ref.children,
|
|
13
|
+
slots = _ref.slots,
|
|
13
14
|
title = _ref.title,
|
|
14
15
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
var linkStyles = {
|
|
@@ -23,7 +24,7 @@ var PageHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
23
24
|
pageHeaderAddIconSize = _useGetTheme.pageHeaderAddIconSize;
|
|
24
25
|
var renderButton = buttonProps && ___EmotionJSX(IconButton, _extends({
|
|
25
26
|
"aria-label": "icon button",
|
|
26
|
-
|
|
27
|
+
mx: pageHeaderAddIconMargin,
|
|
27
28
|
variant: "inverted"
|
|
28
29
|
}, buttonProps), ___EmotionJSX(Icon, {
|
|
29
30
|
icon: PlusIcon,
|
|
@@ -38,7 +39,7 @@ var PageHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
39
|
}, ___EmotionJSX(Text, {
|
|
39
40
|
as: "h1",
|
|
40
41
|
variant: "pageHeaderTitle"
|
|
41
|
-
}, title), renderButton), ___EmotionJSX(Text, {
|
|
42
|
+
}, title), renderButton, slots === null || slots === void 0 ? void 0 : slots.rightOfTitle), ___EmotionJSX(Text, {
|
|
42
43
|
variant: "pageHeaderBody",
|
|
43
44
|
sx: linkStyles
|
|
44
45
|
}, children));
|
|
@@ -47,6 +48,10 @@ PageHeader.propTypes = {
|
|
|
47
48
|
/** If present, this string will be rendered as the title */
|
|
48
49
|
title: PropTypes.string,
|
|
49
50
|
/** Props object that is spread into the Button element. */
|
|
50
|
-
buttonProps: PropTypes.shape({})
|
|
51
|
+
buttonProps: PropTypes.shape({}),
|
|
52
|
+
/** Slots for rendering custom elements within the PageHeader. */
|
|
53
|
+
slots: PropTypes.shape({
|
|
54
|
+
rightOfTitle: PropTypes.node
|
|
55
|
+
})
|
|
51
56
|
};
|
|
52
57
|
export default PageHeader;
|
|
@@ -15,5 +15,8 @@ Pass `buttonProps` to add actions and customizations to the '+' button. Omit `bu
|
|
|
15
15
|
### Children
|
|
16
16
|
Text and Links passed as children will be styled to match Ping specs.
|
|
17
17
|
|
|
18
|
+
### Slots
|
|
19
|
+
Pass `slots.rightOfTitle` to render a custom element (e.g. an overflow menu `IconButton`) to the right of the title/add button. This renders after the add button if `buttonProps` is provided, otherwise it renders immediately after the title.
|
|
20
|
+
|
|
18
21
|
### Note:
|
|
19
22
|
Components styled to match design specs may be updated over time as design specs change. Be aware that styles within this component may undergo minor adjustments over time to stay in sync with the latest design specifications.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import DotsVerticalIcon from '@pingux/mdi-react/DotsVerticalIcon';
|
|
3
4
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
4
|
-
import { Link, PageHeader } from '../../index';
|
|
5
|
+
import { Icon, IconButton, Link, PageHeader } from '../../index';
|
|
5
6
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
6
7
|
import PageHeaderReadMe from './PageHeader.mdx';
|
|
7
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -83,13 +84,22 @@ WithoutLink.parameters = {
|
|
|
83
84
|
url: FIGMA_LINKS.pageHeader.withoutLink
|
|
84
85
|
}
|
|
85
86
|
};
|
|
86
|
-
export var Customization = function Customization(
|
|
87
|
-
return ___EmotionJSX(PageHeader,
|
|
87
|
+
export var Customization = function Customization() {
|
|
88
|
+
return ___EmotionJSX(PageHeader, {
|
|
88
89
|
buttonProps: {
|
|
89
90
|
bg: 'critical.bright'
|
|
90
91
|
},
|
|
91
|
-
title: "Lorem Ipsum"
|
|
92
|
-
|
|
92
|
+
title: "Lorem Ipsum",
|
|
93
|
+
slots: {
|
|
94
|
+
rightOfTitle: ___EmotionJSX(IconButton, {
|
|
95
|
+
"aria-label": "overflow menu",
|
|
96
|
+
onPress: function onPress() {}
|
|
97
|
+
}, ___EmotionJSX(Icon, {
|
|
98
|
+
icon: DotsVerticalIcon,
|
|
99
|
+
size: "sm"
|
|
100
|
+
}))
|
|
101
|
+
}
|
|
102
|
+
}, description, ___EmotionJSX(Link, {
|
|
93
103
|
href: "https://uilibrary.ping-eng.com/"
|
|
94
104
|
}, "Learn more"));
|
|
95
105
|
};
|
|
@@ -29,11 +29,11 @@ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present,
|
|
|
29
29
|
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); }
|
|
30
30
|
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
31
31
|
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; }
|
|
32
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
32
|
+
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; }
|
|
33
33
|
import React from 'react';
|
|
34
34
|
import userEvent from '@testing-library/user-event';
|
|
35
35
|
import * as themeHook from '../../hooks';
|
|
36
|
-
import { Link, PageHeader } from '../../index';
|
|
36
|
+
import { IconButton, Link, PageHeader } from '../../index';
|
|
37
37
|
import theme from '../../styles/theme';
|
|
38
38
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
|
39
39
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
@@ -57,8 +57,13 @@ var getComponent = function getComponent() {
|
|
|
57
57
|
universalComponentTests({
|
|
58
58
|
renderComponent: function renderComponent(props) {
|
|
59
59
|
return ___EmotionJSX(PageHeader, _extends({
|
|
60
|
-
title: "Title of the Page"
|
|
61
|
-
|
|
60
|
+
title: "Title of the Page",
|
|
61
|
+
slots: {
|
|
62
|
+
rightOfTitle: ___EmotionJSX(IconButton, {
|
|
63
|
+
"aria-label": "overflow menu"
|
|
64
|
+
}, ___EmotionJSX("span", null, "..."))
|
|
65
|
+
}
|
|
66
|
+
}, props), "some test");
|
|
62
67
|
}
|
|
63
68
|
});
|
|
64
69
|
test('renders default PageHeader', function () {
|
|
@@ -117,6 +122,55 @@ test('for default theme, it applies correct styles', function () {
|
|
|
117
122
|
});
|
|
118
123
|
expect(button).toHaveStyleRule('margin-left', '10px');
|
|
119
124
|
});
|
|
125
|
+
test('renders slots.rightOfTitle when provided', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
126
|
+
var onPress, overflowButton;
|
|
127
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
128
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
129
|
+
case 0:
|
|
130
|
+
onPress = jest.fn();
|
|
131
|
+
getComponent(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
132
|
+
slots: {
|
|
133
|
+
rightOfTitle: ___EmotionJSX(IconButton, {
|
|
134
|
+
"aria-label": "overflow menu",
|
|
135
|
+
onPress: onPress
|
|
136
|
+
}, ___EmotionJSX("span", null, "..."))
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
overflowButton = screen.getByRole('button', {
|
|
140
|
+
name: 'overflow menu'
|
|
141
|
+
});
|
|
142
|
+
expect(overflowButton).toBeInTheDocument();
|
|
143
|
+
_context2.next = 6;
|
|
144
|
+
return userEvent.tab();
|
|
145
|
+
case 6:
|
|
146
|
+
_context2.next = 8;
|
|
147
|
+
return userEvent.tab();
|
|
148
|
+
case 8:
|
|
149
|
+
expect(overflowButton).toHaveFocus();
|
|
150
|
+
_context2.next = 11;
|
|
151
|
+
return userEvent.click(overflowButton);
|
|
152
|
+
case 11:
|
|
153
|
+
expect(onPress).toHaveBeenCalled();
|
|
154
|
+
case 12:
|
|
155
|
+
case "end":
|
|
156
|
+
return _context2.stop();
|
|
157
|
+
}
|
|
158
|
+
}, _callee2);
|
|
159
|
+
})));
|
|
160
|
+
test('renders slots.rightOfTitle when there is no add button', function () {
|
|
161
|
+
getComponent({
|
|
162
|
+
title: 'test-title',
|
|
163
|
+
slots: {
|
|
164
|
+
rightOfTitle: ___EmotionJSX(IconButton, {
|
|
165
|
+
"aria-label": "overflow menu"
|
|
166
|
+
}, ___EmotionJSX("span", null, "..."))
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
var overflowButton = screen.getByRole('button', {
|
|
170
|
+
name: 'overflow menu'
|
|
171
|
+
});
|
|
172
|
+
expect(overflowButton).toBeInTheDocument();
|
|
173
|
+
});
|
|
120
174
|
test('for onyx theme, it applies correct styles', function () {
|
|
121
175
|
jest.spyOn(themeHook, 'useGetTheme').mockReturnValueOnce(_objectSpread(_objectSpread({}, theme), {}, {
|
|
122
176
|
pageHeaderTitleMargin: 'md',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["avatarProps", "children", "className", "data", "headerProps", "headerWrapperProps", "isCopyable", "slots", "subtextProps"];
|
|
4
|
+
var _excluded = ["avatarProps", "children", "className", "colorId", "data", "headerProps", "headerWrapperProps", "iconProps", "isCopyable", "slots", "subtextProps"];
|
|
5
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
|
|
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; }
|
|
7
7
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
8
8
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
9
9
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
@@ -16,18 +16,20 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
16
16
|
import React, { forwardRef } from 'react';
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
import { useGetTheme } from '../../hooks';
|
|
19
|
-
import { Avatar, Box, CopyText, Icon, Image, Text } from '../../index';
|
|
19
|
+
import { Avatar, Box, CopyText, Icon, IconWrapper, Image, Text } from '../../index';
|
|
20
20
|
import { SharedItemPropTypes } from '../ListViewItem/listViewItemAttributes';
|
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
22
|
export var PANEL_HEADER_ICON = '-panel-header-icon';
|
|
23
23
|
var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
|
-
var _context;
|
|
24
|
+
var _context, _context2;
|
|
25
25
|
var avatarProps = _ref.avatarProps,
|
|
26
26
|
children = _ref.children,
|
|
27
27
|
className = _ref.className,
|
|
28
|
+
colorId = _ref.colorId,
|
|
28
29
|
data = _ref.data,
|
|
29
30
|
headerProps = _ref.headerProps,
|
|
30
31
|
headerWrapperProps = _ref.headerWrapperProps,
|
|
32
|
+
iconProps = _ref.iconProps,
|
|
31
33
|
isCopyable = _ref.isCopyable,
|
|
32
34
|
slots = _ref.slots,
|
|
33
35
|
subtextProps = _ref.subtextProps,
|
|
@@ -51,13 +53,35 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
51
53
|
name: _concatInstanceProperty(_context = "".concat(text)).call(_context, PANEL_HEADER_ICON)
|
|
52
54
|
}
|
|
53
55
|
}));
|
|
56
|
+
var renderOnyxIcon = icon && ___EmotionJSX(Box, {
|
|
57
|
+
mr: "md"
|
|
58
|
+
}, ___EmotionJSX(IconWrapper, _extends({
|
|
59
|
+
icon: icon,
|
|
60
|
+
size: "sm",
|
|
61
|
+
title: {
|
|
62
|
+
name: _concatInstanceProperty(_context2 = "".concat(text)).call(_context2, PANEL_HEADER_ICON)
|
|
63
|
+
},
|
|
64
|
+
isCircle: true,
|
|
65
|
+
colorId: colorId || avatarDefaultText
|
|
66
|
+
}, avatarProps, {
|
|
67
|
+
iconProps: _objectSpread({
|
|
68
|
+
size: 'sm'
|
|
69
|
+
}, iconProps)
|
|
70
|
+
})));
|
|
54
71
|
var renderAvatar = ___EmotionJSX(Avatar, _extends({
|
|
55
|
-
src: image === null || image === void 0 ? void 0 : image.src,
|
|
56
|
-
isSquare: !!(image !== null && image !== void 0 && image.src),
|
|
57
72
|
size: "sm",
|
|
73
|
+
colorId: colorId,
|
|
58
74
|
defaultText: avatarDefaultText,
|
|
59
75
|
mr: "md"
|
|
60
76
|
}, avatarProps));
|
|
77
|
+
var renderOnyxImage = !icon && (image === null || image === void 0 ? void 0 : image.src) && ___EmotionJSX(Box, {
|
|
78
|
+
mr: "md"
|
|
79
|
+
}, ___EmotionJSX(Image, {
|
|
80
|
+
src: image.src,
|
|
81
|
+
alt: image.alt,
|
|
82
|
+
"aria-label": image['aria-label'],
|
|
83
|
+
variant: "images.avatar"
|
|
84
|
+
}));
|
|
61
85
|
var renderImage = !icon && image && ___EmotionJSX(Box, {
|
|
62
86
|
variant: "panelHeader.iconWrapper"
|
|
63
87
|
}, ___EmotionJSX(Image, {
|
|
@@ -70,6 +94,8 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
94
|
return slots.leftOfData;
|
|
71
95
|
}
|
|
72
96
|
if (isOnyx) {
|
|
97
|
+
if (icon) return renderOnyxIcon;
|
|
98
|
+
if (image !== null && image !== void 0 && image.src) return renderOnyxImage;
|
|
73
99
|
return renderAvatar;
|
|
74
100
|
}
|
|
75
101
|
if (icon) {
|
|
@@ -97,9 +123,9 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
97
123
|
textToCopy: subtext
|
|
98
124
|
}, ___EmotionJSX(Text, {
|
|
99
125
|
variant: "panelHeaderSubtext"
|
|
100
|
-
}, subtext)) : subtext && ___EmotionJSX(Text, {
|
|
126
|
+
}, subtext)) : subtext && ___EmotionJSX(Text, _extends({
|
|
101
127
|
variant: "panelHeaderSubtext"
|
|
102
|
-
}, subtext)));
|
|
128
|
+
}, subtextProps), subtext)));
|
|
103
129
|
return ___EmotionJSX(Box, _extends({
|
|
104
130
|
variant: "panelHeader.container",
|
|
105
131
|
className: className,
|
|
@@ -119,7 +145,9 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
119
145
|
}, children)));
|
|
120
146
|
});
|
|
121
147
|
PanelHeader.propTypes = _objectSpread(_objectSpread({}, SharedItemPropTypes), {}, {
|
|
148
|
+
colorId: PropTypes.string,
|
|
122
149
|
isCopyable: PropTypes.bool,
|
|
150
|
+
iconProps: PropTypes.object,
|
|
123
151
|
slots: PropTypes.shape({
|
|
124
152
|
rightOfData: PropTypes.node
|
|
125
153
|
})
|
|
@@ -6,7 +6,7 @@ import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
|
|
|
6
6
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
7
7
|
import { Box, Breadcrumbs, Item, PanelHeader, PanelHeaderCloseButton, PanelHeaderMenu, PanelHeaderSwitchField } from '../../index';
|
|
8
8
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks.ts';
|
|
9
|
-
import { pingImg,
|
|
9
|
+
import { pingImg, userImage } from '../../utils/devUtils/constants/images';
|
|
10
10
|
import { SharedItemArgTypes } from '../ListViewItem/listViewItemAttributes';
|
|
11
11
|
import PanelHeaderReadMe from './PanelHeader.mdx';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -25,6 +25,7 @@ export default {
|
|
|
25
25
|
export var Default = function Default(_ref) {
|
|
26
26
|
var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
27
27
|
return ___EmotionJSX(PanelHeader, _extends({}, args, {
|
|
28
|
+
colorId: "1111111111111111",
|
|
28
29
|
data: {
|
|
29
30
|
icon: AccountIcon,
|
|
30
31
|
text: 'Fons Vernall',
|
|
@@ -82,15 +83,12 @@ export var WithImage = function WithImage(args) {
|
|
|
82
83
|
return ___EmotionJSX(PanelHeader, _extends({}, args, {
|
|
83
84
|
data: {
|
|
84
85
|
image: {
|
|
85
|
-
src:
|
|
86
|
+
src: userImage,
|
|
86
87
|
alt: 'Ping Identity Logo',
|
|
87
88
|
'aria-label': 'Ping Identity Logo'
|
|
88
89
|
},
|
|
89
90
|
avatarDefaultText: 'FV',
|
|
90
91
|
text: 'Fons Vernall'
|
|
91
|
-
},
|
|
92
|
-
avatarProps: {
|
|
93
|
-
size: 'lg'
|
|
94
92
|
}
|
|
95
93
|
}));
|
|
96
94
|
};
|
|
@@ -111,7 +109,6 @@ export var WithAvatar = function WithAvatar(args) {
|
|
|
111
109
|
text: 'Fons Vernall'
|
|
112
110
|
},
|
|
113
111
|
avatarProps: {
|
|
114
|
-
size: 'lg',
|
|
115
112
|
isLogo: true
|
|
116
113
|
}
|
|
117
114
|
}));
|
|
@@ -30,12 +30,12 @@ function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
|
30
30
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
31
31
|
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
32
32
|
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; }
|
|
33
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
33
|
+
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; }
|
|
34
34
|
import React from 'react';
|
|
35
35
|
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
|
36
36
|
import { act } from '@testing-library/react';
|
|
37
37
|
import userEvent from '@testing-library/user-event';
|
|
38
|
-
import { AstroProvider, OnyxTheme, PanelHeader, PanelHeaderSwitchField } from '../../index';
|
|
38
|
+
import { AstroProvider, OnyxDarkTheme, OnyxTheme, PanelHeader, PanelHeaderSwitchField } from '../../index';
|
|
39
39
|
import { pingImg } from '../../utils/devUtils/constants/images';
|
|
40
40
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
|
41
41
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
|
@@ -66,8 +66,9 @@ jest.mock('../../hooks/useFallbackImage', function () {
|
|
|
66
66
|
});
|
|
67
67
|
var getComponentOnyx = function getComponentOnyx() {
|
|
68
68
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
69
|
+
var theme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OnyxTheme;
|
|
69
70
|
return render(___EmotionJSX(AstroProvider, {
|
|
70
|
-
themeOverrides: [
|
|
71
|
+
themeOverrides: [theme]
|
|
71
72
|
}, ___EmotionJSX(PanelHeader, _extends({}, defaultProps, props))));
|
|
72
73
|
};
|
|
73
74
|
|
|
@@ -224,10 +225,51 @@ test('renders leftOfData slot', function () {
|
|
|
224
225
|
});
|
|
225
226
|
screen.getByText(TEST_TEXT);
|
|
226
227
|
});
|
|
227
|
-
test('renders
|
|
228
|
+
test.each([['Onyx light', OnyxTheme], ['Onyx dark', OnyxDarkTheme]])('renders an 18px icon in %s PanelHeader avatars', function (_, theme) {
|
|
229
|
+
var _context4;
|
|
230
|
+
getComponentOnyx({
|
|
231
|
+
data: {
|
|
232
|
+
text: 'testText',
|
|
233
|
+
icon: AccountIcon,
|
|
234
|
+
avatarDefaultText: 'AA'
|
|
235
|
+
},
|
|
236
|
+
avatarProps: {
|
|
237
|
+
color: 'green'
|
|
238
|
+
},
|
|
239
|
+
iconProps: {
|
|
240
|
+
'data-testid': 'panel-header-icon'
|
|
241
|
+
}
|
|
242
|
+
}, theme);
|
|
243
|
+
var icon = screen.getByRole('img', {
|
|
244
|
+
name: _concatInstanceProperty(_context4 = "".concat(defaultProps.data.text)).call(_context4, PANEL_HEADER_ICON)
|
|
245
|
+
});
|
|
246
|
+
expect(icon).toHaveStyleRule('width', '18px');
|
|
247
|
+
expect(icon).toHaveStyleRule('height', '18px');
|
|
248
|
+
expect(icon).toHaveAttribute('data-testid', 'panel-header-icon');
|
|
249
|
+
});
|
|
250
|
+
test('forwards iconProps to the Onyx avatar icon', function () {
|
|
251
|
+
getComponentOnyx({
|
|
252
|
+
data: {
|
|
253
|
+
text: 'testText',
|
|
254
|
+
icon: AccountIcon
|
|
255
|
+
},
|
|
256
|
+
avatarProps: {
|
|
257
|
+
color: 'green'
|
|
258
|
+
},
|
|
259
|
+
iconProps: {
|
|
260
|
+
'aria-label': 'custom panel icon'
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
expect(screen.getByLabelText('custom panel icon')).toBeInTheDocument();
|
|
264
|
+
});
|
|
265
|
+
test('renders image avatars in Onyx', function () {
|
|
228
266
|
getComponentOnyx();
|
|
267
|
+
act(function () {
|
|
268
|
+
fallbackImageObj.onImageLoad();
|
|
269
|
+
});
|
|
229
270
|
var image = screen.getByRole('img');
|
|
230
271
|
expect(image.tagName.toLowerCase()).toBe('img');
|
|
231
272
|
expect(image).toHaveAttribute('src', pingImg);
|
|
232
|
-
expect(image).toHaveAttribute('alt', '
|
|
273
|
+
expect(image).toHaveAttribute('alt', 'avatar');
|
|
274
|
+
expect(image).toHaveAttribute('aria-label', 'avatar');
|
|
233
275
|
});
|
|
@@ -73,7 +73,7 @@ var RangeCalendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
73
73
|
nextButtonProps: nextButtonProps
|
|
74
74
|
}), ___EmotionJSX(Box, {
|
|
75
75
|
isRow: true,
|
|
76
|
-
gap: "
|
|
76
|
+
gap: "lg"
|
|
77
77
|
}, ___EmotionJSX(RangeCalendarGrid, {
|
|
78
78
|
state: state
|
|
79
79
|
}), ___EmotionJSX(RangeCalendarGrid, {
|
|
@@ -16,6 +16,10 @@ This component is built on [useRangeCalendar](https://react-spectrum.adobe.com/r
|
|
|
16
16
|
|
|
17
17
|
This component can be used independently and does not require additional components.
|
|
18
18
|
|
|
19
|
+
### Usage in a popup
|
|
20
|
+
|
|
21
|
+
When RangeCalendar is displayed inside a popup (such as a popover or date picker overlay), the popup container should include a popover shadow to visually separate it from the page content.
|
|
22
|
+
|
|
19
23
|
### Accessibility
|
|
20
24
|
|
|
21
25
|
<AccessibilityTable keyboardRows={[
|
|
@@ -287,6 +287,36 @@ test('parseDateIfString should correctly parse string or DateValue inputs', func
|
|
|
287
287
|
expect(result1).toEqual(new CalendarDate(2022, 8, 1));
|
|
288
288
|
expect(result2).toEqual(new CalendarDate(2022, 8, 10));
|
|
289
289
|
});
|
|
290
|
+
test('disabled calendar applies is-disabled class to weekday column headers', function () {
|
|
291
|
+
getComponent({
|
|
292
|
+
isDisabled: true
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
// RangeCalendarGrid passes isDisabled to TableCell; Box applies the is-disabled class
|
|
296
|
+
var columnHeaders = screen.getAllByRole('columnheader', {
|
|
297
|
+
hidden: true
|
|
298
|
+
});
|
|
299
|
+
expect(columnHeaders).toHaveLength(14);
|
|
300
|
+
_forEachInstanceProperty(columnHeaders).call(columnHeaders, function (header) {
|
|
301
|
+
expect(header).toHaveClass('is-disabled');
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
test('disabled calendar renders month name headings with disabled state', function () {
|
|
305
|
+
getComponent({
|
|
306
|
+
isDisabled: true
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// RangeCalendarHeader applies sx={{ color: state.isDisabled ? 'text.secondary' : undefined }}
|
|
310
|
+
// to the month name Text elements (role="heading", aria-level={3}, aria-hidden)
|
|
311
|
+
var monthHeadings = screen.getAllByRole('heading', {
|
|
312
|
+
level: 3,
|
|
313
|
+
hidden: true
|
|
314
|
+
});
|
|
315
|
+
expect(monthHeadings).toHaveLength(2);
|
|
316
|
+
_forEachInstanceProperty(monthHeadings).call(monthHeadings, function (heading) {
|
|
317
|
+
expect(heading).toBeInTheDocument();
|
|
318
|
+
});
|
|
319
|
+
});
|
|
290
320
|
test('should allow selecting a range spanning more than 2 months with minValue constraint', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
291
321
|
var minValue, buttons, cellsAfterNavigation, octFirstCell, cellsInJuly, julyFifthCell, selectedCells;
|
|
292
322
|
return _regeneratorRuntime().wrap(function _callee6$(_context7) {
|
|
@@ -35,6 +35,7 @@ var RangeCalendarGrid = function RangeCalendarGrid(props) {
|
|
|
35
35
|
return ___EmotionJSX(Table, gridProps, ___EmotionJSX(TableHead, headerProps, ___EmotionJSX(TableRow, null, _mapInstanceProperty(weekDays).call(weekDays, function (day, index) {
|
|
36
36
|
return ___EmotionJSX(TableCell, {
|
|
37
37
|
isHeading: true,
|
|
38
|
+
isDisabled: state.isDisabled,
|
|
38
39
|
variant: "rangeCalendar.columnHeader",
|
|
39
40
|
key: getKey(day, index),
|
|
40
41
|
role: "columnheader"
|
|
@@ -154,6 +154,19 @@ export var Default = function Default(args) {
|
|
|
154
154
|
key: "yellow"
|
|
155
155
|
}, "Yellow")));
|
|
156
156
|
};
|
|
157
|
+
export var DefaultOpen = function DefaultOpen() {
|
|
158
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, {
|
|
159
|
+
width: "100%",
|
|
160
|
+
isDefaultOpen: true,
|
|
161
|
+
label: "Example Label"
|
|
162
|
+
}, ___EmotionJSX(Item, {
|
|
163
|
+
key: "red"
|
|
164
|
+
}, "Red"), ___EmotionJSX(Item, {
|
|
165
|
+
key: "blue"
|
|
166
|
+
}, "Blue"), ___EmotionJSX(Item, {
|
|
167
|
+
key: "yellow"
|
|
168
|
+
}, "Yellow")));
|
|
169
|
+
};
|
|
157
170
|
export var WithSections = function WithSections(args) {
|
|
158
171
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, _extends({
|
|
159
172
|
items: withSection
|