@envive-ai/react-toolkit 0.1.4 → 0.1.6
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 +84 -0
- package/dist/Accordion/index.d.cts +13 -0
- package/dist/Accordion/index.d.ts +13 -0
- package/dist/Accordion/index.js +77 -0
- package/dist/ButtonBase/index.cjs +7 -0
- package/dist/ButtonBase/index.d.cts +43 -0
- package/dist/ButtonBase/index.d.ts +43 -0
- package/dist/ButtonBase/index.js +6 -0
- package/dist/{ButtonBase-C1rsL9gO.js → ButtonBase-BIAu5fIG.js} +5 -5
- package/dist/ButtonBase-BRfuPPzN.js +1 -0
- package/dist/ButtonBase-BleAVeo-.cjs +0 -0
- package/dist/{ButtonBase-a8uj6c2f.cjs → ButtonBase-DcyxOe2v.cjs} +11 -5
- package/dist/{AppliedFiltersScrollbar-BlcyhZkZ.cjs → DynamicFiltersScrollbar-BTopFhyl.cjs} +34 -2
- package/dist/{AppliedFiltersScrollbar-DFGzRemu.js → DynamicFiltersScrollbar-BmPTqym5.js} +29 -3
- package/dist/FilterScrollbar/index.cjs +6 -0
- package/dist/FilterScrollbar/index.d.cts +47 -0
- package/dist/FilterScrollbar/index.d.ts +47 -0
- package/dist/FilterScrollbar/index.js +5 -0
- package/dist/Headline/index.cjs +4 -0
- package/dist/{common/Headline/Headline.d.cts → Headline/index.d.cts} +3 -3
- package/dist/{common/Headline/Headline.d.ts → Headline/index.d.ts} +3 -3
- package/dist/Headline/index.js +4 -0
- package/dist/{Headline-8on6ZB9e.js → Headline-XpaAeTSR.js} +2 -2
- package/dist/{Headline-CcWn0w-a.cjs → Headline-iP_MckEO.cjs} +2 -2
- package/dist/ImageWithFallback/index.cjs +3 -0
- package/dist/{common/ImageWithFallback/ImageWithFallback.d.ts → ImageWithFallback/index.d.cts} +3 -3
- package/dist/{common/ImageWithFallback/ImageWithFallback.d.cts → ImageWithFallback/index.d.ts} +2 -2
- package/dist/ImageWithFallback/index.js +3 -0
- package/dist/{ImageWithFallback-ioeMFrTf.cjs → ImageWithFallback-1LqhQK1q.cjs} +3 -3
- package/dist/{ImageWithFallback-gN5HDS9L.js → ImageWithFallback-Ckwsmd8P.js} +2 -2
- package/dist/ProductCard/index.cjs +17 -0
- package/dist/ProductCard/index.d.cts +3 -0
- package/dist/ProductCard/index.d.ts +3 -0
- package/dist/ProductCard/index.js +8 -0
- package/dist/{ProductCard-C7WUShhN.cjs → ProductCard-DZZKutY-.cjs} +138 -12
- package/dist/{ProductCard-B5wnOeR9.js → ProductCard-SF8-lXlT.js} +92 -9
- package/dist/ProductGrid/index.cjs +10 -0
- package/dist/ProductGrid/index.d.cts +36 -0
- package/dist/ProductGrid/index.d.ts +36 -0
- package/dist/ProductGrid/index.js +9 -0
- package/dist/{ProductGrid-DZgwGPSQ.cjs → ProductGrid-BSSmPr7K.cjs} +56 -30
- package/dist/{ProductGrid-wnSc9bXT.js → ProductGrid-DTUhH219.js} +50 -30
- package/dist/SearchAutocomplete/index.cjs +3 -0
- package/dist/{search/SearchInputAutocomplete/SearchAutocomplete.d.cts → SearchAutocomplete/index.d.cts} +1 -1
- package/dist/{search/SearchInputAutocomplete/SearchAutocomplete.d.ts → SearchAutocomplete/index.d.ts} +1 -1
- package/dist/SearchAutocomplete/index.js +3 -0
- package/dist/{SearchAutocomplete-B8mO03Rr.js → SearchAutocomplete-BPjlo6qq.js} +4 -4
- package/dist/{SearchAutocomplete-BrF2SMoZ.cjs → SearchAutocomplete-BzaEXmRQ.cjs} +8 -8
- package/dist/SearchFilter/index.cjs +8 -0
- package/dist/SearchFilter/index.d.cts +2 -0
- package/dist/SearchFilter/index.d.ts +2 -0
- package/dist/SearchFilter/index.js +6 -0
- package/dist/SearchFilter-B15tybnV.cjs +134 -0
- package/dist/SearchFilter-D427M2UE.js +114 -0
- package/dist/SearchInput/index.cjs +7 -0
- package/dist/SearchInput/index.d.cts +33 -0
- package/dist/SearchInput/index.d.ts +33 -0
- package/dist/SearchInput/index.js +6 -0
- package/dist/{SearchInput-CzVUsUSb.js → SearchInput-C0wB4hSV.js} +8 -8
- package/dist/{SearchInput-mLPisqFO.cjs → SearchInput-D6UW79wT.cjs} +12 -12
- package/dist/{search/SearchInputForm/SearchInputForm.cjs → SearchInputForm/index.cjs} +9 -8
- package/dist/SearchInputForm/index.d.cts +2 -0
- package/dist/SearchInputForm/index.d.ts +2 -0
- package/dist/{search/SearchInputForm/SearchInputForm.js → SearchInputForm/index.js} +8 -7
- package/dist/{search/SearchResultsFilterSidebar/SearchResultsFilter.cjs → SearchResultsFilterSidebar/index.cjs} +15 -12
- package/dist/SearchResultsFilterSidebar/index.d.cts +3 -0
- package/dist/SearchResultsFilterSidebar/index.d.ts +3 -0
- package/dist/{search/SearchResultsFilterSidebar/SearchResultsFilter.js → SearchResultsFilterSidebar/index.js} +11 -10
- package/dist/SearchResultsStates/index.cjs +126 -0
- package/dist/SearchResultsStates/index.d.cts +73 -0
- package/dist/SearchResultsStates/index.d.ts +73 -0
- package/dist/SearchResultsStates/index.js +118 -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-Qs17S1rn.js → SparkleAnimation-BdOjC8l-.js} +5 -5
- package/dist/{SparkleAnimation-Ba5G4MIQ.cjs → SparkleAnimation-BhyeL26m.cjs} +12 -6
- 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-BZ-kTOpm.js → Spinner-BgGihEfJ.js} +1 -1
- package/dist/{Spinner-CfQ85Ajl.cjs → Spinner-DzdIkS6t.cjs} +1 -1
- package/dist/{common/SuggestionButton/SuggestionButton.cjs → SuggestionButton/index.cjs} +5 -5
- package/dist/{common/SuggestionButton/SuggestionButton.d.cts → SuggestionButton/index.d.cts} +6 -6
- package/dist/{common/SuggestionButton/SuggestionButton.d.ts → SuggestionButton/index.d.ts} +6 -6
- package/dist/{common/SuggestionButton/SuggestionButton.js → SuggestionButton/index.js} +4 -4
- package/dist/Text/index.cjs +10 -0
- package/dist/Text/index.d.cts +42 -0
- package/dist/Text/index.d.ts +42 -0
- package/dist/Text/index.js +5 -0
- package/dist/{Text-Bdv7F5-u.js → Text-BMg3d10t.js} +2 -2
- package/dist/Text-CV9pv8ds.js +10 -0
- package/dist/{Text-C04c4Z93.cjs → Text-CgOYTs8D.cjs} +2 -2
- package/dist/Text-DDT3sqY1.cjs +16 -0
- package/dist/TextInput/index.cjs +4 -0
- package/dist/TextInput/index.d.cts +12 -0
- package/dist/TextInput/index.d.ts +12 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/{TextInput-BO80ixsV.cjs → TextInput-C6fF9cSB.cjs} +4 -4
- package/dist/{TextInput-CEGWfdPC.js → TextInput-CRMqBW3X.js} +3 -3
- package/dist/{colorsConfig-BKBZfFq1.js → colorsConfig-BQlaCfxi.js} +1 -1
- package/dist/{colorsConfig-vunsVTFC.cjs → colorsConfig-DCvy_dV4.cjs} +1 -1
- package/dist/index-B0oln9VD.d.ts +58 -0
- package/dist/index-B125udRj.d.cts +78 -0
- package/dist/{search/SearchInputForm/SearchInputForm.d.cts → index-BHNzU-Pc.d.ts} +10 -6
- package/dist/{search/SearchInputForm/SearchInputForm.d.ts → index-BNCrvswP.d.cts} +10 -6
- package/dist/index-CQlBDGTL.d.cts +58 -0
- package/dist/index-CcnuEYQN.d.ts +379 -0
- package/dist/index-DMXTg_9L.d.ts +78 -0
- package/dist/index-wYn2mEDm.d.cts +379 -0
- package/dist/{searchFilterSidebarVariants-eoyfoWA8.js → searchFilterSidebarVariants-BWQyiKwS.js} +2 -2
- package/dist/{searchFilterSidebarVariants-L1rn5Ift.cjs → searchFilterSidebarVariants-D08jyA7U.cjs} +2 -2
- package/dist/{textVariantClasses-Bhf4VY5z.cjs → textVariantClasses-BnV4wXaw.cjs} +1 -1
- package/dist/textVariantClasses-C8OCWZAw.d.ts +174 -0
- package/dist/textVariantClasses-Cdg-UUHi.d.cts +174 -0
- package/dist/{textVariantClasses-5t3OricK.js → textVariantClasses-CnjwO2Fv.js} +1 -1
- package/dist/types-BQYpWDJ4.d.cts +6 -0
- package/dist/types-BruEHw-X.d.ts +6 -0
- package/package.json +62 -84
- package/src/components/Accordion/Accordion.tsx +90 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +70 -0
- package/src/components/ButtonBase/index.ts +2 -0
- package/src/components/{common/ButtonBase → ButtonBase}/types.ts +1 -1
- package/src/components/{search/FilterScrollbar → DynamicFiltersScrollbar}/DynamicFiltersScrollbar.tsx +1 -1
- package/src/components/{search/FilterScrollbar → FilterScrollbar}/AppliedFiltersScrollbar.tsx +1 -1
- package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +52 -0
- package/src/components/FilterScrollbar/index.ts +2 -0
- package/src/components/Headline/index.ts +1 -0
- package/src/components/ImageWithFallback/index.ts +1 -0
- package/src/components/{common/ProductCard → ProductCard}/ProductCard.tsx +34 -17
- package/src/components/ProductCard/index.ts +4 -0
- package/src/components/{common/ProductCard → ProductCard}/types.ts +1 -1
- package/src/components/ProductGrid/ProductGrid.tsx +73 -0
- package/src/components/ProductGrid/index.ts +2 -0
- package/src/components/{search/SearchInputAutocomplete → SearchAutocomplete}/SearchAutocomplete.tsx +1 -1
- package/src/components/SearchAutocomplete/index.ts +1 -0
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilter.tsx +2 -2
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilterHeader.tsx +1 -1
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilterItem.tsx +1 -1
- package/src/components/SearchFilter/index.ts +4 -0
- package/src/components/{search/SearchInput → SearchInput}/SearchInput.tsx +6 -6
- package/src/components/SearchInput/index.ts +2 -0
- package/src/components/{search/SearchInput → SearchInput}/searchInputVariants.ts +5 -5
- package/src/components/{search/SearchInputForm → SearchInputForm}/SearchInputForm.tsx +6 -4
- package/src/components/SearchInputForm/index.ts +2 -0
- package/src/components/SearchResultsContent/SearchResultsContent.tsx +87 -0
- package/src/components/SearchResultsContent/utils.ts +28 -0
- package/src/components/{search/SearchResultsFilterSidebar → SearchResultsFilterSidebar}/SearchResultsFilter.tsx +5 -6
- package/src/components/SearchResultsFilterSidebar/index.ts +3 -0
- package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +58 -0
- package/src/components/SearchResultsFilterSidebar/types.ts +15 -0
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/NoSearchResultsFound.tsx +2 -2
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/SearchResultsGrid.tsx +14 -12
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/SearchResultsLoadingGrid.tsx +4 -5
- package/src/components/SearchResultsStates/index.ts +3 -0
- package/src/components/SparkleAnimation/index.ts +2 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/SuggestionButton/index.ts +2 -0
- package/src/components/Text/index.ts +3 -0
- package/src/components/TextInput/index.ts +1 -0
- package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +0 -41
- package/dist/DynamicFiltersScrollbar-Dys6geP0.js +0 -32
- package/dist/ProductCardSkeleton-BPfp6IOp.js +0 -38
- package/dist/ProductCardSkeleton-BgvDlaty.cjs +0 -46
- package/dist/SearchFilter-D-2IdBKS.js +0 -62
- package/dist/SearchFilter-D0IzBlG5.cjs +0 -70
- package/dist/SearchFilterHeader-BQT0-ssS.js +0 -37
- package/dist/SearchFilterHeader-C3EklfoO.cjs +0 -45
- package/dist/SearchFilterItem-BodtWLoP.js +0 -26
- package/dist/SearchFilterItem-DmMkiqNC.cjs +0 -34
- package/dist/common/ButtonBase/ButtonBase.cjs +0 -5
- package/dist/common/ButtonBase/ButtonBase.d.cts +0 -35
- package/dist/common/ButtonBase/ButtonBase.d.ts +0 -35
- package/dist/common/ButtonBase/ButtonBase.js +0 -5
- package/dist/common/Headline/Headline.cjs +0 -4
- package/dist/common/Headline/Headline.js +0 -4
- package/dist/common/ImageWithFallback/ImageWithFallback.cjs +0 -3
- package/dist/common/ImageWithFallback/ImageWithFallback.js +0 -3
- package/dist/common/ProductCard/ProductCard.cjs +0 -11
- package/dist/common/ProductCard/ProductCard.d.cts +0 -91
- package/dist/common/ProductCard/ProductCard.d.ts +0 -91
- package/dist/common/ProductCard/ProductCard.js +0 -9
- package/dist/common/ProductCard/ProductCardSkeleton.cjs +0 -4
- package/dist/common/ProductCard/ProductCardSkeleton.d.cts +0 -12
- package/dist/common/ProductCard/ProductCardSkeleton.d.ts +0 -12
- package/dist/common/ProductCard/ProductCardSkeleton.js +0 -4
- package/dist/common/ProductGrid/ProductGrid.cjs +0 -11
- package/dist/common/ProductGrid/ProductGrid.d.cts +0 -26
- package/dist/common/ProductGrid/ProductGrid.d.ts +0 -26
- package/dist/common/ProductGrid/ProductGrid.js +0 -11
- package/dist/common/SparkleAnimation/SparkleAnimation.cjs +0 -3
- package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +0 -15
- package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +0 -15
- package/dist/common/SparkleAnimation/SparkleAnimation.js +0 -3
- package/dist/common/Spinner/Spinner.cjs +0 -3
- package/dist/common/Spinner/Spinner.d.cts +0 -11
- package/dist/common/Spinner/Spinner.d.ts +0 -11
- package/dist/common/Spinner/Spinner.js +0 -3
- package/dist/common/Text/Text.cjs +0 -4
- package/dist/common/Text/Text.d.cts +0 -28
- package/dist/common/Text/Text.d.ts +0 -28
- package/dist/common/Text/Text.js +0 -4
- package/dist/common/TextInput/TextInput.cjs +0 -4
- package/dist/common/TextInput/TextInput.d.cts +0 -98
- package/dist/common/TextInput/TextInput.d.ts +0 -98
- package/dist/common/TextInput/TextInput.js +0 -4
- package/dist/productCardVariants-C_QIZ-KF.js +0 -45
- package/dist/productCardVariants-Dd-wrJKP.cjs +0 -69
- package/dist/productGridVariants-BNX4YlRK.js +0 -20
- package/dist/productGridVariants-CsNV0ACt.cjs +0 -26
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +0 -5
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +0 -22
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -22
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -5
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +0 -5
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +0 -28
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -28
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -5
- package/dist/search/SearchFilter/SearchFilter.cjs +0 -7
- package/dist/search/SearchFilter/SearchFilter.d.cts +0 -18
- package/dist/search/SearchFilter/SearchFilter.d.ts +0 -18
- package/dist/search/SearchFilter/SearchFilter.js +0 -7
- package/dist/search/SearchFilter/SearchFilterHeader.cjs +0 -5
- package/dist/search/SearchFilter/SearchFilterHeader.d.cts +0 -12
- package/dist/search/SearchFilter/SearchFilterHeader.d.ts +0 -12
- package/dist/search/SearchFilter/SearchFilterHeader.js +0 -5
- package/dist/search/SearchFilter/SearchFilterItem.cjs +0 -5
- package/dist/search/SearchFilter/SearchFilterItem.d.cts +0 -13
- package/dist/search/SearchFilter/SearchFilterItem.d.ts +0 -13
- package/dist/search/SearchFilter/SearchFilterItem.js +0 -5
- package/dist/search/SearchInput/SearchInput.cjs +0 -6
- package/dist/search/SearchInput/SearchInput.d.cts +0 -20
- package/dist/search/SearchInput/SearchInput.d.ts +0 -20
- package/dist/search/SearchInput/SearchInput.js +0 -6
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +0 -3
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -3
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +0 -28
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -28
- package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +0 -30
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +0 -17
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -17
- package/dist/search/SearchResultsStates/NoSearchResultsFound.js +0 -26
- package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +0 -66
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +0 -41
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -41
- package/dist/search/SearchResultsStates/SearchResultsGrid.js +0 -62
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +0 -52
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +0 -15
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -15
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -49
- package/dist/types-53zIialA.d.ts +0 -35
- package/dist/types-B4BGZSlV.d.cts +0 -4
- package/dist/types-BQNqA5xL.d.ts +0 -46
- package/dist/types-BRLWwGMI.d.ts +0 -4
- package/dist/types-CImLkcNh.d.cts +0 -46
- package/dist/types-Cph97xkm.d.ts +0 -6
- package/dist/types-CpiJO5UH.d.ts +0 -4
- package/dist/types-Dy4_w6Cf.d.cts +0 -4
- package/dist/types-TYhhwWZw.d.cts +0 -6
- package/dist/types-aa4flfRE.d.cts +0 -35
- package/src/components/common/ProductGrid/ProductGrid.tsx +0 -73
- package/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +0 -45
- package/src/components/search/SearchResultsFilterSidebar/types.ts +0 -2
- package/src/components/search/types.ts +0 -5
- package/src/types/external.ts +0 -24
- /package/dist/{types-DFetqNL2.d.ts → types-Bm-qQyO3.d.ts} +0 -0
- /package/dist/{types-DaSkJnT_.d.cts → types-C-Jrlw5Z.d.cts} +0 -0
- /package/src/components/{common/ButtonBase → ButtonBase}/ButtonBase.tsx +0 -0
- /package/src/components/{common/Headline → Headline}/Headline.tsx +0 -0
- /package/src/components/{common/ImageWithFallback → ImageWithFallback}/ImageWithFallback.tsx +0 -0
- /package/src/components/{common/ProductCard → ProductCard}/ProductCardSkeleton.tsx +0 -0
- /package/src/components/{common/ProductCard → ProductCard}/productCardVariants.ts +0 -0
- /package/src/components/{common/ProductGrid → ProductGrid}/productGridVariants.ts +0 -0
- /package/src/components/{search/SearchFilter → SearchFilter}/types.ts +0 -0
- /package/src/components/{search/SearchInputForm → SearchInputForm}/types.ts +0 -0
- /package/src/components/{common/SparkleAnimation → SparkleAnimation}/SparkleAnimation.tsx +0 -0
- /package/src/components/{common/SparkleAnimation → SparkleAnimation}/types.ts +0 -0
- /package/src/components/{common/Spinner → Spinner}/Spinner.tsx +0 -0
- /package/src/components/{common/SuggestionButton → SuggestionButton}/SuggestionButton.tsx +0 -0
- /package/src/components/{common/SuggestionButton → SuggestionButton}/types.ts +0 -0
- /package/src/components/{common/Text → Text}/Text.tsx +0 -0
- /package/src/components/{common/Text → Text}/textVariantClasses.ts +0 -0
- /package/src/components/{common/Text → Text}/types.ts +0 -0
- /package/src/components/{common/TextInput → TextInput}/TextInput.tsx +0 -0
- /package/src/{components/models → models}/colorsConfig.ts +0 -0
- /package/src/{components/test → test}/types.ts +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
//#region src/components/Text/textVariantClasses.d.ts
|
|
2
|
+
declare const HeadlineVariantMap: {
|
|
3
|
+
t1: {
|
|
4
|
+
'spiffy-headline': boolean;
|
|
5
|
+
'spiffy-headline-1': boolean;
|
|
6
|
+
'spiffy-tw-text-[32px]': boolean;
|
|
7
|
+
'spiffy-tw-font-medium': boolean;
|
|
8
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
9
|
+
};
|
|
10
|
+
t2: {
|
|
11
|
+
'spiffy-headline': boolean;
|
|
12
|
+
'spiffy-headline-1': boolean;
|
|
13
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
14
|
+
'spiffy-tw-font-medium': boolean;
|
|
15
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
16
|
+
};
|
|
17
|
+
t3: {
|
|
18
|
+
'spiffy-headline': boolean;
|
|
19
|
+
'spiffy-headline-1': boolean;
|
|
20
|
+
'spiffy-tw-text-[24px]': boolean;
|
|
21
|
+
'spiffy-tw-leading-[120%]': boolean;
|
|
22
|
+
};
|
|
23
|
+
h1: {
|
|
24
|
+
'spiffy-headline': boolean;
|
|
25
|
+
'spiffy-headline-1': boolean;
|
|
26
|
+
'spiffy-tw-text-[20px]': boolean;
|
|
27
|
+
'spiffy-tw-font-normal': boolean;
|
|
28
|
+
'spiffy-tw-leading-[120%]': boolean;
|
|
29
|
+
};
|
|
30
|
+
h2: {
|
|
31
|
+
'spiffy-headline': boolean;
|
|
32
|
+
'spiffy-headline-2': boolean;
|
|
33
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
34
|
+
'spiffy-tw-font-normal': boolean;
|
|
35
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
36
|
+
};
|
|
37
|
+
h3: {
|
|
38
|
+
'spiffy-headline': boolean;
|
|
39
|
+
'spiffy-headline-3': boolean;
|
|
40
|
+
'spiffy-tw-text-[15px]': boolean;
|
|
41
|
+
'spiffy-tw-font-medium': boolean;
|
|
42
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
43
|
+
};
|
|
44
|
+
h4: {
|
|
45
|
+
'spiffy-headline': boolean;
|
|
46
|
+
'spiffy-headline-4': boolean;
|
|
47
|
+
'spiffy-tw-text-[14px]': boolean;
|
|
48
|
+
'spiffy-tw-font-medium': boolean;
|
|
49
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
declare const TextVariantMap: {
|
|
53
|
+
body1: {
|
|
54
|
+
'spiffy-body-text': boolean;
|
|
55
|
+
'spiffy-body-1': boolean;
|
|
56
|
+
'spiffy-tw-text-[20px]': boolean;
|
|
57
|
+
'spiffy-tw-font-normal': boolean;
|
|
58
|
+
'spiffy-tw-line-height-[120%]': boolean;
|
|
59
|
+
};
|
|
60
|
+
body2: {
|
|
61
|
+
'spiffy-body-text': boolean;
|
|
62
|
+
'spiffy-body-2': boolean;
|
|
63
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
64
|
+
'spiffy-tw-font-normal': boolean;
|
|
65
|
+
'spiffy-tw-line-height-[148%]': boolean;
|
|
66
|
+
};
|
|
67
|
+
body3: {
|
|
68
|
+
'spiffy-body-text': boolean;
|
|
69
|
+
'spiffy-body-3': boolean;
|
|
70
|
+
'spiffy-tw-text-sm': boolean;
|
|
71
|
+
'spiffy-tw-font-normal': boolean;
|
|
72
|
+
'spiffy-tw-leading-[140%]': boolean;
|
|
73
|
+
};
|
|
74
|
+
body4: {
|
|
75
|
+
'spiffy-body-text': boolean;
|
|
76
|
+
'spiffy-body-4': boolean;
|
|
77
|
+
'spiffy-tw-text-xs': boolean;
|
|
78
|
+
'spiffy-tw-font-medium': boolean;
|
|
79
|
+
'spiffy-tw-leading-[130%]': boolean;
|
|
80
|
+
};
|
|
81
|
+
body5: {
|
|
82
|
+
'spiffy-body-text': boolean;
|
|
83
|
+
'spiffy-body-5': boolean;
|
|
84
|
+
'spiffy-tw-text-[10px]': boolean;
|
|
85
|
+
'spiffy-tw-font-normal': boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
declare const TextStyleVariantMap: {
|
|
89
|
+
t1: {
|
|
90
|
+
'spiffy-headline': boolean;
|
|
91
|
+
'spiffy-headline-1': boolean;
|
|
92
|
+
'spiffy-tw-text-[32px]': boolean;
|
|
93
|
+
'spiffy-tw-font-medium': boolean;
|
|
94
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
95
|
+
};
|
|
96
|
+
t2: {
|
|
97
|
+
'spiffy-headline': boolean;
|
|
98
|
+
'spiffy-headline-1': boolean;
|
|
99
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
100
|
+
'spiffy-tw-font-medium': boolean;
|
|
101
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
102
|
+
};
|
|
103
|
+
t3: {
|
|
104
|
+
'spiffy-headline': boolean;
|
|
105
|
+
'spiffy-headline-1': boolean;
|
|
106
|
+
'spiffy-tw-text-[24px]': boolean;
|
|
107
|
+
'spiffy-tw-leading-[120%]': boolean;
|
|
108
|
+
};
|
|
109
|
+
h1: {
|
|
110
|
+
'spiffy-headline': boolean;
|
|
111
|
+
'spiffy-headline-1': boolean;
|
|
112
|
+
'spiffy-tw-text-[20px]': boolean;
|
|
113
|
+
'spiffy-tw-font-normal': boolean;
|
|
114
|
+
'spiffy-tw-leading-[120%]': boolean;
|
|
115
|
+
};
|
|
116
|
+
h2: {
|
|
117
|
+
'spiffy-headline': boolean;
|
|
118
|
+
'spiffy-headline-2': boolean;
|
|
119
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
120
|
+
'spiffy-tw-font-normal': boolean;
|
|
121
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
122
|
+
};
|
|
123
|
+
h3: {
|
|
124
|
+
'spiffy-headline': boolean;
|
|
125
|
+
'spiffy-headline-3': boolean;
|
|
126
|
+
'spiffy-tw-text-[15px]': boolean;
|
|
127
|
+
'spiffy-tw-font-medium': boolean;
|
|
128
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
129
|
+
};
|
|
130
|
+
h4: {
|
|
131
|
+
'spiffy-headline': boolean;
|
|
132
|
+
'spiffy-headline-4': boolean;
|
|
133
|
+
'spiffy-tw-text-[14px]': boolean;
|
|
134
|
+
'spiffy-tw-font-medium': boolean;
|
|
135
|
+
'spiffy-tw-leading-[124%]': boolean;
|
|
136
|
+
};
|
|
137
|
+
body1: {
|
|
138
|
+
'spiffy-body-text': boolean;
|
|
139
|
+
'spiffy-body-1': boolean;
|
|
140
|
+
'spiffy-tw-text-[20px]': boolean;
|
|
141
|
+
'spiffy-tw-font-normal': boolean;
|
|
142
|
+
'spiffy-tw-line-height-[120%]': boolean;
|
|
143
|
+
};
|
|
144
|
+
body2: {
|
|
145
|
+
'spiffy-body-text': boolean;
|
|
146
|
+
'spiffy-body-2': boolean;
|
|
147
|
+
'spiffy-tw-text-[16px]': boolean;
|
|
148
|
+
'spiffy-tw-font-normal': boolean;
|
|
149
|
+
'spiffy-tw-line-height-[148%]': boolean;
|
|
150
|
+
};
|
|
151
|
+
body3: {
|
|
152
|
+
'spiffy-body-text': boolean;
|
|
153
|
+
'spiffy-body-3': boolean;
|
|
154
|
+
'spiffy-tw-text-sm': boolean;
|
|
155
|
+
'spiffy-tw-font-normal': boolean;
|
|
156
|
+
'spiffy-tw-leading-[140%]': boolean;
|
|
157
|
+
};
|
|
158
|
+
body4: {
|
|
159
|
+
'spiffy-body-text': boolean;
|
|
160
|
+
'spiffy-body-4': boolean;
|
|
161
|
+
'spiffy-tw-text-xs': boolean;
|
|
162
|
+
'spiffy-tw-font-medium': boolean;
|
|
163
|
+
'spiffy-tw-leading-[130%]': boolean;
|
|
164
|
+
};
|
|
165
|
+
body5: {
|
|
166
|
+
'spiffy-body-text': boolean;
|
|
167
|
+
'spiffy-body-5': boolean;
|
|
168
|
+
'spiffy-tw-text-[10px]': boolean;
|
|
169
|
+
'spiffy-tw-font-normal': boolean;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
declare const getVariantPlaceholderClassNames: (classes: Record<string, boolean>) => Record<string, boolean>;
|
|
173
|
+
//#endregion
|
|
174
|
+
export { HeadlineVariantMap, TextStyleVariantMap, TextVariantMap, getVariantPlaceholderClassNames };
|
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.6",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"author": "Envive AI",
|
|
12
12
|
"license": "UNLICENSED",
|
|
13
13
|
"type": "module",
|
|
14
|
-
"main": "dist/index.cjs",
|
|
15
|
-
"module": "dist/index.js",
|
|
16
|
-
"types": "dist/index.d.
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
19
|
"src",
|
|
@@ -24,116 +24,94 @@
|
|
|
24
24
|
"prepublish": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@envive-ai/react-
|
|
27
|
+
"@envive-ai/react-hooks": "^0.1.1",
|
|
28
|
+
"@envive-ai/react-icons": "0.1.1",
|
|
28
29
|
"classnames": "^2.5.1",
|
|
29
30
|
"framer-motion": "^12.23.12",
|
|
30
31
|
"react-icons": "^5.0.1",
|
|
31
|
-
"react-indiana-drag-scroll": "^3.0.3-alpha"
|
|
32
|
-
"vite-plugin-svgr": "^4.5.0"
|
|
32
|
+
"react-indiana-drag-scroll": "^3.0.3-alpha"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.3.1",
|
|
36
36
|
"react-dom": "^18.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@svgr/cli": "^8.1.0",
|
|
40
|
-
"copyfiles": "^2.4.1",
|
|
41
39
|
"tsdown": "^0.14.2",
|
|
42
40
|
"typescript": "~5.8.3"
|
|
43
41
|
},
|
|
44
42
|
"exports": {
|
|
45
|
-
"./
|
|
46
|
-
"import": "./dist/
|
|
47
|
-
"require": "./dist/
|
|
43
|
+
"./Accordion": {
|
|
44
|
+
"import": "./dist/Accordion/index.js",
|
|
45
|
+
"require": "./dist/Accordion/index.cjs"
|
|
48
46
|
},
|
|
49
|
-
"./
|
|
50
|
-
"import": "./dist/
|
|
51
|
-
"require": "./dist/
|
|
47
|
+
"./ButtonBase": {
|
|
48
|
+
"import": "./dist/ButtonBase/index.js",
|
|
49
|
+
"require": "./dist/ButtonBase/index.cjs"
|
|
52
50
|
},
|
|
53
|
-
"./
|
|
54
|
-
"import": "./dist/
|
|
55
|
-
"require": "./dist/
|
|
51
|
+
"./FilterScrollbar": {
|
|
52
|
+
"import": "./dist/FilterScrollbar/index.js",
|
|
53
|
+
"require": "./dist/FilterScrollbar/index.cjs"
|
|
56
54
|
},
|
|
57
|
-
"./
|
|
58
|
-
"import": "./dist/
|
|
59
|
-
"require": "./dist/
|
|
55
|
+
"./Headline": {
|
|
56
|
+
"import": "./dist/Headline/index.js",
|
|
57
|
+
"require": "./dist/Headline/index.cjs"
|
|
60
58
|
},
|
|
61
|
-
"./
|
|
62
|
-
"import": "./dist/
|
|
63
|
-
"require": "./dist/
|
|
59
|
+
"./ImageWithFallback": {
|
|
60
|
+
"import": "./dist/ImageWithFallback/index.js",
|
|
61
|
+
"require": "./dist/ImageWithFallback/index.cjs"
|
|
64
62
|
},
|
|
65
|
-
"./
|
|
66
|
-
"import": "./dist/
|
|
67
|
-
"require": "./dist/
|
|
63
|
+
"./ProductCard": {
|
|
64
|
+
"import": "./dist/ProductCard/index.js",
|
|
65
|
+
"require": "./dist/ProductCard/index.cjs"
|
|
68
66
|
},
|
|
69
|
-
"./
|
|
70
|
-
"import": "./dist/
|
|
71
|
-
"require": "./dist/
|
|
67
|
+
"./ProductGrid": {
|
|
68
|
+
"import": "./dist/ProductGrid/index.js",
|
|
69
|
+
"require": "./dist/ProductGrid/index.cjs"
|
|
72
70
|
},
|
|
73
|
-
"./
|
|
74
|
-
"import": "./dist/
|
|
75
|
-
"require": "./dist/
|
|
71
|
+
"./SearchAutocomplete": {
|
|
72
|
+
"import": "./dist/SearchAutocomplete/index.js",
|
|
73
|
+
"require": "./dist/SearchAutocomplete/index.cjs"
|
|
76
74
|
},
|
|
77
|
-
"./
|
|
78
|
-
"import": "./dist/
|
|
79
|
-
"require": "./dist/
|
|
75
|
+
"./SearchFilter": {
|
|
76
|
+
"import": "./dist/SearchFilter/index.js",
|
|
77
|
+
"require": "./dist/SearchFilter/index.cjs"
|
|
80
78
|
},
|
|
81
|
-
"./
|
|
82
|
-
"import": "./dist/
|
|
83
|
-
"require": "./dist/
|
|
79
|
+
"./SearchInput": {
|
|
80
|
+
"import": "./dist/SearchInput/index.js",
|
|
81
|
+
"require": "./dist/SearchInput/index.cjs"
|
|
84
82
|
},
|
|
85
|
-
"./
|
|
86
|
-
"import": "./dist/
|
|
87
|
-
"require": "./dist/
|
|
83
|
+
"./SearchInputForm": {
|
|
84
|
+
"import": "./dist/SearchInputForm/index.js",
|
|
85
|
+
"require": "./dist/SearchInputForm/index.cjs"
|
|
88
86
|
},
|
|
89
|
-
"./
|
|
90
|
-
"import": "./dist/
|
|
91
|
-
"require": "./dist/
|
|
87
|
+
"./SearchResultsFilterSidebar": {
|
|
88
|
+
"import": "./dist/SearchResultsFilterSidebar/index.js",
|
|
89
|
+
"require": "./dist/SearchResultsFilterSidebar/index.cjs"
|
|
92
90
|
},
|
|
93
|
-
"./
|
|
94
|
-
"import": "./dist/
|
|
95
|
-
"require": "./dist/
|
|
91
|
+
"./SearchResultsStates": {
|
|
92
|
+
"import": "./dist/SearchResultsStates/index.js",
|
|
93
|
+
"require": "./dist/SearchResultsStates/index.cjs"
|
|
96
94
|
},
|
|
97
|
-
"./
|
|
98
|
-
"import": "./dist/
|
|
99
|
-
"require": "./dist/
|
|
95
|
+
"./SparkleAnimation": {
|
|
96
|
+
"import": "./dist/SparkleAnimation/index.js",
|
|
97
|
+
"require": "./dist/SparkleAnimation/index.cjs"
|
|
100
98
|
},
|
|
101
|
-
"./
|
|
102
|
-
"import": "./dist/
|
|
103
|
-
"require": "./dist/
|
|
99
|
+
"./Spinner": {
|
|
100
|
+
"import": "./dist/Spinner/index.js",
|
|
101
|
+
"require": "./dist/Spinner/index.cjs"
|
|
104
102
|
},
|
|
105
|
-
"./
|
|
106
|
-
"import": "./dist/
|
|
107
|
-
"require": "./dist/
|
|
103
|
+
"./SuggestionButton": {
|
|
104
|
+
"import": "./dist/SuggestionButton/index.js",
|
|
105
|
+
"require": "./dist/SuggestionButton/index.cjs"
|
|
108
106
|
},
|
|
109
|
-
"./
|
|
110
|
-
"import": "./dist/
|
|
111
|
-
"require": "./dist/
|
|
107
|
+
"./Text": {
|
|
108
|
+
"import": "./dist/Text/index.js",
|
|
109
|
+
"require": "./dist/Text/index.cjs"
|
|
112
110
|
},
|
|
113
|
-
"./
|
|
114
|
-
"import": "./dist/
|
|
115
|
-
"require": "./dist/
|
|
111
|
+
"./TextInput": {
|
|
112
|
+
"import": "./dist/TextInput/index.js",
|
|
113
|
+
"require": "./dist/TextInput/index.cjs"
|
|
116
114
|
},
|
|
117
|
-
"./
|
|
118
|
-
"import": "./dist/search/SearchInputForm/SearchInputForm.js",
|
|
119
|
-
"require": "./dist/search/SearchInputForm/SearchInputForm.cjs"
|
|
120
|
-
},
|
|
121
|
-
"./search/SearchResultsFilterSidebar/SearchResultsFilter": {
|
|
122
|
-
"import": "./dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js",
|
|
123
|
-
"require": "./dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs"
|
|
124
|
-
},
|
|
125
|
-
"./search/SearchResultsStates/NoSearchResultsFound": {
|
|
126
|
-
"import": "./dist/search/SearchResultsStates/NoSearchResultsFound.js",
|
|
127
|
-
"require": "./dist/search/SearchResultsStates/NoSearchResultsFound.cjs"
|
|
128
|
-
},
|
|
129
|
-
"./search/SearchResultsStates/SearchResultsGrid": {
|
|
130
|
-
"import": "./dist/search/SearchResultsStates/SearchResultsGrid.js",
|
|
131
|
-
"require": "./dist/search/SearchResultsStates/SearchResultsGrid.cjs"
|
|
132
|
-
},
|
|
133
|
-
"./search/SearchResultsStates/SearchResultsLoadingGrid": {
|
|
134
|
-
"import": "./dist/search/SearchResultsStates/SearchResultsLoadingGrid.js",
|
|
135
|
-
"require": "./dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs"
|
|
136
|
-
},
|
|
137
|
-
"./*": "./*"
|
|
115
|
+
"./package.json": "./package.json"
|
|
138
116
|
}
|
|
139
117
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Text } from '@envive-ai/react-toolkit/Text';
|
|
5
|
+
import ChevronDown from '@envive-ai/react-icons/ChevronDown';
|
|
6
|
+
|
|
7
|
+
interface AccordionProps {
|
|
8
|
+
title: string;
|
|
9
|
+
content: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ANIMATION_DURATION = 0.3;
|
|
13
|
+
|
|
14
|
+
export const Accordion = ({ title, content }: AccordionProps) => {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
|
|
17
|
+
const contentRef = useRef<HTMLDivElement>(null);
|
|
18
|
+
|
|
19
|
+
const titleWrapperClasses = classNames({
|
|
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
|
+
|
|
30
|
+
const titleClasses = classNames({
|
|
31
|
+
'spiffy-tw-uppercase': true,
|
|
32
|
+
'spiffy-tw-text-[--spiffy-colors-text-primary]': true,
|
|
33
|
+
'!spiffy-tw-font-[400]': true,
|
|
34
|
+
'group-aria-expanded:!spiffy-tw-font-medium': true,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const contentClasses = classNames({
|
|
38
|
+
'spiffy-tw-overflow-hidden': true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
<button
|
|
44
|
+
aria-expanded={isOpen}
|
|
45
|
+
type="button"
|
|
46
|
+
className={titleWrapperClasses}
|
|
47
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
48
|
+
>
|
|
49
|
+
<Text variant="body4" className={titleClasses}>
|
|
50
|
+
{title}
|
|
51
|
+
</Text>
|
|
52
|
+
<motion.div
|
|
53
|
+
variants={{
|
|
54
|
+
open: {
|
|
55
|
+
rotate: 180,
|
|
56
|
+
},
|
|
57
|
+
closed: {
|
|
58
|
+
rotate: 360,
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
animate={isOpen ? 'open' : 'closed'}
|
|
62
|
+
transition={{ duration: ANIMATION_DURATION, ease: 'easeOut' }}
|
|
63
|
+
>
|
|
64
|
+
<ChevronDown />
|
|
65
|
+
</motion.div>
|
|
66
|
+
</button>
|
|
67
|
+
<motion.div
|
|
68
|
+
variants={{
|
|
69
|
+
open: {
|
|
70
|
+
height: 'auto',
|
|
71
|
+
marginTop: '24px',
|
|
72
|
+
marginBottom: '24px',
|
|
73
|
+
},
|
|
74
|
+
closed: {
|
|
75
|
+
height: '0px',
|
|
76
|
+
marginTop: '0px',
|
|
77
|
+
marginBottom: '0px',
|
|
78
|
+
},
|
|
79
|
+
}}
|
|
80
|
+
className={contentClasses}
|
|
81
|
+
initial={{ height: 0 }}
|
|
82
|
+
animate={isOpen ? 'open' : 'closed'}
|
|
83
|
+
transition={{ duration: ANIMATION_DURATION, ease: 'easeOut' }}
|
|
84
|
+
ref={contentRef}
|
|
85
|
+
>
|
|
86
|
+
{content}
|
|
87
|
+
</motion.div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Accordion';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import ScrollContainer from 'react-indiana-drag-scroll';
|
|
3
|
+
import { SelectedFilterOption } from 'src/atoms/search/types';
|
|
4
|
+
import { Text } from '@envive-ai/react-toolkit/Text';
|
|
5
|
+
|
|
6
|
+
interface AppliedFiltersScrollbarProps {
|
|
7
|
+
selectedFilterOptions: SelectedFilterOption[];
|
|
8
|
+
filterBarClassNames: string;
|
|
9
|
+
filterDefaultClasses: string;
|
|
10
|
+
filterHoverClasses: string;
|
|
11
|
+
appliedFilterBackgroundClasses: string;
|
|
12
|
+
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const AppliedFiltersScrollbar = ({
|
|
16
|
+
selectedFilterOptions,
|
|
17
|
+
filterBarClassNames,
|
|
18
|
+
filterDefaultClasses,
|
|
19
|
+
filterHoverClasses,
|
|
20
|
+
appliedFilterBackgroundClasses,
|
|
21
|
+
onRemoveFilter,
|
|
22
|
+
}: AppliedFiltersScrollbarProps) => {
|
|
23
|
+
if (selectedFilterOptions.length === 0) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Extract border and text classes from filterDefaultClasses, excluding background because everything is shared between filters except for the applied filters background
|
|
28
|
+
const filterDefaultWithoutBg = filterDefaultClasses
|
|
29
|
+
.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, '')
|
|
30
|
+
.trim();
|
|
31
|
+
const buttonClasses = classNames(
|
|
32
|
+
' spiffy-tw-flex spiffy-tw-items-center spiffy-tw-rounded-full spiffy-tw-px-[8px] spiffy-tw-py-[4px] spiffy-tw-whitespace-nowrap',
|
|
33
|
+
filterHoverClasses,
|
|
34
|
+
filterDefaultWithoutBg,
|
|
35
|
+
appliedFilterBackgroundClasses,
|
|
36
|
+
);
|
|
37
|
+
const iconColor = 'currentColor'; // match with text color
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<ScrollContainer className={filterBarClassNames} hideScrollbars>
|
|
41
|
+
{selectedFilterOptions.map((filter) => {
|
|
42
|
+
return (
|
|
43
|
+
<button
|
|
44
|
+
key={filter.id}
|
|
45
|
+
className={buttonClasses}
|
|
46
|
+
type="button"
|
|
47
|
+
onClick={() => onRemoveFilter(filter)}
|
|
48
|
+
aria-label={`Remove filter: ${filter.displayName}`}
|
|
49
|
+
>
|
|
50
|
+
<div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]">
|
|
51
|
+
<Text variant="body3">{filter.displayName}</Text>
|
|
52
|
+
<svg
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
width="10"
|
|
55
|
+
height="10"
|
|
56
|
+
viewBox="0 0 10 10"
|
|
57
|
+
fill="none"
|
|
58
|
+
>
|
|
59
|
+
<path
|
|
60
|
+
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"
|
|
61
|
+
fill={iconColor}
|
|
62
|
+
/>
|
|
63
|
+
</svg>
|
|
64
|
+
</div>
|
|
65
|
+
</button>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
</ScrollContainer>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import ScrollContainer from 'react-indiana-drag-scroll';
|
|
3
|
-
import { Text } from '
|
|
3
|
+
import { Text } from '@envive-ai/react-toolkit/Text';
|
|
4
4
|
|
|
5
5
|
interface DynamicFiltersScrollbarProps {
|
|
6
6
|
availableDynamicFilters: { name: string; displayName: string }[];
|
package/src/components/{search/FilterScrollbar → FilterScrollbar}/AppliedFiltersScrollbar.tsx
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import ScrollContainer from 'react-indiana-drag-scroll';
|
|
3
|
-
import { Text } from 'src/components/
|
|
3
|
+
import { Text } from 'src/components/Text/Text';
|
|
4
4
|
import type { SelectedFilterOption } from 'src/atoms/search/types';
|
|
5
5
|
|
|
6
6
|
interface AppliedFiltersScrollbarProps {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import ScrollContainer from 'react-indiana-drag-scroll';
|
|
3
|
+
import { Text } from 'src/components/Text/Text';
|
|
4
|
+
|
|
5
|
+
interface DynamicFiltersScrollbarProps {
|
|
6
|
+
availableDynamicFilters: { name: string; displayName: string }[];
|
|
7
|
+
filterBarClassNames: string;
|
|
8
|
+
filterDefaultClasses: string;
|
|
9
|
+
filterHoverClasses: string;
|
|
10
|
+
onToggleDynamicFilter: ({
|
|
11
|
+
filter,
|
|
12
|
+
dynamicFilterDisplayName,
|
|
13
|
+
}: {
|
|
14
|
+
filter: string;
|
|
15
|
+
dynamicFilterDisplayName: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const DynamicFiltersScrollbar = ({
|
|
20
|
+
availableDynamicFilters,
|
|
21
|
+
filterBarClassNames,
|
|
22
|
+
filterDefaultClasses,
|
|
23
|
+
filterHoverClasses,
|
|
24
|
+
onToggleDynamicFilter,
|
|
25
|
+
}: DynamicFiltersScrollbarProps) => {
|
|
26
|
+
return (
|
|
27
|
+
<ScrollContainer className={filterBarClassNames} hideScrollbars>
|
|
28
|
+
{availableDynamicFilters.map(({ name, displayName }) => {
|
|
29
|
+
const buttonClasses = classNames(
|
|
30
|
+
'spiffy-tw-px-[12px] spiffy-tw-py-2 spiffy-tw-rounded-full spiffy-tw-border spiffy-tw-whitespace-nowrap ',
|
|
31
|
+
filterHoverClasses,
|
|
32
|
+
filterDefaultClasses,
|
|
33
|
+
);
|
|
34
|
+
return (
|
|
35
|
+
<button
|
|
36
|
+
key={name}
|
|
37
|
+
type="button"
|
|
38
|
+
className={buttonClasses}
|
|
39
|
+
onClick={() => {
|
|
40
|
+
onToggleDynamicFilter({
|
|
41
|
+
filter: name,
|
|
42
|
+
dynamicFilterDisplayName: displayName,
|
|
43
|
+
});
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<Text variant="body3">{displayName}</Text>
|
|
47
|
+
</button>
|
|
48
|
+
);
|
|
49
|
+
})}
|
|
50
|
+
</ScrollContainer>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Headline';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ImageWithFallback';
|