@jobber/components 4.90.4 → 4.90.5
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 → index.cjs} +1 -3
- package/dist/AnimatedPresence/index.mjs +4 -0
- package/dist/{AnimatedPresence-20a02aaa.js → AnimatedPresence-BWePg1sL.js} +3 -7
- package/dist/AnimatedPresence-CzXm0q2a.js +98 -0
- package/dist/AnimatedSwitcher/index.cjs +11 -0
- package/dist/AnimatedSwitcher/index.mjs +5 -0
- package/dist/AnimatedSwitcher--j45gdP1.js +90 -0
- package/dist/{AnimatedSwitcher-3d45ec5d.js → AnimatedSwitcher-D_Qj_hx5.js} +4 -8
- package/dist/AtlantisContext/{index.js → index.cjs} +1 -3
- package/dist/AtlantisContext/index.mjs +2 -0
- package/dist/AtlantisContext-B0Zo5l8l.js +18 -0
- package/dist/Autocomplete/index.cjs +33 -0
- package/dist/Autocomplete/index.mjs +27 -0
- package/dist/Autocomplete-DQ9t1vLy.js +190 -0
- package/dist/Autocomplete-W9xb3p2A.js +192 -0
- package/dist/Avatar/index.cjs +12 -0
- package/dist/Avatar/index.mjs +6 -0
- package/dist/Avatar-BPd8t6BU.js +67 -0
- package/dist/Avatar-DTFS2kFm.js +69 -0
- package/dist/Banner/components/BannerIcon/index.cjs +13 -0
- package/dist/Banner/components/BannerIcon/index.mjs +7 -0
- package/dist/Banner/index.cjs +23 -0
- package/dist/Banner/index.mjs +17 -0
- package/dist/Banner-Dpwk3NK9.js +79 -0
- package/dist/Banner-DzeDUJLs.js +81 -0
- package/dist/BannerIcon-Co45J70u.js +19 -0
- package/dist/BannerIcon-CzBZbMVi.js +22 -0
- package/dist/Body-4eoS-dUC.js +45 -0
- package/dist/Body-CwY_QyVF.js +54 -0
- package/dist/Button/index.cjs +13 -0
- package/dist/Button/index.mjs +7 -0
- package/dist/Button-BH4Hhr2S.js +47 -0
- package/dist/Button-BPYGeGx2.js +49 -0
- package/dist/ButtonDismiss/index.cjs +14 -0
- package/dist/ButtonDismiss/index.mjs +8 -0
- package/dist/ButtonDismiss-BajTLHia.js +10 -0
- package/dist/ButtonDismiss-Dwe1QljB.js +8 -0
- package/dist/Card/index.cjs +21 -0
- package/dist/Card/index.mjs +15 -0
- package/dist/Card-DG7RIZdT.js +83 -0
- package/dist/Card-DWjfc534.js +81 -0
- package/dist/Checkbox/index.cjs +15 -0
- package/dist/Checkbox/index.mjs +9 -0
- package/dist/Checkbox-BDVwj5E8.js +53 -0
- package/dist/Checkbox-DDDvFfUJ.js +55 -0
- package/dist/Chip/hooks/index.cjs +8 -0
- package/dist/Chip/hooks/index.mjs +2 -0
- package/dist/Chip/index.cjs +26 -0
- package/dist/Chip/index.mjs +18 -0
- package/dist/Chip-Br7-JkgN.js +70 -0
- package/dist/Chip-CGMUQ-V-.js +67 -0
- package/dist/ChipDismissible-DETPCXth.js +19 -0
- package/dist/ChipDismissible-DyMHTSQ9.js +22 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +23 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +13 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +35 -0
- package/dist/Chips/InternalChipDismissible/index.mjs +29 -0
- package/dist/Chips/index.cjs +48 -0
- package/dist/Chips/index.mjs +44 -0
- package/dist/Chips-B1RCrN1F.js +93 -0
- package/dist/Chips-DXbRgMUE.js +91 -0
- package/dist/Combobox/components/ComboboxAction/index.cjs +12 -0
- package/dist/Combobox/components/ComboboxAction/index.mjs +6 -0
- package/dist/Combobox/components/ComboboxActivator/index.cjs +27 -0
- package/dist/Combobox/components/ComboboxActivator/index.mjs +21 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.cjs +14 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.mjs +8 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.cjs +24 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.mjs +18 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.cjs +10 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.mjs +4 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +9 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +3 -0
- package/dist/Combobox/components/ComboboxContent/index.cjs +34 -0
- package/dist/Combobox/components/ComboboxContent/index.mjs +28 -0
- package/dist/Combobox/components/ComboboxOption/index.cjs +14 -0
- package/dist/Combobox/components/ComboboxOption/index.mjs +8 -0
- package/dist/Combobox/components/ComboboxTrigger/index.cjs +25 -0
- package/dist/Combobox/components/ComboboxTrigger/index.mjs +19 -0
- package/dist/Combobox/index.cjs +53 -0
- package/dist/Combobox/index.mjs +46 -0
- package/dist/Combobox-D0Qo3yYu.js +117 -0
- package/dist/Combobox-DxPzrwcK.js +119 -0
- package/dist/ComboboxAction-Ct0ao84E.js +24 -0
- package/dist/ComboboxAction-I7TT2mVE.js +22 -0
- package/dist/ComboboxActivator-BOGk012k.js +26 -0
- package/dist/ComboboxActivator-uU5VaZqF.js +28 -0
- package/dist/ComboboxContent-miRfjhNV.js +145 -0
- package/dist/ComboboxContent-u1C3PXKH.js +143 -0
- package/dist/ComboboxContentHeader-BF43vAXl.js +27 -0
- package/dist/ComboboxContentHeader-Cirx9k9L.js +29 -0
- package/dist/ComboboxContentList-DFv7m0NQ.js +77 -0
- package/dist/ComboboxContentList-nxCsc_XU.js +75 -0
- package/dist/ComboboxContentSearch-C2RHQNXR.js +34 -0
- package/dist/ComboboxContentSearch-DX-BiYTa.js +32 -0
- package/dist/ComboboxLoadMore-CUK0n3WY.js +16 -0
- package/dist/ComboboxLoadMore-t_s_eVDp.js +14 -0
- package/dist/ComboboxOption-BMg1O_Br.js +20 -0
- package/dist/ComboboxOption-DSzlMoup.js +22 -0
- package/dist/ComboboxProvider-GdvooWYJ.js +10 -0
- package/dist/ComboboxProvider-ku2HdEkO.js +13 -0
- package/dist/ComboboxTrigger-1KuifQvl.js +24 -0
- package/dist/ComboboxTrigger-CvcB6ptJ.js +22 -0
- package/dist/ConfirmationModal/index.cjs +31 -0
- package/dist/ConfirmationModal/index.mjs +25 -0
- package/dist/{ConfirmationModal-b44e302f.js → ConfirmationModal-AtuPSZb4.js} +8 -12
- package/dist/ConfirmationModal-DrQ-Nm1m.js +94 -0
- package/dist/Content/index.cjs +9 -0
- package/dist/Content/index.mjs +3 -0
- package/dist/Content-CobtdYug.js +13 -0
- package/dist/Content-D5eJgx6J.js +15 -0
- package/dist/Countdown/index.cjs +11 -0
- package/dist/Countdown/index.mjs +5 -0
- package/dist/Countdown-CXuL7Gh7.js +659 -0
- package/dist/Countdown-CnIjUABD.js +657 -0
- package/dist/DataDump/index.cjs +24 -0
- package/dist/DataDump/index.mjs +18 -0
- package/dist/DataDump-CXh_x55J.js +15 -0
- package/dist/DataDump-R0kwoLVp.js +17 -0
- package/dist/DataList/components/DataListAction/index.cjs +13 -0
- package/dist/DataList/components/DataListAction/index.mjs +7 -0
- package/dist/DataList/components/DataListActions/index.cjs +43 -0
- package/dist/DataList/components/DataListActions/index.mjs +37 -0
- package/dist/DataList/components/DataListActionsMenu/index.cjs +17 -0
- package/dist/DataList/components/DataListActionsMenu/index.mjs +11 -0
- package/dist/DataList/components/DataListBulkActions/index.cjs +46 -0
- package/dist/DataList/components/DataListBulkActions/index.mjs +39 -0
- package/dist/DataList/components/DataListEmptyState/index.cjs +20 -0
- package/dist/DataList/components/DataListEmptyState/index.mjs +13 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +54 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +48 -0
- package/dist/DataList/components/DataListFilters/index.cjs +68 -0
- package/dist/DataList/components/DataListFilters/index.mjs +61 -0
- package/dist/DataList/components/DataListHeader/index.cjs +53 -0
- package/dist/DataList/components/DataListHeader/index.mjs +47 -0
- package/dist/DataList/components/DataListHeaderTile/components/index.cjs +12 -0
- package/dist/DataList/components/DataListHeaderTile/components/index.mjs +6 -0
- package/dist/DataList/components/DataListHeaderTile/index.cjs +20 -0
- package/dist/DataList/components/DataListHeaderTile/index.mjs +14 -0
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.cjs +14 -0
- package/dist/DataList/components/DataListItem/components/DataListItemClickable/index.mjs +8 -0
- package/dist/DataList/components/DataListItem/index.cjs +52 -0
- package/dist/DataList/components/DataListItem/index.mjs +46 -0
- package/dist/DataList/components/DataListItemActions/index.cjs +45 -0
- package/dist/DataList/components/DataListItemActions/index.mjs +38 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +25 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +19 -0
- package/dist/DataList/components/DataListItems/index.cjs +53 -0
- package/dist/DataList/components/DataListItems/index.mjs +47 -0
- package/dist/DataList/components/DataListLayout/index.cjs +56 -0
- package/dist/DataList/components/DataListLayout/index.mjs +50 -0
- package/dist/DataList/components/DataListLayoutActions/DataListLayoutContext/index.cjs +9 -0
- package/dist/DataList/components/DataListLayoutActions/DataListLayoutContext/index.mjs +2 -0
- package/dist/DataList/components/DataListLayoutActions/index.cjs +33 -0
- package/dist/DataList/components/DataListLayoutActions/index.mjs +27 -0
- package/dist/DataList/components/DataListLoadMore/index.cjs +21 -0
- package/dist/DataList/components/DataListLoadMore/index.mjs +14 -0
- package/dist/DataList/components/DataListLoadingState/index.cjs +21 -0
- package/dist/DataList/components/DataListLoadingState/index.mjs +13 -0
- package/dist/DataList/components/DataListOverflowFade/index.cjs +11 -0
- package/dist/DataList/components/DataListOverflowFade/index.mjs +4 -0
- package/dist/DataList/components/DataListSearch/index.cjs +33 -0
- package/dist/DataList/components/DataListSearch/index.mjs +25 -0
- package/dist/DataList/components/DataListStatusBar/index.cjs +32 -0
- package/dist/DataList/components/DataListStatusBar/index.mjs +25 -0
- package/dist/DataList/components/DataListStickyHeader/index.cjs +11 -0
- package/dist/DataList/components/DataListStickyHeader/index.mjs +5 -0
- package/dist/DataList/components/DataListTags/index.cjs +12 -0
- package/dist/DataList/components/DataListTags/index.mjs +6 -0
- package/dist/DataList/components/DataListTotalCount/index.cjs +15 -0
- package/dist/DataList/components/DataListTotalCount/index.mjs +8 -0
- package/dist/DataList/context/DataListContext/index.cjs +12 -0
- package/dist/DataList/context/DataListContext/index.mjs +4 -0
- package/dist/DataList/context/DataListLayoutContext/index.cjs +12 -0
- package/dist/DataList/context/DataListLayoutContext/index.mjs +4 -0
- package/dist/DataList/index.cjs +98 -0
- package/dist/DataList/index.mjs +92 -0
- package/dist/DataList-BRPBlIVp.js +3 -0
- package/dist/DataList-C_diEjjb.js +5 -0
- package/dist/DataList-DyUX97mL.js +141 -0
- package/dist/DataList-DzXNiSs1.js +139 -0
- package/dist/DataList.const-Bqcfo3vs.js +38 -0
- package/dist/DataList.const-z084v3KH.js +25 -0
- package/dist/DataList.utils-BjG-otvz.js +168 -0
- package/dist/DataList.utils-RcG6TvB4.js +161 -0
- package/dist/DataListAction-3U8gJcpE.js +37 -0
- package/dist/DataListAction-BN0qp_ae.js +39 -0
- package/dist/DataListActions-D1r_3WQD.js +43 -0
- package/dist/DataListActions-DV-03b5h.js +45 -0
- package/dist/DataListActionsMenu-Cg-ZZ0LI.js +55 -0
- package/dist/DataListActionsMenu-D9iOGk3i.js +57 -0
- package/dist/DataListBulkActions-BEFyOkWd.js +29 -0
- package/dist/DataListBulkActions-C2E5e2oE.js +26 -0
- package/dist/DataListContext-DTtBXteA.js +25 -0
- package/dist/DataListContext-qFN5DiHI.js +29 -0
- package/dist/DataListEmptyState-DTsqkHng.js +50 -0
- package/dist/DataListEmptyState-DfaWzs71.js +53 -0
- package/dist/DataListFilters-35MxtHUo.js +43 -0
- package/dist/DataListFilters-BjC9kPSD.js +46 -0
- package/dist/DataListHeader-CI-p6m7K.js +93 -0
- package/dist/DataListHeader-D5iNjhk1.js +95 -0
- package/dist/DataListHeaderTile-DwHOJPOJ.js +81 -0
- package/dist/DataListHeaderTile-K_UG9NgG.js +79 -0
- package/dist/DataListItem-BpD1kRWd.js +112 -0
- package/dist/DataListItem-CK9nQ-II.js +114 -0
- package/dist/DataListItemActions-B7Pbbv7U.js +29 -0
- package/dist/DataListItemActions-DDdszYpl.js +32 -0
- package/dist/DataListItemActionsOverflow-CmBtR4CV.js +33 -0
- package/dist/DataListItemActionsOverflow-D83sgU_z.js +35 -0
- package/dist/DataListItemClickable-BBVDmF_w.js +45 -0
- package/dist/DataListItemClickable-DluGOyKl.js +47 -0
- package/dist/DataListItems-DHSJSPeG.js +21 -0
- package/dist/DataListItems-hAiXRicl.js +19 -0
- package/dist/DataListLayout-CVVR8T7f.js +21 -0
- package/dist/DataListLayout-CiKR3P98.js +19 -0
- package/dist/DataListLayoutActions-BiR49Hjb.js +36 -0
- package/dist/DataListLayoutActions-CUWi8Fxy.js +38 -0
- package/dist/DataListLayoutContext-B3szPGTf.js +8 -0
- package/dist/DataListLayoutContext-CjAT05BI.js +11 -0
- package/dist/DataListLayoutContext-lF5Zk-jV.js +18 -0
- package/dist/DataListLayoutContext-p48sRC9i.js +14 -0
- package/dist/DataListLoadMore-CixukWAA.js +31 -0
- package/dist/DataListLoadMore-Cu32AbMo.js +34 -0
- package/dist/DataListLoadingState-CBsAzSFk.js +22 -0
- package/dist/DataListLoadingState-DFRSjdMI.js +26 -0
- package/dist/DataListOverflowFade-BGAt4dqm.js +25 -0
- package/dist/DataListOverflowFade-DU0y9j-T.js +22 -0
- package/dist/DataListSearch-C1PpW3kQ.js +59 -0
- package/dist/DataListSearch-uEaN0YJ7.js +63 -0
- package/dist/DataListSort-BrRFvXG5.js +92 -0
- package/dist/DataListSort-Dx6POURf.js +94 -0
- package/dist/DataListSortingOptions-BndDkYtw.js +37 -0
- package/dist/DataListSortingOptions-wYjmZSp4.js +35 -0
- package/dist/DataListStatusBar-B_NpGiAA.js +22 -0
- package/dist/DataListStatusBar-VdGpFaWQ.js +25 -0
- package/dist/DataListStickyHeader-CScdFohW.js +25 -0
- package/dist/DataListStickyHeader-YssmrZlM.js +23 -0
- package/dist/DataListTags-B4e8t5VV.js +62 -0
- package/dist/DataListTags-xHDVW7r1.js +64 -0
- package/dist/DataListTotalCount-FvMJCJV4.js +27 -0
- package/dist/DataListTotalCount-TVna906A.js +24 -0
- package/dist/DataTable/index.cjs +36 -0
- package/dist/DataTable/index.mjs +25 -0
- package/dist/DataTable/test-utilities/index.cjs +246 -0
- package/dist/DataTable/test-utilities/index.mjs +238 -0
- package/dist/DataTable-BhmuLCau.js +236 -0
- package/dist/DataTable-DRXABYeP.js +238 -0
- package/dist/DatePicker/index.cjs +26 -0
- package/dist/DatePicker/index.mjs +20 -0
- package/dist/DatePicker-BzXdyAsQ.js +8554 -0
- package/dist/DatePicker-CZnbHBrf.js +8551 -0
- package/dist/DayOfMonthSelect-GTME6B8V.js +130 -0
- package/dist/DayOfMonthSelect-Rxeaskdx.js +137 -0
- package/dist/DescriptionList/index.cjs +10 -0
- package/dist/DescriptionList/index.mjs +4 -0
- package/dist/DescriptionList-CMHhotQz.js +12 -0
- package/dist/DescriptionList-D4V2AGoH.js +14 -0
- package/dist/Disclosure/index.cjs +17 -0
- package/dist/Disclosure/index.mjs +11 -0
- package/dist/Disclosure-B_Ndy93n.js +33 -0
- package/dist/Disclosure-iwknokMb.js +35 -0
- package/dist/Divider/index.cjs +9 -0
- package/dist/Divider/index.mjs +3 -0
- package/dist/Divider-CQwVNie1.js +17 -0
- package/dist/Divider-aDM-8IiX.js +19 -0
- package/dist/Drawer/index.cjs +19 -0
- package/dist/Drawer/index.mjs +12 -0
- package/dist/DrawerGrid-Cy6jFIEj.js +28 -0
- package/dist/DrawerGrid-D-xjQAGo.js +31 -0
- package/dist/Emphasis/index.cjs +10 -0
- package/dist/Emphasis/index.mjs +4 -0
- package/dist/Emphasis-DIJAlzt-.js +13 -0
- package/dist/Emphasis-ZgoNe2R5.js +15 -0
- package/dist/FeatureSwitch/index.cjs +26 -0
- package/dist/FeatureSwitch/index.mjs +20 -0
- package/dist/FeatureSwitch-BKO31OVK.js +52 -0
- package/dist/FeatureSwitch-C4S0awPY.js +54 -0
- package/dist/Flex/index.cjs +9 -0
- package/dist/Flex/index.mjs +3 -0
- package/dist/Flex-Bfl-vL64.js +28 -0
- package/dist/Flex-Dh0WNozY.js +30 -0
- package/dist/Form/index.cjs +10 -0
- package/dist/Form/index.mjs +4 -0
- package/dist/{Form/index.js → Form-5myjIaNx.js} +3 -9
- package/dist/Form-fdEPa2Di.js +48 -0
- package/dist/FormField/index.cjs +20 -0
- package/dist/FormField/index.mjs +14 -0
- package/dist/FormField-DY5JDjdc.js +261 -0
- package/dist/FormField-RMjW742D.js +263 -0
- package/dist/FormatDate/{index.js → index.cjs} +1 -3
- package/dist/FormatDate/index.mjs +2 -0
- package/dist/{FormatDate-70ea5b43.js → FormatDate-CcycFjAL.js} +1 -5
- package/dist/FormatDate-YUbeta27.js +27 -0
- package/dist/FormatEmail/index.cjs +9 -0
- package/dist/FormatEmail/index.mjs +3 -0
- package/dist/FormatEmail-B7cAlIQY.js +11 -0
- package/dist/FormatEmail-DJLlhpQr.js +13 -0
- package/dist/FormatFile/index.cjs +36 -0
- package/dist/FormatFile/index.mjs +30 -0
- package/dist/FormatFile-BAZqq1p8.js +149 -0
- package/dist/FormatFile-CRPcqK86.js +147 -0
- package/dist/FormatRelativeDateTime/index.cjs +8 -0
- package/dist/FormatRelativeDateTime/index.mjs +2 -0
- package/dist/FormatRelativeDateTime-Ca1DyZ7Z.js +64 -0
- package/dist/{FormatRelativeDateTime/index.js → FormatRelativeDateTime-hdrEQWhy.js} +5 -11
- package/dist/FormatTime/index.cjs +8 -0
- package/dist/FormatTime/index.mjs +2 -0
- package/dist/FormatTime-DcIV5E6n.js +29 -0
- package/dist/{FormatTime/index.js → FormatTime-DrHluWW3.js} +1 -7
- package/dist/Gallery/index.cjs +42 -0
- package/dist/Gallery/index.mjs +36 -0
- package/dist/Gallery-D9AVJQTM.js +65 -0
- package/dist/Gallery-Duiow0xg.js +63 -0
- package/dist/Glimmer/index.cjs +12 -0
- package/dist/Glimmer/index.mjs +5 -0
- package/dist/Glimmer-CG9tFCHs.js +63 -0
- package/dist/Glimmer-IWgpoHGI.js +60 -0
- package/dist/Grid/InternalGridCell/index.cjs +9 -0
- package/dist/Grid/InternalGridCell/index.mjs +2 -0
- package/dist/Grid/index.cjs +14 -0
- package/dist/Grid/index.mjs +7 -0
- package/dist/Grid-DzRYkCwi.js +29 -0
- package/dist/Grid-VQ3fN1ko.js +32 -0
- package/dist/Heading/index.cjs +12 -0
- package/dist/Heading/index.mjs +6 -0
- package/dist/Heading-D_ylbFzI.js +49 -0
- package/dist/{Heading-23d382a1.js → Heading-Y2BrFvzY.js} +3 -7
- package/dist/Icon/index.cjs +9 -0
- package/dist/Icon/index.mjs +3 -0
- package/dist/Icon-C05AQvkv.js +36 -0
- package/dist/Icon-Dic5myD3.js +34 -0
- package/dist/InlineLabel/index.cjs +10 -0
- package/dist/InlineLabel/index.mjs +4 -0
- package/dist/InlineLabel-A3tenwf6.js +20 -0
- package/dist/InlineLabel-BLt0Q3bb.js +18 -0
- package/dist/InputAvatar/index.cjs +26 -0
- package/dist/InputAvatar/index.mjs +20 -0
- package/dist/InputAvatar-BdLo0JDy.js +49 -0
- package/dist/InputAvatar-Dqd68eBU.js +47 -0
- package/dist/InputDate/index.cjs +34 -0
- package/dist/InputDate/index.mjs +28 -0
- package/dist/InputDate-CEk7YABR.js +48 -0
- package/dist/{InputDate/index.js → InputDate-kNxwMqkc.js} +6 -31
- package/dist/InputEmail/index.cjs +22 -0
- package/dist/InputEmail/index.mjs +15 -0
- package/dist/InputEmail-C-EyDCxm.js +20 -0
- package/dist/InputEmail-wUgCu5JW.js +23 -0
- package/dist/InputFile/index.cjs +23 -0
- package/dist/InputFile/index.mjs +16 -0
- package/dist/InputFile-B4DD55KU.js +1608 -0
- package/dist/InputFile-D5DGGfOB.js +1611 -0
- package/dist/InputGroup/index.cjs +9 -0
- package/dist/InputGroup/index.mjs +3 -0
- package/dist/InputGroup-DeQx7ud8.js +25 -0
- package/dist/InputGroup-hh3QBfdL.js +23 -0
- package/dist/InputNumber/index.cjs +21 -0
- package/dist/InputNumber/index.mjs +15 -0
- package/dist/InputNumber-BveQrPyO.js +56 -0
- package/dist/{InputNumber-e15cc1a3.js → InputNumber-CW4ttUb0.js} +2 -6
- package/dist/InputPassword/index.cjs +21 -0
- package/dist/InputPassword/index.mjs +15 -0
- package/dist/InputPassword-C8V7VR78.js +21 -0
- package/dist/InputPassword-Dw7Go90j.js +19 -0
- package/dist/InputPhoneNumber/index.cjs +21 -0
- package/dist/InputPhoneNumber/index.mjs +15 -0
- package/dist/{InputPhoneNumber/index.js → InputPhoneNumber-DHO2lp-T.js} +7 -27
- package/dist/InputPhoneNumber-DVscxVqU.js +94 -0
- package/dist/InputText/index.cjs +22 -0
- package/dist/InputText/index.mjs +16 -0
- package/dist/InputText-COr1oIHK.js +96 -0
- package/dist/{InputText-130b0440.js → InputText-C_iZe7xf.js} +4 -8
- package/dist/InputTime/index.cjs +26 -0
- package/dist/InputTime/index.mjs +20 -0
- package/dist/{InputTime/index.js → InputTime-DemVybcJ.js} +5 -25
- package/dist/InputTime-_Oc4Hp9L.js +190 -0
- package/dist/InputValidation/index.cjs +14 -0
- package/dist/InputValidation/index.mjs +8 -0
- package/dist/InputValidation-BiJTp0aC.js +22 -0
- package/dist/InputValidation-CCkTBcxQ.js +20 -0
- package/dist/InternalChipDismissible-D8UrPjJC.js +152 -0
- package/dist/InternalChipDismissible-DUluzwH6.js +157 -0
- package/dist/InternalGridCell-Bi4IFFO8.js +37 -0
- package/dist/InternalGridCell-CE9IQZwO.js +34 -0
- package/dist/LightBox/index.cjs +26 -0
- package/dist/LightBox/index.mjs +20 -0
- package/dist/LightBox-CIWrYTaA.js +110 -0
- package/dist/LightBox-D-gmMO7L.js +112 -0
- package/dist/Link/index.cjs +8 -0
- package/dist/Link/index.mjs +2 -0
- package/dist/Link-_423xhjb.js +7 -0
- package/dist/Link-j486eamd.js +9 -0
- package/dist/List/index.cjs +29 -0
- package/dist/List/index.mjs +22 -0
- package/dist/List-BcQDY2Rj.js +186 -0
- package/dist/List-Dgwp7JmK.js +189 -0
- package/dist/Markdown/index.cjs +19 -0
- package/dist/Markdown/index.mjs +13 -0
- package/dist/Markdown-BfxzpIEM.js +19011 -0
- package/dist/Markdown-BhG7kPFl.js +19013 -0
- package/dist/Menu/index.cjs +18 -0
- package/dist/Menu/index.mjs +12 -0
- package/dist/Menu-CuPp5MtV.js +129 -0
- package/dist/Menu-DNImsnBT.js +131 -0
- package/dist/Modal/index.cjs +23 -0
- package/dist/Modal/index.mjs +17 -0
- package/dist/Modal-Cgz6UlsK.js +62 -0
- package/dist/Modal-DQHFlXp5.js +60 -0
- package/dist/MultiSelect/index.cjs +16 -0
- package/dist/MultiSelect/index.mjs +10 -0
- package/dist/MultiSelect-BxtKPK3-.js +166 -0
- package/dist/MultiSelect-DFR0vsTw.js +164 -0
- package/dist/Option-C87IriRr.js +12 -0
- package/dist/Option-X8lh2w6I.js +15 -0
- package/dist/Page/index.cjs +32 -0
- package/dist/Page/index.mjs +26 -0
- package/dist/Page-BgG3_7DX.js +56 -0
- package/dist/Page-BowBp8rI.js +58 -0
- package/dist/Popover/index.cjs +17 -0
- package/dist/Popover/index.mjs +11 -0
- package/dist/Popover-BwG9WBGX.js +50 -0
- package/dist/Popover-o9pOjTMP.js +48 -0
- package/dist/ProgressBar/index.cjs +9 -0
- package/dist/ProgressBar/index.mjs +3 -0
- package/dist/ProgressBar-CUTebo_k.js +33 -0
- package/dist/ProgressBar-OBLHnKRF.js +31 -0
- package/dist/RadioGroup/index.cjs +12 -0
- package/dist/RadioGroup/index.mjs +5 -0
- package/dist/RadioGroup-CxguJ9E7.js +39 -0
- package/dist/RadioGroup-Dt9_WguN.js +36 -0
- package/dist/RecurringSelect/components/index.cjs +15 -0
- package/dist/RecurringSelect/components/index.mjs +6 -0
- package/dist/RecurringSelect/index.cjs +35 -0
- package/dist/RecurringSelect/index.mjs +21 -0
- package/dist/RecurringSelect-BB2D2awE.js +69 -0
- package/dist/RecurringSelect-Dqle4F6a.js +71 -0
- package/dist/Select/index.cjs +22 -0
- package/dist/Select/index.mjs +15 -0
- package/dist/Spinner/index.cjs +9 -0
- package/dist/Spinner/index.mjs +3 -0
- package/dist/Spinner-CjTb3xIl.js +16 -0
- package/dist/Spinner-DGO8_Jsa.js +14 -0
- package/dist/StatusIndicator/index.cjs +8 -0
- package/dist/StatusIndicator/index.mjs +2 -0
- package/dist/StatusIndicator-CNH13isn.js +11 -0
- package/dist/StatusIndicator-DaWtSIUm.js +9 -0
- package/dist/StatusLabel/index.cjs +11 -0
- package/dist/StatusLabel/index.mjs +5 -0
- package/dist/StatusLabel-DuJzG65D.js +18 -0
- package/dist/StatusLabel-YebFZkcB.js +16 -0
- package/dist/Switch/index.cjs +10 -0
- package/dist/Switch/index.mjs +4 -0
- package/dist/Switch-CUBASre6.js +46 -0
- package/dist/Switch-KKEqlvTp.js +48 -0
- package/dist/Table/index.cjs +17 -0
- package/dist/Table/index.mjs +4 -0
- package/dist/Tabs/index.cjs +11 -0
- package/dist/Tabs/index.mjs +4 -0
- package/dist/Tabs-AoDyVJHh.js +70 -0
- package/dist/Tabs-CmCuGGLm.js +67 -0
- package/dist/Text/index.cjs +10 -0
- package/dist/Text/index.mjs +4 -0
- package/dist/{Text-fbeaaca6.js → Text-BKFV1Z0j.js} +2 -6
- package/dist/Text-CfxmOdM-.js +25 -0
- package/dist/Toast/index.cjs +16 -0
- package/dist/Toast/index.mjs +10 -0
- package/dist/Tooltip/index.cjs +14 -0
- package/dist/Tooltip/index.mjs +8 -0
- package/dist/Tooltip-BrnUcSMD.js +103 -0
- package/dist/Tooltip-PbQMMMXT.js +105 -0
- package/dist/Typography/index.cjs +9 -0
- package/dist/Typography/index.mjs +3 -0
- package/dist/Typography-BiJhpsiL.js +38 -0
- package/dist/Typography-DscVWtp8.js +36 -0
- package/dist/_baseAssignValue-Byqm0l-g.js +29 -0
- package/dist/_baseAssignValue-ph7A7Tyf.js +31 -0
- package/dist/_baseEach-2sgXrDWN.js +1073 -0
- package/dist/_baseEach-DbUzYrtE.js +1069 -0
- package/dist/_commonjsHelpers-BHq9dk6I.js +36 -0
- package/dist/_commonjsHelpers-Dw5gAsMR.js +32 -0
- package/dist/_defineProperty-PEG-eSOB.js +1326 -0
- package/dist/_defineProperty-fDNRMxz-.js +1306 -0
- package/dist/_getTag-BBi2mXSK.js +718 -0
- package/dist/_getTag-CtczKdF2.js +733 -0
- package/dist/_polyfill-node.process-7AsFqJce.js +258 -0
- package/dist/_polyfill-node.process-B3Zw2Wh0.js +255 -0
- package/dist/_setToString-BEt-Msu3.js +230 -0
- package/dist/_setToString-BXD3rooF.js +234 -0
- package/dist/debounce-DHeCta_M.js +329 -0
- package/dist/debounce-DtVkjvKH.js +332 -0
- package/dist/helpers-BX_7EKw7.js +15 -0
- package/dist/helpers-BpmnB4Qy.js +17 -0
- package/dist/index-BE4KkyL_.js +1186 -0
- package/dist/index-dKBcvdAq.js +1189 -0
- package/dist/index.cjs +275 -0
- package/dist/index.d.mts +74 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.mjs +162 -0
- package/dist/isObjectLike-53d8VfgU.js +190 -0
- package/dist/isObjectLike-zrq0mtNG.js +197 -0
- package/dist/isSymbol-B7o505jx.js +35 -0
- package/dist/isSymbol-Co3-vUC1.js +33 -0
- package/dist/noop-B8ZS2J9q.js +24 -0
- package/dist/noop-mF8IIYWw.js +26 -0
- package/dist/showToast-C4Fxtv_O.js +97 -0
- package/dist/showToast-Ckq11MSy.js +99 -0
- package/dist/styles.css +8762 -0
- package/dist/tslib.es6-5nrZ19JS.js +97 -0
- package/dist/tslib.es6-BBH1pS30.js +102 -0
- package/dist/useActiveLayout-BSipZn9t.js +16 -0
- package/dist/useActiveLayout-BqE7ZQY7.js +14 -0
- package/dist/useAssert-BTe43jaI.js +27 -0
- package/dist/useAssert-CSmf3rDf.js +27 -0
- package/dist/{useAtlantisConfig-ed0bee66.js → useAtlantisConfig-Ckfr55qY.js} +2 -2
- package/dist/useAtlantisConfig-DC3Ppo_R.js +14 -0
- package/dist/useBatchSelect-KPnTra4u.js +36 -0
- package/dist/useBatchSelect-rQ55uZ7U.js +38 -0
- package/dist/useChildComponent-CwlKwCml.js +15 -0
- package/dist/useChildComponent-D7PbyArU.js +17 -0
- package/dist/useFocusTrap-B-xOQ79p.js +74 -0
- package/dist/useFocusTrap-D0gOZaSx.js +74 -0
- package/dist/useInView-CjeNEvX0.js +25 -0
- package/dist/useInView-DGjydyXL.js +25 -0
- package/dist/useIsMounted-BxDu0lnY.js +47 -0
- package/dist/useIsMounted-DfJrPzyU.js +47 -0
- package/dist/useOnKeyDown-07RktdgP.js +40 -0
- package/dist/useOnKeyDown-W2x-4HSi.js +40 -0
- package/dist/useRefocusOnActivator-BAub7L-i.js +32 -0
- package/dist/useRefocusOnActivator-BnM3unqN.js +32 -0
- package/dist/useResizeObserver-B4Vfml7U.js +1192 -0
- package/dist/useResizeObserver-DzMx2b66.js +1189 -0
- package/dist/useResponsiveSizing-DB6K2Viw.js +51 -0
- package/dist/useResponsiveSizing-DVb-nBuX.js +49 -0
- package/dist/useSafeLayoutEffect-BW_VIS6-.js +12 -0
- package/dist/useSafeLayoutEffect-juh5vdFE.js +14 -0
- package/dist/useScrollToActive-CQdgd_Dw.js +591 -0
- package/dist/useScrollToActive-DP9nvfrv.js +597 -0
- package/package.json +394 -8
- package/{rollup.config.js → rollup.config.mjs} +50 -17
- package/dist/AnimatedSwitcher/index.js +0 -13
- package/dist/Autocomplete/index.js +0 -214
- package/dist/Avatar/index.js +0 -15
- package/dist/Avatar-76a799fa.js +0 -78
- package/dist/Banner/index.js +0 -111
- package/dist/Button/index.js +0 -16
- package/dist/Button-6b922fc1.js +0 -57
- package/dist/ButtonDismiss/index.js +0 -17
- package/dist/ButtonDismiss-a3ba1de2.js +0 -14
- package/dist/Card/index.js +0 -24
- package/dist/Card-01d6ba19.js +0 -93
- package/dist/Checkbox/index.js +0 -18
- package/dist/Checkbox-e481a4b1.js +0 -63
- package/dist/Chip/index.js +0 -42
- package/dist/Chip-76f18555.js +0 -89
- package/dist/Chips/index.js +0 -525
- package/dist/Combobox/index.js +0 -41
- package/dist/Combobox-6d864202.js +0 -481
- package/dist/ConfirmationModal/index.js +0 -32
- package/dist/Content/index.js +0 -12
- package/dist/Content-e3f7b6fc.js +0 -24
- package/dist/Countdown/index.js +0 -72
- package/dist/DataDump/index.js +0 -37
- package/dist/DataList/index.js +0 -1346
- package/dist/DataTable/index.js +0 -301
- package/dist/DatePicker/index.js +0 -21
- package/dist/DatePicker-305a5b82.js +0 -144
- package/dist/DescriptionList/index.js +0 -24
- package/dist/Disclosure/index.js +0 -46
- package/dist/Divider/index.js +0 -29
- package/dist/Drawer/index.js +0 -50
- package/dist/Emphasis/index.js +0 -13
- package/dist/Emphasis-a77d8ee9.js +0 -19
- package/dist/FeatureSwitch/index.js +0 -71
- package/dist/Flex/index.js +0 -12
- package/dist/Flex-d490c4db.js +0 -38
- package/dist/FormField/index.js +0 -24
- package/dist/FormField-f6fadff2.js +0 -253
- package/dist/FormatEmail/index.js +0 -23
- package/dist/FormatFile/index.js +0 -37
- package/dist/FormatFile-32228107.js +0 -162
- package/dist/Gallery/index.js +0 -101
- package/dist/Glimmer/index.js +0 -15
- package/dist/Glimmer-84dee1ed.js +0 -77
- package/dist/Grid/index.js +0 -76
- package/dist/Heading/index.js +0 -15
- package/dist/Icon/index.js +0 -11
- package/dist/Icon-405a216c.js +0 -40
- package/dist/InlineLabel/index.js +0 -13
- package/dist/InlineLabel-c8fc28f0.js +0 -28
- package/dist/InputAvatar/index.js +0 -70
- package/dist/InputEmail/index.js +0 -43
- package/dist/InputFile/index.js +0 -25
- package/dist/InputFile-20b9074a.js +0 -190
- package/dist/InputGroup/index.js +0 -12
- package/dist/InputGroup-8d4fd4eb.js +0 -33
- package/dist/InputNumber/index.js +0 -25
- package/dist/InputPassword/index.js +0 -41
- package/dist/InputText/index.js +0 -26
- package/dist/InputValidation/index.js +0 -17
- package/dist/InputValidation-a92bb519.js +0 -29
- package/dist/LightBox/index.js +0 -25
- package/dist/LightBox-7efe8932.js +0 -121
- package/dist/Link/index.js +0 -15
- package/dist/List/index.js +0 -94
- package/dist/Markdown/index.js +0 -20
- package/dist/Markdown-0f24de70.js +0 -62
- package/dist/Menu/index.js +0 -21
- package/dist/Menu-d6dd673e.js +0 -139
- package/dist/Modal/index.js +0 -26
- package/dist/Modal-067becad.js +0 -73
- package/dist/MultiSelect/index.js +0 -182
- package/dist/Option-a1dbc08a.js +0 -19
- package/dist/Page/index.js +0 -78
- package/dist/Popover/index.js +0 -65
- package/dist/ProgressBar/index.js +0 -12
- package/dist/ProgressBar-b68edc8f.js +0 -43
- package/dist/RadioGroup/index.js +0 -15
- package/dist/RadioGroup-678f4932.js +0 -46
- package/dist/RecurringSelect/index.js +0 -227
- package/dist/Select/index.js +0 -26
- package/dist/Spinner/index.js +0 -12
- package/dist/Spinner-9d8fc7ff.js +0 -24
- package/dist/StatusIndicator/index.js +0 -11
- package/dist/StatusIndicator-7b5258ea.js +0 -18
- package/dist/StatusLabel/index.js +0 -28
- package/dist/Switch/index.js +0 -13
- package/dist/Switch-eac89586.js +0 -56
- package/dist/Table/index.js +0 -66
- package/dist/Tabs/index.js +0 -80
- package/dist/Text/index.js +0 -13
- package/dist/Toast/index.js +0 -111
- package/dist/Tooltip/index.js +0 -17
- package/dist/Tooltip-b9de6e57.js +0 -114
- package/dist/Typography/index.js +0 -12
- package/dist/Typography-e2a23b7e.js +0 -62
- package/dist/style-inject.es-9d2f5f4e.js +0 -30
- package/dist/tslib.es6-754e2961.js +0 -46
- /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
- /package/dist/{AtlantisContext-64608897.js → AtlantisContext-AiJSmYGH.js} +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var AnimatedPresence = require('../AnimatedPresence-20a02aaa.js');
|
|
3
|
+
var AnimatedPresence = require('../AnimatedPresence-BWePg1sL.js');
|
|
6
4
|
require('react');
|
|
7
5
|
require('framer-motion');
|
|
8
6
|
require('@jobber/design');
|
|
@@ -4,10 +4,6 @@ var React = require('react');
|
|
|
4
4
|
var framerMotion = require('framer-motion');
|
|
5
5
|
var design = require('@jobber/design');
|
|
6
6
|
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
-
|
|
11
7
|
const TIMING_QUICK = toSeconds(design.tokens["timing-quick"]);
|
|
12
8
|
const TIMING_BASE = toSeconds(design.tokens["timing-base"]);
|
|
13
9
|
const baseTransition = {
|
|
@@ -73,9 +69,9 @@ const transitions = {
|
|
|
73
69
|
function AnimatedPresence(props) {
|
|
74
70
|
const shouldReduceMotion = framerMotion.useReducedMotion();
|
|
75
71
|
if (shouldReduceMotion) {
|
|
76
|
-
return
|
|
72
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
77
73
|
}
|
|
78
|
-
return
|
|
74
|
+
return React.createElement(InternalAnimatedPresence, Object.assign({}, props));
|
|
79
75
|
}
|
|
80
76
|
function InternalAnimatedPresence({ transition = "fromTop", initial = false, children, }) {
|
|
81
77
|
const transitionVariation = transitions[transition];
|
|
@@ -88,7 +84,7 @@ function InternalAnimatedPresence({ transition = "fromTop", initial = false, chi
|
|
|
88
84
|
React.useEffect(() => {
|
|
89
85
|
setLastChildIndex(childCount - 1);
|
|
90
86
|
}, [childCount]);
|
|
91
|
-
return (
|
|
87
|
+
return (React.createElement(framerMotion.AnimatePresence, { initial: initial, mode: "popLayout" }, React.Children.map(children, (child, i) => child && (React.createElement(framerMotion.motion.div, { layout: true, variants: transitionVariation, initial: hasInitialTransition ? "initial" : "hidden", animate: "visible", exit: "hidden", transition: {
|
|
92
88
|
duration: TIMING_BASE,
|
|
93
89
|
delay: generateDelayTime(i),
|
|
94
90
|
} }, child)))));
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { useState, useEffect, Children } from 'react';
|
|
2
|
+
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
3
|
+
import { tokens } from '@jobber/design';
|
|
4
|
+
|
|
5
|
+
const TIMING_QUICK = toSeconds(tokens["timing-quick"]);
|
|
6
|
+
const TIMING_BASE = toSeconds(tokens["timing-base"]);
|
|
7
|
+
const baseTransition = {
|
|
8
|
+
visible: { opacity: 1 },
|
|
9
|
+
hidden: { opacity: 0 },
|
|
10
|
+
};
|
|
11
|
+
const fade = {
|
|
12
|
+
visible: { opacity: 1 },
|
|
13
|
+
hidden: { opacity: 0 },
|
|
14
|
+
};
|
|
15
|
+
const popIn = {
|
|
16
|
+
visible: Object.assign({ scale: 1 }, baseTransition.visible),
|
|
17
|
+
hidden: Object.assign({ scale: 0.95 }, baseTransition.hidden),
|
|
18
|
+
};
|
|
19
|
+
const fromTop = {
|
|
20
|
+
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
21
|
+
hidden: Object.assign({ y: -tokens["space-base"] }, baseTransition.hidden),
|
|
22
|
+
};
|
|
23
|
+
const fromBottom = {
|
|
24
|
+
visible: Object.assign({ y: 0 }, baseTransition.visible),
|
|
25
|
+
hidden: Object.assign({ y: tokens["space-base"] }, baseTransition.hidden),
|
|
26
|
+
};
|
|
27
|
+
const fromLeft = {
|
|
28
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
29
|
+
hidden: Object.assign({ x: -tokens["space-base"] }, baseTransition.hidden),
|
|
30
|
+
};
|
|
31
|
+
const fromRight = {
|
|
32
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
33
|
+
hidden: Object.assign({ x: tokens["space-base"] }, baseTransition.hidden),
|
|
34
|
+
};
|
|
35
|
+
const fromLeftToRight = {
|
|
36
|
+
initial: Object.assign({ x: -tokens["space-base"] }, baseTransition.hidden),
|
|
37
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
38
|
+
hidden: Object.assign({ x: tokens["space-base"] }, baseTransition.hidden),
|
|
39
|
+
};
|
|
40
|
+
const fromRightToLeft = {
|
|
41
|
+
initial: Object.assign({ x: tokens["space-base"] }, baseTransition.hidden),
|
|
42
|
+
visible: Object.assign({ x: 0 }, baseTransition.visible),
|
|
43
|
+
hidden: Object.assign({ x: -tokens["space-base"] }, baseTransition.hidden),
|
|
44
|
+
};
|
|
45
|
+
function toSeconds(ms) {
|
|
46
|
+
return ms / 1000;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function usePreviousValue(value) {
|
|
50
|
+
const [previousValue, setPreviousValue] = useState(value);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setPreviousValue(value);
|
|
53
|
+
}, [value]);
|
|
54
|
+
return [previousValue, setPreviousValue];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const transitions = {
|
|
58
|
+
fromBottom,
|
|
59
|
+
fromTop,
|
|
60
|
+
fromLeft,
|
|
61
|
+
fromRight,
|
|
62
|
+
popIn,
|
|
63
|
+
fromLeftToRight,
|
|
64
|
+
fromRightToLeft,
|
|
65
|
+
fade,
|
|
66
|
+
};
|
|
67
|
+
function AnimatedPresence(props) {
|
|
68
|
+
const shouldReduceMotion = useReducedMotion();
|
|
69
|
+
if (shouldReduceMotion) {
|
|
70
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
71
|
+
}
|
|
72
|
+
return React.createElement(InternalAnimatedPresence, Object.assign({}, props));
|
|
73
|
+
}
|
|
74
|
+
function InternalAnimatedPresence({ transition = "fromTop", initial = false, children, }) {
|
|
75
|
+
const transitionVariation = transitions[transition];
|
|
76
|
+
const hasInitialTransition = "initial" in transitionVariation;
|
|
77
|
+
const childCount = Children.count(children);
|
|
78
|
+
// Set the initial value to 0 so it staggers the animation on mount when
|
|
79
|
+
// initial is true.
|
|
80
|
+
const [lastChildIndex, setLastChildIndex] = usePreviousValue(0);
|
|
81
|
+
// Whenever the children count changes, update the last index.
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
setLastChildIndex(childCount - 1);
|
|
84
|
+
}, [childCount]);
|
|
85
|
+
return (React.createElement(AnimatePresence, { initial: initial, mode: "popLayout" }, Children.map(children, (child, i) => child && (React.createElement(motion.div, { layout: true, variants: transitionVariation, initial: hasInitialTransition ? "initial" : "hidden", animate: "visible", exit: "hidden", transition: {
|
|
86
|
+
duration: TIMING_BASE,
|
|
87
|
+
delay: generateDelayTime(i),
|
|
88
|
+
} }, child)))));
|
|
89
|
+
function generateDelayTime(index) {
|
|
90
|
+
// Don't add a delay if it's already rendered.
|
|
91
|
+
if (lastChildIndex > index)
|
|
92
|
+
return 0;
|
|
93
|
+
// Stagger the animation starting after the previous last child index.
|
|
94
|
+
return (index - lastChildIndex) * TIMING_QUICK;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { AnimatedPresence as A };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AnimatedSwitcher = require('../AnimatedSwitcher-D_Qj_hx5.js');
|
|
4
|
+
require('react');
|
|
5
|
+
require('framer-motion');
|
|
6
|
+
require('../Icon-C05AQvkv.js');
|
|
7
|
+
require('@jobber/design');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.AnimatedSwitcher = AnimatedSwitcher.AnimatedSwitcher;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
|
+
import { I as Icon } from './Icon-Dic5myD3.js';
|
|
4
|
+
|
|
5
|
+
const DURATION_SIMPLE = 0.1;
|
|
6
|
+
const DURATION_AVERAGE = 0.2;
|
|
7
|
+
const FADE = {
|
|
8
|
+
visible: { opacity: 1 },
|
|
9
|
+
hidden: { opacity: 0 },
|
|
10
|
+
};
|
|
11
|
+
const SLIDE_IN_UP = {
|
|
12
|
+
visible: { y: 0, opacity: 1 },
|
|
13
|
+
hidden: { y: "10%", opacity: 0 },
|
|
14
|
+
};
|
|
15
|
+
const SLIDE_IN_DOWN = {
|
|
16
|
+
visible: { y: 0, opacity: 1 },
|
|
17
|
+
hidden: { y: "-10%", opacity: 0 },
|
|
18
|
+
};
|
|
19
|
+
const SPIN_COUNTER_CLOCK_WISE = {
|
|
20
|
+
visible: {
|
|
21
|
+
rotate: 0,
|
|
22
|
+
scale: 1,
|
|
23
|
+
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
24
|
+
},
|
|
25
|
+
hidden: {
|
|
26
|
+
rotate: 180,
|
|
27
|
+
scale: 0.6,
|
|
28
|
+
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const SPIN_CLOCK_WISE = {
|
|
32
|
+
visible: {
|
|
33
|
+
rotate: 0,
|
|
34
|
+
scale: 1,
|
|
35
|
+
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
36
|
+
},
|
|
37
|
+
hidden: {
|
|
38
|
+
rotate: -180,
|
|
39
|
+
scale: 0.6,
|
|
40
|
+
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromBottom", }) {
|
|
45
|
+
const [ref, setRef] = useState(null);
|
|
46
|
+
const isSwitchingBetweenIcons = initialChild.type === Icon && switchTo.type === Icon;
|
|
47
|
+
const { key, transition, child, duration } = getChildData();
|
|
48
|
+
return (React.createElement(AnimatePresence, { mode: "wait", initial: false },
|
|
49
|
+
React.createElement(motion.div, { ref: setRef, key: key, variants: transition, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration }, style: { display: getDisplayValue() } }, child)));
|
|
50
|
+
function getDisplayValue() {
|
|
51
|
+
if (ref === null || ref === void 0 ? void 0 : ref.firstElementChild) {
|
|
52
|
+
return window.getComputedStyle(ref.firstElementChild).display;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function getChildData() {
|
|
56
|
+
let data = { key: `${initialChild.type}_1`, child: initialChild };
|
|
57
|
+
if (switched) {
|
|
58
|
+
data = { key: `${switchTo.type}_2`, child: switchTo };
|
|
59
|
+
}
|
|
60
|
+
return Object.assign(Object.assign({}, data), { transition: getTransitionType(), duration: getTransitionDuration() });
|
|
61
|
+
}
|
|
62
|
+
function getTransitionType() {
|
|
63
|
+
if (isSwitchingBetweenIcons) {
|
|
64
|
+
if (switched)
|
|
65
|
+
return SPIN_COUNTER_CLOCK_WISE;
|
|
66
|
+
return SPIN_CLOCK_WISE;
|
|
67
|
+
}
|
|
68
|
+
else if (type === "fade") {
|
|
69
|
+
return FADE;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (switched)
|
|
73
|
+
return SLIDE_IN_UP;
|
|
74
|
+
return SLIDE_IN_DOWN;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function getTransitionDuration() {
|
|
78
|
+
switch (type) {
|
|
79
|
+
case "fade":
|
|
80
|
+
return DURATION_AVERAGE;
|
|
81
|
+
default:
|
|
82
|
+
return DURATION_SIMPLE;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
AnimatedSwitcher.Icon = function AnimatedSwitcherIcon({ switchToIcon, switched, initialIcon, }) {
|
|
87
|
+
return (React.createElement(AnimatedSwitcher, { switched: switched, initialChild: React.createElement(Icon, { name: initialIcon }), switchTo: React.createElement(Icon, { name: switchToIcon }) }));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { AnimatedSwitcher as A };
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var framerMotion = require('framer-motion');
|
|
5
|
-
var Icon = require('./Icon-
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
5
|
+
var Icon = require('./Icon-C05AQvkv.js');
|
|
10
6
|
|
|
11
7
|
const DURATION_SIMPLE = 0.1;
|
|
12
8
|
const DURATION_AVERAGE = 0.2;
|
|
@@ -51,8 +47,8 @@ function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromB
|
|
|
51
47
|
const [ref, setRef] = React.useState(null);
|
|
52
48
|
const isSwitchingBetweenIcons = initialChild.type === Icon.Icon && switchTo.type === Icon.Icon;
|
|
53
49
|
const { key, transition, child, duration } = getChildData();
|
|
54
|
-
return (
|
|
55
|
-
|
|
50
|
+
return (React.createElement(framerMotion.AnimatePresence, { mode: "wait", initial: false },
|
|
51
|
+
React.createElement(framerMotion.motion.div, { ref: setRef, key: key, variants: transition, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration }, style: { display: getDisplayValue() } }, child)));
|
|
56
52
|
function getDisplayValue() {
|
|
57
53
|
if (ref === null || ref === void 0 ? void 0 : ref.firstElementChild) {
|
|
58
54
|
return window.getComputedStyle(ref.firstElementChild).display;
|
|
@@ -90,7 +86,7 @@ function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromB
|
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
88
|
AnimatedSwitcher.Icon = function AnimatedSwitcherIcon({ switchToIcon, switched, initialIcon, }) {
|
|
93
|
-
return (
|
|
89
|
+
return (React.createElement(AnimatedSwitcher, { switched: switched, initialChild: React.createElement(Icon.Icon, { name: initialIcon }), switchTo: React.createElement(Icon.Icon, { name: switchToIcon }) }));
|
|
94
90
|
};
|
|
95
91
|
|
|
96
92
|
exports.AnimatedSwitcher = AnimatedSwitcher;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
|
+
const atlantisContextDefaultValues = {
|
|
5
|
+
dateFormat: "P",
|
|
6
|
+
// The system time is "p"
|
|
7
|
+
timeFormat: "p",
|
|
8
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
9
|
+
floatSeparators: { group: ",", decimal: "." },
|
|
10
|
+
currencySymbol: "$",
|
|
11
|
+
locale: "en",
|
|
12
|
+
};
|
|
13
|
+
const AtlantisContext = createContext(atlantisContextDefaultValues);
|
|
14
|
+
function useAtlantisContext() {
|
|
15
|
+
return useContext(AtlantisContext);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { AtlantisContext as A, atlantisContextDefaultValues as a, useAtlantisContext as u };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Autocomplete = require('../Autocomplete-W9xb3p2A.js');
|
|
4
|
+
require('../tslib.es6-BBH1pS30.js');
|
|
5
|
+
require('react');
|
|
6
|
+
require('../debounce-DtVkjvKH.js');
|
|
7
|
+
require('../_commonjsHelpers-BHq9dk6I.js');
|
|
8
|
+
require('../isObjectLike-zrq0mtNG.js');
|
|
9
|
+
require('../isSymbol-B7o505jx.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
require('react-dom');
|
|
12
|
+
require('react-popper');
|
|
13
|
+
require('../useOnKeyDown-W2x-4HSi.js');
|
|
14
|
+
require('../useSafeLayoutEffect-juh5vdFE.js');
|
|
15
|
+
require('../useIsMounted-DfJrPzyU.js');
|
|
16
|
+
require('../Text-BKFV1Z0j.js');
|
|
17
|
+
require('../Typography-BiJhpsiL.js');
|
|
18
|
+
require('../Icon-C05AQvkv.js');
|
|
19
|
+
require('@jobber/design');
|
|
20
|
+
require('../Heading-Y2BrFvzY.js');
|
|
21
|
+
require('../useAtlantisConfig-Ckfr55qY.js');
|
|
22
|
+
require('../InputText-C_iZe7xf.js');
|
|
23
|
+
require('../FormField-RMjW742D.js');
|
|
24
|
+
require('react-hook-form');
|
|
25
|
+
require('../Button-BPYGeGx2.js');
|
|
26
|
+
require('react-router-dom');
|
|
27
|
+
require('../InputValidation-BiJTp0aC.js');
|
|
28
|
+
require('framer-motion');
|
|
29
|
+
require('../Spinner-CjTb3xIl.js');
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.Autocomplete = Autocomplete.Autocomplete;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { A as Autocomplete } from '../Autocomplete-DQ9t1vLy.js';
|
|
2
|
+
import '../tslib.es6-5nrZ19JS.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../debounce-DHeCta_M.js';
|
|
5
|
+
import '../_commonjsHelpers-Dw5gAsMR.js';
|
|
6
|
+
import '../isObjectLike-53d8VfgU.js';
|
|
7
|
+
import '../isSymbol-Co3-vUC1.js';
|
|
8
|
+
import 'classnames';
|
|
9
|
+
import 'react-dom';
|
|
10
|
+
import 'react-popper';
|
|
11
|
+
import '../useOnKeyDown-07RktdgP.js';
|
|
12
|
+
import '../useSafeLayoutEffect-BW_VIS6-.js';
|
|
13
|
+
import '../useIsMounted-BxDu0lnY.js';
|
|
14
|
+
import '../Text-CfxmOdM-.js';
|
|
15
|
+
import '../Typography-DscVWtp8.js';
|
|
16
|
+
import '../Icon-Dic5myD3.js';
|
|
17
|
+
import '@jobber/design';
|
|
18
|
+
import '../Heading-D_ylbFzI.js';
|
|
19
|
+
import '../useAtlantisConfig-DC3Ppo_R.js';
|
|
20
|
+
import '../InputText-COr1oIHK.js';
|
|
21
|
+
import '../FormField-DY5JDjdc.js';
|
|
22
|
+
import 'react-hook-form';
|
|
23
|
+
import '../Button-BH4Hhr2S.js';
|
|
24
|
+
import 'react-router-dom';
|
|
25
|
+
import '../InputValidation-CCkTBcxQ.js';
|
|
26
|
+
import 'framer-motion';
|
|
27
|
+
import '../Spinner-DGO8_Jsa.js';
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-5nrZ19JS.js';
|
|
2
|
+
import React, { useState, useEffect, forwardRef, useRef } from 'react';
|
|
3
|
+
import { d as debounce } from './debounce-DHeCta_M.js';
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { usePopper } from 'react-popper';
|
|
7
|
+
import { u as useOnKeyDown_2 } from './useOnKeyDown-07RktdgP.js';
|
|
8
|
+
import { u as useSafeLayoutEffect_1 } from './useSafeLayoutEffect-BW_VIS6-.js';
|
|
9
|
+
import { u as useIsMounted_2 } from './useIsMounted-BxDu0lnY.js';
|
|
10
|
+
import { T as Text } from './Text-CfxmOdM-.js';
|
|
11
|
+
import { I as Icon } from './Icon-Dic5myD3.js';
|
|
12
|
+
import { H as Heading } from './Heading-D_ylbFzI.js';
|
|
13
|
+
import { I as InputText } from './InputText-COr1oIHK.js';
|
|
14
|
+
|
|
15
|
+
var styles = {"autocomplete":"v0Cys9vQ-NE-","options":"CX-N-e0e6og-","visible":"_4PlUaegVpkk-","option":"ucQtG0iwqbo-","active":"r8HS-ma79QE-","separator":"ydwLX44YFZc-","heading":"PvUgNoAUG7A-","icon":"DAOOFUZ1BRM-","text":"cjKJFup6hGY-","label":"hG5zNBuI2wA-","details":"_3CwjFCbhqi4-"};
|
|
16
|
+
|
|
17
|
+
var IndexChange;
|
|
18
|
+
(function (IndexChange) {
|
|
19
|
+
IndexChange[IndexChange["Previous"] = -1] = "Previous";
|
|
20
|
+
IndexChange[IndexChange["Next"] = 1] = "Next";
|
|
21
|
+
})(IndexChange || (IndexChange = {}));
|
|
22
|
+
// Adding useIsMounted is what tipped this to 13 statements.
|
|
23
|
+
// Any additions beyond useIsMounted should probably see this component refactored a bit
|
|
24
|
+
// eslint-disable-next-line max-statements
|
|
25
|
+
function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }) {
|
|
26
|
+
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
27
|
+
const { menuRef, setMenuRef, styles: popperStyles, attributes, targetWidth, } = useRepositionMenu(attachTo, visible);
|
|
28
|
+
const detectSeparatorCondition = (option) => option.description || option.details;
|
|
29
|
+
const detectGroups = (option) => option.options;
|
|
30
|
+
const addSeparators = options.some(detectSeparatorCondition);
|
|
31
|
+
const initialHighlight = options.some(detectGroups) ? 1 : 0;
|
|
32
|
+
setupKeyListeners();
|
|
33
|
+
useEffect(() => setHighlightedIndex(initialHighlight), [options]);
|
|
34
|
+
const mounted = useIsMounted_2();
|
|
35
|
+
const menu = (React.createElement("div", Object.assign({ className: classnames(styles.options, { [styles.visible]: visible }), ref: setMenuRef, style: Object.assign(Object.assign({}, popperStyles.popper), { width: targetWidth }) }, attributes.popper), options.map((option, index) => {
|
|
36
|
+
const optionClass = classnames(styles.option, {
|
|
37
|
+
[styles.active]: index === highlightedIndex,
|
|
38
|
+
[styles.separator]: addSeparators,
|
|
39
|
+
});
|
|
40
|
+
if (isGroup(option)) {
|
|
41
|
+
return (React.createElement("div", { key: option.label, className: styles.heading },
|
|
42
|
+
React.createElement(Heading, { level: 5 }, option.label)));
|
|
43
|
+
}
|
|
44
|
+
return (React.createElement("button", { className: optionClass, key: option.value, onMouseDown: onOptionSelect.bind(undefined, option) },
|
|
45
|
+
React.createElement("div", { className: styles.icon }, isOptionSelected(selectedOption, option) && (React.createElement(Icon, { name: "checkmark", size: "small" }))),
|
|
46
|
+
React.createElement("div", { className: styles.text },
|
|
47
|
+
React.createElement("div", { className: styles.label },
|
|
48
|
+
React.createElement(Text, null, option.label),
|
|
49
|
+
option.description !== undefined && (React.createElement(Text, { variation: "subdued" }, option.description))),
|
|
50
|
+
option.details !== undefined && (React.createElement("div", { className: styles.details },
|
|
51
|
+
React.createElement(Text, null, option.details))))));
|
|
52
|
+
})));
|
|
53
|
+
return mounted.current ? createPortal(menu, document.body) : menu;
|
|
54
|
+
function setupKeyListeners() {
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
(_b = (_a = menuRef === null || menuRef === void 0 ? void 0 : menuRef.children[highlightedIndex]) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
58
|
+
behavior: "smooth",
|
|
59
|
+
block: "nearest",
|
|
60
|
+
inline: "start",
|
|
61
|
+
});
|
|
62
|
+
}, [highlightedIndex]);
|
|
63
|
+
useOnKeyDown_2((event) => {
|
|
64
|
+
const indexChange = arrowKeyPress(event, IndexChange.Next);
|
|
65
|
+
if (indexChange) {
|
|
66
|
+
setHighlightedIndex(Math.min(options.length - 1, highlightedIndex + indexChange));
|
|
67
|
+
}
|
|
68
|
+
}, "ArrowDown");
|
|
69
|
+
useOnKeyDown_2((event) => {
|
|
70
|
+
const indexChange = arrowKeyPress(event, IndexChange.Previous);
|
|
71
|
+
if (indexChange) {
|
|
72
|
+
setHighlightedIndex(Math.max(0, highlightedIndex + indexChange));
|
|
73
|
+
}
|
|
74
|
+
}, "ArrowUp");
|
|
75
|
+
useOnKeyDown_2((event) => {
|
|
76
|
+
if (!visible)
|
|
77
|
+
return;
|
|
78
|
+
if (isGroup(options[highlightedIndex]))
|
|
79
|
+
return;
|
|
80
|
+
event.preventDefault();
|
|
81
|
+
onOptionSelect(options[highlightedIndex]);
|
|
82
|
+
}, "Enter");
|
|
83
|
+
}
|
|
84
|
+
function arrowKeyPress(event, direction) {
|
|
85
|
+
if (!visible)
|
|
86
|
+
return;
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
const requestedIndex = options[highlightedIndex + direction];
|
|
89
|
+
return requestedIndex && isGroup(requestedIndex)
|
|
90
|
+
? direction + direction
|
|
91
|
+
: direction;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function isOptionSelected(selectedOption, option) {
|
|
95
|
+
return selectedOption && selectedOption.value === option.value;
|
|
96
|
+
}
|
|
97
|
+
function isGroup(option) {
|
|
98
|
+
if (option.options)
|
|
99
|
+
return true;
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
function useRepositionMenu(attachTo, visible = false) {
|
|
103
|
+
var _a;
|
|
104
|
+
const [menuRef, setMenuRef] = useState();
|
|
105
|
+
const popper = usePopper(attachTo.current, menuRef, {
|
|
106
|
+
modifiers: [
|
|
107
|
+
{ name: "offset", options: { offset: [0, 8] } },
|
|
108
|
+
{ name: "flip", options: { fallbackPlacements: ["top"] } },
|
|
109
|
+
],
|
|
110
|
+
});
|
|
111
|
+
useSafeLayoutEffect_1(() => {
|
|
112
|
+
var _a;
|
|
113
|
+
(_a = popper === null || popper === void 0 ? void 0 : popper.update) === null || _a === void 0 ? void 0 : _a.call(popper);
|
|
114
|
+
}, [visible]);
|
|
115
|
+
const targetWidth = (_a = attachTo.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
|
|
116
|
+
return Object.assign(Object.assign({}, popper), { menuRef, setMenuRef, targetWidth });
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Max statements increased to make room for the debounce functions
|
|
120
|
+
/* eslint max-statements: ["error", 14] */
|
|
121
|
+
function AutocompleteInternal(_a, ref) {
|
|
122
|
+
var _b;
|
|
123
|
+
var { initialOptions = [], value, allowFreeForm = true, size = undefined, debounce: debounceRate = 300, onChange, getOptions, placeholder, onBlur, onFocus, validations } = _a, inputProps = __rest(_a, ["initialOptions", "value", "allowFreeForm", "size", "debounce", "onChange", "getOptions", "placeholder", "onBlur", "onFocus", "validations"]);
|
|
124
|
+
const [options, setOptions] = useState(initialOptions);
|
|
125
|
+
const [menuVisible, setMenuVisible] = useState(false);
|
|
126
|
+
const [inputText, setInputText] = useState((_b = value === null || value === void 0 ? void 0 : value.label) !== null && _b !== void 0 ? _b : "");
|
|
127
|
+
const autocompleteRef = useRef(null);
|
|
128
|
+
const delayedSearch = debounce(updateSearch, debounceRate);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
delayedSearch();
|
|
131
|
+
return delayedSearch.cancel;
|
|
132
|
+
}, [inputText]);
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
var _a;
|
|
135
|
+
updateInput((_a = value === null || value === void 0 ? void 0 : value.label) !== null && _a !== void 0 ? _a : "");
|
|
136
|
+
}, [value]);
|
|
137
|
+
return (React.createElement("div", { className: styles.autocomplete, ref: autocompleteRef },
|
|
138
|
+
React.createElement(InputText, Object.assign({ ref: ref, autocomplete: false, size: size, value: inputText, onChange: handleInputChange, placeholder: placeholder, onFocus: handleInputFocus, onBlur: handleInputBlur, validations: validations }, inputProps)),
|
|
139
|
+
menuVisible && (React.createElement(Menu, { attachTo: autocompleteRef, visible: menuVisible && options.length > 0, options: options, selectedOption: value, onOptionSelect: handleMenuChange }))));
|
|
140
|
+
function updateInput(newText) {
|
|
141
|
+
setInputText(newText);
|
|
142
|
+
if (newText === "") {
|
|
143
|
+
setOptions(mapToOptions(initialOptions));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function updateSearch() {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const updatedOptions = yield getOptions(inputText);
|
|
149
|
+
const filteredOptions = updatedOptions.filter((option) => "options" in option && option.options ? option.options.length > 0 : true);
|
|
150
|
+
setOptions(mapToOptions(filteredOptions));
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function handleMenuChange(chosenOption) {
|
|
154
|
+
onChange(chosenOption);
|
|
155
|
+
updateInput(chosenOption.label);
|
|
156
|
+
setMenuVisible(false);
|
|
157
|
+
}
|
|
158
|
+
function handleInputChange(newText) {
|
|
159
|
+
updateInput(newText);
|
|
160
|
+
if (allowFreeForm) {
|
|
161
|
+
onChange({ label: newText });
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function handleInputBlur() {
|
|
165
|
+
setMenuVisible(false);
|
|
166
|
+
if (value == undefined || value.label !== inputText) {
|
|
167
|
+
setInputText("");
|
|
168
|
+
onChange(undefined);
|
|
169
|
+
}
|
|
170
|
+
onBlur && onBlur();
|
|
171
|
+
}
|
|
172
|
+
function handleInputFocus() {
|
|
173
|
+
setMenuVisible(true);
|
|
174
|
+
if (onFocus) {
|
|
175
|
+
onFocus();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function mapToOptions(items) {
|
|
180
|
+
return items.reduce(function (result, item) {
|
|
181
|
+
result = result.concat([item]);
|
|
182
|
+
if (item.options) {
|
|
183
|
+
result = result.concat(item.options);
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
}, []);
|
|
187
|
+
}
|
|
188
|
+
const Autocomplete = forwardRef(AutocompleteInternal);
|
|
189
|
+
|
|
190
|
+
export { Autocomplete as A };
|