@pingux/astro 2.91.0 → 2.92.0-alpha.1
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/Card/Card.stories.js +2 -1
- package/lib/cjs/components/Card/Card.styles.d.ts +12 -0
- package/lib/cjs/components/Card/Card.styles.js +2 -1
- package/lib/cjs/components/CodeView/CodeView.js +7 -3
- package/lib/cjs/components/CodeView/CodeView.test.js +11 -4
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +5 -2
- package/lib/cjs/components/DataTable/DataTable.js +42 -14
- package/lib/cjs/components/DataTable/DataTable.stories.d.ts +32 -0
- package/lib/cjs/components/DataTable/DataTable.stories.js +204 -14
- package/lib/cjs/components/DataTable/DataTable.styles.d.ts +29 -0
- package/lib/cjs/components/DataTable/DataTable.styles.js +17 -0
- package/lib/cjs/components/DataTable/DataTable.test.js +144 -2
- package/lib/cjs/components/Icon/NoticeIcon.js +4 -1
- package/lib/cjs/components/IconWrapper/IconWrapper.d.ts +4 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.js +62 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.mdx +14 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.stories.d.ts +4 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.stories.js +53 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.test.d.ts +1 -0
- package/lib/cjs/components/IconWrapper/IconWrapper.test.js +41 -0
- package/lib/cjs/components/IconWrapper/iconWrapperAttributes.d.ts +21 -0
- package/lib/cjs/components/IconWrapper/iconWrapperAttributes.js +31 -0
- package/lib/cjs/components/IconWrapper/index.d.ts +1 -0
- package/lib/cjs/components/IconWrapper/index.js +14 -0
- package/lib/cjs/components/Link/Link.stories.js +1 -1
- package/lib/cjs/components/ListView/ListViewExpandableItem.js +6 -3
- package/lib/cjs/components/NavBar/NavBar.stories.js +10 -3
- package/lib/cjs/components/NavBarSection/NavBarItemBody.js +4 -1
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +6 -4
- package/lib/cjs/components/NavSideBar/NavSideBarSectionHeader.js +6 -3
- package/lib/cjs/components/NavigationHeader/NavigationHeader.stories.js +15 -16
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +5 -1
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +5 -2
- package/lib/cjs/components/Tabs/Tabs.stories.js +3 -3
- package/lib/cjs/hooks/index.d.ts +1 -0
- package/lib/cjs/hooks/index.js +7 -0
- package/lib/cjs/hooks/useGetTheme/index.d.ts +1 -0
- package/lib/cjs/hooks/useGetTheme/index.js +14 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +26 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.js +82 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.test.d.ts +1 -0
- package/lib/cjs/hooks/useGetTheme/useGetTheme.test.js +88 -0
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.js +5 -3
- package/lib/cjs/hooks/useTShirtSize/useTShirtSize.test.js +17 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.js +77 -50
- package/lib/cjs/recipes/NextGen/ListViewNextGen.stories.js +6 -135
- package/lib/cjs/recipes/NextGen/ModalNextGen.stories.js +8 -7
- package/lib/cjs/recipes/NextGen/NavBarNextGen.stories.js +2 -216
- package/lib/cjs/recipes/NextGen/NextGenDataTable.stories.js +2 -135
- package/lib/cjs/styles/sizes.d.ts +12 -0
- package/lib/cjs/styles/sizes.js +19 -0
- package/lib/cjs/styles/theme.js +4 -12
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +75 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +97 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +7 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.js +24 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +11 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.js +24 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/index.d.ts +1 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/index.js +14 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/nextGenDarkModeOverride.d.ts +2 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/nextGenDarkModeOverride.js +31 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkDataTable.chomatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkDataTable.chomatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkNavStory.chomatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkNavStory.chomatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkStickerSheet.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkStickerSheet.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/avatar.d.ts +43 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/avatar.js +51 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.d.ts +92 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/badges.js +96 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +82 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +105 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.d.ts +15 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/cards.js +23 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.d.ts +68 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.js +71 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/iconBadge.d.ts +53 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/iconBadge.js +75 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/input.d.ts +8 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/input.js +35 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/links.d.ts +40 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/links.js +47 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/lsitview.d.ts +24 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/lsitview.js +33 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.d.ts +26 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/menu.js +35 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/message.d.ts +52 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/message.js +60 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/navbar.d.ts +132 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/navbar.js +149 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +375 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +71 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +8 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.js +23 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +12 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.js +15 -0
- package/lib/cjs/styles/themes/astro/customProperties/styles.d.ts +4 -0
- package/lib/cjs/styles/themes/astro/customProperties/styles.js +11 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +36 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.js +22 -4
- package/lib/cjs/styles/themes/next-gen/colors/iconWrapper.d.ts +22 -0
- package/lib/cjs/styles/themes/next-gen/colors/iconWrapper.js +31 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +11 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +15 -4
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +8 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +23 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +12 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/index.js +15 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/styles.d.ts +4 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/styles.js +11 -0
- package/lib/cjs/styles/themes/next-gen/forms.js +3 -3
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +244 -8
- package/lib/cjs/styles/themes/next-gen/next-gen.js +5 -9
- package/lib/cjs/styles/themes/next-gen/sizes.d.ts +7 -0
- package/lib/cjs/styles/themes/next-gen/sizes.js +10 -1
- package/lib/cjs/styles/themes/next-gen/stories/DataTableNextGenComponent.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/stories/DataTableNextGenComponent.js +151 -0
- package/lib/cjs/styles/themes/next-gen/stories/ListViewItemNextGen.d.ts +29 -0
- package/lib/cjs/styles/themes/next-gen/stories/ListViewItemNextGen.js +84 -0
- package/lib/cjs/styles/themes/next-gen/stories/ListViewNextGenComponent.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/stories/ListViewNextGenComponent.js +67 -0
- package/lib/cjs/styles/themes/next-gen/stories/NavBarNextGenComponent.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/stories/NavBarNextGenComponent.js +191 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenDataTable.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenDataTable.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenListView.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenListView.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenListViewItem.stories.d.ts +7 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenListViewItem.stories.js +36 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenNavBar.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenNavBar.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenStickerSheet.chromatic.stories.d.ts +6 -0
- package/lib/cjs/styles/themes/next-gen/stories/NextGenStickerSheet.chromatic.stories.js +22 -0
- package/lib/cjs/styles/themes/next-gen/stories/StickerSheetComponent.d.ts +3 -0
- package/lib/cjs/styles/themes/next-gen/stories/StickerSheetComponent.js +286 -0
- package/lib/cjs/styles/themes/next-gen/variants/avatar.d.ts +43 -0
- package/lib/cjs/styles/themes/next-gen/variants/avatar.js +51 -0
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +208 -0
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +103 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.js +5 -4
- package/lib/cjs/styles/themes/next-gen/variants/cards.d.ts +40 -0
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +22 -2
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.d.ts +36 -0
- package/lib/cjs/styles/themes/next-gen/variants/iconWrapper.js +51 -0
- package/lib/cjs/styles/themes/next-gen/variants/input.js +9 -9
- package/lib/cjs/styles/themes/next-gen/variants/label.js +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/links.d.ts +75 -0
- package/lib/cjs/styles/themes/next-gen/variants/links.js +7 -1
- package/lib/cjs/styles/themes/next-gen/variants/listview.d.ts +68 -0
- package/lib/cjs/styles/themes/next-gen/variants/listview.js +77 -0
- package/lib/cjs/styles/themes/next-gen/variants/menu.d.ts +28 -0
- package/lib/cjs/styles/themes/next-gen/variants/menu.js +37 -0
- package/lib/cjs/styles/themes/next-gen/variants/messages.d.ts +40 -0
- package/lib/cjs/styles/themes/next-gen/variants/messages.js +48 -0
- package/lib/cjs/styles/themes/next-gen/variants/navbar.d.ts +126 -0
- package/lib/cjs/styles/themes/next-gen/variants/navbar.js +134 -0
- package/lib/cjs/styles/themes/next-gen/variants/navigationHeader.d.ts +3 -1
- package/lib/cjs/styles/themes/next-gen/variants/navigationHeader.js +6 -4
- package/lib/cjs/styles/themes/next-gen/variants/tabs.d.ts +28 -0
- package/lib/cjs/styles/themes/next-gen/variants/tabs.js +38 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +11 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.js +18 -7
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +71 -7
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +38 -338
- package/lib/cjs/types/dataTable.d.ts +4 -0
- package/lib/cjs/types/iconWrapper.d.ts +15 -0
- package/lib/cjs/types/iconWrapper.js +6 -0
- package/lib/cjs/utils/devUtils/constants/logos.d.ts +3 -0
- package/lib/cjs/utils/devUtils/constants/logos.js +84 -0
- package/lib/cjs/utils/devUtils/constants/tShirtSizes.d.ts +11 -0
- package/lib/cjs/utils/devUtils/constants/tShirtSizes.js +8 -2
- package/lib/cjs/utils/devUtils/constants/themes.d.ts +5 -0
- package/lib/cjs/utils/devUtils/constants/themes.js +13 -0
- package/lib/cjs/utils/devUtils/shouldReturnComingSoon.d.ts +1 -0
- package/lib/cjs/utils/devUtils/shouldReturnComingSoon.js +41 -0
- package/lib/cjs/utils/docUtils/iconSizeProps.d.ts +1 -1
- package/lib/cjs/utils/docUtils/iconSizeProps.js +1 -1
- package/lib/cjs/utils/testUtils/testWrapper.d.ts +4 -2
- package/lib/cjs/utils/testUtils/testWrapper.js +10 -4
- package/lib/components/Card/Card.stories.js +2 -1
- package/lib/components/Card/Card.styles.js +1 -1
- package/lib/components/CodeView/CodeView.js +7 -3
- package/lib/components/CodeView/CodeView.test.js +12 -5
- package/lib/components/ComboBox/ComboBoxInput.js +4 -1
- package/lib/components/DataTable/DataTable.js +42 -14
- package/lib/components/DataTable/DataTable.stories.js +201 -13
- package/lib/components/DataTable/DataTable.styles.js +17 -0
- package/lib/components/DataTable/DataTable.test.js +141 -2
- package/lib/components/Icon/NoticeIcon.js +4 -1
- package/lib/components/IconWrapper/IconWrapper.js +50 -0
- package/lib/components/IconWrapper/IconWrapper.mdx +14 -0
- package/lib/components/IconWrapper/IconWrapper.stories.js +44 -0
- package/lib/components/IconWrapper/IconWrapper.test.js +38 -0
- package/lib/components/IconWrapper/iconWrapperAttributes.js +23 -0
- package/lib/components/IconWrapper/index.js +1 -0
- package/lib/components/Link/Link.stories.js +2 -2
- package/lib/components/ListView/ListViewExpandableItem.js +6 -3
- package/lib/components/NavBar/NavBar.stories.js +10 -3
- package/lib/components/NavBarSection/NavBarItemBody.js +4 -1
- package/lib/components/NavBarSection/NavBarItemHeader.js +5 -3
- package/lib/components/NavSideBar/NavSideBarSectionHeader.js +5 -2
- package/lib/components/NavigationHeader/NavigationHeader.stories.js +17 -18
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +5 -1
- package/lib/components/SelectFieldBase/SelectFieldBase.js +4 -1
- package/lib/components/Tabs/Tabs.stories.js +3 -3
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useGetTheme/index.js +1 -0
- package/lib/hooks/useGetTheme/useGetTheme.js +74 -0
- package/lib/hooks/useGetTheme/useGetTheme.test.js +81 -0
- package/lib/hooks/useTShirtSize/useTShirtSize.js +5 -3
- package/lib/hooks/useTShirtSize/useTShirtSize.test.js +17 -0
- package/lib/index.js +3 -3
- package/lib/recipes/NextGen/ListViewNextGen.stories.js +5 -134
- package/lib/recipes/NextGen/ModalNextGen.stories.js +9 -8
- package/lib/recipes/NextGen/NavBarNextGen.stories.js +2 -216
- package/lib/recipes/NextGen/NextGenDataTable.stories.js +2 -135
- package/lib/styles/sizes.js +11 -0
- package/lib/styles/theme.js +4 -12
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +88 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/customProperties/icons.js +16 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/customProperties/index.js +16 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/index.js +1 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/nextGenDarkModeOverride.js +22 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkDataTable.chomatic.stories.js +12 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkListView.chromatic.stories.js +12 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkNavStory.chomatic.stories.js +12 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/stories/NextGenDarkStickerSheet.chromatic.stories.js +12 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/avatar.js +43 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/badges.js +88 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +97 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/cards.js +15 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/forms.js +60 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/iconBadge.js +67 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/input.js +26 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/links.js +39 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/lsitview.js +24 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/menu.js +26 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/message.js +52 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/navbar.js +141 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +62 -0
- package/lib/styles/themes/astro/customProperties/icons.js +14 -0
- package/lib/styles/themes/astro/customProperties/index.js +6 -0
- package/lib/styles/themes/astro/customProperties/styles.js +3 -0
- package/lib/styles/themes/next-gen/colors/colors.js +22 -4
- package/lib/styles/themes/next-gen/colors/iconWrapper.js +23 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +12 -2
- package/lib/styles/themes/next-gen/customProperties/icons.js +14 -0
- package/lib/styles/themes/next-gen/customProperties/index.js +6 -0
- package/lib/styles/themes/next-gen/customProperties/styles.js +3 -0
- package/lib/styles/themes/next-gen/forms.js +3 -3
- package/lib/styles/themes/next-gen/next-gen.js +4 -5
- package/lib/styles/themes/next-gen/sizes.js +10 -1
- package/lib/styles/themes/next-gen/stories/DataTableNextGenComponent.js +141 -0
- package/lib/styles/themes/next-gen/stories/ListViewItemNextGen.js +75 -0
- package/lib/styles/themes/next-gen/stories/ListViewNextGenComponent.js +58 -0
- package/lib/styles/themes/next-gen/stories/NavBarNextGenComponent.js +182 -0
- package/lib/styles/themes/next-gen/stories/NextGenDataTable.chromatic.stories.js +12 -0
- package/lib/styles/themes/next-gen/stories/NextGenListView.chromatic.stories.js +12 -0
- package/lib/styles/themes/next-gen/stories/NextGenListViewItem.stories.js +26 -0
- package/lib/styles/themes/next-gen/stories/NextGenNavBar.chromatic.stories.js +12 -0
- package/lib/styles/themes/next-gen/stories/NextGenStickerSheet.chromatic.stories.js +12 -0
- package/lib/styles/themes/next-gen/stories/StickerSheetComponent.js +277 -0
- package/lib/styles/themes/next-gen/variants/avatar.js +43 -0
- package/lib/styles/themes/next-gen/variants/badges.js +94 -0
- package/lib/styles/themes/next-gen/variants/button.js +5 -4
- package/lib/styles/themes/next-gen/variants/cards.js +21 -2
- package/lib/styles/themes/next-gen/variants/iconWrapper.js +43 -0
- package/lib/styles/themes/next-gen/variants/input.js +9 -9
- package/lib/styles/themes/next-gen/variants/label.js +1 -1
- package/lib/styles/themes/next-gen/variants/links.js +7 -1
- package/lib/styles/themes/next-gen/variants/listview.js +68 -0
- package/lib/styles/themes/next-gen/variants/menu.js +28 -0
- package/lib/styles/themes/next-gen/variants/messages.js +40 -0
- package/lib/styles/themes/next-gen/variants/navbar.js +124 -0
- package/lib/styles/themes/next-gen/variants/navigationHeader.js +6 -4
- package/lib/styles/themes/next-gen/variants/tabs.js +28 -0
- package/lib/styles/themes/next-gen/variants/text.js +18 -7
- package/lib/styles/themes/next-gen/variants/variants.js +31 -331
- package/lib/types/iconWrapper.js +1 -0
- package/lib/utils/devUtils/constants/logos.js +74 -0
- package/lib/utils/devUtils/constants/tShirtSizes.js +5 -0
- package/lib/utils/devUtils/constants/themes.js +5 -0
- package/lib/utils/devUtils/shouldReturnComingSoon.js +27 -0
- package/lib/utils/docUtils/iconSizeProps.js +1 -1
- package/lib/utils/testUtils/testWrapper.js +10 -4
- package/package.json +1 -1
@@ -22,9 +22,9 @@ import _parseFloat from "@babel/runtime-corejs3/core-js-stable/parse-float";
|
|
22
22
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
23
23
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
24
24
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
25
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context7; _forEachInstanceProperty(_context7 = ["next", "throw", "return"]).call(_context7, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context8; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context8 = this.tryEntries).call(_context8, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
25
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context8; _forEachInstanceProperty(_context8 = ["next", "throw", "return"]).call(_context8, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context9; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context9 = this.tryEntries).call(_context9, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
26
26
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
27
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context6, _context7; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context6 = ownKeys(Object(source), !0)).call(_context6, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context7 = ownKeys(Object(source))).call(_context7, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
28
28
|
import React, { useEffect, useState } from 'react';
|
29
29
|
import { useAsyncList } from 'react-stately';
|
30
30
|
import { useCollator } from '@react-aria/i18n';
|
@@ -58,6 +58,36 @@ export default {
|
|
58
58
|
disable: true
|
59
59
|
}
|
60
60
|
},
|
61
|
+
selectedKeys: {
|
62
|
+
description: 'The array of keys that is currently selected. (Controlled version).',
|
63
|
+
control: {
|
64
|
+
disable: true
|
65
|
+
}
|
66
|
+
},
|
67
|
+
disabledKeys: {
|
68
|
+
description: 'The array of keys that are unabled to be selected.',
|
69
|
+
control: {
|
70
|
+
disable: true
|
71
|
+
}
|
72
|
+
},
|
73
|
+
defaultSelectedKeys: {
|
74
|
+
description: 'The array of keys that is selected by default. (Uncontrolled version).',
|
75
|
+
control: {
|
76
|
+
disable: true
|
77
|
+
}
|
78
|
+
},
|
79
|
+
onSelectionChange: {
|
80
|
+
description: 'A callback function that fires when the selection changes.',
|
81
|
+
control: {
|
82
|
+
disable: true
|
83
|
+
}
|
84
|
+
},
|
85
|
+
selectionMode: {
|
86
|
+
description: 'Options are "none" and "single". Whether or not the DataTable support selection',
|
87
|
+
control: {
|
88
|
+
disable: true
|
89
|
+
}
|
90
|
+
},
|
61
91
|
width: {
|
62
92
|
description: 'Sets the width of the data table.',
|
63
93
|
control: {
|
@@ -470,6 +500,164 @@ Sortable.parameters = {
|
|
470
500
|
}
|
471
501
|
}
|
472
502
|
};
|
503
|
+
export var Selection = function Selection(args) {
|
504
|
+
var columns = [{
|
505
|
+
name: 'Country',
|
506
|
+
key: 'country'
|
507
|
+
}, {
|
508
|
+
name: 'Population',
|
509
|
+
key: 'population'
|
510
|
+
}, {
|
511
|
+
name: 'Continent',
|
512
|
+
key: 'continent'
|
513
|
+
}];
|
514
|
+
var rows = [{
|
515
|
+
id: 1,
|
516
|
+
country: 'USA',
|
517
|
+
population: '320,000,000',
|
518
|
+
continent: 'North America'
|
519
|
+
}, {
|
520
|
+
id: 2,
|
521
|
+
country: 'Canada',
|
522
|
+
population: '37,000,000',
|
523
|
+
continent: 'North America'
|
524
|
+
}, {
|
525
|
+
id: 3,
|
526
|
+
country: 'China',
|
527
|
+
population: '1,398,000,000',
|
528
|
+
continent: 'Asia'
|
529
|
+
}, {
|
530
|
+
id: 4,
|
531
|
+
country: 'France',
|
532
|
+
population: '67,000,000',
|
533
|
+
continent: 'Europe'
|
534
|
+
}, {
|
535
|
+
id: 5,
|
536
|
+
country: 'Mexico',
|
537
|
+
population: '126,000,000',
|
538
|
+
continent: 'South America'
|
539
|
+
}, {
|
540
|
+
id: 6,
|
541
|
+
country: 'Ethiopia',
|
542
|
+
population: '120,000,000',
|
543
|
+
continent: 'Africa'
|
544
|
+
}, {
|
545
|
+
id: 7,
|
546
|
+
country: 'Austria',
|
547
|
+
population: '25,000,000',
|
548
|
+
continent: 'Oceania'
|
549
|
+
}];
|
550
|
+
return ___EmotionJSX(DataTable, _extends({}, args, {
|
551
|
+
"aria-label": "Dynamic table",
|
552
|
+
density: "compact",
|
553
|
+
scale: "medium",
|
554
|
+
selectionMode: "single",
|
555
|
+
disabledKeys: [3],
|
556
|
+
defaultSelectedKeys: [1]
|
557
|
+
}), ___EmotionJSX(DataTableHeader, {
|
558
|
+
columns: columns
|
559
|
+
}, function (column) {
|
560
|
+
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, 'center'), {
|
561
|
+
minWidth: 155
|
562
|
+
}), column.name);
|
563
|
+
}), ___EmotionJSX(DataTableBody, {
|
564
|
+
items: rows
|
565
|
+
}, function (item) {
|
566
|
+
return ___EmotionJSX(DataTableRow, null, function (columnKey) {
|
567
|
+
return ___EmotionJSX(DataTableCell, getCellProps(columnKey, 'left'), item[columnKey]);
|
568
|
+
});
|
569
|
+
}));
|
570
|
+
};
|
571
|
+
export var ControlledSelection = function ControlledSelection(args) {
|
572
|
+
var _useState3 = useState([2]),
|
573
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
574
|
+
selectedKeys = _useState4[0],
|
575
|
+
setSelectedKeys = _useState4[1];
|
576
|
+
var columns = [{
|
577
|
+
name: 'Country',
|
578
|
+
key: 'country'
|
579
|
+
}, {
|
580
|
+
name: 'Population',
|
581
|
+
key: 'population'
|
582
|
+
}, {
|
583
|
+
name: 'Continent',
|
584
|
+
key: 'continent'
|
585
|
+
}];
|
586
|
+
var rows = [{
|
587
|
+
id: 1,
|
588
|
+
country: 'USA',
|
589
|
+
population: '320,000,000',
|
590
|
+
continent: 'North America'
|
591
|
+
}, {
|
592
|
+
id: 2,
|
593
|
+
country: 'Canada',
|
594
|
+
population: '37,000,000',
|
595
|
+
continent: 'North America'
|
596
|
+
}, {
|
597
|
+
id: 3,
|
598
|
+
country: 'China',
|
599
|
+
population: '1,398,000,000',
|
600
|
+
continent: 'Asia'
|
601
|
+
}, {
|
602
|
+
id: 4,
|
603
|
+
country: 'France',
|
604
|
+
population: '67,000,000',
|
605
|
+
continent: 'Europe'
|
606
|
+
}, {
|
607
|
+
id: 5,
|
608
|
+
country: 'Mexico',
|
609
|
+
population: '126,000,000',
|
610
|
+
continent: 'South America'
|
611
|
+
}, {
|
612
|
+
id: 6,
|
613
|
+
country: 'Ethiopia',
|
614
|
+
population: '120,000,000',
|
615
|
+
continent: 'Africa'
|
616
|
+
}, {
|
617
|
+
id: 7,
|
618
|
+
country: 'Austria',
|
619
|
+
population: '25,000,000',
|
620
|
+
continent: 'Oceania'
|
621
|
+
}];
|
622
|
+
var list = useAsyncList({
|
623
|
+
load: function load() {
|
624
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
625
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
626
|
+
while (1) switch (_context4.prev = _context4.next) {
|
627
|
+
case 0:
|
628
|
+
return _context4.abrupt("return", {
|
629
|
+
items: rows
|
630
|
+
});
|
631
|
+
case 1:
|
632
|
+
case "end":
|
633
|
+
return _context4.stop();
|
634
|
+
}
|
635
|
+
}, _callee4);
|
636
|
+
}))();
|
637
|
+
}
|
638
|
+
});
|
639
|
+
return ___EmotionJSX(DataTable, _extends({}, args, {
|
640
|
+
"aria-label": "Dynamic table",
|
641
|
+
density: "compact",
|
642
|
+
scale: "medium",
|
643
|
+
selectionMode: "single",
|
644
|
+
disabledKeys: [3],
|
645
|
+
selectedKeys: selectedKeys,
|
646
|
+
onSelectionChange: setSelectedKeys
|
647
|
+
}), ___EmotionJSX(DataTableHeader, {
|
648
|
+
columns: columns
|
649
|
+
}, function (column) {
|
650
|
+
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, 'center'), {
|
651
|
+
minWidth: 155
|
652
|
+
}), column.name);
|
653
|
+
}), ___EmotionJSX(DataTableBody, {
|
654
|
+
items: list.items
|
655
|
+
}, function (item) {
|
656
|
+
return ___EmotionJSX(DataTableRow, null, function (columnKey) {
|
657
|
+
return ___EmotionJSX(DataTableCell, getCellProps(columnKey, 'left'), item[columnKey]);
|
658
|
+
});
|
659
|
+
}));
|
660
|
+
};
|
473
661
|
export var AsyncLoading = function AsyncLoading(args) {
|
474
662
|
/**
|
475
663
|
* isChromatic checks if the code is running in Chromatic environment
|
@@ -492,40 +680,40 @@ export var AsyncLoading = function AsyncLoading(args) {
|
|
492
680
|
}];
|
493
681
|
var list = useAsyncList({
|
494
682
|
load: function load(_ref2) {
|
495
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
683
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
496
684
|
var signal, cursor, res, json;
|
497
|
-
return _regeneratorRuntime().wrap(function
|
498
|
-
while (1) switch (
|
685
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
686
|
+
while (1) switch (_context5.prev = _context5.next) {
|
499
687
|
case 0:
|
500
688
|
signal = _ref2.signal, cursor = _ref2.cursor;
|
501
689
|
if (cursor) {
|
502
690
|
// eslint-disable-next-line no-param-reassign
|
503
691
|
cursor = cursor.replace(/^http:\/\//i, 'https://');
|
504
692
|
}
|
505
|
-
|
693
|
+
_context5.next = 4;
|
506
694
|
return fetch(cursor || 'https://swapi.py4e.com/api/people/?search=', {
|
507
695
|
signal: signal
|
508
696
|
});
|
509
697
|
case 4:
|
510
|
-
res =
|
511
|
-
|
698
|
+
res = _context5.sent;
|
699
|
+
_context5.next = 7;
|
512
700
|
return res.json();
|
513
701
|
case 7:
|
514
|
-
json =
|
515
|
-
|
702
|
+
json = _context5.sent;
|
703
|
+
_context5.next = 10;
|
516
704
|
return new _Promise(function (resolve) {
|
517
705
|
return _setTimeout(resolve, cursor ? 2000 : 3000);
|
518
706
|
});
|
519
707
|
case 10:
|
520
|
-
return
|
708
|
+
return _context5.abrupt("return", {
|
521
709
|
items: json.results,
|
522
710
|
cursor: json.next
|
523
711
|
});
|
524
712
|
case 11:
|
525
713
|
case "end":
|
526
|
-
return
|
714
|
+
return _context5.stop();
|
527
715
|
}
|
528
|
-
},
|
716
|
+
}, _callee5);
|
529
717
|
}))();
|
530
718
|
}
|
531
719
|
});
|
@@ -61,6 +61,22 @@ var tableRow = {
|
|
61
61
|
backgroundColor: 'white'
|
62
62
|
}
|
63
63
|
};
|
64
|
+
var selectableTableRow = _objectSpread(_objectSpread({}, tableRow), {}, {
|
65
|
+
bg: 'accent.99',
|
66
|
+
'&.is-selected': {
|
67
|
+
bg: 'white'
|
68
|
+
},
|
69
|
+
'&.is-hovered': {
|
70
|
+
bg: 'white',
|
71
|
+
cursor: 'pointer'
|
72
|
+
},
|
73
|
+
'&.is-focused': {
|
74
|
+
boxShadow: '0 0 0 1px inset #D033FF'
|
75
|
+
},
|
76
|
+
'&.is-disabled': {
|
77
|
+
opacity: '0.5 !important'
|
78
|
+
}
|
79
|
+
});
|
64
80
|
var tableHeadWrapper = {
|
65
81
|
borderLeftWidth: '0px',
|
66
82
|
borderLeftStyle: 'solid',
|
@@ -137,6 +153,7 @@ var tableMenu = {
|
|
137
153
|
mr: 'md'
|
138
154
|
};
|
139
155
|
export default {
|
156
|
+
selectableTableRow: selectableTableRow,
|
140
157
|
tableBody: tableBody,
|
141
158
|
tableHeadWrapper: tableHeadWrapper,
|
142
159
|
tableCenteredWrapper: tableCenteredWrapper,
|
@@ -16,8 +16,9 @@ import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object
|
|
16
16
|
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
17
17
|
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
18
18
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
19
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
20
19
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
20
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
21
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
21
22
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context40; _forEachInstanceProperty(_context40 = ["next", "throw", "return"]).call(_context40, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context41; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context41 = this.tryEntries).call(_context41, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
22
23
|
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
23
24
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
@@ -30,10 +31,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
30
31
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
31
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context37, _context38; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context37 = ownKeys(Object(source), !0)).call(_context37, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context38 = ownKeys(Object(source))).call(_context38, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
32
33
|
/* eslint-disable testing-library/no-node-access */
|
33
|
-
import React from 'react';
|
34
|
+
import React, { useState } from 'react';
|
34
35
|
import { useAsyncList } from 'react-stately';
|
35
36
|
import { useCollator } from '@react-aria/i18n';
|
36
37
|
import { act, act as actDom, act as actHooks, fireEvent, render, renderHook, screen, within } from '@testing-library/react';
|
38
|
+
import userEvent from '@testing-library/user-event';
|
37
39
|
import { DataTableBody, DataTableCell, DataTableColumn, DataTableHeader, DataTableRow } from '../../index';
|
38
40
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
39
41
|
import DataTable from './DataTable';
|
@@ -65,25 +67,50 @@ var columns = [{
|
|
65
67
|
}];
|
66
68
|
var rows = [{
|
67
69
|
id: 2,
|
70
|
+
key: 2,
|
68
71
|
country: 'Canada',
|
69
72
|
population: 37000000,
|
70
73
|
continent: 'North America'
|
71
74
|
}, {
|
72
75
|
id: 1,
|
76
|
+
key: 1,
|
73
77
|
country: 'USA',
|
74
78
|
population: 320000000,
|
75
79
|
continent: 'North America'
|
76
80
|
}, {
|
77
81
|
id: 3,
|
82
|
+
key: 3,
|
78
83
|
country: 'China',
|
79
84
|
population: 1398000000,
|
80
85
|
continent: 'Asia'
|
81
86
|
}, {
|
82
87
|
id: 4,
|
88
|
+
key: 4,
|
83
89
|
country: 'France',
|
84
90
|
population: 67000000,
|
85
91
|
continent: 'Europe'
|
86
92
|
}];
|
93
|
+
var ControlledDataTable = function ControlledDataTable(props) {
|
94
|
+
var _useState = useState([]),
|
95
|
+
_useState2 = _slicedToArray(_useState, 2),
|
96
|
+
selectedKeys = _useState2[0],
|
97
|
+
setSelectedKeys = _useState2[1];
|
98
|
+
return ___EmotionJSX(DataTable, _extends({}, props, {
|
99
|
+
selectionMode: "single",
|
100
|
+
selectedKeys: selectedKeys,
|
101
|
+
onSelectionChange: setSelectedKeys
|
102
|
+
}), ___EmotionJSX(DataTableHeader, {
|
103
|
+
columns: columns
|
104
|
+
}, function (column) {
|
105
|
+
return ___EmotionJSX(DataTableColumn, null, column.name);
|
106
|
+
}), ___EmotionJSX(DataTableBody, {
|
107
|
+
items: rows
|
108
|
+
}, function (item) {
|
109
|
+
return ___EmotionJSX(DataTableRow, null, function (columnKey) {
|
110
|
+
return ___EmotionJSX(DataTableCell, null, item[columnKey]);
|
111
|
+
});
|
112
|
+
}));
|
113
|
+
};
|
87
114
|
var getCell = function getCell(view, text) {
|
88
115
|
// Find by text, then go up to the element with the cell role.
|
89
116
|
// eslint-disable-next-line testing-library/prefer-screen-queries
|
@@ -192,6 +219,14 @@ describe('Static DataTable', function () {
|
|
192
219
|
expect(cells[6]).toHaveAttribute('aria-colindex', '2');
|
193
220
|
expect(cells[7]).toHaveAttribute('aria-colindex', '3');
|
194
221
|
});
|
222
|
+
test('should select with mouse click', function () {
|
223
|
+
staticDataTable();
|
224
|
+
var thisItem = screen.getAllByRole('row');
|
225
|
+
expect(thisItem[2]).not.toHaveClass('is-selected');
|
226
|
+
userEvent.click(thisItem[2]);
|
227
|
+
var updatedItem = screen.queryAllByRole('row')[2];
|
228
|
+
expect(updatedItem).not.toHaveClass('is-selected');
|
229
|
+
});
|
195
230
|
test('should move focus to the next cell in a row with ArrowRight', function () {
|
196
231
|
var view = staticDataTable();
|
197
232
|
act(function () {
|
@@ -227,6 +262,110 @@ describe('Static DataTable', function () {
|
|
227
262
|
expect(getCell(view, 'Europe')).toHaveFocus();
|
228
263
|
});
|
229
264
|
});
|
265
|
+
describe('Selectable DataTable', function () {
|
266
|
+
var testId = 'staticTable';
|
267
|
+
var testCallback = jest.fn();
|
268
|
+
var defaultProps = {
|
269
|
+
'aria-label': 'Default table with static content',
|
270
|
+
width: '100%',
|
271
|
+
height: '100%',
|
272
|
+
'data-testid': testId,
|
273
|
+
selectionMode: 'single',
|
274
|
+
defaultSelectedKeys: [1],
|
275
|
+
onSelectionChange: testCallback
|
276
|
+
};
|
277
|
+
var staticDataTable = function staticDataTable(props) {
|
278
|
+
return render(___EmotionJSX(DataTable, _extends({}, defaultProps, props), ___EmotionJSX(DataTableHeader, {
|
279
|
+
columns: columns
|
280
|
+
}, function (column) {
|
281
|
+
return ___EmotionJSX(DataTableColumn, null, column.name);
|
282
|
+
}), ___EmotionJSX(DataTableBody, {
|
283
|
+
items: rows
|
284
|
+
}, function (item) {
|
285
|
+
return ___EmotionJSX(DataTableRow, null, function (columnKey) {
|
286
|
+
return ___EmotionJSX(DataTableCell, null, item[columnKey]);
|
287
|
+
});
|
288
|
+
})));
|
289
|
+
};
|
290
|
+
test('should change selection on mouse press', function () {
|
291
|
+
staticDataTable({});
|
292
|
+
var thisItem = screen.getAllByRole('row');
|
293
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
294
|
+
userEvent.click(thisItem[1]);
|
295
|
+
expect(thisItem[1]).toHaveClass('is-selected');
|
296
|
+
expect(thisItem[1]).toHaveClass('is-selectable');
|
297
|
+
});
|
298
|
+
test('defaultSelectedKeys works', function () {
|
299
|
+
staticDataTable({
|
300
|
+
defaultSelectedKeys: [2]
|
301
|
+
});
|
302
|
+
var thisItem = screen.getAllByRole('row');
|
303
|
+
expect(thisItem[1]).toHaveClass('is-selected');
|
304
|
+
});
|
305
|
+
test('disabledKeys', function () {
|
306
|
+
staticDataTable({
|
307
|
+
disabledKeys: [2]
|
308
|
+
});
|
309
|
+
var thisItem = screen.getAllByRole('row');
|
310
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
311
|
+
userEvent.click(thisItem[1]);
|
312
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
313
|
+
});
|
314
|
+
test('onSelectedChange callback works as expected', function () {
|
315
|
+
staticDataTable({
|
316
|
+
disabledKeys: [2]
|
317
|
+
});
|
318
|
+
var thisItem = screen.getAllByRole('row');
|
319
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
320
|
+
userEvent.click(thisItem[1]);
|
321
|
+
expect(testCallback).toHaveBeenCalled();
|
322
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
323
|
+
});
|
324
|
+
});
|
325
|
+
describe('Controlled Selectable DataTable', function () {
|
326
|
+
var testId = 'staticTable';
|
327
|
+
var props = {
|
328
|
+
'aria-label': 'Default table with static content',
|
329
|
+
width: '100%',
|
330
|
+
height: '100%',
|
331
|
+
'data-testid': testId,
|
332
|
+
selectionMode: 'single'
|
333
|
+
};
|
334
|
+
test('should select with mouse click', function () {
|
335
|
+
render(___EmotionJSX(ControlledDataTable, props));
|
336
|
+
var thisItem = screen.getAllByRole('row');
|
337
|
+
expect(thisItem[2]).not.toHaveClass('is-selected');
|
338
|
+
userEvent.click(thisItem[2]);
|
339
|
+
var updatedItem = screen.queryAllByRole('row')[2];
|
340
|
+
expect(updatedItem).toHaveClass('is-selected');
|
341
|
+
});
|
342
|
+
test('should select with keyboard', function () {
|
343
|
+
render(___EmotionJSX(ControlledDataTable, props));
|
344
|
+
var thisItem = screen.getAllByRole('row');
|
345
|
+
userEvent.tab();
|
346
|
+
expect(thisItem[2]).not.toHaveClass('is-selected');
|
347
|
+
moveFocus('ArrowDown');
|
348
|
+
fireEvent.keyDown(thisItem[2], {
|
349
|
+
key: ' '
|
350
|
+
});
|
351
|
+
var updatedItem = screen.queryAllByRole('row')[2];
|
352
|
+
expect(updatedItem).toHaveClass('is-selected');
|
353
|
+
});
|
354
|
+
test('disabledKeys', function () {
|
355
|
+
var theseProps = {
|
356
|
+
disabledKeys: [2],
|
357
|
+
'aria-label': 'Default table with static content',
|
358
|
+
width: '100%',
|
359
|
+
height: '100%',
|
360
|
+
'data-testid': testId
|
361
|
+
};
|
362
|
+
render(___EmotionJSX(ControlledDataTable, theseProps));
|
363
|
+
var thisItem = screen.getAllByRole('row');
|
364
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
365
|
+
userEvent.click(thisItem[1]);
|
366
|
+
expect(thisItem[1]).not.toHaveClass('is-selected');
|
367
|
+
});
|
368
|
+
});
|
230
369
|
describe('Async DataTable', function () {
|
231
370
|
test('renders a spinner when loading', function () {
|
232
371
|
var testId = 'loadingTable';
|
@@ -9,6 +9,7 @@ import AlertIcon from '@pingux/mdi-react/AlertIcon';
|
|
9
9
|
import CheckCircleIcon from '@pingux/mdi-react/CheckCircleIcon';
|
10
10
|
import InformationIcon from '@pingux/mdi-react/InformationIcon';
|
11
11
|
import { Icon } from '../..';
|
12
|
+
import useGetTheme from '../../hooks/useGetTheme';
|
12
13
|
import statuses from '../../utils/devUtils/constants/statuses';
|
13
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
14
15
|
export var noticeIcons = (_noticeIcons = {}, _defineProperty(_noticeIcons, statuses.DEFAULT, {
|
@@ -32,11 +33,13 @@ export var NoticeIcon = function NoticeIcon(_ref) {
|
|
32
33
|
var _ref$status = _ref.status,
|
33
34
|
status = _ref$status === void 0 ? statuses.DEFAULT : _ref$status,
|
34
35
|
others = _objectWithoutProperties(_ref, _excluded);
|
36
|
+
var _useGetTheme = useGetTheme(),
|
37
|
+
icons = _useGetTheme.icons;
|
35
38
|
return ___EmotionJSX(Icon, _extends({
|
36
39
|
"data-testid": noticeIcons[status].testid,
|
37
40
|
title: {
|
38
41
|
name: noticeIcons[status].name
|
39
42
|
},
|
40
|
-
icon:
|
43
|
+
icon: icons[status]
|
41
44
|
}, others));
|
42
45
|
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
13
|
+
import React, { forwardRef } from 'react';
|
14
|
+
import { useStatusClasses, useTShirtSize } from '../../hooks';
|
15
|
+
import { Box, Icon } from '../../index';
|
16
|
+
import { iconWrapperSizes } from '../../utils/devUtils/constants/tShirtSizes';
|
17
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
18
|
+
var IconWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
|
19
|
+
var icon = props.icon,
|
20
|
+
iconProps = props.iconProps,
|
21
|
+
wrapperProps = props.wrapperProps,
|
22
|
+
color = props.color,
|
23
|
+
size = props.size,
|
24
|
+
title = props.title,
|
25
|
+
className = props.className,
|
26
|
+
isCircle = props.isCircle;
|
27
|
+
var _useTShirtSize = useTShirtSize(_objectSpread({}, {
|
28
|
+
size: size,
|
29
|
+
sizes: iconWrapperSizes
|
30
|
+
})),
|
31
|
+
sizeProps = _useTShirtSize.sizeProps;
|
32
|
+
var _useStatusClasses = useStatusClasses(className, {
|
33
|
+
isCircle: isCircle
|
34
|
+
}),
|
35
|
+
classNames = _useStatusClasses.classNames;
|
36
|
+
return ___EmotionJSX(Box, _extends({
|
37
|
+
ref: ref,
|
38
|
+
variant: "iconWrapper.".concat(size),
|
39
|
+
sx: {
|
40
|
+
backgroundColor: "iconWrapper.wrapper.".concat(color)
|
41
|
+
},
|
42
|
+
className: classNames
|
43
|
+
}, wrapperProps), ___EmotionJSX(Icon, _extends({
|
44
|
+
icon: icon,
|
45
|
+
size: sizeProps.size,
|
46
|
+
title: title,
|
47
|
+
color: "iconWrapper.icon.".concat(color)
|
48
|
+
}, iconProps)));
|
49
|
+
});
|
50
|
+
export default IconWrapper;
|