@envive-ai/react-widgets 0.1.3 → 0.3.0
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 +8 -12
- package/dist/SearchResults/SearchResults.js +4 -8
- package/dist/SearchResults/SearchResultsWidget.cjs +1 -1
- package/dist/SearchResults/SearchResultsWidget.d.cts +2 -2
- package/dist/SearchResults/SearchResultsWidget.js +1 -1
- package/dist/SearchResults/withSearchResults.cjs +1 -1
- package/dist/SearchResults/withSearchResults.js +1 -1
- package/dist/SearchZeroState/SearchIcon.cjs +2 -3
- package/dist/SearchZeroState/SearchIcon.js +1 -2
- package/dist/SearchZeroState/SearchZeroState.cjs +10 -14
- package/dist/SearchZeroState/SearchZeroState.js +5 -9
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +1 -1
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +2 -2
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +2 -2
- package/dist/SearchZeroState/SearchZeroStateWidget.js +1 -1
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +5 -7
- package/dist/SearchZeroState/components/RecommendedProducts.js +3 -5
- package/dist/SearchZeroState/index.d.cts +2 -1
- package/dist/SearchZeroState/index.d.ts +2 -1
- package/dist/SearchZeroState/types.d.cts +2 -2
- package/dist/SearchZeroState/types.d.ts +2 -2
- package/dist/SuggestionBar/SuggestionBar.cjs +1 -1
- package/dist/SuggestionBar/SuggestionBar.d.cts +1 -1
- package/dist/SuggestionBar/SuggestionBar.d.ts +3 -3
- package/dist/SuggestionBar/SuggestionBar.js +2 -2
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +6 -7
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +2 -3
- package/dist/SuggestionButtonContainer/types.d.cts +2 -2
- package/dist/SuggestionButtonContainer/types.d.ts +2 -2
- package/dist/hooks/dist/contexts/types.d.cts +52 -0
- package/dist/hooks/dist/types/test-types.d.cts +8 -0
- package/dist/packages/hooks/dist/contexts/types.d.ts +52 -0
- package/dist/packages/hooks/dist/types/test-types.d.ts +8 -0
- package/package.json +3 -1
- package/dist/node_modules/react-icons/lib/iconBase.cjs +0 -121
- package/dist/node_modules/react-icons/lib/iconBase.js +0 -119
- package/dist/node_modules/react-icons/lib/iconContext.cjs +0 -17
- package/dist/node_modules/react-icons/lib/iconContext.js +0 -14
- package/dist/node_modules/react-icons/md/index.cjs +0 -35
- package/dist/node_modules/react-icons/md/index.js +0 -35
- package/dist/packages/components/dist/components/Accordion/Accordion.cjs +0 -80
- package/dist/packages/components/dist/components/Accordion/Accordion.js +0 -78
- package/dist/packages/components/dist/components/Accordion/index.cjs +0 -1
- package/dist/packages/components/dist/components/Accordion/index.js +0 -1
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +0 -30
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +0 -29
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +0 -56
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +0 -54
- package/dist/packages/components/dist/components/ButtonBase/index.cjs +0 -2
- package/dist/packages/components/dist/components/ButtonBase/index.js +0 -2
- package/dist/packages/components/dist/components/ButtonBase/types.cjs +0 -11
- package/dist/packages/components/dist/components/ButtonBase/types.js +0 -10
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +0 -45
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +0 -42
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +0 -33
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +0 -30
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +0 -45
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +0 -42
- package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +0 -1
- package/dist/packages/components/dist/components/ImageWithFallback/index.js +0 -1
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +0 -30
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +0 -29
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +0 -26
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +0 -24
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +0 -122
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +0 -120
- package/dist/packages/components/dist/components/ModalSheet/index.cjs +0 -1
- package/dist/packages/components/dist/components/ModalSheet/index.js +0 -1
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +0 -116
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +0 -114
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +0 -38
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +0 -36
- package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +0 -153
- package/dist/packages/components/dist/components/ProductCard/ProductCard.js +0 -149
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +0 -33
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +0 -31
- package/dist/packages/components/dist/components/ProductCard/index.cjs +0 -4
- package/dist/packages/components/dist/components/ProductCard/index.js +0 -4
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +0 -49
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +0 -45
- package/dist/packages/components/dist/components/ProductCard/types.cjs +0 -10
- package/dist/packages/components/dist/components/ProductCard/types.js +0 -9
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +0 -43
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +0 -41
- package/dist/packages/components/dist/components/ProductGrid/index.cjs +0 -2
- package/dist/packages/components/dist/components/ProductGrid/index.js +0 -2
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +0 -21
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +0 -20
- package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +0 -74
- package/dist/packages/components/dist/components/RadioButton/RadioButton.js +0 -72
- package/dist/packages/components/dist/components/RadioButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/RadioButton/index.js +0 -1
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +0 -42
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +0 -39
- package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +0 -1
- package/dist/packages/components/dist/components/RadioButtonGroup/index.js +0 -1
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +0 -53
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +0 -51
- package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +0 -3
- package/dist/packages/components/dist/components/RecommendedProducts/index.js +0 -3
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +0 -72
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +0 -69
- package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchAutocomplete/index.js +0 -1
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +0 -134
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +0 -132
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +0 -48
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +0 -46
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +0 -42
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +0 -40
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +0 -6
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +0 -4
- package/dist/packages/components/dist/components/SearchFilter/index.cjs +0 -5
- package/dist/packages/components/dist/components/SearchFilter/index.js +0 -5
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +0 -27
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +0 -26
- package/dist/packages/components/dist/components/SearchFilter/utils.cjs +0 -11
- package/dist/packages/components/dist/components/SearchFilter/utils.js +0 -9
- package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +0 -81
- package/dist/packages/components/dist/components/SearchInput/SearchInput.js +0 -78
- package/dist/packages/components/dist/components/SearchInput/index.cjs +0 -2
- package/dist/packages/components/dist/components/SearchInput/index.js +0 -2
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +0 -15
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +0 -15
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +0 -57
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +0 -55
- package/dist/packages/components/dist/components/SearchInputForm/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchInputForm/index.js +0 -1
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +0 -52
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +0 -50
- package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +0 -1
- package/dist/packages/components/dist/components/SearchResultsContent/index.js +0 -1
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +0 -24
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +0 -23
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +0 -36
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +0 -35
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +0 -9
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -9
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +0 -2
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +0 -2
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +0 -34
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -34
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +0 -56
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +0 -54
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +0 -53
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +0 -51
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +0 -52
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +0 -51
- package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsStates/index.js +0 -3
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +0 -60
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +0 -57
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +0 -3
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +0 -3
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +0 -77
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +0 -75
- package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +0 -2
- package/dist/packages/components/dist/components/SparkleAnimation/index.js +0 -2
- package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +0 -12
- package/dist/packages/components/dist/components/SparkleAnimation/types.js +0 -11
- package/dist/packages/components/dist/components/Spinner/Spinner.cjs +0 -40
- package/dist/packages/components/dist/components/Spinner/Spinner.js +0 -38
- package/dist/packages/components/dist/components/Spinner/index.cjs +0 -1
- package/dist/packages/components/dist/components/Spinner/index.js +0 -1
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +0 -193
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +0 -188
- package/dist/packages/components/dist/components/SuggestionButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/SuggestionButton/index.js +0 -1
- package/dist/packages/components/dist/components/TextInput/TextInput.cjs +0 -34
- package/dist/packages/components/dist/components/TextInput/TextInput.js +0 -31
- package/dist/packages/components/dist/components/TextInput/index.cjs +0 -1
- package/dist/packages/components/dist/components/TextInput/index.js +0 -1
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +0 -63
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +0 -61
- package/dist/packages/components/dist/components/ToggleButton/index.cjs +0 -1
- package/dist/packages/components/dist/components/ToggleButton/index.js +0 -1
- package/dist/packages/components/dist/components/Typography/Typography.cjs +0 -53
- package/dist/packages/components/dist/components/Typography/Typography.js +0 -50
- package/dist/packages/components/dist/components/Typography/index.cjs +0 -2
- package/dist/packages/components/dist/components/Typography/index.js +0 -2
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +0 -99
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +0 -96
- package/dist/packages/components/dist/components/Typography/util.cjs +0 -10
- package/dist/packages/components/dist/components/Typography/util.js +0 -10
- package/dist/packages/components/dist/logging/logger.cjs +0 -20
- package/dist/packages/components/dist/logging/logger.js +0 -19
- package/dist/packages/components/dist/models/colorsConfig.cjs +0 -28
- package/dist/packages/components/dist/models/colorsConfig.js +0 -26
- package/dist/packages/components/dist/util/formatPrice.cjs +0 -14
- package/dist/packages/components/dist/util/formatPrice.js +0 -13
- package/dist/packages/components/dist/util/index.cjs +0 -3
- package/dist/packages/components/dist/util/index.js +0 -3
- package/dist/packages/components/dist/util/useScrollDirection.cjs +0 -39
- package/dist/packages/components/dist/util/useScrollDirection.js +0 -38
- package/dist/packages/components/dist/util/useStickyVisibility.cjs +0 -38
- package/dist/packages/components/dist/util/useStickyVisibility.js +0 -37
- package/dist/packages/icons/dist/ChevronDown.cjs +0 -23
- package/dist/packages/icons/dist/ChevronDown.js +0 -23
- package/dist/packages/icons/dist/FourPointStar.cjs +0 -22
- package/dist/packages/icons/dist/FourPointStar.js +0 -22
- package/dist/packages/icons/dist/IconClose.cjs +0 -26
- package/dist/packages/icons/dist/IconClose.js +0 -26
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +0 -39
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +0 -39
- package/dist/packages/icons/dist/OutlinedStar.cjs +0 -22
- package/dist/packages/icons/dist/OutlinedStar.js +0 -22
- package/dist/packages/icons/dist/SettingsVariant.cjs +0 -72
- package/dist/packages/icons/dist/SettingsVariant.js +0 -72
|
@@ -1,193 +0,0 @@
|
|
|
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;
|
|
@@ -1,188 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_SuggestionButton = require('./SuggestionButton.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS, SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS, SPIFFY_SUGGESTION_BUTTON_TEXT_CLASS, SuggestionButton } from "./SuggestionButton.js";
|
|
@@ -1,34 +0,0 @@
|
|
|
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;
|
|
@@ -1,31 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_TextInput = require('./TextInput.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { TextInput } from "./TextInput.js";
|
|
@@ -1,63 +0,0 @@
|
|
|
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;
|
|
@@ -1,61 +0,0 @@
|
|
|
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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const require_ToggleButton = require('./ToggleButton.cjs');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ToggleButton } from "./ToggleButton.js";
|
|
@@ -1,53 +0,0 @@
|
|
|
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;
|