@jobber/components 4.85.4-CJS-to-ESM.1 → 4.85.4-CJS-to-ESM.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnimatedPresence/index.js +12 -0
- package/dist/AnimatedPresence/index.mjs +4 -0
- package/dist/AnimatedPresence-20a02aaa.js +104 -0
- package/dist/AnimatedPresence-bbccdaf7.js +98 -0
- package/dist/AnimatedSwitcher/index.js +13 -0
- package/dist/AnimatedSwitcher/index.mjs +5 -0
- package/dist/AnimatedSwitcher-3aff3d12.js +90 -0
- package/dist/AnimatedSwitcher-3d45ec5d.js +96 -0
- package/dist/Autocomplete/index.js +33 -0
- package/dist/Autocomplete/index.mjs +25 -0
- package/dist/Autocomplete-6ca7a7e5.js +188 -0
- package/dist/Autocomplete-6df9f7c0.js +196 -0
- package/dist/Avatar/index.js +15 -0
- package/dist/Avatar/index.mjs +7 -0
- package/dist/Avatar-6ffee4bd.js +70 -0
- package/dist/Avatar-76a799fa.js +78 -0
- package/dist/Banner/components/BannerIcon/index.js +15 -0
- package/dist/Banner/components/BannerIcon/index.mjs +7 -0
- package/dist/Banner/index.js +21 -0
- package/dist/Banner/index.mjs +13 -0
- package/dist/Banner-2d1688c7.js +82 -0
- package/dist/Banner-cb621462.js +89 -0
- package/dist/BannerIcon-9d41540d.js +24 -0
- package/dist/BannerIcon-ae763eab.js +32 -0
- package/dist/Body-2f4bf030.js +50 -0
- package/dist/Body-91ac1819.js +64 -0
- package/dist/Button/index.js +16 -0
- package/dist/Button/index.mjs +8 -0
- package/dist/Button-9ae092b3.js +50 -0
- package/dist/Button-b73a5e01.js +57 -0
- package/dist/ButtonDismiss/index.js +17 -0
- package/dist/ButtonDismiss/index.mjs +9 -0
- package/dist/ButtonDismiss-350af163.js +14 -0
- package/dist/ButtonDismiss-614803be.js +8 -0
- package/dist/Card/colors.css.d.ts +89 -0
- package/dist/Card/index.js +24 -0
- package/dist/Card/index.mjs +16 -0
- package/dist/Card-a9861d4d.js +86 -0
- package/dist/Card-e3144022.js +93 -0
- package/dist/Checkbox/index.js +18 -0
- package/dist/Checkbox/index.mjs +10 -0
- package/dist/Checkbox-3ff9f47a.js +56 -0
- package/dist/Checkbox-787e2e47.js +63 -0
- package/dist/Chip/hooks/index.js +10 -0
- package/dist/Chip/hooks/index.mjs +2 -0
- package/dist/Chip/index.js +28 -0
- package/dist/Chip/index.mjs +18 -0
- package/dist/Chip-0e37aa92.js +70 -0
- package/dist/Chip-36397442.js +78 -0
- package/dist/ChipDismissible-1b8383e1.js +19 -0
- package/dist/ChipDismissible-d12a2207.js +26 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.js +20 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +8 -0
- package/dist/Chips/InternalChipDismissible/index.js +31 -0
- package/dist/Chips/InternalChipDismissible/index.mjs +23 -0
- package/dist/Chips/index.js +48 -0
- package/dist/Chips/index.mjs +38 -0
- package/dist/Chips-36b7630e.js +97 -0
- package/dist/Chips-fe5c5705.js +91 -0
- package/dist/Combobox/components/ComboboxAction/index.js +15 -0
- package/dist/Combobox/components/ComboboxAction/index.mjs +7 -0
- package/dist/Combobox/components/ComboboxActivator/index.js +29 -0
- package/dist/Combobox/components/ComboboxActivator/index.mjs +21 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.js +17 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.mjs +9 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.js +27 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.mjs +19 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.js +13 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.mjs +5 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.js +12 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +4 -0
- package/dist/Combobox/components/ComboboxContent/index.js +37 -0
- package/dist/Combobox/components/ComboboxContent/index.mjs +29 -0
- package/dist/Combobox/components/ComboboxOption/index.js +17 -0
- package/dist/Combobox/components/ComboboxOption/index.mjs +9 -0
- package/dist/Combobox/components/ComboboxTrigger/index.js +27 -0
- package/dist/Combobox/components/ComboboxTrigger/index.mjs +19 -0
- package/dist/Combobox/index.js +51 -0
- package/dist/Combobox/index.mjs +42 -0
- package/dist/Combobox-bf8c9ce6.js +128 -0
- package/dist/Combobox-f781cae2.js +120 -0
- package/dist/ComboboxAction-22bd2e79.js +31 -0
- package/dist/ComboboxAction-c21dc02b.js +25 -0
- package/dist/ComboboxActivator-757941db.js +26 -0
- package/dist/ComboboxActivator-afc63f51.js +32 -0
- package/dist/ComboboxContent-0e67a7f3.js +144 -0
- package/dist/ComboboxContent-1faee40b.js +152 -0
- package/dist/ComboboxContentHeader-97ea6800.js +30 -0
- package/dist/ComboboxContentHeader-ce3f10b6.js +36 -0
- package/dist/ComboboxContentList-7f7ef48c.js +78 -0
- package/dist/ComboboxContentList-b7108426.js +85 -0
- package/dist/ComboboxContentSearch-196e638a.js +35 -0
- package/dist/ComboboxContentSearch-889f0525.js +41 -0
- package/dist/ComboboxLoadMore-21f09a37.js +17 -0
- package/dist/ComboboxLoadMore-a642edaa.js +23 -0
- package/dist/ComboboxOption-16d1c772.js +30 -0
- package/dist/ComboboxOption-cf324e9d.js +23 -0
- package/dist/ComboboxProvider-32666af1.js +10 -0
- package/dist/ComboboxProvider-dd21fe88.js +17 -0
- package/dist/ComboboxTrigger-0c05930b.js +28 -0
- package/dist/ComboboxTrigger-b41954f5.js +22 -0
- package/dist/ConfirmationModal/index.js +31 -0
- package/dist/ConfirmationModal/index.mjs +23 -0
- package/dist/ConfirmationModal-52e16873.js +100 -0
- package/dist/ConfirmationModal-916a1f09.js +94 -0
- package/dist/Content/Spacing.css.d.ts +13 -0
- package/dist/Content/index.js +12 -0
- package/dist/Content/index.mjs +4 -0
- package/dist/Content-c4ea919f.js +18 -0
- package/dist/Content-e3f7b6fc.js +24 -0
- package/dist/Countdown/index.js +12 -0
- package/dist/Countdown/index.mjs +4 -0
- package/dist/Countdown-961d8a6e.js +70 -0
- package/dist/Countdown-ac081ced.js +63 -0
- package/dist/DataDump/index.js +27 -0
- package/dist/DataDump/index.mjs +19 -0
- package/dist/DataDump-18f6e791.js +15 -0
- package/dist/DataDump-9addf519.js +21 -0
- package/dist/DataList/components/DataListAction/index.js +16 -0
- package/dist/DataList/components/DataListAction/index.mjs +8 -0
- package/dist/DataList/components/DataListActions/index.js +43 -0
- package/dist/DataList/components/DataListActions/index.mjs +35 -0
- package/dist/DataList/components/DataListActionsMenu/index.js +18 -0
- package/dist/DataList/components/DataListActionsMenu/index.mjs +10 -0
- package/dist/DataList/components/DataListBulkActions/index.js +46 -0
- package/dist/DataList/components/DataListBulkActions/index.mjs +37 -0
- package/dist/DataList/components/DataListEmptyState/index.js +22 -0
- package/dist/DataList/components/DataListEmptyState/index.mjs +13 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.js +52 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +44 -0
- package/dist/DataList/components/DataListFilters/index.js +66 -0
- package/dist/DataList/components/DataListFilters/index.mjs +57 -0
- package/dist/DataList/components/DataListHeader/index.js +53 -0
- package/dist/DataList/components/DataListHeader/index.mjs +45 -0
- package/dist/DataList/components/DataListHeaderTile/components/index.js +15 -0
- package/dist/DataList/components/DataListHeaderTile/components/index.mjs +7 -0
- package/dist/DataList/components/DataListHeaderTile/index.js +22 -0
- package/dist/DataList/components/DataListHeaderTile/index.mjs +14 -0
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.js +16 -0
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.mjs +8 -0
- package/dist/DataList/components/DataListItem/index.js +52 -0
- package/dist/DataList/components/DataListItem/index.mjs +44 -0
- package/dist/DataList/components/DataListItemActions/index.js +45 -0
- package/dist/DataList/components/DataListItemActions/index.mjs +36 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.js +27 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +19 -0
- package/dist/DataList/components/DataListItems/index.js +53 -0
- package/dist/DataList/components/DataListItems/index.mjs +45 -0
- package/dist/DataList/components/DataListLayout/index.js +56 -0
- package/dist/DataList/components/DataListLayout/index.mjs +48 -0
- package/dist/DataList/components/DataListLayoutActions/DataListLayoutContext/index.js +11 -0
- package/dist/DataList/components/DataListLayoutActions/DataListLayoutContext/index.mjs +2 -0
- package/dist/DataList/components/DataListLayoutActions/index.js +34 -0
- package/dist/DataList/components/DataListLayoutActions/index.mjs +26 -0
- package/dist/DataList/components/DataListLoadMore/index.js +23 -0
- package/dist/DataList/components/DataListLoadMore/index.mjs +14 -0
- package/dist/DataList/components/DataListLoadingState/index.js +23 -0
- package/dist/DataList/components/DataListLoadingState/index.mjs +13 -0
- package/dist/DataList/components/DataListOverflowFade/index.js +14 -0
- package/dist/DataList/components/DataListOverflowFade/index.mjs +5 -0
- package/dist/DataList/components/DataListSearch/index.js +34 -0
- package/dist/DataList/components/DataListSearch/index.mjs +24 -0
- package/dist/DataList/components/DataListStatusBar/index.js +32 -0
- package/dist/DataList/components/DataListStatusBar/index.mjs +23 -0
- package/dist/DataList/components/DataListStickyHeader/index.js +14 -0
- package/dist/DataList/components/DataListStickyHeader/index.mjs +6 -0
- package/dist/DataList/components/DataListTags/index.js +15 -0
- package/dist/DataList/components/DataListTags/index.mjs +7 -0
- package/dist/DataList/components/DataListTotalCount/index.js +18 -0
- package/dist/DataList/components/DataListTotalCount/index.mjs +9 -0
- package/dist/DataList/context/DataListContext/index.js +13 -0
- package/dist/DataList/context/DataListContext/index.mjs +3 -0
- package/dist/DataList/context/DataListLayoutContext/index.js +13 -0
- package/dist/DataList/context/DataListLayoutContext/index.mjs +3 -0
- package/dist/DataList/index.js +97 -0
- package/dist/DataList/index.mjs +89 -0
- package/dist/DataList-1e0e9426.js +7 -0
- package/dist/DataList-ae2efe9b.js +139 -0
- package/dist/DataList-b5f0a522.js +9 -0
- package/dist/DataList-fc20945e.js +145 -0
- package/dist/DataList.const-3ae7ceef.js +25 -0
- package/dist/DataList.const-c05b47de.js +38 -0
- package/dist/DataList.utils-b72b8d0d.js +92 -0
- package/dist/DataList.utils-d51eb44e.js +80 -0
- package/dist/DataListAction-9d8a33e0.js +46 -0
- package/dist/DataListAction-d570e8bf.js +40 -0
- package/dist/DataListActions-c5ad9b23.js +43 -0
- package/dist/DataListActions-f8367eda.js +49 -0
- package/dist/DataListActionsMenu-cce1bd30.js +53 -0
- package/dist/DataListActionsMenu-cfcd5d21.js +59 -0
- package/dist/DataListBulkActions-a750f601.js +29 -0
- package/dist/DataListBulkActions-af1fe283.js +36 -0
- package/dist/DataListContext-736a42a2.js +25 -0
- package/dist/DataListContext-f40570a7.js +34 -0
- package/dist/DataListEmptyState-25d6c47d.js +60 -0
- package/dist/DataListEmptyState-fcc112ac.js +53 -0
- package/dist/DataListFilters-3e5599c6.js +50 -0
- package/dist/DataListFilters-aaff643e.js +43 -0
- package/dist/DataListHeader-43a4bb92.js +100 -0
- package/dist/DataListHeader-bf256a20.js +93 -0
- package/dist/DataListHeaderTile-4b93f949.js +91 -0
- package/dist/DataListHeaderTile-8854e4d8.js +84 -0
- package/dist/DataListItem-3d39e2eb.js +119 -0
- package/dist/DataListItem-5cbf5f14.js +112 -0
- package/dist/DataListItemActions-122d8972.js +39 -0
- package/dist/DataListItemActions-c5749fdc.js +32 -0
- package/dist/DataListItemActionsOverflow-6004ba59.js +33 -0
- package/dist/DataListItemActionsOverflow-9c491ed9.js +39 -0
- package/dist/DataListItemClickable-127bfc7f.js +45 -0
- package/dist/DataListItemClickable-abe0242c.js +51 -0
- package/dist/DataListItems-00dd20c1.js +19 -0
- package/dist/DataListItems-09c65d2c.js +25 -0
- package/dist/DataListLayout-4cdcaa1f.js +25 -0
- package/dist/DataListLayout-99863988.js +19 -0
- package/dist/DataListLayoutActions-43cc8589.js +39 -0
- package/dist/DataListLayoutActions-9f8cc2a2.js +45 -0
- package/dist/DataListLayoutContext-39a0d016.js +11 -0
- package/dist/DataListLayoutContext-7daf863d.js +14 -0
- package/dist/DataListLayoutContext-83df2a23.js +22 -0
- package/dist/DataListLayoutContext-9237afd1.js +8 -0
- package/dist/DataListLoadMore-1b519950.js +34 -0
- package/dist/DataListLoadMore-20d2d817.js +41 -0
- package/dist/DataListLoadingState-9de965f6.js +33 -0
- package/dist/DataListLoadingState-c175094e.js +25 -0
- package/dist/DataListOverflowFade-85c826e0.js +33 -0
- package/dist/DataListOverflowFade-a640f51f.js +25 -0
- package/dist/DataListSearch-584f4f05.js +72 -0
- package/dist/DataListSearch-614b959b.js +62 -0
- package/dist/DataListSort-0e8e03c9.js +98 -0
- package/dist/DataListSort-a684067a.js +92 -0
- package/dist/DataListSortingOptions-4694941c.js +44 -0
- package/dist/DataListSortingOptions-8a64205a.js +38 -0
- package/dist/DataListStatusBar-4f692790.js +22 -0
- package/dist/DataListStatusBar-e17eff45.js +29 -0
- package/dist/DataListStickyHeader-0728e21b.js +33 -0
- package/dist/DataListStickyHeader-ce11cbd9.js +26 -0
- package/dist/DataListTags-68b3a874.js +65 -0
- package/dist/DataListTags-f4038ea1.js +72 -0
- package/dist/DataListTotalCount-8373c2df.js +34 -0
- package/dist/DataListTotalCount-cce98cf6.js +27 -0
- package/dist/DataTable/index.js +36 -0
- package/dist/DataTable/index.mjs +23 -0
- package/dist/DataTable/test-utilities/index.js +243 -0
- package/dist/DataTable/test-utilities/index.mjs +233 -0
- package/dist/DataTable-4afcfbc6.js +252 -0
- package/dist/DataTable-8d4b2d3a.js +245 -0
- package/dist/DatePicker/index.js +20 -0
- package/dist/DatePicker/index.mjs +12 -0
- package/dist/DatePicker-64c5ab1a.js +134 -0
- package/dist/DatePicker-85127ebc.js +125 -0
- package/dist/DayOfMonthSelect-8e05c1a7.js +141 -0
- package/dist/DayOfMonthSelect-d644270a.js +152 -0
- package/dist/DescriptionList/index.js +13 -0
- package/dist/DescriptionList/index.mjs +5 -0
- package/dist/DescriptionList-73241740.js +15 -0
- package/dist/DescriptionList-e72dbff4.js +21 -0
- package/dist/Disclosure/index.js +16 -0
- package/dist/Disclosure/index.mjs +8 -0
- package/dist/Disclosure-1165a958.js +36 -0
- package/dist/Disclosure-f285a6b6.js +42 -0
- package/dist/Divider/index.js +12 -0
- package/dist/Divider/index.mjs +4 -0
- package/dist/Divider-30edc4ed.js +20 -0
- package/dist/Divider-46a88bea.js +27 -0
- package/dist/Drawer/index.js +21 -0
- package/dist/Drawer/index.mjs +12 -0
- package/dist/DrawerGrid-73000735.js +33 -0
- package/dist/DrawerGrid-89de9440.js +41 -0
- package/dist/Emphasis/index.js +13 -0
- package/dist/Emphasis/index.mjs +5 -0
- package/dist/Emphasis-78cec3ac.js +13 -0
- package/dist/Emphasis-bda56d3b.js +19 -0
- package/dist/FeatureSwitch/index.js +26 -0
- package/dist/FeatureSwitch/index.mjs +18 -0
- package/dist/FeatureSwitch-1d6993a1.js +55 -0
- package/dist/FeatureSwitch-6632682d.js +62 -0
- package/dist/Flex/index.js +12 -0
- package/dist/Flex/index.mjs +4 -0
- package/dist/Flex-d490c4db.js +38 -0
- package/dist/Flex-d565495d.js +31 -0
- package/dist/Form/index.js +12 -0
- package/dist/Form/index.mjs +4 -0
- package/dist/Form-6a161b07.js +48 -0
- package/dist/Form-927647ef.js +54 -0
- package/dist/FormField/index.js +24 -0
- package/dist/FormField/index.mjs +16 -0
- package/dist/FormField-6ff183f8.js +253 -0
- package/dist/FormField-8118cfc8.js +246 -0
- package/dist/FormatDate/index.js +11 -0
- package/dist/FormatDate/index.mjs +2 -0
- package/dist/FormatDate-70ea5b43.js +34 -0
- package/dist/FormatDate-720b39cf.js +27 -0
- package/dist/FormatEmail/index.js +12 -0
- package/dist/FormatEmail/index.mjs +4 -0
- package/dist/FormatEmail-04ee4085.js +14 -0
- package/dist/FormatEmail-298393bb.js +21 -0
- package/dist/FormatFile/index.js +36 -0
- package/dist/FormatFile/index.mjs +28 -0
- package/dist/FormatFile-352cc225.js +154 -0
- package/dist/FormatFile-f036902d.js +162 -0
- package/dist/FormatRelativeDateTime/index.js +10 -0
- package/dist/FormatRelativeDateTime/index.mjs +2 -0
- package/dist/FormatRelativeDateTime-529dc36b.js +64 -0
- package/dist/FormatRelativeDateTime-6336002d.js +70 -0
- package/dist/FormatTime/index.js +10 -0
- package/dist/FormatTime/index.mjs +2 -0
- package/dist/FormatTime-20538519.js +34 -0
- package/dist/FormatTime-764fd3c8.js +28 -0
- package/dist/Gallery/Gallery.css.d.ts +9 -0
- package/dist/Gallery/index.js +39 -0
- package/dist/Gallery/index.mjs +31 -0
- package/dist/Gallery-287d640a.js +73 -0
- package/dist/Gallery-604216cb.js +66 -0
- package/dist/Glimmer/index.js +15 -0
- package/dist/Glimmer/index.mjs +6 -0
- package/dist/Glimmer/style/Shape.css.d.ts +9 -0
- package/dist/Glimmer/style/Sizes.css.d.ts +10 -0
- package/dist/Glimmer/style/Timing.css.d.ts +6 -0
- package/dist/Glimmer-84dee1ed.js +77 -0
- package/dist/Glimmer-aea7f8ae.js +69 -0
- package/dist/Grid/GridAlign.css.d.ts +8 -0
- package/dist/Grid/InternalGridCell/index.js +12 -0
- package/dist/Grid/InternalGridCell/index.mjs +3 -0
- package/dist/Grid/index.js +15 -0
- package/dist/Grid/index.mjs +6 -0
- package/dist/Grid-257d509f.js +34 -0
- package/dist/Grid-3b80e935.js +42 -0
- package/dist/Heading/index.js +14 -0
- package/dist/Heading/index.mjs +6 -0
- package/dist/Heading-1e8e4bd3.js +55 -0
- package/dist/Heading-93e755cb.js +49 -0
- package/dist/Icon/index.js +11 -0
- package/dist/Icon/index.mjs +3 -0
- package/dist/Icon-22723fe6.js +34 -0
- package/dist/Icon-405a216c.js +40 -0
- package/dist/InlineLabel/index.js +13 -0
- package/dist/InlineLabel/index.mjs +5 -0
- package/dist/InlineLabel-a6557829.js +28 -0
- package/dist/InlineLabel-b7d9e402.js +21 -0
- package/dist/InputAvatar/index.js +28 -0
- package/dist/InputAvatar/index.mjs +20 -0
- package/dist/InputAvatar-65e584a0.js +56 -0
- package/dist/InputAvatar-e4eb2201.js +50 -0
- package/dist/InputDate/index.js +29 -0
- package/dist/InputDate/index.mjs +21 -0
- package/dist/InputDate-68050753.js +32 -0
- package/dist/InputDate-77bcc250.js +39 -0
- package/dist/InputEmail/index.js +26 -0
- package/dist/InputEmail/index.mjs +17 -0
- package/dist/InputEmail-3103e37c.js +27 -0
- package/dist/InputEmail-88d617d7.js +20 -0
- package/dist/InputFile/index.js +25 -0
- package/dist/InputFile/index.mjs +16 -0
- package/dist/InputFile-bb945071.js +190 -0
- package/dist/InputFile-cfa53555.js +181 -0
- package/dist/InputGroup/index.js +12 -0
- package/dist/InputGroup/index.mjs +4 -0
- package/dist/InputGroup-436859cf.js +26 -0
- package/dist/InputGroup-8d4fd4eb.js +33 -0
- package/dist/InputNumber/index.js +25 -0
- package/dist/InputNumber/index.mjs +17 -0
- package/dist/InputNumber-0391311b.js +56 -0
- package/dist/InputNumber-d451b52e.js +62 -0
- package/dist/InputPassword/index.js +25 -0
- package/dist/InputPassword/index.mjs +17 -0
- package/dist/InputPassword-0ab4214d.js +19 -0
- package/dist/InputPassword-dd44b8d5.js +25 -0
- package/dist/InputPhoneNumber/index.js +25 -0
- package/dist/InputPhoneNumber/index.mjs +17 -0
- package/dist/InputPhoneNumber-83d7ec95.js +103 -0
- package/dist/InputPhoneNumber-bc761c12.js +97 -0
- package/dist/InputText/index.js +26 -0
- package/dist/InputText/index.mjs +18 -0
- package/dist/InputText-55b6cb65.js +102 -0
- package/dist/InputText-8dbcfe70.js +96 -0
- package/dist/InputTime/index.js +27 -0
- package/dist/InputTime/index.mjs +19 -0
- package/dist/InputTime-13522852.js +187 -0
- package/dist/InputTime-ce24b2bf.js +194 -0
- package/dist/InputValidation/index.js +17 -0
- package/dist/InputValidation/index.mjs +9 -0
- package/dist/InputValidation-05e839fa.js +29 -0
- package/dist/InputValidation-d68fb034.js +23 -0
- package/dist/InternalChipDismissible-1086e333.js +158 -0
- package/dist/InternalChipDismissible-5220f657.js +169 -0
- package/dist/InternalGridCell-58643b70.js +44 -0
- package/dist/InternalGridCell-eca14dd0.js +37 -0
- package/dist/LightBox/index.js +24 -0
- package/dist/LightBox/index.mjs +16 -0
- package/dist/LightBox-2460f422.js +109 -0
- package/dist/LightBox-a89d8863.js +117 -0
- package/dist/Link/index.js +10 -0
- package/dist/Link/index.mjs +2 -0
- package/dist/Link-b41bc1d3.js +7 -0
- package/dist/Link-fd7301ec.js +13 -0
- package/dist/List/index.js +25 -0
- package/dist/List/index.mjs +16 -0
- package/dist/List-ad77343b.js +77 -0
- package/dist/List-b5b0b81f.js +87 -0
- package/dist/Markdown/index.js +19 -0
- package/dist/Markdown/index.mjs +11 -0
- package/dist/Markdown-8d44afcd.js +55 -0
- package/dist/Markdown-f7c55304.js +62 -0
- package/dist/Menu/index.js +21 -0
- package/dist/Menu/index.mjs +13 -0
- package/dist/Menu-083fc4c4.js +139 -0
- package/dist/Menu-d99e0e5a.js +132 -0
- package/dist/Modal/Sizes.css.d.ts +6 -0
- package/dist/Modal/index.js +25 -0
- package/dist/Modal/index.mjs +17 -0
- package/dist/Modal-c336cac6.js +71 -0
- package/dist/Modal-ecd845d2.js +63 -0
- package/dist/MultiSelect/index.js +19 -0
- package/dist/MultiSelect/index.mjs +11 -0
- package/dist/MultiSelect-3b48166e.js +176 -0
- package/dist/MultiSelect-6dcd0181.js +169 -0
- package/dist/Option-18ddab50.js +12 -0
- package/dist/Option-3c4d377e.js +19 -0
- package/dist/Page/index.js +30 -0
- package/dist/Page/index.mjs +22 -0
- package/dist/Page-a9b25d27.js +66 -0
- package/dist/Page-f2604b2a.js +59 -0
- package/dist/Popover/index.js +20 -0
- package/dist/Popover/index.mjs +12 -0
- package/dist/Popover-2c6df036.js +47 -0
- package/dist/Popover-efe863e3.js +53 -0
- package/dist/ProgressBar/Sizes.css.d.ts +7 -0
- package/dist/ProgressBar/index.js +12 -0
- package/dist/ProgressBar/index.mjs +4 -0
- package/dist/ProgressBar-a453087d.js +36 -0
- package/dist/ProgressBar-b68edc8f.js +43 -0
- package/dist/RadioGroup/index.js +15 -0
- package/dist/RadioGroup/index.mjs +6 -0
- package/dist/RadioGroup-17b67ade.js +46 -0
- package/dist/RadioGroup-fe381c57.js +39 -0
- package/dist/RecurringSelect/components/index.js +18 -0
- package/dist/RecurringSelect/components/index.mjs +7 -0
- package/dist/RecurringSelect/index.js +39 -0
- package/dist/RecurringSelect/index.mjs +23 -0
- package/dist/RecurringSelect-2cd2b2cf.js +80 -0
- package/dist/RecurringSelect-d6eb7eba.js +74 -0
- package/dist/Select/index.js +26 -0
- package/dist/Select/index.mjs +17 -0
- package/dist/Spinner/index.js +12 -0
- package/dist/Spinner/index.mjs +4 -0
- package/dist/Spinner-5d8359b8.js +17 -0
- package/dist/Spinner-9d8fc7ff.js +24 -0
- package/dist/StatusIndicator/index.js +11 -0
- package/dist/StatusIndicator/index.mjs +3 -0
- package/dist/StatusIndicator-0a3a2d8a.js +12 -0
- package/dist/StatusIndicator-b179d06e.js +18 -0
- package/dist/StatusLabel/index.js +15 -0
- package/dist/StatusLabel/index.mjs +7 -0
- package/dist/StatusLabel-9a8fbdd0.js +19 -0
- package/dist/StatusLabel-f5fdd599.js +26 -0
- package/dist/Switch/index.js +13 -0
- package/dist/Switch/index.mjs +5 -0
- package/dist/Switch-258e7a55.js +49 -0
- package/dist/Switch-7d4aa7c3.js +56 -0
- package/dist/Table/index.js +20 -0
- package/dist/Table/index.mjs +5 -0
- package/dist/Tabs/index.js +14 -0
- package/dist/Tabs/index.mjs +5 -0
- package/dist/Tabs-0dd29b9b.js +78 -0
- package/dist/Tabs-4c37b15f.js +70 -0
- package/dist/Text/index.js +13 -0
- package/dist/Text/index.mjs +5 -0
- package/dist/Text-259af966.js +31 -0
- package/dist/Text-c9162504.js +25 -0
- package/dist/Toast/index.js +19 -0
- package/dist/Toast/index.mjs +11 -0
- package/dist/Tooltip/index.js +16 -0
- package/dist/Tooltip/index.mjs +8 -0
- package/dist/Tooltip-d1fc7e74.js +104 -0
- package/dist/Tooltip-ef3d6ef4.js +112 -0
- package/dist/Typography/css/Emphasis.css.d.ts +6 -0
- package/dist/Typography/css/FontFamilies.css.d.ts +6 -0
- package/dist/Typography/css/FontSizes.css.d.ts +12 -0
- package/dist/Typography/css/FontWeights.css.d.ts +10 -0
- package/dist/Typography/css/TextAlignment.css.d.ts +7 -0
- package/dist/Typography/css/TextCases.css.d.ts +7 -0
- package/dist/Typography/css/TextColors.css.d.ts +22 -0
- package/dist/Typography/css/Truncate.css.d.ts +5 -0
- package/dist/Typography/css/Typography.css.d.ts +5 -0
- package/dist/Typography/index.js +12 -0
- package/dist/Typography/index.mjs +4 -0
- package/dist/Typography-7cc5daf5.js +55 -0
- package/dist/Typography-c45bf216.js +62 -0
- package/dist/getAtlantisConfig-0f3e8af2.js +13 -0
- package/dist/getAtlantisConfig-5b50057c.js +11 -0
- package/dist/helpers-686e91da.js +15 -0
- package/dist/helpers-8ea80269.js +37 -0
- package/dist/index.js +274 -0
- package/dist/index.mjs +162 -0
- package/dist/showToast-59a77248.js +100 -0
- package/dist/showToast-c1e660fd.js +106 -0
- package/dist/style-inject.es-9d2f5f4e.js +30 -0
- package/dist/style-inject.es-a0e1a0ba.js +28 -0
- package/dist/tslib.es6-754e2961.js +46 -0
- package/dist/tslib.es6-c563c1dd.js +43 -0
- package/dist/useActiveLayout-101129a8.js +14 -0
- package/dist/useActiveLayout-adbf2bc3.js +16 -0
- package/dist/useBatchSelect-33acc2fc.js +36 -0
- package/dist/useBatchSelect-ac66c1cb.js +38 -0
- package/dist/useChildComponent-13989d0a.js +15 -0
- package/dist/useChildComponent-d661dbd6.js +21 -0
- package/dist/useResponsiveSizing-10f0860d.js +45 -0
- package/dist/useResponsiveSizing-c1e28e54.js +43 -0
- package/dist/useScrollToActive-056749d8.js +271 -0
- package/dist/useScrollToActive-ace6c5ba.js +259 -0
- package/package.json +6 -364
- package/rollup.config.js +82 -20
- package/dist/index.cjs +0 -6721
- package/dist/index.esm.js +0 -6603
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { Children, isValidElement } from 'react';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import { B as BREAKPOINTS } from './DataList.const-3ae7ceef.js';
|
|
4
|
+
import { D as DataListTags } from './DataListTags-68b3a874.js';
|
|
5
|
+
import { D as DataListHeaderTile } from './DataListHeaderTile-8854e4d8.js';
|
|
6
|
+
import { F as FormatDate } from './FormatDate-720b39cf.js';
|
|
7
|
+
import { T as Text } from './Text-c9162504.js';
|
|
8
|
+
import { H as Heading } from './Heading-93e755cb.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Return the child component that matches the `type` provided
|
|
12
|
+
*/
|
|
13
|
+
function getCompoundComponent(children, type) {
|
|
14
|
+
const childrenArray = Children.toArray(children);
|
|
15
|
+
const element = childrenArray.find(child => isValidElement(child) && child.type === type);
|
|
16
|
+
// Comply with the return type without casting it
|
|
17
|
+
return isValidElement(element) ? element : undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Return all instances child component that matches the `type` provided
|
|
21
|
+
*/
|
|
22
|
+
function getCompoundComponents(children, type) {
|
|
23
|
+
const childrenArray = Children.toArray(children);
|
|
24
|
+
const elements = childrenArray.filter((child) => isValidElement(child) && child.type === type);
|
|
25
|
+
return elements;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Generate the default element the DataList would use on the data provided.
|
|
29
|
+
*/
|
|
30
|
+
function generateListItemElement(item) {
|
|
31
|
+
return Object.keys(item).reduce((acc, key) => {
|
|
32
|
+
const currentItem = item[key];
|
|
33
|
+
if (!currentItem) {
|
|
34
|
+
return acc;
|
|
35
|
+
}
|
|
36
|
+
if (key === "tags" && Array.isArray(currentItem)) {
|
|
37
|
+
acc[key] = React.createElement(DataListTags, { items: currentItem });
|
|
38
|
+
}
|
|
39
|
+
else if (key === "label" && typeof currentItem === "string") {
|
|
40
|
+
acc[key] = React.createElement(Heading, { level: 5 }, currentItem);
|
|
41
|
+
}
|
|
42
|
+
else if (isValidElement(currentItem)) {
|
|
43
|
+
acc[key] = currentItem;
|
|
44
|
+
}
|
|
45
|
+
else if (currentItem instanceof Date) {
|
|
46
|
+
acc[key] = (React.createElement(Text, { variation: "subdued" },
|
|
47
|
+
React.createElement(FormatDate, { date: currentItem })));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
acc[key] = React.createElement(Text, { variation: "subdued" }, currentItem);
|
|
51
|
+
}
|
|
52
|
+
return acc;
|
|
53
|
+
}, {});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Generate the header elements with the default styling
|
|
57
|
+
*/
|
|
58
|
+
function generateHeaderElements(headers) {
|
|
59
|
+
const headerElements = Object.keys(headers).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: React.createElement(DataListHeaderTile, { headers: headers, headerKey: key, visible: true }) })), {});
|
|
60
|
+
return isEmpty(headerElements) ? undefined : headerElements;
|
|
61
|
+
}
|
|
62
|
+
function sortBreakpoints(sizeProp) {
|
|
63
|
+
return sizeProp.sort((a, b) => BREAKPOINTS.indexOf(a) - BREAKPOINTS.indexOf(b));
|
|
64
|
+
}
|
|
65
|
+
function getExposedActions(childrenArray, childCount = 2) {
|
|
66
|
+
const firstNChildren = childrenArray.slice(0, childCount);
|
|
67
|
+
return firstNChildren.reduce((result, child, i) => {
|
|
68
|
+
const hasIcon = Boolean(child.props.icon);
|
|
69
|
+
if (!hasIcon)
|
|
70
|
+
return result; // If the child does not have an icon, continue.
|
|
71
|
+
const isLastChildAdded = result.length === i;
|
|
72
|
+
// If it's the first child or if the previous child was added, then add this child.
|
|
73
|
+
if (i === 0 || (i < childCount && isLastChildAdded)) {
|
|
74
|
+
return [...result, child];
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}, []);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { getCompoundComponents as a, generateHeaderElements as b, getExposedActions as c, generateListItemElement as d, getCompoundComponent as g, sortBreakpoints as s };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Typography = require('./Typography-c45bf216.js');
|
|
5
|
+
var Icon = require('./Icon-405a216c.js');
|
|
6
|
+
var DataListLayoutContext = require('./DataListLayoutContext-39a0d016.js');
|
|
7
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var css_248z = ".iyg43v-S9yU- {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n min-height: 44px;\n padding: calc(16px / 2);\n padding: var(--space-small);\n border: none;\n border-radius: 0;\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n font-size: calc((16px * 1) * 0.875);\n font-size: calc(calc(16px * 1) * 0.875);\n font-size: var(--typography--fontSize-base);\n text-align: left;\n background: none;\n cursor: pointer;\n transition: background 200ms ease;\n transition: background var(--timing-base) ease;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: justify;\n justify-content: space-between;\n gap: calc(16px / 2);\n gap: var(--space-small);\n}\n\n.iyg43v-S9yU-:hover,\n.iyg43v-S9yU-:focus {\n background-color: rgb(244, 246, 250);\n background-color: var(--color-surface--hover);\n}\n\n.iyg43v-S9yU-:focus,\n.iyg43v-S9yU-:focus-visible {\n outline: none;\n}\n\n.iyg43v-S9yU-:focus-visible {\n box-shadow: 0px 0px 0px calc(16px / 8) rgba(255, 255, 255, 1),\n 0px 0px 0px calc(16px / 4) rgb(147, 161, 169);\n box-shadow: var(--shadow-focus);\n}\n\n.AUJNqz93ZDA- {\n font-weight: 500;\n}\n";
|
|
14
|
+
var styles = {"action":"iyg43v-S9yU-","label":"AUJNqz93ZDA-"};
|
|
15
|
+
styleInject_es.styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
function DataListAction({ label, icon, destructive, visible = () => true, onClick, }) {
|
|
18
|
+
const { activeItem } = DataListLayoutContext.useDataListLayoutActionsContext();
|
|
19
|
+
// Don't render if the item is not visible
|
|
20
|
+
if (activeItem && !visible(activeItem)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const color = destructive ? "critical" : "heading";
|
|
24
|
+
function getActionLabel() {
|
|
25
|
+
if (typeof label === "string") {
|
|
26
|
+
return label;
|
|
27
|
+
}
|
|
28
|
+
if (activeItem) {
|
|
29
|
+
return label(activeItem);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return (React__default["default"].createElement("button", { type: "button", className: styles.action, onClick: handleClick },
|
|
33
|
+
React__default["default"].createElement(Typography.Typography, { textColor: color },
|
|
34
|
+
React__default["default"].createElement("span", { className: styles.label }, getActionLabel())),
|
|
35
|
+
icon && React__default["default"].createElement(Icon.Icon, { name: icon, color: color })));
|
|
36
|
+
function handleClick() {
|
|
37
|
+
if (activeItem) {
|
|
38
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(activeItem);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.DataListAction = DataListAction;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { T as Typography } from './Typography-7cc5daf5.js';
|
|
3
|
+
import { I as Icon } from './Icon-22723fe6.js';
|
|
4
|
+
import { u as useDataListLayoutActionsContext } from './DataListLayoutContext-9237afd1.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = ".iyg43v-S9yU- {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n min-height: 44px;\n padding: calc(16px / 2);\n padding: var(--space-small);\n border: none;\n border-radius: 0;\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n font-size: calc((16px * 1) * 0.875);\n font-size: calc(calc(16px * 1) * 0.875);\n font-size: var(--typography--fontSize-base);\n text-align: left;\n background: none;\n cursor: pointer;\n transition: background 200ms ease;\n transition: background var(--timing-base) ease;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: justify;\n justify-content: space-between;\n gap: calc(16px / 2);\n gap: var(--space-small);\n}\n\n.iyg43v-S9yU-:hover,\n.iyg43v-S9yU-:focus {\n background-color: rgb(244, 246, 250);\n background-color: var(--color-surface--hover);\n}\n\n.iyg43v-S9yU-:focus,\n.iyg43v-S9yU-:focus-visible {\n outline: none;\n}\n\n.iyg43v-S9yU-:focus-visible {\n box-shadow: 0px 0px 0px calc(16px / 8) rgba(255, 255, 255, 1),\n 0px 0px 0px calc(16px / 4) rgb(147, 161, 169);\n box-shadow: var(--shadow-focus);\n}\n\n.AUJNqz93ZDA- {\n font-weight: 500;\n}\n";
|
|
8
|
+
var styles = {"action":"iyg43v-S9yU-","label":"AUJNqz93ZDA-"};
|
|
9
|
+
styleInject(css_248z);
|
|
10
|
+
|
|
11
|
+
function DataListAction({ label, icon, destructive, visible = () => true, onClick, }) {
|
|
12
|
+
const { activeItem } = useDataListLayoutActionsContext();
|
|
13
|
+
// Don't render if the item is not visible
|
|
14
|
+
if (activeItem && !visible(activeItem)) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const color = destructive ? "critical" : "heading";
|
|
18
|
+
function getActionLabel() {
|
|
19
|
+
if (typeof label === "string") {
|
|
20
|
+
return label;
|
|
21
|
+
}
|
|
22
|
+
if (activeItem) {
|
|
23
|
+
return label(activeItem);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return (React.createElement("button", { type: "button", className: styles.action, onClick: handleClick },
|
|
27
|
+
React.createElement(Typography, { textColor: color },
|
|
28
|
+
React.createElement("span", { className: styles.label }, getActionLabel())),
|
|
29
|
+
icon && React.createElement(Icon, { name: icon, color: color })));
|
|
30
|
+
function handleClick() {
|
|
31
|
+
if (activeItem) {
|
|
32
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(activeItem);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { DataListAction as D };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { Children, isValidElement } from 'react';
|
|
2
|
+
import { T as Tooltip } from './Tooltip-d1fc7e74.js';
|
|
3
|
+
import { B as Button } from './Button-9ae092b3.js';
|
|
4
|
+
import { D as DataListOverflowFade } from './DataListOverflowFade-a640f51f.js';
|
|
5
|
+
import { c as getExposedActions } from './DataList.utils-d51eb44e.js';
|
|
6
|
+
import { u as useDataListLayoutActionsContext } from './DataListLayoutContext-9237afd1.js';
|
|
7
|
+
import { D as DataListItemActionsOverflow } from './DataListItemActionsOverflow-6004ba59.js';
|
|
8
|
+
|
|
9
|
+
function DataListActions({ children, itemsToExpose = 2, }) {
|
|
10
|
+
const { activeItem } = useDataListLayoutActionsContext();
|
|
11
|
+
const childrenArray = Children.toArray(children).filter(isValidElement);
|
|
12
|
+
const exposedActions = getExposedActions(childrenArray, itemsToExpose);
|
|
13
|
+
childrenArray.splice(0, exposedActions.length);
|
|
14
|
+
return (React.createElement(DataListOverflowFade, null,
|
|
15
|
+
exposedActions.map(({ props }) => {
|
|
16
|
+
if (props.visible && !props.visible(activeItem))
|
|
17
|
+
return null;
|
|
18
|
+
if (!props.icon)
|
|
19
|
+
return null;
|
|
20
|
+
function getActionLabel() {
|
|
21
|
+
if (typeof props.label === "string") {
|
|
22
|
+
return props.label;
|
|
23
|
+
}
|
|
24
|
+
if (activeItem) {
|
|
25
|
+
return props.label(activeItem);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const actionLabel = getActionLabel();
|
|
29
|
+
return (React.createElement(Tooltip, { key: actionLabel, message: actionLabel },
|
|
30
|
+
React.createElement(Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
if (activeItem) {
|
|
33
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
(_b = props.onClick) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
37
|
+
}
|
|
38
|
+
}, type: "secondary", variation: "subtle" })));
|
|
39
|
+
}),
|
|
40
|
+
React.createElement(DataListItemActionsOverflow, { actions: childrenArray })));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { DataListActions as D };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var Tooltip = require('./Tooltip-ef3d6ef4.js');
|
|
5
|
+
var Button = require('./Button-b73a5e01.js');
|
|
6
|
+
var DataListOverflowFade = require('./DataListOverflowFade-85c826e0.js');
|
|
7
|
+
var DataList_utils = require('./DataList.utils-b72b8d0d.js');
|
|
8
|
+
var DataListLayoutContext = require('./DataListLayoutContext-39a0d016.js');
|
|
9
|
+
var DataListItemActionsOverflow = require('./DataListItemActionsOverflow-9c491ed9.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
function DataListActions({ children, itemsToExpose = 2, }) {
|
|
16
|
+
const { activeItem } = DataListLayoutContext.useDataListLayoutActionsContext();
|
|
17
|
+
const childrenArray = React.Children.toArray(children).filter(React.isValidElement);
|
|
18
|
+
const exposedActions = DataList_utils.getExposedActions(childrenArray, itemsToExpose);
|
|
19
|
+
childrenArray.splice(0, exposedActions.length);
|
|
20
|
+
return (React__default["default"].createElement(DataListOverflowFade.DataListOverflowFade, null,
|
|
21
|
+
exposedActions.map(({ props }) => {
|
|
22
|
+
if (props.visible && !props.visible(activeItem))
|
|
23
|
+
return null;
|
|
24
|
+
if (!props.icon)
|
|
25
|
+
return null;
|
|
26
|
+
function getActionLabel() {
|
|
27
|
+
if (typeof props.label === "string") {
|
|
28
|
+
return props.label;
|
|
29
|
+
}
|
|
30
|
+
if (activeItem) {
|
|
31
|
+
return props.label(activeItem);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const actionLabel = getActionLabel();
|
|
35
|
+
return (React__default["default"].createElement(Tooltip.Tooltip, { key: actionLabel, message: actionLabel },
|
|
36
|
+
React__default["default"].createElement(Button.Button, { icon: props.icon, ariaLabel: actionLabel, onClick: () => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
if (activeItem) {
|
|
39
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, activeItem);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
(_b = props.onClick) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
43
|
+
}
|
|
44
|
+
}, type: "secondary", variation: "subtle" })));
|
|
45
|
+
}),
|
|
46
|
+
React__default["default"].createElement(DataListItemActionsOverflow.DataListItemActionsOverflow, { actions: childrenArray })));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
exports.DataListActions = DataListActions;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
|
+
import { useFocusTrap } from '@jobber/hooks/useFocusTrap';
|
|
4
|
+
import { useRefocusOnActivator } from '@jobber/hooks/useRefocusOnActivator';
|
|
5
|
+
import { useOnKeyDown } from '@jobber/hooks/useOnKeyDown';
|
|
6
|
+
import { createPortal } from 'react-dom';
|
|
7
|
+
import { tokens } from '@jobber/design';
|
|
8
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
9
|
+
import { f as TRANSITION_DELAY_IN_SECONDS } from './DataList.const-3ae7ceef.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = ".aokwZU8jbWU- {\n position: fixed;\n top: 0;\n top: var(--actions-menu-y, 0);\n left: 0;\n left: var(--actions-menu-x, 0);\n z-index: 6;\n z-index: var(--elevation-menu);\n min-width: 150px;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 2);\n border-radius: var(--radius-larger);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.jobber-retheme .aokwZU8jbWU- {\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n}\n\n.XtVRP97TVSE- {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(6 - 1);\n z-index: calc(var(--elevation-menu) - 1);\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: transparent;\n}\n";
|
|
12
|
+
var styles = {"menu":"aokwZU8jbWU-","overlay":"XtVRP97TVSE-"};
|
|
13
|
+
styleInject(css_248z);
|
|
14
|
+
|
|
15
|
+
const variants = {
|
|
16
|
+
hidden: { opacity: 0, y: -10 },
|
|
17
|
+
visible: { opacity: 1, y: 0 },
|
|
18
|
+
};
|
|
19
|
+
function DataListActionsMenu({ visible = false, position, onRequestClose, children, }) {
|
|
20
|
+
const [ref, setRef] = useState();
|
|
21
|
+
useRefocusOnActivator(visible);
|
|
22
|
+
const focusTrapRef = useFocusTrap(visible);
|
|
23
|
+
useOnKeyDown(onRequestClose, "Escape");
|
|
24
|
+
return createPortal(React.createElement(AnimatePresence, null, visible && (React.createElement("div", { ref: focusTrapRef, onClick: handleClick },
|
|
25
|
+
React.createElement(motion.div, { role: "menu", ref: setRef, variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: TRANSITION_DELAY_IN_SECONDS }, className: styles.menu, style: getPositionCssVars(), onClick: onRequestClose }, children),
|
|
26
|
+
React.createElement("button", { type: "button", className: styles.overlay, onClick: onRequestClose, "aria-label": "Close menu" })))), document.body);
|
|
27
|
+
function handleClick(event) {
|
|
28
|
+
// Prevent menu from firing the parent's onClick event when it is nested
|
|
29
|
+
// within a clickable list item
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
}
|
|
32
|
+
function getPositionCssVars() {
|
|
33
|
+
const { posX, posY } = getPosition();
|
|
34
|
+
return {
|
|
35
|
+
"--actions-menu-x": `${posX}px`,
|
|
36
|
+
"--actions-menu-y": `${posY}px`,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function getPosition() {
|
|
40
|
+
const rect = ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect();
|
|
41
|
+
const { width = 0, height = 0 } = rect || {};
|
|
42
|
+
const { x, y } = position;
|
|
43
|
+
const xIsOffScreen = x + width > window.innerWidth;
|
|
44
|
+
const yIsOffScreen = y + height > window.innerHeight;
|
|
45
|
+
const xOffSet = x + width - window.innerWidth + tokens["space-base"];
|
|
46
|
+
const yOffSet = y + height - window.innerHeight;
|
|
47
|
+
const newPosX = Math.floor(xIsOffScreen ? x - xOffSet : x);
|
|
48
|
+
const newPosY = Math.floor(yIsOffScreen ? y - yOffSet : y);
|
|
49
|
+
return { posX: newPosX, posY: newPosY };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { DataListActionsMenu as D };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
var useFocusTrap = require('@jobber/hooks/useFocusTrap');
|
|
6
|
+
var useRefocusOnActivator = require('@jobber/hooks/useRefocusOnActivator');
|
|
7
|
+
var useOnKeyDown = require('@jobber/hooks/useOnKeyDown');
|
|
8
|
+
var ReactDOM = require('react-dom');
|
|
9
|
+
var design = require('@jobber/design');
|
|
10
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
11
|
+
var DataList_const = require('./DataList.const-c05b47de.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
|
|
17
|
+
var css_248z = ".aokwZU8jbWU- {\n position: fixed;\n top: 0;\n top: var(--actions-menu-y, 0);\n left: 0;\n left: var(--actions-menu-x, 0);\n z-index: 6;\n z-index: var(--elevation-menu);\n min-width: 150px;\n box-shadow: 0px calc(16px / 16) calc(16px / 4) 0px\n rgba(0, 0, 0, 0.1),\n 0px calc(16px / 4) 12px 0px rgba(0, 0, 0, 0.05);\n box-shadow: var(--shadow-base);\n padding: calc(16px / 4);\n padding: var(--space-smaller);\n border: calc(16px / 16) solid rgb(217, 223, 225);\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(16px / 2);\n border-radius: var(--radius-larger);\n background-color: rgba(255, 255, 255, 1);\n background-color: var(--color-surface);\n}\n\n.jobber-retheme .aokwZU8jbWU- {\n border-radius: calc(16px / 8);\n border-radius: var(--radius-base);\n}\n\n.XtVRP97TVSE- {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(6 - 1);\n z-index: calc(var(--elevation-menu) - 1);\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n background-color: transparent;\n}\n";
|
|
18
|
+
var styles = {"menu":"aokwZU8jbWU-","overlay":"XtVRP97TVSE-"};
|
|
19
|
+
styleInject_es.styleInject(css_248z);
|
|
20
|
+
|
|
21
|
+
const variants = {
|
|
22
|
+
hidden: { opacity: 0, y: -10 },
|
|
23
|
+
visible: { opacity: 1, y: 0 },
|
|
24
|
+
};
|
|
25
|
+
function DataListActionsMenu({ visible = false, position, onRequestClose, children, }) {
|
|
26
|
+
const [ref, setRef] = React.useState();
|
|
27
|
+
useRefocusOnActivator.useRefocusOnActivator(visible);
|
|
28
|
+
const focusTrapRef = useFocusTrap.useFocusTrap(visible);
|
|
29
|
+
useOnKeyDown.useOnKeyDown(onRequestClose, "Escape");
|
|
30
|
+
return ReactDOM.createPortal(React__default["default"].createElement(framerMotion.AnimatePresence, null, visible && (React__default["default"].createElement("div", { ref: focusTrapRef, onClick: handleClick },
|
|
31
|
+
React__default["default"].createElement(framerMotion.motion.div, { role: "menu", ref: setRef, variants: variants, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration: DataList_const.TRANSITION_DELAY_IN_SECONDS }, className: styles.menu, style: getPositionCssVars(), onClick: onRequestClose }, children),
|
|
32
|
+
React__default["default"].createElement("button", { type: "button", className: styles.overlay, onClick: onRequestClose, "aria-label": "Close menu" })))), document.body);
|
|
33
|
+
function handleClick(event) {
|
|
34
|
+
// Prevent menu from firing the parent's onClick event when it is nested
|
|
35
|
+
// within a clickable list item
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
}
|
|
38
|
+
function getPositionCssVars() {
|
|
39
|
+
const { posX, posY } = getPosition();
|
|
40
|
+
return {
|
|
41
|
+
"--actions-menu-x": `${posX}px`,
|
|
42
|
+
"--actions-menu-y": `${posY}px`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function getPosition() {
|
|
46
|
+
const rect = ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect();
|
|
47
|
+
const { width = 0, height = 0 } = rect || {};
|
|
48
|
+
const { x, y } = position;
|
|
49
|
+
const xIsOffScreen = x + width > window.innerWidth;
|
|
50
|
+
const yIsOffScreen = y + height > window.innerHeight;
|
|
51
|
+
const xOffSet = x + width - window.innerWidth + design.tokens["space-base"];
|
|
52
|
+
const yOffSet = y + height - window.innerHeight;
|
|
53
|
+
const newPosX = Math.floor(xIsOffScreen ? x - xOffSet : x);
|
|
54
|
+
const newPosY = Math.floor(yIsOffScreen ? y - yOffSet : y);
|
|
55
|
+
return { posX: newPosX, posY: newPosY };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
exports.DataListActionsMenu = DataListActionsMenu;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
3
|
+
import { u as useDataListContext } from './DataListContext-736a42a2.js';
|
|
4
|
+
import { D as DataListActions } from './DataListActions-c5ad9b23.js';
|
|
5
|
+
import { u as useResponsiveSizing } from './useResponsiveSizing-c1e28e54.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = ".v-GrdlFpBLk- {\n /* Offset the button's padding so the height of the header bar doesn't change */\n margin: calc((16px / 2) * -1) 0;\n margin: calc(calc(16px / 2) * -1) 0;\n margin: calc(var(--space-small) * -1) 0;\n}\n";
|
|
8
|
+
var styles = {"bulkActions":"v-GrdlFpBLk-"};
|
|
9
|
+
styleInject(css_248z);
|
|
10
|
+
|
|
11
|
+
// This component is meant to capture the props of the DataList.BulkActions
|
|
12
|
+
function DataListBulkActions(
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
_) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function InternalDataListBulkActions() {
|
|
18
|
+
const { bulkActionsComponent } = useDataListContext();
|
|
19
|
+
if (!bulkActionsComponent)
|
|
20
|
+
return null;
|
|
21
|
+
const { children } = bulkActionsComponent.props;
|
|
22
|
+
const { sm } = useResponsiveSizing();
|
|
23
|
+
// Collapse all actions under "More actions" when breakpoint is smaller than sm
|
|
24
|
+
const itemsToExpose = sm ? 3 : 0;
|
|
25
|
+
return (React.createElement("div", { className: styles.bulkActions },
|
|
26
|
+
React.createElement(DataListActions, { itemsToExpose: itemsToExpose }, children)));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { DataListBulkActions as D, InternalDataListBulkActions as I };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
5
|
+
var DataListContext = require('./DataListContext-f40570a7.js');
|
|
6
|
+
var DataListActions = require('./DataListActions-f8367eda.js');
|
|
7
|
+
var useResponsiveSizing = require('./useResponsiveSizing-10f0860d.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var css_248z = ".v-GrdlFpBLk- {\n /* Offset the button's padding so the height of the header bar doesn't change */\n margin: calc((16px / 2) * -1) 0;\n margin: calc(calc(16px / 2) * -1) 0;\n margin: calc(var(--space-small) * -1) 0;\n}\n";
|
|
14
|
+
var styles = {"bulkActions":"v-GrdlFpBLk-"};
|
|
15
|
+
styleInject_es.styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
// This component is meant to capture the props of the DataList.BulkActions
|
|
18
|
+
function DataListBulkActions(
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
+
_) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function InternalDataListBulkActions() {
|
|
24
|
+
const { bulkActionsComponent } = DataListContext.useDataListContext();
|
|
25
|
+
if (!bulkActionsComponent)
|
|
26
|
+
return null;
|
|
27
|
+
const { children } = bulkActionsComponent.props;
|
|
28
|
+
const { sm } = useResponsiveSizing.useResponsiveSizing();
|
|
29
|
+
// Collapse all actions under "More actions" when breakpoint is smaller than sm
|
|
30
|
+
const itemsToExpose = sm ? 3 : 0;
|
|
31
|
+
return (React__default["default"].createElement("div", { className: styles.bulkActions },
|
|
32
|
+
React__default["default"].createElement(DataListActions.DataListActions, { itemsToExpose: itemsToExpose }, children)));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.DataListBulkActions = DataListBulkActions;
|
|
36
|
+
exports.InternalDataListBulkActions = InternalDataListBulkActions;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import noop from 'lodash/noop';
|
|
3
|
+
|
|
4
|
+
const defaultValues = {
|
|
5
|
+
title: "",
|
|
6
|
+
data: [],
|
|
7
|
+
headers: {},
|
|
8
|
+
children: [],
|
|
9
|
+
selected: [],
|
|
10
|
+
layoutBreakpoints: [],
|
|
11
|
+
layouts: {
|
|
12
|
+
xs: children => React.createElement(React.Fragment, null, children),
|
|
13
|
+
sm: children => React.createElement(React.Fragment, null, children),
|
|
14
|
+
md: children => React.createElement(React.Fragment, null, children),
|
|
15
|
+
lg: children => React.createElement(React.Fragment, null, children),
|
|
16
|
+
xl: children => React.createElement(React.Fragment, null, children),
|
|
17
|
+
},
|
|
18
|
+
registerLayout: noop,
|
|
19
|
+
};
|
|
20
|
+
const DataListContext = createContext(defaultValues);
|
|
21
|
+
function useDataListContext() {
|
|
22
|
+
return useContext(DataListContext);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { DataListContext as D, defaultValues as d, useDataListContext as u };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var noop = require('lodash/noop');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
var noop__default = /*#__PURE__*/_interopDefaultLegacy(noop);
|
|
10
|
+
|
|
11
|
+
const defaultValues = {
|
|
12
|
+
title: "",
|
|
13
|
+
data: [],
|
|
14
|
+
headers: {},
|
|
15
|
+
children: [],
|
|
16
|
+
selected: [],
|
|
17
|
+
layoutBreakpoints: [],
|
|
18
|
+
layouts: {
|
|
19
|
+
xs: children => React__default["default"].createElement(React__default["default"].Fragment, null, children),
|
|
20
|
+
sm: children => React__default["default"].createElement(React__default["default"].Fragment, null, children),
|
|
21
|
+
md: children => React__default["default"].createElement(React__default["default"].Fragment, null, children),
|
|
22
|
+
lg: children => React__default["default"].createElement(React__default["default"].Fragment, null, children),
|
|
23
|
+
xl: children => React__default["default"].createElement(React__default["default"].Fragment, null, children),
|
|
24
|
+
},
|
|
25
|
+
registerLayout: noop__default["default"],
|
|
26
|
+
};
|
|
27
|
+
const DataListContext = React.createContext(defaultValues);
|
|
28
|
+
function useDataListContext() {
|
|
29
|
+
return React.useContext(DataListContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.DataListContext = DataListContext;
|
|
33
|
+
exports.defaultValues = defaultValues;
|
|
34
|
+
exports.useDataListContext = useDataListContext;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
5
|
+
var DataListContext = require('./DataListContext-f40570a7.js');
|
|
6
|
+
var Text = require('./Text-259af966.js');
|
|
7
|
+
var Button = require('./Button-b73a5e01.js');
|
|
8
|
+
var DataList_const = require('./DataList.const-c05b47de.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
|
|
14
|
+
var css_248z = ".zg3w9nQga-M- {\n display: -ms-flexbox;\n display: flex;\n box-sizing: border-box;\n padding: calc(16px * 1);\n padding: var(--space-base);\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-direction: column;\n flex-direction: column;\n row-gap: calc(16px * 1);\n row-gap: var(--space-base);\n -ms-flex-align: center;\n align-items: center;\n -ms-flex: 1;\n flex: 1;\n}\n";
|
|
15
|
+
var styles = {"emptyStateWrapper":"zg3w9nQga-M-"};
|
|
16
|
+
styleInject_es.styleInject(css_248z);
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
+
function DataListEmptyState(_) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function InternalDataListEmptyState() {
|
|
23
|
+
const { emptyStateComponents: components, filtered } = React.useContext(DataListContext.DataListContext);
|
|
24
|
+
const { message, action } = getMessages();
|
|
25
|
+
return (React__default["default"].createElement("div", { className: styles.emptyStateWrapper },
|
|
26
|
+
React__default["default"].createElement(Text.Text, { align: "center" }, message),
|
|
27
|
+
renderButton(action)));
|
|
28
|
+
function getMessages() {
|
|
29
|
+
const { defaultEmptyState, filteredEmptyState } = getEmptyStates(components);
|
|
30
|
+
if (filtered) {
|
|
31
|
+
return {
|
|
32
|
+
message: (filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.message) || DataList_const.EMPTY_FILTER_RESULTS_MESSAGE,
|
|
33
|
+
action: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.action,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
message: (defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.message) || DataList_const.EMPTY_RESULTS_MESSAGE,
|
|
38
|
+
action: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.action,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function renderButton(action) {
|
|
43
|
+
if (action) {
|
|
44
|
+
if (action.type === Button.Button) {
|
|
45
|
+
return React.cloneElement(action, {
|
|
46
|
+
variation: action.props.variation || "subtle",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
throw new Error(DataList_const.EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR);
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
function getEmptyStates(components) {
|
|
54
|
+
const defaultEmptyState = components === null || components === void 0 ? void 0 : components.find(es => es.props.type === "empty" || es.props.type === undefined);
|
|
55
|
+
const filteredEmptyState = components === null || components === void 0 ? void 0 : components.find(es => es.props.type === "filtered");
|
|
56
|
+
return { defaultEmptyState, filteredEmptyState };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
exports.DataListEmptyState = DataListEmptyState;
|
|
60
|
+
exports.InternalDataListEmptyState = InternalDataListEmptyState;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useContext, cloneElement } from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
3
|
+
import { D as DataListContext } from './DataListContext-736a42a2.js';
|
|
4
|
+
import { T as Text } from './Text-c9162504.js';
|
|
5
|
+
import { B as Button } from './Button-9ae092b3.js';
|
|
6
|
+
import { E as EMPTY_FILTER_RESULTS_MESSAGE, b as EMPTY_RESULTS_MESSAGE, c as EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR } from './DataList.const-3ae7ceef.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = ".zg3w9nQga-M- {\n display: -ms-flexbox;\n display: flex;\n box-sizing: border-box;\n padding: calc(16px * 1);\n padding: var(--space-base);\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-direction: column;\n flex-direction: column;\n row-gap: calc(16px * 1);\n row-gap: var(--space-base);\n -ms-flex-align: center;\n align-items: center;\n -ms-flex: 1;\n flex: 1;\n}\n";
|
|
9
|
+
var styles = {"emptyStateWrapper":"zg3w9nQga-M-"};
|
|
10
|
+
styleInject(css_248z);
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13
|
+
function DataListEmptyState(_) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function InternalDataListEmptyState() {
|
|
17
|
+
const { emptyStateComponents: components, filtered } = useContext(DataListContext);
|
|
18
|
+
const { message, action } = getMessages();
|
|
19
|
+
return (React.createElement("div", { className: styles.emptyStateWrapper },
|
|
20
|
+
React.createElement(Text, { align: "center" }, message),
|
|
21
|
+
renderButton(action)));
|
|
22
|
+
function getMessages() {
|
|
23
|
+
const { defaultEmptyState, filteredEmptyState } = getEmptyStates(components);
|
|
24
|
+
if (filtered) {
|
|
25
|
+
return {
|
|
26
|
+
message: (filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.message) || EMPTY_FILTER_RESULTS_MESSAGE,
|
|
27
|
+
action: filteredEmptyState === null || filteredEmptyState === void 0 ? void 0 : filteredEmptyState.props.action,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
message: (defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.message) || EMPTY_RESULTS_MESSAGE,
|
|
32
|
+
action: defaultEmptyState === null || defaultEmptyState === void 0 ? void 0 : defaultEmptyState.props.action,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function renderButton(action) {
|
|
37
|
+
if (action) {
|
|
38
|
+
if (action.type === Button) {
|
|
39
|
+
return cloneElement(action, {
|
|
40
|
+
variation: action.props.variation || "subtle",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
throw new Error(EMPTY_STATE_ACTION_BUTTON_ONLY_ERROR);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
function getEmptyStates(components) {
|
|
48
|
+
const defaultEmptyState = components === null || components === void 0 ? void 0 : components.find(es => es.props.type === "empty" || es.props.type === undefined);
|
|
49
|
+
const filteredEmptyState = components === null || components === void 0 ? void 0 : components.find(es => es.props.type === "filtered");
|
|
50
|
+
return { defaultEmptyState, filteredEmptyState };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { DataListEmptyState as D, InternalDataListEmptyState as I };
|