@envive-ai/react-toolkit 0.2.13 → 0.2.14
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/{chunk-CbDLau6x.cjs → _virtual/rolldown_runtime.cjs} +1 -6
- package/dist/{types--eyQnaEA.d.cts → atoms/search/types.d.cts} +1 -1
- package/dist/{types-CQpdBL3M.d.ts → atoms/search/types.d.ts} +1 -1
- package/dist/{Accordion-Bc3o-NjV.cjs → components/Accordion/Accordion.cjs} +6 -10
- package/dist/components/Accordion/{index-DJOd-3Pi.d.ts → Accordion.d.cts} +2 -2
- package/dist/components/Accordion/{index-D_7-KJa0.d.cts → Accordion.d.ts} +2 -2
- package/dist/{Accordion-D8Vm8J1y.js → components/Accordion/Accordion.js} +3 -2
- package/dist/components/Accordion/index.cjs +1 -2
- package/dist/components/Accordion/index.d.cts +2 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/index.js +1 -2
- package/dist/{AnimatedChevron-BKQrUKb5.cjs → components/AnimatedChevron/AnimatedChevron.cjs} +2 -7
- package/dist/components/AnimatedChevron/{index-BfdaL9eW.d.cts → AnimatedChevron.d.cts} +2 -2
- package/dist/components/AnimatedChevron/{index-bNdUYDzX.d.ts → AnimatedChevron.d.ts} +2 -2
- package/dist/{AnimatedChevron-DghLnmlM.js → components/AnimatedChevron/AnimatedChevron.js} +1 -1
- package/dist/components/AnimatedChevron/index.cjs +1 -1
- package/dist/components/AnimatedChevron/index.d.cts +2 -0
- package/dist/components/AnimatedChevron/index.d.ts +2 -0
- package/dist/components/AnimatedChevron/index.js +1 -1
- package/dist/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.cjs +45 -0
- package/dist/components/AppliedFiltersScrollbar/{index-B68Mx16E.d.cts → AppliedFiltersScrollbar.d.cts} +2 -2
- package/dist/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
- package/dist/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.js +42 -0
- package/dist/components/AppliedFiltersScrollbar/index.cjs +2 -43
- package/dist/components/AppliedFiltersScrollbar/index.d.cts +2 -0
- package/dist/components/AppliedFiltersScrollbar/index.d.ts +2 -0
- package/dist/components/AppliedFiltersScrollbar/index.js +1 -39
- package/dist/{ButtonBase-Bm_QOyM1.cjs → components/ButtonBase/ButtonBase.cjs} +12 -29
- package/dist/components/ButtonBase/ButtonBase.d.cts +18 -0
- package/dist/components/ButtonBase/ButtonBase.d.ts +18 -0
- package/dist/{ButtonBase-CT397aT3.js → components/ButtonBase/ButtonBase.js} +8 -14
- package/dist/components/ButtonBase/index.cjs +3 -4
- package/dist/components/ButtonBase/index.d.cts +3 -0
- package/dist/components/ButtonBase/index.d.ts +3 -0
- package/dist/components/ButtonBase/index.js +2 -3
- package/dist/components/ButtonBase/types.cjs +11 -0
- package/dist/components/ButtonBase/{index-3ltL6jhO.d.ts → types.d.cts} +4 -19
- package/dist/components/ButtonBase/{index-CcVRnbuQ.d.cts → types.d.ts} +4 -19
- package/dist/components/ButtonBase/types.js +10 -0
- package/dist/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.cjs +33 -0
- package/dist/components/DynamicFiltersScrollbar/{index-B483Jhki.d.cts → DynamicFiltersScrollbar.d.cts} +2 -2
- package/dist/components/DynamicFiltersScrollbar/{index-B_a6Oebn.d.ts → DynamicFiltersScrollbar.d.ts} +2 -2
- package/dist/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.js +30 -0
- package/dist/components/DynamicFiltersScrollbar/index.cjs +2 -31
- package/dist/components/DynamicFiltersScrollbar/index.d.cts +2 -0
- package/dist/components/DynamicFiltersScrollbar/index.d.ts +2 -0
- package/dist/components/DynamicFiltersScrollbar/index.js +1 -27
- package/dist/{DynamicFiltersScrollbar-bT3VoG-D.cjs → components/FilterScrollbar/AppliedFiltersScrollbar.cjs} +6 -39
- package/dist/components/FilterScrollbar/{index-CISEdkBM.d.ts → AppliedFiltersScrollbar.d.cts} +1 -26
- package/dist/components/{AppliedFiltersScrollbar/index-B9u7XRmf.d.ts → FilterScrollbar/AppliedFiltersScrollbar.d.ts} +1 -1
- package/dist/{DynamicFiltersScrollbar-CibstqNd.js → components/FilterScrollbar/AppliedFiltersScrollbar.js} +3 -25
- package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +33 -0
- package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
- package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
- package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +30 -0
- package/dist/components/FilterScrollbar/index.cjs +3 -3
- package/dist/components/FilterScrollbar/index.d.cts +3 -0
- package/dist/components/FilterScrollbar/index.d.ts +3 -0
- package/dist/components/FilterScrollbar/index.js +2 -2
- package/dist/{ImageWithFallback-BiBjNK-9.cjs → components/ImageWithFallback/ImageWithFallback.cjs} +4 -9
- package/dist/components/ImageWithFallback/{index-Dk89vxqv.d.cts → ImageWithFallback.d.cts} +2 -2
- package/dist/components/ImageWithFallback/{index-CCWzf6ZV.d.ts → ImageWithFallback.d.ts} +2 -2
- package/dist/{ImageWithFallback-_QZT0EKI.js → components/ImageWithFallback/ImageWithFallback.js} +1 -1
- package/dist/components/ImageWithFallback/index.cjs +1 -1
- package/dist/components/ImageWithFallback/index.d.cts +2 -0
- package/dist/components/ImageWithFallback/index.d.ts +2 -0
- package/dist/components/ImageWithFallback/index.js +1 -1
- package/dist/components/ModalSheet/ModalSheet.cjs +30 -0
- package/dist/components/ModalSheet/ModalSheet.d.cts +15 -0
- package/dist/components/ModalSheet/ModalSheet.d.ts +15 -0
- package/dist/components/ModalSheet/ModalSheet.js +29 -0
- package/dist/components/ModalSheet/desktop/desktopHeader.cjs +26 -0
- package/dist/components/ModalSheet/desktop/desktopHeader.js +24 -0
- package/dist/components/ModalSheet/desktop/index.cjs +122 -0
- package/dist/components/ModalSheet/desktop/index.js +120 -0
- package/dist/components/ModalSheet/index.cjs +1 -2
- package/dist/components/ModalSheet/index.d.cts +2 -0
- package/dist/components/ModalSheet/index.d.ts +2 -0
- package/dist/components/ModalSheet/index.js +1 -2
- package/dist/components/ModalSheet/mobile/index.cjs +116 -0
- package/dist/components/ModalSheet/mobile/index.js +114 -0
- package/dist/components/ModalSheet/mobile/mobileHeader.cjs +38 -0
- package/dist/components/ModalSheet/mobile/mobileHeader.js +36 -0
- package/dist/components/ModalSheet/{index-C_8baIZK.d.cts → types.d.cts} +1 -14
- package/dist/components/ModalSheet/{index-CI0qFVA7.d.ts → types.d.ts} +1 -14
- package/dist/{ProductCard-C3seoFWE.cjs → components/ProductCard/ProductCard.cjs} +19 -171
- package/dist/components/ProductCard/ProductCard.d.cts +64 -0
- package/dist/components/ProductCard/ProductCard.d.ts +64 -0
- package/dist/{ProductCard-ChitHvuc.js → components/ProductCard/ProductCard.js} +10 -105
- package/dist/components/ProductCard/ProductCardSkeleton.cjs +33 -0
- package/dist/components/ProductCard/ProductCardSkeleton.d.cts +7 -0
- package/dist/components/ProductCard/ProductCardSkeleton.d.ts +7 -0
- package/dist/components/ProductCard/ProductCardSkeleton.js +31 -0
- package/dist/components/ProductCard/index.cjs +11 -12
- package/dist/components/ProductCard/index.d.cts +5 -0
- package/dist/components/ProductCard/index.d.ts +5 -0
- package/dist/components/ProductCard/index.js +4 -5
- package/dist/components/ProductCard/productCardVariants.cjs +49 -0
- package/dist/components/ProductCard/productCardVariants.d.cts +13 -0
- package/dist/components/ProductCard/productCardVariants.d.ts +13 -0
- package/dist/components/ProductCard/productCardVariants.js +45 -0
- package/dist/components/ProductCard/types.cjs +16 -0
- package/dist/components/ProductCard/types.d.cts +43 -0
- package/dist/components/ProductCard/types.d.ts +43 -0
- package/dist/components/ProductCard/types.js +14 -0
- package/dist/{ProductGrid-Ct2DvLGf.cjs → components/ProductGrid/ProductGrid.cjs} +7 -35
- package/dist/components/ProductGrid/ProductGrid.d.cts +25 -0
- package/dist/components/ProductGrid/ProductGrid.d.ts +25 -0
- package/dist/{ProductGrid-DukHo_KY.js → components/ProductGrid/ProductGrid.js} +4 -21
- package/dist/components/ProductGrid/index.cjs +3 -7
- package/dist/components/ProductGrid/index.d.cts +3 -0
- package/dist/components/ProductGrid/index.d.ts +3 -0
- package/dist/components/ProductGrid/index.js +2 -6
- package/dist/components/ProductGrid/productGridVariants.cjs +21 -0
- package/dist/components/ProductGrid/productGridVariants.d.cts +13 -0
- package/dist/components/ProductGrid/productGridVariants.d.ts +13 -0
- package/dist/components/ProductGrid/productGridVariants.js +20 -0
- package/dist/{RadioButton-D4TPq1Aa.cjs → components/RadioButton/RadioButton.cjs} +5 -9
- package/dist/components/RadioButton/{index-BWo-a19v.d.ts → RadioButton.d.cts} +2 -2
- package/dist/components/RadioButton/{index-DsVASVAv.d.cts → RadioButton.d.ts} +2 -2
- package/dist/{RadioButton-C1w7N40t.js → components/RadioButton/RadioButton.js} +3 -2
- package/dist/components/RadioButton/index.cjs +1 -2
- package/dist/components/RadioButton/index.d.cts +2 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/RadioButton/index.js +1 -2
- package/dist/{RadioButtonGroup-BhZloLH6.cjs → components/RadioButtonGroup/RadioButtonGroup.cjs} +6 -15
- package/dist/components/RadioButtonGroup/{index-CiljmnzJ.d.cts → RadioButtonGroup.d.cts} +2 -2
- package/dist/components/RadioButtonGroup/{index-DdyMuFCX.d.ts → RadioButtonGroup.d.ts} +2 -2
- package/dist/{RadioButtonGroup-BWQ4-m2M.js → components/RadioButtonGroup/RadioButtonGroup.js} +3 -2
- package/dist/components/RadioButtonGroup/index.cjs +1 -3
- package/dist/components/RadioButtonGroup/index.d.cts +2 -0
- package/dist/components/RadioButtonGroup/index.d.ts +2 -0
- package/dist/components/RadioButtonGroup/index.js +1 -3
- package/dist/{RecommendedProducts-Cy-1szYc.cjs → components/RecommendedProducts/RecommendedProducts.cjs} +7 -10
- package/dist/{RecommendedProducts-DooGvLFT.js → components/RecommendedProducts/RecommendedProducts.js} +5 -3
- package/dist/components/RecommendedProducts/index.cjs +1 -7
- package/dist/components/RecommendedProducts/index.d.cts +2 -0
- package/dist/components/RecommendedProducts/index.d.ts +2 -0
- package/dist/components/RecommendedProducts/index.js +1 -7
- package/dist/{SearchAutocomplete-C1XH39Xx.cjs → components/SearchAutocomplete/SearchAutocomplete.cjs} +7 -11
- package/dist/components/SearchAutocomplete/{index-BBUrFTl5.d.ts → SearchAutocomplete.d.cts} +2 -2
- package/dist/components/SearchAutocomplete/{index-OVMqT8K4.d.cts → SearchAutocomplete.d.ts} +2 -2
- package/dist/{SearchAutocomplete-CuuN0cDu.js → components/SearchAutocomplete/SearchAutocomplete.js} +3 -2
- package/dist/components/SearchAutocomplete/index.cjs +1 -2
- package/dist/components/SearchAutocomplete/index.d.cts +2 -0
- package/dist/components/SearchAutocomplete/index.d.ts +2 -0
- package/dist/components/SearchAutocomplete/index.js +1 -2
- package/dist/components/SearchFilter/SearchFilter.cjs +134 -0
- package/dist/components/SearchFilter/SearchFilter.d.cts +23 -0
- package/dist/components/SearchFilter/SearchFilter.d.ts +23 -0
- package/dist/components/SearchFilter/SearchFilter.js +132 -0
- package/dist/components/SearchFilter/SearchFilterFooter.cjs +48 -0
- package/dist/components/SearchFilter/SearchFilterFooter.d.cts +14 -0
- package/dist/components/SearchFilter/SearchFilterFooter.d.ts +14 -0
- package/dist/components/SearchFilter/SearchFilterFooter.js +46 -0
- package/dist/components/SearchFilter/SearchFilterHeader.cjs +42 -0
- package/dist/components/SearchFilter/SearchFilterHeader.d.cts +12 -0
- package/dist/components/SearchFilter/SearchFilterHeader.d.ts +12 -0
- package/dist/components/SearchFilter/SearchFilterHeader.js +40 -0
- package/dist/components/SearchFilter/SearchFilterItem.cjs +41 -0
- package/dist/components/SearchFilter/SearchFilterItem.d.cts +13 -0
- package/dist/components/SearchFilter/SearchFilterItem.d.ts +13 -0
- package/dist/components/SearchFilter/SearchFilterItem.js +39 -0
- package/dist/components/SearchFilter/index.cjs +10 -15
- package/dist/components/SearchFilter/index.d.cts +6 -0
- package/dist/components/SearchFilter/index.d.ts +6 -0
- package/dist/components/SearchFilter/index.js +5 -10
- package/dist/components/SearchFilter/types.d.cts +42 -0
- package/dist/components/SearchFilter/types.d.ts +42 -0
- package/dist/components/SearchFilter/useHasFilterStateChanged.cjs +27 -0
- package/dist/components/SearchFilter/useHasFilterStateChanged.js +26 -0
- package/dist/components/SearchFilter/utils.cjs +11 -0
- package/dist/components/SearchFilter/utils.d.cts +7 -0
- package/dist/components/SearchFilter/utils.d.ts +7 -0
- package/dist/components/SearchFilter/utils.js +9 -0
- package/dist/{SearchInput-Cgsjew8Q.cjs → components/SearchInput/SearchInput.cjs} +10 -32
- package/dist/components/SearchInput/{index-UY0W77Y0.d.ts → SearchInput.d.cts} +1 -15
- package/dist/components/SearchInput/{index-rFDdhvqg.d.cts → SearchInput.d.ts} +1 -15
- package/dist/{SearchInput-DE9Iz7A8.js → components/SearchInput/SearchInput.js} +4 -15
- package/dist/components/SearchInput/index.cjs +3 -5
- package/dist/components/SearchInput/index.d.cts +3 -0
- package/dist/components/SearchInput/index.d.ts +3 -0
- package/dist/components/SearchInput/index.js +2 -4
- package/dist/components/SearchInput/searchInputVariants.cjs +15 -0
- package/dist/components/SearchInput/searchInputVariants.d.cts +16 -0
- package/dist/components/SearchInput/searchInputVariants.d.ts +16 -0
- package/dist/components/SearchInput/searchInputVariants.js +15 -0
- package/dist/{SearchInputForm-CSd4tjts.cjs → components/SearchInputForm/SearchInputForm.cjs} +8 -11
- package/dist/components/SearchInputForm/{index-D1F37qNH.d.ts → SearchInputForm.d.cts} +3 -3
- package/dist/components/SearchInputForm/{index-B3A17s3e.d.cts → SearchInputForm.d.ts} +3 -3
- package/dist/{SearchInputForm--CvVrjwl.js → components/SearchInputForm/SearchInputForm.js} +5 -3
- package/dist/components/SearchInputForm/index.cjs +1 -6
- package/dist/components/SearchInputForm/index.d.cts +2 -0
- package/dist/components/SearchInputForm/index.d.ts +2 -0
- package/dist/components/SearchInputForm/index.js +1 -6
- package/dist/components/SearchResultsContent/SearchResultsContent.cjs +52 -0
- package/dist/components/SearchResultsContent/{index-BI4Dm7mI.d.ts → SearchResultsContent.d.cts} +5 -5
- package/dist/components/SearchResultsContent/{index-B66EnbgF.d.cts → SearchResultsContent.d.ts} +5 -5
- package/dist/components/SearchResultsContent/SearchResultsContent.js +50 -0
- package/dist/components/SearchResultsContent/index.cjs +2 -59
- package/dist/components/SearchResultsContent/index.d.cts +2 -0
- package/dist/components/SearchResultsContent/index.d.ts +2 -0
- package/dist/components/SearchResultsContent/index.js +1 -56
- package/dist/{SearchResultsFilterButton-BQqm4icD.cjs → components/SearchResultsFilterButton/SearchResultsFilterButton.cjs} +6 -10
- package/dist/components/SearchResultsFilterButton/{index-CCVZZUTR.d.cts → SearchResultsFilterButton.d.cts} +2 -2
- package/dist/components/SearchResultsFilterButton/{index-Cjq_NOxx.d.ts → SearchResultsFilterButton.d.ts} +2 -2
- package/dist/{SearchResultsFilterButton-CV11UTGi.js → components/SearchResultsFilterButton/SearchResultsFilterButton.js} +4 -3
- package/dist/components/SearchResultsFilterButton/index.cjs +1 -4
- package/dist/components/SearchResultsFilterButton/index.d.cts +2 -0
- package/dist/components/SearchResultsFilterButton/index.d.ts +2 -0
- package/dist/components/SearchResultsFilterButton/index.js +1 -4
- package/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +36 -0
- package/dist/components/SearchResultsFilterModal/{index-CMWDFJWT.d.cts → SearchResultsFilterModal.d.cts} +3 -3
- package/dist/components/SearchResultsFilterModal/{index-Ba84MNoM.d.ts → SearchResultsFilterModal.d.ts} +3 -3
- package/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +35 -0
- package/dist/components/SearchResultsFilterModal/index.cjs +2 -43
- package/dist/components/SearchResultsFilterModal/index.d.cts +2 -0
- package/dist/components/SearchResultsFilterModal/index.d.ts +2 -0
- package/dist/components/SearchResultsFilterModal/index.js +1 -41
- package/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +51 -0
- package/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +27 -0
- package/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +27 -0
- package/dist/{SearchResultsFilterSidebar-ydSo1S6h.js → components/SearchResultsFilterSidebar/SearchResultsFilter.js} +9 -72
- package/dist/components/SearchResultsFilterSidebar/index.cjs +3 -14
- package/dist/components/SearchResultsFilterSidebar/index.d.cts +4 -0
- package/dist/components/SearchResultsFilterSidebar/index.d.ts +4 -0
- package/dist/components/SearchResultsFilterSidebar/index.js +2 -13
- package/dist/{searchFilterSidebarVariants-C61Byr1S.cjs → components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs} +2 -7
- package/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.cts +19 -0
- package/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +19 -0
- package/dist/{searchFilterSidebarVariants-DcwlBfvY.js → components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js} +2 -2
- package/dist/components/SearchResultsFilterSidebar/types.d.cts +5 -0
- package/dist/components/SearchResultsFilterSidebar/types.d.ts +5 -0
- package/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +57 -0
- package/dist/components/SearchResultsStates/NoSearchResultsFound.d.cts +25 -0
- package/dist/components/SearchResultsStates/NoSearchResultsFound.d.ts +25 -0
- package/dist/components/SearchResultsStates/NoSearchResultsFound.js +54 -0
- package/dist/components/SearchResultsStates/SearchResultsGrid.cjs +53 -0
- package/dist/components/SearchResultsStates/SearchResultsGrid.d.cts +46 -0
- package/dist/components/SearchResultsStates/SearchResultsGrid.d.ts +46 -0
- package/dist/components/SearchResultsStates/SearchResultsGrid.js +51 -0
- package/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/components/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
- package/dist/components/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
- package/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +51 -0
- package/dist/components/SearchResultsStates/index.cjs +6 -15
- package/dist/components/SearchResultsStates/index.d.cts +4 -0
- package/dist/components/SearchResultsStates/index.d.ts +4 -0
- package/dist/components/SearchResultsStates/index.js +3 -12
- package/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +60 -0
- package/dist/components/SearchResultsToolbar/{index-_hxKcDDT.d.ts → SearchResultsToolbar.d.cts} +2 -2
- package/dist/components/SearchResultsToolbar/{index-M8RkRW3H.d.cts → SearchResultsToolbar.d.ts} +2 -2
- package/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +57 -0
- package/dist/components/SearchResultsToolbar/index.cjs +2 -64
- package/dist/components/SearchResultsToolbar/index.d.cts +2 -0
- package/dist/components/SearchResultsToolbar/index.d.ts +2 -0
- package/dist/components/SearchResultsToolbar/index.js +1 -60
- package/dist/{SparkleAnimation-Bg5qax1t.cjs → components/SparkleAnimation/SparkleAnimation.cjs} +9 -29
- package/dist/components/SparkleAnimation/SparkleAnimation.d.cts +15 -0
- package/dist/components/SparkleAnimation/SparkleAnimation.d.ts +15 -0
- package/dist/{SparkleAnimation-HY4cgwE3.js → components/SparkleAnimation/SparkleAnimation.js} +2 -11
- package/dist/components/SparkleAnimation/index.cjs +3 -2
- package/dist/components/SparkleAnimation/index.d.cts +3 -0
- package/dist/components/SparkleAnimation/index.d.ts +3 -0
- package/dist/components/SparkleAnimation/index.js +2 -1
- package/dist/components/SparkleAnimation/types.cjs +12 -0
- package/dist/components/SparkleAnimation/types.d.cts +9 -0
- package/dist/components/SparkleAnimation/types.d.ts +9 -0
- package/dist/components/SparkleAnimation/types.js +11 -0
- package/dist/{Spinner-CUrXDajS.cjs → components/Spinner/Spinner.cjs} +3 -8
- package/dist/components/Spinner/{index-DrYhRG9D.d.cts → Spinner.d.cts} +2 -2
- package/dist/components/Spinner/{index-C876igqb.d.ts → Spinner.d.ts} +2 -2
- package/dist/{Spinner-CDDFWySo.js → components/Spinner/Spinner.js} +1 -1
- package/dist/components/Spinner/index.cjs +1 -1
- package/dist/components/Spinner/index.d.cts +2 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/SuggestionButton/SuggestionButton.cjs +195 -0
- package/dist/components/SuggestionButton/{index-CrGSb18s.d.ts → SuggestionButton.d.cts} +6 -8
- package/dist/components/SuggestionButton/{index-DfQRQGev.d.cts → SuggestionButton.d.ts} +6 -8
- package/dist/components/SuggestionButton/SuggestionButton.js +188 -0
- package/dist/components/SuggestionButton/index.cjs +5 -192
- package/dist/components/SuggestionButton/index.d.cts +3 -0
- package/dist/components/SuggestionButton/index.d.ts +3 -0
- package/dist/components/SuggestionButton/index.js +1 -184
- package/dist/components/SuggestionButton/types.d.cts +4 -0
- package/dist/components/SuggestionButton/types.d.ts +4 -0
- package/dist/{TextInput-DfCocKVm.cjs → components/TextInput/TextInput.cjs} +7 -11
- package/dist/components/TextInput/{index-CkQtHiR9.d.ts → TextInput.d.cts} +1 -2
- package/dist/components/TextInput/{index-CRJMRe-b.d.cts → TextInput.d.ts} +1 -2
- package/dist/{TextInput-PtrUXoZo.js → components/TextInput/TextInput.js} +3 -2
- package/dist/components/TextInput/index.cjs +1 -2
- package/dist/components/TextInput/index.d.cts +2 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/TextInput/index.js +1 -2
- package/dist/{ToggleButton-BhBEOjxO.cjs → components/ToggleButton/ToggleButton.cjs} +5 -9
- package/dist/components/ToggleButton/{index-DFz4kch0.d.ts → ToggleButton.d.cts} +2 -2
- package/dist/components/ToggleButton/{index-CpURpMq5.d.cts → ToggleButton.d.ts} +2 -2
- package/dist/{ToggleButton-BTz_zIdc.js → components/ToggleButton/ToggleButton.js} +3 -2
- package/dist/components/ToggleButton/index.cjs +1 -2
- package/dist/components/ToggleButton/index.d.cts +2 -0
- package/dist/components/ToggleButton/index.d.ts +2 -0
- package/dist/components/ToggleButton/index.js +1 -2
- package/dist/components/Typography/Typography.cjs +53 -0
- package/dist/{index-Cr8VXccr.d.ts → components/Typography/Typography.d.cts} +2 -2
- package/dist/{index-Bw6lDfEp.d.cts → components/Typography/Typography.d.ts} +2 -2
- package/dist/components/Typography/Typography.js +50 -0
- package/dist/components/Typography/index.cjs +5 -4
- package/dist/components/Typography/index.d.cts +3 -0
- package/dist/components/Typography/index.d.ts +3 -0
- package/dist/components/Typography/index.js +2 -1
- package/dist/{Typography-xehJH05l.js → components/Typography/typographyVariantClasses.cjs} +3 -54
- package/dist/{typographyVariantClasses-CoRhazCU.d.cts → components/Typography/typographyVariantClasses.d.cts} +1 -1
- package/dist/{typographyVariantClasses-CrT5OfVw.d.ts → components/Typography/typographyVariantClasses.d.ts} +1 -1
- package/dist/{Typography-Csg-nd_w.cjs → components/Typography/typographyVariantClasses.js} +1 -81
- package/dist/components/Typography/util.cjs +10 -0
- package/dist/components/Typography/util.js +10 -0
- package/dist/logging/logger.cjs +20 -0
- package/dist/logging/logger.js +19 -0
- package/dist/{colorsConfig-D-MZuBvt.cjs → models/colorsConfig.cjs} +2 -12
- package/dist/{colorsConfig-BjdoRtRK.js → models/colorsConfig.js} +1 -1
- package/dist/util/camelCase.d.cts +69 -0
- package/dist/util/camelCase.d.ts +69 -0
- package/dist/util/camelCasedPropertiesDeep.d.cts +55 -0
- package/dist/util/camelCasedPropertiesDeep.d.ts +55 -0
- package/dist/util/colorVar.cjs +6 -0
- package/dist/util/colorVar.d.cts +6 -0
- package/dist/util/colorVar.d.ts +6 -0
- package/dist/util/colorVar.js +5 -0
- package/dist/{formatPrice-CyfkjZ3R.cjs → util/formatPrice.cjs} +1 -6
- package/dist/util/formatPrice.d.cts +4 -0
- package/dist/util/formatPrice.d.ts +4 -0
- package/dist/{formatPrice-DexQu2aZ.js → util/formatPrice.js} +1 -1
- package/dist/util/index.cjs +7 -78
- package/dist/util/index.d.cts +5 -0
- package/dist/util/index.d.ts +5 -0
- package/dist/util/index.js +4 -74
- package/dist/util/internal.d.cts +22 -0
- package/dist/util/internal.d.ts +22 -0
- package/dist/util/splitWords.d.cts +28 -0
- package/dist/util/splitWords.d.ts +28 -0
- package/dist/util/trim.d.cts +28 -0
- package/dist/util/trim.d.ts +28 -0
- package/dist/util/unknownArray.d.cts +28 -0
- package/dist/util/unknownArray.d.ts +28 -0
- package/dist/util/useScrollDirection.cjs +39 -0
- package/dist/util/useScrollDirection.d.cts +5 -0
- package/dist/util/useScrollDirection.d.ts +5 -0
- package/dist/util/useScrollDirection.js +38 -0
- package/dist/util/useStickyVisibility.cjs +38 -0
- package/dist/util/useStickyVisibility.d.cts +10 -0
- package/dist/util/useStickyVisibility.d.ts +10 -0
- package/dist/util/useStickyVisibility.js +37 -0
- package/package.json +1 -2
- package/src/components/ButtonBase/ButtonBase.tsx +3 -5
- package/src/components/ButtonBase/types.ts +3 -3
- package/src/components/ModalSheet/common/closeIcon.tsx +3 -6
- package/src/components/ProductCard/ProductCard.tsx +2 -2
- package/src/components/SearchFilter/types.ts +2 -0
- package/src/components/SearchResultsFilterButton/SearchResultsFilterButton.tsx +1 -1
- package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -2
- package/src/components/SuggestionButton/SuggestionButton.tsx +17 -12
- package/src/stories/ButtonBase.stories.tsx +1 -1
- package/src/stories/ProductCardSkeleton.stories.tsx +46 -16
- package/src/stories/SearchResultsFilter.stories.tsx +2 -2
- package/dist/ButtonBase-BIXx56hq.cjs +0 -0
- package/dist/ButtonBase-C9fn-c5h.js +0 -1
- package/dist/ModalSheet-BuCtRDnQ.cjs +0 -308
- package/dist/ModalSheet-DVrY7Mw0.js +0 -301
- package/dist/SearchFilter-CnP71PTj.cjs +0 -301
- package/dist/SearchFilter-DsYF1A5n.js +0 -264
- package/dist/SearchResultsFilterSidebar-U6dFy-Jo.cjs +0 -118
- package/dist/SearchResultsStates-BCeqeo9y.js +0 -138
- package/dist/SearchResultsStates-Dp-AsmH8.cjs +0 -158
- package/dist/components/FilterScrollbar/index-BmHm47DA.d.cts +0 -47
- package/dist/components/ProductCard/index-D5om2RVT.d.ts +0 -2
- package/dist/components/ProductCard/index-Djjvdeh7.d.cts +0 -2
- package/dist/components/ProductGrid/index-AxMBGLVk.d.ts +0 -35
- package/dist/components/ProductGrid/index-C4Tz_KWs.d.cts +0 -35
- package/dist/components/SearchFilter/index-BDaLJW2Q.d.cts +0 -91
- package/dist/components/SearchFilter/index-DESOqSJQ.d.ts +0 -91
- package/dist/components/SearchResultsFilterSidebar/index-DmO55w4A.d.ts +0 -2
- package/dist/components/SearchResultsFilterSidebar/index-Dtr9q9hT.d.cts +0 -2
- package/dist/components/SearchResultsStates/index-Ba3tQMCI.d.ts +0 -78
- package/dist/components/SearchResultsStates/index-DN1-g87W.d.cts +0 -78
- package/dist/components/SparkleAnimation/index-BMrS1PDU.d.cts +0 -23
- package/dist/components/SparkleAnimation/index-t59eI0td.d.ts +0 -23
- package/dist/components/Typography/index-DE1Nhjra.d.ts +0 -3
- package/dist/components/Typography/index-DzSBreyM.d.cts +0 -3
- package/dist/index-1GZFptEC.d.cts +0 -325
- package/dist/index-CBI4Lqsm.d.cts +0 -46
- package/dist/index-pZZXXUG_.d.ts +0 -46
- package/dist/index-yDKT5Bem.d.ts +0 -325
- package/dist/util/index-C2ueYGXh.d.ts +0 -21
- package/dist/util/index-DUzbpjPa.d.cts +0 -21
- /package/dist/components/RecommendedProducts/{index-BFM83Qu3.d.cts → RecommendedProducts.d.cts} +0 -0
- /package/dist/components/RecommendedProducts/{index-DlbCfGof.d.ts → RecommendedProducts.d.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Trim } from "./trim.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/util/internal.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns a boolean for whether the string is numeric.
|
|
7
|
+
*
|
|
8
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
9
|
+
*/
|
|
10
|
+
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a boolean for whether the string is lowercased.
|
|
13
|
+
*/
|
|
14
|
+
type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
15
|
+
/**
|
|
16
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
17
|
+
*/
|
|
18
|
+
type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
19
|
+
type WordSeparators = '-' | '_' | Whitespace;
|
|
20
|
+
type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
|
|
21
|
+
//#endregion
|
|
22
|
+
export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Trim } from "./trim.js";
|
|
2
|
+
|
|
3
|
+
//#region src/util/internal.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns a boolean for whether the string is numeric.
|
|
7
|
+
*
|
|
8
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
9
|
+
*/
|
|
10
|
+
type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a boolean for whether the string is lowercased.
|
|
13
|
+
*/
|
|
14
|
+
type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
15
|
+
/**
|
|
16
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
17
|
+
*/
|
|
18
|
+
type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
19
|
+
type WordSeparators = '-' | '_' | Whitespace;
|
|
20
|
+
type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
|
|
21
|
+
//#endregion
|
|
22
|
+
export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/util/splitWords.d.ts
|
|
4
|
+
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
5
|
+
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
6
|
+
/**
|
|
7
|
+
* Split a string (almost) like Lodash's `_.words()` function.
|
|
8
|
+
*
|
|
9
|
+
* - Split on each word that begins with a capital letter.
|
|
10
|
+
* - Split on each {@link WordSeparators}.
|
|
11
|
+
* - Split on numeric sequence.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
16
|
+
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
17
|
+
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
18
|
+
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
19
|
+
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
* @category Change case
|
|
24
|
+
* @category Template literal
|
|
25
|
+
*/
|
|
26
|
+
type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SplitWords };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.js";
|
|
2
|
+
|
|
3
|
+
//#region src/util/splitWords.d.ts
|
|
4
|
+
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
5
|
+
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
6
|
+
/**
|
|
7
|
+
* Split a string (almost) like Lodash's `_.words()` function.
|
|
8
|
+
*
|
|
9
|
+
* - Split on each word that begins with a capital letter.
|
|
10
|
+
* - Split on each {@link WordSeparators}.
|
|
11
|
+
* - Split on numeric sequence.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
16
|
+
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
17
|
+
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
18
|
+
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
19
|
+
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
* @category Change case
|
|
24
|
+
* @category Template literal
|
|
25
|
+
*/
|
|
26
|
+
type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { SplitWords };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Whitespace } from "./internal.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/util/trim.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Remove spaces from the left side.
|
|
7
|
+
*/
|
|
8
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
9
|
+
/**
|
|
10
|
+
* Remove spaces from the right side.
|
|
11
|
+
*/
|
|
12
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
13
|
+
/**
|
|
14
|
+
* Remove leading and trailing spaces from a string.
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* import type {Trim} from 'type-fest';
|
|
18
|
+
*
|
|
19
|
+
* Trim<' foo '>
|
|
20
|
+
* //=> 'foo'
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category String
|
|
24
|
+
* @category Template literal
|
|
25
|
+
*/
|
|
26
|
+
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Trim };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Whitespace } from "./internal.js";
|
|
2
|
+
|
|
3
|
+
//#region src/util/trim.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Remove spaces from the left side.
|
|
7
|
+
*/
|
|
8
|
+
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
9
|
+
/**
|
|
10
|
+
* Remove spaces from the right side.
|
|
11
|
+
*/
|
|
12
|
+
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
13
|
+
/**
|
|
14
|
+
* Remove leading and trailing spaces from a string.
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* import type {Trim} from 'type-fest';
|
|
18
|
+
*
|
|
19
|
+
* Trim<' foo '>
|
|
20
|
+
* //=> 'foo'
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category String
|
|
24
|
+
* @category Template literal
|
|
25
|
+
*/
|
|
26
|
+
type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Trim };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/util/unknownArray.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents an array with `unknown` value.
|
|
4
|
+
*
|
|
5
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import type {UnknownArray} from 'type-fest';
|
|
10
|
+
*
|
|
11
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
12
|
+
*
|
|
13
|
+
* type A = IsArray<['foo']>;
|
|
14
|
+
* //=> true
|
|
15
|
+
*
|
|
16
|
+
* type B = IsArray<readonly number[]>;
|
|
17
|
+
* //=> true
|
|
18
|
+
*
|
|
19
|
+
* type C = IsArray<string>;
|
|
20
|
+
* //=> false
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category Type
|
|
24
|
+
* @category Array
|
|
25
|
+
*/
|
|
26
|
+
type UnknownArray = readonly unknown[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { UnknownArray };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/util/unknownArray.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents an array with `unknown` value.
|
|
4
|
+
*
|
|
5
|
+
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import type {UnknownArray} from 'type-fest';
|
|
10
|
+
*
|
|
11
|
+
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
12
|
+
*
|
|
13
|
+
* type A = IsArray<['foo']>;
|
|
14
|
+
* //=> true
|
|
15
|
+
*
|
|
16
|
+
* type B = IsArray<readonly number[]>;
|
|
17
|
+
* //=> true
|
|
18
|
+
*
|
|
19
|
+
* type C = IsArray<string>;
|
|
20
|
+
* //=> false
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category Type
|
|
24
|
+
* @category Array
|
|
25
|
+
*/
|
|
26
|
+
type UnknownArray = readonly unknown[];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { UnknownArray };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/util/useScrollDirection.ts
|
|
5
|
+
const useScrollDirection = (scrollContainerRef) => {
|
|
6
|
+
const [scrollDirection, setScrollDirection] = (0, react.useState)(null);
|
|
7
|
+
const touchStartY = (0, react.useRef)(0);
|
|
8
|
+
(0, react.useEffect)(() => {
|
|
9
|
+
const container = scrollContainerRef?.current || window;
|
|
10
|
+
const touchTarget = scrollContainerRef?.current || document;
|
|
11
|
+
const handleWheel = (e) => {
|
|
12
|
+
if (e.deltaY > 0) setScrollDirection("down");
|
|
13
|
+
else setScrollDirection("up");
|
|
14
|
+
};
|
|
15
|
+
const handleTouchStart = (e) => {
|
|
16
|
+
touchStartY.current = e.touches[0].clientY;
|
|
17
|
+
};
|
|
18
|
+
const handleTouchMove = (e) => {
|
|
19
|
+
const currentTouchY = e.touches[0].clientY;
|
|
20
|
+
const deltaY = touchStartY.current - currentTouchY;
|
|
21
|
+
if (Math.abs(deltaY) < 10) return;
|
|
22
|
+
if (deltaY > 0) setScrollDirection("down");
|
|
23
|
+
else setScrollDirection("up");
|
|
24
|
+
touchStartY.current = currentTouchY;
|
|
25
|
+
};
|
|
26
|
+
container.addEventListener("wheel", handleWheel, { passive: true });
|
|
27
|
+
touchTarget.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
28
|
+
touchTarget.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
29
|
+
return () => {
|
|
30
|
+
container.removeEventListener("wheel", handleWheel);
|
|
31
|
+
touchTarget.removeEventListener("touchstart", handleTouchStart);
|
|
32
|
+
touchTarget.removeEventListener("touchmove", handleTouchMove);
|
|
33
|
+
};
|
|
34
|
+
}, [scrollContainerRef]);
|
|
35
|
+
return scrollDirection;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
exports.useScrollDirection = useScrollDirection;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/util/useScrollDirection.ts
|
|
4
|
+
const useScrollDirection = (scrollContainerRef) => {
|
|
5
|
+
const [scrollDirection, setScrollDirection] = useState(null);
|
|
6
|
+
const touchStartY = useRef(0);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const container = scrollContainerRef?.current || window;
|
|
9
|
+
const touchTarget = scrollContainerRef?.current || document;
|
|
10
|
+
const handleWheel = (e) => {
|
|
11
|
+
if (e.deltaY > 0) setScrollDirection("down");
|
|
12
|
+
else setScrollDirection("up");
|
|
13
|
+
};
|
|
14
|
+
const handleTouchStart = (e) => {
|
|
15
|
+
touchStartY.current = e.touches[0].clientY;
|
|
16
|
+
};
|
|
17
|
+
const handleTouchMove = (e) => {
|
|
18
|
+
const currentTouchY = e.touches[0].clientY;
|
|
19
|
+
const deltaY = touchStartY.current - currentTouchY;
|
|
20
|
+
if (Math.abs(deltaY) < 10) return;
|
|
21
|
+
if (deltaY > 0) setScrollDirection("down");
|
|
22
|
+
else setScrollDirection("up");
|
|
23
|
+
touchStartY.current = currentTouchY;
|
|
24
|
+
};
|
|
25
|
+
container.addEventListener("wheel", handleWheel, { passive: true });
|
|
26
|
+
touchTarget.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
27
|
+
touchTarget.addEventListener("touchmove", handleTouchMove, { passive: true });
|
|
28
|
+
return () => {
|
|
29
|
+
container.removeEventListener("wheel", handleWheel);
|
|
30
|
+
touchTarget.removeEventListener("touchstart", handleTouchStart);
|
|
31
|
+
touchTarget.removeEventListener("touchmove", handleTouchMove);
|
|
32
|
+
};
|
|
33
|
+
}, [scrollContainerRef]);
|
|
34
|
+
return scrollDirection;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { useScrollDirection };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_useScrollDirection = require('./useScrollDirection.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
|
|
5
|
+
//#region src/util/useStickyVisibility.ts
|
|
6
|
+
const useStickyVisibility = () => {
|
|
7
|
+
const [isVisible, setIsVisible] = (0, react.useState)(true);
|
|
8
|
+
const toolbarRef = (0, react.useRef)(null);
|
|
9
|
+
const [toolbarHeight, setToolbarHeight] = (0, react.useState)(0);
|
|
10
|
+
const [scrollY, setScrollY] = (0, react.useState)(0);
|
|
11
|
+
const scrollDirection = require_useScrollDirection.useScrollDirection();
|
|
12
|
+
(0, react.useEffect)(() => {
|
|
13
|
+
const handleScroll = () => {
|
|
14
|
+
setScrollY(window.scrollY);
|
|
15
|
+
};
|
|
16
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
17
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
18
|
+
}, []);
|
|
19
|
+
(0, react.useEffect)(() => {
|
|
20
|
+
if (toolbarRef.current) setToolbarHeight(toolbarRef.current.offsetHeight);
|
|
21
|
+
}, []);
|
|
22
|
+
(0, react.useEffect)(() => {
|
|
23
|
+
if (scrollDirection === "down" && scrollY > toolbarHeight && toolbarHeight > 0) setIsVisible(false);
|
|
24
|
+
else setIsVisible(true);
|
|
25
|
+
}, [
|
|
26
|
+
scrollDirection,
|
|
27
|
+
toolbarHeight,
|
|
28
|
+
scrollY
|
|
29
|
+
]);
|
|
30
|
+
return {
|
|
31
|
+
toolbarRef,
|
|
32
|
+
isVisible,
|
|
33
|
+
toolbarHeight
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
exports.useStickyVisibility = useStickyVisibility;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react0 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/util/useStickyVisibility.d.ts
|
|
4
|
+
declare const useStickyVisibility: () => {
|
|
5
|
+
toolbarRef: react0.RefObject<HTMLDivElement>;
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
toolbarHeight: number;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useStickyVisibility };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react0 from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/util/useStickyVisibility.d.ts
|
|
4
|
+
declare const useStickyVisibility: () => {
|
|
5
|
+
toolbarRef: react0.RefObject<HTMLDivElement>;
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
toolbarHeight: number;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { useStickyVisibility };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { useScrollDirection } from "./useScrollDirection.js";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/util/useStickyVisibility.ts
|
|
5
|
+
const useStickyVisibility = () => {
|
|
6
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
7
|
+
const toolbarRef = useRef(null);
|
|
8
|
+
const [toolbarHeight, setToolbarHeight] = useState(0);
|
|
9
|
+
const [scrollY, setScrollY] = useState(0);
|
|
10
|
+
const scrollDirection = useScrollDirection();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const handleScroll = () => {
|
|
13
|
+
setScrollY(window.scrollY);
|
|
14
|
+
};
|
|
15
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
16
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (toolbarRef.current) setToolbarHeight(toolbarRef.current.offsetHeight);
|
|
20
|
+
}, []);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (scrollDirection === "down" && scrollY > toolbarHeight && toolbarHeight > 0) setIsVisible(false);
|
|
23
|
+
else setIsVisible(true);
|
|
24
|
+
}, [
|
|
25
|
+
scrollDirection,
|
|
26
|
+
toolbarHeight,
|
|
27
|
+
scrollY
|
|
28
|
+
]);
|
|
29
|
+
return {
|
|
30
|
+
toolbarRef,
|
|
31
|
+
isVisible,
|
|
32
|
+
toolbarHeight
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { useStickyVisibility };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-toolkit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"test": "vitest"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@envive-ai/react-hooks": "0.2.9",
|
|
35
34
|
"@tailwindcss/typography": "^0.5.15",
|
|
36
35
|
"classnames": "^2.5.1",
|
|
37
36
|
"react-icons": "^5.0.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
3
|
import { ButtonBaseOverrides, ButtonBaseProps } from './types';
|
|
4
4
|
import { Typography } from '../Typography';
|
|
5
5
|
|
|
@@ -15,6 +15,7 @@ export const ButtonBase = ({
|
|
|
15
15
|
onClick,
|
|
16
16
|
disablePadding = false,
|
|
17
17
|
}: ButtonBaseProps) => {
|
|
18
|
+
const RenderedIcon = () => icon;
|
|
18
19
|
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
19
20
|
|
|
20
21
|
const buttonClassName = classNames({
|
|
@@ -59,10 +60,7 @@ export const ButtonBase = ({
|
|
|
59
60
|
data-testid={dataTestId}
|
|
60
61
|
onClick={onClick}
|
|
61
62
|
>
|
|
62
|
-
{icon &&
|
|
63
|
-
createElement(icon, {
|
|
64
|
-
className: iconClassName,
|
|
65
|
-
})}
|
|
63
|
+
{icon && <RenderedIcon />}
|
|
66
64
|
<Typography className={textClassName}>{text}</Typography>
|
|
67
65
|
</button>
|
|
68
66
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TestProps } from '@envive-ai/react-hooks/types';
|
|
2
1
|
import { ButtonHTMLAttributes, CSSProperties } from 'react';
|
|
3
2
|
|
|
4
3
|
export interface ButtonHoverStyles extends CSSProperties {
|
|
@@ -6,17 +5,18 @@ export interface ButtonHoverStyles extends CSSProperties {
|
|
|
6
5
|
color?: string;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
export interface ButtonBaseProps
|
|
8
|
+
export interface ButtonBaseProps {
|
|
10
9
|
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
11
10
|
isDisabled?: boolean;
|
|
12
11
|
dataAttributes?: Record<string, string>;
|
|
13
12
|
buttonClass?: string;
|
|
14
13
|
text: string;
|
|
15
14
|
textClass?: string;
|
|
16
|
-
icon?: React.
|
|
15
|
+
icon?: React.ReactNode;
|
|
17
16
|
iconClass?: string;
|
|
18
17
|
onClick?: () => void;
|
|
19
18
|
disablePadding?: boolean;
|
|
19
|
+
dataTestId?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export enum ButtonBaseOverrides {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
|
-
import
|
|
4
|
-
import { IconContext } from 'react-icons/lib';
|
|
2
|
+
import IconCloseVariant from '@envive-ai/react-icons/IconCloseVariant';
|
|
5
3
|
import { ModalSheetCloseIconProps } from '../types';
|
|
6
4
|
|
|
7
5
|
const closeIconVariantMapping = {
|
|
@@ -21,7 +19,7 @@ const closeIconVariantMapping = {
|
|
|
21
19
|
|
|
22
20
|
export const ModalSheetCloseIcon = ({
|
|
23
21
|
closeIconVariant = 'tertiary',
|
|
24
|
-
closeIcon = <
|
|
22
|
+
closeIcon = <IconCloseVariant />,
|
|
25
23
|
iconSize = '20px',
|
|
26
24
|
closeModal,
|
|
27
25
|
}: ModalSheetCloseIconProps) => {
|
|
@@ -31,14 +29,13 @@ export const ModalSheetCloseIcon = ({
|
|
|
31
29
|
...closeIconVariantMapping[closeIconVariant],
|
|
32
30
|
});
|
|
33
31
|
|
|
34
|
-
const closeIconContextValue = useMemo(() => ({ size: iconSize }), [iconSize]);
|
|
35
32
|
return (
|
|
36
33
|
<button
|
|
37
34
|
type="button"
|
|
38
35
|
className={closeIconClassNames}
|
|
39
36
|
onClick={closeModal}
|
|
40
37
|
>
|
|
41
|
-
<
|
|
38
|
+
{closeIcon || <IconCloseVariant style={{ width: iconSize, height: iconSize }} />}
|
|
42
39
|
</button>
|
|
43
40
|
);
|
|
44
41
|
};
|
|
@@ -3,7 +3,6 @@ import { MdStar } from 'react-icons/md';
|
|
|
3
3
|
import Logger from 'src/logging/logger';
|
|
4
4
|
import { Typography } from 'src/components/Typography';
|
|
5
5
|
import { formatPrice } from 'src/util/formatPrice';
|
|
6
|
-
import { TestProps } from '@envive-ai/react-hooks/types';
|
|
7
6
|
import { useImageResolver } from '@envive-ai/react-hooks/hooks/ImageResolver';
|
|
8
7
|
import { PRODUCT_CARD_TESTID } from '@envive-ai/react-hooks/config';
|
|
9
8
|
import {
|
|
@@ -97,7 +96,7 @@ export const PriceSection = ({ originalPrice, salePrice, pricePrefix }: PriceSec
|
|
|
97
96
|
);
|
|
98
97
|
};
|
|
99
98
|
|
|
100
|
-
interface ProductCardProps
|
|
99
|
+
interface ProductCardProps {
|
|
101
100
|
productCardConfig?: ProductCardConfig;
|
|
102
101
|
merchantShortName: string;
|
|
103
102
|
title: string;
|
|
@@ -114,6 +113,7 @@ interface ProductCardProps extends TestProps {
|
|
|
114
113
|
aspectRatio?: '3:4' | 'square' | 'none';
|
|
115
114
|
growWithContainer?: boolean;
|
|
116
115
|
onClick?: () => void;
|
|
116
|
+
dataTestId?: string;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
export const ProductCard = ({
|
|
@@ -19,7 +19,7 @@ export const SearchResultsFilterButton = ({
|
|
|
19
19
|
return (
|
|
20
20
|
<ButtonBase
|
|
21
21
|
onClick={openFilter}
|
|
22
|
-
icon={SettingsVariant}
|
|
22
|
+
icon={<SettingsVariant />}
|
|
23
23
|
iconClass="spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center"
|
|
24
24
|
text={filterButtonText}
|
|
25
25
|
textClass="spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
|
|
3
3
|
import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
|
|
4
|
-
import SettingsVariant from '@envive-ai/react-icons/
|
|
4
|
+
import SettingsVariant from '@envive-ai/react-icons/SettingsVariant';
|
|
5
5
|
import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
|
|
6
6
|
import { ButtonBase } from '../ButtonBase';
|
|
7
7
|
import { SearchFilter, SearchFilterHeader } from '../SearchFilter';
|
|
@@ -69,7 +69,7 @@ export const SearchResultsFilter = ({
|
|
|
69
69
|
/>
|
|
70
70
|
<ButtonBase
|
|
71
71
|
onClick={openFilter}
|
|
72
|
-
icon={SettingsVariant}
|
|
72
|
+
icon={<SettingsVariant />}
|
|
73
73
|
iconClass="spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center"
|
|
74
74
|
text={filterButtonText}
|
|
75
75
|
textClass="spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import OutlinedStar from '@envive-ai/react-icons/OutlinedStar';
|
|
3
3
|
import FourPointStar from '@envive-ai/react-icons/FourPointStar';
|
|
4
|
-
import { TestProps } from '@envive-ai/react-hooks/types';
|
|
5
4
|
import type { SuggestionButtonVariant } from './types';
|
|
6
5
|
import { ButtonBase } from '../ButtonBase/ButtonBase';
|
|
7
6
|
|
|
@@ -163,7 +162,16 @@ const variantClassMap = new Map<SuggestionButtonVariant, string[]>([
|
|
|
163
162
|
],
|
|
164
163
|
]);
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
// Choose icon based on variant to match legacy exactly
|
|
166
|
+
const Icon = ({ isAnswer, variant }: { isAnswer: boolean; variant: SuggestionButtonVariant }) => {
|
|
167
|
+
if (isAnswer) return undefined;
|
|
168
|
+
if (variant === 'transparentDark') {
|
|
169
|
+
return <OutlinedStar />;
|
|
170
|
+
}
|
|
171
|
+
return <FourPointStar />;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
interface SuggestionButtonProps {
|
|
167
175
|
variant: SuggestionButtonVariant;
|
|
168
176
|
hoverVariant: SuggestionButtonVariant;
|
|
169
177
|
isDisabled: boolean;
|
|
@@ -173,6 +181,7 @@ interface SuggestionButtonProps extends TestProps {
|
|
|
173
181
|
isAnswer?: boolean;
|
|
174
182
|
dataAttributes?: Record<string, string>;
|
|
175
183
|
onClick: () => void;
|
|
184
|
+
dataTestId?: string;
|
|
176
185
|
}
|
|
177
186
|
|
|
178
187
|
const borderedVariants = [
|
|
@@ -247,15 +256,6 @@ export const SuggestionButton = ({
|
|
|
247
256
|
|
|
248
257
|
const buttonClass = `${buttonClassName} ${variantClasses.join(' ')}`;
|
|
249
258
|
|
|
250
|
-
// Choose icon based on variant to match legacy exactly
|
|
251
|
-
const getIcon = () => {
|
|
252
|
-
if (isAnswer) return undefined;
|
|
253
|
-
if (variant === 'transparentDark') {
|
|
254
|
-
return OutlinedStar;
|
|
255
|
-
}
|
|
256
|
-
return FourPointStar;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
259
|
return (
|
|
260
260
|
<ButtonBase
|
|
261
261
|
text={content}
|
|
@@ -263,7 +263,12 @@ export const SuggestionButton = ({
|
|
|
263
263
|
dataTestId={dataTestId}
|
|
264
264
|
isDisabled={isDisabled}
|
|
265
265
|
// we may want to support custom icons in the future
|
|
266
|
-
icon={
|
|
266
|
+
icon={
|
|
267
|
+
<Icon
|
|
268
|
+
isAnswer={isAnswer}
|
|
269
|
+
variant={variant}
|
|
270
|
+
/>
|
|
271
|
+
}
|
|
267
272
|
iconClass={isAnswer ? undefined : iconClass}
|
|
268
273
|
textClass={`${SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS} ${textClassName}`}
|
|
269
274
|
buttonClass={buttonClass}
|