@envive-ai/react-toolkit 0.1.13 → 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 (186) hide show
  1. package/package.json +13 -12
  2. package/src/atoms/search/types.ts +1 -5
  3. package/src/components/Accordion/Accordion.tsx +3 -3
  4. package/src/components/AnimatedChevron/index.ts +1 -0
  5. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  6. package/src/components/ButtonBase/ButtonBase.tsx +2 -2
  7. package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  8. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  9. package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  10. package/src/components/ProductCard/ProductCard.tsx +10 -9
  11. package/src/components/RadioButton/RadioButton.tsx +2 -2
  12. package/src/components/SearchFilter/SearchFilterHeader.tsx +3 -3
  13. package/src/components/SearchFilter/SearchFilterItem.tsx +2 -2
  14. package/src/components/SearchFilter/index.ts +4 -2
  15. package/src/components/SearchInput/SearchInput.tsx +1 -1
  16. package/src/components/SearchInput/searchInputVariants.ts +3 -3
  17. package/src/components/SearchInputForm/SearchInputForm.tsx +1 -1
  18. package/src/components/SearchInputForm/index.ts +1 -1
  19. package/src/components/SearchResultsStates/NoSearchResultsFound.tsx +3 -3
  20. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +2 -2
  21. package/src/components/TextInput/TextInput.tsx +4 -3
  22. package/src/components/ToggleButton/ToggleButton.tsx +5 -5
  23. package/src/components/Typography/Typography.spec.tsx +22 -0
  24. package/src/components/Typography/Typography.tsx +73 -0
  25. package/src/components/Typography/index.ts +2 -0
  26. package/src/components/{Text/textVariantClasses.ts → Typography/typographyVariantClasses.ts} +36 -38
  27. package/src/components/Typography/util.ts +19 -0
  28. package/dist/Accordion/index.cjs +0 -6
  29. package/dist/Accordion/index.d.cts +0 -13
  30. package/dist/Accordion/index.d.ts +0 -13
  31. package/dist/Accordion/index.js +0 -6
  32. package/dist/Accordion-D9gO9_y3.cjs +0 -88
  33. package/dist/Accordion-ZEdp99Ph.js +0 -77
  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-0NN6wmX-.js +0 -1
  43. package/dist/ButtonBase-BIXx56hq.cjs +0 -0
  44. package/dist/ButtonBase-DgRupM53.js +0 -60
  45. package/dist/ButtonBase-DrIwVGTR.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-B1j53y2q.cjs +0 -81
  51. package/dist/DynamicFiltersScrollbar-D7WYp6x9.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-COv0Jbn8.js +0 -64
  61. package/dist/Headline-Cp79THVF.cjs +0 -72
  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-Cx-KNi-D.cjs +0 -51
  67. package/dist/ImageWithFallback-DqxjwO3i.js +0 -42
  68. package/dist/ModalSheet/index.cjs +0 -3
  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 -3
  72. package/dist/ModalSheet-01pxpy_K.js +0 -326
  73. package/dist/ModalSheet-Csz8HIxs.cjs +0 -337
  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-CNwmHggx.js +0 -255
  79. package/dist/ProductCard-EmdDy2af.cjs +0 -319
  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-CMoomZLc.cjs +0 -74
  85. package/dist/ProductGrid-nmWSp0qX.js +0 -60
  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-BdKJRzLM.cjs +0 -84
  91. package/dist/RadioButton-S5dALI2f.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-BipNsoHL.js +0 -38
  97. package/dist/RadioButtonGroup-TAJMA1j_.cjs +0 -52
  98. package/dist/SearchAutocomplete/index.cjs +0 -57
  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 -51
  102. package/dist/SearchFilter/index.cjs +0 -15
  103. package/dist/SearchFilter/index.d.cts +0 -77
  104. package/dist/SearchFilter/index.d.ts +0 -77
  105. package/dist/SearchFilter/index.js +0 -13
  106. package/dist/SearchFilter-BcLc0TMq.cjs +0 -289
  107. package/dist/SearchFilter-w-0s2YVu.js +0 -268
  108. package/dist/SearchInput/index.cjs +0 -97
  109. package/dist/SearchInput/index.d.cts +0 -33
  110. package/dist/SearchInput/index.d.ts +0 -33
  111. package/dist/SearchInput/index.js +0 -90
  112. package/dist/SearchInputForm/index.cjs +0 -0
  113. package/dist/SearchInputForm/index.d.cts +0 -2
  114. package/dist/SearchInputForm/index.d.ts +0 -2
  115. package/dist/SearchInputForm/index.js +0 -1
  116. package/dist/SearchResultsContent/index.cjs +0 -47
  117. package/dist/SearchResultsContent/index.d.cts +0 -48
  118. package/dist/SearchResultsContent/index.d.ts +0 -48
  119. package/dist/SearchResultsContent/index.js +0 -44
  120. package/dist/SearchResultsFilterSidebar/index.cjs +0 -61
  121. package/dist/SearchResultsFilterSidebar/index.d.cts +0 -2
  122. package/dist/SearchResultsFilterSidebar/index.d.ts +0 -2
  123. package/dist/SearchResultsFilterSidebar/index.js +0 -56
  124. package/dist/SearchResultsStates/index.cjs +0 -17
  125. package/dist/SearchResultsStates/index.d.cts +0 -69
  126. package/dist/SearchResultsStates/index.d.ts +0 -69
  127. package/dist/SearchResultsStates/index.js +0 -15
  128. package/dist/SearchResultsStates-DlZz14yy.js +0 -110
  129. package/dist/SearchResultsStates-DwcPrsdd.cjs +0 -132
  130. package/dist/SparkleAnimation/index.cjs +0 -4
  131. package/dist/SparkleAnimation/index.d.cts +0 -23
  132. package/dist/SparkleAnimation/index.d.ts +0 -23
  133. package/dist/SparkleAnimation/index.js +0 -3
  134. package/dist/SparkleAnimation-CvGlWUqv.cjs +0 -101
  135. package/dist/SparkleAnimation-paLhSu5E.js +0 -84
  136. package/dist/Spinner/index.cjs +0 -3
  137. package/dist/Spinner/index.d.cts +0 -11
  138. package/dist/Spinner/index.d.ts +0 -11
  139. package/dist/Spinner/index.js +0 -3
  140. package/dist/Spinner-CjGLIRgs.js +0 -38
  141. package/dist/Spinner-DFor2Szi.cjs +0 -46
  142. package/dist/SuggestionButton/index.cjs +0 -188
  143. package/dist/SuggestionButton/index.d.cts +0 -35
  144. package/dist/SuggestionButton/index.d.ts +0 -35
  145. package/dist/SuggestionButton/index.js +0 -180
  146. package/dist/Text/index.cjs +0 -10
  147. package/dist/Text/index.d.cts +0 -42
  148. package/dist/Text/index.d.ts +0 -42
  149. package/dist/Text/index.js +0 -5
  150. package/dist/Text-BLzNhX4H.js +0 -42
  151. package/dist/Text-BMsncrpY.js +0 -10
  152. package/dist/Text-C8t_iEj6.cjs +0 -16
  153. package/dist/Text-DllCE9_D.cjs +0 -50
  154. package/dist/TextInput/index.cjs +0 -4
  155. package/dist/TextInput/index.d.cts +0 -12
  156. package/dist/TextInput/index.d.ts +0 -12
  157. package/dist/TextInput/index.js +0 -4
  158. package/dist/TextInput-DmsOxxPN.js +0 -31
  159. package/dist/TextInput-HMW0hxLI.cjs +0 -40
  160. package/dist/ToggleButton/index.cjs +0 -6
  161. package/dist/ToggleButton/index.d.cts +0 -30
  162. package/dist/ToggleButton/index.d.ts +0 -30
  163. package/dist/ToggleButton/index.js +0 -6
  164. package/dist/ToggleButton-DblAj4Cd.cjs +0 -68
  165. package/dist/ToggleButton-r7Y7Kzzo.js +0 -60
  166. package/dist/chunk-CUT6urMc.cjs +0 -30
  167. package/dist/colorsConfig-B3-SMUSx.cjs +0 -38
  168. package/dist/colorsConfig-DZ-GSPWy.js +0 -26
  169. package/dist/index-BKvXn5sj.d.ts +0 -4
  170. package/dist/index-Br1B7Jta.d.cts +0 -46
  171. package/dist/index-DADHwW6M.d.ts +0 -325
  172. package/dist/index-DDp-fLgm.d.cts +0 -325
  173. package/dist/index-Dh8rcWev.d.ts +0 -46
  174. package/dist/index-W1wCDiw_.d.cts +0 -4
  175. package/dist/searchFilterSidebarVariants-J0FJ8pck.js +0 -34
  176. package/dist/searchFilterSidebarVariants-kkTjYEIF.cjs +0 -39
  177. package/dist/textVariantClasses-B0gNjzl4.d.cts +0 -174
  178. package/dist/textVariantClasses-C8OCWZAw.d.ts +0 -174
  179. package/dist/textVariantClasses-CBre7vXv.cjs +0 -123
  180. package/dist/textVariantClasses-CRrTb43V.js +0 -99
  181. package/src/components/Headline/Headline.tsx +0 -81
  182. package/src/components/Headline/index.ts +0 -1
  183. package/src/components/SearchInputForm/types.ts +0 -1
  184. package/src/components/Text/Text.tsx +0 -58
  185. package/src/components/Text/index.ts +0 -3
  186. package/src/components/Text/types.ts +0 -23
@@ -1,26 +0,0 @@
1
- import * as react_jsx_runtime7 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_runtime7.JSX.Element;
25
- //#endregion
26
- export { ImageWithFallback, ImageWithFallbackProps };
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import * as react_jsx_runtime25 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_runtime25.JSX.Element;
25
- //#endregion
26
- export { ImageWithFallback, ImageWithFallbackProps };
@@ -1,3 +0,0 @@
1
- import { ImageWithFallback } from "../ImageWithFallback-DqxjwO3i.js";
2
-
3
- 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,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,3 +0,0 @@
1
- const require_ModalSheet = require('../ModalSheet-Csz8HIxs.cjs');
2
-
3
- exports.ModalSheet = require_ModalSheet.ModalSheet;
@@ -1,38 +0,0 @@
1
- import * as react_jsx_runtime16 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_runtime16.JSX.Element;
37
- //#endregion
38
- export { ModalSheet };
@@ -1,38 +0,0 @@
1
- import * as react_jsx_runtime23 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_runtime23.JSX.Element;
37
- //#endregion
38
- export { ModalSheet };
@@ -1,3 +0,0 @@
1
- import { ModalSheet } from "../ModalSheet-01pxpy_K.js";
2
-
3
- export { ModalSheet };
@@ -1,326 +0,0 @@
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 };