@evolve.ui/core-components 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{BottomSheet-ZV_eq3xt.mjs → BottomSheet-CNVLnEoD.mjs} +3 -3
- package/BottomSheet-CNVLnEoD.mjs.map +1 -0
- package/{BottomSheet-emWP9Fct.cjs → BottomSheet-D5w0WZDl.cjs} +3 -3
- package/BottomSheet-D5w0WZDl.cjs.map +1 -0
- package/Button.cjs +1 -1
- package/Button.mjs +1 -1
- package/{CookieConsent-CIwm0bTz.mjs → CookieConsent-B9dg9WdC.mjs} +2 -2
- package/{CookieConsent-CIwm0bTz.mjs.map → CookieConsent-B9dg9WdC.mjs.map} +1 -1
- package/{CookieConsent-PIglB_bb.cjs → CookieConsent-BSXJHMwX.cjs} +2 -2
- package/{CookieConsent-PIglB_bb.cjs.map → CookieConsent-BSXJHMwX.cjs.map} +1 -1
- package/{Drawer-9HFG45OA.cjs → Drawer-3rA9dGCl.cjs} +2 -2
- package/{Drawer-9HFG45OA.cjs.map → Drawer-3rA9dGCl.cjs.map} +1 -1
- package/Drawer-CFZbwg0R.d.cts.map +1 -1
- package/Drawer-CFZbwg0R.d.mts.map +1 -1
- package/{Drawer-BkCPfK6P.mjs → Drawer-DzKEmewj.mjs} +2 -2
- package/{Drawer-BkCPfK6P.mjs.map → Drawer-DzKEmewj.mjs.map} +1 -1
- package/{FavoriteButton-CC3qL0lR.mjs → FavoriteButton-7nK77lQP.mjs} +6 -6
- package/FavoriteButton-7nK77lQP.mjs.map +1 -0
- package/{FavoriteButton-BGF-3dze.d.cts → FavoriteButton-B8r_qtlj.d.cts} +2 -2
- package/{FavoriteButton-BGF-3dze.d.cts.map → FavoriteButton-B8r_qtlj.d.cts.map} +1 -1
- package/{FavoriteButton-DliYzkfu.cjs → FavoriteButton-BkIaWfgD.cjs} +6 -6
- package/FavoriteButton-BkIaWfgD.cjs.map +1 -0
- package/{FavoriteButton-BZEGWrRo.d.mts → FavoriteButton-hIkGjcKH.d.mts} +2 -2
- package/{FavoriteButton-BZEGWrRo.d.mts.map → FavoriteButton-hIkGjcKH.d.mts.map} +1 -1
- package/{FileUpload-p_pl9NXr.mjs → FileUpload-BfZOMsLs.mjs} +6 -6
- package/FileUpload-BfZOMsLs.mjs.map +1 -0
- package/{FileUpload--e_UJ_ek.cjs → FileUpload-gjRbkgrL.cjs} +6 -6
- package/FileUpload-gjRbkgrL.cjs.map +1 -0
- package/IconButton.cjs +1 -1
- package/IconButton.mjs +1 -1
- package/{ImageSlider-BidXfnLj.cjs → ImageSlider-CAgxQffP.cjs} +3 -3
- package/ImageSlider-CAgxQffP.cjs.map +1 -0
- package/{ImageSlider-CDrg_TbL.mjs → ImageSlider-fdrJ6lIJ.mjs} +3 -3
- package/ImageSlider-fdrJ6lIJ.mjs.map +1 -0
- package/InfoIconTooltip.cjs +1 -1
- package/InfoIconTooltip.cjs.map +1 -1
- package/InfoIconTooltip.mjs +1 -1
- package/InfoIconTooltip.mjs.map +1 -1
- package/InlineButton-CRLbNJZ3.d.mts.map +1 -1
- package/InlineButton-DoXGLiSE.d.cts.map +1 -1
- package/Input.cjs +1 -1
- package/Input.cjs.map +1 -1
- package/Input.mjs +1 -1
- package/Input.mjs.map +1 -1
- package/JumpMenu-BXYZnPIH.cjs.map +1 -1
- package/JumpMenu-DcZjAiej.mjs.map +1 -1
- package/{Menu-Cxu8CaX1.mjs → Menu-Bn4smlEe.mjs} +2 -2
- package/Menu-Bn4smlEe.mjs.map +1 -0
- package/{Menu-ClUogmwE.cjs → Menu-DuDhtoNP.cjs} +2 -2
- package/Menu-DuDhtoNP.cjs.map +1 -0
- package/Modal-DM0aXJZ5.d.cts.map +1 -1
- package/Modal-DM0aXJZ5.d.mts.map +1 -1
- package/{Modal-C6gatdtT.mjs → Modal-DtxWd7Le.mjs} +3 -2
- package/{Modal-C6gatdtT.mjs.map → Modal-DtxWd7Le.mjs.map} +1 -1
- package/{Modal-CiBqXyiK.cjs → Modal-q4HhBAQU.cjs} +3 -2
- package/Modal-q4HhBAQU.cjs.map +1 -0
- package/{Pagination-bAtbN478.cjs → Pagination-Denb9_zB.cjs} +2 -2
- package/{Pagination-bAtbN478.cjs.map → Pagination-Denb9_zB.cjs.map} +1 -1
- package/{Pagination-DIpGKMLz.mjs → Pagination-Dyfeys4B.mjs} +2 -2
- package/{Pagination-DIpGKMLz.mjs.map → Pagination-Dyfeys4B.mjs.map} +1 -1
- package/PhoneInput-B5pkpkdt.mjs.map +1 -1
- package/PhoneInput-BXnkBME4.d.mts.map +1 -1
- package/PhoneInput-Bkrbrins.d.cts.map +1 -1
- package/PhoneInput-CUMPOSxJ.cjs.map +1 -1
- package/{ProgressCircle-BC81D9sU.cjs → ProgressCircle-B6R4dxoV.cjs} +2 -2
- package/{ProgressCircle-BC81D9sU.cjs.map → ProgressCircle-B6R4dxoV.cjs.map} +1 -1
- package/{ProgressCircle-ae8cvZhe.mjs → ProgressCircle-zSai1HTT.mjs} +2 -2
- package/{ProgressCircle-ae8cvZhe.mjs.map → ProgressCircle-zSai1HTT.mjs.map} +1 -1
- package/SearchInput-DYIPC8Cd.d.cts.map +1 -1
- package/SearchInput-IfEWePDQ.d.mts.map +1 -1
- package/{Select-BkZu8OLs.mjs → Select-CH_ZN88G.mjs} +2 -2
- package/Select-CH_ZN88G.mjs.map +1 -0
- package/{Select-BXDjzyDs.cjs → Select-DCCcyLT4.cjs} +2 -2
- package/Select-DCCcyLT4.cjs.map +1 -0
- package/{SplitButton-DcmmLW8j.cjs → SplitButton-B_Y253RU.cjs} +2 -2
- package/{SplitButton-DcmmLW8j.cjs.map → SplitButton-B_Y253RU.cjs.map} +1 -1
- package/{SplitButton-WE5ymwCQ.mjs → SplitButton-_poP9Ykq.mjs} +2 -2
- package/{SplitButton-WE5ymwCQ.mjs.map → SplitButton-_poP9Ykq.mjs.map} +1 -1
- package/{Table-M-rANdMt.mjs → Table-CQGtDpvH.mjs} +3 -3
- package/{Table-M-rANdMt.mjs.map → Table-CQGtDpvH.mjs.map} +1 -1
- package/{Table-CLlDragJ.cjs → Table-D4UYosb1.cjs} +3 -3
- package/{Table-CLlDragJ.cjs.map → Table-D4UYosb1.cjs.map} +1 -1
- package/Typography/InlineButton.cjs +1 -1
- package/Typography/InlineButton.cjs.map +1 -1
- package/Typography/InlineButton.mjs +1 -1
- package/Typography/InlineButton.mjs.map +1 -1
- package/{ViewMore-BBoUvo7p.cjs → ViewMore-BcoSRZSl.cjs} +14 -1
- package/ViewMore-BcoSRZSl.cjs.map +1 -0
- package/{ViewMore-BrZPuE4E.mjs → ViewMore-Be0TQZ_2.mjs} +14 -1
- package/ViewMore-Be0TQZ_2.mjs.map +1 -0
- package/bottomSheet.cjs +1 -1
- package/bottomSheet.mjs +1 -1
- package/{buttonColorClasses-C3hg1at8.cjs → buttonColorClasses-CQQmLYfk.cjs} +4 -4
- package/buttonColorClasses-CQQmLYfk.cjs.map +1 -0
- package/{buttonColorClasses-B7OU4aQA.mjs → buttonColorClasses-CQnqAJXl.mjs} +4 -4
- package/buttonColorClasses-CQnqAJXl.mjs.map +1 -0
- package/card/components/createFavoriteButton.cjs +1 -1
- package/card/components/createFavoriteButton.mjs +1 -1
- package/cookieConsent.cjs +1 -1
- package/cookieConsent.mjs +1 -1
- package/drawer.cjs +1 -1
- package/drawer.mjs +1 -1
- package/favoriteButton.cjs +1 -1
- package/favoriteButton.d.cts +1 -1
- package/favoriteButton.d.mts +1 -1
- package/favoriteButton.mjs +1 -1
- package/featureFlags/hooks.d.cts +1 -1
- package/featureFlags/hooks.d.mts +1 -1
- package/fileUpload/testUtils/mockFilesAndImages.d.cts +3 -3
- package/fileUpload/testUtils/mockFilesAndImages.d.cts.map +1 -1
- package/fileUpload/testUtils/mockFilesAndImages.d.mts +3 -3
- package/fileUpload/testUtils/mockFilesAndImages.d.mts.map +1 -1
- package/fileUpload/testUtils/testUtils.d.cts +1 -1
- package/fileUpload/testUtils/testUtils.d.cts.map +1 -1
- package/fileUpload/testUtils/testUtils.d.mts +1 -1
- package/fileUpload/testUtils/testUtils.d.mts.map +1 -1
- package/fileUpload.cjs +1 -1
- package/fileUpload.mjs +1 -1
- package/imageSlider.cjs +1 -1
- package/imageSlider.mjs +1 -1
- package/index.cjs +14 -14
- package/index.d.cts +1 -1
- package/index.d.mts +1 -1
- package/index.mjs +14 -14
- package/menu.cjs +1 -1
- package/menu.mjs +1 -1
- package/modal/useCloseModal.cjs +2 -1
- package/modal/useCloseModal.cjs.map +1 -1
- package/modal/useCloseModal.mjs +2 -1
- package/modal/useCloseModal.mjs.map +1 -1
- package/modal.cjs +1 -1
- package/modal.mjs +1 -1
- package/package.json +2 -4
- package/pagination.cjs +1 -1
- package/pagination.mjs +1 -1
- package/progressCircle.cjs +1 -1
- package/progressCircle.mjs +1 -1
- package/searchInput.cjs +4 -4
- package/searchInput.cjs.map +1 -1
- package/searchInput.mjs +4 -4
- package/searchInput.mjs.map +1 -1
- package/select.cjs +1 -1
- package/select.mjs +1 -1
- package/selectAsync.cjs +1 -1
- package/selectAsync.mjs +1 -1
- package/selectAsyncCreatable.cjs +1 -1
- package/selectAsyncCreatable.mjs +1 -1
- package/selectCreatable.cjs +1 -1
- package/selectCreatable.mjs +1 -1
- package/splitButton.cjs +1 -1
- package/splitButton.mjs +1 -1
- package/src/BottomSheet/components/BottomSheetContentArea/BottomSheetContentArea.tsx +4 -3
- package/src/BottomSheet/components/BottomSheetOverlay/BottomSheetOverlayTranslate3d.tsx +5 -2
- package/src/Button/buttonColorClasses.ts +8 -3
- package/src/Drawer/Drawer.tsx +5 -8
- package/src/FavoriteButton/components/IconOnlyFavoriteButton/IconOnlyFavoriteButton.tsx +4 -1
- package/src/FavoriteButton/components/LabeledAnimatedFavoriteButton/LabeledAnimatedFavoriteButton.tsx +13 -6
- package/src/FavoriteButton/types/favoriteButton.ts +1 -1
- package/src/FileUpload/components/GridFileCard/GridFileCard.tsx +1 -1
- package/src/FileUpload/components/ListFileCard/ListFileCard.tsx +2 -2
- package/src/ImageSlider/ImageSlider.tsx +3 -1
- package/src/ImageSlider/components/Thumbnails/Thumbnails.tsx +1 -1
- package/src/JumpMenu/components/JumpMenuItem/JumpMenuItem.tsx +4 -1
- package/src/Menu/components/MenuItem/MenuItem.tsx +1 -1
- package/src/Modal/ComposableModal.tsx +9 -1
- package/src/Modal/hooks/useCloseModal.ts +8 -1
- package/src/PhoneInput/PhoneInput.tsx +7 -1
- package/src/ProgressCircle/ProgressCircle.tsx +1 -1
- package/src/SearchInput/SearchInput.tsx +5 -4
- package/src/Select/selectComponents.tsx +1 -2
- package/src/Tabs/Tabs.tsx +4 -4
- package/src/TextArea/TextArea.tsx +2 -0
- package/src/TextInput/TextInput.tsx +1 -1
- package/src/Tooltip/InfoIconTooltip.tsx +1 -1
- package/src/Typography/InlineButton/InlineButton.tsx +4 -3
- package/src/utils/smoothScrollTo.ts +18 -0
- package/table.cjs +1 -1
- package/table.mjs +1 -1
- package/tabs.cjs +1 -1
- package/tabs.cjs.map +1 -1
- package/tabs.mjs +1 -1
- package/tabs.mjs.map +1 -1
- package/textArea.cjs.map +1 -1
- package/textArea.mjs.map +1 -1
- package/viewMore.cjs +1 -1
- package/viewMore.mjs +1 -1
- package/BottomSheet-ZV_eq3xt.mjs.map +0 -1
- package/BottomSheet-emWP9Fct.cjs.map +0 -1
- package/FavoriteButton-CC3qL0lR.mjs.map +0 -1
- package/FavoriteButton-DliYzkfu.cjs.map +0 -1
- package/FileUpload--e_UJ_ek.cjs.map +0 -1
- package/FileUpload-p_pl9NXr.mjs.map +0 -1
- package/ImageSlider-BidXfnLj.cjs.map +0 -1
- package/ImageSlider-CDrg_TbL.mjs.map +0 -1
- package/Menu-ClUogmwE.cjs.map +0 -1
- package/Menu-Cxu8CaX1.mjs.map +0 -1
- package/Modal-CiBqXyiK.cjs.map +0 -1
- package/Select-BXDjzyDs.cjs.map +0 -1
- package/Select-BkZu8OLs.mjs.map +0 -1
- package/ViewMore-BBoUvo7p.cjs.map +0 -1
- package/ViewMore-BrZPuE4E.mjs.map +0 -1
- package/buttonColorClasses-B7OU4aQA.mjs.map +0 -1
- package/buttonColorClasses-C3hg1at8.cjs.map +0 -1
package/index.cjs
CHANGED
|
@@ -28,14 +28,14 @@ const require_Badge_ItemBadge = require("./Badge/ItemBadge.cjs");
|
|
|
28
28
|
const require_Badge_LiveStatusBadge = require("./Badge/LiveStatusBadge.cjs");
|
|
29
29
|
const require_skeleton = require("./skeleton.cjs");
|
|
30
30
|
const require_BannerNotification = require("./BannerNotification-D9Sfa2si.cjs");
|
|
31
|
-
const require_BottomSheet = require("./BottomSheet-
|
|
31
|
+
const require_BottomSheet = require("./BottomSheet-D5w0WZDl.cjs");
|
|
32
32
|
const require_Breadcrumbs = require("./Breadcrumbs-7jTSZ7NM.cjs");
|
|
33
33
|
const require_Callout = require("./Callout-DrWwRGi4.cjs");
|
|
34
34
|
const require_card_singleCard = require("./card/singleCard.cjs");
|
|
35
35
|
const require_CardGrid = require("./CardGrid-CXi9XvDo.cjs");
|
|
36
36
|
const require_cardFactory = require("./cardFactory-DTU3jY-R.cjs");
|
|
37
37
|
const require_card_components_createBadge = require("./card/components/createBadge.cjs");
|
|
38
|
-
const require_FavoriteButton = require("./FavoriteButton-
|
|
38
|
+
const require_FavoriteButton = require("./FavoriteButton-BkIaWfgD.cjs");
|
|
39
39
|
const require_SaveConfetti = require("./SaveConfetti-DSJtuE3b.cjs");
|
|
40
40
|
const require_card_components_createFavoriteButton = require("./card/components/createFavoriteButton.cjs");
|
|
41
41
|
const require_card_components_createImage = require("./card/components/createImage.cjs");
|
|
@@ -45,13 +45,13 @@ const require_Typography_InlineButton = require("./Typography/InlineButton.cjs")
|
|
|
45
45
|
const require_card_components_createPriceStatus = require("./card/components/createPriceStatus.cjs");
|
|
46
46
|
const require_Confetti = require("./Confetti--vMcCOQ7.cjs");
|
|
47
47
|
const require_Toast = require("./Toast-CPEKESLZ.cjs");
|
|
48
|
-
const require_CookieConsent = require("./CookieConsent-
|
|
48
|
+
const require_CookieConsent = require("./CookieConsent-BSXJHMwX.cjs");
|
|
49
49
|
const require_components = require("./components-CL4KcKF0.cjs");
|
|
50
50
|
const require_modal_context = require("./modal/context.cjs");
|
|
51
51
|
const require_modal_useCloseModal = require("./modal/useCloseModal.cjs");
|
|
52
52
|
const require_ContentPager = require("./ContentPager-BJo1L64Y.cjs");
|
|
53
53
|
const require_progressSteps = require("./progressSteps.cjs");
|
|
54
|
-
const require_Modal = require("./Modal-
|
|
54
|
+
const require_Modal = require("./Modal-q4HhBAQU.cjs");
|
|
55
55
|
const require_toggleSwitch = require("./toggleSwitch.cjs");
|
|
56
56
|
const require_Countdown = require("./Countdown-D4-QPv6V.cjs");
|
|
57
57
|
const require_chips_chip = require("./chips/chip.cjs");
|
|
@@ -64,23 +64,23 @@ const require_utils = require("./utils-CvmfGpqu.cjs");
|
|
|
64
64
|
const require_dateInput = require("./dateInput.cjs");
|
|
65
65
|
const require_datePicker = require("./datePicker-DaYegd15.cjs");
|
|
66
66
|
const require_timePicker = require("./timePicker-Bs25zweI.cjs");
|
|
67
|
-
const require_Drawer = require("./Drawer-
|
|
67
|
+
const require_Drawer = require("./Drawer-3rA9dGCl.cjs");
|
|
68
68
|
const require_educationalPopover = require("./educationalPopover.cjs");
|
|
69
69
|
const require_useFeatureFlags = require("./useFeatureFlags--GRuT9Qc.cjs");
|
|
70
70
|
const require_FeatureFlagDevToolsUI = require("./FeatureFlagDevToolsUI-MBFES3GM.cjs");
|
|
71
71
|
const require_hooks = require("./hooks-DDMD_CDN.cjs");
|
|
72
72
|
const require_hooks$1 = require("./hooks-8VsDqwlb.cjs");
|
|
73
|
-
const require_FileUpload = require("./FileUpload
|
|
73
|
+
const require_FileUpload = require("./FileUpload-gjRbkgrL.cjs");
|
|
74
74
|
const require_tabs = require("./tabs.cjs");
|
|
75
75
|
const require_Loading = require("./Loading-BL7_u25j.cjs");
|
|
76
|
-
const require_Pagination = require("./Pagination-
|
|
77
|
-
const require_Select = require("./Select-
|
|
78
|
-
const require_Table = require("./Table-
|
|
79
|
-
const require_Menu = require("./Menu-
|
|
80
|
-
const require_ProgressCircle = require("./ProgressCircle-
|
|
76
|
+
const require_Pagination = require("./Pagination-Denb9_zB.cjs");
|
|
77
|
+
const require_Select = require("./Select-DCCcyLT4.cjs");
|
|
78
|
+
const require_Table = require("./Table-D4UYosb1.cjs");
|
|
79
|
+
const require_Menu = require("./Menu-DuDhtoNP.cjs");
|
|
80
|
+
const require_ProgressCircle = require("./ProgressCircle-B6R4dxoV.cjs");
|
|
81
81
|
const require_CreditCardIcon = require("./CreditCardIcon-OqdAEE3e.cjs");
|
|
82
82
|
const require_imageCluster = require("./imageCluster.cjs");
|
|
83
|
-
const require_ImageSlider = require("./ImageSlider-
|
|
83
|
+
const require_ImageSlider = require("./ImageSlider-CAgxQffP.cjs");
|
|
84
84
|
const require_inlineNotification = require("./inlineNotification.cjs");
|
|
85
85
|
const require_JumpMenu = require("./JumpMenu-BXYZnPIH.cjs");
|
|
86
86
|
const require_notificationBadge = require("./notificationBadge.cjs");
|
|
@@ -91,12 +91,12 @@ const require_selectAsync = require("./selectAsync.cjs");
|
|
|
91
91
|
const require_selectAsyncCreatable = require("./selectAsyncCreatable.cjs");
|
|
92
92
|
const require_selectCreatable = require("./selectCreatable.cjs");
|
|
93
93
|
const require_SegmentedControl = require("./SegmentedControl-B5FZ0uX8.cjs");
|
|
94
|
-
const require_SplitButton = require("./SplitButton-
|
|
94
|
+
const require_SplitButton = require("./SplitButton-B_Y253RU.cjs");
|
|
95
95
|
const require_StarRating = require("./StarRating-Dski54FS.cjs");
|
|
96
96
|
const require_breakpoints = require("./breakpoints.cjs");
|
|
97
97
|
const require_InfoIconTooltip = require("./InfoIconTooltip.cjs");
|
|
98
98
|
const require_textArea = require("./textArea.cjs");
|
|
99
|
-
const require_ViewMore = require("./ViewMore-
|
|
99
|
+
const require_ViewMore = require("./ViewMore-BcoSRZSl.cjs");
|
|
100
100
|
const require_WebRTCPlayer = require("./WebRTCPlayer-CssffyCM.cjs");
|
|
101
101
|
const require_grid = require("./grid.cjs");
|
|
102
102
|
let _evolve_ui_theme_system = require("@evolve.ui/theme-system");
|
package/index.d.cts
CHANGED
|
@@ -47,7 +47,7 @@ import { n as getDisplayDate, t as getDisplayTime } from "./index-C1knx8x3.cjs";
|
|
|
47
47
|
import { t as Drawer } from "./Drawer-CFZbwg0R.cjs";
|
|
48
48
|
import { n as TooltipProps, r as reactTooltip, t as Tooltip } from "./Tooltip-D6_5Rsmd.cjs";
|
|
49
49
|
import { t as EducationalPopover } from "./EducationalPopover-CLNgGomH.cjs";
|
|
50
|
-
import { a as BaseFavoriteButtonProps, c as IconOnlyFavoriteButtonProps, i as useFeatureFlag, l as LabeledFavoriteButtonProps, n as cn, o as FavoriteButtonProps, r as useFeatureFlags, s as FavoriteButtonVariant, t as FavoriteButton } from "./FavoriteButton-
|
|
50
|
+
import { a as BaseFavoriteButtonProps, c as IconOnlyFavoriteButtonProps, i as useFeatureFlag, l as LabeledFavoriteButtonProps, n as cn, o as FavoriteButtonProps, r as useFeatureFlags, s as FavoriteButtonVariant, t as FavoriteButton } from "./FavoriteButton-B8r_qtlj.cjs";
|
|
51
51
|
import { t as FeatureFlagDevToolsUI } from "./FeatureFlagDevToolsUI-CutvngLI.cjs";
|
|
52
52
|
import { a as UploadValidationContext, b as ValidationError, c as useValidationContext, i as useFileUploadContext, r as FileUploadProvider, s as UploadValidationProvider, t as FileUploadContext } from "./index-BAR19_eg.cjs";
|
|
53
53
|
import { n as useFileValidation } from "./index-Co9X1Vty.cjs";
|
package/index.d.mts
CHANGED
|
@@ -47,7 +47,7 @@ import { n as getDisplayDate, t as getDisplayTime } from "./index-C1knx8x3.mjs";
|
|
|
47
47
|
import { t as Drawer } from "./Drawer-CFZbwg0R.mjs";
|
|
48
48
|
import { n as TooltipProps, r as reactTooltip, t as Tooltip } from "./Tooltip-D6_5Rsmd.mjs";
|
|
49
49
|
import { t as EducationalPopover } from "./EducationalPopover-DP63Yqlm.mjs";
|
|
50
|
-
import { a as BaseFavoriteButtonProps, c as IconOnlyFavoriteButtonProps, i as useFeatureFlag, l as LabeledFavoriteButtonProps, n as cn, o as FavoriteButtonProps, r as useFeatureFlags, s as FavoriteButtonVariant, t as FavoriteButton } from "./FavoriteButton-
|
|
50
|
+
import { a as BaseFavoriteButtonProps, c as IconOnlyFavoriteButtonProps, i as useFeatureFlag, l as LabeledFavoriteButtonProps, n as cn, o as FavoriteButtonProps, r as useFeatureFlags, s as FavoriteButtonVariant, t as FavoriteButton } from "./FavoriteButton-hIkGjcKH.mjs";
|
|
51
51
|
import { t as FeatureFlagDevToolsUI } from "./FeatureFlagDevToolsUI-CutvngLI.mjs";
|
|
52
52
|
import { a as UploadValidationContext, b as ValidationError, c as useValidationContext, i as useFileUploadContext, r as FileUploadProvider, s as UploadValidationProvider, t as FileUploadContext } from "./index-BAR19_eg.mjs";
|
|
53
53
|
import { n as useFileValidation } from "./index-CQb7B4U7.mjs";
|
package/index.mjs
CHANGED
|
@@ -24,14 +24,14 @@ import { ItemBadge } from "./Badge/ItemBadge.mjs";
|
|
|
24
24
|
import { LiveStatusBadge } from "./Badge/LiveStatusBadge.mjs";
|
|
25
25
|
import { Skeleton } from "./skeleton.mjs";
|
|
26
26
|
import { t as BannerNotification } from "./BannerNotification-DzprO7bZ.mjs";
|
|
27
|
-
import { t as BottomSheet } from "./BottomSheet-
|
|
27
|
+
import { t as BottomSheet } from "./BottomSheet-CNVLnEoD.mjs";
|
|
28
28
|
import { t as Breadcrumbs } from "./Breadcrumbs-blgWG9cP.mjs";
|
|
29
29
|
import { t as Callout } from "./Callout-Olv0CM82.mjs";
|
|
30
30
|
import { SingleCard } from "./card/singleCard.mjs";
|
|
31
31
|
import { t as CardGrid } from "./CardGrid-BpX_oOS4.mjs";
|
|
32
32
|
import { t as cardFactory } from "./cardFactory-B0Ah0Qb8.mjs";
|
|
33
33
|
import { createBadge } from "./card/components/createBadge.mjs";
|
|
34
|
-
import { t as FavoriteButton } from "./FavoriteButton-
|
|
34
|
+
import { t as FavoriteButton } from "./FavoriteButton-7nK77lQP.mjs";
|
|
35
35
|
import { t as SaveConfetti } from "./SaveConfetti-DI0MTd63.mjs";
|
|
36
36
|
import { createFavoriteButton } from "./card/components/createFavoriteButton.mjs";
|
|
37
37
|
import { createImage } from "./card/components/createImage.mjs";
|
|
@@ -41,13 +41,13 @@ import { InlineButton } from "./Typography/InlineButton.mjs";
|
|
|
41
41
|
import { createPriceStatus, priceStatusPreviewOnlyIntlKey, priceStatusSeeSoldPriceIntlKey, priceStatusSoldIntlKey } from "./card/components/createPriceStatus.mjs";
|
|
42
42
|
import { t as Confetti } from "./Confetti-Csdjmzfv.mjs";
|
|
43
43
|
import { n as toast, t as ToastContainer } from "./Toast-CdUaFVpt.mjs";
|
|
44
|
-
import { a as DEFAULT_COOKIE_CATEGORIES, i as ConsentSource, n as DEFAULT_CONSENT_STORAGE_KEY, r as useCookieConsent, t as CookieConsent } from "./CookieConsent-
|
|
44
|
+
import { a as DEFAULT_COOKIE_CATEGORIES, i as ConsentSource, n as DEFAULT_CONSENT_STORAGE_KEY, r as useCookieConsent, t as CookieConsent } from "./CookieConsent-B9dg9WdC.mjs";
|
|
45
45
|
import { a as ModalContent, c as BackButton, i as ModalHeader, n as ModalSubTitle, o as ModalActions, r as ModalProgressSteps, s as CloseButton, t as ModalTitle } from "./components-BPFB_cmZ.mjs";
|
|
46
46
|
import { ModalContext } from "./modal/context.mjs";
|
|
47
47
|
import { useCloseModal, useForceCloseModal } from "./modal/useCloseModal.mjs";
|
|
48
48
|
import { n as currentPageAtom, r as Page, t as ContentPager } from "./ContentPager-B9UIPahb.mjs";
|
|
49
49
|
import { ProgressSteps } from "./progressSteps.mjs";
|
|
50
|
-
import { t as Modal } from "./Modal-
|
|
50
|
+
import { t as Modal } from "./Modal-DtxWd7Le.mjs";
|
|
51
51
|
import { ToggleSwitch } from "./toggleSwitch.mjs";
|
|
52
52
|
import { t as Countdown } from "./Countdown-Hiu5EYUI.mjs";
|
|
53
53
|
import { Chip } from "./chips/chip.mjs";
|
|
@@ -60,23 +60,23 @@ import { n as getDisplayDate, t as getDisplayTime } from "./utils-C6Ngn6x9.mjs";
|
|
|
60
60
|
import { DateInput } from "./dateInput.mjs";
|
|
61
61
|
import { t as DatePicker } from "./datePicker-DQ32Z8yo.mjs";
|
|
62
62
|
import { t as TimePicker } from "./timePicker-BPrJk5TQ.mjs";
|
|
63
|
-
import { t as Drawer } from "./Drawer-
|
|
63
|
+
import { t as Drawer } from "./Drawer-DzKEmewj.mjs";
|
|
64
64
|
import { EducationalPopover } from "./educationalPopover.mjs";
|
|
65
65
|
import { t as useFeatureFlags } from "./useFeatureFlags-Dmf_37f8.mjs";
|
|
66
66
|
import { t as FeatureFlagDevToolsUI } from "./FeatureFlagDevToolsUI-B13AuQ2A.mjs";
|
|
67
67
|
import { t as useFeatureFlag } from "./hooks-BudbgYTF.mjs";
|
|
68
68
|
import { a as useValidationContext, c as getFilePluralizationText, i as UploadValidationProvider, l as getFileExtensionsFromAcceptedTypes, n as useFileValidation, r as UploadValidationContext } from "./hooks-D4sJ62Xl.mjs";
|
|
69
|
-
import { a as FileCard, c as FileDropzone, d as useFileUploadContext, i as FilePreviewList, l as FileUploadContext, n as FileDropzoneOverlay, o as ListFileCard, r as FileUpload, s as GridFileCard, t as FileUploadCanvas, u as FileUploadProvider } from "./FileUpload-
|
|
69
|
+
import { a as FileCard, c as FileDropzone, d as useFileUploadContext, i as FilePreviewList, l as FileUploadContext, n as FileDropzoneOverlay, o as ListFileCard, r as FileUpload, s as GridFileCard, t as FileUploadCanvas, u as FileUploadProvider } from "./FileUpload-BfZOMsLs.mjs";
|
|
70
70
|
import { Tabs } from "./tabs.mjs";
|
|
71
71
|
import { t as Loading } from "./Loading-BenQpF_w.mjs";
|
|
72
|
-
import { i as usePagination, n as Pagination, r as PaginationProvider, t as AdvancedPagination } from "./Pagination-
|
|
73
|
-
import { n as selectBuiltins, t as Select } from "./Select-
|
|
74
|
-
import { t as Table } from "./Table-
|
|
75
|
-
import { n as MenuDivider, r as MenuItem, t as Menu } from "./Menu-
|
|
76
|
-
import { t as ProgressCircle } from "./ProgressCircle-
|
|
72
|
+
import { i as usePagination, n as Pagination, r as PaginationProvider, t as AdvancedPagination } from "./Pagination-Dyfeys4B.mjs";
|
|
73
|
+
import { n as selectBuiltins, t as Select } from "./Select-CH_ZN88G.mjs";
|
|
74
|
+
import { t as Table } from "./Table-CQGtDpvH.mjs";
|
|
75
|
+
import { n as MenuDivider, r as MenuItem, t as Menu } from "./Menu-Bn4smlEe.mjs";
|
|
76
|
+
import { t as ProgressCircle } from "./ProgressCircle-zSai1HTT.mjs";
|
|
77
77
|
import { t as CreditCardIcon } from "./CreditCardIcon-rpcjx4S_.mjs";
|
|
78
78
|
import { ImageCluster } from "./imageCluster.mjs";
|
|
79
|
-
import { i as Thumbnails, r as ThumbnailDisplay, t as ImageSlider } from "./ImageSlider-
|
|
79
|
+
import { i as Thumbnails, r as ThumbnailDisplay, t as ImageSlider } from "./ImageSlider-fdrJ6lIJ.mjs";
|
|
80
80
|
import { InlineNotification } from "./inlineNotification.mjs";
|
|
81
81
|
import { t as JumpMenu } from "./JumpMenu-DcZjAiej.mjs";
|
|
82
82
|
import { NotificationBadge } from "./notificationBadge.mjs";
|
|
@@ -87,12 +87,12 @@ import { SelectAsync } from "./selectAsync.mjs";
|
|
|
87
87
|
import { SelectAsyncCreatable } from "./selectAsyncCreatable.mjs";
|
|
88
88
|
import { SelectCreatable } from "./selectCreatable.mjs";
|
|
89
89
|
import { n as SegmentedControl, t as SegmentedControlGroup } from "./SegmentedControl-DHf4SQQL.mjs";
|
|
90
|
-
import { t as SplitButton } from "./SplitButton-
|
|
90
|
+
import { t as SplitButton } from "./SplitButton-_poP9Ykq.mjs";
|
|
91
91
|
import { t as StarRating } from "./StarRating-CRGx_jeU.mjs";
|
|
92
92
|
import { largerScreenThan, maxMediaQuery, minMediaQuery, smallerScreenThan } from "./breakpoints.mjs";
|
|
93
93
|
import { InfoIconTooltip } from "./InfoIconTooltip.mjs";
|
|
94
94
|
import { TextAreaInput } from "./textArea.mjs";
|
|
95
|
-
import { t as ViewMore } from "./ViewMore-
|
|
95
|
+
import { t as ViewMore } from "./ViewMore-Be0TQZ_2.mjs";
|
|
96
96
|
import { n as useWebRTCStream, t as WebRTCPlayer } from "./WebRTCPlayer-C-sTtskR.mjs";
|
|
97
97
|
import { EasyRestrict, PageGrid, SubGridContainer, baseGridClasses, pageGridClasses, useSubGridCSS } from "./grid.mjs";
|
|
98
98
|
import { cn } from "@evolve.ui/theme-system";
|
package/menu.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
__esModule: { value: true },
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
|
-
const require_Menu = require("./Menu-
|
|
6
|
+
const require_Menu = require("./Menu-DuDhtoNP.cjs");
|
|
7
7
|
exports.Menu = require_Menu.Menu;
|
|
8
8
|
exports.MenuDivider = require_Menu.MenuDivider;
|
|
9
9
|
exports.MenuItem = require_Menu.MenuItem;
|
package/menu.mjs
CHANGED
package/modal/useCloseModal.cjs
CHANGED
|
@@ -84,7 +84,8 @@ const useCloseModal = (handleCloseData) => {
|
|
|
84
84
|
}
|
|
85
85
|
if (!backdrop || !container) return;
|
|
86
86
|
setModalAnimation("closing");
|
|
87
|
-
container.addEventListener("animationend", () => {
|
|
87
|
+
container.addEventListener("animationend", (event) => {
|
|
88
|
+
if (event.target !== event.currentTarget) return;
|
|
88
89
|
clearTimeout(timeout);
|
|
89
90
|
forceCloseModal();
|
|
90
91
|
storedResolve();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCloseModal.cjs","names":["ModalContext","defaultModalContext","nodeEnv"],"sources":["../../src/Modal/hooks/useCloseModal.ts"],"sourcesContent":["import { useSetAtom } from 'jotai';\nimport { useResetAtom } from 'jotai/utils';\nimport { useCallback, useContext } from 'react';\n\nimport { nodeEnv } from '../../utils/nodeEnv';\nimport { defaultModalContext, ModalContext } from '../context';\n\n/**\n * Closes the modal without an animation.\n *\n * If possible, use `useCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal instantly.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useForceCloseModal = (handleCloseData?: any) => {\n const modalContext = useContext(ModalContext);\n\n if (modalContext === defaultModalContext) {\n throw new Error(\n 'useForceCloseModal must be used within a Modal. If you need to programmatically close a modal, change show to false instead.'\n );\n }\n\n const {\n handleClose,\n modalAnimationAtom,\n modalHasFooterAtom,\n onModalCloseAnimationEnd,\n scrollTopAtom,\n showBottomScrollHintAtom,\n showTopScrollHintAtom,\n } = modalContext;\n const resetShowBottomScrollHint = useResetAtom(showBottomScrollHintAtom);\n const resetShowTopScrollHint = useResetAtom(showTopScrollHintAtom);\n const resetScrollTop = useResetAtom(scrollTopAtom);\n const resetModalHasFooter = useResetAtom(modalHasFooterAtom);\n const resetIsClosingModal = useResetAtom(modalAnimationAtom);\n\n return useCallback(() => {\n resetShowBottomScrollHint();\n resetShowTopScrollHint();\n resetScrollTop();\n resetModalHasFooter();\n resetIsClosingModal();\n handleClose?.(handleCloseData);\n\n // if we are in a test environment, we want to call the onModalCloseAnimationEnd callback since it is not called by the animation end event\n if (nodeEnv === 'test') {\n onModalCloseAnimationEnd?.();\n }\n }, [\n resetShowBottomScrollHint,\n resetShowTopScrollHint,\n resetScrollTop,\n resetModalHasFooter,\n onModalCloseAnimationEnd,\n resetIsClosingModal,\n handleClose,\n handleCloseData,\n ]);\n};\n\n/**\n * Closes the modal with an animation.\n *\n * If the animation does not finish, the modal will not be closed.\n *\n * If you want to close the modal without an animation, use `useForceCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useCloseModal = (handleCloseData?: any) => {\n const { modalAnimationAtom } = useContext(ModalContext);\n const forceCloseModal = useForceCloseModal(handleCloseData);\n const setModalAnimation = useSetAtom(modalAnimationAtom);\n const isTestEnv = nodeEnv === 'test';\n\n /* istanbul ignore next */\n return useCallback(async () => {\n if (typeof document === 'undefined') {\n return;\n }\n\n let storedResolve: () => void;\n let storedReject: () => void;\n const promiseWeAwait = new Promise<void>((resolve, reject) => {\n storedResolve = resolve;\n storedReject = reject;\n });\n\n const timeout = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.error(\n 'Modal reached error state: Modal show was set to `false` out of order. To fix, make sure you are using useCloseModal (and waiting for the animation to finish) or useForceCloseModal'\n );\n storedReject();\n }, 450);\n\n // These are hard coded in those components. Lets us use less refs.\n const backdrop = document.querySelector('.hui-modal-backdrop') as HTMLElement | null;\n const container = document.querySelector('.hui-modal-container') as HTMLElement | null;\n\n if (isTestEnv) {\n clearTimeout(timeout);\n forceCloseModal();\n return;\n }\n\n if (!backdrop || !container) {\n return;\n }\n\n // If we are in a test environment, we want to close the modal immediately.\n\n setModalAnimation('closing');\n\n container.addEventListener('animationend', () => {\n clearTimeout(timeout);\n forceCloseModal();\n storedResolve();\n });\n\n // Wait for the animation to finish.\n\n await promiseWeAwait;\n }, [forceCloseModal, setModalAnimation, isTestEnv]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAa,sBAAsB,oBAA0B;CACzD,MAAM,gBAAA,GAAA,MAAA,WAAA,CAA0BA,sBAAAA,YAAY;CAE5C,IAAI,iBAAiBC,sBAAAA,qBACjB,MAAM,IAAI,MACN,8HACJ;CAGJ,MAAM,EACF,aACA,oBACA,oBACA,0BACA,eACA,0BACA,0BACA;CACJ,MAAM,6BAAA,GAAA,YAAA,aAAA,CAAyC,wBAAwB;CACvE,MAAM,0BAAA,GAAA,YAAA,aAAA,CAAsC,qBAAqB;CACjE,MAAM,kBAAA,GAAA,YAAA,aAAA,CAA8B,aAAa;CACjD,MAAM,uBAAA,GAAA,YAAA,aAAA,CAAmC,kBAAkB;CAC3D,MAAM,uBAAA,GAAA,YAAA,aAAA,CAAmC,kBAAkB;CAE3D,QAAA,GAAA,MAAA,YAAA,OAAyB;EACrB,0BAA0B;EAC1B,uBAAuB;EACvB,eAAe;EACf,oBAAoB;EACpB,oBAAoB;EACpB,cAAc,eAAe;EAG7B,IAAIC,gBAAAA,YAAY,QACZ,2BAA2B;CAEnC,GAAG;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;;;;;;;;;AAcA,MAAa,iBAAiB,oBAA0B;CACpD,MAAM,EAAE,wBAAA,GAAA,MAAA,WAAA,CAAkCF,sBAAAA,YAAY;CACtD,MAAM,kBAAkB,mBAAmB,eAAe;CAC1D,MAAM,qBAAA,GAAA,MAAA,WAAA,CAA+B,kBAAkB;CACvD,MAAM,YAAYE,gBAAAA,YAAY;;CAG9B,QAAA,GAAA,MAAA,YAAA,CAAmB,YAAY;EAC3B,IAAI,OAAO,aAAa,aACpB;EAGJ,IAAI;EACJ,IAAI;EACJ,MAAM,iBAAiB,IAAI,SAAe,SAAS,WAAW;GAC1D,gBAAgB;GAChB,eAAe;EACnB,CAAC;EAED,MAAM,UAAU,iBAAiB;GAE7B,QAAQ,MACJ,sLACJ;GACA,aAAa;EACjB,GAAG,GAAG;EAGN,MAAM,WAAW,SAAS,cAAc,qBAAqB;EAC7D,MAAM,YAAY,SAAS,cAAc,sBAAsB;EAE/D,IAAI,WAAW;GACX,aAAa,OAAO;GACpB,gBAAgB;GAChB;EACJ;EAEA,IAAI,CAAC,YAAY,CAAC,WACd;EAKJ,kBAAkB,SAAS;EAE3B,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useCloseModal.cjs","names":["ModalContext","defaultModalContext","nodeEnv"],"sources":["../../src/Modal/hooks/useCloseModal.ts"],"sourcesContent":["import { useSetAtom } from 'jotai';\nimport { useResetAtom } from 'jotai/utils';\nimport { useCallback, useContext } from 'react';\n\nimport { nodeEnv } from '../../utils/nodeEnv';\nimport { defaultModalContext, ModalContext } from '../context';\n\n/**\n * Closes the modal without an animation.\n *\n * If possible, use `useCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal instantly.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useForceCloseModal = (handleCloseData?: any) => {\n const modalContext = useContext(ModalContext);\n\n if (modalContext === defaultModalContext) {\n throw new Error(\n 'useForceCloseModal must be used within a Modal. If you need to programmatically close a modal, change show to false instead.'\n );\n }\n\n const {\n handleClose,\n modalAnimationAtom,\n modalHasFooterAtom,\n onModalCloseAnimationEnd,\n scrollTopAtom,\n showBottomScrollHintAtom,\n showTopScrollHintAtom,\n } = modalContext;\n const resetShowBottomScrollHint = useResetAtom(showBottomScrollHintAtom);\n const resetShowTopScrollHint = useResetAtom(showTopScrollHintAtom);\n const resetScrollTop = useResetAtom(scrollTopAtom);\n const resetModalHasFooter = useResetAtom(modalHasFooterAtom);\n const resetIsClosingModal = useResetAtom(modalAnimationAtom);\n\n return useCallback(() => {\n resetShowBottomScrollHint();\n resetShowTopScrollHint();\n resetScrollTop();\n resetModalHasFooter();\n resetIsClosingModal();\n handleClose?.(handleCloseData);\n\n // if we are in a test environment, we want to call the onModalCloseAnimationEnd callback since it is not called by the animation end event\n if (nodeEnv === 'test') {\n onModalCloseAnimationEnd?.();\n }\n }, [\n resetShowBottomScrollHint,\n resetShowTopScrollHint,\n resetScrollTop,\n resetModalHasFooter,\n onModalCloseAnimationEnd,\n resetIsClosingModal,\n handleClose,\n handleCloseData,\n ]);\n};\n\n/**\n * Closes the modal with an animation.\n *\n * If the animation does not finish, the modal will not be closed.\n *\n * If you want to close the modal without an animation, use `useForceCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useCloseModal = (handleCloseData?: any) => {\n const { modalAnimationAtom } = useContext(ModalContext);\n const forceCloseModal = useForceCloseModal(handleCloseData);\n const setModalAnimation = useSetAtom(modalAnimationAtom);\n const isTestEnv = nodeEnv === 'test';\n\n /* istanbul ignore next */\n return useCallback(async () => {\n if (typeof document === 'undefined') {\n return;\n }\n\n let storedResolve: () => void;\n let storedReject: () => void;\n const promiseWeAwait = new Promise<void>((resolve, reject) => {\n storedResolve = resolve;\n storedReject = reject;\n });\n\n const timeout = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.error(\n 'Modal reached error state: Modal show was set to `false` out of order. To fix, make sure you are using useCloseModal (and waiting for the animation to finish) or useForceCloseModal'\n );\n storedReject();\n }, 450);\n\n // These are hard coded in those components. Lets us use less refs.\n const backdrop = document.querySelector('.hui-modal-backdrop') as HTMLElement | null;\n const container = document.querySelector('.hui-modal-container') as HTMLElement | null;\n\n if (isTestEnv) {\n clearTimeout(timeout);\n forceCloseModal();\n return;\n }\n\n if (!backdrop || !container) {\n return;\n }\n\n // If we are in a test environment, we want to close the modal immediately.\n\n setModalAnimation('closing');\n\n container.addEventListener('animationend', (event) => {\n // `animationend` bubbles up from descendants. Under `prefers-reduced-motion: reduce`\n // every animation collapses to ~1ms, so a child finishing in the same tick would\n // otherwise clear the watchdog and resolve the close before the modal has animated.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n clearTimeout(timeout);\n forceCloseModal();\n storedResolve();\n });\n\n // Wait for the animation to finish.\n\n await promiseWeAwait;\n }, [forceCloseModal, setModalAnimation, isTestEnv]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAa,sBAAsB,oBAA0B;CACzD,MAAM,gBAAA,GAAA,MAAA,WAAA,CAA0BA,sBAAAA,YAAY;CAE5C,IAAI,iBAAiBC,sBAAAA,qBACjB,MAAM,IAAI,MACN,8HACJ;CAGJ,MAAM,EACF,aACA,oBACA,oBACA,0BACA,eACA,0BACA,0BACA;CACJ,MAAM,6BAAA,GAAA,YAAA,aAAA,CAAyC,wBAAwB;CACvE,MAAM,0BAAA,GAAA,YAAA,aAAA,CAAsC,qBAAqB;CACjE,MAAM,kBAAA,GAAA,YAAA,aAAA,CAA8B,aAAa;CACjD,MAAM,uBAAA,GAAA,YAAA,aAAA,CAAmC,kBAAkB;CAC3D,MAAM,uBAAA,GAAA,YAAA,aAAA,CAAmC,kBAAkB;CAE3D,QAAA,GAAA,MAAA,YAAA,OAAyB;EACrB,0BAA0B;EAC1B,uBAAuB;EACvB,eAAe;EACf,oBAAoB;EACpB,oBAAoB;EACpB,cAAc,eAAe;EAG7B,IAAIC,gBAAAA,YAAY,QACZ,2BAA2B;CAEnC,GAAG;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;;;;;;;;;AAcA,MAAa,iBAAiB,oBAA0B;CACpD,MAAM,EAAE,wBAAA,GAAA,MAAA,WAAA,CAAkCF,sBAAAA,YAAY;CACtD,MAAM,kBAAkB,mBAAmB,eAAe;CAC1D,MAAM,qBAAA,GAAA,MAAA,WAAA,CAA+B,kBAAkB;CACvD,MAAM,YAAYE,gBAAAA,YAAY;;CAG9B,QAAA,GAAA,MAAA,YAAA,CAAmB,YAAY;EAC3B,IAAI,OAAO,aAAa,aACpB;EAGJ,IAAI;EACJ,IAAI;EACJ,MAAM,iBAAiB,IAAI,SAAe,SAAS,WAAW;GAC1D,gBAAgB;GAChB,eAAe;EACnB,CAAC;EAED,MAAM,UAAU,iBAAiB;GAE7B,QAAQ,MACJ,sLACJ;GACA,aAAa;EACjB,GAAG,GAAG;EAGN,MAAM,WAAW,SAAS,cAAc,qBAAqB;EAC7D,MAAM,YAAY,SAAS,cAAc,sBAAsB;EAE/D,IAAI,WAAW;GACX,aAAa,OAAO;GACpB,gBAAgB;GAChB;EACJ;EAEA,IAAI,CAAC,YAAY,CAAC,WACd;EAKJ,kBAAkB,SAAS;EAE3B,UAAU,iBAAiB,iBAAiB,UAAU;GAIlD,IAAI,MAAM,WAAW,MAAM,eACvB;GAGJ,aAAa,OAAO;GACpB,gBAAgB;GAChB,cAAc;EAClB,CAAC;EAID,MAAM;CACV,GAAG;EAAC;EAAiB;EAAmB;CAAS,CAAC;AACtD"}
|
package/modal/useCloseModal.mjs
CHANGED
|
@@ -80,7 +80,8 @@ const useCloseModal = (handleCloseData) => {
|
|
|
80
80
|
}
|
|
81
81
|
if (!backdrop || !container) return;
|
|
82
82
|
setModalAnimation("closing");
|
|
83
|
-
container.addEventListener("animationend", () => {
|
|
83
|
+
container.addEventListener("animationend", (event) => {
|
|
84
|
+
if (event.target !== event.currentTarget) return;
|
|
84
85
|
clearTimeout(timeout);
|
|
85
86
|
forceCloseModal();
|
|
86
87
|
storedResolve();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCloseModal.mjs","names":[],"sources":["../../src/Modal/hooks/useCloseModal.ts"],"sourcesContent":["import { useSetAtom } from 'jotai';\nimport { useResetAtom } from 'jotai/utils';\nimport { useCallback, useContext } from 'react';\n\nimport { nodeEnv } from '../../utils/nodeEnv';\nimport { defaultModalContext, ModalContext } from '../context';\n\n/**\n * Closes the modal without an animation.\n *\n * If possible, use `useCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal instantly.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useForceCloseModal = (handleCloseData?: any) => {\n const modalContext = useContext(ModalContext);\n\n if (modalContext === defaultModalContext) {\n throw new Error(\n 'useForceCloseModal must be used within a Modal. If you need to programmatically close a modal, change show to false instead.'\n );\n }\n\n const {\n handleClose,\n modalAnimationAtom,\n modalHasFooterAtom,\n onModalCloseAnimationEnd,\n scrollTopAtom,\n showBottomScrollHintAtom,\n showTopScrollHintAtom,\n } = modalContext;\n const resetShowBottomScrollHint = useResetAtom(showBottomScrollHintAtom);\n const resetShowTopScrollHint = useResetAtom(showTopScrollHintAtom);\n const resetScrollTop = useResetAtom(scrollTopAtom);\n const resetModalHasFooter = useResetAtom(modalHasFooterAtom);\n const resetIsClosingModal = useResetAtom(modalAnimationAtom);\n\n return useCallback(() => {\n resetShowBottomScrollHint();\n resetShowTopScrollHint();\n resetScrollTop();\n resetModalHasFooter();\n resetIsClosingModal();\n handleClose?.(handleCloseData);\n\n // if we are in a test environment, we want to call the onModalCloseAnimationEnd callback since it is not called by the animation end event\n if (nodeEnv === 'test') {\n onModalCloseAnimationEnd?.();\n }\n }, [\n resetShowBottomScrollHint,\n resetShowTopScrollHint,\n resetScrollTop,\n resetModalHasFooter,\n onModalCloseAnimationEnd,\n resetIsClosingModal,\n handleClose,\n handleCloseData,\n ]);\n};\n\n/**\n * Closes the modal with an animation.\n *\n * If the animation does not finish, the modal will not be closed.\n *\n * If you want to close the modal without an animation, use `useForceCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useCloseModal = (handleCloseData?: any) => {\n const { modalAnimationAtom } = useContext(ModalContext);\n const forceCloseModal = useForceCloseModal(handleCloseData);\n const setModalAnimation = useSetAtom(modalAnimationAtom);\n const isTestEnv = nodeEnv === 'test';\n\n /* istanbul ignore next */\n return useCallback(async () => {\n if (typeof document === 'undefined') {\n return;\n }\n\n let storedResolve: () => void;\n let storedReject: () => void;\n const promiseWeAwait = new Promise<void>((resolve, reject) => {\n storedResolve = resolve;\n storedReject = reject;\n });\n\n const timeout = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.error(\n 'Modal reached error state: Modal show was set to `false` out of order. To fix, make sure you are using useCloseModal (and waiting for the animation to finish) or useForceCloseModal'\n );\n storedReject();\n }, 450);\n\n // These are hard coded in those components. Lets us use less refs.\n const backdrop = document.querySelector('.hui-modal-backdrop') as HTMLElement | null;\n const container = document.querySelector('.hui-modal-container') as HTMLElement | null;\n\n if (isTestEnv) {\n clearTimeout(timeout);\n forceCloseModal();\n return;\n }\n\n if (!backdrop || !container) {\n return;\n }\n\n // If we are in a test environment, we want to close the modal immediately.\n\n setModalAnimation('closing');\n\n container.addEventListener('animationend', () => {\n clearTimeout(timeout);\n forceCloseModal();\n storedResolve();\n });\n\n // Wait for the animation to finish.\n\n await promiseWeAwait;\n }, [forceCloseModal, setModalAnimation, isTestEnv]);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,sBAAsB,oBAA0B;CACzD,MAAM,eAAe,WAAW,YAAY;CAE5C,IAAI,iBAAiB,qBACjB,MAAM,IAAI,MACN,8HACJ;CAGJ,MAAM,EACF,aACA,oBACA,oBACA,0BACA,eACA,0BACA,0BACA;CACJ,MAAM,4BAA4B,aAAa,wBAAwB;CACvE,MAAM,yBAAyB,aAAa,qBAAqB;CACjE,MAAM,iBAAiB,aAAa,aAAa;CACjD,MAAM,sBAAsB,aAAa,kBAAkB;CAC3D,MAAM,sBAAsB,aAAa,kBAAkB;CAE3D,OAAO,kBAAkB;EACrB,0BAA0B;EAC1B,uBAAuB;EACvB,eAAe;EACf,oBAAoB;EACpB,oBAAoB;EACpB,cAAc,eAAe;EAG7B,IAAI,YAAY,QACZ,2BAA2B;CAEnC,GAAG;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;;;;;;;;;AAcA,MAAa,iBAAiB,oBAA0B;CACpD,MAAM,EAAE,uBAAuB,WAAW,YAAY;CACtD,MAAM,kBAAkB,mBAAmB,eAAe;CAC1D,MAAM,oBAAoB,WAAW,kBAAkB;CACvD,MAAM,YAAY,YAAY;;CAG9B,OAAO,YAAY,YAAY;EAC3B,IAAI,OAAO,aAAa,aACpB;EAGJ,IAAI;EACJ,IAAI;EACJ,MAAM,iBAAiB,IAAI,SAAe,SAAS,WAAW;GAC1D,gBAAgB;GAChB,eAAe;EACnB,CAAC;EAED,MAAM,UAAU,iBAAiB;GAE7B,QAAQ,MACJ,sLACJ;GACA,aAAa;EACjB,GAAG,GAAG;EAGN,MAAM,WAAW,SAAS,cAAc,qBAAqB;EAC7D,MAAM,YAAY,SAAS,cAAc,sBAAsB;EAE/D,IAAI,WAAW;GACX,aAAa,OAAO;GACpB,gBAAgB;GAChB;EACJ;EAEA,IAAI,CAAC,YAAY,CAAC,WACd;EAKJ,kBAAkB,SAAS;EAE3B,UAAU,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useCloseModal.mjs","names":[],"sources":["../../src/Modal/hooks/useCloseModal.ts"],"sourcesContent":["import { useSetAtom } from 'jotai';\nimport { useResetAtom } from 'jotai/utils';\nimport { useCallback, useContext } from 'react';\n\nimport { nodeEnv } from '../../utils/nodeEnv';\nimport { defaultModalContext, ModalContext } from '../context';\n\n/**\n * Closes the modal without an animation.\n *\n * If possible, use `useCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal instantly.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useForceCloseModal = (handleCloseData?: any) => {\n const modalContext = useContext(ModalContext);\n\n if (modalContext === defaultModalContext) {\n throw new Error(\n 'useForceCloseModal must be used within a Modal. If you need to programmatically close a modal, change show to false instead.'\n );\n }\n\n const {\n handleClose,\n modalAnimationAtom,\n modalHasFooterAtom,\n onModalCloseAnimationEnd,\n scrollTopAtom,\n showBottomScrollHintAtom,\n showTopScrollHintAtom,\n } = modalContext;\n const resetShowBottomScrollHint = useResetAtom(showBottomScrollHintAtom);\n const resetShowTopScrollHint = useResetAtom(showTopScrollHintAtom);\n const resetScrollTop = useResetAtom(scrollTopAtom);\n const resetModalHasFooter = useResetAtom(modalHasFooterAtom);\n const resetIsClosingModal = useResetAtom(modalAnimationAtom);\n\n return useCallback(() => {\n resetShowBottomScrollHint();\n resetShowTopScrollHint();\n resetScrollTop();\n resetModalHasFooter();\n resetIsClosingModal();\n handleClose?.(handleCloseData);\n\n // if we are in a test environment, we want to call the onModalCloseAnimationEnd callback since it is not called by the animation end event\n if (nodeEnv === 'test') {\n onModalCloseAnimationEnd?.();\n }\n }, [\n resetShowBottomScrollHint,\n resetShowTopScrollHint,\n resetScrollTop,\n resetModalHasFooter,\n onModalCloseAnimationEnd,\n resetIsClosingModal,\n handleClose,\n handleCloseData,\n ]);\n};\n\n/**\n * Closes the modal with an animation.\n *\n * If the animation does not finish, the modal will not be closed.\n *\n * If you want to close the modal without an animation, use `useForceCloseModal` instead.\n *\n * @param handleCloseData Data that will be passed to the `handleClose` function on the modal.\n * By default, the close button calls with `\"close\"` and the backdrop calls with `\"backdrop\"`.\n * @returns A function that closes the modal.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- hammer-parity: handleCloseData is an arbitrary consumer-defined payload forwarded verbatim to handleClose\nexport const useCloseModal = (handleCloseData?: any) => {\n const { modalAnimationAtom } = useContext(ModalContext);\n const forceCloseModal = useForceCloseModal(handleCloseData);\n const setModalAnimation = useSetAtom(modalAnimationAtom);\n const isTestEnv = nodeEnv === 'test';\n\n /* istanbul ignore next */\n return useCallback(async () => {\n if (typeof document === 'undefined') {\n return;\n }\n\n let storedResolve: () => void;\n let storedReject: () => void;\n const promiseWeAwait = new Promise<void>((resolve, reject) => {\n storedResolve = resolve;\n storedReject = reject;\n });\n\n const timeout = setTimeout(() => {\n // eslint-disable-next-line no-console\n console.error(\n 'Modal reached error state: Modal show was set to `false` out of order. To fix, make sure you are using useCloseModal (and waiting for the animation to finish) or useForceCloseModal'\n );\n storedReject();\n }, 450);\n\n // These are hard coded in those components. Lets us use less refs.\n const backdrop = document.querySelector('.hui-modal-backdrop') as HTMLElement | null;\n const container = document.querySelector('.hui-modal-container') as HTMLElement | null;\n\n if (isTestEnv) {\n clearTimeout(timeout);\n forceCloseModal();\n return;\n }\n\n if (!backdrop || !container) {\n return;\n }\n\n // If we are in a test environment, we want to close the modal immediately.\n\n setModalAnimation('closing');\n\n container.addEventListener('animationend', (event) => {\n // `animationend` bubbles up from descendants. Under `prefers-reduced-motion: reduce`\n // every animation collapses to ~1ms, so a child finishing in the same tick would\n // otherwise clear the watchdog and resolve the close before the modal has animated.\n if (event.target !== event.currentTarget) {\n return;\n }\n\n clearTimeout(timeout);\n forceCloseModal();\n storedResolve();\n });\n\n // Wait for the animation to finish.\n\n await promiseWeAwait;\n }, [forceCloseModal, setModalAnimation, isTestEnv]);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,sBAAsB,oBAA0B;CACzD,MAAM,eAAe,WAAW,YAAY;CAE5C,IAAI,iBAAiB,qBACjB,MAAM,IAAI,MACN,8HACJ;CAGJ,MAAM,EACF,aACA,oBACA,oBACA,0BACA,eACA,0BACA,0BACA;CACJ,MAAM,4BAA4B,aAAa,wBAAwB;CACvE,MAAM,yBAAyB,aAAa,qBAAqB;CACjE,MAAM,iBAAiB,aAAa,aAAa;CACjD,MAAM,sBAAsB,aAAa,kBAAkB;CAC3D,MAAM,sBAAsB,aAAa,kBAAkB;CAE3D,OAAO,kBAAkB;EACrB,0BAA0B;EAC1B,uBAAuB;EACvB,eAAe;EACf,oBAAoB;EACpB,oBAAoB;EACpB,cAAc,eAAe;EAG7B,IAAI,YAAY,QACZ,2BAA2B;CAEnC,GAAG;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;;;;;;;;;AAcA,MAAa,iBAAiB,oBAA0B;CACpD,MAAM,EAAE,uBAAuB,WAAW,YAAY;CACtD,MAAM,kBAAkB,mBAAmB,eAAe;CAC1D,MAAM,oBAAoB,WAAW,kBAAkB;CACvD,MAAM,YAAY,YAAY;;CAG9B,OAAO,YAAY,YAAY;EAC3B,IAAI,OAAO,aAAa,aACpB;EAGJ,IAAI;EACJ,IAAI;EACJ,MAAM,iBAAiB,IAAI,SAAe,SAAS,WAAW;GAC1D,gBAAgB;GAChB,eAAe;EACnB,CAAC;EAED,MAAM,UAAU,iBAAiB;GAE7B,QAAQ,MACJ,sLACJ;GACA,aAAa;EACjB,GAAG,GAAG;EAGN,MAAM,WAAW,SAAS,cAAc,qBAAqB;EAC7D,MAAM,YAAY,SAAS,cAAc,sBAAsB;EAE/D,IAAI,WAAW;GACX,aAAa,OAAO;GACpB,gBAAgB;GAChB;EACJ;EAEA,IAAI,CAAC,YAAY,CAAC,WACd;EAKJ,kBAAkB,SAAS;EAE3B,UAAU,iBAAiB,iBAAiB,UAAU;GAIlD,IAAI,MAAM,WAAW,MAAM,eACvB;GAGJ,aAAa,OAAO;GACpB,gBAAgB;GAChB,cAAc;EAClB,CAAC;EAID,MAAM;CACV,GAAG;EAAC;EAAiB;EAAmB;CAAS,CAAC;AACtD"}
|
package/modal.cjs
CHANGED
package/modal.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evolve.ui/core-components",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@evolve.ui/theme-system": "^1.
|
|
4
|
+
"@evolve.ui/theme-system": "^1.2.0",
|
|
5
5
|
"@dnd-kit/core": "6.3.1",
|
|
6
|
-
"@dnd-kit/sortable": "10.0.0",
|
|
7
|
-
"@dnd-kit/utilities": "3.2.2",
|
|
8
6
|
"@floating-ui/react": "0.26.1",
|
|
9
7
|
"@formatjs/icu-messageformat-parser": "2.11.1",
|
|
10
8
|
"@juggle/resize-observer": "3.4.0",
|
|
@@ -36,7 +34,7 @@
|
|
|
36
34
|
"tailwindcss": ">=3"
|
|
37
35
|
},
|
|
38
36
|
"sideEffects": false,
|
|
39
|
-
"version": "1.
|
|
37
|
+
"version": "1.2.0",
|
|
40
38
|
"repository": {
|
|
41
39
|
"type": "git",
|
|
42
40
|
"url": "git+https://github.com/dbarrett24/evolve-ui.git",
|
package/pagination.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
__esModule: { value: true },
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
|
-
const require_Pagination = require("./Pagination-
|
|
6
|
+
const require_Pagination = require("./Pagination-Denb9_zB.cjs");
|
|
7
7
|
exports.AdvancedPagination = require_Pagination.AdvancedPagination;
|
|
8
8
|
exports.Pagination = require_Pagination.Pagination;
|
|
9
9
|
exports.PaginationProvider = require_Pagination.PaginationProvider;
|
package/pagination.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { i as usePagination, n as Pagination, r as PaginationProvider, t as AdvancedPagination } from "./Pagination-
|
|
2
|
+
import { i as usePagination, n as Pagination, r as PaginationProvider, t as AdvancedPagination } from "./Pagination-Dyfeys4B.mjs";
|
|
3
3
|
export { AdvancedPagination, Pagination, PaginationProvider, usePagination };
|
package/progressCircle.cjs
CHANGED
|
@@ -3,5 +3,5 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
__esModule: { value: true },
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
|
-
const require_ProgressCircle = require("./ProgressCircle-
|
|
6
|
+
const require_ProgressCircle = require("./ProgressCircle-B6R4dxoV.cjs");
|
|
7
7
|
exports.ProgressCircle = require_ProgressCircle.ProgressCircle;
|
package/progressCircle.mjs
CHANGED
package/searchInput.cjs
CHANGED
|
@@ -33,7 +33,7 @@ const SearchInput = ({ "button-aria-label": buttonAriaLabel = "Search", classNam
|
|
|
33
33
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
34
|
className: (0, _evolve_ui_theme_system.cn)("rounded-search-input bg-background-primary", className),
|
|
35
35
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
36
|
-
className: (0, _evolve_ui_theme_system.cn)("overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus]:border-border-selected", {
|
|
36
|
+
className: (0, _evolve_ui_theme_system.cn)("overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus-visible]:border-border-selected", {
|
|
37
37
|
"border-0": emphasis === "bold",
|
|
38
38
|
"h-[32px]": small,
|
|
39
39
|
"h-[40px]": !small,
|
|
@@ -43,9 +43,9 @@ const SearchInput = ({ "button-aria-label": buttonAriaLabel = "Search", classNam
|
|
|
43
43
|
"hover:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
44
44
|
"hover:outline-focus-inverse": style === "inverse"
|
|
45
45
|
}, {
|
|
46
|
-
"has-[:focus]:border-border-secondary has-[:focus]:bg-background-primary has-[:focus]:outline has-[:focus]:outline-focus-inverse": emphasis === "bold",
|
|
47
|
-
"has-[:focus]:outline-2 has-[:focus]:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
48
|
-
"has-[:focus]:outline-4 has-[:focus]:outline-focus-inverse": style === "inverse"
|
|
46
|
+
"has-[:focus-visible]:border-border-secondary has-[:focus-visible]:bg-background-primary has-[:focus-visible]:outline has-[:focus-visible]:outline-focus-inverse": emphasis === "bold",
|
|
47
|
+
"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
48
|
+
"has-[:focus-visible]:outline-4 has-[:focus-visible]:outline-focus-inverse": style === "inverse"
|
|
49
49
|
}),
|
|
50
50
|
"data-hui-id": "SearchInput",
|
|
51
51
|
"data-testid": testId,
|
package/searchInput.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchInput.cjs","names":["TextInput","IconButton","MagnifyingGlass"],"sources":["../src/SearchInput/SearchInput.tsx"],"sourcesContent":["import { cn } from '@evolve.ui/theme-system';\nimport { FormEventHandler, ReactNode, RefObject, useCallback, useEffect, useState } from 'react';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { MagnifyingGlass } from '../Icons';\nimport { IconWeight } from '../Icons/IconBase';\nimport { TextInput } from '../TextInput/TextInput';\n\ntype Props = {\n /**\n * Changes the aria label for the `<button>` element\n *\n * @default 'Search button'\n */\n 'button-aria-label'?: string;\n className?: string;\n /**\n * Allows you to add a data-testid to the component\n */\n ['data-testid']?: string;\n /**\n * If true, the search input will be disabled\n */\n disabled?: boolean;\n /**\n * Input emphasis. Currently supports subtle and bold. Defaults to subtle.\n */\n emphasis?: 'subtle' | 'bold';\n /**\n * Custom content rendered inside the input on the right, before the search button\n * (e.g. an extra action icon).\n */\n endAdornment?: ReactNode;\n /**\n * Style variant for the icon. Can be either 'regular' (default), 'bold', 'fill', or 'duotone'.\n */\n iconStyle?: IconWeight;\n /**\n * Allows you to edit the input id\n *\n * @default 'search-input'\n */\n id?: string;\n /**\n * Set an initial value to pass through\n *\n * @default ''\n */\n initialValue?: string;\n /**\n * Changes the aria label for the `<input>` element\n *\n * @default 'Search input'\n */\n 'input-aria-label'?: string;\n /**\n * Ref for the input element\n */\n inputRef?: RefObject<HTMLInputElement>;\n /**\n * Maximum number of characters allowed in the input.\n * Uses the native HTML maxLength attribute.\n */\n maxLength?: number;\n /**\n * Callback that triggers when the input loses focus\n */\n onBlur?: () => void;\n /**\n * Callback that triggers when you press the clear button\n */\n onClear?: () => void;\n /**\n * Callback that triggers when the input gains focus\n */\n onFocus?: () => void;\n /**\n * Callback that triggers when you submit (press enter or button)\n */\n onSubmit?: (searchString: string) => void;\n /**\n * Callback that triggers when you type\n */\n onTextChange?: (searchString: string) => void;\n /**\n * Allows you to edit the placeholder text\n *\n * @default 'Search'\n */\n placeholder?: string;\n /**\n * Show in the small size vs the medium one\n */\n small?: boolean;\n /**\n * Style variant for the input. Can be either 'neutral' (default) or 'inverse' for dark backgrounds.\n */\n style?: 'neutral' | 'inverse';\n\n /**\n * Controlled value for the input\n * If provided, initialValue will be ignored\n */\n value?: string;\n};\n\nexport const SearchInput = ({\n 'button-aria-label': buttonAriaLabel = 'Search',\n className,\n 'data-testid': testId = 'search-input',\n disabled = false,\n emphasis,\n endAdornment,\n iconStyle,\n id = 'search-input',\n initialValue = '',\n 'input-aria-label': inputAriaLabel = 'Search input',\n inputRef,\n maxLength,\n onBlur,\n onClear: onClearProp,\n onFocus,\n onSubmit: onSubmitProp,\n onTextChange,\n placeholder = 'Search',\n small = false,\n style,\n value,\n}: Props) => {\n const [search, setSearch] = useState(value ?? initialValue);\n\n // Add effect to sync with controlled value when it changes\n useEffect(() => {\n if (value !== undefined) {\n setSearch(value);\n }\n }, [value]);\n\n const setSearchText = useCallback(\n (s: string) => {\n onTextChange?.(s);\n setSearch(s);\n },\n [onTextChange]\n );\n\n const onChange = useCallback<FormEventHandler<HTMLInputElement>>(\n (e) => {\n setSearchText(e.currentTarget.value);\n },\n [setSearchText]\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n setSearchText('');\n }, [setSearchText, onClearProp]);\n\n const onSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n (e) => {\n onSubmitProp?.(search);\n e.preventDefault();\n },\n [onSubmitProp, search]\n );\n\n return (\n <div className={cn('rounded-search-input bg-background-primary', className)}>\n <form\n className={cn(\n 'overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus]:border-border-selected',\n {\n 'border-0': emphasis === 'bold',\n 'h-[32px]': small, // Smaller due to box-content to prevent clipping\n 'h-[40px]': !small, // Smaller due to box-content to prevent clipping\n 'outline outline-1 outline-border-black': emphasis === 'bold' && style === 'neutral',\n },\n // Hover Styles\n {\n 'hover:border-border-secondary hover:bg-background-hover hover:outline hover:outline-2 hover:outline-border-black':\n emphasis === 'bold',\n 'hover:outline-border-black': style === 'neutral' && emphasis === 'bold',\n 'hover:outline-focus-inverse': style === 'inverse',\n },\n // Focus Styles\n {\n 'has-[:focus]:border-border-secondary has-[:focus]:bg-background-primary has-[:focus]:outline has-[:focus]:outline-focus-inverse':\n emphasis === 'bold',\n 'has-[:focus]:outline-2 has-[:focus]:outline-border-black':\n style === 'neutral' && emphasis === 'bold',\n 'has-[:focus]:outline-4 has-[:focus]:outline-focus-inverse': style === 'inverse',\n }\n )}\n data-hui-id=\"SearchInput\"\n data-testid={testId}\n onSubmit={onSubmit}\n >\n <TextInput\n aria-label={inputAriaLabel}\n autoComplete=\"off\"\n className={cn('w-full [&>div]:!border-transparent [&>div]:!bg-transparent')}\n clearAriaLabel=\"Clear search text\"\n disabled={disabled}\n emphasis={emphasis}\n id={id}\n maxLength={maxLength}\n onBlur={onBlur}\n onChange={onChange}\n onClear={onClear}\n onFocus={onFocus}\n placeholder={placeholder}\n ref={inputRef}\n value={search}\n />\n {endAdornment}\n {search !== '' && emphasis === 'bold' && (\n <div className={cn('-ml-2xs h-[24px] border-l border-border-secondary', { 'h-[20px]': small })} />\n )}\n <IconButton\n aria-label={buttonAriaLabel}\n className={cn('mr-2xs self-center justify-self-end !rounded-button', {\n 'mr-[-1px]': small,\n })}\n disabled={disabled}\n hideTooltip\n icon={MagnifyingGlass}\n iconStyle={iconStyle}\n size=\"sm\"\n style={search === '' || emphasis === 'bold' ? 'neutral' : 'primary'}\n type=\"submit\"\n variant={search === '' || emphasis === 'bold' ? 'transparent' : 'filled'}\n />\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AA0GA,MAAa,eAAe,EACxB,qBAAqB,kBAAkB,UACvC,WACA,eAAe,SAAS,gBACxB,WAAW,OACX,UACA,cACA,WACA,KAAK,gBACL,eAAe,IACf,oBAAoB,iBAAiB,gBACrC,UACA,WACA,QACA,SAAS,aACT,SACA,UAAU,cACV,cACA,cAAc,UACd,QAAQ,OACR,OACA,YACS;CACT,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,SAAA,CAAsB,SAAS,YAAY;CAG1D,CAAA,GAAA,MAAA,UAAA,OAAgB;EACZ,IAAI,UAAU,KAAA,GACV,UAAU,KAAK;CAEvB,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,iBAAA,GAAA,MAAA,YAAA,EACD,MAAc;EACX,eAAe,CAAC;EAChB,UAAU,CAAC;CACf,GACA,CAAC,YAAY,CACjB;CAEA,MAAM,YAAA,GAAA,MAAA,YAAA,EACD,MAAM;EACH,cAAc,EAAE,cAAc,KAAK;CACvC,GACA,CAAC,aAAa,CAClB;CAEA,MAAM,WAAA,GAAA,MAAA,YAAA,OAA4B;EAC9B,cAAc;EACd,cAAc,EAAE;CACpB,GAAG,CAAC,eAAe,WAAW,CAAC;CAE/B,MAAM,YAAA,GAAA,MAAA,YAAA,EACD,MAAM;EACH,eAAe,MAAM;EACrB,EAAE,eAAe;CACrB,GACA,CAAC,cAAc,MAAM,CACzB;CAEA,OACI,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,YAAA,GAAA,wBAAA,GAAA,CAAc,8CAA8C,SAAS;YACtE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;GACI,YAAA,GAAA,wBAAA,GAAA,CACI,0OACA;IACI,YAAY,aAAa;IACzB,YAAY;IACZ,YAAY,CAAC;IACb,0CAA0C,aAAa,UAAU,UAAU;GAC/E,GAEA;IACI,oHACI,aAAa;IACjB,8BAA8B,UAAU,aAAa,aAAa;IAClE,+BAA+B,UAAU;GAC7C,GAEA;IACI,mIACI,aAAa;IACjB,4DACI,UAAU,aAAa,aAAa;IACxC,6DAA6D,UAAU;GAC3E,CACJ;GACA,eAAY;GACZ,eAAa;GACH;aA3Bd;IA6BI,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,WAAD;KACI,cAAY;KACZ,cAAa;KACb,YAAA,GAAA,wBAAA,GAAA,CAAc,4DAA4D;KAC1E,gBAAe;KACL;KACA;KACN;KACO;KACH;KACE;KACD;KACA;KACI;KACb,KAAK;KACL,OAAO;IACV,CAAA;IACA;IACA,WAAW,MAAM,aAAa,UAC3B,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,YAAA,GAAA,wBAAA,GAAA,CAAc,qDAAqD,EAAE,YAAY,MAAM,CAAC,EAAI,CAAA;IAErG,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;KACI,cAAY;KACZ,YAAA,GAAA,wBAAA,GAAA,CAAc,uDAAuD,EACjE,aAAa,MACjB,CAAC;KACS;KACV,aAAA;KACA,MAAMC,cAAAA;KACK;KACX,MAAK;KACL,OAAO,WAAW,MAAM,aAAa,SAAS,YAAY;KAC1D,MAAK;KACL,SAAS,WAAW,MAAM,aAAa,SAAS,gBAAgB;IACnE,CAAA;GACC;;CACL,CAAA;AAEb"}
|
|
1
|
+
{"version":3,"file":"searchInput.cjs","names":["TextInput","IconButton","MagnifyingGlass"],"sources":["../src/SearchInput/SearchInput.tsx"],"sourcesContent":["import { cn } from '@evolve.ui/theme-system';\nimport { FormEventHandler, ReactNode, RefObject, useCallback, useEffect, useState } from 'react';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { MagnifyingGlass } from '../Icons';\nimport { IconWeight } from '../Icons/IconBase';\nimport { TextInput } from '../TextInput/TextInput';\n\ntype Props = {\n /**\n * Changes the aria label for the `<button>` element\n *\n * @default 'Search button'\n */\n 'button-aria-label'?: string;\n className?: string;\n /**\n * Allows you to add a data-testid to the component\n */\n ['data-testid']?: string;\n /**\n * If true, the search input will be disabled\n */\n disabled?: boolean;\n /**\n * Input emphasis. Currently supports subtle and bold. Defaults to subtle.\n */\n emphasis?: 'subtle' | 'bold';\n /**\n * Custom content rendered inside the input on the right, before the search button\n * (e.g. an extra action icon).\n */\n endAdornment?: ReactNode;\n /**\n * Style variant for the icon. Can be either 'regular' (default), 'bold', 'fill', or 'duotone'.\n */\n iconStyle?: IconWeight;\n /**\n * Allows you to edit the input id\n *\n * @default 'search-input'\n */\n id?: string;\n /**\n * Set an initial value to pass through\n *\n * @default ''\n */\n initialValue?: string;\n /**\n * Changes the aria label for the `<input>` element\n *\n * @default 'Search input'\n */\n 'input-aria-label'?: string;\n /**\n * Ref for the input element\n */\n inputRef?: RefObject<HTMLInputElement>;\n /**\n * Maximum number of characters allowed in the input.\n * Uses the native HTML maxLength attribute.\n */\n maxLength?: number;\n /**\n * Callback that triggers when the input loses focus\n */\n onBlur?: () => void;\n /**\n * Callback that triggers when you press the clear button\n */\n onClear?: () => void;\n /**\n * Callback that triggers when the input gains focus\n */\n onFocus?: () => void;\n /**\n * Callback that triggers when you submit (press enter or button)\n */\n onSubmit?: (searchString: string) => void;\n /**\n * Callback that triggers when you type\n */\n onTextChange?: (searchString: string) => void;\n /**\n * Allows you to edit the placeholder text\n *\n * @default 'Search'\n */\n placeholder?: string;\n /**\n * Show in the small size vs the medium one\n */\n small?: boolean;\n /**\n * Style variant for the input. Can be either 'neutral' (default) or 'inverse' for dark backgrounds.\n */\n style?: 'neutral' | 'inverse';\n\n /**\n * Controlled value for the input\n * If provided, initialValue will be ignored\n */\n value?: string;\n};\n\nexport const SearchInput = ({\n 'button-aria-label': buttonAriaLabel = 'Search',\n className,\n 'data-testid': testId = 'search-input',\n disabled = false,\n emphasis,\n endAdornment,\n iconStyle,\n id = 'search-input',\n initialValue = '',\n 'input-aria-label': inputAriaLabel = 'Search input',\n inputRef,\n maxLength,\n onBlur,\n onClear: onClearProp,\n onFocus,\n onSubmit: onSubmitProp,\n onTextChange,\n placeholder = 'Search',\n small = false,\n style,\n value,\n}: Props) => {\n const [search, setSearch] = useState(value ?? initialValue);\n\n // Add effect to sync with controlled value when it changes\n useEffect(() => {\n if (value !== undefined) {\n setSearch(value);\n }\n }, [value]);\n\n const setSearchText = useCallback(\n (s: string) => {\n onTextChange?.(s);\n setSearch(s);\n },\n [onTextChange]\n );\n\n const onChange = useCallback<FormEventHandler<HTMLInputElement>>(\n (e) => {\n setSearchText(e.currentTarget.value);\n },\n [setSearchText]\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n setSearchText('');\n }, [setSearchText, onClearProp]);\n\n const onSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n (e) => {\n onSubmitProp?.(search);\n e.preventDefault();\n },\n [onSubmitProp, search]\n );\n\n return (\n <div className={cn('rounded-search-input bg-background-primary', className)}>\n <form\n className={cn(\n 'overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus-visible]:border-border-selected',\n {\n 'border-0': emphasis === 'bold',\n 'h-[32px]': small, // Smaller due to box-content to prevent clipping\n 'h-[40px]': !small, // Smaller due to box-content to prevent clipping\n 'outline outline-1 outline-border-black': emphasis === 'bold' && style === 'neutral',\n },\n // Hover Styles\n {\n 'hover:border-border-secondary hover:bg-background-hover hover:outline hover:outline-2 hover:outline-border-black':\n emphasis === 'bold',\n 'hover:outline-border-black': style === 'neutral' && emphasis === 'bold',\n 'hover:outline-focus-inverse': style === 'inverse',\n },\n // Focus Styles\n {\n 'has-[:focus-visible]:border-border-secondary has-[:focus-visible]:bg-background-primary has-[:focus-visible]:outline has-[:focus-visible]:outline-focus-inverse':\n emphasis === 'bold',\n 'has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-border-black':\n style === 'neutral' && emphasis === 'bold',\n 'has-[:focus-visible]:outline-4 has-[:focus-visible]:outline-focus-inverse':\n style === 'inverse',\n }\n )}\n data-hui-id=\"SearchInput\"\n data-testid={testId}\n onSubmit={onSubmit}\n >\n <TextInput\n aria-label={inputAriaLabel}\n autoComplete=\"off\"\n className={cn('w-full [&>div]:!border-transparent [&>div]:!bg-transparent')}\n clearAriaLabel=\"Clear search text\"\n disabled={disabled}\n emphasis={emphasis}\n id={id}\n maxLength={maxLength}\n onBlur={onBlur}\n onChange={onChange}\n onClear={onClear}\n onFocus={onFocus}\n placeholder={placeholder}\n ref={inputRef}\n value={search}\n />\n {endAdornment}\n {search !== '' && emphasis === 'bold' && (\n <div className={cn('-ml-2xs h-[24px] border-l border-border-secondary', { 'h-[20px]': small })} />\n )}\n <IconButton\n aria-label={buttonAriaLabel}\n className={cn('mr-2xs self-center justify-self-end !rounded-button', {\n 'mr-[-1px]': small,\n })}\n disabled={disabled}\n hideTooltip\n icon={MagnifyingGlass}\n iconStyle={iconStyle}\n size=\"sm\"\n style={search === '' || emphasis === 'bold' ? 'neutral' : 'primary'}\n type=\"submit\"\n variant={search === '' || emphasis === 'bold' ? 'transparent' : 'filled'}\n />\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AA0GA,MAAa,eAAe,EACxB,qBAAqB,kBAAkB,UACvC,WACA,eAAe,SAAS,gBACxB,WAAW,OACX,UACA,cACA,WACA,KAAK,gBACL,eAAe,IACf,oBAAoB,iBAAiB,gBACrC,UACA,WACA,QACA,SAAS,aACT,SACA,UAAU,cACV,cACA,cAAc,UACd,QAAQ,OACR,OACA,YACS;CACT,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,SAAA,CAAsB,SAAS,YAAY;CAG1D,CAAA,GAAA,MAAA,UAAA,OAAgB;EACZ,IAAI,UAAU,KAAA,GACV,UAAU,KAAK;CAEvB,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,iBAAA,GAAA,MAAA,YAAA,EACD,MAAc;EACX,eAAe,CAAC;EAChB,UAAU,CAAC;CACf,GACA,CAAC,YAAY,CACjB;CAEA,MAAM,YAAA,GAAA,MAAA,YAAA,EACD,MAAM;EACH,cAAc,EAAE,cAAc,KAAK;CACvC,GACA,CAAC,aAAa,CAClB;CAEA,MAAM,WAAA,GAAA,MAAA,YAAA,OAA4B;EAC9B,cAAc;EACd,cAAc,EAAE;CACpB,GAAG,CAAC,eAAe,WAAW,CAAC;CAE/B,MAAM,YAAA,GAAA,MAAA,YAAA,EACD,MAAM;EACH,eAAe,MAAM;EACrB,EAAE,eAAe;CACrB,GACA,CAAC,cAAc,MAAM,CACzB;CAEA,OACI,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,YAAA,GAAA,wBAAA,GAAA,CAAc,8CAA8C,SAAS;YACtE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;GACI,YAAA,GAAA,wBAAA,GAAA,CACI,kPACA;IACI,YAAY,aAAa;IACzB,YAAY;IACZ,YAAY,CAAC;IACb,0CAA0C,aAAa,UAAU,UAAU;GAC/E,GAEA;IACI,oHACI,aAAa;IACjB,8BAA8B,UAAU,aAAa,aAAa;IAClE,+BAA+B,UAAU;GAC7C,GAEA;IACI,mKACI,aAAa;IACjB,4EACI,UAAU,aAAa,aAAa;IACxC,6EACI,UAAU;GAClB,CACJ;GACA,eAAY;GACZ,eAAa;GACH;aA5Bd;IA8BI,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,WAAD;KACI,cAAY;KACZ,cAAa;KACb,YAAA,GAAA,wBAAA,GAAA,CAAc,4DAA4D;KAC1E,gBAAe;KACL;KACA;KACN;KACO;KACH;KACE;KACD;KACA;KACI;KACb,KAAK;KACL,OAAO;IACV,CAAA;IACA;IACA,WAAW,MAAM,aAAa,UAC3B,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD,EAAK,YAAA,GAAA,wBAAA,GAAA,CAAc,qDAAqD,EAAE,YAAY,MAAM,CAAC,EAAI,CAAA;IAErG,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;KACI,cAAY;KACZ,YAAA,GAAA,wBAAA,GAAA,CAAc,uDAAuD,EACjE,aAAa,MACjB,CAAC;KACS;KACV,aAAA;KACA,MAAMC,cAAAA;KACK;KACX,MAAK;KACL,OAAO,WAAW,MAAM,aAAa,SAAS,YAAY;KAC1D,MAAK;KACL,SAAS,WAAW,MAAM,aAAa,SAAS,gBAAgB;IACnE,CAAA;GACC;;CACL,CAAA;AAEb"}
|
package/searchInput.mjs
CHANGED
|
@@ -29,7 +29,7 @@ const SearchInput = ({ "button-aria-label": buttonAriaLabel = "Search", classNam
|
|
|
29
29
|
return /* @__PURE__ */ jsx("div", {
|
|
30
30
|
className: cn("rounded-search-input bg-background-primary", className),
|
|
31
31
|
children: /* @__PURE__ */ jsxs("form", {
|
|
32
|
-
className: cn("overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus]:border-border-selected", {
|
|
32
|
+
className: cn("overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus-visible]:border-border-selected", {
|
|
33
33
|
"border-0": emphasis === "bold",
|
|
34
34
|
"h-[32px]": small,
|
|
35
35
|
"h-[40px]": !small,
|
|
@@ -39,9 +39,9 @@ const SearchInput = ({ "button-aria-label": buttonAriaLabel = "Search", classNam
|
|
|
39
39
|
"hover:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
40
40
|
"hover:outline-focus-inverse": style === "inverse"
|
|
41
41
|
}, {
|
|
42
|
-
"has-[:focus]:border-border-secondary has-[:focus]:bg-background-primary has-[:focus]:outline has-[:focus]:outline-focus-inverse": emphasis === "bold",
|
|
43
|
-
"has-[:focus]:outline-2 has-[:focus]:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
44
|
-
"has-[:focus]:outline-4 has-[:focus]:outline-focus-inverse": style === "inverse"
|
|
42
|
+
"has-[:focus-visible]:border-border-secondary has-[:focus-visible]:bg-background-primary has-[:focus-visible]:outline has-[:focus-visible]:outline-focus-inverse": emphasis === "bold",
|
|
43
|
+
"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-border-black": style === "neutral" && emphasis === "bold",
|
|
44
|
+
"has-[:focus-visible]:outline-4 has-[:focus-visible]:outline-focus-inverse": style === "inverse"
|
|
45
45
|
}),
|
|
46
46
|
"data-hui-id": "SearchInput",
|
|
47
47
|
"data-testid": testId,
|
package/searchInput.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchInput.mjs","names":[],"sources":["../src/SearchInput/SearchInput.tsx"],"sourcesContent":["import { cn } from '@evolve.ui/theme-system';\nimport { FormEventHandler, ReactNode, RefObject, useCallback, useEffect, useState } from 'react';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { MagnifyingGlass } from '../Icons';\nimport { IconWeight } from '../Icons/IconBase';\nimport { TextInput } from '../TextInput/TextInput';\n\ntype Props = {\n /**\n * Changes the aria label for the `<button>` element\n *\n * @default 'Search button'\n */\n 'button-aria-label'?: string;\n className?: string;\n /**\n * Allows you to add a data-testid to the component\n */\n ['data-testid']?: string;\n /**\n * If true, the search input will be disabled\n */\n disabled?: boolean;\n /**\n * Input emphasis. Currently supports subtle and bold. Defaults to subtle.\n */\n emphasis?: 'subtle' | 'bold';\n /**\n * Custom content rendered inside the input on the right, before the search button\n * (e.g. an extra action icon).\n */\n endAdornment?: ReactNode;\n /**\n * Style variant for the icon. Can be either 'regular' (default), 'bold', 'fill', or 'duotone'.\n */\n iconStyle?: IconWeight;\n /**\n * Allows you to edit the input id\n *\n * @default 'search-input'\n */\n id?: string;\n /**\n * Set an initial value to pass through\n *\n * @default ''\n */\n initialValue?: string;\n /**\n * Changes the aria label for the `<input>` element\n *\n * @default 'Search input'\n */\n 'input-aria-label'?: string;\n /**\n * Ref for the input element\n */\n inputRef?: RefObject<HTMLInputElement>;\n /**\n * Maximum number of characters allowed in the input.\n * Uses the native HTML maxLength attribute.\n */\n maxLength?: number;\n /**\n * Callback that triggers when the input loses focus\n */\n onBlur?: () => void;\n /**\n * Callback that triggers when you press the clear button\n */\n onClear?: () => void;\n /**\n * Callback that triggers when the input gains focus\n */\n onFocus?: () => void;\n /**\n * Callback that triggers when you submit (press enter or button)\n */\n onSubmit?: (searchString: string) => void;\n /**\n * Callback that triggers when you type\n */\n onTextChange?: (searchString: string) => void;\n /**\n * Allows you to edit the placeholder text\n *\n * @default 'Search'\n */\n placeholder?: string;\n /**\n * Show in the small size vs the medium one\n */\n small?: boolean;\n /**\n * Style variant for the input. Can be either 'neutral' (default) or 'inverse' for dark backgrounds.\n */\n style?: 'neutral' | 'inverse';\n\n /**\n * Controlled value for the input\n * If provided, initialValue will be ignored\n */\n value?: string;\n};\n\nexport const SearchInput = ({\n 'button-aria-label': buttonAriaLabel = 'Search',\n className,\n 'data-testid': testId = 'search-input',\n disabled = false,\n emphasis,\n endAdornment,\n iconStyle,\n id = 'search-input',\n initialValue = '',\n 'input-aria-label': inputAriaLabel = 'Search input',\n inputRef,\n maxLength,\n onBlur,\n onClear: onClearProp,\n onFocus,\n onSubmit: onSubmitProp,\n onTextChange,\n placeholder = 'Search',\n small = false,\n style,\n value,\n}: Props) => {\n const [search, setSearch] = useState(value ?? initialValue);\n\n // Add effect to sync with controlled value when it changes\n useEffect(() => {\n if (value !== undefined) {\n setSearch(value);\n }\n }, [value]);\n\n const setSearchText = useCallback(\n (s: string) => {\n onTextChange?.(s);\n setSearch(s);\n },\n [onTextChange]\n );\n\n const onChange = useCallback<FormEventHandler<HTMLInputElement>>(\n (e) => {\n setSearchText(e.currentTarget.value);\n },\n [setSearchText]\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n setSearchText('');\n }, [setSearchText, onClearProp]);\n\n const onSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n (e) => {\n onSubmitProp?.(search);\n e.preventDefault();\n },\n [onSubmitProp, search]\n );\n\n return (\n <div className={cn('rounded-search-input bg-background-primary', className)}>\n <form\n className={cn(\n 'overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus]:border-border-selected',\n {\n 'border-0': emphasis === 'bold',\n 'h-[32px]': small, // Smaller due to box-content to prevent clipping\n 'h-[40px]': !small, // Smaller due to box-content to prevent clipping\n 'outline outline-1 outline-border-black': emphasis === 'bold' && style === 'neutral',\n },\n // Hover Styles\n {\n 'hover:border-border-secondary hover:bg-background-hover hover:outline hover:outline-2 hover:outline-border-black':\n emphasis === 'bold',\n 'hover:outline-border-black': style === 'neutral' && emphasis === 'bold',\n 'hover:outline-focus-inverse': style === 'inverse',\n },\n // Focus Styles\n {\n 'has-[:focus]:border-border-secondary has-[:focus]:bg-background-primary has-[:focus]:outline has-[:focus]:outline-focus-inverse':\n emphasis === 'bold',\n 'has-[:focus]:outline-2 has-[:focus]:outline-border-black':\n style === 'neutral' && emphasis === 'bold',\n 'has-[:focus]:outline-4 has-[:focus]:outline-focus-inverse'
|
|
1
|
+
{"version":3,"file":"searchInput.mjs","names":[],"sources":["../src/SearchInput/SearchInput.tsx"],"sourcesContent":["import { cn } from '@evolve.ui/theme-system';\nimport { FormEventHandler, ReactNode, RefObject, useCallback, useEffect, useState } from 'react';\n\nimport { IconButton } from '../IconButton/IconButton';\nimport { MagnifyingGlass } from '../Icons';\nimport { IconWeight } from '../Icons/IconBase';\nimport { TextInput } from '../TextInput/TextInput';\n\ntype Props = {\n /**\n * Changes the aria label for the `<button>` element\n *\n * @default 'Search button'\n */\n 'button-aria-label'?: string;\n className?: string;\n /**\n * Allows you to add a data-testid to the component\n */\n ['data-testid']?: string;\n /**\n * If true, the search input will be disabled\n */\n disabled?: boolean;\n /**\n * Input emphasis. Currently supports subtle and bold. Defaults to subtle.\n */\n emphasis?: 'subtle' | 'bold';\n /**\n * Custom content rendered inside the input on the right, before the search button\n * (e.g. an extra action icon).\n */\n endAdornment?: ReactNode;\n /**\n * Style variant for the icon. Can be either 'regular' (default), 'bold', 'fill', or 'duotone'.\n */\n iconStyle?: IconWeight;\n /**\n * Allows you to edit the input id\n *\n * @default 'search-input'\n */\n id?: string;\n /**\n * Set an initial value to pass through\n *\n * @default ''\n */\n initialValue?: string;\n /**\n * Changes the aria label for the `<input>` element\n *\n * @default 'Search input'\n */\n 'input-aria-label'?: string;\n /**\n * Ref for the input element\n */\n inputRef?: RefObject<HTMLInputElement>;\n /**\n * Maximum number of characters allowed in the input.\n * Uses the native HTML maxLength attribute.\n */\n maxLength?: number;\n /**\n * Callback that triggers when the input loses focus\n */\n onBlur?: () => void;\n /**\n * Callback that triggers when you press the clear button\n */\n onClear?: () => void;\n /**\n * Callback that triggers when the input gains focus\n */\n onFocus?: () => void;\n /**\n * Callback that triggers when you submit (press enter or button)\n */\n onSubmit?: (searchString: string) => void;\n /**\n * Callback that triggers when you type\n */\n onTextChange?: (searchString: string) => void;\n /**\n * Allows you to edit the placeholder text\n *\n * @default 'Search'\n */\n placeholder?: string;\n /**\n * Show in the small size vs the medium one\n */\n small?: boolean;\n /**\n * Style variant for the input. Can be either 'neutral' (default) or 'inverse' for dark backgrounds.\n */\n style?: 'neutral' | 'inverse';\n\n /**\n * Controlled value for the input\n * If provided, initialValue will be ignored\n */\n value?: string;\n};\n\nexport const SearchInput = ({\n 'button-aria-label': buttonAriaLabel = 'Search',\n className,\n 'data-testid': testId = 'search-input',\n disabled = false,\n emphasis,\n endAdornment,\n iconStyle,\n id = 'search-input',\n initialValue = '',\n 'input-aria-label': inputAriaLabel = 'Search input',\n inputRef,\n maxLength,\n onBlur,\n onClear: onClearProp,\n onFocus,\n onSubmit: onSubmitProp,\n onTextChange,\n placeholder = 'Search',\n small = false,\n style,\n value,\n}: Props) => {\n const [search, setSearch] = useState(value ?? initialValue);\n\n // Add effect to sync with controlled value when it changes\n useEffect(() => {\n if (value !== undefined) {\n setSearch(value);\n }\n }, [value]);\n\n const setSearchText = useCallback(\n (s: string) => {\n onTextChange?.(s);\n setSearch(s);\n },\n [onTextChange]\n );\n\n const onChange = useCallback<FormEventHandler<HTMLInputElement>>(\n (e) => {\n setSearchText(e.currentTarget.value);\n },\n [setSearchText]\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n setSearchText('');\n }, [setSearchText, onClearProp]);\n\n const onSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n (e) => {\n onSubmitProp?.(search);\n e.preventDefault();\n },\n [onSubmitProp, search]\n );\n\n return (\n <div className={cn('rounded-search-input bg-background-primary', className)}>\n <form\n className={cn(\n 'overflow-none box-content flex items-center gap-2xs rounded-search-input border border-border-secondary bg-background-primary outline-1 outline-background-critical-dark hover:border-border-hover has-[:focus-visible]:border-border-selected',\n {\n 'border-0': emphasis === 'bold',\n 'h-[32px]': small, // Smaller due to box-content to prevent clipping\n 'h-[40px]': !small, // Smaller due to box-content to prevent clipping\n 'outline outline-1 outline-border-black': emphasis === 'bold' && style === 'neutral',\n },\n // Hover Styles\n {\n 'hover:border-border-secondary hover:bg-background-hover hover:outline hover:outline-2 hover:outline-border-black':\n emphasis === 'bold',\n 'hover:outline-border-black': style === 'neutral' && emphasis === 'bold',\n 'hover:outline-focus-inverse': style === 'inverse',\n },\n // Focus Styles\n {\n 'has-[:focus-visible]:border-border-secondary has-[:focus-visible]:bg-background-primary has-[:focus-visible]:outline has-[:focus-visible]:outline-focus-inverse':\n emphasis === 'bold',\n 'has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-border-black':\n style === 'neutral' && emphasis === 'bold',\n 'has-[:focus-visible]:outline-4 has-[:focus-visible]:outline-focus-inverse':\n style === 'inverse',\n }\n )}\n data-hui-id=\"SearchInput\"\n data-testid={testId}\n onSubmit={onSubmit}\n >\n <TextInput\n aria-label={inputAriaLabel}\n autoComplete=\"off\"\n className={cn('w-full [&>div]:!border-transparent [&>div]:!bg-transparent')}\n clearAriaLabel=\"Clear search text\"\n disabled={disabled}\n emphasis={emphasis}\n id={id}\n maxLength={maxLength}\n onBlur={onBlur}\n onChange={onChange}\n onClear={onClear}\n onFocus={onFocus}\n placeholder={placeholder}\n ref={inputRef}\n value={search}\n />\n {endAdornment}\n {search !== '' && emphasis === 'bold' && (\n <div className={cn('-ml-2xs h-[24px] border-l border-border-secondary', { 'h-[20px]': small })} />\n )}\n <IconButton\n aria-label={buttonAriaLabel}\n className={cn('mr-2xs self-center justify-self-end !rounded-button', {\n 'mr-[-1px]': small,\n })}\n disabled={disabled}\n hideTooltip\n icon={MagnifyingGlass}\n iconStyle={iconStyle}\n size=\"sm\"\n style={search === '' || emphasis === 'bold' ? 'neutral' : 'primary'}\n type=\"submit\"\n variant={search === '' || emphasis === 'bold' ? 'transparent' : 'filled'}\n />\n </form>\n </div>\n );\n};\n"],"mappings":";;;;;;;AA0GA,MAAa,eAAe,EACxB,qBAAqB,kBAAkB,UACvC,WACA,eAAe,SAAS,gBACxB,WAAW,OACX,UACA,cACA,WACA,KAAK,gBACL,eAAe,IACf,oBAAoB,iBAAiB,gBACrC,UACA,WACA,QACA,SAAS,aACT,SACA,UAAU,cACV,cACA,cAAc,UACd,QAAQ,OACR,OACA,YACS;CACT,MAAM,CAAC,QAAQ,aAAa,SAAS,SAAS,YAAY;CAG1D,gBAAgB;EACZ,IAAI,UAAU,KAAA,GACV,UAAU,KAAK;CAEvB,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,gBAAgB,aACjB,MAAc;EACX,eAAe,CAAC;EAChB,UAAU,CAAC;CACf,GACA,CAAC,YAAY,CACjB;CAEA,MAAM,WAAW,aACZ,MAAM;EACH,cAAc,EAAE,cAAc,KAAK;CACvC,GACA,CAAC,aAAa,CAClB;CAEA,MAAM,UAAU,kBAAkB;EAC9B,cAAc;EACd,cAAc,EAAE;CACpB,GAAG,CAAC,eAAe,WAAW,CAAC;CAE/B,MAAM,WAAW,aACZ,MAAM;EACH,eAAe,MAAM;EACrB,EAAE,eAAe;CACrB,GACA,CAAC,cAAc,MAAM,CACzB;CAEA,OACI,oBAAC,OAAD;EAAK,WAAW,GAAG,8CAA8C,SAAS;YACtE,qBAAC,QAAD;GACI,WAAW,GACP,kPACA;IACI,YAAY,aAAa;IACzB,YAAY;IACZ,YAAY,CAAC;IACb,0CAA0C,aAAa,UAAU,UAAU;GAC/E,GAEA;IACI,oHACI,aAAa;IACjB,8BAA8B,UAAU,aAAa,aAAa;IAClE,+BAA+B,UAAU;GAC7C,GAEA;IACI,mKACI,aAAa;IACjB,4EACI,UAAU,aAAa,aAAa;IACxC,6EACI,UAAU;GAClB,CACJ;GACA,eAAY;GACZ,eAAa;GACH;aA5Bd;IA8BI,oBAAC,WAAD;KACI,cAAY;KACZ,cAAa;KACb,WAAW,GAAG,4DAA4D;KAC1E,gBAAe;KACL;KACA;KACN;KACO;KACH;KACE;KACD;KACA;KACI;KACb,KAAK;KACL,OAAO;IACV,CAAA;IACA;IACA,WAAW,MAAM,aAAa,UAC3B,oBAAC,OAAD,EAAK,WAAW,GAAG,qDAAqD,EAAE,YAAY,MAAM,CAAC,EAAI,CAAA;IAErG,oBAAC,YAAD;KACI,cAAY;KACZ,WAAW,GAAG,uDAAuD,EACjE,aAAa,MACjB,CAAC;KACS;KACV,aAAA;KACA,MAAM;KACK;KACX,MAAK;KACL,OAAO,WAAW,MAAM,aAAa,SAAS,YAAY;KAC1D,MAAK;KACL,SAAS,WAAW,MAAM,aAAa,SAAS,gBAAgB;IACnE,CAAA;GACC;;CACL,CAAA;AAEb"}
|
package/select.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
__esModule: { value: true },
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
|
-
const require_Select = require("./Select-
|
|
6
|
+
const require_Select = require("./Select-DCCcyLT4.cjs");
|
|
7
7
|
let react_select = require("react-select");
|
|
8
8
|
exports.Select = require_Select.Select;
|
|
9
9
|
exports.reactSelectBuiltins = react_select.components;
|
package/select.mjs
CHANGED
package/selectAsync.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
6
|
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
7
|
-
const require_Select = require("./Select-
|
|
7
|
+
const require_Select = require("./Select-DCCcyLT4.cjs");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_select_async = require("react-select/async");
|
|
10
10
|
react_select_async = require_rolldown_runtime.__toESM(react_select_async);
|
package/selectAsync.mjs
CHANGED
package/selectAsyncCreatable.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
6
|
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
7
|
-
const require_Select = require("./Select-
|
|
7
|
+
const require_Select = require("./Select-DCCcyLT4.cjs");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_select_async_creatable = require("react-select/async-creatable");
|
|
10
10
|
react_select_async_creatable = require_rolldown_runtime.__toESM(react_select_async_creatable);
|
package/selectAsyncCreatable.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { t as Select } from "./Select-
|
|
2
|
+
import { t as Select } from "./Select-CH_ZN88G.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import ReactSelectAsyncCreatable from "react-select/async-creatable";
|
|
5
5
|
//#region src/Select/SelectAsyncCreatable.tsx
|
package/selectCreatable.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
[Symbol.toStringTag]: { value: "Module" }
|
|
5
5
|
});
|
|
6
6
|
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
7
|
-
const require_Select = require("./Select-
|
|
7
|
+
const require_Select = require("./Select-DCCcyLT4.cjs");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_select_creatable = require("react-select/creatable");
|
|
10
10
|
react_select_creatable = require_rolldown_runtime.__toESM(react_select_creatable);
|
package/selectCreatable.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { t as Select } from "./Select-
|
|
2
|
+
import { t as Select } from "./Select-CH_ZN88G.mjs";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import ReactSelectCreatable from "react-select/creatable";
|
|
5
5
|
//#region src/Select/SelectCreatable.tsx
|