@envive-ai/react-toolkit 0.1.10 → 0.1.11
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 +3 -82
- package/dist/Accordion/index.d.cts +2 -2
- package/dist/Accordion/index.d.ts +2 -2
- package/dist/Accordion/index.js +2 -75
- package/dist/Accordion-Cp3Hx2zm.js +77 -0
- package/dist/Accordion-DBZpiQe7.cjs +88 -0
- package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
- package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
- package/dist/ButtonBase/index.cjs +2 -2
- package/dist/ButtonBase/index.js +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
- package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
- package/dist/FilterScrollbar/index.cjs +1 -1
- package/dist/FilterScrollbar/index.d.cts +3 -3
- package/dist/FilterScrollbar/index.d.ts +3 -3
- package/dist/FilterScrollbar/index.js +1 -1
- package/dist/Headline/index.cjs +1 -1
- package/dist/Headline/index.d.cts +2 -2
- package/dist/Headline/index.d.ts +2 -2
- package/dist/Headline/index.js +1 -1
- package/dist/ImageWithFallback/index.d.cts +2 -2
- package/dist/ImageWithFallback/index.d.ts +2 -2
- package/dist/ModalSheet/index.cjs +3 -0
- package/dist/ModalSheet/index.d.cts +38 -0
- package/dist/ModalSheet/index.d.ts +38 -0
- package/dist/ModalSheet/index.js +3 -0
- package/dist/ModalSheet-CXZgyZ4a.cjs +335 -0
- package/dist/ModalSheet-CZd5pssv.js +324 -0
- package/dist/ProductCard/index.cjs +3 -3
- package/dist/ProductCard/index.d.cts +1 -1
- package/dist/ProductCard/index.d.ts +1 -1
- package/dist/ProductCard/index.js +3 -3
- package/dist/{ProductCard-Dkkhl9pk.js → ProductCard-D-lyh8uV.js} +3 -3
- package/dist/{ProductCard-CymUvJnC.cjs → ProductCard-F49krjHk.cjs} +4 -4
- package/dist/ProductGrid/index.cjs +4 -4
- package/dist/ProductGrid/index.d.cts +3 -3
- package/dist/ProductGrid/index.d.ts +3 -3
- package/dist/ProductGrid/index.js +4 -4
- package/dist/{ProductGrid-B3Ypqh7j.js → ProductGrid-FIf5wFQx.js} +1 -1
- package/dist/{ProductGrid-ZNRujkuN.cjs → ProductGrid-QeoaIfcq.cjs} +1 -1
- package/dist/RadioButton/index.cjs +6 -0
- package/dist/RadioButton/index.d.cts +30 -0
- package/dist/RadioButton/index.d.ts +30 -0
- package/dist/RadioButton/index.js +6 -0
- package/dist/RadioButton-Bf68dZl7.js +68 -0
- package/dist/RadioButton-DZ6QXkrN.cjs +77 -0
- package/dist/RadioButtonGroup/index.cjs +8 -0
- package/dist/RadioButtonGroup/index.d.cts +36 -0
- package/dist/RadioButtonGroup/index.d.ts +36 -0
- package/dist/RadioButtonGroup/index.js +7 -0
- package/dist/RadioButtonGroup-8k7hkJYB.js +37 -0
- package/dist/RadioButtonGroup-Dc_n5amh.cjs +51 -0
- package/dist/SearchAutocomplete/index.cjs +1 -1
- package/dist/SearchAutocomplete/index.js +1 -1
- package/dist/SearchFilter/index.cjs +9 -2
- package/dist/SearchFilter/index.d.cts +15 -9
- package/dist/SearchFilter/index.d.ts +11 -5
- package/dist/SearchFilter/index.js +9 -2
- package/dist/SearchFilter-BOwErEyI.js +258 -0
- package/dist/SearchFilter-BtLKnFMm.cjs +279 -0
- package/dist/SearchInput/index.cjs +3 -3
- package/dist/SearchInput/index.d.cts +1 -1
- package/dist/SearchInput/index.d.ts +2 -2
- package/dist/SearchInput/index.js +3 -3
- package/dist/{SearchInput-BT1rrc4F.js → SearchInput-BBaYEwkR.js} +2 -2
- package/dist/{SearchInput-CdR_nsR3.cjs → SearchInput-BTNvgrIa.cjs} +2 -2
- package/dist/SearchInputForm/index.cjs +4 -4
- package/dist/SearchInputForm/index.d.cts +1 -1
- package/dist/SearchInputForm/index.d.ts +1 -1
- package/dist/SearchInputForm/index.js +4 -4
- package/dist/SearchResultsContent/index.cjs +9 -9
- package/dist/SearchResultsContent/index.d.cts +4 -4
- package/dist/SearchResultsContent/index.d.ts +4 -4
- package/dist/SearchResultsContent/index.js +9 -9
- package/dist/SearchResultsFilterSidebar/index.cjs +15 -8
- package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
- package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
- package/dist/SearchResultsFilterSidebar/index.js +13 -6
- package/dist/SearchResultsStates/index.cjs +9 -9
- package/dist/SearchResultsStates/index.d.cts +6 -6
- package/dist/SearchResultsStates/index.d.ts +6 -6
- package/dist/SearchResultsStates/index.js +9 -9
- package/dist/{SearchResultsStates-BxJphoL-.js → SearchResultsStates-CB5k1xkK.js} +5 -5
- package/dist/{SearchResultsStates-ESlrrf20.cjs → SearchResultsStates-DywK7vvp.cjs} +5 -5
- package/dist/SparkleAnimation/index.cjs +1 -1
- package/dist/SparkleAnimation/index.d.cts +2 -2
- package/dist/SparkleAnimation/index.d.ts +2 -2
- package/dist/SparkleAnimation/index.js +1 -1
- package/dist/Spinner/index.cjs +1 -1
- package/dist/Spinner/index.d.cts +2 -2
- package/dist/Spinner/index.d.ts +2 -2
- package/dist/Spinner/index.js +1 -1
- package/dist/SuggestionButton/index.cjs +1 -1
- package/dist/SuggestionButton/index.d.cts +2 -2
- package/dist/SuggestionButton/index.d.ts +2 -2
- package/dist/SuggestionButton/index.js +1 -1
- package/dist/Text/index.d.cts +2 -2
- package/dist/Text/index.d.ts +3 -3
- package/dist/TextInput/index.cjs +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/ToggleButton/index.cjs +6 -0
- package/dist/ToggleButton/index.d.cts +30 -0
- package/dist/ToggleButton/index.d.ts +30 -0
- package/dist/ToggleButton/index.js +6 -0
- package/dist/ToggleButton-BKRR_-69.js +60 -0
- package/dist/ToggleButton-D90UO4qv.cjs +68 -0
- package/dist/{index-b4yAASuy.d.cts → index-1x_hMlEf.d.cts} +4 -4
- package/dist/{index-DV2K-9lE.d.cts → index-CgjZdKpL.d.cts} +5 -5
- package/dist/{index-agU5rfIs.d.ts → index-Cl4d_pDw.d.ts} +5 -5
- package/dist/{index-uU3sIiRx.d.ts → index-H_9LhS_1.d.cts} +2 -2
- package/dist/{index-DggZTKvc.d.ts → index-QMTPxKA9.d.ts} +4 -4
- package/dist/{index-Bpjv4lP2.d.cts → index-gfYBM7Ul.d.ts} +2 -2
- package/dist/{searchFilterSidebarVariants-BnIcOVWR.js → searchFilterSidebarVariants-CDFCHVeZ.js} +1 -1
- package/dist/{searchFilterSidebarVariants-DVZ7wRlb.cjs → searchFilterSidebarVariants-CtmuwSBQ.cjs} +1 -1
- package/package.json +20 -3
- package/src/components/AnimatedChevron/AnimatedChevron.tsx +37 -0
- package/src/components/ModalSheet/ModalSheet.tsx +42 -0
- package/src/components/ModalSheet/common/closeIcon.tsx +40 -0
- package/src/components/ModalSheet/common/enviveWatermark.tsx +30 -0
- package/src/components/ModalSheet/desktop/desktopHeader.tsx +24 -0
- package/src/components/ModalSheet/desktop/index.tsx +118 -0
- package/src/components/ModalSheet/index.ts +1 -0
- package/src/components/ModalSheet/mobile/index.tsx +117 -0
- package/src/components/ModalSheet/mobile/mobileHeader.tsx +42 -0
- package/src/components/ModalSheet/types.ts +33 -0
- package/src/components/RadioButton/RadioButton.tsx +88 -0
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +72 -0
- package/src/components/RadioButtonGroup/index.ts +1 -0
- package/src/components/SearchFilter/SearchFilter.tsx +161 -64
- package/src/components/SearchFilter/SearchFilterFooter.tsx +55 -0
- package/src/components/SearchFilter/types.ts +2 -1
- package/src/components/SearchFilter/useHasFilterStateChanged.tsx +40 -0
- package/src/components/SearchFilter/utils.ts +15 -0
- package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -2
- package/src/components/ToggleButton/ToggleButton.tsx +98 -0
- package/src/components/ToggleButton/index.ts +1 -0
- package/dist/SearchFilter-CLYCSNAa.cjs +0 -137
- package/dist/SearchFilter-qQPpx-34.js +0 -117
- /package/dist/{ButtonBase-C_uKnl48.js → ButtonBase-0NN6wmX-.js} +0 -0
- /package/dist/{ButtonBase-DGbSm0SJ.js → ButtonBase-BAf-nlCm.js} +0 -0
- /package/dist/{ButtonBase-DbWQ25n-.cjs → ButtonBase-BIXx56hq.cjs} +0 -0
- /package/dist/{ButtonBase-DGpQBeLR.cjs → ButtonBase-Do88ndKa.cjs} +0 -0
- /package/dist/{DynamicFiltersScrollbar-Dev5vGsW.js → DynamicFiltersScrollbar-C4kdNSJ9.js} +0 -0
- /package/dist/{DynamicFiltersScrollbar-ChvmEiPB.cjs → DynamicFiltersScrollbar-CVw1PINp.cjs} +0 -0
- /package/dist/{Headline-DTaT30_m.js → Headline-DNEWF8ly.js} +0 -0
- /package/dist/{Headline-DSmu5Mg8.cjs → Headline-DTT4RSv2.cjs} +0 -0
- /package/dist/{SearchAutocomplete-C4RY0IoT.js → SearchAutocomplete-C6omCGJp.js} +0 -0
- /package/dist/{SearchAutocomplete-hQDnKtwQ.cjs → SearchAutocomplete-Cofuvwwp.cjs} +0 -0
- /package/dist/{SparkleAnimation-fQHP7b-R.js → SparkleAnimation-AM4XoegD.js} +0 -0
- /package/dist/{SparkleAnimation-BY5iw7s0.cjs → SparkleAnimation-Edzqyb48.cjs} +0 -0
- /package/dist/{Spinner-BqTt55uu.js → Spinner-CjGLIRgs.js} +0 -0
- /package/dist/{Spinner-DjK8ts9E.cjs → Spinner-DFor2Szi.cjs} +0 -0
- /package/dist/{TextInput-DIjjsSMg.js → TextInput-BVPdz7e8.js} +0 -0
- /package/dist/{TextInput-BJrdkZsM.cjs → TextInput-CnXhppYn.cjs} +0 -0
- /package/dist/{colorsConfig-CYZ8f_gj.js → colorsConfig-5Yf4nrEe.js} +0 -0
- /package/dist/{colorsConfig-CJTKbJsm.cjs → colorsConfig-DFL3mBwB.cjs} +0 -0
- /package/dist/{textVariantClasses-ypYGLq0h.d.ts → textVariantClasses-kyZtL8F5.d.ts} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Text } from "./Text-Bod4OMPk.js";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/ToggleButton/ToggleButton.tsx
|
|
6
|
+
const toggleButtonVariants = { default: {
|
|
7
|
+
button: ({ isSelected }) => classNames({
|
|
8
|
+
"spiffy-tw-bg-[--spiffy-colors-background-dark]": isSelected,
|
|
9
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]": isSelected,
|
|
10
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]": isSelected,
|
|
11
|
+
"hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]": true,
|
|
12
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-primary]": isSelected,
|
|
13
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]": !isSelected,
|
|
14
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]": !isSelected,
|
|
15
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": !isSelected
|
|
16
|
+
}),
|
|
17
|
+
label: () => "",
|
|
18
|
+
secondaryLabel: ({ isSelected }) => classNames({
|
|
19
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected,
|
|
20
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected
|
|
21
|
+
})
|
|
22
|
+
} };
|
|
23
|
+
const ToggleButton = ({ isSelected, onClick, label, buttonClassName, labelClassName, secondaryLabel, secondaryLabelClassName, icon, iconClassName, variant }) => {
|
|
24
|
+
const buttonClassNames = classNames({
|
|
25
|
+
"spiffy-tw-flex": true,
|
|
26
|
+
"spiffy-tw-items-center": true,
|
|
27
|
+
"spiffy-tw-gap-[4px]": true,
|
|
28
|
+
"spiffy-tw-cursor-pointer": true,
|
|
29
|
+
"spiffy-tw-py-[8px]": true,
|
|
30
|
+
"spiffy-tw-px-[12px]": true,
|
|
31
|
+
"spiffy-tw-rounded-[200px]": true,
|
|
32
|
+
"spiffy-tw-border": true
|
|
33
|
+
}, toggleButtonVariants?.[variant]?.button({ isSelected }), buttonClassName);
|
|
34
|
+
const labelClassNames = classNames({}, toggleButtonVariants?.[variant]?.label({ isSelected }), labelClassName);
|
|
35
|
+
const secondaryLabelClassNames = classNames({}, toggleButtonVariants?.[variant]?.secondaryLabel({ isSelected }), secondaryLabelClassName);
|
|
36
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
37
|
+
className: buttonClassNames,
|
|
38
|
+
onClick,
|
|
39
|
+
type: "button",
|
|
40
|
+
children: [
|
|
41
|
+
icon && /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: iconClassName,
|
|
43
|
+
children: icon
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx(Text, {
|
|
46
|
+
variant: "body3",
|
|
47
|
+
className: labelClassNames,
|
|
48
|
+
children: label
|
|
49
|
+
}),
|
|
50
|
+
secondaryLabel && /* @__PURE__ */ jsx(Text, {
|
|
51
|
+
variant: "body4",
|
|
52
|
+
className: secondaryLabelClassNames,
|
|
53
|
+
children: secondaryLabel
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ToggleButton };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
+
const require_Text = require('./Text-MQjxqgZZ.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
|
+
|
|
8
|
+
//#region src/components/ToggleButton/ToggleButton.tsx
|
|
9
|
+
const toggleButtonVariants = { default: {
|
|
10
|
+
button: ({ isSelected }) => (0, classnames.default)({
|
|
11
|
+
"spiffy-tw-bg-[--spiffy-colors-background-dark]": isSelected,
|
|
12
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]": isSelected,
|
|
13
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]": isSelected,
|
|
14
|
+
"hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]": true,
|
|
15
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-primary]": isSelected,
|
|
16
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]": !isSelected,
|
|
17
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]": !isSelected,
|
|
18
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": !isSelected
|
|
19
|
+
}),
|
|
20
|
+
label: () => "",
|
|
21
|
+
secondaryLabel: ({ isSelected }) => (0, classnames.default)({
|
|
22
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected,
|
|
23
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected
|
|
24
|
+
})
|
|
25
|
+
} };
|
|
26
|
+
const ToggleButton = ({ isSelected, onClick, label, buttonClassName, labelClassName, secondaryLabel, secondaryLabelClassName, icon, iconClassName, variant }) => {
|
|
27
|
+
const buttonClassNames = (0, classnames.default)({
|
|
28
|
+
"spiffy-tw-flex": true,
|
|
29
|
+
"spiffy-tw-items-center": true,
|
|
30
|
+
"spiffy-tw-gap-[4px]": true,
|
|
31
|
+
"spiffy-tw-cursor-pointer": true,
|
|
32
|
+
"spiffy-tw-py-[8px]": true,
|
|
33
|
+
"spiffy-tw-px-[12px]": true,
|
|
34
|
+
"spiffy-tw-rounded-[200px]": true,
|
|
35
|
+
"spiffy-tw-border": true
|
|
36
|
+
}, toggleButtonVariants?.[variant]?.button({ isSelected }), buttonClassName);
|
|
37
|
+
const labelClassNames = (0, classnames.default)({}, toggleButtonVariants?.[variant]?.label({ isSelected }), labelClassName);
|
|
38
|
+
const secondaryLabelClassNames = (0, classnames.default)({}, toggleButtonVariants?.[variant]?.secondaryLabel({ isSelected }), secondaryLabelClassName);
|
|
39
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
40
|
+
className: buttonClassNames,
|
|
41
|
+
onClick,
|
|
42
|
+
type: "button",
|
|
43
|
+
children: [
|
|
44
|
+
icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
|
+
className: iconClassName,
|
|
46
|
+
children: icon
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
49
|
+
variant: "body3",
|
|
50
|
+
className: labelClassNames,
|
|
51
|
+
children: label
|
|
52
|
+
}),
|
|
53
|
+
secondaryLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
54
|
+
variant: "body4",
|
|
55
|
+
className: secondaryLabelClassNames,
|
|
56
|
+
children: secondaryLabel
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
Object.defineProperty(exports, 'ToggleButton', {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return ToggleButton;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
2
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
3
3
|
import { FC } from "react";
|
|
4
4
|
import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
@@ -261,7 +261,7 @@ declare const RatingSummary: ({
|
|
|
261
261
|
stars,
|
|
262
262
|
reviewCount,
|
|
263
263
|
className
|
|
264
|
-
}: RatingSummaryProps) =>
|
|
264
|
+
}: RatingSummaryProps) => react_jsx_runtime5.JSX.Element;
|
|
265
265
|
interface PriceSectionProps {
|
|
266
266
|
originalPrice?: string;
|
|
267
267
|
salePrice?: string;
|
|
@@ -271,7 +271,7 @@ declare const PriceSection: ({
|
|
|
271
271
|
originalPrice,
|
|
272
272
|
salePrice,
|
|
273
273
|
pricePrefix
|
|
274
|
-
}: PriceSectionProps) =>
|
|
274
|
+
}: PriceSectionProps) => react_jsx_runtime5.JSX.Element;
|
|
275
275
|
interface ProductCardProps extends TestProps {
|
|
276
276
|
productCardConfig?: ProductCardConfig;
|
|
277
277
|
merchantShortName: string;
|
|
@@ -312,7 +312,7 @@ declare const ProductCard: ({
|
|
|
312
312
|
aspectRatio,
|
|
313
313
|
growWithContainer,
|
|
314
314
|
handleClick
|
|
315
|
-
}: ProductCardProps) =>
|
|
315
|
+
}: ProductCardProps) => react_jsx_runtime5.JSX.Element;
|
|
316
316
|
//#endregion
|
|
317
317
|
//#region src/components/ProductCard/ProductCardSkeleton.d.ts
|
|
318
318
|
declare const ProductCardSkeleton: FC<ProductCardSkeletonProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
2
2
|
import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/SearchResultsFilterSidebar/types.d.ts
|
|
5
5
|
type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
|
|
6
|
-
type CloseIconVariant = 'light' | 'tertiary' | 'dark';
|
|
6
|
+
type CloseIconVariant$1 = 'light' | 'tertiary' | 'dark';
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts
|
|
9
9
|
interface SearchFilterSidebarVariantClasses {
|
|
@@ -17,7 +17,7 @@ interface SearchFilterSidebarVariantClasses {
|
|
|
17
17
|
appliedFilterBackgroundClasses: string;
|
|
18
18
|
applyFiltersUnchangedClasses: string;
|
|
19
19
|
applyFiltersChangedClasses: string;
|
|
20
|
-
filterCloseIconVariant: CloseIconVariant;
|
|
20
|
+
filterCloseIconVariant: CloseIconVariant$1;
|
|
21
21
|
}
|
|
22
22
|
declare const searchFilterSidebarVariantClasses: Record<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses>;
|
|
23
23
|
//#endregion
|
|
@@ -42,6 +42,6 @@ declare const SearchResultsFilter: ({
|
|
|
42
42
|
onSelectFilterItem,
|
|
43
43
|
onClearAllFilters,
|
|
44
44
|
filterButtonText
|
|
45
|
-
}: SearchResultsFilterProps) =>
|
|
45
|
+
}: SearchResultsFilterProps) => react_jsx_runtime20.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
|
-
export { CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
|
|
47
|
+
export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime25 from "react/jsx-runtime";
|
|
2
2
|
import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
|
|
3
3
|
|
|
4
4
|
//#region src/components/SearchResultsFilterSidebar/types.d.ts
|
|
5
5
|
type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
|
|
6
|
-
type CloseIconVariant = 'light' | 'tertiary' | 'dark';
|
|
6
|
+
type CloseIconVariant$1 = 'light' | 'tertiary' | 'dark';
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts
|
|
9
9
|
interface SearchFilterSidebarVariantClasses {
|
|
@@ -17,7 +17,7 @@ interface SearchFilterSidebarVariantClasses {
|
|
|
17
17
|
appliedFilterBackgroundClasses: string;
|
|
18
18
|
applyFiltersUnchangedClasses: string;
|
|
19
19
|
applyFiltersChangedClasses: string;
|
|
20
|
-
filterCloseIconVariant: CloseIconVariant;
|
|
20
|
+
filterCloseIconVariant: CloseIconVariant$1;
|
|
21
21
|
}
|
|
22
22
|
declare const searchFilterSidebarVariantClasses: Record<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses>;
|
|
23
23
|
//#endregion
|
|
@@ -42,6 +42,6 @@ declare const SearchResultsFilter: ({
|
|
|
42
42
|
onSelectFilterItem,
|
|
43
43
|
onClearAllFilters,
|
|
44
44
|
filterButtonText
|
|
45
|
-
}: SearchResultsFilterProps) =>
|
|
45
|
+
}: SearchResultsFilterProps) => react_jsx_runtime25.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
|
-
export { CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
|
|
47
|
+
export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/SearchInputForm/types.d.ts
|
|
4
4
|
type SearchInputVariant = 'standard';
|
|
@@ -31,6 +31,6 @@ declare const SearchInputForm: ({
|
|
|
31
31
|
onSearchInputChange,
|
|
32
32
|
onSearchSubmit,
|
|
33
33
|
searchInputDataTestId
|
|
34
|
-
}: SearchInputFormProps) =>
|
|
34
|
+
}: SearchInputFormProps) => react_jsx_runtime11.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { SearchInputForm, SearchInputVariant };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
3
3
|
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
4
4
|
import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
|
|
5
5
|
|
|
@@ -261,7 +261,7 @@ declare const RatingSummary: ({
|
|
|
261
261
|
stars,
|
|
262
262
|
reviewCount,
|
|
263
263
|
className
|
|
264
|
-
}: RatingSummaryProps) =>
|
|
264
|
+
}: RatingSummaryProps) => react_jsx_runtime14.JSX.Element;
|
|
265
265
|
interface PriceSectionProps {
|
|
266
266
|
originalPrice?: string;
|
|
267
267
|
salePrice?: string;
|
|
@@ -271,7 +271,7 @@ declare const PriceSection: ({
|
|
|
271
271
|
originalPrice,
|
|
272
272
|
salePrice,
|
|
273
273
|
pricePrefix
|
|
274
|
-
}: PriceSectionProps) =>
|
|
274
|
+
}: PriceSectionProps) => react_jsx_runtime14.JSX.Element;
|
|
275
275
|
interface ProductCardProps extends TestProps {
|
|
276
276
|
productCardConfig?: ProductCardConfig;
|
|
277
277
|
merchantShortName: string;
|
|
@@ -312,7 +312,7 @@ declare const ProductCard: ({
|
|
|
312
312
|
aspectRatio,
|
|
313
313
|
growWithContainer,
|
|
314
314
|
handleClick
|
|
315
|
-
}: ProductCardProps) =>
|
|
315
|
+
}: ProductCardProps) => react_jsx_runtime14.JSX.Element;
|
|
316
316
|
//#endregion
|
|
317
317
|
//#region src/components/ProductCard/ProductCardSkeleton.d.ts
|
|
318
318
|
declare const ProductCardSkeleton: FC<ProductCardSkeletonProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/SearchInputForm/types.d.ts
|
|
4
4
|
type SearchInputVariant = 'standard';
|
|
@@ -31,6 +31,6 @@ declare const SearchInputForm: ({
|
|
|
31
31
|
onSearchInputChange,
|
|
32
32
|
onSearchSubmit,
|
|
33
33
|
searchInputDataTestId
|
|
34
|
-
}: SearchInputFormProps) =>
|
|
34
|
+
}: SearchInputFormProps) => react_jsx_runtime0.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { SearchInputForm, SearchInputVariant };
|
package/dist/{searchFilterSidebarVariants-DVZ7wRlb.cjs → searchFilterSidebarVariants-CtmuwSBQ.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_colorsConfig = require('./colorsConfig-
|
|
1
|
+
const require_colorsConfig = require('./colorsConfig-DFL3mBwB.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts
|
|
4
4
|
const searchFilterSidebarVariantClasses = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsdown",
|
|
25
25
|
"build:watch": "tsdown --watch",
|
|
26
|
-
"prepublish": "npm run build"
|
|
26
|
+
"prepublish": "npm run build",
|
|
27
|
+
"typecheck": "tsc"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@envive-ai/react-hooks": "^0.1.5",
|
|
30
30
|
"@envive-ai/react-icons": "0.1.1",
|
|
31
|
+
"@envive-ai/react-hooks": "^0.1.6",
|
|
31
32
|
"@tailwindcss/typography": "^0.5.15",
|
|
32
33
|
"classnames": "^2.5.1",
|
|
33
34
|
"framer-motion": "^12.23.12",
|
|
@@ -75,6 +76,10 @@
|
|
|
75
76
|
"import": "./dist/ImageWithFallback/index.js",
|
|
76
77
|
"require": "./dist/ImageWithFallback/index.cjs"
|
|
77
78
|
},
|
|
79
|
+
"./ModalSheet": {
|
|
80
|
+
"import": "./dist/ModalSheet/index.js",
|
|
81
|
+
"require": "./dist/ModalSheet/index.cjs"
|
|
82
|
+
},
|
|
78
83
|
"./ProductCard": {
|
|
79
84
|
"import": "./dist/ProductCard/index.js",
|
|
80
85
|
"require": "./dist/ProductCard/index.cjs"
|
|
@@ -83,6 +88,14 @@
|
|
|
83
88
|
"import": "./dist/ProductGrid/index.js",
|
|
84
89
|
"require": "./dist/ProductGrid/index.cjs"
|
|
85
90
|
},
|
|
91
|
+
"./RadioButton": {
|
|
92
|
+
"import": "./dist/RadioButton/index.js",
|
|
93
|
+
"require": "./dist/RadioButton/index.cjs"
|
|
94
|
+
},
|
|
95
|
+
"./RadioButtonGroup": {
|
|
96
|
+
"import": "./dist/RadioButtonGroup/index.js",
|
|
97
|
+
"require": "./dist/RadioButtonGroup/index.cjs"
|
|
98
|
+
},
|
|
86
99
|
"./SearchAutocomplete": {
|
|
87
100
|
"import": "./dist/SearchAutocomplete/index.js",
|
|
88
101
|
"require": "./dist/SearchAutocomplete/index.cjs"
|
|
@@ -135,6 +148,10 @@
|
|
|
135
148
|
"import": "./dist/TextInput/index.js",
|
|
136
149
|
"require": "./dist/TextInput/index.cjs"
|
|
137
150
|
},
|
|
151
|
+
"./ToggleButton": {
|
|
152
|
+
"import": "./dist/ToggleButton/index.js",
|
|
153
|
+
"require": "./dist/ToggleButton/index.cjs"
|
|
154
|
+
},
|
|
138
155
|
"./package.json": "./package.json"
|
|
139
156
|
}
|
|
140
157
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MotionValue, motion, useTransform } from 'framer-motion';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
interface AnimatedChevronProps {
|
|
5
|
+
animationKey: MotionValue;
|
|
6
|
+
chevronColor: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const AnimatedChevron: FC<AnimatedChevronProps> = ({ animationKey, chevronColor }) => {
|
|
10
|
+
const leftRotation = useTransform(animationKey, [300, 0], [-12, 0]);
|
|
11
|
+
const rightRotation = useTransform(animationKey, [300, 0], [12, 0]);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div style={{ display: 'flex' }}>
|
|
15
|
+
<motion.div
|
|
16
|
+
style={{
|
|
17
|
+
x: 1,
|
|
18
|
+
width: '25px',
|
|
19
|
+
height: '4px',
|
|
20
|
+
background: chevronColor,
|
|
21
|
+
borderRadius: '8px',
|
|
22
|
+
rotate: leftRotation,
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
<motion.div
|
|
26
|
+
style={{
|
|
27
|
+
x: -1,
|
|
28
|
+
width: '25px',
|
|
29
|
+
height: '4px',
|
|
30
|
+
background: chevronColor,
|
|
31
|
+
borderRadius: '8px',
|
|
32
|
+
rotate: rightRotation,
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ModalSheetMobile } from './mobile';
|
|
2
|
+
import { ModalSheetDesktop } from './desktop';
|
|
3
|
+
import { ModalSheetProps } from './types';
|
|
4
|
+
import { useIsSmallScreen } from '@envive-ai/react-hooks/hooks';
|
|
5
|
+
|
|
6
|
+
const ANIMATION_DURATION = 0.3;
|
|
7
|
+
|
|
8
|
+
export const ModalSheet = ({
|
|
9
|
+
children,
|
|
10
|
+
isOpen,
|
|
11
|
+
closeModal,
|
|
12
|
+
animationDuration = ANIMATION_DURATION,
|
|
13
|
+
desktopWidth = 512,
|
|
14
|
+
headerProps,
|
|
15
|
+
footerProps,
|
|
16
|
+
}: ModalSheetProps) => {
|
|
17
|
+
const isSmallScreen = useIsSmallScreen();
|
|
18
|
+
|
|
19
|
+
return isSmallScreen ? (
|
|
20
|
+
<ModalSheetMobile
|
|
21
|
+
isOpen={isOpen}
|
|
22
|
+
closeModal={closeModal}
|
|
23
|
+
desktopWidth={desktopWidth}
|
|
24
|
+
animationDuration={animationDuration}
|
|
25
|
+
headerProps={headerProps}
|
|
26
|
+
footerProps={footerProps}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</ModalSheetMobile>
|
|
30
|
+
) : (
|
|
31
|
+
<ModalSheetDesktop
|
|
32
|
+
isOpen={isOpen}
|
|
33
|
+
closeModal={closeModal}
|
|
34
|
+
desktopWidth={desktopWidth}
|
|
35
|
+
animationDuration={animationDuration}
|
|
36
|
+
headerProps={headerProps}
|
|
37
|
+
footerProps={footerProps}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</ModalSheetDesktop>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { GrFormClose } from 'react-icons/gr';
|
|
4
|
+
import { IconContext } from 'react-icons/lib';
|
|
5
|
+
import { ModalSheetCloseIconProps } from '../types';
|
|
6
|
+
|
|
7
|
+
const closeIconVariantMapping = {
|
|
8
|
+
light: {
|
|
9
|
+
'spiffy-tw-bg-[--spiffy-colors-background-light]': true,
|
|
10
|
+
'spiffy-tw-text-[--spiffy-colors-text-primary]': true,
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
'spiffy-tw-bg-[--spiffy-colors-background-dark]': true,
|
|
14
|
+
'spiffy-tw-text-[--spiffy-colors-background-primary]': true,
|
|
15
|
+
},
|
|
16
|
+
tertiary: {
|
|
17
|
+
'spiffy-tw-text-[--spiffy-colors-background-primary]': true,
|
|
18
|
+
'spiffy-tw-bg-[--spiffy-colors-background-tertiary]': true,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const ModalSheetCloseIcon = ({
|
|
23
|
+
closeIconVariant = 'tertiary',
|
|
24
|
+
closeIcon = <GrFormClose />,
|
|
25
|
+
iconSize = '20px',
|
|
26
|
+
closeModal,
|
|
27
|
+
}: ModalSheetCloseIconProps) => {
|
|
28
|
+
const closeIconClassNames = classNames({
|
|
29
|
+
'spiffy-modal-sheet-close-icon': true,
|
|
30
|
+
'spiffy-tw-rounded-[99px]': true,
|
|
31
|
+
...closeIconVariantMapping[closeIconVariant],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const closeIconContextValue = useMemo(() => ({ size: iconSize }), [iconSize]);
|
|
35
|
+
return (
|
|
36
|
+
<div className={closeIconClassNames} onClick={closeModal}>
|
|
37
|
+
<IconContext.Provider value={closeIconContextValue}>{closeIcon}</IconContext.Provider>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { useAtomValue } from 'jotai';
|
|
3
|
+
import { WatermarkLogo } from 'src/assets';
|
|
4
|
+
import { orgUIConfigAtom } from 'src/atoms/org/orgUIConfig';
|
|
5
|
+
|
|
6
|
+
export const EnviveWatermark = () => {
|
|
7
|
+
const { floatingChatConfig } = useAtomValue(orgUIConfigAtom);
|
|
8
|
+
if (!floatingChatConfig.enableWatermark) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const wrapperClasses = classNames({
|
|
12
|
+
'spiffy-watermark-wrapper': true,
|
|
13
|
+
'spiffy-tw-flex': true,
|
|
14
|
+
'spiffy-tw-align-middle': true,
|
|
15
|
+
'spiffy-tw-pt-[4px]': true,
|
|
16
|
+
'spiffy-tw-justify-center': true,
|
|
17
|
+
});
|
|
18
|
+
const watermarkClasses = classNames({
|
|
19
|
+
'spiffy-watermark-logo': true,
|
|
20
|
+
'spiffy-tw-py-[4px]': true,
|
|
21
|
+
'spiffy-tw-px-[8px]': true,
|
|
22
|
+
});
|
|
23
|
+
return (
|
|
24
|
+
<a className={wrapperClasses} target="_blank" rel="noreferrer" href="https://www.envive.ai/">
|
|
25
|
+
<div title="Powered by Envive" className={watermarkClasses}>
|
|
26
|
+
<WatermarkLogo />
|
|
27
|
+
</div>
|
|
28
|
+
</a>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { ModalSheetHeaderProps } from '../types';
|
|
3
|
+
|
|
4
|
+
const modalSheetVariants = {
|
|
5
|
+
primary: {
|
|
6
|
+
'spiffy-tw-bg-[--spiffy-colors-background-primary]': true,
|
|
7
|
+
'spiffy-tw-text-[--spiffy-colors-text-light]': true,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ModalSheetDesktopHeader = ({
|
|
12
|
+
headerVariant = 'primary',
|
|
13
|
+
headerContent,
|
|
14
|
+
}: ModalSheetHeaderProps) => {
|
|
15
|
+
const headerStyles = classNames({
|
|
16
|
+
'spiffy-modal-sheet-header': true,
|
|
17
|
+
'spiffy-tw-flex': true,
|
|
18
|
+
'spiffy-tw-items-center': true,
|
|
19
|
+
'spiffy-tw-justify-between': true,
|
|
20
|
+
'spiffy-tw-w-full': true,
|
|
21
|
+
...modalSheetVariants[headerVariant],
|
|
22
|
+
});
|
|
23
|
+
return <div className={headerStyles}>{headerContent}</div>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
|
|
5
|
+
import { ModalSheetProps } from '../types';
|
|
6
|
+
import { ModalSheetDesktopHeader } from './desktopHeader';
|
|
7
|
+
|
|
8
|
+
export const ModalSheetDesktop = ({
|
|
9
|
+
children,
|
|
10
|
+
isOpen,
|
|
11
|
+
closeModal,
|
|
12
|
+
desktopWidth = 512,
|
|
13
|
+
animationDuration,
|
|
14
|
+
headerProps,
|
|
15
|
+
footerProps,
|
|
16
|
+
showOverlay = false,
|
|
17
|
+
}: ModalSheetProps) => {
|
|
18
|
+
const [isHidden, setIsHidden] = useState(isOpen ? 'block' : 'none');
|
|
19
|
+
const [right, setRight] = useState(isOpen ? 0 : 0 - desktopWidth);
|
|
20
|
+
const [overlayOpacity, setOverlayOpacity] = useState(0);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setIsHidden(isOpen ? 'block' : 'none');
|
|
24
|
+
setRight(isOpen ? 0 : 0 - desktopWidth);
|
|
25
|
+
setOverlayOpacity(isOpen ? 1 : 0);
|
|
26
|
+
}, [desktopWidth, isOpen]);
|
|
27
|
+
|
|
28
|
+
const overlayClassNames = classNames({
|
|
29
|
+
'spiffy-modal-sheet-overlay': true,
|
|
30
|
+
'spiffy-tw-fixed': true,
|
|
31
|
+
'spiffy-tw-inset-0': true,
|
|
32
|
+
'spiffy-tw-top-[0]': true,
|
|
33
|
+
'spiffy-tw-bottom-[0]': true,
|
|
34
|
+
'spiffy-tw-left-[0]': true,
|
|
35
|
+
'spiffy-tw-right-[0]': true,
|
|
36
|
+
'spiffy-tw-z-[2147483647]': true,
|
|
37
|
+
'spiffy-tw-bg-black/30': showOverlay,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const modalClassNames = classNames({
|
|
41
|
+
'spiffy-modal-sheet': true,
|
|
42
|
+
'spiffy-modal-sheet-open': isOpen,
|
|
43
|
+
'spiffy-tw-max-h-full': true,
|
|
44
|
+
'spiffy-tw-h-screen': true,
|
|
45
|
+
'spiffy-tw-w-[512px]': true,
|
|
46
|
+
'spiffy-tw-shadow-lg': true,
|
|
47
|
+
'spiffy-tw-top-[0]': true,
|
|
48
|
+
'spiffy-tw-bottom-[0]': true,
|
|
49
|
+
'spiffy-tw-fixed': true,
|
|
50
|
+
'spiffy-tw-bg-white': true,
|
|
51
|
+
'spiffy-tw-border-box': true,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const contentClassNames = classNames({
|
|
55
|
+
'spiffy-modal-sheet-content': true,
|
|
56
|
+
'spiffy-tw-overflow-y-auto': true,
|
|
57
|
+
'spiffy-tw-overflow-x-hidden': true,
|
|
58
|
+
'spiffy-tw-flex': true,
|
|
59
|
+
'spiffy-tw-flex-col': true,
|
|
60
|
+
'spiffy-tw-h-full': true,
|
|
61
|
+
'spiffy-tw-w-full': true,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const headerClassNames = classNames({
|
|
65
|
+
'spiffy-tw-sticky': true,
|
|
66
|
+
'spiffy-tw-top-0': true,
|
|
67
|
+
'spiffy-tw-flex': true,
|
|
68
|
+
'spiffy-tw-flex-col': true,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const { footerContent, footerClassName } = footerProps || {};
|
|
72
|
+
|
|
73
|
+
const footerClassNames = classNames(
|
|
74
|
+
{
|
|
75
|
+
'spiffy-tw-sticky': true,
|
|
76
|
+
'spiffy-tw-bottom-0': true,
|
|
77
|
+
'spiffy-modal-sheet-footer': true,
|
|
78
|
+
'spiffy-tw-flex': true,
|
|
79
|
+
'spiffy-tw-flex-col': true,
|
|
80
|
+
},
|
|
81
|
+
footerClassName,
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<div>
|
|
86
|
+
<motion.div
|
|
87
|
+
className={overlayClassNames}
|
|
88
|
+
initial={{ opacity: 0, display: 'none' }}
|
|
89
|
+
animate={{ opacity: overlayOpacity, display: isHidden }}
|
|
90
|
+
onClick={closeModal}
|
|
91
|
+
>
|
|
92
|
+
<motion.div
|
|
93
|
+
role="dialog"
|
|
94
|
+
className={modalClassNames}
|
|
95
|
+
initial={{ right, display: isHidden }}
|
|
96
|
+
animate={{ right, display: isHidden }}
|
|
97
|
+
exit={{ right, display: isHidden }}
|
|
98
|
+
transition={{ duration: animationDuration, ease: 'easeIn' }}
|
|
99
|
+
style={{ width: desktopWidth }}
|
|
100
|
+
onClick={(e) => e.stopPropagation()}
|
|
101
|
+
>
|
|
102
|
+
<div className={contentClassNames}>
|
|
103
|
+
<div className={headerClassNames}>
|
|
104
|
+
<ModalSheetDesktopHeader
|
|
105
|
+
headerContent={headerProps.headerContent}
|
|
106
|
+
headerVariant={headerProps?.headerVariant}
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
{children}
|
|
110
|
+
{/* this div will grow to fill the remaining space */}
|
|
111
|
+
<div className="spiffy-tw-flex-grow" />
|
|
112
|
+
{footerContent && <div className={footerClassNames}>{footerContent}</div>}
|
|
113
|
+
</div>
|
|
114
|
+
</motion.div>
|
|
115
|
+
</motion.div>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ModalSheet';
|