@envive-ai/react-toolkit 0.1.1 → 0.1.2
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/AppliedFiltersScrollbar-BlcyhZkZ.cjs +53 -0
- package/dist/AppliedFiltersScrollbar-DFGzRemu.js +44 -0
- package/dist/ButtonBase-C1rsL9gO.js +60 -0
- package/dist/ButtonBase-a8uj6c2f.cjs +69 -0
- package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +41 -0
- package/dist/DynamicFiltersScrollbar-Dys6geP0.js +32 -0
- package/dist/Headline-L7w3BsBF.cjs +72 -0
- package/dist/Headline-ro_Nigw5.js +64 -0
- package/dist/ImageWithFallback-CfmkC58B.js +42 -0
- package/dist/ImageWithFallback-P3AjyL2Y.cjs +51 -0
- package/dist/ProductCard-Btg8tHGc.js +172 -0
- package/dist/ProductCard-CS6DZAwO.cjs +193 -0
- package/dist/ProductCardSkeleton-BPfp6IOp.js +38 -0
- package/dist/ProductCardSkeleton-BgvDlaty.cjs +46 -0
- package/dist/ProductGrid-B7QZfW-v.cjs +77 -0
- package/dist/ProductGrid-DB_Uq5F-.js +69 -0
- package/dist/SearchAutocomplete-C5FL82xC.js +51 -0
- package/dist/SearchAutocomplete-wr18dJ8L.cjs +62 -0
- package/dist/SearchFilter-D-2IdBKS.js +62 -0
- package/dist/SearchFilter-D0IzBlG5.cjs +70 -0
- package/dist/SearchFilterHeader-BQT0-ssS.js +37 -0
- package/dist/SearchFilterHeader-C3EklfoO.cjs +45 -0
- package/dist/SearchFilterItem-BodtWLoP.js +26 -0
- package/dist/SearchFilterItem-DmMkiqNC.cjs +34 -0
- package/dist/SearchInput-BrcAgcvI.js +89 -0
- package/dist/SearchInput-DSB9CwIq.cjs +106 -0
- package/dist/SparkleAnimation-BpLwrEqM.cjs +96 -0
- package/dist/SparkleAnimation-CXs58sFd.js +85 -0
- package/dist/Spinner-BZ-kTOpm.js +38 -0
- package/dist/Spinner-CfQ85Ajl.cjs +46 -0
- package/dist/Text-Bdv7F5-u.js +42 -0
- package/dist/Text-C04c4Z93.cjs +50 -0
- package/dist/TextInput-BO80ixsV.cjs +40 -0
- package/dist/TextInput-CEGWfdPC.js +31 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/colorsConfig-TCONYTQ7.cjs +38 -0
- package/dist/colorsConfig-l0ODUVhu.js +26 -0
- package/dist/common/ButtonBase/ButtonBase.cjs +5 -0
- package/dist/common/ButtonBase/ButtonBase.d.cts +35 -0
- package/dist/common/ButtonBase/ButtonBase.d.ts +35 -0
- package/dist/common/ButtonBase/ButtonBase.js +5 -0
- package/dist/common/Headline/Headline.cjs +4 -0
- package/dist/common/Headline/Headline.d.cts +21 -0
- package/dist/common/Headline/Headline.d.ts +21 -0
- package/dist/common/Headline/Headline.js +4 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.cjs +3 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.cts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.ts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.js +3 -0
- package/dist/common/ProductCard/ProductCard.cjs +11 -0
- package/dist/common/ProductCard/ProductCard.d.cts +91 -0
- package/dist/common/ProductCard/ProductCard.d.ts +91 -0
- package/dist/common/ProductCard/ProductCard.js +9 -0
- package/dist/common/ProductCard/ProductCardSkeleton.cjs +4 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.cts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.ts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.js +4 -0
- package/dist/common/ProductGrid/ProductGrid.cjs +11 -0
- package/dist/common/ProductGrid/ProductGrid.d.cts +26 -0
- package/dist/common/ProductGrid/ProductGrid.d.ts +26 -0
- package/dist/common/ProductGrid/ProductGrid.js +11 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.cjs +3 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.js +3 -0
- package/dist/common/Spinner/Spinner.cjs +3 -0
- package/dist/common/Spinner/Spinner.d.cts +11 -0
- package/dist/common/Spinner/Spinner.d.ts +11 -0
- package/dist/common/Spinner/Spinner.js +3 -0
- package/dist/common/SuggestionButton/SuggestionButton.cjs +188 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.cts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.ts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.js +180 -0
- package/dist/common/Text/Text.cjs +4 -0
- package/dist/common/Text/Text.d.cts +28 -0
- package/dist/common/Text/Text.d.ts +28 -0
- package/dist/common/Text/Text.js +4 -0
- package/dist/common/TextInput/TextInput.cjs +4 -0
- package/dist/common/TextInput/TextInput.d.cts +98 -0
- package/dist/common/TextInput/TextInput.d.ts +98 -0
- package/dist/common/TextInput/TextInput.js +4 -0
- package/dist/productCardVariants-C_QIZ-KF.js +45 -0
- package/dist/productCardVariants-Dd-wrJKP.cjs +69 -0
- package/dist/productGridVariants-CxCKx5Fq.js +20 -0
- package/dist/productGridVariants-DVzvjK9i.cjs +26 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +5 -0
- package/dist/search/SearchFilter/SearchFilter.cjs +7 -0
- package/dist/search/SearchFilter/SearchFilter.d.cts +18 -0
- package/dist/search/SearchFilter/SearchFilter.d.ts +18 -0
- package/dist/search/SearchFilter/SearchFilter.js +7 -0
- package/dist/search/SearchFilter/SearchFilterHeader.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.cts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.ts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.js +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.cts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.ts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.js +5 -0
- package/dist/search/SearchInput/SearchInput.cjs +6 -0
- package/dist/search/SearchInput/SearchInput.d.cts +20 -0
- package/dist/search/SearchInput/SearchInput.d.ts +20 -0
- package/dist/search/SearchInput/SearchInput.js +6 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +3 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.cts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +3 -0
- package/dist/search/SearchInputForm/SearchInputForm.cjs +38 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.cts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.ts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.js +36 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs +52 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js +49 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +30 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.js +26 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +66 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.js +62 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +49 -0
- package/dist/searchFilterSidebarVariants-GfFbQzGf.cjs +39 -0
- package/dist/searchFilterSidebarVariants-lJVVZT_2.js +34 -0
- package/dist/textVariantClasses-5t3OricK.js +101 -0
- package/dist/textVariantClasses-Bhf4VY5z.cjs +125 -0
- package/dist/types-53zIialA.d.ts +35 -0
- package/dist/types-B4BGZSlV.d.cts +4 -0
- package/dist/types-BQNqA5xL.d.ts +46 -0
- package/dist/types-BRLWwGMI.d.ts +4 -0
- package/dist/types-CImLkcNh.d.cts +46 -0
- package/dist/types-Cph97xkm.d.ts +6 -0
- package/dist/types-CpiJO5UH.d.ts +4 -0
- package/dist/types-DFetqNL2.d.ts +8 -0
- package/dist/types-DaSkJnT_.d.cts +8 -0
- package/dist/types-Dy4_w6Cf.d.cts +4 -0
- package/dist/types-TYhhwWZw.d.cts +6 -0
- package/dist/types-aa4flfRE.d.cts +35 -0
- package/package.json +8 -8
- package/src/components/common/ButtonBase/ButtonBase.tsx +2 -2
- package/src/components/common/ButtonBase/types.ts +2 -3
- package/dist/src/atoms/search/types.d.ts +0 -5
- package/dist/src/atoms/search/types.js +0 -1
- package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
- package/dist/src/components/common/ButtonBase/ButtonBase.js +0 -41
- package/dist/src/components/common/ButtonBase/types.d.ts +0 -24
- package/dist/src/components/common/ButtonBase/types.js +0 -6
- package/dist/src/components/common/Headline/Headline.d.ts +0 -10
- package/dist/src/components/common/Headline/Headline.js +0 -34
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
- package/dist/src/components/common/ProductCard/ProductCard.d.ts +0 -39
- package/dist/src/components/common/ProductCard/ProductCard.js +0 -84
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
- package/dist/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
- package/dist/src/components/common/ProductCard/productCardVariants.js +0 -50
- package/dist/src/components/common/ProductCard/types.d.ts +0 -39
- package/dist/src/components/common/ProductCard/types.js +0 -10
- package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
- package/dist/src/components/common/ProductGrid/ProductGrid.js +0 -13
- package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
- package/dist/src/components/common/ProductGrid/productGridVariants.js +0 -16
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
- package/dist/src/components/common/SparkleAnimation/types.d.ts +0 -6
- package/dist/src/components/common/SparkleAnimation/types.js +0 -7
- package/dist/src/components/common/Spinner/Spinner.d.ts +0 -5
- package/dist/src/components/common/Spinner/Spinner.js +0 -16
- package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
- package/dist/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
- package/dist/src/components/common/SuggestionButton/types.d.ts +0 -1
- package/dist/src/components/common/SuggestionButton/types.js +0 -1
- package/dist/src/components/common/Text/Text.d.ts +0 -12
- package/dist/src/components/common/Text/Text.js +0 -26
- package/dist/src/components/common/Text/textVariantClasses.d.ts +0 -171
- package/dist/src/components/common/Text/textVariantClasses.js +0 -103
- package/dist/src/components/common/Text/types.d.ts +0 -16
- package/dist/src/components/common/Text/types.js +0 -6
- package/dist/src/components/common/TextInput/TextInput.d.ts +0 -8
- package/dist/src/components/common/TextInput/TextInput.js +0 -25
- package/dist/src/components/models/colorsConfig.d.ts +0 -26
- package/dist/src/components/models/colorsConfig.js +0 -23
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
- package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilter.js +0 -24
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
- package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
- package/dist/src/components/search/SearchFilter/types.d.ts +0 -42
- package/dist/src/components/search/SearchFilter/types.js +0 -1
- package/dist/src/components/search/SearchInput/SearchInput.d.ts +0 -16
- package/dist/src/components/search/SearchInput/SearchInput.js +0 -38
- package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
- package/dist/src/components/search/SearchInput/searchInputVariants.js +0 -12
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
- package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
- package/dist/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
- package/dist/src/components/search/SearchInputForm/types.d.ts +0 -1
- package/dist/src/components/search/SearchInputForm/types.js +0 -1
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
- package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +0 -2
- package/dist/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
- package/dist/src/components/search/types.d.ts +0 -5
- package/dist/src/components/search/types.js +0 -6
- package/dist/src/components/test/types.d.ts +0 -3
- package/dist/src/components/test/types.js +0 -1
- package/dist/src/config/chatElementDisplayLocation.d.ts +0 -21
- package/dist/src/config/chatElementDisplayLocation.js +0 -23
- package/dist/src/index.d.ts +0 -45
- package/dist/src/index.js +0 -49
- package/dist/src/logging/logger.d.ts +0 -7
- package/dist/src/logging/logger.js +0 -16
- package/dist/src/types/external.d.ts +0 -21
- package/dist/src/types/external.js +0 -5
- package/dist/src/util/camelCase.d.ts +0 -65
- package/dist/src/util/camelCase.js +0 -2
- package/dist/src/util/camelCasedPropertiesDeep.d.ts +0 -53
- package/dist/src/util/camelCasedPropertiesDeep.js +0 -1
- package/dist/src/util/formatPrice.d.ts +0 -1
- package/dist/src/util/formatPrice.js +0 -11
- package/dist/src/util/internal.d.ts +0 -27
- package/dist/src/util/internal.js +0 -4
- package/dist/src/util/primitive.d.ts +0 -6
- package/dist/src/util/primitive.js +0 -2
- package/dist/src/util/splitWords.d.ts +0 -55
- package/dist/src/util/splitWords.js +0 -2
- package/dist/src/util/trim.d.ts +0 -24
- package/dist/src/util/trim.js +0 -2
- package/dist/src/util/unknownArray.d.ts +0 -25
- package/dist/src/util/unknownArray.js +0 -1
- package/src/index.ts +0 -59
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { CamelCase, CamelCaseOptions } from './camelCase';
|
|
2
|
-
import type { UnknownArray } from './unknownArray';
|
|
3
|
-
/**
|
|
4
|
-
* Convert object properties to camel case recursively.
|
|
5
|
-
*
|
|
6
|
-
* This can be useful when, for example, converting some API types from a different style.
|
|
7
|
-
*
|
|
8
|
-
* @see CamelCasedProperties
|
|
9
|
-
* @see CamelCase
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```
|
|
13
|
-
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
14
|
-
*
|
|
15
|
-
* interface User {
|
|
16
|
-
* UserId: number;
|
|
17
|
-
* UserName: string;
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* interface UserWithFriends {
|
|
21
|
-
* UserInfo: User;
|
|
22
|
-
* UserFriends: User[];
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
26
|
-
* userInfo: {
|
|
27
|
-
* userId: 1,
|
|
28
|
-
* userName: 'Tom',
|
|
29
|
-
* },
|
|
30
|
-
* userFriends: [
|
|
31
|
-
* {
|
|
32
|
-
* userId: 2,
|
|
33
|
-
* userName: 'Jerry',
|
|
34
|
-
* },
|
|
35
|
-
* {
|
|
36
|
-
* userId: 3,
|
|
37
|
-
* userName: 'Spike',
|
|
38
|
-
* },
|
|
39
|
-
* ],
|
|
40
|
-
* };
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @category Change case
|
|
44
|
-
* @category Template literal
|
|
45
|
-
* @category Object
|
|
46
|
-
*/
|
|
47
|
-
export type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
|
|
48
|
-
preserveConsecutiveUppercase: true;
|
|
49
|
-
}> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : {
|
|
50
|
-
[K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options>;
|
|
51
|
-
};
|
|
52
|
-
type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends [] ? [] : Value extends [infer U, ...infer V] ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [infer U, ...infer V] ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends Array<infer U> ? Array<CamelCasedPropertiesDeep<U>> : Value extends ReadonlyArray<infer U> ? ReadonlyArray<CamelCasedPropertiesDeep<U>> : never;
|
|
53
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formatPrice: (price?: number, currency?: string) => string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const formatPrice = (price, currency = '$') => {
|
|
2
|
-
if (price == null) {
|
|
3
|
-
return '';
|
|
4
|
-
}
|
|
5
|
-
const options = {};
|
|
6
|
-
if (!Number.isInteger(price)) {
|
|
7
|
-
options.minimumFractionDigits = 2;
|
|
8
|
-
options.maximumFractionDigits = 2;
|
|
9
|
-
}
|
|
10
|
-
return `${currency}${price.toLocaleString('en-US', options)}`;
|
|
11
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Primitive } from './primitive';
|
|
2
|
-
import type { Trim } from './trim';
|
|
3
|
-
/**
|
|
4
|
-
* Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
5
|
-
*/
|
|
6
|
-
export type BuiltIns = Primitive | void | Date | RegExp;
|
|
7
|
-
/**
|
|
8
|
-
* Matches non-recursive types.
|
|
9
|
-
*/
|
|
10
|
-
export type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown);
|
|
11
|
-
/**
|
|
12
|
-
* Returns a boolean for whether the string is numeric.
|
|
13
|
-
*
|
|
14
|
-
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
15
|
-
*/
|
|
16
|
-
export type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
|
|
17
|
-
/**
|
|
18
|
-
* Returns a boolean for whether the string is lowercased.
|
|
19
|
-
*/
|
|
20
|
-
export type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
21
|
-
/**
|
|
22
|
-
* Returns a boolean for whether the string is upper-cased.
|
|
23
|
-
*/
|
|
24
|
-
export type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
25
|
-
export type WordSeparators = '-' | '_' | Whitespace;
|
|
26
|
-
export type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
|
|
27
|
-
export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from './internal';
|
|
2
|
-
type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
|
|
3
|
-
type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
|
|
4
|
-
/**
|
|
5
|
-
* Split a string (almost) like Lodash's `_.words()` function.
|
|
6
|
-
*
|
|
7
|
-
* - Split on each word that begins with a capital letter.
|
|
8
|
-
* - Split on each {@link WordSeparators}.
|
|
9
|
-
* - Split on numeric sequence.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```
|
|
13
|
-
* type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
|
|
14
|
-
* type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
|
|
15
|
-
* type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
|
|
16
|
-
* type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
|
|
17
|
-
* type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
* @category Change case
|
|
22
|
-
* @category Template literal
|
|
23
|
-
*/
|
|
24
|
-
export type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [
|
|
25
|
-
...SkipEmptyWord<CurrentWord>,
|
|
26
|
-
...SplitWords<RemainingCharacters>
|
|
27
|
-
] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [
|
|
28
|
-
false,
|
|
29
|
-
true
|
|
30
|
-
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [
|
|
31
|
-
...SkipEmptyWord<CurrentWord>,
|
|
32
|
-
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
33
|
-
] : [
|
|
34
|
-
true,
|
|
35
|
-
false
|
|
36
|
-
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [
|
|
37
|
-
...SkipEmptyWord<CurrentWord>,
|
|
38
|
-
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
39
|
-
] : [
|
|
40
|
-
true,
|
|
41
|
-
true
|
|
42
|
-
] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [
|
|
43
|
-
true,
|
|
44
|
-
true
|
|
45
|
-
] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [
|
|
46
|
-
...SkipEmptyWord<CurrentWord>,
|
|
47
|
-
...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
|
|
48
|
-
] : [
|
|
49
|
-
true,
|
|
50
|
-
true
|
|
51
|
-
] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [
|
|
52
|
-
...RemoveLastCharacter<CurrentWord, LastCharacter>,
|
|
53
|
-
...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>
|
|
54
|
-
] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
|
|
55
|
-
export {};
|
package/dist/src/util/trim.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Whitespace } from './internal';
|
|
2
|
-
/**
|
|
3
|
-
* Remove spaces from the left side.
|
|
4
|
-
*/
|
|
5
|
-
type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
|
|
6
|
-
/**
|
|
7
|
-
* Remove spaces from the right side.
|
|
8
|
-
*/
|
|
9
|
-
type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
|
|
10
|
-
/**
|
|
11
|
-
* Remove leading and trailing spaces from a string.
|
|
12
|
-
* @example
|
|
13
|
-
* ```
|
|
14
|
-
* import type {Trim} from 'type-fest';
|
|
15
|
-
*
|
|
16
|
-
* Trim<' foo '>
|
|
17
|
-
* //=> 'foo'
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @category String
|
|
21
|
-
* @category Template literal
|
|
22
|
-
*/
|
|
23
|
-
export type Trim<V extends string> = TrimLeft<TrimRight<V>>;
|
|
24
|
-
export {};
|
package/dist/src/util/trim.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents an array with `unknown` value.
|
|
3
|
-
*
|
|
4
|
-
* Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```
|
|
8
|
-
* import type {UnknownArray} from 'type-fest';
|
|
9
|
-
*
|
|
10
|
-
* type IsArray<T> = T extends UnknownArray ? true : false;
|
|
11
|
-
*
|
|
12
|
-
* type A = IsArray<['foo']>;
|
|
13
|
-
* //=> true
|
|
14
|
-
*
|
|
15
|
-
* type B = IsArray<readonly number[]>;
|
|
16
|
-
* //=> true
|
|
17
|
-
*
|
|
18
|
-
* type C = IsArray<string>;
|
|
19
|
-
* //=> false
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @category Type
|
|
23
|
-
* @category Array
|
|
24
|
-
*/
|
|
25
|
-
export type UnknownArray = readonly unknown[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/index.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Common Components
|
|
2
|
-
export { ButtonBase } from './components/common/ButtonBase/ButtonBase';
|
|
3
|
-
export { Headline } from './components/common/Headline/Headline';
|
|
4
|
-
export { ImageWithFallback } from './components/common/ImageWithFallback/ImageWithFallback';
|
|
5
|
-
export { ProductCard } from './components/common/ProductCard/ProductCard';
|
|
6
|
-
export { ProductCardSkeleton } from './components/common/ProductCard/ProductCardSkeleton';
|
|
7
|
-
export { ProductGrid } from './components/common/ProductGrid/ProductGrid';
|
|
8
|
-
export { SparkleAnimation } from './components/common/SparkleAnimation/SparkleAnimation';
|
|
9
|
-
export { Spinner } from './components/common/Spinner/Spinner';
|
|
10
|
-
export { SuggestionButton } from './components/common/SuggestionButton/SuggestionButton';
|
|
11
|
-
export { Text } from './components/common/Text/Text';
|
|
12
|
-
export { TextInput } from './components/common/TextInput/TextInput';
|
|
13
|
-
|
|
14
|
-
// Search Components
|
|
15
|
-
export { AppliedFiltersScrollbar } from './components/search/FilterScrollbar/AppliedFiltersScrollbar';
|
|
16
|
-
export { DynamicFiltersScrollbar } from './components/search/FilterScrollbar/DynamicFiltersScrollbar';
|
|
17
|
-
export { SearchFilter } from './components/search/SearchFilter/SearchFilter';
|
|
18
|
-
export { SearchFilterHeader } from './components/search/SearchFilter/SearchFilterHeader';
|
|
19
|
-
export { SearchFilterItem } from './components/search/SearchFilter/SearchFilterItem';
|
|
20
|
-
export { SearchInput } from './components/search/SearchInput/SearchInput';
|
|
21
|
-
export { SearchAutocomplete } from './components/search/SearchInputAutocomplete/SearchAutocomplete';
|
|
22
|
-
export { SearchInputForm } from './components/search/SearchInputForm/SearchInputForm';
|
|
23
|
-
export { SearchResultsFilter } from './components/search/SearchResultsFilterSidebar/SearchResultsFilter';
|
|
24
|
-
export { NoSearchResultsFound } from './components/search/SearchResultsStates/NoSearchResultsFound';
|
|
25
|
-
export { SearchResultsGrid } from './components/search/SearchResultsStates/SearchResultsGrid';
|
|
26
|
-
export { SearchResultsLoadingGrid } from './components/search/SearchResultsStates/SearchResultsLoadingGrid';
|
|
27
|
-
|
|
28
|
-
// Utilities
|
|
29
|
-
export * from './util/camelCase';
|
|
30
|
-
export * from './util/camelCasedPropertiesDeep';
|
|
31
|
-
export * from './util/formatPrice';
|
|
32
|
-
export * from './util/internal';
|
|
33
|
-
export * from './util/primitive';
|
|
34
|
-
export * from './util/splitWords';
|
|
35
|
-
export * from './util/trim';
|
|
36
|
-
export * from './util/unknownArray';
|
|
37
|
-
|
|
38
|
-
// Types
|
|
39
|
-
export * from './components/common/ButtonBase/types';
|
|
40
|
-
export * from './components/common/ProductCard/types';
|
|
41
|
-
export * from './components/common/SparkleAnimation/types';
|
|
42
|
-
export * from './components/common/SuggestionButton/types';
|
|
43
|
-
export * from './components/common/Text/types';
|
|
44
|
-
export type { HeadlineProps, HeadlineVariant } from './components/common/Text/types'; // Explicitly re-export from types.ts
|
|
45
|
-
export * from './components/search/types';
|
|
46
|
-
export * from './components/search/SearchFilter/types';
|
|
47
|
-
export * from './components/search/SearchInputForm/types';
|
|
48
|
-
export type {
|
|
49
|
-
SearchFilterSidebarVariant,
|
|
50
|
-
CloseIconVariant as CloseIconVariantType,
|
|
51
|
-
} from './components/search/SearchResultsFilterSidebar/types';
|
|
52
|
-
export * from './atoms/search/types';
|
|
53
|
-
|
|
54
|
-
// Config exports
|
|
55
|
-
export { ChatElementDisplayLocation } from './config/chatElementDisplayLocation';
|
|
56
|
-
|
|
57
|
-
// Variants
|
|
58
|
-
export { productGridVariantClasses } from './components/common/ProductGrid/productGridVariants';
|
|
59
|
-
export { searchFilterSidebarVariantClasses } from './components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants';
|