@envive-ai/react-toolkit 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/package.json +10 -13
  2. package/src/components/Accordion/Accordion.tsx +3 -3
  3. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  4. package/src/components/ButtonBase/ButtonBase.tsx +2 -2
  5. package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  6. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  7. package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  8. package/src/components/ProductCard/ProductCard.tsx +10 -9
  9. package/src/components/RadioButton/RadioButton.tsx +2 -2
  10. package/src/components/SearchFilter/SearchFilterHeader.tsx +3 -3
  11. package/src/components/SearchFilter/SearchFilterItem.tsx +2 -2
  12. package/src/components/SearchInput/searchInputVariants.ts +2 -2
  13. package/src/components/SearchResultsStates/NoSearchResultsFound.tsx +3 -3
  14. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +2 -2
  15. package/src/components/TextInput/TextInput.tsx +4 -3
  16. package/src/components/ToggleButton/ToggleButton.tsx +5 -5
  17. package/src/components/Typography/Typography.spec.tsx +22 -0
  18. package/src/components/Typography/Typography.tsx +73 -0
  19. package/src/components/Typography/index.ts +2 -0
  20. package/src/components/{Text/textVariantClasses.ts → Typography/typographyVariantClasses.ts} +36 -38
  21. package/src/components/Typography/util.ts +19 -0
  22. package/dist/Accordion/index.cjs +0 -6
  23. package/dist/Accordion/index.d.cts +0 -13
  24. package/dist/Accordion/index.d.ts +0 -13
  25. package/dist/Accordion/index.js +0 -6
  26. package/dist/Accordion-D9gO9_y3.cjs +0 -88
  27. package/dist/Accordion-ZEdp99Ph.js +0 -77
  28. package/dist/AnimatedChevron/index.cjs +0 -3
  29. package/dist/AnimatedChevron/index.d.cts +0 -11
  30. package/dist/AnimatedChevron/index.d.ts +0 -11
  31. package/dist/AnimatedChevron/index.js +0 -3
  32. package/dist/AnimatedChevron-CwuXgR2r.js +0 -29
  33. package/dist/AnimatedChevron-e_UzWBl0.cjs +0 -37
  34. package/dist/AppliedFiltersScrollbar/index.cjs +0 -48
  35. package/dist/AppliedFiltersScrollbar/index.d.cts +0 -22
  36. package/dist/AppliedFiltersScrollbar/index.d.ts +0 -22
  37. package/dist/AppliedFiltersScrollbar/index.js +0 -44
  38. package/dist/ButtonBase/index.cjs +0 -7
  39. package/dist/ButtonBase/index.d.cts +0 -42
  40. package/dist/ButtonBase/index.d.ts +0 -42
  41. package/dist/ButtonBase/index.js +0 -6
  42. package/dist/ButtonBase-BJ0qXMWD.js +0 -60
  43. package/dist/ButtonBase-BktteD9c.js +0 -1
  44. package/dist/ButtonBase-Cb6Iec6f.cjs +0 -0
  45. package/dist/ButtonBase-VIv-tn7H.cjs +0 -75
  46. package/dist/DynamicFiltersScrollbar/index.cjs +0 -36
  47. package/dist/DynamicFiltersScrollbar/index.d.cts +0 -28
  48. package/dist/DynamicFiltersScrollbar/index.d.ts +0 -28
  49. package/dist/DynamicFiltersScrollbar/index.js +0 -32
  50. package/dist/DynamicFiltersScrollbar-HCYZjI14.cjs +0 -81
  51. package/dist/DynamicFiltersScrollbar-O0ai3cIG.js +0 -66
  52. package/dist/FilterScrollbar/index.cjs +0 -6
  53. package/dist/FilterScrollbar/index.d.cts +0 -47
  54. package/dist/FilterScrollbar/index.d.ts +0 -47
  55. package/dist/FilterScrollbar/index.js +0 -5
  56. package/dist/Headline/index.cjs +0 -4
  57. package/dist/Headline/index.d.cts +0 -21
  58. package/dist/Headline/index.d.ts +0 -21
  59. package/dist/Headline/index.js +0 -4
  60. package/dist/Headline-CKJmd2w4.cjs +0 -72
  61. package/dist/Headline-DtjTB4xS.js +0 -64
  62. package/dist/ImageWithFallback/index.cjs +0 -3
  63. package/dist/ImageWithFallback/index.d.cts +0 -26
  64. package/dist/ImageWithFallback/index.d.ts +0 -26
  65. package/dist/ImageWithFallback/index.js +0 -3
  66. package/dist/ImageWithFallback-CbYsD1_a.js +0 -42
  67. package/dist/ImageWithFallback-Km9h16Vz.cjs +0 -51
  68. package/dist/ModalSheet/index.cjs +0 -4
  69. package/dist/ModalSheet/index.d.cts +0 -38
  70. package/dist/ModalSheet/index.d.ts +0 -38
  71. package/dist/ModalSheet/index.js +0 -4
  72. package/dist/ModalSheet-DwnbbFh7.cjs +0 -313
  73. package/dist/ModalSheet-sMg44OLz.js +0 -302
  74. package/dist/ProductCard/index.cjs +0 -17
  75. package/dist/ProductCard/index.d.cts +0 -2
  76. package/dist/ProductCard/index.d.ts +0 -2
  77. package/dist/ProductCard/index.js +0 -8
  78. package/dist/ProductCard-BDz80MCQ.cjs +0 -319
  79. package/dist/ProductCard-CqhNJShq.js +0 -255
  80. package/dist/ProductGrid/index.cjs +0 -10
  81. package/dist/ProductGrid/index.d.cts +0 -33
  82. package/dist/ProductGrid/index.d.ts +0 -33
  83. package/dist/ProductGrid/index.js +0 -9
  84. package/dist/ProductGrid-8n4XgcMr.js +0 -60
  85. package/dist/ProductGrid-RRcdkY5J.cjs +0 -74
  86. package/dist/RadioButton/index.cjs +0 -6
  87. package/dist/RadioButton/index.d.cts +0 -32
  88. package/dist/RadioButton/index.d.ts +0 -32
  89. package/dist/RadioButton/index.js +0 -6
  90. package/dist/RadioButton-BWnaUI8o.cjs +0 -84
  91. package/dist/RadioButton-CG8_M0hY.js +0 -75
  92. package/dist/RadioButtonGroup/index.cjs +0 -8
  93. package/dist/RadioButtonGroup/index.d.cts +0 -36
  94. package/dist/RadioButtonGroup/index.d.ts +0 -36
  95. package/dist/RadioButtonGroup/index.js +0 -7
  96. package/dist/RadioButtonGroup-B7EuiEP1.js +0 -38
  97. package/dist/RadioButtonGroup-ReQqakpS.cjs +0 -52
  98. package/dist/SearchAutocomplete/index.cjs +0 -3
  99. package/dist/SearchAutocomplete/index.d.cts +0 -13
  100. package/dist/SearchAutocomplete/index.d.ts +0 -13
  101. package/dist/SearchAutocomplete/index.js +0 -3
  102. package/dist/SearchAutocomplete-BMNYZiJL.js +0 -51
  103. package/dist/SearchAutocomplete-BmHdijOv.cjs +0 -62
  104. package/dist/SearchFilter/index.cjs +0 -19
  105. package/dist/SearchFilter/index.d.cts +0 -91
  106. package/dist/SearchFilter/index.d.ts +0 -91
  107. package/dist/SearchFilter/index.js +0 -14
  108. package/dist/SearchFilter-C8mgj84o.js +0 -268
  109. package/dist/SearchFilter-FrdHPM5O.cjs +0 -307
  110. package/dist/SearchInput/index.cjs +0 -7
  111. package/dist/SearchInput/index.d.cts +0 -34
  112. package/dist/SearchInput/index.d.ts +0 -34
  113. package/dist/SearchInput/index.js +0 -6
  114. package/dist/SearchInput--x9NTMTb.cjs +0 -106
  115. package/dist/SearchInput-IBq83nqF.js +0 -89
  116. package/dist/SearchInputForm/index.cjs +0 -39
  117. package/dist/SearchInputForm/index.d.cts +0 -34
  118. package/dist/SearchInputForm/index.d.ts +0 -34
  119. package/dist/SearchInputForm/index.js +0 -37
  120. package/dist/SearchResultsContent/index.cjs +0 -47
  121. package/dist/SearchResultsContent/index.d.cts +0 -48
  122. package/dist/SearchResultsContent/index.d.ts +0 -48
  123. package/dist/SearchResultsContent/index.js +0 -44
  124. package/dist/SearchResultsFilterSidebar/index.cjs +0 -62
  125. package/dist/SearchResultsFilterSidebar/index.d.cts +0 -2
  126. package/dist/SearchResultsFilterSidebar/index.d.ts +0 -2
  127. package/dist/SearchResultsFilterSidebar/index.js +0 -57
  128. package/dist/SearchResultsStates/index.cjs +0 -17
  129. package/dist/SearchResultsStates/index.d.cts +0 -69
  130. package/dist/SearchResultsStates/index.d.ts +0 -69
  131. package/dist/SearchResultsStates/index.js +0 -15
  132. package/dist/SearchResultsStates-D7dM35qq.js +0 -110
  133. package/dist/SearchResultsStates-nlaPbkj3.cjs +0 -132
  134. package/dist/SparkleAnimation/index.cjs +0 -4
  135. package/dist/SparkleAnimation/index.d.cts +0 -23
  136. package/dist/SparkleAnimation/index.d.ts +0 -23
  137. package/dist/SparkleAnimation/index.js +0 -3
  138. package/dist/SparkleAnimation-D1aZE-7A.cjs +0 -101
  139. package/dist/SparkleAnimation-DtWkXmkN.js +0 -84
  140. package/dist/Spinner/index.cjs +0 -3
  141. package/dist/Spinner/index.d.cts +0 -11
  142. package/dist/Spinner/index.d.ts +0 -11
  143. package/dist/Spinner/index.js +0 -3
  144. package/dist/Spinner-bg6jb_ks.js +0 -38
  145. package/dist/Spinner-rcWX566W.cjs +0 -46
  146. package/dist/SuggestionButton/index.cjs +0 -188
  147. package/dist/SuggestionButton/index.d.cts +0 -35
  148. package/dist/SuggestionButton/index.d.ts +0 -35
  149. package/dist/SuggestionButton/index.js +0 -180
  150. package/dist/Text/index.cjs +0 -10
  151. package/dist/Text/index.d.cts +0 -42
  152. package/dist/Text/index.d.ts +0 -42
  153. package/dist/Text/index.js +0 -5
  154. package/dist/Text-BLzNhX4H.js +0 -42
  155. package/dist/Text-BMsncrpY.js +0 -10
  156. package/dist/Text-C8t_iEj6.cjs +0 -16
  157. package/dist/Text-DllCE9_D.cjs +0 -50
  158. package/dist/TextInput/index.cjs +0 -4
  159. package/dist/TextInput/index.d.cts +0 -12
  160. package/dist/TextInput/index.d.ts +0 -12
  161. package/dist/TextInput/index.js +0 -4
  162. package/dist/TextInput-BeHPlVHT.js +0 -31
  163. package/dist/TextInput-CGs4BY1q.cjs +0 -40
  164. package/dist/ToggleButton/index.cjs +0 -6
  165. package/dist/ToggleButton/index.d.cts +0 -30
  166. package/dist/ToggleButton/index.d.ts +0 -30
  167. package/dist/ToggleButton/index.js +0 -6
  168. package/dist/ToggleButton-CRiPqTCb.js +0 -60
  169. package/dist/ToggleButton-DfJZ8POQ.cjs +0 -68
  170. package/dist/chunk-CUT6urMc.cjs +0 -30
  171. package/dist/colorsConfig-Ck2jeqWe.js +0 -26
  172. package/dist/colorsConfig-CqCKftuM.cjs +0 -38
  173. package/dist/index-B9WeFNlO.d.cts +0 -325
  174. package/dist/index-CLGe_Pam.d.cts +0 -46
  175. package/dist/index-CeECGrFM.d.ts +0 -325
  176. package/dist/index-PSzeHU2s.d.ts +0 -46
  177. package/dist/searchFilterSidebarVariants-B05f5SD5.js +0 -34
  178. package/dist/searchFilterSidebarVariants-NQhqq-NT.cjs +0 -39
  179. package/dist/textVariantClasses-B0gNjzl4.d.cts +0 -174
  180. package/dist/textVariantClasses-Bl8SAGwZ.d.ts +0 -174
  181. package/dist/textVariantClasses-CBre7vXv.cjs +0 -123
  182. package/dist/textVariantClasses-CRrTb43V.js +0 -99
  183. package/dist/types-BhGjnuWx.d.cts +0 -4
  184. package/dist/types-CTOdb0G0.d.ts +0 -4
  185. package/src/components/Headline/Headline.tsx +0 -81
  186. package/src/components/Headline/index.ts +0 -1
  187. package/src/components/Text/Text.tsx +0 -58
  188. package/src/components/Text/index.ts +0 -3
  189. package/src/components/Text/types.ts +0 -23
@@ -1,26 +0,0 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
- import React from "react";
3
-
4
- //#region src/components/ImageWithFallback/ImageWithFallback.d.ts
5
- interface ImageWithFallbackProps {
6
- src: string | undefined;
7
- alt: string;
8
- fallbackClassnames?: string;
9
- fallback: React.ReactNode;
10
- dataTestId?: string;
11
- imageClassnames: string;
12
- onLoad?: () => void;
13
- onError?: () => void;
14
- }
15
- declare const ImageWithFallback: ({
16
- src,
17
- alt,
18
- dataTestId,
19
- fallbackClassnames,
20
- fallback,
21
- imageClassnames,
22
- onLoad,
23
- onError
24
- }: ImageWithFallbackProps) => react_jsx_runtime10.JSX.Element;
25
- //#endregion
26
- export { ImageWithFallback, ImageWithFallbackProps };
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
3
-
4
- //#region src/components/ImageWithFallback/ImageWithFallback.d.ts
5
- interface ImageWithFallbackProps {
6
- src: string | undefined;
7
- alt: string;
8
- fallbackClassnames?: string;
9
- fallback: React.ReactNode;
10
- dataTestId?: string;
11
- imageClassnames: string;
12
- onLoad?: () => void;
13
- onError?: () => void;
14
- }
15
- declare const ImageWithFallback: ({
16
- src,
17
- alt,
18
- dataTestId,
19
- fallbackClassnames,
20
- fallback,
21
- imageClassnames,
22
- onLoad,
23
- onError
24
- }: ImageWithFallbackProps) => react_jsx_runtime14.JSX.Element;
25
- //#endregion
26
- export { ImageWithFallback, ImageWithFallbackProps };
@@ -1,3 +0,0 @@
1
- import { ImageWithFallback } from "../ImageWithFallback-CbYsD1_a.js";
2
-
3
- export { ImageWithFallback };
@@ -1,42 +0,0 @@
1
- import React, { useState } from "react";
2
- import classNames from "classnames";
3
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
-
5
- //#region src/components/ImageWithFallback/ImageWithFallback.tsx
6
- const ImageWithFallback = ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError }) => {
7
- const [isLoaded, setIsLoaded] = useState(false);
8
- const [isError, setIsError] = useState(false);
9
- const imageExtraClassnames = classNames(imageClassnames, {
10
- "spiffy-tw-block": isLoaded,
11
- "spiffy-tw-hidden": !isLoaded
12
- });
13
- const fallbackMergedClassNames = classNames({
14
- "spiffy-tw-flex": true,
15
- "spiffy-tw-flex-col": true,
16
- "spiffy-tw-items-center": true
17
- }, fallbackClassnames);
18
- if (isError) return /* @__PURE__ */ jsx("div", {
19
- className: fallbackMergedClassNames,
20
- children: fallback
21
- });
22
- return /* @__PURE__ */ jsxs(Fragment, { children: [!isLoaded && /* @__PURE__ */ jsx("div", {
23
- className: fallbackMergedClassNames,
24
- children: fallback
25
- }), /* @__PURE__ */ jsx("img", {
26
- src,
27
- className: imageExtraClassnames,
28
- "data-testid": dataTestId,
29
- alt,
30
- onLoad: () => {
31
- setIsLoaded(true);
32
- onLoad?.();
33
- },
34
- onError: () => {
35
- setIsError(true);
36
- onError?.();
37
- }
38
- })] });
39
- };
40
-
41
- //#endregion
42
- export { ImageWithFallback };
@@ -1,51 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- let react = require("react");
3
- react = require_chunk.__toESM(react);
4
- let classnames = require("classnames");
5
- classnames = require_chunk.__toESM(classnames);
6
- let react_jsx_runtime = require("react/jsx-runtime");
7
- react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
8
-
9
- //#region src/components/ImageWithFallback/ImageWithFallback.tsx
10
- const ImageWithFallback = ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError }) => {
11
- const [isLoaded, setIsLoaded] = (0, react.useState)(false);
12
- const [isError, setIsError] = (0, react.useState)(false);
13
- const imageExtraClassnames = (0, classnames.default)(imageClassnames, {
14
- "spiffy-tw-block": isLoaded,
15
- "spiffy-tw-hidden": !isLoaded
16
- });
17
- const fallbackMergedClassNames = (0, classnames.default)({
18
- "spiffy-tw-flex": true,
19
- "spiffy-tw-flex-col": true,
20
- "spiffy-tw-items-center": true
21
- }, fallbackClassnames);
22
- if (isError) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
23
- className: fallbackMergedClassNames,
24
- children: fallback
25
- });
26
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [!isLoaded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
27
- className: fallbackMergedClassNames,
28
- children: fallback
29
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
30
- src,
31
- className: imageExtraClassnames,
32
- "data-testid": dataTestId,
33
- alt,
34
- onLoad: () => {
35
- setIsLoaded(true);
36
- onLoad?.();
37
- },
38
- onError: () => {
39
- setIsError(true);
40
- onError?.();
41
- }
42
- })] });
43
- };
44
-
45
- //#endregion
46
- Object.defineProperty(exports, 'ImageWithFallback', {
47
- enumerable: true,
48
- get: function () {
49
- return ImageWithFallback;
50
- }
51
- });
@@ -1,4 +0,0 @@
1
- require('../AnimatedChevron-e_UzWBl0.cjs');
2
- const require_ModalSheet = require('../ModalSheet-DwnbbFh7.cjs');
3
-
4
- exports.ModalSheet = require_ModalSheet.ModalSheet;
@@ -1,38 +0,0 @@
1
- import * as react_jsx_runtime7 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_runtime7.JSX.Element;
37
- //#endregion
38
- export { ModalSheet };
@@ -1,38 +0,0 @@
1
- import * as react_jsx_runtime12 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_runtime12.JSX.Element;
37
- //#endregion
38
- export { ModalSheet };
@@ -1,4 +0,0 @@
1
- import "../AnimatedChevron-CwuXgR2r.js";
2
- import { ModalSheet } from "../ModalSheet-sMg44OLz.js";
3
-
4
- export { ModalSheet };
@@ -1,313 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_AnimatedChevron = require('./AnimatedChevron-e_UzWBl0.cjs');
3
- let framer_motion = require("framer-motion");
4
- framer_motion = require_chunk.__toESM(framer_motion);
5
- let react = require("react");
6
- react = require_chunk.__toESM(react);
7
- let classnames = require("classnames");
8
- classnames = require_chunk.__toESM(classnames);
9
- let react_jsx_runtime = require("react/jsx-runtime");
10
- react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
11
- let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
12
- __envive_ai_react_hooks_hooks_IsSmallScreen = require_chunk.__toESM(__envive_ai_react_hooks_hooks_IsSmallScreen);
13
-
14
- //#region src/components/ModalSheet/mobile/mobileHeader.tsx
15
- const modalSheetVariants$1 = { primary: {
16
- "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
17
- "spiffy-tw-text-[--spiffy-colors-text-light]": true
18
- } };
19
- const ModalSheetMobileHeader = ({ headerVariant = "primary", headerContent, handleHeaderClick, chevronColor }) => {
20
- const animationKey = (0, framer_motion.useMotionValue)(-1);
21
- const headerClassName = (0, classnames.default)({
22
- "spiffy-modal-sheet-header": true,
23
- "spiffy-tw-flex": true,
24
- "spiffy-tw-items-center": true,
25
- "spiffy-tw-justify-between": true,
26
- "spiffy-tw-w-full": true,
27
- "spiffy-tw-flex-col": true,
28
- "spiffy-tw-pt-[16px]": true,
29
- "spiffy-tw-shadow-[0px_-8px_16px_0px_#0000001A]": true,
30
- ...modalSheetVariants$1[headerVariant]
31
- });
32
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
33
- className: headerClassName,
34
- onTouchStart: handleHeaderClick,
35
- onMouseDown: handleHeaderClick,
36
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AnimatedChevron.AnimatedChevron, {
37
- animationKey,
38
- chevronColor
39
- }), headerContent]
40
- });
41
- };
42
-
43
- //#endregion
44
- //#region src/components/ModalSheet/mobile/index.tsx
45
- const ModalSheetMobile = ({ children, isOpen, closeModal, mobileFullHeight = 180, animationDuration, headerProps, footerProps }) => {
46
- const [isHidden, setIsHidden] = (0, react.useState)(isOpen ? "block" : "none");
47
- const [bottom, setBottom] = (0, react.useState)(isOpen ? 0 : 0 - mobileFullHeight);
48
- const [overlayOpacity, setOverlayOpacity] = (0, react.useState)(isOpen ? 1 : 0);
49
- (0, react.useEffect)(() => {
50
- setIsHidden(isOpen ? "block" : "none");
51
- setBottom(isOpen ? 0 : 0 - mobileFullHeight);
52
- setOverlayOpacity(isOpen ? 1 : 0);
53
- }, [mobileFullHeight, isOpen]);
54
- const overlayClassNames = (0, classnames.default)({
55
- "spiffy-modal-sheet-overlay": true,
56
- "spiffy-tw-fixed": true,
57
- "spiffy-tw-inset-0": true,
58
- "spiffy-tw-top-[0]": true,
59
- "spiffy-tw-bottom-[0]": true,
60
- "spiffy-tw-left-[0]": true,
61
- "spiffy-tw-right-[0]": true,
62
- "spiffy-tw-bg-black/30": true,
63
- "spiffy-tw-z-[100]": true
64
- });
65
- const modalClassNames = (0, classnames.default)({
66
- "spiffy-modal-sheet": true,
67
- "spiffy-modal-sheet-open": isOpen,
68
- "spiffy-tw-w-full": true,
69
- "spiffy-tw-overflow-y-auto": true,
70
- "spiffy-tw-shadow-lg": true,
71
- "spiffy-tw-fixed": true,
72
- "spiffy-tw-bg-white": true,
73
- "spiffy-tw-border-box": true,
74
- "spiffy-tw-rounded-t-[16px]": true,
75
- "spiffy-tw-h-[89%]": true,
76
- "spiffy-tw-max-h-[89%]": true
77
- });
78
- const contentClassNames = (0, classnames.default)({
79
- "spiffy-modal-sheet-content": true,
80
- "spiffy-tw-flex": true,
81
- "spiffy-tw-flex-col": true,
82
- "spiffy-tw-w-full": true,
83
- "spiffy-tw-h-full": true
84
- });
85
- const headerClassNames = (0, classnames.default)({
86
- "spiffy-tw-sticky": true,
87
- "spiffy-tw-top-[0px]": true,
88
- "spiffy-tw-flex": true,
89
- "spiffy-tw-flex-col": true
90
- });
91
- const { footerContent, footerClassName } = footerProps || {};
92
- const footerClassNames = (0, classnames.default)({
93
- "spiffy-tw-sticky": true,
94
- "spiffy-tw-bottom-[0px]": true,
95
- "spiffy-modal-sheet-footer": true,
96
- "spiffy-tw-flex": true,
97
- "spiffy-tw-flex-col": true
98
- }, footerClassName);
99
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
100
- className: overlayClassNames,
101
- animate: {
102
- opacity: overlayOpacity,
103
- display: isHidden
104
- },
105
- onClick: closeModal,
106
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
107
- role: "dialog",
108
- className: modalClassNames,
109
- initial: {
110
- bottom,
111
- display: isHidden
112
- },
113
- animate: {
114
- bottom,
115
- display: isHidden
116
- },
117
- exit: {
118
- bottom,
119
- display: isHidden
120
- },
121
- transition: {
122
- duration: animationDuration,
123
- ease: "easeIn"
124
- },
125
- onClick: (e) => e.stopPropagation(),
126
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
127
- className: contentClassNames,
128
- children: [
129
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
130
- className: headerClassNames,
131
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetMobileHeader, {
132
- headerContent: headerProps.headerContent,
133
- headerVariant: headerProps?.headerVariant,
134
- handleHeaderClick: closeModal,
135
- chevronColor: "#000"
136
- })
137
- }),
138
- children,
139
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "spiffy-tw-flex-grow" }),
140
- footerContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
141
- className: footerClassNames,
142
- children: footerContent
143
- })
144
- ]
145
- })
146
- })
147
- }) });
148
- };
149
-
150
- //#endregion
151
- //#region src/components/ModalSheet/desktop/desktopHeader.tsx
152
- const modalSheetVariants = { primary: {
153
- "spiffy-tw-bg-[--spiffy-colors-background-primary]": true,
154
- "spiffy-tw-text-[--spiffy-colors-text-light]": true
155
- } };
156
- const ModalSheetDesktopHeader = ({ headerVariant = "primary", headerContent }) => {
157
- const headerStyles = (0, classnames.default)({
158
- "spiffy-modal-sheet-header": true,
159
- "spiffy-tw-flex": true,
160
- "spiffy-tw-items-center": true,
161
- "spiffy-tw-justify-between": true,
162
- "spiffy-tw-w-full": true,
163
- ...modalSheetVariants[headerVariant]
164
- });
165
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
166
- className: headerStyles,
167
- children: headerContent
168
- });
169
- };
170
-
171
- //#endregion
172
- //#region src/components/ModalSheet/desktop/index.tsx
173
- const ModalSheetDesktop = ({ children, isOpen, closeModal, desktopWidth = 512, animationDuration, headerProps, footerProps, showOverlay = false }) => {
174
- const [isHidden, setIsHidden] = (0, react.useState)(isOpen ? "block" : "none");
175
- const [right, setRight] = (0, react.useState)(isOpen ? 0 : 0 - desktopWidth);
176
- const [overlayOpacity, setOverlayOpacity] = (0, react.useState)(0);
177
- (0, react.useEffect)(() => {
178
- setIsHidden(isOpen ? "block" : "none");
179
- setRight(isOpen ? 0 : 0 - desktopWidth);
180
- setOverlayOpacity(isOpen ? 1 : 0);
181
- }, [desktopWidth, isOpen]);
182
- const overlayClassNames = (0, classnames.default)({
183
- "spiffy-modal-sheet-overlay": true,
184
- "spiffy-tw-fixed": true,
185
- "spiffy-tw-inset-0": true,
186
- "spiffy-tw-top-[0]": true,
187
- "spiffy-tw-bottom-[0]": true,
188
- "spiffy-tw-left-[0]": true,
189
- "spiffy-tw-right-[0]": true,
190
- "spiffy-tw-z-[2147483647]": true,
191
- "spiffy-tw-bg-black/30": showOverlay
192
- });
193
- const modalClassNames = (0, classnames.default)({
194
- "spiffy-modal-sheet": true,
195
- "spiffy-modal-sheet-open": isOpen,
196
- "spiffy-tw-max-h-full": true,
197
- "spiffy-tw-h-screen": true,
198
- "spiffy-tw-w-[512px]": true,
199
- "spiffy-tw-shadow-lg": true,
200
- "spiffy-tw-top-[0]": true,
201
- "spiffy-tw-bottom-[0]": true,
202
- "spiffy-tw-fixed": true,
203
- "spiffy-tw-bg-white": true,
204
- "spiffy-tw-border-box": true
205
- });
206
- const contentClassNames = (0, classnames.default)({
207
- "spiffy-modal-sheet-content": true,
208
- "spiffy-tw-overflow-y-auto": true,
209
- "spiffy-tw-overflow-x-hidden": true,
210
- "spiffy-tw-flex": true,
211
- "spiffy-tw-flex-col": true,
212
- "spiffy-tw-h-full": true,
213
- "spiffy-tw-w-full": true
214
- });
215
- const headerClassNames = (0, classnames.default)({
216
- "spiffy-tw-sticky": true,
217
- "spiffy-tw-top-0": true,
218
- "spiffy-tw-flex": true,
219
- "spiffy-tw-flex-col": true
220
- });
221
- const { footerContent, footerClassName } = footerProps || {};
222
- const footerClassNames = (0, classnames.default)({
223
- "spiffy-tw-sticky": true,
224
- "spiffy-tw-bottom-0": true,
225
- "spiffy-modal-sheet-footer": true,
226
- "spiffy-tw-flex": true,
227
- "spiffy-tw-flex-col": true
228
- }, footerClassName);
229
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
230
- className: overlayClassNames,
231
- initial: {
232
- opacity: 0,
233
- display: "none"
234
- },
235
- animate: {
236
- opacity: overlayOpacity,
237
- display: isHidden
238
- },
239
- onClick: closeModal,
240
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
241
- role: "dialog",
242
- className: modalClassNames,
243
- initial: {
244
- right,
245
- display: isHidden
246
- },
247
- animate: {
248
- right,
249
- display: isHidden
250
- },
251
- exit: {
252
- right,
253
- display: isHidden
254
- },
255
- transition: {
256
- duration: animationDuration,
257
- ease: "easeIn"
258
- },
259
- style: { width: desktopWidth },
260
- onClick: (e) => e.stopPropagation(),
261
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
262
- className: contentClassNames,
263
- children: [
264
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
265
- className: headerClassNames,
266
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetDesktopHeader, {
267
- headerContent: headerProps.headerContent,
268
- headerVariant: headerProps?.headerVariant,
269
- chevronColor: "#000"
270
- })
271
- }),
272
- children,
273
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "spiffy-tw-flex-grow" }),
274
- footerContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
275
- className: footerClassNames,
276
- children: footerContent
277
- })
278
- ]
279
- })
280
- })
281
- }) });
282
- };
283
-
284
- //#endregion
285
- //#region src/components/ModalSheet/ModalSheet.tsx
286
- const ANIMATION_DURATION = .3;
287
- const ModalSheet = ({ children, isOpen, closeModal, animationDuration = ANIMATION_DURATION, desktopWidth = 512, headerProps, footerProps }) => {
288
- return (0, __envive_ai_react_hooks_hooks_IsSmallScreen.useIsSmallScreen)() ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetMobile, {
289
- isOpen,
290
- closeModal,
291
- desktopWidth,
292
- animationDuration,
293
- headerProps,
294
- footerProps,
295
- children
296
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetDesktop, {
297
- isOpen,
298
- closeModal,
299
- desktopWidth,
300
- animationDuration,
301
- headerProps,
302
- footerProps,
303
- children
304
- });
305
- };
306
-
307
- //#endregion
308
- Object.defineProperty(exports, 'ModalSheet', {
309
- enumerable: true,
310
- get: function () {
311
- return ModalSheet;
312
- }
313
- });