@envive-ai/react-toolkit 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion/index.cjs +4 -0
- package/dist/Accordion/index.d.cts +13 -0
- package/dist/Accordion/index.d.ts +13 -0
- package/dist/Accordion/index.js +4 -0
- package/dist/Accordion-DxtXK__u.js +77 -0
- package/dist/Accordion-RpyCFs2a.cjs +88 -0
- package/dist/AnimatedChevron/index.cjs +3 -0
- package/dist/AnimatedChevron/index.d.cts +14 -0
- package/dist/AnimatedChevron/index.d.ts +14 -0
- package/dist/AnimatedChevron/index.js +3 -0
- package/dist/AnimatedChevron-Bik7GMSe.js +29 -0
- package/dist/AnimatedChevron-Q96FneFy.cjs +37 -0
- package/dist/AppliedFiltersScrollbar/index.cjs +46 -0
- package/dist/AppliedFiltersScrollbar/index.d.cts +22 -0
- package/dist/AppliedFiltersScrollbar/index.d.ts +22 -0
- package/dist/AppliedFiltersScrollbar/index.js +42 -0
- package/dist/ButtonBase/index.cjs +6 -0
- package/dist/ButtonBase/index.d.cts +42 -0
- package/dist/ButtonBase/index.d.ts +42 -0
- package/dist/ButtonBase/index.js +5 -0
- package/dist/ButtonBase-6wjsZ1tU.js +60 -0
- package/dist/ButtonBase-AU23oGQr.cjs +75 -0
- package/dist/ButtonBase-C_uKnl48.js +1 -0
- package/dist/ButtonBase-DbWQ25n-.cjs +0 -0
- package/dist/DynamicFiltersScrollbar/index.cjs +34 -0
- package/dist/DynamicFiltersScrollbar/index.d.cts +28 -0
- package/dist/DynamicFiltersScrollbar/index.d.ts +28 -0
- package/dist/DynamicFiltersScrollbar/index.js +30 -0
- package/dist/DynamicFiltersScrollbar-50i_InZz.cjs +81 -0
- package/dist/DynamicFiltersScrollbar-AhyHehrB.js +66 -0
- package/dist/FilterScrollbar/index.cjs +5 -0
- package/dist/FilterScrollbar/index.d.cts +47 -0
- package/dist/FilterScrollbar/index.d.ts +47 -0
- package/dist/FilterScrollbar/index.js +4 -0
- package/dist/ImageWithFallback/index.cjs +3 -0
- package/dist/ImageWithFallback/index.d.cts +26 -0
- package/dist/ImageWithFallback/index.d.ts +26 -0
- package/dist/ImageWithFallback/index.js +3 -0
- package/dist/ImageWithFallback-1LqhQK1q.cjs +51 -0
- package/dist/ImageWithFallback-Ckwsmd8P.js +42 -0
- package/dist/ModalSheet/index.cjs +4 -0
- package/dist/ModalSheet/index.d.cts +38 -0
- package/dist/ModalSheet/index.d.ts +38 -0
- package/dist/ModalSheet/index.js +4 -0
- package/dist/ModalSheet-BSj_g9JF.js +302 -0
- package/dist/ModalSheet-CcthFeMD.cjs +313 -0
- package/dist/ProductCard/index.cjs +15 -0
- package/dist/ProductCard/index.d.cts +2 -0
- package/dist/ProductCard/index.d.ts +2 -0
- package/dist/ProductCard/index.js +6 -0
- package/dist/ProductCard-BIlnM2nV.js +254 -0
- package/dist/ProductCard-CByKIsUN.cjs +318 -0
- package/dist/ProductGrid/index.cjs +8 -0
- package/dist/ProductGrid/index.d.cts +33 -0
- package/dist/ProductGrid/index.d.ts +33 -0
- package/dist/ProductGrid/index.js +7 -0
- package/dist/ProductGrid-BeFeluHo.cjs +74 -0
- package/dist/ProductGrid-Cgkb4vNf.js +60 -0
- package/dist/RadioButton/index.cjs +4 -0
- package/dist/RadioButton/index.d.cts +32 -0
- package/dist/RadioButton/index.d.ts +32 -0
- package/dist/RadioButton/index.js +4 -0
- package/dist/RadioButton-C_soBi7w.js +75 -0
- package/dist/RadioButton-DG0PgZbz.cjs +84 -0
- package/dist/RadioButtonGroup/index.cjs +6 -0
- package/dist/RadioButtonGroup/index.d.cts +36 -0
- package/dist/RadioButtonGroup/index.d.ts +36 -0
- package/dist/RadioButtonGroup/index.js +5 -0
- package/dist/RadioButtonGroup-3t2kqSFA.cjs +52 -0
- package/dist/RadioButtonGroup-DMbVgPQH.js +38 -0
- package/dist/SearchAutocomplete/index.cjs +3 -0
- package/dist/SearchAutocomplete/index.d.cts +13 -0
- package/dist/SearchAutocomplete/index.d.ts +13 -0
- package/dist/SearchAutocomplete/index.js +3 -0
- package/dist/SearchAutocomplete-TX8UTczp.cjs +62 -0
- package/dist/SearchAutocomplete-obO19yzL.js +51 -0
- package/dist/SearchFilter/index.cjs +17 -0
- package/dist/SearchFilter/index.d.cts +91 -0
- package/dist/SearchFilter/index.d.ts +91 -0
- package/dist/SearchFilter/index.js +12 -0
- package/dist/SearchFilter-BQW4o3Xf.js +268 -0
- package/dist/SearchFilter-t9or-lnj.cjs +307 -0
- package/dist/SearchInput/index.cjs +8 -0
- package/dist/SearchInput/index.d.cts +34 -0
- package/dist/SearchInput/index.d.ts +34 -0
- package/dist/SearchInput/index.js +7 -0
- package/dist/SearchInput-BaiWd0_O.js +108 -0
- package/dist/SearchInput-CO1poiit.cjs +124 -0
- package/dist/SearchInputForm/index.cjs +40 -0
- package/dist/SearchInputForm/index.d.cts +34 -0
- package/dist/SearchInputForm/index.d.ts +34 -0
- package/dist/SearchInputForm/index.js +38 -0
- package/dist/SearchResultsContent/index.cjs +44 -0
- package/dist/SearchResultsContent/index.d.cts +48 -0
- package/dist/SearchResultsContent/index.d.ts +48 -0
- package/dist/SearchResultsContent/index.js +41 -0
- package/dist/SearchResultsFilterSidebar/index.cjs +59 -0
- package/dist/SearchResultsFilterSidebar/index.d.cts +2 -0
- package/dist/SearchResultsFilterSidebar/index.d.ts +2 -0
- package/dist/SearchResultsFilterSidebar/index.js +55 -0
- package/dist/SearchResultsStates/index.cjs +14 -0
- package/dist/SearchResultsStates/index.d.cts +69 -0
- package/dist/SearchResultsStates/index.d.ts +69 -0
- package/dist/SearchResultsStates/index.js +12 -0
- package/dist/SearchResultsStates-Bv5NyxPn.cjs +132 -0
- package/dist/SearchResultsStates-DUG-117h.js +110 -0
- package/dist/SettingsVariant-BsBbdjV5.cjs +63 -0
- package/dist/SettingsVariant-CUSFlJEu.js +55 -0
- package/dist/SparkleAnimation/index.cjs +4 -0
- package/dist/SparkleAnimation/index.d.cts +23 -0
- package/dist/SparkleAnimation/index.d.ts +23 -0
- package/dist/SparkleAnimation/index.js +3 -0
- package/dist/SparkleAnimation-Bm3fk2FJ.cjs +101 -0
- package/dist/SparkleAnimation-D1QjYho_.js +84 -0
- package/dist/Spinner/index.cjs +3 -0
- package/dist/Spinner/index.d.cts +11 -0
- package/dist/Spinner/index.d.ts +11 -0
- package/dist/Spinner/index.js +3 -0
- package/dist/Spinner-BqTt55uu.js +38 -0
- package/dist/Spinner-DjK8ts9E.cjs +46 -0
- package/dist/SuggestionButton/index.cjs +187 -0
- package/dist/SuggestionButton/index.d.cts +35 -0
- package/dist/SuggestionButton/index.d.ts +35 -0
- package/dist/SuggestionButton/index.js +179 -0
- package/dist/TextInput/index.cjs +4 -0
- package/dist/TextInput/index.d.cts +13 -0
- package/dist/TextInput/index.d.ts +13 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/TextInput-B_4Bu2vf.js +31 -0
- package/dist/TextInput-iAKCKHwT.cjs +40 -0
- package/dist/ToggleButton/index.cjs +4 -0
- package/dist/ToggleButton/index.d.cts +30 -0
- package/dist/ToggleButton/index.d.ts +30 -0
- package/dist/ToggleButton/index.js +4 -0
- package/dist/ToggleButton-Br6MgjiG.js +60 -0
- package/dist/ToggleButton-CJ74eu-N.cjs +68 -0
- package/dist/Typography/index.cjs +6 -0
- package/dist/Typography/index.d.cts +3 -0
- package/dist/Typography/index.d.ts +3 -0
- package/dist/Typography/index.js +3 -0
- package/dist/Typography-CFNWgbM5.cjs +176 -0
- package/dist/Typography-D3vDkBMS.js +150 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/colorsConfig-D-MZuBvt.cjs +38 -0
- package/dist/colorsConfig-DEfiLHH0.js +26 -0
- package/dist/index-B5p2z61Y.d.ts +325 -0
- package/dist/index-BH-QK27q.d.ts +31 -0
- package/dist/index-BMHF0IWd.d.cts +31 -0
- package/dist/index-BcvJf9Sr.d.ts +46 -0
- package/dist/index-DDp-fLgm.d.cts +325 -0
- package/dist/index-Dfe_lkL2.d.cts +46 -0
- package/dist/searchFilterSidebarVariants-BD4SYugF.js +34 -0
- package/dist/searchFilterSidebarVariants-DXabOauB.cjs +39 -0
- package/dist/types-BhGjnuWx.d.cts +4 -0
- package/dist/types-CGRog8XL.d.ts +4 -0
- package/dist/typographyVariantClasses-COmQXqcN.d.ts +119 -0
- package/dist/typographyVariantClasses-DTSltxPN.d.cts +119 -0
- package/package.json +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime20 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_runtime20.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Accordion };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime27 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_runtime27.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Accordion };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Typography } from "./Typography-D3vDkBMS.js";
|
|
2
|
+
import { motion } from "framer-motion";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import ChevronDown from "@envive-ai/react-icons/ChevronDown";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
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(Typography, {
|
|
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 };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_Typography = require('./Typography-CFNWgbM5.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 __envive_ai_react_icons_ChevronDown = require("@envive-ai/react-icons/ChevronDown");
|
|
10
|
+
__envive_ai_react_icons_ChevronDown = require_chunk.__toESM(__envive_ai_react_icons_ChevronDown);
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
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_Typography.Typography, {
|
|
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
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime18 from "react/jsx-runtime";
|
|
2
|
+
import { MotionValue } from "framer-motion";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AnimatedChevron/AnimatedChevron.d.ts
|
|
5
|
+
interface AnimatedChevronProps {
|
|
6
|
+
animationKey: MotionValue;
|
|
7
|
+
chevronColor: string;
|
|
8
|
+
}
|
|
9
|
+
declare const AnimatedChevron: ({
|
|
10
|
+
animationKey,
|
|
11
|
+
chevronColor
|
|
12
|
+
}: AnimatedChevronProps) => react_jsx_runtime18.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AnimatedChevron };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MotionValue } from "framer-motion";
|
|
2
|
+
import * as react_jsx_runtime19 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AnimatedChevron/AnimatedChevron.d.ts
|
|
5
|
+
interface AnimatedChevronProps {
|
|
6
|
+
animationKey: MotionValue;
|
|
7
|
+
chevronColor: string;
|
|
8
|
+
}
|
|
9
|
+
declare const AnimatedChevron: ({
|
|
10
|
+
animationKey,
|
|
11
|
+
chevronColor
|
|
12
|
+
}: AnimatedChevronProps) => react_jsx_runtime19.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AnimatedChevron };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { motion, useTransform } from "framer-motion";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AnimatedChevron/AnimatedChevron.tsx
|
|
5
|
+
const AnimatedChevron = ({ animationKey, chevronColor }) => {
|
|
6
|
+
const leftRotation = useTransform(animationKey, [300, 0], [-12, 0]);
|
|
7
|
+
const rightRotation = useTransform(animationKey, [300, 0], [12, 0]);
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
+
style: { display: "flex" },
|
|
10
|
+
children: [/* @__PURE__ */ jsx(motion.div, { style: {
|
|
11
|
+
x: 1,
|
|
12
|
+
width: "25px",
|
|
13
|
+
height: "4px",
|
|
14
|
+
background: chevronColor,
|
|
15
|
+
borderRadius: "8px",
|
|
16
|
+
rotate: leftRotation
|
|
17
|
+
} }), /* @__PURE__ */ jsx(motion.div, { style: {
|
|
18
|
+
x: -1,
|
|
19
|
+
width: "25px",
|
|
20
|
+
height: "4px",
|
|
21
|
+
background: chevronColor,
|
|
22
|
+
borderRadius: "8px",
|
|
23
|
+
rotate: rightRotation
|
|
24
|
+
} })]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { AnimatedChevron };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
let framer_motion = require("framer-motion");
|
|
3
|
+
framer_motion = require_chunk.__toESM(framer_motion);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
6
|
+
|
|
7
|
+
//#region src/components/AnimatedChevron/AnimatedChevron.tsx
|
|
8
|
+
const AnimatedChevron = ({ animationKey, chevronColor }) => {
|
|
9
|
+
const leftRotation = (0, framer_motion.useTransform)(animationKey, [300, 0], [-12, 0]);
|
|
10
|
+
const rightRotation = (0, framer_motion.useTransform)(animationKey, [300, 0], [12, 0]);
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
12
|
+
style: { display: "flex" },
|
|
13
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, { style: {
|
|
14
|
+
x: 1,
|
|
15
|
+
width: "25px",
|
|
16
|
+
height: "4px",
|
|
17
|
+
background: chevronColor,
|
|
18
|
+
borderRadius: "8px",
|
|
19
|
+
rotate: leftRotation
|
|
20
|
+
} }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.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
|
+
Object.defineProperty(exports, 'AnimatedChevron', {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return AnimatedChevron;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_Typography = require('../Typography-CFNWgbM5.cjs');
|
|
3
|
+
let classnames = require("classnames");
|
|
4
|
+
classnames = require_chunk.__toESM(classnames);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
7
|
+
let react_indiana_drag_scroll = require("react-indiana-drag-scroll");
|
|
8
|
+
react_indiana_drag_scroll = require_chunk.__toESM(react_indiana_drag_scroll);
|
|
9
|
+
|
|
10
|
+
//#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx
|
|
11
|
+
const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter }) => {
|
|
12
|
+
if (selectedFilterOptions.length === 0) return null;
|
|
13
|
+
const filterDefaultWithoutBg = filterDefaultClasses.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, "").trim();
|
|
14
|
+
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);
|
|
15
|
+
const iconColor = "currentColor";
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_indiana_drag_scroll.default, {
|
|
17
|
+
className: filterBarClassNames,
|
|
18
|
+
hideScrollbars: true,
|
|
19
|
+
children: selectedFilterOptions.map((filter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
20
|
+
className: buttonClasses,
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: () => onRemoveFilter(filter),
|
|
23
|
+
"aria-label": `Remove filter: ${filter.displayName}`,
|
|
24
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
25
|
+
className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]",
|
|
26
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
27
|
+
variant: "body3",
|
|
28
|
+
children: filter.displayName
|
|
29
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
width: "10",
|
|
32
|
+
height: "10",
|
|
33
|
+
viewBox: "0 0 10 10",
|
|
34
|
+
fill: "none",
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
36
|
+
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",
|
|
37
|
+
fill: iconColor
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
})
|
|
41
|
+
}, filter.id))
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.AppliedFiltersScrollbar = AppliedFiltersScrollbar;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime21 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_runtime21.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AppliedFiltersScrollbar };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime21 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_runtime21.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AppliedFiltersScrollbar };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Typography } from "../Typography-D3vDkBMS.js";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import ScrollContainer from "react-indiana-drag-scroll";
|
|
5
|
+
|
|
6
|
+
//#region src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx
|
|
7
|
+
const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter }) => {
|
|
8
|
+
if (selectedFilterOptions.length === 0) return null;
|
|
9
|
+
const filterDefaultWithoutBg = filterDefaultClasses.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, "").trim();
|
|
10
|
+
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);
|
|
11
|
+
const iconColor = "currentColor";
|
|
12
|
+
return /* @__PURE__ */ jsx(ScrollContainer, {
|
|
13
|
+
className: filterBarClassNames,
|
|
14
|
+
hideScrollbars: true,
|
|
15
|
+
children: selectedFilterOptions.map((filter) => /* @__PURE__ */ jsx("button", {
|
|
16
|
+
className: buttonClasses,
|
|
17
|
+
type: "button",
|
|
18
|
+
onClick: () => onRemoveFilter(filter),
|
|
19
|
+
"aria-label": `Remove filter: ${filter.displayName}`,
|
|
20
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]",
|
|
22
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
23
|
+
variant: "body3",
|
|
24
|
+
children: filter.displayName
|
|
25
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
width: "10",
|
|
28
|
+
height: "10",
|
|
29
|
+
viewBox: "0 0 10 10",
|
|
30
|
+
fill: "none",
|
|
31
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
32
|
+
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",
|
|
33
|
+
fill: iconColor
|
|
34
|
+
})
|
|
35
|
+
})]
|
|
36
|
+
})
|
|
37
|
+
}, filter.id))
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { AppliedFiltersScrollbar };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
require('../Typography-CFNWgbM5.cjs');
|
|
2
|
+
const require_ButtonBase = require('../ButtonBase-AU23oGQr.cjs');
|
|
3
|
+
require('../ButtonBase-DbWQ25n-.cjs');
|
|
4
|
+
|
|
5
|
+
exports.ButtonBase = require_ButtonBase.ButtonBase;
|
|
6
|
+
exports.ButtonBaseOverrides = require_ButtonBase.ButtonBaseOverrides;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as react_jsx_runtime19 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_runtime19.JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ButtonBase, ButtonBaseOverrides, ButtonBaseProps, ButtonHoverStyles };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, CSSProperties } from "react";
|
|
2
|
+
import * as react_jsx_runtime15 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_runtime15.JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ButtonBase, ButtonBaseOverrides, ButtonBaseProps, ButtonHoverStyles };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Typography } from "./Typography-D3vDkBMS.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(Typography, {
|
|
53
|
+
className: textClassName,
|
|
54
|
+
children: text
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ButtonBase, ButtonBaseOverrides };
|