@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,38 @@
|
|
|
1
|
+
import classNames from "classnames";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Spinner/Spinner.tsx
|
|
5
|
+
const Spinner = ({ className }) => {
|
|
6
|
+
const svgClassnames = classNames({
|
|
7
|
+
"spiffy-tw-w-4": true,
|
|
8
|
+
"spiffy-tw-h-4": true,
|
|
9
|
+
"spiffy-tw-text-gray-200": true,
|
|
10
|
+
"spiffy-tw-animate-spin": true,
|
|
11
|
+
"spiffy-tw-dark:text-gray-600": true,
|
|
12
|
+
"spiffy-tw-fill-black": true
|
|
13
|
+
}, className);
|
|
14
|
+
const spanClassnames = classNames({ "spiffy-tw-sr-only": true });
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
role: "status",
|
|
17
|
+
children: [/* @__PURE__ */ jsxs("svg", {
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
className: svgClassnames,
|
|
20
|
+
viewBox: "0 0 100 101",
|
|
21
|
+
fill: "none",
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
24
|
+
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
25
|
+
fill: "currentColor"
|
|
26
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
27
|
+
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
28
|
+
fill: "currentFill"
|
|
29
|
+
})]
|
|
30
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: spanClassnames,
|
|
32
|
+
children: "Loading..."
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Spinner };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
let classnames = require("classnames");
|
|
3
|
+
classnames = require_chunk.__toESM(classnames);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
|
|
6
|
+
|
|
7
|
+
//#region src/components/Spinner/Spinner.tsx
|
|
8
|
+
const Spinner = ({ className }) => {
|
|
9
|
+
const svgClassnames = (0, classnames.default)({
|
|
10
|
+
"spiffy-tw-w-4": true,
|
|
11
|
+
"spiffy-tw-h-4": true,
|
|
12
|
+
"spiffy-tw-text-gray-200": true,
|
|
13
|
+
"spiffy-tw-animate-spin": true,
|
|
14
|
+
"spiffy-tw-dark:text-gray-600": true,
|
|
15
|
+
"spiffy-tw-fill-black": true
|
|
16
|
+
}, className);
|
|
17
|
+
const spanClassnames = (0, classnames.default)({ "spiffy-tw-sr-only": true });
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
19
|
+
role: "status",
|
|
20
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
className: svgClassnames,
|
|
23
|
+
viewBox: "0 0 100 101",
|
|
24
|
+
fill: "none",
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
27
|
+
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
28
|
+
fill: "currentColor"
|
|
29
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
30
|
+
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
31
|
+
fill: "currentFill"
|
|
32
|
+
})]
|
|
33
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
34
|
+
className: spanClassnames,
|
|
35
|
+
children: "Loading..."
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
Object.defineProperty(exports, 'Spinner', {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return Spinner;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
require('../Typography-CFNWgbM5.cjs');
|
|
3
|
+
const require_ButtonBase = require('../ButtonBase-AU23oGQr.cjs');
|
|
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
|
+
let __envive_ai_react_icons_OutlinedStar = require("@envive-ai/react-icons/OutlinedStar");
|
|
9
|
+
__envive_ai_react_icons_OutlinedStar = require_chunk.__toESM(__envive_ai_react_icons_OutlinedStar);
|
|
10
|
+
let __envive_ai_react_icons_FourPointStar = require("@envive-ai/react-icons/FourPointStar");
|
|
11
|
+
__envive_ai_react_icons_FourPointStar = require_chunk.__toESM(__envive_ai_react_icons_FourPointStar);
|
|
12
|
+
|
|
13
|
+
//#region src/components/SuggestionButton/SuggestionButton.tsx
|
|
14
|
+
const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
15
|
+
const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
16
|
+
const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
17
|
+
const BORDER_CLASS = "spiffy-tw-border";
|
|
18
|
+
const TEXT_LINK_CLASSES = [
|
|
19
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
20
|
+
"spiffy-tw-fill-[--spiffy-colors-text-link]",
|
|
21
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-link]"
|
|
22
|
+
];
|
|
23
|
+
const TEXT_LIGHT_CLASSES = [
|
|
24
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
25
|
+
"spiffy-tw-fill-[--spiffy-colors-text-light]",
|
|
26
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]"
|
|
27
|
+
];
|
|
28
|
+
const TEXT_PRIMARY_CLASSES = [
|
|
29
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
30
|
+
"spiffy-tw-fill-[--spiffy-colors-text-primary]",
|
|
31
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]"
|
|
32
|
+
];
|
|
33
|
+
const ACCENT_PRIMARY_CLASSES = ["spiffy-tw-fill-[--spiffy-colors-accent-primary]", "spiffy-tw-stroke-[--spiffy-colors-accent-primary]"];
|
|
34
|
+
const DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-dark]", "spiffy-tw-border-[--spiffy-colors-background-dark]"];
|
|
35
|
+
const SECONDARY_DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]", "spiffy-tw-border-[--spiffy-colors-background-secondary-dark]"];
|
|
36
|
+
const variantClassMap = new Map([
|
|
37
|
+
["outlined", ["spiffy-tw-border-[--spiffy-colors-border-outline]", ...TEXT_LINK_CLASSES]],
|
|
38
|
+
["outlinedLight", [
|
|
39
|
+
"spiffy-tw-border-[--spiffy-colors-border-outline]",
|
|
40
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
41
|
+
...TEXT_LINK_CLASSES,
|
|
42
|
+
BORDER_CLASS
|
|
43
|
+
]],
|
|
44
|
+
["primary", [
|
|
45
|
+
"spiffy-tw-bg-[--spiffy-colors-background-primary]",
|
|
46
|
+
"spiffy-tw-border-[--spiffy-colors-background-primary]",
|
|
47
|
+
...TEXT_LIGHT_CLASSES,
|
|
48
|
+
BORDER_CLASS
|
|
49
|
+
]],
|
|
50
|
+
["secondary", [
|
|
51
|
+
"spiffy-tw-bg-[--spiffy-colors-background-secondary]",
|
|
52
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
53
|
+
"spiffy-tw-border-[--spiffy-colors-background-secondary]",
|
|
54
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
55
|
+
BORDER_CLASS
|
|
56
|
+
]],
|
|
57
|
+
["tertiary", [
|
|
58
|
+
"spiffy-tw-bg-[--spiffy-colors-background-tertiary]",
|
|
59
|
+
"spiffy-tw-border-[--spiffy-colors-background-tertiary]",
|
|
60
|
+
...TEXT_LINK_CLASSES,
|
|
61
|
+
BORDER_CLASS
|
|
62
|
+
]],
|
|
63
|
+
["dark", [
|
|
64
|
+
...DARK_BACKGROUND_CLASSES,
|
|
65
|
+
...TEXT_LIGHT_CLASSES,
|
|
66
|
+
BORDER_CLASS
|
|
67
|
+
]],
|
|
68
|
+
["darkPrimary", [
|
|
69
|
+
...DARK_BACKGROUND_CLASSES,
|
|
70
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
71
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
72
|
+
BORDER_CLASS
|
|
73
|
+
]],
|
|
74
|
+
["darkAccent", [
|
|
75
|
+
...DARK_BACKGROUND_CLASSES,
|
|
76
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
77
|
+
"spiffy-tw-fill-[--spiffy-colors-text-accent]",
|
|
78
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-accent]",
|
|
79
|
+
BORDER_CLASS
|
|
80
|
+
]],
|
|
81
|
+
["transparent", [
|
|
82
|
+
"spiffy-tw-bg-transparent",
|
|
83
|
+
"spiffy-tw-border-[--spiffy-colors-background-light]",
|
|
84
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
85
|
+
"spiffy-tw-fill-transparent",
|
|
86
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]",
|
|
87
|
+
BORDER_CLASS
|
|
88
|
+
]],
|
|
89
|
+
["transparentDark", [
|
|
90
|
+
"spiffy-tw-bg-transparent",
|
|
91
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]",
|
|
92
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
93
|
+
"spiffy-tw-fill-transparent",
|
|
94
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]",
|
|
95
|
+
BORDER_CLASS
|
|
96
|
+
]],
|
|
97
|
+
["secondaryDark", [
|
|
98
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
99
|
+
...TEXT_LINK_CLASSES,
|
|
100
|
+
BORDER_CLASS
|
|
101
|
+
]],
|
|
102
|
+
["secondaryAccent", [
|
|
103
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
104
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
105
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
106
|
+
BORDER_CLASS
|
|
107
|
+
]],
|
|
108
|
+
["lightDark", [
|
|
109
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
110
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]",
|
|
111
|
+
...TEXT_PRIMARY_CLASSES,
|
|
112
|
+
BORDER_CLASS
|
|
113
|
+
]]
|
|
114
|
+
]);
|
|
115
|
+
const borderedVariants = [
|
|
116
|
+
"outlined",
|
|
117
|
+
"outlinedLight",
|
|
118
|
+
"primary",
|
|
119
|
+
"secondary",
|
|
120
|
+
"tertiary",
|
|
121
|
+
"dark",
|
|
122
|
+
"darkAccent",
|
|
123
|
+
"darkPrimary",
|
|
124
|
+
"transparent",
|
|
125
|
+
"transparentDark",
|
|
126
|
+
"secondaryDark",
|
|
127
|
+
"secondaryAccent",
|
|
128
|
+
"lightDark"
|
|
129
|
+
];
|
|
130
|
+
const hoverTransform = (variantClass) => variantClass?.map((className) => `hover:${className}`);
|
|
131
|
+
const SuggestionButton = ({ variant, hoverVariant, isDisabled, content, boldText, borderRadius = "lg", isAnswer = false, dataAttributes, dataTestId, onClick }) => {
|
|
132
|
+
const buttonClassName = (0, classnames.default)({
|
|
133
|
+
[SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS]: !isAnswer,
|
|
134
|
+
[SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS]: isAnswer,
|
|
135
|
+
"!spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
136
|
+
"!spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
137
|
+
"!spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
138
|
+
"spiffy-tw-border-[1px]": borderedVariants.includes(variant),
|
|
139
|
+
"spiffy-tw-border-solid": borderedVariants.includes(variant)
|
|
140
|
+
});
|
|
141
|
+
const textClassName = (0, classnames.default)({
|
|
142
|
+
"spiffy-tw-text-[14px]": true,
|
|
143
|
+
"spiffy-tw-leading-[100%]": true,
|
|
144
|
+
"!spiffy-tw-font-bold": boldText
|
|
145
|
+
});
|
|
146
|
+
const iconClass = (0, classnames.default)({
|
|
147
|
+
"spiffy-tw-w-[11px]": true,
|
|
148
|
+
"spiffy-tw-h-[11px]": true,
|
|
149
|
+
"spiffy-tw-stroke-inherit": true,
|
|
150
|
+
"spiffy-tw-fill-inherit": true
|
|
151
|
+
});
|
|
152
|
+
const baseClasses = variantClassMap.get(variant) ?? [];
|
|
153
|
+
const hoverClasses = variantClassMap.get(hoverVariant) ?? [];
|
|
154
|
+
const baseBorderClasses = baseClasses.filter((cls) => cls.includes("border"));
|
|
155
|
+
const baseNonBorderClasses = baseClasses.filter((cls) => !cls.includes("border"));
|
|
156
|
+
const hoverBorderClasses = hoverClasses.filter((cls) => cls.includes("border"));
|
|
157
|
+
const hoverNonBorderClasses = hoverClasses.filter((cls) => !cls.includes("border"));
|
|
158
|
+
const variantClasses = [
|
|
159
|
+
...baseNonBorderClasses,
|
|
160
|
+
...hoverTransform(hoverNonBorderClasses),
|
|
161
|
+
...baseBorderClasses,
|
|
162
|
+
...hoverTransform(hoverBorderClasses)
|
|
163
|
+
];
|
|
164
|
+
const buttonClass = `${buttonClassName} ${variantClasses.join(" ")}`;
|
|
165
|
+
const getIcon = () => {
|
|
166
|
+
if (isAnswer) return void 0;
|
|
167
|
+
if (variant === "transparentDark") return __envive_ai_react_icons_OutlinedStar.default;
|
|
168
|
+
return __envive_ai_react_icons_FourPointStar.default;
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
|
|
171
|
+
text: content,
|
|
172
|
+
dataAttributes,
|
|
173
|
+
dataTestId,
|
|
174
|
+
isDisabled,
|
|
175
|
+
icon: getIcon(),
|
|
176
|
+
iconClass: isAnswer ? void 0 : iconClass,
|
|
177
|
+
textClass: `${SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS} ${textClassName}`,
|
|
178
|
+
buttonClass,
|
|
179
|
+
onClick
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
exports.SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS;
|
|
185
|
+
exports.SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS;
|
|
186
|
+
exports.SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS;
|
|
187
|
+
exports.SuggestionButton = SuggestionButton;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
|
+
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
|
+
|
|
4
|
+
//#region src/components/SuggestionButton/types.d.ts
|
|
5
|
+
type SuggestionButtonVariant = 'outlined' | 'outlinedLight' | 'primary' | 'secondary' | 'tertiary' | 'dark' | 'darkAccent' | 'darkPrimary' | 'secondaryDark' | 'secondaryAccent' | 'transparent' | 'transparentDark' | 'lightDark';
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/SuggestionButton/SuggestionButton.d.ts
|
|
8
|
+
declare const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
9
|
+
declare const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
10
|
+
declare const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
11
|
+
interface SuggestionButtonProps extends TestProps {
|
|
12
|
+
variant: SuggestionButtonVariant;
|
|
13
|
+
hoverVariant: SuggestionButtonVariant;
|
|
14
|
+
isDisabled: boolean;
|
|
15
|
+
content: string;
|
|
16
|
+
boldText?: boolean;
|
|
17
|
+
borderRadius?: 'sm' | 'md' | 'lg';
|
|
18
|
+
isAnswer?: boolean;
|
|
19
|
+
dataAttributes?: Record<string, string>;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const SuggestionButton: ({
|
|
23
|
+
variant,
|
|
24
|
+
hoverVariant,
|
|
25
|
+
isDisabled,
|
|
26
|
+
content,
|
|
27
|
+
boldText,
|
|
28
|
+
borderRadius,
|
|
29
|
+
isAnswer,
|
|
30
|
+
dataAttributes,
|
|
31
|
+
dataTestId,
|
|
32
|
+
onClick
|
|
33
|
+
}: SuggestionButtonProps) => react_jsx_runtime8.JSX.Element;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton, SuggestionButtonVariant };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
|
+
|
|
4
|
+
//#region src/components/SuggestionButton/types.d.ts
|
|
5
|
+
type SuggestionButtonVariant = 'outlined' | 'outlinedLight' | 'primary' | 'secondary' | 'tertiary' | 'dark' | 'darkAccent' | 'darkPrimary' | 'secondaryDark' | 'secondaryAccent' | 'transparent' | 'transparentDark' | 'lightDark';
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/SuggestionButton/SuggestionButton.d.ts
|
|
8
|
+
declare const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
9
|
+
declare const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
10
|
+
declare const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
11
|
+
interface SuggestionButtonProps extends TestProps {
|
|
12
|
+
variant: SuggestionButtonVariant;
|
|
13
|
+
hoverVariant: SuggestionButtonVariant;
|
|
14
|
+
isDisabled: boolean;
|
|
15
|
+
content: string;
|
|
16
|
+
boldText?: boolean;
|
|
17
|
+
borderRadius?: 'sm' | 'md' | 'lg';
|
|
18
|
+
isAnswer?: boolean;
|
|
19
|
+
dataAttributes?: Record<string, string>;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
}
|
|
22
|
+
declare const SuggestionButton: ({
|
|
23
|
+
variant,
|
|
24
|
+
hoverVariant,
|
|
25
|
+
isDisabled,
|
|
26
|
+
content,
|
|
27
|
+
boldText,
|
|
28
|
+
borderRadius,
|
|
29
|
+
isAnswer,
|
|
30
|
+
dataAttributes,
|
|
31
|
+
dataTestId,
|
|
32
|
+
onClick
|
|
33
|
+
}: SuggestionButtonProps) => react_jsx_runtime0.JSX.Element;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton, SuggestionButtonVariant };
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import "../Typography-D3vDkBMS.js";
|
|
2
|
+
import { ButtonBase } from "../ButtonBase-6wjsZ1tU.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import OutlinedStar from "@envive-ai/react-icons/OutlinedStar";
|
|
6
|
+
import FourPointStar from "@envive-ai/react-icons/FourPointStar";
|
|
7
|
+
|
|
8
|
+
//#region src/components/SuggestionButton/SuggestionButton.tsx
|
|
9
|
+
const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
10
|
+
const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
11
|
+
const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
12
|
+
const BORDER_CLASS = "spiffy-tw-border";
|
|
13
|
+
const TEXT_LINK_CLASSES = [
|
|
14
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
15
|
+
"spiffy-tw-fill-[--spiffy-colors-text-link]",
|
|
16
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-link]"
|
|
17
|
+
];
|
|
18
|
+
const TEXT_LIGHT_CLASSES = [
|
|
19
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
20
|
+
"spiffy-tw-fill-[--spiffy-colors-text-light]",
|
|
21
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]"
|
|
22
|
+
];
|
|
23
|
+
const TEXT_PRIMARY_CLASSES = [
|
|
24
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
25
|
+
"spiffy-tw-fill-[--spiffy-colors-text-primary]",
|
|
26
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]"
|
|
27
|
+
];
|
|
28
|
+
const ACCENT_PRIMARY_CLASSES = ["spiffy-tw-fill-[--spiffy-colors-accent-primary]", "spiffy-tw-stroke-[--spiffy-colors-accent-primary]"];
|
|
29
|
+
const DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-dark]", "spiffy-tw-border-[--spiffy-colors-background-dark]"];
|
|
30
|
+
const SECONDARY_DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]", "spiffy-tw-border-[--spiffy-colors-background-secondary-dark]"];
|
|
31
|
+
const variantClassMap = new Map([
|
|
32
|
+
["outlined", ["spiffy-tw-border-[--spiffy-colors-border-outline]", ...TEXT_LINK_CLASSES]],
|
|
33
|
+
["outlinedLight", [
|
|
34
|
+
"spiffy-tw-border-[--spiffy-colors-border-outline]",
|
|
35
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
36
|
+
...TEXT_LINK_CLASSES,
|
|
37
|
+
BORDER_CLASS
|
|
38
|
+
]],
|
|
39
|
+
["primary", [
|
|
40
|
+
"spiffy-tw-bg-[--spiffy-colors-background-primary]",
|
|
41
|
+
"spiffy-tw-border-[--spiffy-colors-background-primary]",
|
|
42
|
+
...TEXT_LIGHT_CLASSES,
|
|
43
|
+
BORDER_CLASS
|
|
44
|
+
]],
|
|
45
|
+
["secondary", [
|
|
46
|
+
"spiffy-tw-bg-[--spiffy-colors-background-secondary]",
|
|
47
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
48
|
+
"spiffy-tw-border-[--spiffy-colors-background-secondary]",
|
|
49
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
50
|
+
BORDER_CLASS
|
|
51
|
+
]],
|
|
52
|
+
["tertiary", [
|
|
53
|
+
"spiffy-tw-bg-[--spiffy-colors-background-tertiary]",
|
|
54
|
+
"spiffy-tw-border-[--spiffy-colors-background-tertiary]",
|
|
55
|
+
...TEXT_LINK_CLASSES,
|
|
56
|
+
BORDER_CLASS
|
|
57
|
+
]],
|
|
58
|
+
["dark", [
|
|
59
|
+
...DARK_BACKGROUND_CLASSES,
|
|
60
|
+
...TEXT_LIGHT_CLASSES,
|
|
61
|
+
BORDER_CLASS
|
|
62
|
+
]],
|
|
63
|
+
["darkPrimary", [
|
|
64
|
+
...DARK_BACKGROUND_CLASSES,
|
|
65
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
66
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
67
|
+
BORDER_CLASS
|
|
68
|
+
]],
|
|
69
|
+
["darkAccent", [
|
|
70
|
+
...DARK_BACKGROUND_CLASSES,
|
|
71
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
72
|
+
"spiffy-tw-fill-[--spiffy-colors-text-accent]",
|
|
73
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-accent]",
|
|
74
|
+
BORDER_CLASS
|
|
75
|
+
]],
|
|
76
|
+
["transparent", [
|
|
77
|
+
"spiffy-tw-bg-transparent",
|
|
78
|
+
"spiffy-tw-border-[--spiffy-colors-background-light]",
|
|
79
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
80
|
+
"spiffy-tw-fill-transparent",
|
|
81
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]",
|
|
82
|
+
BORDER_CLASS
|
|
83
|
+
]],
|
|
84
|
+
["transparentDark", [
|
|
85
|
+
"spiffy-tw-bg-transparent",
|
|
86
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]",
|
|
87
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
88
|
+
"spiffy-tw-fill-transparent",
|
|
89
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]",
|
|
90
|
+
BORDER_CLASS
|
|
91
|
+
]],
|
|
92
|
+
["secondaryDark", [
|
|
93
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
94
|
+
...TEXT_LINK_CLASSES,
|
|
95
|
+
BORDER_CLASS
|
|
96
|
+
]],
|
|
97
|
+
["secondaryAccent", [
|
|
98
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
99
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
100
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
101
|
+
BORDER_CLASS
|
|
102
|
+
]],
|
|
103
|
+
["lightDark", [
|
|
104
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
105
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]",
|
|
106
|
+
...TEXT_PRIMARY_CLASSES,
|
|
107
|
+
BORDER_CLASS
|
|
108
|
+
]]
|
|
109
|
+
]);
|
|
110
|
+
const borderedVariants = [
|
|
111
|
+
"outlined",
|
|
112
|
+
"outlinedLight",
|
|
113
|
+
"primary",
|
|
114
|
+
"secondary",
|
|
115
|
+
"tertiary",
|
|
116
|
+
"dark",
|
|
117
|
+
"darkAccent",
|
|
118
|
+
"darkPrimary",
|
|
119
|
+
"transparent",
|
|
120
|
+
"transparentDark",
|
|
121
|
+
"secondaryDark",
|
|
122
|
+
"secondaryAccent",
|
|
123
|
+
"lightDark"
|
|
124
|
+
];
|
|
125
|
+
const hoverTransform = (variantClass) => variantClass?.map((className) => `hover:${className}`);
|
|
126
|
+
const SuggestionButton = ({ variant, hoverVariant, isDisabled, content, boldText, borderRadius = "lg", isAnswer = false, dataAttributes, dataTestId, onClick }) => {
|
|
127
|
+
const buttonClassName = classNames({
|
|
128
|
+
[SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS]: !isAnswer,
|
|
129
|
+
[SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS]: isAnswer,
|
|
130
|
+
"!spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
131
|
+
"!spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
132
|
+
"!spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
133
|
+
"spiffy-tw-border-[1px]": borderedVariants.includes(variant),
|
|
134
|
+
"spiffy-tw-border-solid": borderedVariants.includes(variant)
|
|
135
|
+
});
|
|
136
|
+
const textClassName = classNames({
|
|
137
|
+
"spiffy-tw-text-[14px]": true,
|
|
138
|
+
"spiffy-tw-leading-[100%]": true,
|
|
139
|
+
"!spiffy-tw-font-bold": boldText
|
|
140
|
+
});
|
|
141
|
+
const iconClass = classNames({
|
|
142
|
+
"spiffy-tw-w-[11px]": true,
|
|
143
|
+
"spiffy-tw-h-[11px]": true,
|
|
144
|
+
"spiffy-tw-stroke-inherit": true,
|
|
145
|
+
"spiffy-tw-fill-inherit": true
|
|
146
|
+
});
|
|
147
|
+
const baseClasses = variantClassMap.get(variant) ?? [];
|
|
148
|
+
const hoverClasses = variantClassMap.get(hoverVariant) ?? [];
|
|
149
|
+
const baseBorderClasses = baseClasses.filter((cls) => cls.includes("border"));
|
|
150
|
+
const baseNonBorderClasses = baseClasses.filter((cls) => !cls.includes("border"));
|
|
151
|
+
const hoverBorderClasses = hoverClasses.filter((cls) => cls.includes("border"));
|
|
152
|
+
const hoverNonBorderClasses = hoverClasses.filter((cls) => !cls.includes("border"));
|
|
153
|
+
const variantClasses = [
|
|
154
|
+
...baseNonBorderClasses,
|
|
155
|
+
...hoverTransform(hoverNonBorderClasses),
|
|
156
|
+
...baseBorderClasses,
|
|
157
|
+
...hoverTransform(hoverBorderClasses)
|
|
158
|
+
];
|
|
159
|
+
const buttonClass = `${buttonClassName} ${variantClasses.join(" ")}`;
|
|
160
|
+
const getIcon = () => {
|
|
161
|
+
if (isAnswer) return void 0;
|
|
162
|
+
if (variant === "transparentDark") return OutlinedStar;
|
|
163
|
+
return FourPointStar;
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ jsx(ButtonBase, {
|
|
166
|
+
text: content,
|
|
167
|
+
dataAttributes,
|
|
168
|
+
dataTestId,
|
|
169
|
+
isDisabled,
|
|
170
|
+
icon: getIcon(),
|
|
171
|
+
iconClass: isAnswer ? void 0 : iconClass,
|
|
172
|
+
textClass: `${SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS} ${textClassName}`,
|
|
173
|
+
buttonClass,
|
|
174
|
+
onClick
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
//#endregion
|
|
179
|
+
export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypographyVariantMap } from "../typographyVariantClasses-DTSltxPN.cjs";
|
|
2
|
+
import "../index-BMHF0IWd.cjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/TextInput/TextInput.d.ts
|
|
6
|
+
interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
7
|
+
borderRadius: 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
borderColorClass?: string;
|
|
9
|
+
placeholderVariant?: keyof typeof TypographyVariantMap;
|
|
10
|
+
}
|
|
11
|
+
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TextInput, TextInputProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypographyVariantMap } from "../typographyVariantClasses-COmQXqcN.js";
|
|
2
|
+
import "../index-BH-QK27q.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/TextInput/TextInput.d.ts
|
|
6
|
+
interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
7
|
+
borderRadius: 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
borderColorClass?: string;
|
|
9
|
+
placeholderVariant?: keyof typeof TypographyVariantMap;
|
|
10
|
+
}
|
|
11
|
+
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TextInput, TextInputProps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TypographyVariantMap, getVariantPlaceholderClassNames } from "./Typography-D3vDkBMS.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/TextInput/TextInput.tsx
|
|
7
|
+
const TextInput = React.forwardRef(({ className, borderRadius, borderColorClass, placeholderVariant,...rest }, ref) => {
|
|
8
|
+
const variantClassNames = placeholderVariant ? TypographyVariantMap[placeholderVariant] : {};
|
|
9
|
+
const placeholderVariantClassNames = getVariantPlaceholderClassNames(variantClassNames);
|
|
10
|
+
const inputClasses = classNames([
|
|
11
|
+
{
|
|
12
|
+
"spiffy-text-input": true,
|
|
13
|
+
"spiffy-tw-outline-none": true,
|
|
14
|
+
"spiffy-tw-rounded-[64px]": borderRadius === "xl",
|
|
15
|
+
"spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
16
|
+
"spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
17
|
+
"spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
18
|
+
...placeholderVariantClassNames
|
|
19
|
+
},
|
|
20
|
+
borderColorClass,
|
|
21
|
+
className
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ jsx("input", {
|
|
24
|
+
ref,
|
|
25
|
+
...rest,
|
|
26
|
+
className: inputClasses
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TextInput };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_Typography = require('./Typography-CFNWgbM5.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_chunk.__toESM(react);
|
|
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
|
+
|
|
10
|
+
//#region src/components/TextInput/TextInput.tsx
|
|
11
|
+
const TextInput = react.default.forwardRef(({ className, borderRadius, borderColorClass, placeholderVariant,...rest }, ref) => {
|
|
12
|
+
const variantClassNames = placeholderVariant ? require_Typography.TypographyVariantMap[placeholderVariant] : {};
|
|
13
|
+
const placeholderVariantClassNames = require_Typography.getVariantPlaceholderClassNames(variantClassNames);
|
|
14
|
+
const inputClasses = (0, classnames.default)([
|
|
15
|
+
{
|
|
16
|
+
"spiffy-text-input": true,
|
|
17
|
+
"spiffy-tw-outline-none": true,
|
|
18
|
+
"spiffy-tw-rounded-[64px]": borderRadius === "xl",
|
|
19
|
+
"spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
20
|
+
"spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
21
|
+
"spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
22
|
+
...placeholderVariantClassNames
|
|
23
|
+
},
|
|
24
|
+
borderColorClass,
|
|
25
|
+
className
|
|
26
|
+
]);
|
|
27
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
28
|
+
ref,
|
|
29
|
+
...rest,
|
|
30
|
+
className: inputClasses
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
Object.defineProperty(exports, 'TextInput', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return TextInput;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ToggleButton/ToggleButton.d.ts
|
|
4
|
+
type ToggleButtonProps = {
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
variant: ToggleButtonVariant;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
label: string;
|
|
9
|
+
buttonClassName?: string;
|
|
10
|
+
labelClassName?: string;
|
|
11
|
+
secondaryLabel?: string;
|
|
12
|
+
secondaryLabelClassName?: string;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
iconClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
type ToggleButtonVariant = 'default';
|
|
17
|
+
declare const ToggleButton: ({
|
|
18
|
+
isSelected,
|
|
19
|
+
onClick,
|
|
20
|
+
label,
|
|
21
|
+
buttonClassName,
|
|
22
|
+
labelClassName,
|
|
23
|
+
secondaryLabel,
|
|
24
|
+
secondaryLabelClassName,
|
|
25
|
+
icon,
|
|
26
|
+
iconClassName,
|
|
27
|
+
variant
|
|
28
|
+
}: ToggleButtonProps) => react_jsx_runtime10.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ToggleButton, ToggleButtonProps, ToggleButtonVariant };
|