@envive-ai/react-toolkit 0.1.10 → 0.1.12

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.
Files changed (162) hide show
  1. package/dist/Accordion/index.cjs +3 -82
  2. package/dist/Accordion/index.d.cts +2 -2
  3. package/dist/Accordion/index.d.ts +2 -2
  4. package/dist/Accordion/index.js +2 -75
  5. package/dist/Accordion-Cp3Hx2zm.js +77 -0
  6. package/dist/Accordion-DBZpiQe7.cjs +88 -0
  7. package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
  8. package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
  9. package/dist/ButtonBase/index.cjs +2 -2
  10. package/dist/ButtonBase/index.d.cts +2 -2
  11. package/dist/ButtonBase/index.d.ts +2 -2
  12. package/dist/ButtonBase/index.js +2 -2
  13. package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
  14. package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
  15. package/dist/FilterScrollbar/index.cjs +1 -1
  16. package/dist/FilterScrollbar/index.d.cts +3 -3
  17. package/dist/FilterScrollbar/index.d.ts +3 -3
  18. package/dist/FilterScrollbar/index.js +1 -1
  19. package/dist/Headline/index.cjs +1 -1
  20. package/dist/Headline/index.d.cts +2 -2
  21. package/dist/Headline/index.d.ts +2 -2
  22. package/dist/Headline/index.js +1 -1
  23. package/dist/ImageWithFallback/index.d.cts +2 -2
  24. package/dist/ImageWithFallback/index.d.ts +2 -2
  25. package/dist/ModalSheet/index.cjs +3 -0
  26. package/dist/ModalSheet/index.d.cts +38 -0
  27. package/dist/ModalSheet/index.d.ts +38 -0
  28. package/dist/ModalSheet/index.js +3 -0
  29. package/dist/ModalSheet-01pxpy_K.js +326 -0
  30. package/dist/ModalSheet-Csz8HIxs.cjs +337 -0
  31. package/dist/ProductCard/index.cjs +3 -3
  32. package/dist/ProductCard/index.d.cts +1 -1
  33. package/dist/ProductCard/index.d.ts +1 -1
  34. package/dist/ProductCard/index.js +3 -3
  35. package/dist/{ProductCard-Dkkhl9pk.js → ProductCard-C3MjnfZJ.js} +3 -3
  36. package/dist/{ProductCard-CymUvJnC.cjs → ProductCard-FDyIMnZs.cjs} +5 -5
  37. package/dist/ProductGrid/index.cjs +4 -4
  38. package/dist/ProductGrid/index.d.cts +3 -3
  39. package/dist/ProductGrid/index.d.ts +3 -3
  40. package/dist/ProductGrid/index.js +4 -4
  41. package/dist/{ProductGrid-B3Ypqh7j.js → ProductGrid-C9OKsyB2.js} +1 -1
  42. package/dist/{ProductGrid-ZNRujkuN.cjs → ProductGrid-TlntVJ6h.cjs} +1 -1
  43. package/dist/RadioButton/index.cjs +6 -0
  44. package/dist/RadioButton/index.d.cts +30 -0
  45. package/dist/RadioButton/index.d.ts +30 -0
  46. package/dist/RadioButton/index.js +6 -0
  47. package/dist/RadioButton-Bf68dZl7.js +68 -0
  48. package/dist/RadioButton-DZ6QXkrN.cjs +77 -0
  49. package/dist/RadioButtonGroup/index.cjs +8 -0
  50. package/dist/RadioButtonGroup/index.d.cts +36 -0
  51. package/dist/RadioButtonGroup/index.d.ts +36 -0
  52. package/dist/RadioButtonGroup/index.js +7 -0
  53. package/dist/RadioButtonGroup-8k7hkJYB.js +37 -0
  54. package/dist/RadioButtonGroup-Dc_n5amh.cjs +51 -0
  55. package/dist/SearchAutocomplete/index.cjs +1 -1
  56. package/dist/SearchAutocomplete/index.js +1 -1
  57. package/dist/SearchFilter/index.cjs +9 -2
  58. package/dist/SearchFilter/index.d.cts +15 -9
  59. package/dist/SearchFilter/index.d.ts +15 -9
  60. package/dist/SearchFilter/index.js +9 -2
  61. package/dist/SearchFilter-CTVBi5s3.cjs +279 -0
  62. package/dist/SearchFilter-DvqBIXa1.js +258 -0
  63. package/dist/SearchInput/index.cjs +3 -3
  64. package/dist/SearchInput/index.d.cts +1 -1
  65. package/dist/SearchInput/index.d.ts +2 -2
  66. package/dist/SearchInput/index.js +3 -3
  67. package/dist/{SearchInput-BT1rrc4F.js → SearchInput-CVaCPWCE.js} +2 -2
  68. package/dist/{SearchInput-CdR_nsR3.cjs → SearchInput-vJMWoLzS.cjs} +2 -2
  69. package/dist/SearchInputForm/index.cjs +4 -4
  70. package/dist/SearchInputForm/index.d.cts +1 -1
  71. package/dist/SearchInputForm/index.d.ts +1 -1
  72. package/dist/SearchInputForm/index.js +4 -4
  73. package/dist/SearchResultsContent/index.cjs +14 -14
  74. package/dist/SearchResultsContent/index.d.cts +5 -5
  75. package/dist/SearchResultsContent/index.d.ts +5 -5
  76. package/dist/SearchResultsContent/index.js +10 -10
  77. package/dist/SearchResultsFilterSidebar/index.cjs +15 -8
  78. package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
  79. package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
  80. package/dist/SearchResultsFilterSidebar/index.js +13 -6
  81. package/dist/SearchResultsStates/index.cjs +9 -9
  82. package/dist/SearchResultsStates/index.d.cts +6 -6
  83. package/dist/SearchResultsStates/index.d.ts +6 -6
  84. package/dist/SearchResultsStates/index.js +9 -9
  85. package/dist/{SearchResultsStates-ESlrrf20.cjs → SearchResultsStates-CH4agenX.cjs} +5 -5
  86. package/dist/{SearchResultsStates-BxJphoL-.js → SearchResultsStates-iKz64Pd4.js} +5 -5
  87. package/dist/SparkleAnimation/index.cjs +1 -1
  88. package/dist/SparkleAnimation/index.d.cts +2 -2
  89. package/dist/SparkleAnimation/index.d.ts +2 -2
  90. package/dist/SparkleAnimation/index.js +1 -1
  91. package/dist/Spinner/index.cjs +1 -1
  92. package/dist/Spinner/index.d.cts +2 -2
  93. package/dist/Spinner/index.d.ts +2 -2
  94. package/dist/Spinner/index.js +1 -1
  95. package/dist/SuggestionButton/index.cjs +1 -1
  96. package/dist/SuggestionButton/index.d.cts +2 -2
  97. package/dist/SuggestionButton/index.d.ts +2 -2
  98. package/dist/SuggestionButton/index.js +1 -1
  99. package/dist/Text/index.d.cts +2 -2
  100. package/dist/Text/index.d.ts +3 -3
  101. package/dist/TextInput/index.cjs +1 -1
  102. package/dist/TextInput/index.d.ts +1 -1
  103. package/dist/TextInput/index.js +1 -1
  104. package/dist/ToggleButton/index.cjs +6 -0
  105. package/dist/ToggleButton/index.d.cts +30 -0
  106. package/dist/ToggleButton/index.d.ts +30 -0
  107. package/dist/ToggleButton/index.js +6 -0
  108. package/dist/ToggleButton-CK_vkMvt.cjs +68 -0
  109. package/dist/ToggleButton-GIVd2-Z4.js +60 -0
  110. package/dist/{index-DV2K-9lE.d.cts → index-B8l3muO3.d.ts} +5 -5
  111. package/dist/{index-agU5rfIs.d.ts → index-BMt66uqr.d.cts} +5 -5
  112. package/dist/{index-b4yAASuy.d.cts → index-CFH3KUVw.d.cts} +4 -4
  113. package/dist/{index-uU3sIiRx.d.ts → index-H_9LhS_1.d.cts} +2 -2
  114. package/dist/{index-DggZTKvc.d.ts → index-Vck3pox6.d.ts} +4 -4
  115. package/dist/{index-Bpjv4lP2.d.cts → index-h-QwQNnu.d.ts} +2 -2
  116. package/dist/{searchFilterSidebarVariants-BnIcOVWR.js → searchFilterSidebarVariants-CI782ylo.js} +1 -1
  117. package/dist/{searchFilterSidebarVariants-DVZ7wRlb.cjs → searchFilterSidebarVariants-DFfOTqjc.cjs} +1 -1
  118. package/package.json +20 -3
  119. package/src/components/AnimatedChevron/AnimatedChevron.tsx +37 -0
  120. package/src/components/ModalSheet/ModalSheet.tsx +42 -0
  121. package/src/components/ModalSheet/common/closeIcon.tsx +40 -0
  122. package/src/components/ModalSheet/desktop/desktopHeader.tsx +24 -0
  123. package/src/components/ModalSheet/desktop/index.tsx +119 -0
  124. package/src/components/ModalSheet/index.ts +1 -0
  125. package/src/components/ModalSheet/mobile/index.tsx +118 -0
  126. package/src/components/ModalSheet/mobile/mobileHeader.tsx +42 -0
  127. package/src/components/ModalSheet/types.ts +33 -0
  128. package/src/components/ProductCard/ProductCard.tsx +1 -1
  129. package/src/components/RadioButton/RadioButton.tsx +88 -0
  130. package/src/components/RadioButton/index.ts +1 -0
  131. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +72 -0
  132. package/src/components/RadioButtonGroup/index.ts +1 -0
  133. package/src/components/SearchFilter/SearchFilter.tsx +161 -64
  134. package/src/components/SearchFilter/SearchFilterFooter.tsx +55 -0
  135. package/src/components/SearchFilter/types.ts +2 -1
  136. package/src/components/SearchFilter/useHasFilterStateChanged.tsx +40 -0
  137. package/src/components/SearchFilter/utils.ts +15 -0
  138. package/src/components/SearchResultsContent/SearchResultsContent.tsx +1 -1
  139. package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -2
  140. package/src/components/ToggleButton/ToggleButton.tsx +98 -0
  141. package/src/components/ToggleButton/index.ts +1 -0
  142. package/dist/SearchFilter-CLYCSNAa.cjs +0 -137
  143. package/dist/SearchFilter-qQPpx-34.js +0 -117
  144. /package/dist/{ButtonBase-C_uKnl48.js → ButtonBase-0NN6wmX-.js} +0 -0
  145. /package/dist/{ButtonBase-DGbSm0SJ.js → ButtonBase-BAf-nlCm.js} +0 -0
  146. /package/dist/{ButtonBase-DbWQ25n-.cjs → ButtonBase-BIXx56hq.cjs} +0 -0
  147. /package/dist/{ButtonBase-DGpQBeLR.cjs → ButtonBase-Do88ndKa.cjs} +0 -0
  148. /package/dist/{DynamicFiltersScrollbar-Dev5vGsW.js → DynamicFiltersScrollbar-C4kdNSJ9.js} +0 -0
  149. /package/dist/{DynamicFiltersScrollbar-ChvmEiPB.cjs → DynamicFiltersScrollbar-CVw1PINp.cjs} +0 -0
  150. /package/dist/{Headline-DTaT30_m.js → Headline-DNEWF8ly.js} +0 -0
  151. /package/dist/{Headline-DSmu5Mg8.cjs → Headline-DTT4RSv2.cjs} +0 -0
  152. /package/dist/{SearchAutocomplete-C4RY0IoT.js → SearchAutocomplete-BlpII8Xs.js} +0 -0
  153. /package/dist/{SearchAutocomplete-hQDnKtwQ.cjs → SearchAutocomplete-DIEhLT4C.cjs} +0 -0
  154. /package/dist/{SparkleAnimation-fQHP7b-R.js → SparkleAnimation-BLfNojLv.js} +0 -0
  155. /package/dist/{SparkleAnimation-BY5iw7s0.cjs → SparkleAnimation-qi5WCJ9B.cjs} +0 -0
  156. /package/dist/{Spinner-BqTt55uu.js → Spinner-CjGLIRgs.js} +0 -0
  157. /package/dist/{Spinner-DjK8ts9E.cjs → Spinner-DFor2Szi.cjs} +0 -0
  158. /package/dist/{TextInput-BJrdkZsM.cjs → TextInput-B3dTeD3q.cjs} +0 -0
  159. /package/dist/{TextInput-DIjjsSMg.js → TextInput-DoM41M53.js} +0 -0
  160. /package/dist/{colorsConfig-CJTKbJsm.cjs → colorsConfig-D-MZuBvt.cjs} +0 -0
  161. /package/dist/{colorsConfig-CYZ8f_gj.js → colorsConfig-DEfiLHH0.js} +0 -0
  162. /package/dist/{textVariantClasses-ypYGLq0h.d.ts → textVariantClasses-kyZtL8F5.d.ts} +0 -0
@@ -0,0 +1,38 @@
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+
3
+ //#region src/components/ModalSheet/types.d.ts
4
+ type ModalSheetProps = {
5
+ children: React.ReactNode;
6
+ isOpen: boolean;
7
+ closeModal: () => void;
8
+ desktopWidth?: number;
9
+ mobileFullHeight?: number;
10
+ animationDuration?: number;
11
+ headerProps: ModalSheetHeaderProps;
12
+ footerProps?: ModalSheetFooterProps;
13
+ showOverlay?: boolean;
14
+ };
15
+ type ModalSheetHeaderProps = {
16
+ headerVariant?: ModalSheetHeaderVariant;
17
+ headerContent: React.ReactNode;
18
+ handleHeaderClick?: () => void;
19
+ chevronColor: string;
20
+ };
21
+ type ModalSheetFooterProps = {
22
+ footerContent: React.ReactNode;
23
+ footerClassName?: string;
24
+ };
25
+ type ModalSheetHeaderVariant = 'primary';
26
+ //#endregion
27
+ //#region src/components/ModalSheet/ModalSheet.d.ts
28
+ declare const ModalSheet: ({
29
+ children,
30
+ isOpen,
31
+ closeModal,
32
+ animationDuration,
33
+ desktopWidth,
34
+ headerProps,
35
+ footerProps
36
+ }: ModalSheetProps) => react_jsx_runtime8.JSX.Element;
37
+ //#endregion
38
+ export { ModalSheet };
@@ -0,0 +1,3 @@
1
+ import { ModalSheet } from "../ModalSheet-01pxpy_K.js";
2
+
3
+ export { ModalSheet };
@@ -0,0 +1,326 @@
1
+ import { motion, useMotionValue, useTransform } from "framer-motion";
2
+ import { useEffect, useState } from "react";
3
+ import classNames from "classnames";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useIsSmallScreen } from "@envive-ai/react-hooks/hooks/IsSmallScreen";
6
+
7
+ //#region src/components/AnimatedChevron/AnimatedChevron.tsx
8
+ const AnimatedChevron = ({ animationKey, chevronColor }) => {
9
+ const leftRotation = useTransform(animationKey, [300, 0], [-12, 0]);
10
+ const rightRotation = useTransform(animationKey, [300, 0], [12, 0]);
11
+ return /* @__PURE__ */ jsxs("div", {
12
+ style: { display: "flex" },
13
+ children: [/* @__PURE__ */ jsx(motion.div, { style: {
14
+ x: 1,
15
+ width: "25px",
16
+ height: "4px",
17
+ background: chevronColor,
18
+ borderRadius: "8px",
19
+ rotate: leftRotation
20
+ } }), /* @__PURE__ */ jsx(motion.div, { style: {
21
+ x: -1,
22
+ width: "25px",
23
+ height: "4px",
24
+ background: chevronColor,
25
+ borderRadius: "8px",
26
+ rotate: rightRotation
27
+ } })]
28
+ });
29
+ };
30
+
31
+ //#endregion
32
+ //#region src/components/ModalSheet/mobile/mobileHeader.tsx
33
+ const modalSheetVariants$1 = { primary: {
34
+ "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
35
+ "spiffy-tw-text-[--spiffy-colors-text-light]": true
36
+ } };
37
+ const ModalSheetMobileHeader = ({ headerVariant = "primary", headerContent, handleHeaderClick, chevronColor }) => {
38
+ const animationKey = useMotionValue(-1);
39
+ const headerClassName = classNames({
40
+ "spiffy-modal-sheet-header": true,
41
+ "spiffy-tw-flex": true,
42
+ "spiffy-tw-items-center": true,
43
+ "spiffy-tw-justify-between": true,
44
+ "spiffy-tw-w-full": true,
45
+ "spiffy-tw-flex-col": true,
46
+ "spiffy-tw-pt-[16px]": true,
47
+ "spiffy-tw-shadow-[0px_-8px_16px_0px_#0000001A]": true,
48
+ ...modalSheetVariants$1[headerVariant]
49
+ });
50
+ return /* @__PURE__ */ jsxs(motion.div, {
51
+ className: headerClassName,
52
+ onTouchStart: handleHeaderClick,
53
+ onMouseDown: handleHeaderClick,
54
+ children: [/* @__PURE__ */ jsx(AnimatedChevron, {
55
+ animationKey,
56
+ chevronColor
57
+ }), headerContent]
58
+ });
59
+ };
60
+
61
+ //#endregion
62
+ //#region src/components/ModalSheet/mobile/index.tsx
63
+ const ModalSheetMobile = ({ children, isOpen, closeModal, mobileFullHeight = 180, animationDuration, headerProps, footerProps }) => {
64
+ const [isHidden, setIsHidden] = useState(isOpen ? "block" : "none");
65
+ const [bottom, setBottom] = useState(isOpen ? 0 : 0 - mobileFullHeight);
66
+ const [overlayOpacity, setOverlayOpacity] = useState(isOpen ? 1 : 0);
67
+ useEffect(() => {
68
+ setIsHidden(isOpen ? "block" : "none");
69
+ setBottom(isOpen ? 0 : 0 - mobileFullHeight);
70
+ setOverlayOpacity(isOpen ? 1 : 0);
71
+ }, [mobileFullHeight, isOpen]);
72
+ const overlayClassNames = classNames({
73
+ "spiffy-modal-sheet-overlay": true,
74
+ "spiffy-tw-fixed": true,
75
+ "spiffy-tw-inset-0": true,
76
+ "spiffy-tw-top-[0]": true,
77
+ "spiffy-tw-bottom-[0]": true,
78
+ "spiffy-tw-left-[0]": true,
79
+ "spiffy-tw-right-[0]": true,
80
+ "spiffy-tw-bg-black/30": true,
81
+ "spiffy-tw-z-[100]": true
82
+ });
83
+ const modalClassNames = classNames({
84
+ "spiffy-modal-sheet": true,
85
+ "spiffy-modal-sheet-open": isOpen,
86
+ "spiffy-tw-w-full": true,
87
+ "spiffy-tw-overflow-y-auto": true,
88
+ "spiffy-tw-shadow-lg": true,
89
+ "spiffy-tw-fixed": true,
90
+ "spiffy-tw-bg-white": true,
91
+ "spiffy-tw-border-box": true,
92
+ "spiffy-tw-rounded-t-[16px]": true,
93
+ "spiffy-tw-h-[89%]": true,
94
+ "spiffy-tw-max-h-[89%]": true
95
+ });
96
+ const contentClassNames = classNames({
97
+ "spiffy-modal-sheet-content": true,
98
+ "spiffy-tw-flex": true,
99
+ "spiffy-tw-flex-col": true,
100
+ "spiffy-tw-w-full": true,
101
+ "spiffy-tw-h-full": true
102
+ });
103
+ const headerClassNames = classNames({
104
+ "spiffy-tw-sticky": true,
105
+ "spiffy-tw-top-[0px]": true,
106
+ "spiffy-tw-flex": true,
107
+ "spiffy-tw-flex-col": true
108
+ });
109
+ const { footerContent, footerClassName } = footerProps || {};
110
+ const footerClassNames = classNames({
111
+ "spiffy-tw-sticky": true,
112
+ "spiffy-tw-bottom-[0px]": true,
113
+ "spiffy-modal-sheet-footer": true,
114
+ "spiffy-tw-flex": true,
115
+ "spiffy-tw-flex-col": true
116
+ }, footerClassName);
117
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(motion.div, {
118
+ className: overlayClassNames,
119
+ animate: {
120
+ opacity: overlayOpacity,
121
+ display: isHidden
122
+ },
123
+ onClick: closeModal,
124
+ children: /* @__PURE__ */ jsx(motion.div, {
125
+ role: "dialog",
126
+ className: modalClassNames,
127
+ initial: {
128
+ bottom,
129
+ display: isHidden
130
+ },
131
+ animate: {
132
+ bottom,
133
+ display: isHidden
134
+ },
135
+ exit: {
136
+ bottom,
137
+ display: isHidden
138
+ },
139
+ transition: {
140
+ duration: animationDuration,
141
+ ease: "easeIn"
142
+ },
143
+ onClick: (e) => e.stopPropagation(),
144
+ children: /* @__PURE__ */ jsxs("div", {
145
+ className: contentClassNames,
146
+ children: [
147
+ /* @__PURE__ */ jsx("div", {
148
+ className: headerClassNames,
149
+ children: /* @__PURE__ */ jsx(ModalSheetMobileHeader, {
150
+ headerContent: headerProps.headerContent,
151
+ headerVariant: headerProps?.headerVariant,
152
+ handleHeaderClick: closeModal,
153
+ chevronColor: "#000"
154
+ })
155
+ }),
156
+ children,
157
+ /* @__PURE__ */ jsx("div", { className: "spiffy-tw-flex-grow" }),
158
+ footerContent && /* @__PURE__ */ jsx("div", {
159
+ className: footerClassNames,
160
+ children: footerContent
161
+ })
162
+ ]
163
+ })
164
+ })
165
+ }) });
166
+ };
167
+
168
+ //#endregion
169
+ //#region src/components/ModalSheet/desktop/desktopHeader.tsx
170
+ const modalSheetVariants = { primary: {
171
+ "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
172
+ "spiffy-tw-text-[--spiffy-colors-text-light]": true
173
+ } };
174
+ const ModalSheetDesktopHeader = ({ headerVariant = "primary", headerContent }) => {
175
+ const headerStyles = classNames({
176
+ "spiffy-modal-sheet-header": true,
177
+ "spiffy-tw-flex": true,
178
+ "spiffy-tw-items-center": true,
179
+ "spiffy-tw-justify-between": true,
180
+ "spiffy-tw-w-full": true,
181
+ ...modalSheetVariants[headerVariant]
182
+ });
183
+ return /* @__PURE__ */ jsx("div", {
184
+ className: headerStyles,
185
+ children: headerContent
186
+ });
187
+ };
188
+
189
+ //#endregion
190
+ //#region src/components/ModalSheet/desktop/index.tsx
191
+ const ModalSheetDesktop = ({ children, isOpen, closeModal, desktopWidth = 512, animationDuration, headerProps, footerProps, showOverlay = false }) => {
192
+ const [isHidden, setIsHidden] = useState(isOpen ? "block" : "none");
193
+ const [right, setRight] = useState(isOpen ? 0 : 0 - desktopWidth);
194
+ const [overlayOpacity, setOverlayOpacity] = useState(0);
195
+ useEffect(() => {
196
+ setIsHidden(isOpen ? "block" : "none");
197
+ setRight(isOpen ? 0 : 0 - desktopWidth);
198
+ setOverlayOpacity(isOpen ? 1 : 0);
199
+ }, [desktopWidth, isOpen]);
200
+ const overlayClassNames = classNames({
201
+ "spiffy-modal-sheet-overlay": true,
202
+ "spiffy-tw-fixed": true,
203
+ "spiffy-tw-inset-0": true,
204
+ "spiffy-tw-top-[0]": true,
205
+ "spiffy-tw-bottom-[0]": true,
206
+ "spiffy-tw-left-[0]": true,
207
+ "spiffy-tw-right-[0]": true,
208
+ "spiffy-tw-z-[2147483647]": true,
209
+ "spiffy-tw-bg-black/30": showOverlay
210
+ });
211
+ const modalClassNames = classNames({
212
+ "spiffy-modal-sheet": true,
213
+ "spiffy-modal-sheet-open": isOpen,
214
+ "spiffy-tw-max-h-full": true,
215
+ "spiffy-tw-h-screen": true,
216
+ "spiffy-tw-w-[512px]": true,
217
+ "spiffy-tw-shadow-lg": true,
218
+ "spiffy-tw-top-[0]": true,
219
+ "spiffy-tw-bottom-[0]": true,
220
+ "spiffy-tw-fixed": true,
221
+ "spiffy-tw-bg-white": true,
222
+ "spiffy-tw-border-box": true
223
+ });
224
+ const contentClassNames = classNames({
225
+ "spiffy-modal-sheet-content": true,
226
+ "spiffy-tw-overflow-y-auto": true,
227
+ "spiffy-tw-overflow-x-hidden": true,
228
+ "spiffy-tw-flex": true,
229
+ "spiffy-tw-flex-col": true,
230
+ "spiffy-tw-h-full": true,
231
+ "spiffy-tw-w-full": true
232
+ });
233
+ const headerClassNames = classNames({
234
+ "spiffy-tw-sticky": true,
235
+ "spiffy-tw-top-0": true,
236
+ "spiffy-tw-flex": true,
237
+ "spiffy-tw-flex-col": true
238
+ });
239
+ const { footerContent, footerClassName } = footerProps || {};
240
+ const footerClassNames = classNames({
241
+ "spiffy-tw-sticky": true,
242
+ "spiffy-tw-bottom-0": true,
243
+ "spiffy-modal-sheet-footer": true,
244
+ "spiffy-tw-flex": true,
245
+ "spiffy-tw-flex-col": true
246
+ }, footerClassName);
247
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(motion.div, {
248
+ className: overlayClassNames,
249
+ initial: {
250
+ opacity: 0,
251
+ display: "none"
252
+ },
253
+ animate: {
254
+ opacity: overlayOpacity,
255
+ display: isHidden
256
+ },
257
+ onClick: closeModal,
258
+ children: /* @__PURE__ */ jsx(motion.div, {
259
+ role: "dialog",
260
+ className: modalClassNames,
261
+ initial: {
262
+ right,
263
+ display: isHidden
264
+ },
265
+ animate: {
266
+ right,
267
+ display: isHidden
268
+ },
269
+ exit: {
270
+ right,
271
+ display: isHidden
272
+ },
273
+ transition: {
274
+ duration: animationDuration,
275
+ ease: "easeIn"
276
+ },
277
+ style: { width: desktopWidth },
278
+ onClick: (e) => e.stopPropagation(),
279
+ children: /* @__PURE__ */ jsxs("div", {
280
+ className: contentClassNames,
281
+ children: [
282
+ /* @__PURE__ */ jsx("div", {
283
+ className: headerClassNames,
284
+ children: /* @__PURE__ */ jsx(ModalSheetDesktopHeader, {
285
+ headerContent: headerProps.headerContent,
286
+ headerVariant: headerProps?.headerVariant,
287
+ chevronColor: "#000"
288
+ })
289
+ }),
290
+ children,
291
+ /* @__PURE__ */ jsx("div", { className: "spiffy-tw-flex-grow" }),
292
+ footerContent && /* @__PURE__ */ jsx("div", {
293
+ className: footerClassNames,
294
+ children: footerContent
295
+ })
296
+ ]
297
+ })
298
+ })
299
+ }) });
300
+ };
301
+
302
+ //#endregion
303
+ //#region src/components/ModalSheet/ModalSheet.tsx
304
+ const ANIMATION_DURATION = .3;
305
+ const ModalSheet = ({ children, isOpen, closeModal, animationDuration = ANIMATION_DURATION, desktopWidth = 512, headerProps, footerProps }) => {
306
+ return useIsSmallScreen() ? /* @__PURE__ */ jsx(ModalSheetMobile, {
307
+ isOpen,
308
+ closeModal,
309
+ desktopWidth,
310
+ animationDuration,
311
+ headerProps,
312
+ footerProps,
313
+ children
314
+ }) : /* @__PURE__ */ jsx(ModalSheetDesktop, {
315
+ isOpen,
316
+ closeModal,
317
+ desktopWidth,
318
+ animationDuration,
319
+ headerProps,
320
+ footerProps,
321
+ children
322
+ });
323
+ };
324
+
325
+ //#endregion
326
+ export { ModalSheet };
@@ -0,0 +1,337 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ let framer_motion = require("framer-motion");
3
+ framer_motion = require_chunk.__toESM(framer_motion);
4
+ let react = require("react");
5
+ react = require_chunk.__toESM(react);
6
+ let classnames = require("classnames");
7
+ classnames = require_chunk.__toESM(classnames);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
10
+ let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
11
+ __envive_ai_react_hooks_hooks_IsSmallScreen = require_chunk.__toESM(__envive_ai_react_hooks_hooks_IsSmallScreen);
12
+
13
+ //#region src/components/AnimatedChevron/AnimatedChevron.tsx
14
+ const AnimatedChevron = ({ animationKey, chevronColor }) => {
15
+ const leftRotation = (0, framer_motion.useTransform)(animationKey, [300, 0], [-12, 0]);
16
+ const rightRotation = (0, framer_motion.useTransform)(animationKey, [300, 0], [12, 0]);
17
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
18
+ style: { display: "flex" },
19
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, { style: {
20
+ x: 1,
21
+ width: "25px",
22
+ height: "4px",
23
+ background: chevronColor,
24
+ borderRadius: "8px",
25
+ rotate: leftRotation
26
+ } }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, { style: {
27
+ x: -1,
28
+ width: "25px",
29
+ height: "4px",
30
+ background: chevronColor,
31
+ borderRadius: "8px",
32
+ rotate: rightRotation
33
+ } })]
34
+ });
35
+ };
36
+
37
+ //#endregion
38
+ //#region src/components/ModalSheet/mobile/mobileHeader.tsx
39
+ const modalSheetVariants$1 = { primary: {
40
+ "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
41
+ "spiffy-tw-text-[--spiffy-colors-text-light]": true
42
+ } };
43
+ const ModalSheetMobileHeader = ({ headerVariant = "primary", headerContent, handleHeaderClick, chevronColor }) => {
44
+ const animationKey = (0, framer_motion.useMotionValue)(-1);
45
+ const headerClassName = (0, classnames.default)({
46
+ "spiffy-modal-sheet-header": true,
47
+ "spiffy-tw-flex": true,
48
+ "spiffy-tw-items-center": true,
49
+ "spiffy-tw-justify-between": true,
50
+ "spiffy-tw-w-full": true,
51
+ "spiffy-tw-flex-col": true,
52
+ "spiffy-tw-pt-[16px]": true,
53
+ "spiffy-tw-shadow-[0px_-8px_16px_0px_#0000001A]": true,
54
+ ...modalSheetVariants$1[headerVariant]
55
+ });
56
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
57
+ className: headerClassName,
58
+ onTouchStart: handleHeaderClick,
59
+ onMouseDown: handleHeaderClick,
60
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnimatedChevron, {
61
+ animationKey,
62
+ chevronColor
63
+ }), headerContent]
64
+ });
65
+ };
66
+
67
+ //#endregion
68
+ //#region src/components/ModalSheet/mobile/index.tsx
69
+ const ModalSheetMobile = ({ children, isOpen, closeModal, mobileFullHeight = 180, animationDuration, headerProps, footerProps }) => {
70
+ const [isHidden, setIsHidden] = (0, react.useState)(isOpen ? "block" : "none");
71
+ const [bottom, setBottom] = (0, react.useState)(isOpen ? 0 : 0 - mobileFullHeight);
72
+ const [overlayOpacity, setOverlayOpacity] = (0, react.useState)(isOpen ? 1 : 0);
73
+ (0, react.useEffect)(() => {
74
+ setIsHidden(isOpen ? "block" : "none");
75
+ setBottom(isOpen ? 0 : 0 - mobileFullHeight);
76
+ setOverlayOpacity(isOpen ? 1 : 0);
77
+ }, [mobileFullHeight, isOpen]);
78
+ const overlayClassNames = (0, classnames.default)({
79
+ "spiffy-modal-sheet-overlay": true,
80
+ "spiffy-tw-fixed": true,
81
+ "spiffy-tw-inset-0": true,
82
+ "spiffy-tw-top-[0]": true,
83
+ "spiffy-tw-bottom-[0]": true,
84
+ "spiffy-tw-left-[0]": true,
85
+ "spiffy-tw-right-[0]": true,
86
+ "spiffy-tw-bg-black/30": true,
87
+ "spiffy-tw-z-[100]": true
88
+ });
89
+ const modalClassNames = (0, classnames.default)({
90
+ "spiffy-modal-sheet": true,
91
+ "spiffy-modal-sheet-open": isOpen,
92
+ "spiffy-tw-w-full": true,
93
+ "spiffy-tw-overflow-y-auto": true,
94
+ "spiffy-tw-shadow-lg": true,
95
+ "spiffy-tw-fixed": true,
96
+ "spiffy-tw-bg-white": true,
97
+ "spiffy-tw-border-box": true,
98
+ "spiffy-tw-rounded-t-[16px]": true,
99
+ "spiffy-tw-h-[89%]": true,
100
+ "spiffy-tw-max-h-[89%]": true
101
+ });
102
+ const contentClassNames = (0, classnames.default)({
103
+ "spiffy-modal-sheet-content": true,
104
+ "spiffy-tw-flex": true,
105
+ "spiffy-tw-flex-col": true,
106
+ "spiffy-tw-w-full": true,
107
+ "spiffy-tw-h-full": true
108
+ });
109
+ const headerClassNames = (0, classnames.default)({
110
+ "spiffy-tw-sticky": true,
111
+ "spiffy-tw-top-[0px]": true,
112
+ "spiffy-tw-flex": true,
113
+ "spiffy-tw-flex-col": true
114
+ });
115
+ const { footerContent, footerClassName } = footerProps || {};
116
+ const footerClassNames = (0, classnames.default)({
117
+ "spiffy-tw-sticky": true,
118
+ "spiffy-tw-bottom-[0px]": true,
119
+ "spiffy-modal-sheet-footer": true,
120
+ "spiffy-tw-flex": true,
121
+ "spiffy-tw-flex-col": true
122
+ }, footerClassName);
123
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
124
+ className: overlayClassNames,
125
+ animate: {
126
+ opacity: overlayOpacity,
127
+ display: isHidden
128
+ },
129
+ onClick: closeModal,
130
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
131
+ role: "dialog",
132
+ className: modalClassNames,
133
+ initial: {
134
+ bottom,
135
+ display: isHidden
136
+ },
137
+ animate: {
138
+ bottom,
139
+ display: isHidden
140
+ },
141
+ exit: {
142
+ bottom,
143
+ display: isHidden
144
+ },
145
+ transition: {
146
+ duration: animationDuration,
147
+ ease: "easeIn"
148
+ },
149
+ onClick: (e) => e.stopPropagation(),
150
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
151
+ className: contentClassNames,
152
+ children: [
153
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
154
+ className: headerClassNames,
155
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetMobileHeader, {
156
+ headerContent: headerProps.headerContent,
157
+ headerVariant: headerProps?.headerVariant,
158
+ handleHeaderClick: closeModal,
159
+ chevronColor: "#000"
160
+ })
161
+ }),
162
+ children,
163
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "spiffy-tw-flex-grow" }),
164
+ footerContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
165
+ className: footerClassNames,
166
+ children: footerContent
167
+ })
168
+ ]
169
+ })
170
+ })
171
+ }) });
172
+ };
173
+
174
+ //#endregion
175
+ //#region src/components/ModalSheet/desktop/desktopHeader.tsx
176
+ const modalSheetVariants = { primary: {
177
+ "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
178
+ "spiffy-tw-text-[--spiffy-colors-text-light]": true
179
+ } };
180
+ const ModalSheetDesktopHeader = ({ headerVariant = "primary", headerContent }) => {
181
+ const headerStyles = (0, classnames.default)({
182
+ "spiffy-modal-sheet-header": true,
183
+ "spiffy-tw-flex": true,
184
+ "spiffy-tw-items-center": true,
185
+ "spiffy-tw-justify-between": true,
186
+ "spiffy-tw-w-full": true,
187
+ ...modalSheetVariants[headerVariant]
188
+ });
189
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
190
+ className: headerStyles,
191
+ children: headerContent
192
+ });
193
+ };
194
+
195
+ //#endregion
196
+ //#region src/components/ModalSheet/desktop/index.tsx
197
+ const ModalSheetDesktop = ({ children, isOpen, closeModal, desktopWidth = 512, animationDuration, headerProps, footerProps, showOverlay = false }) => {
198
+ const [isHidden, setIsHidden] = (0, react.useState)(isOpen ? "block" : "none");
199
+ const [right, setRight] = (0, react.useState)(isOpen ? 0 : 0 - desktopWidth);
200
+ const [overlayOpacity, setOverlayOpacity] = (0, react.useState)(0);
201
+ (0, react.useEffect)(() => {
202
+ setIsHidden(isOpen ? "block" : "none");
203
+ setRight(isOpen ? 0 : 0 - desktopWidth);
204
+ setOverlayOpacity(isOpen ? 1 : 0);
205
+ }, [desktopWidth, isOpen]);
206
+ const overlayClassNames = (0, classnames.default)({
207
+ "spiffy-modal-sheet-overlay": true,
208
+ "spiffy-tw-fixed": true,
209
+ "spiffy-tw-inset-0": true,
210
+ "spiffy-tw-top-[0]": true,
211
+ "spiffy-tw-bottom-[0]": true,
212
+ "spiffy-tw-left-[0]": true,
213
+ "spiffy-tw-right-[0]": true,
214
+ "spiffy-tw-z-[2147483647]": true,
215
+ "spiffy-tw-bg-black/30": showOverlay
216
+ });
217
+ const modalClassNames = (0, classnames.default)({
218
+ "spiffy-modal-sheet": true,
219
+ "spiffy-modal-sheet-open": isOpen,
220
+ "spiffy-tw-max-h-full": true,
221
+ "spiffy-tw-h-screen": true,
222
+ "spiffy-tw-w-[512px]": true,
223
+ "spiffy-tw-shadow-lg": true,
224
+ "spiffy-tw-top-[0]": true,
225
+ "spiffy-tw-bottom-[0]": true,
226
+ "spiffy-tw-fixed": true,
227
+ "spiffy-tw-bg-white": true,
228
+ "spiffy-tw-border-box": true
229
+ });
230
+ const contentClassNames = (0, classnames.default)({
231
+ "spiffy-modal-sheet-content": true,
232
+ "spiffy-tw-overflow-y-auto": true,
233
+ "spiffy-tw-overflow-x-hidden": true,
234
+ "spiffy-tw-flex": true,
235
+ "spiffy-tw-flex-col": true,
236
+ "spiffy-tw-h-full": true,
237
+ "spiffy-tw-w-full": true
238
+ });
239
+ const headerClassNames = (0, classnames.default)({
240
+ "spiffy-tw-sticky": true,
241
+ "spiffy-tw-top-0": true,
242
+ "spiffy-tw-flex": true,
243
+ "spiffy-tw-flex-col": true
244
+ });
245
+ const { footerContent, footerClassName } = footerProps || {};
246
+ const footerClassNames = (0, classnames.default)({
247
+ "spiffy-tw-sticky": true,
248
+ "spiffy-tw-bottom-0": true,
249
+ "spiffy-modal-sheet-footer": true,
250
+ "spiffy-tw-flex": true,
251
+ "spiffy-tw-flex-col": true
252
+ }, footerClassName);
253
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
254
+ className: overlayClassNames,
255
+ initial: {
256
+ opacity: 0,
257
+ display: "none"
258
+ },
259
+ animate: {
260
+ opacity: overlayOpacity,
261
+ display: isHidden
262
+ },
263
+ onClick: closeModal,
264
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
265
+ role: "dialog",
266
+ className: modalClassNames,
267
+ initial: {
268
+ right,
269
+ display: isHidden
270
+ },
271
+ animate: {
272
+ right,
273
+ display: isHidden
274
+ },
275
+ exit: {
276
+ right,
277
+ display: isHidden
278
+ },
279
+ transition: {
280
+ duration: animationDuration,
281
+ ease: "easeIn"
282
+ },
283
+ style: { width: desktopWidth },
284
+ onClick: (e) => e.stopPropagation(),
285
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
286
+ className: contentClassNames,
287
+ children: [
288
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
289
+ className: headerClassNames,
290
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetDesktopHeader, {
291
+ headerContent: headerProps.headerContent,
292
+ headerVariant: headerProps?.headerVariant,
293
+ chevronColor: "#000"
294
+ })
295
+ }),
296
+ children,
297
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "spiffy-tw-flex-grow" }),
298
+ footerContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
299
+ className: footerClassNames,
300
+ children: footerContent
301
+ })
302
+ ]
303
+ })
304
+ })
305
+ }) });
306
+ };
307
+
308
+ //#endregion
309
+ //#region src/components/ModalSheet/ModalSheet.tsx
310
+ const ANIMATION_DURATION = .3;
311
+ const ModalSheet = ({ children, isOpen, closeModal, animationDuration = ANIMATION_DURATION, desktopWidth = 512, headerProps, footerProps }) => {
312
+ return (0, __envive_ai_react_hooks_hooks_IsSmallScreen.useIsSmallScreen)() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetMobile, {
313
+ isOpen,
314
+ closeModal,
315
+ desktopWidth,
316
+ animationDuration,
317
+ headerProps,
318
+ footerProps,
319
+ children
320
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetDesktop, {
321
+ isOpen,
322
+ closeModal,
323
+ desktopWidth,
324
+ animationDuration,
325
+ headerProps,
326
+ footerProps,
327
+ children
328
+ });
329
+ };
330
+
331
+ //#endregion
332
+ Object.defineProperty(exports, 'ModalSheet', {
333
+ enumerable: true,
334
+ get: function () {
335
+ return ModalSheet;
336
+ }
337
+ });