@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,33 +1,16 @@
1
- // TODO: add the rest of the variants as needed
2
- export const HeadlineVariantMap = {
3
- t1: {
4
- 'spiffy-headline': true,
5
- 'spiffy-headline-1': true,
6
- 'spiffy-tw-text-[32px]': true,
7
- 'spiffy-tw-font-medium': true,
8
- 'spiffy-tw-leading-[124%]': true,
9
- },
10
- t2: {
11
- 'spiffy-headline': true,
12
- 'spiffy-headline-1': true,
13
- 'spiffy-tw-text-[16px]': true,
14
- 'spiffy-tw-font-medium': true,
15
- 'spiffy-tw-leading-[124%]': true,
16
- },
17
- t3: {
18
- 'spiffy-headline': true,
19
- 'spiffy-headline-1': true,
20
- 'spiffy-tw-text-[24px]': true,
21
- 'spiffy-tw-leading-[120%]': true,
22
- },
23
- h1: {
1
+ // Variants that map to a particular dom element.
2
+
3
+ export type ElementTypes = 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'sub';
4
+
5
+ export const TypographyDomVariantMap = {
6
+ ['h1' as const]: {
24
7
  'spiffy-headline': true,
25
8
  'spiffy-headline-1': true,
26
9
  'spiffy-tw-text-[20px]': true,
27
10
  'spiffy-tw-font-normal': true,
28
11
  'spiffy-tw-leading-[120%]': true,
29
12
  },
30
- h2: {
13
+ ['h2' as const]: {
31
14
  'spiffy-headline': true,
32
15
  'spiffy-headline-2': true,
33
16
  'spiffy-tw-text-[16px]': true,
@@ -35,14 +18,14 @@ export const HeadlineVariantMap = {
35
18
  'spiffy-tw-leading-[124%]': true,
36
19
  },
37
20
 
38
- h3: {
21
+ ['h3' as const]: {
39
22
  'spiffy-headline': true,
40
23
  'spiffy-headline-3': true,
41
24
  'spiffy-tw-text-[15px]': true,
42
25
  'spiffy-tw-font-medium': true,
43
26
  'spiffy-tw-leading-[124%]': true,
44
27
  },
45
- h4: {
28
+ ['h4' as const]: {
46
29
  'spiffy-headline': true,
47
30
  'spiffy-headline-4': true,
48
31
  'spiffy-tw-text-[14px]': true,
@@ -51,37 +34,57 @@ export const HeadlineVariantMap = {
51
34
  },
52
35
  };
53
36
 
54
- // TODO: add the rest of the variants as needed
55
- export const TextVariantMap = {
56
- body1: {
37
+ export const TypographyVariantMap = {
38
+ ...TypographyDomVariantMap,
39
+ ['t1' as const]: {
40
+ 'spiffy-headline': true,
41
+ 'spiffy-headline-1': true,
42
+ 'spiffy-tw-text-[32px]': true,
43
+ 'spiffy-tw-font-medium': true,
44
+ 'spiffy-tw-leading-[124%]': true,
45
+ },
46
+ ['t2' as const]: {
47
+ 'spiffy-headline': true,
48
+ 'spiffy-headline-1': true,
49
+ 'spiffy-tw-text-[16px]': true,
50
+ 'spiffy-tw-font-medium': true,
51
+ 'spiffy-tw-leading-[124%]': true,
52
+ },
53
+ ['t3' as const]: {
54
+ 'spiffy-headline': true,
55
+ 'spiffy-headline-1': true,
56
+ 'spiffy-tw-text-[24px]': true,
57
+ 'spiffy-tw-leading-[120%]': true,
58
+ },
59
+ ['body1' as const]: {
57
60
  'spiffy-body-text': true,
58
61
  'spiffy-body-1': true,
59
62
  'spiffy-tw-text-[20px]': true,
60
63
  'spiffy-tw-font-normal': true,
61
64
  'spiffy-tw-line-height-[120%]': true,
62
65
  },
63
- body2: {
66
+ ['body2' as const]: {
64
67
  'spiffy-body-text': true,
65
68
  'spiffy-body-2': true,
66
69
  'spiffy-tw-text-[16px]': true,
67
70
  'spiffy-tw-font-normal': true,
68
71
  'spiffy-tw-line-height-[148%]': true,
69
72
  },
70
- body3: {
73
+ ['body3' as const]: {
71
74
  'spiffy-body-text': true,
72
75
  'spiffy-body-3': true,
73
76
  'spiffy-tw-text-sm': true,
74
77
  'spiffy-tw-font-normal': true,
75
78
  'spiffy-tw-leading-[140%]': true,
76
79
  },
77
- body4: {
80
+ ['body4' as const]: {
78
81
  'spiffy-body-text': true,
79
82
  'spiffy-body-4': true,
80
83
  'spiffy-tw-text-xs': true,
81
84
  'spiffy-tw-font-medium': true,
82
85
  'spiffy-tw-leading-[130%]': true,
83
86
  },
84
- body5: {
87
+ ['body5' as const]: {
85
88
  'spiffy-body-text': true,
86
89
  'spiffy-body-5': true,
87
90
  'spiffy-tw-text-[10px]': true,
@@ -89,11 +92,6 @@ export const TextVariantMap = {
89
92
  },
90
93
  };
91
94
 
92
- export const TextStyleVariantMap = {
93
- ...TextVariantMap,
94
- ...HeadlineVariantMap,
95
- };
96
-
97
95
  export const getVariantPlaceholderClassNames = (classes: Record<string, boolean>) =>
98
96
  Object.keys(classes).reduce(
99
97
  (acc, key) => {
@@ -0,0 +1,19 @@
1
+ import {
2
+ TypographyVariantMap,
3
+ TypographyDomVariantMap,
4
+ ElementTypes,
5
+ } from './typographyVariantClasses';
6
+
7
+ export const getElementTypeFromVariant = (
8
+ variant: keyof typeof TypographyVariantMap,
9
+ isHeadline: boolean,
10
+ ): ElementTypes => {
11
+ if (isHeadline) {
12
+ // if the variant corresponds to a real dom element, then use it as the element type.
13
+ const mappedHeaderElement = TypographyDomVariantMap[variant]
14
+ ? (variant as keyof typeof TypographyDomVariantMap)
15
+ : null;
16
+ return mappedHeaderElement || 'h3'; // defaults to h3
17
+ }
18
+ return 'span'; // default to span for body variants.
19
+ };
@@ -1,6 +0,0 @@
1
- require('../textVariantClasses-CBre7vXv.cjs');
2
- require('../Text-DllCE9_D.cjs');
3
- require('../Text-C8t_iEj6.cjs');
4
- const require_Accordion = require('../Accordion-D9gO9_y3.cjs');
5
-
6
- exports.Accordion = require_Accordion.Accordion;
@@ -1,13 +0,0 @@
1
- import * as react_jsx_runtime25 from "react/jsx-runtime";
2
-
3
- //#region src/components/Accordion/Accordion.d.ts
4
- interface AccordionProps {
5
- title: string;
6
- content: React.ReactNode;
7
- }
8
- declare const Accordion: ({
9
- title,
10
- content
11
- }: AccordionProps) => react_jsx_runtime25.JSX.Element;
12
- //#endregion
13
- export { Accordion };
@@ -1,13 +0,0 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
-
3
- //#region src/components/Accordion/Accordion.d.ts
4
- interface AccordionProps {
5
- title: string;
6
- content: React.ReactNode;
7
- }
8
- declare const Accordion: ({
9
- title,
10
- content
11
- }: AccordionProps) => react_jsx_runtime3.JSX.Element;
12
- //#endregion
13
- export { Accordion };
@@ -1,6 +0,0 @@
1
- import "../textVariantClasses-CRrTb43V.js";
2
- import "../Text-BLzNhX4H.js";
3
- import "../Text-BMsncrpY.js";
4
- import { Accordion } from "../Accordion-ZEdp99Ph.js";
5
-
6
- export { Accordion };
@@ -1,88 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_Text = require('./Text-DllCE9_D.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_icons_ChevronDown = require("@envive-ai/react-icons/ChevronDown");
12
- __envive_ai_react_icons_ChevronDown = require_chunk.__toESM(__envive_ai_react_icons_ChevronDown);
13
-
14
- //#region src/components/Accordion/Accordion.tsx
15
- const ANIMATION_DURATION = .3;
16
- const Accordion = ({ title, content }) => {
17
- const [isOpen, setIsOpen] = (0, react.useState)(false);
18
- const contentRef = (0, react.useRef)(null);
19
- const titleWrapperClasses = (0, classnames.default)({
20
- "spiffy-tw-border-b": true,
21
- "spiffy-tw-border-[--spiffy-colors-border-light]": true,
22
- "spiffy-tw-pb-2": true,
23
- "spiffy-tw-flex": true,
24
- "spiffy-tw-justify-between": true,
25
- "spiffy-tw-items-center": true,
26
- "spiffy-tw-w-full": true,
27
- "spiffy-tw-group": true
28
- });
29
- const titleClasses = (0, classnames.default)({
30
- "spiffy-tw-uppercase": true,
31
- "spiffy-tw-text-[--spiffy-colors-text-primary]": true,
32
- "!spiffy-tw-font-[400]": true,
33
- "group-aria-expanded:!spiffy-tw-font-medium": true
34
- });
35
- const contentClasses = (0, classnames.default)({ "spiffy-tw-overflow-hidden": true });
36
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
37
- "aria-expanded": isOpen,
38
- type: "button",
39
- className: titleWrapperClasses,
40
- onClick: () => setIsOpen(!isOpen),
41
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
42
- variant: "body4",
43
- className: titleClasses,
44
- children: title
45
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
46
- variants: {
47
- open: { rotate: 180 },
48
- closed: { rotate: 360 }
49
- },
50
- animate: isOpen ? "open" : "closed",
51
- transition: {
52
- duration: ANIMATION_DURATION,
53
- ease: "easeOut"
54
- },
55
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_ChevronDown.default, {})
56
- })]
57
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
58
- variants: {
59
- open: {
60
- height: "auto",
61
- marginTop: "24px",
62
- marginBottom: "24px"
63
- },
64
- closed: {
65
- height: "0px",
66
- marginTop: "0px",
67
- marginBottom: "0px"
68
- }
69
- },
70
- className: contentClasses,
71
- initial: { height: 0 },
72
- animate: isOpen ? "open" : "closed",
73
- transition: {
74
- duration: ANIMATION_DURATION,
75
- ease: "easeOut"
76
- },
77
- ref: contentRef,
78
- children: content
79
- })] });
80
- };
81
-
82
- //#endregion
83
- Object.defineProperty(exports, 'Accordion', {
84
- enumerable: true,
85
- get: function () {
86
- return Accordion;
87
- }
88
- });
@@ -1,77 +0,0 @@
1
- import { Text } from "./Text-BLzNhX4H.js";
2
- import { motion } from "framer-motion";
3
- import { useRef, useState } from "react";
4
- import classNames from "classnames";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import ChevronDown from "@envive-ai/react-icons/ChevronDown";
7
-
8
- //#region src/components/Accordion/Accordion.tsx
9
- const ANIMATION_DURATION = .3;
10
- const Accordion = ({ title, content }) => {
11
- const [isOpen, setIsOpen] = useState(false);
12
- const contentRef = useRef(null);
13
- const titleWrapperClasses = classNames({
14
- "spiffy-tw-border-b": true,
15
- "spiffy-tw-border-[--spiffy-colors-border-light]": true,
16
- "spiffy-tw-pb-2": true,
17
- "spiffy-tw-flex": true,
18
- "spiffy-tw-justify-between": true,
19
- "spiffy-tw-items-center": true,
20
- "spiffy-tw-w-full": true,
21
- "spiffy-tw-group": true
22
- });
23
- const titleClasses = classNames({
24
- "spiffy-tw-uppercase": true,
25
- "spiffy-tw-text-[--spiffy-colors-text-primary]": true,
26
- "!spiffy-tw-font-[400]": true,
27
- "group-aria-expanded:!spiffy-tw-font-medium": true
28
- });
29
- const contentClasses = classNames({ "spiffy-tw-overflow-hidden": true });
30
- return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("button", {
31
- "aria-expanded": isOpen,
32
- type: "button",
33
- className: titleWrapperClasses,
34
- onClick: () => setIsOpen(!isOpen),
35
- children: [/* @__PURE__ */ jsx(Text, {
36
- variant: "body4",
37
- className: titleClasses,
38
- children: title
39
- }), /* @__PURE__ */ jsx(motion.div, {
40
- variants: {
41
- open: { rotate: 180 },
42
- closed: { rotate: 360 }
43
- },
44
- animate: isOpen ? "open" : "closed",
45
- transition: {
46
- duration: ANIMATION_DURATION,
47
- ease: "easeOut"
48
- },
49
- children: /* @__PURE__ */ jsx(ChevronDown, {})
50
- })]
51
- }), /* @__PURE__ */ jsx(motion.div, {
52
- variants: {
53
- open: {
54
- height: "auto",
55
- marginTop: "24px",
56
- marginBottom: "24px"
57
- },
58
- closed: {
59
- height: "0px",
60
- marginTop: "0px",
61
- marginBottom: "0px"
62
- }
63
- },
64
- className: contentClasses,
65
- initial: { height: 0 },
66
- animate: isOpen ? "open" : "closed",
67
- transition: {
68
- duration: ANIMATION_DURATION,
69
- ease: "easeOut"
70
- },
71
- ref: contentRef,
72
- children: content
73
- })] });
74
- };
75
-
76
- //#endregion
77
- export { Accordion };
@@ -1,48 +0,0 @@
1
- const require_chunk = require('../chunk-CUT6urMc.cjs');
2
- require('../textVariantClasses-CBre7vXv.cjs');
3
- const require_Text = require('../Text-DllCE9_D.cjs');
4
- require('../Text-C8t_iEj6.cjs');
5
- let classnames = require("classnames");
6
- classnames = require_chunk.__toESM(classnames);
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
9
- let react_indiana_drag_scroll = require("react-indiana-drag-scroll");
10
- react_indiana_drag_scroll = require_chunk.__toESM(react_indiana_drag_scroll);
11
-
12
- //#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx
13
- const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter }) => {
14
- if (selectedFilterOptions.length === 0) return null;
15
- const filterDefaultWithoutBg = filterDefaultClasses.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, "").trim();
16
- const buttonClasses = (0, classnames.default)(" spiffy-tw-flex spiffy-tw-items-center spiffy-tw-rounded-full spiffy-tw-px-[8px] spiffy-tw-py-[4px] spiffy-tw-whitespace-nowrap", filterHoverClasses, filterDefaultWithoutBg, appliedFilterBackgroundClasses);
17
- const iconColor = "currentColor";
18
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_indiana_drag_scroll.default, {
19
- className: filterBarClassNames,
20
- hideScrollbars: true,
21
- children: selectedFilterOptions.map((filter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
22
- className: buttonClasses,
23
- type: "button",
24
- onClick: () => onRemoveFilter(filter),
25
- "aria-label": `Remove filter: ${filter.displayName}`,
26
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
27
- className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]",
28
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
29
- variant: "body3",
30
- children: filter.displayName
31
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
32
- xmlns: "http://www.w3.org/2000/svg",
33
- width: "10",
34
- height: "10",
35
- viewBox: "0 0 10 10",
36
- fill: "none",
37
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
38
- d: "M4.59766 4.29297L8.48535 0.405273L9.19238 1.1123L5.30469 5L9.19238 8.8877L8.48535 9.59473L4.59766 5.70703L0.707031 9.59766L0 8.89062L3.89062 5L0 1.10938L0.707031 0.402344L4.59766 4.29297Z",
39
- fill: iconColor
40
- })
41
- })]
42
- })
43
- }, filter.id))
44
- });
45
- };
46
-
47
- //#endregion
48
- exports.AppliedFiltersScrollbar = AppliedFiltersScrollbar;
@@ -1,22 +0,0 @@
1
- import * as react_jsx_runtime19 from "react/jsx-runtime";
2
- import { SelectedFilterOption } from "@envive-ai/react-hooks/atoms/search";
3
-
4
- //#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.d.ts
5
- interface AppliedFiltersScrollbarProps {
6
- selectedFilterOptions: SelectedFilterOption[];
7
- filterBarClassNames: string;
8
- filterDefaultClasses: string;
9
- filterHoverClasses: string;
10
- appliedFilterBackgroundClasses: string;
11
- onRemoveFilter: (filter: SelectedFilterOption) => void;
12
- }
13
- declare const AppliedFiltersScrollbar: ({
14
- selectedFilterOptions,
15
- filterBarClassNames,
16
- filterDefaultClasses,
17
- filterHoverClasses,
18
- appliedFilterBackgroundClasses,
19
- onRemoveFilter
20
- }: AppliedFiltersScrollbarProps) => react_jsx_runtime19.JSX.Element;
21
- //#endregion
22
- export { AppliedFiltersScrollbar };
@@ -1,22 +0,0 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { SelectedFilterOption } from "@envive-ai/react-hooks/atoms/search";
3
-
4
- //#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.d.ts
5
- interface AppliedFiltersScrollbarProps {
6
- selectedFilterOptions: SelectedFilterOption[];
7
- filterBarClassNames: string;
8
- filterDefaultClasses: string;
9
- filterHoverClasses: string;
10
- appliedFilterBackgroundClasses: string;
11
- onRemoveFilter: (filter: SelectedFilterOption) => void;
12
- }
13
- declare const AppliedFiltersScrollbar: ({
14
- selectedFilterOptions,
15
- filterBarClassNames,
16
- filterDefaultClasses,
17
- filterHoverClasses,
18
- appliedFilterBackgroundClasses,
19
- onRemoveFilter
20
- }: AppliedFiltersScrollbarProps) => react_jsx_runtime0.JSX.Element;
21
- //#endregion
22
- export { AppliedFiltersScrollbar };
@@ -1,44 +0,0 @@
1
- import "../textVariantClasses-CRrTb43V.js";
2
- import { Text } from "../Text-BLzNhX4H.js";
3
- import "../Text-BMsncrpY.js";
4
- import classNames from "classnames";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import ScrollContainer from "react-indiana-drag-scroll";
7
-
8
- //#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx
9
- const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter }) => {
10
- if (selectedFilterOptions.length === 0) return null;
11
- const filterDefaultWithoutBg = filterDefaultClasses.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, "").trim();
12
- const buttonClasses = classNames(" spiffy-tw-flex spiffy-tw-items-center spiffy-tw-rounded-full spiffy-tw-px-[8px] spiffy-tw-py-[4px] spiffy-tw-whitespace-nowrap", filterHoverClasses, filterDefaultWithoutBg, appliedFilterBackgroundClasses);
13
- const iconColor = "currentColor";
14
- return /* @__PURE__ */ jsx(ScrollContainer, {
15
- className: filterBarClassNames,
16
- hideScrollbars: true,
17
- children: selectedFilterOptions.map((filter) => /* @__PURE__ */ jsx("button", {
18
- className: buttonClasses,
19
- type: "button",
20
- onClick: () => onRemoveFilter(filter),
21
- "aria-label": `Remove filter: ${filter.displayName}`,
22
- children: /* @__PURE__ */ jsxs("div", {
23
- className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]",
24
- children: [/* @__PURE__ */ jsx(Text, {
25
- variant: "body3",
26
- children: filter.displayName
27
- }), /* @__PURE__ */ jsx("svg", {
28
- xmlns: "http://www.w3.org/2000/svg",
29
- width: "10",
30
- height: "10",
31
- viewBox: "0 0 10 10",
32
- fill: "none",
33
- children: /* @__PURE__ */ jsx("path", {
34
- d: "M4.59766 4.29297L8.48535 0.405273L9.19238 1.1123L5.30469 5L9.19238 8.8877L8.48535 9.59473L4.59766 5.70703L0.707031 9.59766L0 8.89062L3.89062 5L0 1.10938L0.707031 0.402344L4.59766 4.29297Z",
35
- fill: iconColor
36
- })
37
- })]
38
- })
39
- }, filter.id))
40
- });
41
- };
42
-
43
- //#endregion
44
- export { AppliedFiltersScrollbar };
@@ -1,7 +0,0 @@
1
- require('../textVariantClasses-CBre7vXv.cjs');
2
- require('../Text-DllCE9_D.cjs');
3
- const require_ButtonBase = require('../ButtonBase-DrIwVGTR.cjs');
4
- require('../ButtonBase-BIXx56hq.cjs');
5
-
6
- exports.ButtonBase = require_ButtonBase.ButtonBase;
7
- exports.ButtonBaseOverrides = require_ButtonBase.ButtonBaseOverrides;
@@ -1,42 +0,0 @@
1
- import * as react_jsx_runtime20 from "react/jsx-runtime";
2
- import { TestProps } from "@envive-ai/react-hooks/types";
3
- import { ButtonHTMLAttributes, CSSProperties } from "react";
4
-
5
- //#region src/components/ButtonBase/types.d.ts
6
- interface ButtonHoverStyles extends CSSProperties {
7
- backgroundColor?: string;
8
- color?: string;
9
- }
10
- interface ButtonBaseProps extends TestProps {
11
- type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
12
- isDisabled?: boolean;
13
- dataAttributes?: Record<string, string>;
14
- buttonClass?: string;
15
- text: string;
16
- textClass?: string;
17
- icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
18
- iconClass?: string;
19
- onClick?: () => void;
20
- disablePadding?: boolean;
21
- }
22
- declare enum ButtonBaseOverrides {
23
- BUTTON = "spiffy-button-base-button",
24
- BUTTON_TEXT = "spiffy-button-base-button-text",
25
- BUTTON_ICON = "spiffy-button-base-button-icon",
26
- }
27
- //#endregion
28
- //#region src/components/ButtonBase/ButtonBase.d.ts
29
- declare const ButtonBase: ({
30
- isDisabled,
31
- dataAttributes,
32
- buttonClass,
33
- text,
34
- textClass,
35
- icon,
36
- iconClass,
37
- dataTestId,
38
- onClick,
39
- disablePadding
40
- }: ButtonBaseProps) => react_jsx_runtime20.JSX.Element;
41
- //#endregion
42
- export { ButtonBase, ButtonBaseOverrides, ButtonBaseProps, ButtonHoverStyles };
@@ -1,42 +0,0 @@
1
- import { ButtonHTMLAttributes, CSSProperties } from "react";
2
- import * as react_jsx_runtime19 from "react/jsx-runtime";
3
- import { TestProps } from "@envive-ai/react-hooks/types";
4
-
5
- //#region src/components/ButtonBase/types.d.ts
6
- interface ButtonHoverStyles extends CSSProperties {
7
- backgroundColor?: string;
8
- color?: string;
9
- }
10
- interface ButtonBaseProps extends TestProps {
11
- type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
12
- isDisabled?: boolean;
13
- dataAttributes?: Record<string, string>;
14
- buttonClass?: string;
15
- text: string;
16
- textClass?: string;
17
- icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
18
- iconClass?: string;
19
- onClick?: () => void;
20
- disablePadding?: boolean;
21
- }
22
- declare enum ButtonBaseOverrides {
23
- BUTTON = "spiffy-button-base-button",
24
- BUTTON_TEXT = "spiffy-button-base-button-text",
25
- BUTTON_ICON = "spiffy-button-base-button-icon",
26
- }
27
- //#endregion
28
- //#region src/components/ButtonBase/ButtonBase.d.ts
29
- declare const ButtonBase: ({
30
- isDisabled,
31
- dataAttributes,
32
- buttonClass,
33
- text,
34
- textClass,
35
- icon,
36
- iconClass,
37
- dataTestId,
38
- onClick,
39
- disablePadding
40
- }: ButtonBaseProps) => react_jsx_runtime19.JSX.Element;
41
- //#endregion
42
- export { ButtonBase, ButtonBaseOverrides, ButtonBaseProps, ButtonHoverStyles };
@@ -1,6 +0,0 @@
1
- import "../textVariantClasses-CRrTb43V.js";
2
- import "../Text-BLzNhX4H.js";
3
- import { ButtonBase, ButtonBaseOverrides } from "../ButtonBase-DgRupM53.js";
4
- import "../ButtonBase-0NN6wmX-.js";
5
-
6
- export { ButtonBase, ButtonBaseOverrides };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,60 +0,0 @@
1
- import { Text } from "./Text-BLzNhX4H.js";
2
- import { createElement, useEffect, useRef } from "react";
3
- import classNames from "classnames";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
-
6
- //#region src/components/ButtonBase/types.ts
7
- let ButtonBaseOverrides = /* @__PURE__ */ function(ButtonBaseOverrides$1) {
8
- ButtonBaseOverrides$1["BUTTON"] = "spiffy-button-base-button";
9
- ButtonBaseOverrides$1["BUTTON_TEXT"] = "spiffy-button-base-button-text";
10
- ButtonBaseOverrides$1["BUTTON_ICON"] = "spiffy-button-base-button-icon";
11
- return ButtonBaseOverrides$1;
12
- }({});
13
-
14
- //#endregion
15
- //#region src/components/ButtonBase/ButtonBase.tsx
16
- const ButtonBase = ({ isDisabled = false, dataAttributes, buttonClass, text, textClass, icon, iconClass = "spiffy-tw-w-[21px] spiffy-tw-h-[21px]", dataTestId, onClick, disablePadding = false }) => {
17
- const buttonRef = useRef(null);
18
- const buttonClassName = classNames({
19
- [ButtonBaseOverrides.BUTTON]: true,
20
- "spiffy-tw-flex": true,
21
- "spiffy-tw-min-h-[36px]": true,
22
- "spiffy-tw-cursor-pointer": true,
23
- "spiffy-tw-items-center": true,
24
- "spiffy-tw-gap-2": true,
25
- "spiffy-tw-px-4": !disablePadding,
26
- "spiffy-tw-transition-colors": true,
27
- "spiffy-tw-opacity-40": isDisabled,
28
- "spiffy-tw-cursor-not-allowed": isDisabled,
29
- [`${buttonClass}`]: buttonClass != null
30
- });
31
- const textClassName = classNames({
32
- [ButtonBaseOverrides.BUTTON_TEXT]: true,
33
- "spiffy-tw-whitespace-nowrap": true,
34
- [`${textClass}`]: textClass != null
35
- });
36
- const iconClassName = classNames({
37
- [ButtonBaseOverrides.BUTTON_ICON]: true,
38
- [`${iconClass}`]: iconClass != null
39
- });
40
- useEffect(() => {
41
- if (dataAttributes && buttonRef.current) Object.entries(dataAttributes).forEach(([key, value]) => {
42
- buttonRef.current?.setAttribute(key, value);
43
- });
44
- }, [dataAttributes]);
45
- return /* @__PURE__ */ jsxs("button", {
46
- type: "button",
47
- ref: buttonRef,
48
- className: buttonClassName,
49
- disabled: isDisabled,
50
- "data-testid": dataTestId,
51
- onClick,
52
- children: [icon && createElement(icon, { className: iconClassName }), /* @__PURE__ */ jsx(Text, {
53
- className: textClassName,
54
- children: text
55
- })]
56
- });
57
- };
58
-
59
- //#endregion
60
- export { ButtonBase, ButtonBaseOverrides };