@envive-ai/react-widgets 0.1.2 → 0.1.3
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/SearchResults/SearchResults.cjs +86 -0
- package/dist/SearchResults/SearchResults.js +84 -0
- package/dist/SearchResults/SearchResultsWidget.cjs +34 -0
- package/dist/SearchResults/SearchResultsWidget.js +33 -0
- package/dist/SearchResults/index.cjs +2 -122
- package/dist/SearchResults/index.d.cts +2 -0
- package/dist/SearchResults/index.d.ts +2 -0
- package/dist/SearchResults/index.js +1 -119
- package/dist/SearchResults/withSearchResults.cjs +18 -0
- package/dist/SearchResults/withSearchResults.js +17 -0
- package/dist/SearchZeroState/SearchIcon.cjs +48 -0
- package/dist/SearchZeroState/SearchIcon.js +45 -0
- package/dist/SearchZeroState/SearchOverlay.cjs +42 -0
- package/dist/SearchZeroState/SearchOverlay.js +39 -0
- package/dist/SearchZeroState/SearchZeroState.cjs +173 -0
- package/dist/SearchZeroState/SearchZeroState.d.cts +7 -0
- package/dist/SearchZeroState/SearchZeroState.d.ts +7 -0
- package/dist/SearchZeroState/SearchZeroState.js +171 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +23 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.js +22 -0
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +74 -0
- package/dist/SearchZeroState/components/RecommendedProducts.js +72 -0
- package/dist/SearchZeroState/index.cjs +4 -3070
- package/dist/SearchZeroState/index.d.cts +4 -0
- package/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/SearchZeroState/index.js +2 -3065
- package/dist/SearchZeroState/overlay/overlayHostLocator.cjs +21 -0
- package/dist/SearchZeroState/overlay/overlayHostLocator.js +20 -0
- package/dist/SearchZeroState/types.d.cts +10 -0
- package/dist/SearchZeroState/types.d.ts +10 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.cjs +21 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.js +20 -0
- package/dist/SuggestionBar/SuggestionBar.cjs +74 -0
- package/dist/SuggestionBar/{index-DZU9kbWS.d.cts → SuggestionBar.d.cts} +4 -9
- package/dist/SuggestionBar/{index-DyXd4-b7.d.ts → SuggestionBar.d.ts} +6 -11
- package/dist/{SuggestionBar-BHAXhgcd.js → SuggestionBar/SuggestionBar.js} +7 -59
- package/dist/SuggestionBar/index.cjs +3 -3
- package/dist/SuggestionBar/index.d.cts +3 -0
- package/dist/SuggestionBar/index.d.ts +3 -0
- package/dist/SuggestionBar/index.js +2 -2
- package/dist/SuggestionBar/types.cjs +10 -0
- package/dist/SuggestionBar/types.d.cts +7 -0
- package/dist/SuggestionBar/types.d.ts +7 -0
- package/dist/SuggestionBar/types.js +9 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +76 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +6 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +6 -0
- package/dist/{SuggestionButtonContainer-s2e9YGW_.js → SuggestionButtonContainer/SuggestionButtonContainer.js} +6 -98
- package/dist/SuggestionButtonContainer/index.cjs +1 -1
- package/dist/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/SuggestionButtonContainer/index.js +1 -1
- package/dist/SuggestionButtonContainer/{index-B_X537jw.d.cts → types.d.cts} +1 -4
- package/dist/SuggestionButtonContainer/{index-vwelzDzM.d.ts → types.d.ts} +1 -4
- package/dist/{chunk-DSlc6foC.cjs → _virtual/rolldown_runtime.cjs} +2 -12
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/node_modules/react-icons/md/index.cjs +35 -0
- package/dist/node_modules/react-icons/md/index.js +35 -0
- package/dist/{SuggestionBar-CK5aU2bb.cjs → node_modules/react-indiana-drag-scroll/dist/index.cjs} +6 -132
- package/dist/node_modules/uuid/dist/native.js +6 -0
- package/dist/node_modules/uuid/dist/rng.js +13 -0
- package/dist/node_modules/uuid/dist/stringify.js +9 -0
- package/dist/node_modules/uuid/dist/v4.js +27 -0
- package/dist/node_modules/uuid/dist-node/native.cjs +8 -0
- package/dist/node_modules/uuid/dist-node/rng.cjs +16 -0
- package/dist/node_modules/uuid/dist-node/stringify.cjs +10 -0
- package/dist/node_modules/uuid/dist-node/v4.cjs +27 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.cjs +80 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.js +78 -0
- package/dist/packages/components/dist/components/Accordion/index.cjs +1 -0
- package/dist/packages/components/dist/components/Accordion/index.js +1 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +30 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +29 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +56 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +54 -0
- package/dist/packages/components/dist/components/ButtonBase/index.cjs +2 -0
- package/dist/packages/components/dist/components/ButtonBase/index.js +2 -0
- package/dist/packages/components/dist/components/ButtonBase/types.cjs +11 -0
- package/dist/packages/components/dist/components/ButtonBase/types.js +10 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +45 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +42 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +33 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +30 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +45 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +42 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +1 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +30 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +29 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +26 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +24 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +122 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +120 -0
- package/dist/packages/components/dist/components/ModalSheet/index.cjs +1 -0
- package/dist/packages/components/dist/components/ModalSheet/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +116 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +114 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +38 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +36 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +153 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.js +149 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +33 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +31 -0
- package/dist/packages/components/dist/components/ProductCard/index.cjs +4 -0
- package/dist/packages/components/dist/components/ProductCard/index.js +4 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +49 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +45 -0
- package/dist/packages/components/dist/components/ProductCard/types.cjs +10 -0
- package/dist/packages/components/dist/components/ProductCard/types.js +9 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +43 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +41 -0
- package/dist/packages/components/dist/components/ProductGrid/index.cjs +2 -0
- package/dist/packages/components/dist/components/ProductGrid/index.js +2 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +21 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +20 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +74 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.js +72 -0
- package/dist/packages/components/dist/components/RadioButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButton/index.js +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +42 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +39 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.js +1 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +53 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +51 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +3 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.js +3 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +72 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +69 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.js +1 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +134 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +132 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +48 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +46 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +42 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +40 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +6 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +4 -0
- package/dist/packages/components/dist/components/SearchFilter/index.cjs +5 -0
- package/dist/packages/components/dist/components/SearchFilter/index.js +5 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +27 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +26 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.cjs +11 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.js +9 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +81 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.js +78 -0
- package/dist/packages/components/dist/components/SearchInput/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchInput/index.js +2 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +15 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +15 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +57 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +55 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +50 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +24 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +23 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +36 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +35 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +34 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +34 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +56 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +54 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +53 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +60 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +57 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +3 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +77 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +75 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.js +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +12 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.js +11 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.cjs +40 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.js +38 -0
- package/dist/packages/components/dist/components/Spinner/index.cjs +1 -0
- package/dist/packages/components/dist/components/Spinner/index.js +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +193 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +188 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.js +1 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.cjs +34 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.js +31 -0
- package/dist/packages/components/dist/components/TextInput/index.cjs +1 -0
- package/dist/packages/components/dist/components/TextInput/index.js +1 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +63 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +61 -0
- package/dist/packages/components/dist/components/ToggleButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/ToggleButton/index.js +1 -0
- package/dist/packages/components/dist/components/Typography/Typography.cjs +53 -0
- package/dist/packages/components/dist/components/Typography/Typography.js +50 -0
- package/dist/packages/components/dist/components/Typography/index.cjs +2 -0
- package/dist/packages/components/dist/components/Typography/index.js +2 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +99 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +96 -0
- package/dist/packages/components/dist/components/Typography/util.cjs +10 -0
- package/dist/packages/components/dist/components/Typography/util.js +10 -0
- package/dist/packages/components/dist/logging/logger.cjs +20 -0
- package/dist/packages/components/dist/logging/logger.js +19 -0
- package/dist/packages/components/dist/models/colorsConfig.cjs +28 -0
- package/dist/packages/components/dist/models/colorsConfig.js +26 -0
- package/dist/packages/components/dist/util/formatPrice.cjs +14 -0
- package/dist/packages/components/dist/util/formatPrice.js +13 -0
- package/dist/packages/components/dist/util/index.cjs +3 -0
- package/dist/packages/components/dist/util/index.js +3 -0
- package/dist/packages/components/dist/util/useScrollDirection.cjs +39 -0
- package/dist/packages/components/dist/util/useScrollDirection.js +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.cjs +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.js +37 -0
- package/dist/packages/icons/dist/AiSearchBold.cjs +38 -0
- package/dist/packages/icons/dist/AiSearchBold.js +38 -0
- package/dist/packages/icons/dist/AiSearchThin.cjs +35 -0
- package/dist/packages/icons/dist/AiSearchThin.js +35 -0
- package/dist/packages/icons/dist/ChevronDown.cjs +23 -0
- package/dist/packages/icons/dist/ChevronDown.js +23 -0
- package/dist/packages/icons/dist/FourPointStar.cjs +22 -0
- package/dist/packages/icons/dist/FourPointStar.js +22 -0
- package/dist/packages/icons/dist/IconClose.cjs +26 -0
- package/dist/packages/icons/dist/IconClose.js +26 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +39 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +39 -0
- package/dist/packages/icons/dist/OutlinedStar.cjs +22 -0
- package/dist/packages/icons/dist/OutlinedStar.js +22 -0
- package/dist/packages/icons/dist/SettingsVariant.cjs +72 -0
- package/dist/packages/icons/dist/SettingsVariant.js +72 -0
- package/dist/packages/icons/dist/Sparkles.cjs +43 -0
- package/dist/packages/icons/dist/Sparkles.js +43 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +27 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/util/useHorizontalScrollAnimation.cjs +88 -0
- package/dist/util/useHorizontalScrollAnimation.js +87 -0
- package/dist/util/useReducedMotionWithOverride.cjs +15 -0
- package/dist/util/useReducedMotionWithOverride.js +14 -0
- package/package.json +3 -5
- package/src/SearchZeroState/SearchZeroState.tsx +1 -1
- package/src/SuggestionBar/SuggestionBar.tsx +2 -2
- package/dist/SearchZeroState/index-DSFtalZR.d.ts +0 -27
- package/dist/SearchZeroState/index-bEcxYOSF.d.cts +0 -27
- package/dist/SuggestionButtonContainer-Dm38gJiJ.cjs +0 -173
- /package/dist/SearchResults/{index-DCTxvwmv.d.cts → SearchResultsWidget.d.cts} +0 -0
- /package/dist/SearchResults/{index-CYPV3XE0.d.ts → SearchResultsWidget.d.ts} +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_ButtonBase = require('../ButtonBase/ButtonBase.cjs');
|
|
3
|
+
const require_OutlinedStar = require('../../../../icons/dist/OutlinedStar.cjs');
|
|
4
|
+
const require_FourPointStar = require('../../../../icons/dist/FourPointStar.cjs');
|
|
5
|
+
let classnames = require("classnames");
|
|
6
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
|
|
9
|
+
//#region ../components/dist/components/SuggestionButton/SuggestionButton.js
|
|
10
|
+
const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
11
|
+
const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
12
|
+
const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
13
|
+
const BORDER_CLASS = "spiffy-tw-border";
|
|
14
|
+
const TEXT_LINK_CLASSES = [
|
|
15
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
16
|
+
"spiffy-tw-fill-[--spiffy-colors-text-link]",
|
|
17
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-link]"
|
|
18
|
+
];
|
|
19
|
+
const TEXT_LIGHT_CLASSES = [
|
|
20
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
21
|
+
"spiffy-tw-fill-[--spiffy-colors-text-light]",
|
|
22
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]"
|
|
23
|
+
];
|
|
24
|
+
const TEXT_PRIMARY_CLASSES = [
|
|
25
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
26
|
+
"spiffy-tw-fill-[--spiffy-colors-text-primary]",
|
|
27
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]"
|
|
28
|
+
];
|
|
29
|
+
const ACCENT_PRIMARY_CLASSES = ["spiffy-tw-fill-[--spiffy-colors-accent-primary]", "spiffy-tw-stroke-[--spiffy-colors-accent-primary]"];
|
|
30
|
+
const DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-dark]", "spiffy-tw-border-[--spiffy-colors-background-dark]"];
|
|
31
|
+
const SECONDARY_DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]", "spiffy-tw-border-[--spiffy-colors-background-secondary-dark]"];
|
|
32
|
+
const variantClassMap = new Map([
|
|
33
|
+
["outlined", ["spiffy-tw-border-[--spiffy-colors-border-outline]", ...TEXT_LINK_CLASSES]],
|
|
34
|
+
["outlinedLight", [
|
|
35
|
+
"spiffy-tw-border-[--spiffy-colors-border-outline]",
|
|
36
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
37
|
+
...TEXT_LINK_CLASSES,
|
|
38
|
+
BORDER_CLASS
|
|
39
|
+
]],
|
|
40
|
+
["primary", [
|
|
41
|
+
"spiffy-tw-bg-[--spiffy-colors-background-primary]",
|
|
42
|
+
"spiffy-tw-border-[--spiffy-colors-background-primary]",
|
|
43
|
+
...TEXT_LIGHT_CLASSES,
|
|
44
|
+
BORDER_CLASS
|
|
45
|
+
]],
|
|
46
|
+
["secondary", [
|
|
47
|
+
"spiffy-tw-bg-[--spiffy-colors-background-secondary]",
|
|
48
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
49
|
+
"spiffy-tw-border-[--spiffy-colors-background-secondary]",
|
|
50
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
51
|
+
BORDER_CLASS
|
|
52
|
+
]],
|
|
53
|
+
["tertiary", [
|
|
54
|
+
"spiffy-tw-bg-[--spiffy-colors-background-tertiary]",
|
|
55
|
+
"spiffy-tw-border-[--spiffy-colors-background-tertiary]",
|
|
56
|
+
...TEXT_LINK_CLASSES,
|
|
57
|
+
BORDER_CLASS
|
|
58
|
+
]],
|
|
59
|
+
["dark", [
|
|
60
|
+
...DARK_BACKGROUND_CLASSES,
|
|
61
|
+
...TEXT_LIGHT_CLASSES,
|
|
62
|
+
BORDER_CLASS
|
|
63
|
+
]],
|
|
64
|
+
["darkPrimary", [
|
|
65
|
+
...DARK_BACKGROUND_CLASSES,
|
|
66
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
67
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
68
|
+
BORDER_CLASS
|
|
69
|
+
]],
|
|
70
|
+
["darkAccent", [
|
|
71
|
+
...DARK_BACKGROUND_CLASSES,
|
|
72
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
73
|
+
"spiffy-tw-fill-[--spiffy-colors-text-accent]",
|
|
74
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-accent]",
|
|
75
|
+
BORDER_CLASS
|
|
76
|
+
]],
|
|
77
|
+
["darkAccentContrast", [
|
|
78
|
+
...DARK_BACKGROUND_CLASSES,
|
|
79
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
80
|
+
"spiffy-tw-fill-[--spiffy-colors-accent-primary]",
|
|
81
|
+
"spiffy-tw-stroke-[--spiffy-colors-accent-primary]",
|
|
82
|
+
BORDER_CLASS
|
|
83
|
+
]],
|
|
84
|
+
["transparent", [
|
|
85
|
+
"spiffy-tw-bg-transparent",
|
|
86
|
+
"spiffy-tw-border-[--spiffy-colors-background-light]",
|
|
87
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
88
|
+
"spiffy-tw-fill-transparent",
|
|
89
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]",
|
|
90
|
+
BORDER_CLASS
|
|
91
|
+
]],
|
|
92
|
+
["transparentDark", [
|
|
93
|
+
"spiffy-tw-bg-transparent",
|
|
94
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]",
|
|
95
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
96
|
+
"spiffy-tw-fill-transparent",
|
|
97
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]",
|
|
98
|
+
BORDER_CLASS
|
|
99
|
+
]],
|
|
100
|
+
["secondaryDark", [
|
|
101
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
102
|
+
...TEXT_LINK_CLASSES,
|
|
103
|
+
BORDER_CLASS
|
|
104
|
+
]],
|
|
105
|
+
["secondaryAccent", [
|
|
106
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
107
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
108
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
109
|
+
BORDER_CLASS
|
|
110
|
+
]],
|
|
111
|
+
["lightDark", [
|
|
112
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
113
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]",
|
|
114
|
+
...TEXT_PRIMARY_CLASSES,
|
|
115
|
+
BORDER_CLASS
|
|
116
|
+
]]
|
|
117
|
+
]);
|
|
118
|
+
const Icon = ({ isAnswer, variant }) => {
|
|
119
|
+
if (isAnswer) return void 0;
|
|
120
|
+
if (variant === "transparentDark") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OutlinedStar.OutlinedStar_default, {});
|
|
121
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FourPointStar.FourPointStar_default, {});
|
|
122
|
+
};
|
|
123
|
+
const borderedVariants = [
|
|
124
|
+
"outlined",
|
|
125
|
+
"outlinedLight",
|
|
126
|
+
"primary",
|
|
127
|
+
"secondary",
|
|
128
|
+
"tertiary",
|
|
129
|
+
"dark",
|
|
130
|
+
"darkAccent",
|
|
131
|
+
"darkAccentContrast",
|
|
132
|
+
"darkPrimary",
|
|
133
|
+
"transparent",
|
|
134
|
+
"transparentDark",
|
|
135
|
+
"secondaryDark",
|
|
136
|
+
"secondaryAccent",
|
|
137
|
+
"lightDark"
|
|
138
|
+
];
|
|
139
|
+
const hoverTransform = (variantClass) => variantClass?.map((className) => `hover:${className}`);
|
|
140
|
+
const SuggestionButton = ({ variant, hoverVariant, isDisabled, content, boldText, borderRadius = "lg", isAnswer = false, dataAttributes, dataTestId, onClick }) => {
|
|
141
|
+
const buttonClassName = (0, classnames.default)({
|
|
142
|
+
[SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS]: !isAnswer,
|
|
143
|
+
[SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS]: isAnswer,
|
|
144
|
+
"!spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
145
|
+
"!spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
146
|
+
"!spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
147
|
+
"spiffy-tw-border-[1px]": borderedVariants.includes(variant),
|
|
148
|
+
"spiffy-tw-border-solid": borderedVariants.includes(variant)
|
|
149
|
+
});
|
|
150
|
+
const textClassName = (0, classnames.default)({
|
|
151
|
+
"spiffy-tw-text-[14px]": true,
|
|
152
|
+
"spiffy-tw-leading-[100%]": true,
|
|
153
|
+
"!spiffy-tw-font-bold": boldText
|
|
154
|
+
});
|
|
155
|
+
const iconClass = (0, classnames.default)({
|
|
156
|
+
"spiffy-tw-w-[11px]": true,
|
|
157
|
+
"spiffy-tw-h-[11px]": true,
|
|
158
|
+
"spiffy-tw-stroke-inherit": true,
|
|
159
|
+
"spiffy-tw-fill-inherit": true
|
|
160
|
+
});
|
|
161
|
+
const baseClasses = variantClassMap.get(variant) ?? [];
|
|
162
|
+
const hoverClasses = variantClassMap.get(hoverVariant) ?? [];
|
|
163
|
+
const baseBorderClasses = baseClasses.filter((cls) => cls.includes("border"));
|
|
164
|
+
const baseNonBorderClasses = baseClasses.filter((cls) => !cls.includes("border"));
|
|
165
|
+
const hoverBorderClasses = hoverClasses.filter((cls) => cls.includes("border"));
|
|
166
|
+
const hoverNonBorderClasses = hoverClasses.filter((cls) => !cls.includes("border"));
|
|
167
|
+
const buttonClass = `${buttonClassName} ${[
|
|
168
|
+
...baseNonBorderClasses,
|
|
169
|
+
...hoverTransform(hoverNonBorderClasses),
|
|
170
|
+
...baseBorderClasses,
|
|
171
|
+
...hoverTransform(hoverBorderClasses)
|
|
172
|
+
].join(" ")}`;
|
|
173
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
|
|
174
|
+
text: content,
|
|
175
|
+
dataAttributes,
|
|
176
|
+
dataTestId,
|
|
177
|
+
isDisabled,
|
|
178
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
|
|
179
|
+
isAnswer,
|
|
180
|
+
variant
|
|
181
|
+
}),
|
|
182
|
+
iconClass: isAnswer ? void 0 : iconClass,
|
|
183
|
+
textClass: `${SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS} ${textClassName}`,
|
|
184
|
+
buttonClass,
|
|
185
|
+
onClick
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
exports.SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS;
|
|
191
|
+
exports.SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS;
|
|
192
|
+
exports.SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS;
|
|
193
|
+
exports.SuggestionButton = SuggestionButton;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { ButtonBase } from "../ButtonBase/ButtonBase.js";
|
|
2
|
+
import { OutlinedStar_default } from "../../../../icons/dist/OutlinedStar.js";
|
|
3
|
+
import { FourPointStar_default } from "../../../../icons/dist/FourPointStar.js";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region ../components/dist/components/SuggestionButton/SuggestionButton.js
|
|
8
|
+
const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = "spiffy-suggestion-button-question-class";
|
|
9
|
+
const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = "spiffy-suggestion-button-answer-class";
|
|
10
|
+
const SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS = "spiffy-suggestion-button-text-class";
|
|
11
|
+
const BORDER_CLASS = "spiffy-tw-border";
|
|
12
|
+
const TEXT_LINK_CLASSES = [
|
|
13
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
14
|
+
"spiffy-tw-fill-[--spiffy-colors-text-link]",
|
|
15
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-link]"
|
|
16
|
+
];
|
|
17
|
+
const TEXT_LIGHT_CLASSES = [
|
|
18
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
19
|
+
"spiffy-tw-fill-[--spiffy-colors-text-light]",
|
|
20
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]"
|
|
21
|
+
];
|
|
22
|
+
const TEXT_PRIMARY_CLASSES = [
|
|
23
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
24
|
+
"spiffy-tw-fill-[--spiffy-colors-text-primary]",
|
|
25
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]"
|
|
26
|
+
];
|
|
27
|
+
const ACCENT_PRIMARY_CLASSES = ["spiffy-tw-fill-[--spiffy-colors-accent-primary]", "spiffy-tw-stroke-[--spiffy-colors-accent-primary]"];
|
|
28
|
+
const DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-dark]", "spiffy-tw-border-[--spiffy-colors-background-dark]"];
|
|
29
|
+
const SECONDARY_DARK_BACKGROUND_CLASSES = ["spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]", "spiffy-tw-border-[--spiffy-colors-background-secondary-dark]"];
|
|
30
|
+
const variantClassMap = new Map([
|
|
31
|
+
["outlined", ["spiffy-tw-border-[--spiffy-colors-border-outline]", ...TEXT_LINK_CLASSES]],
|
|
32
|
+
["outlinedLight", [
|
|
33
|
+
"spiffy-tw-border-[--spiffy-colors-border-outline]",
|
|
34
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
35
|
+
...TEXT_LINK_CLASSES,
|
|
36
|
+
BORDER_CLASS
|
|
37
|
+
]],
|
|
38
|
+
["primary", [
|
|
39
|
+
"spiffy-tw-bg-[--spiffy-colors-background-primary]",
|
|
40
|
+
"spiffy-tw-border-[--spiffy-colors-background-primary]",
|
|
41
|
+
...TEXT_LIGHT_CLASSES,
|
|
42
|
+
BORDER_CLASS
|
|
43
|
+
]],
|
|
44
|
+
["secondary", [
|
|
45
|
+
"spiffy-tw-bg-[--spiffy-colors-background-secondary]",
|
|
46
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
47
|
+
"spiffy-tw-border-[--spiffy-colors-background-secondary]",
|
|
48
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
49
|
+
BORDER_CLASS
|
|
50
|
+
]],
|
|
51
|
+
["tertiary", [
|
|
52
|
+
"spiffy-tw-bg-[--spiffy-colors-background-tertiary]",
|
|
53
|
+
"spiffy-tw-border-[--spiffy-colors-background-tertiary]",
|
|
54
|
+
...TEXT_LINK_CLASSES,
|
|
55
|
+
BORDER_CLASS
|
|
56
|
+
]],
|
|
57
|
+
["dark", [
|
|
58
|
+
...DARK_BACKGROUND_CLASSES,
|
|
59
|
+
...TEXT_LIGHT_CLASSES,
|
|
60
|
+
BORDER_CLASS
|
|
61
|
+
]],
|
|
62
|
+
["darkPrimary", [
|
|
63
|
+
...DARK_BACKGROUND_CLASSES,
|
|
64
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
65
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
66
|
+
BORDER_CLASS
|
|
67
|
+
]],
|
|
68
|
+
["darkAccent", [
|
|
69
|
+
...DARK_BACKGROUND_CLASSES,
|
|
70
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
71
|
+
"spiffy-tw-fill-[--spiffy-colors-text-accent]",
|
|
72
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-accent]",
|
|
73
|
+
BORDER_CLASS
|
|
74
|
+
]],
|
|
75
|
+
["darkAccentContrast", [
|
|
76
|
+
...DARK_BACKGROUND_CLASSES,
|
|
77
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
78
|
+
"spiffy-tw-fill-[--spiffy-colors-accent-primary]",
|
|
79
|
+
"spiffy-tw-stroke-[--spiffy-colors-accent-primary]",
|
|
80
|
+
BORDER_CLASS
|
|
81
|
+
]],
|
|
82
|
+
["transparent", [
|
|
83
|
+
"spiffy-tw-bg-transparent",
|
|
84
|
+
"spiffy-tw-border-[--spiffy-colors-background-light]",
|
|
85
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]",
|
|
86
|
+
"spiffy-tw-fill-transparent",
|
|
87
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-light]",
|
|
88
|
+
BORDER_CLASS
|
|
89
|
+
]],
|
|
90
|
+
["transparentDark", [
|
|
91
|
+
"spiffy-tw-bg-transparent",
|
|
92
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]",
|
|
93
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]",
|
|
94
|
+
"spiffy-tw-fill-transparent",
|
|
95
|
+
"spiffy-tw-stroke-[--spiffy-colors-text-primary]",
|
|
96
|
+
BORDER_CLASS
|
|
97
|
+
]],
|
|
98
|
+
["secondaryDark", [
|
|
99
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
100
|
+
...TEXT_LINK_CLASSES,
|
|
101
|
+
BORDER_CLASS
|
|
102
|
+
]],
|
|
103
|
+
["secondaryAccent", [
|
|
104
|
+
...SECONDARY_DARK_BACKGROUND_CLASSES,
|
|
105
|
+
"spiffy-tw-text-[--spiffy-colors-text-link]",
|
|
106
|
+
...ACCENT_PRIMARY_CLASSES,
|
|
107
|
+
BORDER_CLASS
|
|
108
|
+
]],
|
|
109
|
+
["lightDark", [
|
|
110
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]",
|
|
111
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]",
|
|
112
|
+
...TEXT_PRIMARY_CLASSES,
|
|
113
|
+
BORDER_CLASS
|
|
114
|
+
]]
|
|
115
|
+
]);
|
|
116
|
+
const Icon = ({ isAnswer, variant }) => {
|
|
117
|
+
if (isAnswer) return void 0;
|
|
118
|
+
if (variant === "transparentDark") return /* @__PURE__ */ jsx(OutlinedStar_default, {});
|
|
119
|
+
return /* @__PURE__ */ jsx(FourPointStar_default, {});
|
|
120
|
+
};
|
|
121
|
+
const borderedVariants = [
|
|
122
|
+
"outlined",
|
|
123
|
+
"outlinedLight",
|
|
124
|
+
"primary",
|
|
125
|
+
"secondary",
|
|
126
|
+
"tertiary",
|
|
127
|
+
"dark",
|
|
128
|
+
"darkAccent",
|
|
129
|
+
"darkAccentContrast",
|
|
130
|
+
"darkPrimary",
|
|
131
|
+
"transparent",
|
|
132
|
+
"transparentDark",
|
|
133
|
+
"secondaryDark",
|
|
134
|
+
"secondaryAccent",
|
|
135
|
+
"lightDark"
|
|
136
|
+
];
|
|
137
|
+
const hoverTransform = (variantClass) => variantClass?.map((className) => `hover:${className}`);
|
|
138
|
+
const SuggestionButton = ({ variant, hoverVariant, isDisabled, content, boldText, borderRadius = "lg", isAnswer = false, dataAttributes, dataTestId, onClick }) => {
|
|
139
|
+
const buttonClassName = classNames({
|
|
140
|
+
[SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS]: !isAnswer,
|
|
141
|
+
[SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS]: isAnswer,
|
|
142
|
+
"!spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
143
|
+
"!spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
144
|
+
"!spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
145
|
+
"spiffy-tw-border-[1px]": borderedVariants.includes(variant),
|
|
146
|
+
"spiffy-tw-border-solid": borderedVariants.includes(variant)
|
|
147
|
+
});
|
|
148
|
+
const textClassName = classNames({
|
|
149
|
+
"spiffy-tw-text-[14px]": true,
|
|
150
|
+
"spiffy-tw-leading-[100%]": true,
|
|
151
|
+
"!spiffy-tw-font-bold": boldText
|
|
152
|
+
});
|
|
153
|
+
const iconClass = classNames({
|
|
154
|
+
"spiffy-tw-w-[11px]": true,
|
|
155
|
+
"spiffy-tw-h-[11px]": true,
|
|
156
|
+
"spiffy-tw-stroke-inherit": true,
|
|
157
|
+
"spiffy-tw-fill-inherit": true
|
|
158
|
+
});
|
|
159
|
+
const baseClasses = variantClassMap.get(variant) ?? [];
|
|
160
|
+
const hoverClasses = variantClassMap.get(hoverVariant) ?? [];
|
|
161
|
+
const baseBorderClasses = baseClasses.filter((cls) => cls.includes("border"));
|
|
162
|
+
const baseNonBorderClasses = baseClasses.filter((cls) => !cls.includes("border"));
|
|
163
|
+
const hoverBorderClasses = hoverClasses.filter((cls) => cls.includes("border"));
|
|
164
|
+
const hoverNonBorderClasses = hoverClasses.filter((cls) => !cls.includes("border"));
|
|
165
|
+
const buttonClass = `${buttonClassName} ${[
|
|
166
|
+
...baseNonBorderClasses,
|
|
167
|
+
...hoverTransform(hoverNonBorderClasses),
|
|
168
|
+
...baseBorderClasses,
|
|
169
|
+
...hoverTransform(hoverBorderClasses)
|
|
170
|
+
].join(" ")}`;
|
|
171
|
+
return /* @__PURE__ */ jsx(ButtonBase, {
|
|
172
|
+
text: content,
|
|
173
|
+
dataAttributes,
|
|
174
|
+
dataTestId,
|
|
175
|
+
isDisabled,
|
|
176
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
177
|
+
isAnswer,
|
|
178
|
+
variant
|
|
179
|
+
}),
|
|
180
|
+
iconClass: isAnswer ? void 0 : iconClass,
|
|
181
|
+
textClass: `${SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS} ${textClassName}`,
|
|
182
|
+
buttonClass,
|
|
183
|
+
onClick
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
export { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_SuggestionButton = require('./SuggestionButton.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton } from "./SuggestionButton.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_typographyVariantClasses = require('../Typography/typographyVariantClasses.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
|
|
10
|
+
//#region ../components/dist/components/TextInput/TextInput.js
|
|
11
|
+
const TextInput = react.default.forwardRef(({ className, borderRadius, borderColorClass, placeholderVariant, ...rest }, ref) => {
|
|
12
|
+
const placeholderVariantClassNames = require_typographyVariantClasses.getVariantPlaceholderClassNames(placeholderVariant ? require_typographyVariantClasses.TypographyVariantMap[placeholderVariant] : {});
|
|
13
|
+
const inputClasses = (0, classnames.default)([
|
|
14
|
+
{
|
|
15
|
+
"spiffy-text-input": true,
|
|
16
|
+
"spiffy-tw-outline-none": true,
|
|
17
|
+
"spiffy-tw-rounded-[64px]": borderRadius === "xl",
|
|
18
|
+
"spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
19
|
+
"spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
20
|
+
"spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
21
|
+
...placeholderVariantClassNames
|
|
22
|
+
},
|
|
23
|
+
borderColorClass,
|
|
24
|
+
className
|
|
25
|
+
]);
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
27
|
+
ref,
|
|
28
|
+
...rest,
|
|
29
|
+
className: inputClasses
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.TextInput = TextInput;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TypographyVariantMap, getVariantPlaceholderClassNames } from "../Typography/typographyVariantClasses.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region ../components/dist/components/TextInput/TextInput.js
|
|
8
|
+
const TextInput = React.forwardRef(({ className, borderRadius, borderColorClass, placeholderVariant, ...rest }, ref) => {
|
|
9
|
+
const placeholderVariantClassNames = getVariantPlaceholderClassNames(placeholderVariant ? TypographyVariantMap[placeholderVariant] : {});
|
|
10
|
+
const inputClasses = classNames([
|
|
11
|
+
{
|
|
12
|
+
"spiffy-text-input": true,
|
|
13
|
+
"spiffy-tw-outline-none": true,
|
|
14
|
+
"spiffy-tw-rounded-[64px]": borderRadius === "xl",
|
|
15
|
+
"spiffy-tw-rounded-[20px]": borderRadius === "lg",
|
|
16
|
+
"spiffy-tw-rounded-[8px]": borderRadius === "md",
|
|
17
|
+
"spiffy-tw-rounded-[0px]": borderRadius === "sm",
|
|
18
|
+
...placeholderVariantClassNames
|
|
19
|
+
},
|
|
20
|
+
borderColorClass,
|
|
21
|
+
className
|
|
22
|
+
]);
|
|
23
|
+
return /* @__PURE__ */ jsx("input", {
|
|
24
|
+
ref,
|
|
25
|
+
...rest,
|
|
26
|
+
className: inputClasses
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TextInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_TextInput = require('./TextInput.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { TextInput } from "./TextInput.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Typography = require('../Typography/Typography.cjs');
|
|
3
|
+
require('../Typography/index.cjs');
|
|
4
|
+
let classnames = require("classnames");
|
|
5
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region ../components/dist/components/ToggleButton/ToggleButton.js
|
|
9
|
+
const toggleButtonVariants = { default: {
|
|
10
|
+
button: ({ isSelected }) => (0, classnames.default)({
|
|
11
|
+
"spiffy-tw-bg-[--spiffy-colors-background-dark]": isSelected,
|
|
12
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]": isSelected,
|
|
13
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]": isSelected,
|
|
14
|
+
"hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]": true,
|
|
15
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-primary]": isSelected,
|
|
16
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]": !isSelected,
|
|
17
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]": !isSelected,
|
|
18
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": !isSelected
|
|
19
|
+
}),
|
|
20
|
+
label: () => "",
|
|
21
|
+
secondaryLabel: ({ isSelected }) => (0, classnames.default)({
|
|
22
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected,
|
|
23
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected
|
|
24
|
+
})
|
|
25
|
+
} };
|
|
26
|
+
const ToggleButton = ({ isSelected, onClick, label, buttonClassName, labelClassName, secondaryLabel, secondaryLabelClassName, icon, iconClassName, variant }) => {
|
|
27
|
+
const buttonClassNames = (0, classnames.default)({
|
|
28
|
+
"spiffy-tw-flex": true,
|
|
29
|
+
"spiffy-tw-items-center": true,
|
|
30
|
+
"spiffy-tw-gap-[4px]": true,
|
|
31
|
+
"spiffy-tw-cursor-pointer": true,
|
|
32
|
+
"spiffy-tw-py-[8px]": true,
|
|
33
|
+
"spiffy-tw-px-[12px]": true,
|
|
34
|
+
"spiffy-tw-rounded-[200px]": true,
|
|
35
|
+
"spiffy-tw-border": true
|
|
36
|
+
}, toggleButtonVariants?.[variant]?.button({ isSelected }), buttonClassName);
|
|
37
|
+
const labelClassNames = (0, classnames.default)({}, toggleButtonVariants?.[variant]?.label({ isSelected }), labelClassName);
|
|
38
|
+
const secondaryLabelClassNames = (0, classnames.default)({}, toggleButtonVariants?.[variant]?.secondaryLabel({ isSelected }), secondaryLabelClassName);
|
|
39
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
40
|
+
className: buttonClassNames,
|
|
41
|
+
onClick,
|
|
42
|
+
type: "button",
|
|
43
|
+
children: [
|
|
44
|
+
icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
|
+
className: iconClassName,
|
|
46
|
+
children: icon
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
49
|
+
variant: "body3",
|
|
50
|
+
className: labelClassNames,
|
|
51
|
+
children: label
|
|
52
|
+
}),
|
|
53
|
+
secondaryLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
54
|
+
variant: "body4",
|
|
55
|
+
className: secondaryLabelClassNames,
|
|
56
|
+
children: secondaryLabel
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.ToggleButton = ToggleButton;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Typography } from "../Typography/Typography.js";
|
|
2
|
+
import "../Typography/index.js";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region ../components/dist/components/ToggleButton/ToggleButton.js
|
|
7
|
+
const toggleButtonVariants = { default: {
|
|
8
|
+
button: ({ isSelected }) => classNames({
|
|
9
|
+
"spiffy-tw-bg-[--spiffy-colors-background-dark]": isSelected,
|
|
10
|
+
"spiffy-tw-border-[--spiffy-colors-background-dark]": isSelected,
|
|
11
|
+
"spiffy-tw-text-[--spiffy-colors-text-light]": isSelected,
|
|
12
|
+
"hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]": true,
|
|
13
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-primary]": isSelected,
|
|
14
|
+
"spiffy-tw-bg-[--spiffy-colors-background-light]": !isSelected,
|
|
15
|
+
"spiffy-tw-border-[--spiffy-colors-border-light]": !isSelected,
|
|
16
|
+
"spiffy-tw-text-[--spiffy-colors-text-primary]": !isSelected
|
|
17
|
+
}),
|
|
18
|
+
label: () => "",
|
|
19
|
+
secondaryLabel: ({ isSelected }) => classNames({
|
|
20
|
+
"spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected,
|
|
21
|
+
"hover:spiffy-tw-text-[--spiffy-colors-text-secondary]": !isSelected
|
|
22
|
+
})
|
|
23
|
+
} };
|
|
24
|
+
const ToggleButton = ({ isSelected, onClick, label, buttonClassName, labelClassName, secondaryLabel, secondaryLabelClassName, icon, iconClassName, variant }) => {
|
|
25
|
+
const buttonClassNames = classNames({
|
|
26
|
+
"spiffy-tw-flex": true,
|
|
27
|
+
"spiffy-tw-items-center": true,
|
|
28
|
+
"spiffy-tw-gap-[4px]": true,
|
|
29
|
+
"spiffy-tw-cursor-pointer": true,
|
|
30
|
+
"spiffy-tw-py-[8px]": true,
|
|
31
|
+
"spiffy-tw-px-[12px]": true,
|
|
32
|
+
"spiffy-tw-rounded-[200px]": true,
|
|
33
|
+
"spiffy-tw-border": true
|
|
34
|
+
}, toggleButtonVariants?.[variant]?.button({ isSelected }), buttonClassName);
|
|
35
|
+
const labelClassNames = classNames({}, toggleButtonVariants?.[variant]?.label({ isSelected }), labelClassName);
|
|
36
|
+
const secondaryLabelClassNames = classNames({}, toggleButtonVariants?.[variant]?.secondaryLabel({ isSelected }), secondaryLabelClassName);
|
|
37
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
38
|
+
className: buttonClassNames,
|
|
39
|
+
onClick,
|
|
40
|
+
type: "button",
|
|
41
|
+
children: [
|
|
42
|
+
icon && /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: iconClassName,
|
|
44
|
+
children: icon
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx(Typography, {
|
|
47
|
+
variant: "body3",
|
|
48
|
+
className: labelClassNames,
|
|
49
|
+
children: label
|
|
50
|
+
}),
|
|
51
|
+
secondaryLabel && /* @__PURE__ */ jsx(Typography, {
|
|
52
|
+
variant: "body4",
|
|
53
|
+
className: secondaryLabelClassNames,
|
|
54
|
+
children: secondaryLabel
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ToggleButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const require_ToggleButton = require('./ToggleButton.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ToggleButton } from "./ToggleButton.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_typographyVariantClasses = require('./typographyVariantClasses.cjs');
|
|
3
|
+
const require_util = require('./util.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
8
|
+
|
|
9
|
+
//#region ../components/dist/components/Typography/Typography.js
|
|
10
|
+
const Typography = ({ children, className, style, noOfLines, testId, elementType, variant = "body3", id }) => {
|
|
11
|
+
const variantClassNames = variant ? require_typographyVariantClasses.TypographyVariantMap[variant] : {};
|
|
12
|
+
const isHeadline = (0, react.useCallback)(() => [
|
|
13
|
+
"t1",
|
|
14
|
+
"t2",
|
|
15
|
+
"t3",
|
|
16
|
+
"h1",
|
|
17
|
+
"h2",
|
|
18
|
+
"h3",
|
|
19
|
+
"h4"
|
|
20
|
+
].includes(variant), [variant]);
|
|
21
|
+
const renderedElementType = (0, react.useMemo)(() => {
|
|
22
|
+
if (elementType) return elementType;
|
|
23
|
+
if (!elementType) {
|
|
24
|
+
if (isHeadline()) return require_util.getElementTypeFromVariant(variant, isHeadline());
|
|
25
|
+
}
|
|
26
|
+
return "span";
|
|
27
|
+
}, [
|
|
28
|
+
isHeadline,
|
|
29
|
+
variant,
|
|
30
|
+
elementType
|
|
31
|
+
]);
|
|
32
|
+
const textClassNames = (0, classnames.default)(className, variantClassNames, {
|
|
33
|
+
"spiffy-tw-font-[Poppins,sans-serif]": isHeadline(),
|
|
34
|
+
"spiffy-tw-font-[\"Inter Variable,sans-serif\"]": !isHeadline(),
|
|
35
|
+
"spiffy-tw-line-clamp-1": noOfLines === 1,
|
|
36
|
+
"spiffy-tw-line-clamp-2": noOfLines === 2,
|
|
37
|
+
"spiffy-tw-line-clamp-3": noOfLines === 3,
|
|
38
|
+
"spiffy-tw-line-clamp-4": noOfLines === 4,
|
|
39
|
+
"spiffy-tw-line-clamp-5": noOfLines === 5,
|
|
40
|
+
"spiffy-tw-line-clamp-6": noOfLines === 6,
|
|
41
|
+
"spiffy-tw-line-clamp-7": noOfLines === 7
|
|
42
|
+
});
|
|
43
|
+
const renderElement = (elementTypeToRender) => react.default.createElement(elementTypeToRender, {
|
|
44
|
+
"data-testid": testId,
|
|
45
|
+
className: textClassNames,
|
|
46
|
+
style,
|
|
47
|
+
id
|
|
48
|
+
}, children);
|
|
49
|
+
return renderElement(renderedElementType);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.Typography = Typography;
|