@envive-ai/react-toolkit 0.2.14 → 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.
Files changed (99) hide show
  1. package/dist/components/Accordion/Accordion.d.cts +2 -2
  2. package/dist/components/Accordion/Accordion.d.ts +2 -2
  3. package/dist/components/AnimatedChevron/AnimatedChevron.d.cts +2 -2
  4. package/dist/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.d.cts +3 -3
  5. package/dist/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.d.ts +3 -3
  6. package/dist/components/ButtonBase/ButtonBase.d.cts +2 -2
  7. package/dist/components/ButtonBase/ButtonBase.d.ts +2 -2
  8. package/dist/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.d.cts +2 -2
  9. package/dist/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.d.ts +2 -2
  10. package/dist/components/FilterScrollbar/AppliedFiltersScrollbar.d.cts +3 -3
  11. package/dist/components/FilterScrollbar/AppliedFiltersScrollbar.d.ts +3 -3
  12. package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.d.cts +2 -2
  13. package/dist/components/FilterScrollbar/DynamicFiltersScrollbar.d.ts +2 -2
  14. package/dist/components/ImageWithFallback/ImageWithFallback.d.cts +2 -2
  15. package/dist/components/ImageWithFallback/ImageWithFallback.d.ts +2 -2
  16. package/dist/components/ModalSheet/ModalSheet.d.cts +2 -2
  17. package/dist/components/ModalSheet/ModalSheet.d.ts +2 -2
  18. package/dist/components/ProductCard/ProductCard.cjs +2 -2
  19. package/dist/components/ProductCard/ProductCard.d.cts +4 -4
  20. package/dist/components/ProductCard/ProductCard.d.ts +4 -4
  21. package/dist/components/ProductCard/ProductCard.js +2 -2
  22. package/dist/components/ProductGrid/ProductGrid.d.cts +3 -3
  23. package/dist/components/ProductGrid/ProductGrid.d.ts +3 -3
  24. package/dist/components/RadioButton/RadioButton.d.cts +3 -3
  25. package/dist/components/RadioButton/RadioButton.d.ts +3 -3
  26. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.cts +3 -3
  27. package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +3 -3
  28. package/dist/components/RecommendedProducts/RecommendedProducts.d.cts +2 -2
  29. package/dist/components/RecommendedProducts/RecommendedProducts.d.ts +2 -2
  30. package/dist/components/SearchAutocomplete/SearchAutocomplete.d.cts +2 -2
  31. package/dist/components/SearchAutocomplete/SearchAutocomplete.d.ts +2 -2
  32. package/dist/components/SearchFilter/SearchFilter.d.cts +2 -2
  33. package/dist/components/SearchFilter/SearchFilter.d.ts +2 -2
  34. package/dist/components/SearchFilter/SearchFilterFooter.d.cts +3 -3
  35. package/dist/components/SearchFilter/SearchFilterFooter.d.ts +3 -3
  36. package/dist/components/SearchFilter/SearchFilterHeader.d.cts +2 -2
  37. package/dist/components/SearchFilter/SearchFilterHeader.d.ts +2 -2
  38. package/dist/components/SearchFilter/SearchFilterItem.d.cts +2 -2
  39. package/dist/components/SearchFilter/SearchFilterItem.d.ts +2 -2
  40. package/dist/components/SearchFilter/types.d.cts +1 -1
  41. package/dist/components/SearchFilter/types.d.ts +1 -1
  42. package/dist/components/SearchFilter/utils.d.cts +3 -3
  43. package/dist/components/SearchFilter/utils.d.ts +3 -3
  44. package/dist/components/SearchInput/SearchInput.d.cts +1 -1
  45. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  46. package/dist/components/SearchInputForm/SearchInputForm.d.cts +2 -2
  47. package/dist/components/SearchInputForm/SearchInputForm.d.ts +2 -2
  48. package/dist/components/SearchResultsContent/SearchResultsContent.d.cts +4 -4
  49. package/dist/components/SearchResultsContent/SearchResultsContent.d.ts +4 -4
  50. package/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.d.cts +2 -2
  51. package/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.d.ts +2 -2
  52. package/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.d.cts +3 -3
  53. package/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.d.ts +3 -3
  54. package/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +1 -1
  55. package/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +3 -3
  56. package/dist/components/SearchResultsStates/NoSearchResultsFound.d.cts +3 -3
  57. package/dist/components/SearchResultsStates/NoSearchResultsFound.d.ts +3 -3
  58. package/dist/components/SearchResultsStates/SearchResultsGrid.d.cts +3 -3
  59. package/dist/components/SearchResultsStates/SearchResultsGrid.d.ts +1 -1
  60. package/dist/components/SearchResultsStates/SearchResultsLoadingGrid.d.cts +2 -2
  61. package/dist/components/SearchResultsToolbar/SearchResultsToolbar.d.cts +3 -3
  62. package/dist/components/SearchResultsToolbar/SearchResultsToolbar.d.ts +3 -3
  63. package/dist/components/SparkleAnimation/SparkleAnimation.d.cts +2 -2
  64. package/dist/components/SparkleAnimation/SparkleAnimation.d.ts +2 -2
  65. package/dist/components/Spinner/Spinner.d.cts +2 -2
  66. package/dist/components/Spinner/Spinner.d.ts +2 -2
  67. package/dist/components/SuggestionButton/SuggestionButton.d.cts +2 -2
  68. package/dist/components/SuggestionButton/SuggestionButton.d.ts +2 -2
  69. package/dist/components/ToggleButton/ToggleButton.d.cts +2 -2
  70. package/dist/components/ToggleButton/ToggleButton.d.ts +2 -2
  71. package/dist/hooks/dist/application/models/api/response.d.cts +11 -0
  72. package/dist/hooks/dist/application/models/api/response.d.ts +11 -0
  73. package/dist/hooks/dist/application/models/colorsConfig.d.cts +24 -0
  74. package/dist/hooks/dist/application/models/colorsConfig.d.ts +24 -0
  75. package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.cts +71 -0
  76. package/dist/hooks/dist/application/models/utilityTypes/camelCase.d.ts +71 -0
  77. package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.cts +58 -0
  78. package/dist/hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts +58 -0
  79. package/dist/hooks/dist/application/models/utilityTypes/internal.d.cts +22 -0
  80. package/dist/hooks/dist/application/models/utilityTypes/internal.d.ts +22 -0
  81. package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.cts +31 -0
  82. package/dist/hooks/dist/application/models/utilityTypes/splitWords.d.ts +31 -0
  83. package/dist/hooks/dist/application/models/utilityTypes/trim.d.cts +30 -0
  84. package/dist/hooks/dist/application/models/utilityTypes/trim.d.ts +30 -0
  85. package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.cts +30 -0
  86. package/dist/hooks/dist/application/models/utilityTypes/unknownArray.d.ts +30 -0
  87. package/dist/hooks/dist/atoms/search/searchAPI.d.cts +11 -0
  88. package/dist/hooks/dist/atoms/search/searchAPI.d.ts +11 -0
  89. package/dist/hooks/dist/contexts/types.d.cts +17 -0
  90. package/dist/hooks/dist/contexts/types.d.ts +17 -0
  91. package/dist/hooks/dist/hooks/utils.d.cts +9 -0
  92. package/dist/hooks/dist/hooks/utils.d.ts +9 -0
  93. package/dist/hooks/dist/types/search-filter-types.d.cts +36 -0
  94. package/dist/hooks/dist/types/search-filter-types.d.ts +36 -0
  95. package/dist/hooks/dist/types/test-types.d.cts +8 -0
  96. package/dist/hooks/dist/types/test-types.d.ts +8 -0
  97. package/dist/util/colorVar.d.cts +1 -1
  98. package/dist/util/colorVar.d.ts +1 -1
  99. package/package.json +3 -1
@@ -0,0 +1,71 @@
1
+ import { SplitWords } from "./splitWords.js";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/camelCase.d.ts
4
+
5
+ //#region src/application/models/utilityTypes/camelCase.d.ts
6
+ /**
7
+ * CamelCase options.
8
+ *
9
+ * @see {@link CamelCase}
10
+ */
11
+ type CamelCaseOptions = {
12
+ /**
13
+ * Whether to preserved consecutive uppercase letter.
14
+ *
15
+ * @default true
16
+ */
17
+ preserveConsecutiveUppercase?: boolean;
18
+ };
19
+ /**
20
+ * Convert an array of words to camel-case.
21
+ */
22
+ type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? Options['preserveConsecutiveUppercase'] extends true ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}` : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}` : OutputString;
23
+ /**
24
+ * Convert a string literal to camel-case.
25
+ *
26
+ * This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
27
+ *
28
+ * By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
29
+ *
30
+ * @example
31
+ * ```
32
+ * import type {CamelCase} from 'type-fest';
33
+ *
34
+ * // Simple
35
+ *
36
+ * const someVariable: CamelCase<'foo-bar'> = 'fooBar';
37
+ *
38
+ * // Advanced
39
+ *
40
+ * type CamelCasedProperties<T> = {
41
+ * [K in keyof T as CamelCase<K>]: T[K]
42
+ * };
43
+ *
44
+ * interface RawOptions {
45
+ * 'dry-run': boolean;
46
+ * 'full_family_name': string;
47
+ * foo: number;
48
+ * BAR: string;
49
+ * QUZ_QUX: number;
50
+ * 'OTHER-FIELD': boolean;
51
+ * }
52
+ *
53
+ * const dbResult: CamelCasedProperties<RawOptions> = {
54
+ * dryRun: true,
55
+ * fullFamilyName: 'bar.js',
56
+ * foo: 123,
57
+ * bar: 'foo',
58
+ * quzQux: 6,
59
+ * otherField: false
60
+ * };
61
+ * ```
62
+ *
63
+ * @category Change case
64
+ * @category Template literal
65
+ */
66
+ type CamelCase<Type, Options extends CamelCaseOptions = {
67
+ preserveConsecutiveUppercase: true;
68
+ }> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
69
+ //#endregion
70
+ //#endregion
71
+ export { CamelCase, CamelCaseOptions };
@@ -0,0 +1,58 @@
1
+ import { CamelCase, CamelCaseOptions } from "./camelCase.cjs";
2
+ import { UnknownArray } from "./unknownArray.cjs";
3
+
4
+ //#region ../hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
5
+
6
+ //#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
7
+ /**
8
+ * Convert object properties to camel case recursively.
9
+ *
10
+ * This can be useful when, for example, converting some API types from a different style.
11
+ *
12
+ * @see CamelCasedProperties
13
+ * @see CamelCase
14
+ *
15
+ * @example
16
+ * ```
17
+ * import type {CamelCasedPropertiesDeep} from 'type-fest';
18
+ *
19
+ * interface User {
20
+ * UserId: number;
21
+ * UserName: string;
22
+ * }
23
+ *
24
+ * interface UserWithFriends {
25
+ * UserInfo: User;
26
+ * UserFriends: User[];
27
+ * }
28
+ *
29
+ * const result: CamelCasedPropertiesDeep<UserWithFriends> = {
30
+ * userInfo: {
31
+ * userId: 1,
32
+ * userName: 'Tom',
33
+ * },
34
+ * userFriends: [
35
+ * {
36
+ * userId: 2,
37
+ * userName: 'Jerry',
38
+ * },
39
+ * {
40
+ * userId: 3,
41
+ * userName: 'Spike',
42
+ * },
43
+ * ],
44
+ * };
45
+ * ```
46
+ *
47
+ * @category Change case
48
+ * @category Template literal
49
+ * @category Object
50
+ */
51
+ type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
52
+ preserveConsecutiveUppercase: true;
53
+ }> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : { [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options> };
54
+ 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;
55
+ //#endregion
56
+
57
+ //#endregion
58
+ export { CamelCasedPropertiesDeep };
@@ -0,0 +1,58 @@
1
+ import { CamelCase, CamelCaseOptions } from "./camelCase.js";
2
+ import { UnknownArray } from "./unknownArray.js";
3
+
4
+ //#region ../hooks/dist/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
5
+
6
+ //#region src/application/models/utilityTypes/camelCasedPropertiesDeep.d.ts
7
+ /**
8
+ * Convert object properties to camel case recursively.
9
+ *
10
+ * This can be useful when, for example, converting some API types from a different style.
11
+ *
12
+ * @see CamelCasedProperties
13
+ * @see CamelCase
14
+ *
15
+ * @example
16
+ * ```
17
+ * import type {CamelCasedPropertiesDeep} from 'type-fest';
18
+ *
19
+ * interface User {
20
+ * UserId: number;
21
+ * UserName: string;
22
+ * }
23
+ *
24
+ * interface UserWithFriends {
25
+ * UserInfo: User;
26
+ * UserFriends: User[];
27
+ * }
28
+ *
29
+ * const result: CamelCasedPropertiesDeep<UserWithFriends> = {
30
+ * userInfo: {
31
+ * userId: 1,
32
+ * userName: 'Tom',
33
+ * },
34
+ * userFriends: [
35
+ * {
36
+ * userId: 2,
37
+ * userName: 'Jerry',
38
+ * },
39
+ * {
40
+ * userId: 3,
41
+ * userName: 'Spike',
42
+ * },
43
+ * ],
44
+ * };
45
+ * ```
46
+ *
47
+ * @category Change case
48
+ * @category Template literal
49
+ * @category Object
50
+ */
51
+ type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
52
+ preserveConsecutiveUppercase: true;
53
+ }> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : { [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options> };
54
+ 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;
55
+ //#endregion
56
+
57
+ //#endregion
58
+ export { CamelCasedPropertiesDeep };
@@ -0,0 +1,22 @@
1
+ import { Trim } from "./trim.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/internal.d.ts
4
+
5
+ /**
6
+ * Returns a boolean for whether the string is numeric.
7
+ *
8
+ * This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
9
+ */
10
+ type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
11
+ /**
12
+ * Returns a boolean for whether the string is lowercased.
13
+ */
14
+ type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
15
+ /**
16
+ * Returns a boolean for whether the string is upper-cased.
17
+ */
18
+ type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
19
+ type WordSeparators = '-' | '_' | Whitespace;
20
+ type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
21
+ //#endregion
22
+ export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
@@ -0,0 +1,22 @@
1
+ import { Trim } from "./trim.js";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/internal.d.ts
4
+
5
+ /**
6
+ * Returns a boolean for whether the string is numeric.
7
+ *
8
+ * This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
9
+ */
10
+ type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
11
+ /**
12
+ * Returns a boolean for whether the string is lowercased.
13
+ */
14
+ type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
15
+ /**
16
+ * Returns a boolean for whether the string is upper-cased.
17
+ */
18
+ type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
19
+ type WordSeparators = '-' | '_' | Whitespace;
20
+ type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
21
+ //#endregion
22
+ export { IsLowerCase, IsNumeric, IsUpperCase, Whitespace, WordSeparators };
@@ -0,0 +1,31 @@
1
+ import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/splitWords.d.ts
4
+ //#region src/application/models/utilityTypes/splitWords.d.ts
5
+ type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
6
+ type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
7
+ /**
8
+ * Split a string (almost) like Lodash's `_.words()` function.
9
+ *
10
+ * - Split on each word that begins with a capital letter.
11
+ * - Split on each {@link WordSeparators}.
12
+ * - Split on numeric sequence.
13
+ *
14
+ * @example
15
+ * ```
16
+ * type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
17
+ * type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
18
+ * type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
19
+ * type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
20
+ * type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
21
+ * ```
22
+ *
23
+ * @internal
24
+ * @category Change case
25
+ * @category Template literal
26
+ */
27
+ type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
28
+ //#endregion
29
+
30
+ //#endregion
31
+ export { SplitWords };
@@ -0,0 +1,31 @@
1
+ import { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from "./internal.js";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/splitWords.d.ts
4
+ //#region src/application/models/utilityTypes/splitWords.d.ts
5
+ type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
6
+ type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
7
+ /**
8
+ * Split a string (almost) like Lodash's `_.words()` function.
9
+ *
10
+ * - Split on each word that begins with a capital letter.
11
+ * - Split on each {@link WordSeparators}.
12
+ * - Split on numeric sequence.
13
+ *
14
+ * @example
15
+ * ```
16
+ * type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
17
+ * type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
18
+ * type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
19
+ * type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
20
+ * type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
21
+ * ```
22
+ *
23
+ * @internal
24
+ * @category Change case
25
+ * @category Template literal
26
+ */
27
+ type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
28
+ //#endregion
29
+
30
+ //#endregion
31
+ export { SplitWords };
@@ -0,0 +1,30 @@
1
+ import { Whitespace } from "./internal.cjs";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
4
+
5
+ //#region src/application/models/utilityTypes/trim.d.ts
6
+ /**
7
+ * Remove spaces from the left side.
8
+ */
9
+ type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
10
+ /**
11
+ * Remove spaces from the right side.
12
+ */
13
+ type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
14
+ /**
15
+ * Remove leading and trailing spaces from a string.
16
+ * @example
17
+ * ```
18
+ * import type {Trim} from 'type-fest';
19
+ *
20
+ * Trim<' foo '>
21
+ * //=> 'foo'
22
+ * ```
23
+ *
24
+ * @category String
25
+ * @category Template literal
26
+ */
27
+ type Trim<V extends string> = TrimLeft<TrimRight<V>>;
28
+ //#endregion
29
+ //#endregion
30
+ export { Trim };
@@ -0,0 +1,30 @@
1
+ import { Whitespace } from "./internal.js";
2
+
3
+ //#region ../hooks/dist/application/models/utilityTypes/trim.d.ts
4
+
5
+ //#region src/application/models/utilityTypes/trim.d.ts
6
+ /**
7
+ * Remove spaces from the left side.
8
+ */
9
+ type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
10
+ /**
11
+ * Remove spaces from the right side.
12
+ */
13
+ type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
14
+ /**
15
+ * Remove leading and trailing spaces from a string.
16
+ * @example
17
+ * ```
18
+ * import type {Trim} from 'type-fest';
19
+ *
20
+ * Trim<' foo '>
21
+ * //=> 'foo'
22
+ * ```
23
+ *
24
+ * @category String
25
+ * @category Template literal
26
+ */
27
+ type Trim<V extends string> = TrimLeft<TrimRight<V>>;
28
+ //#endregion
29
+ //#endregion
30
+ export { Trim };
@@ -0,0 +1,30 @@
1
+ //#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
2
+ //#region src/application/models/utilityTypes/unknownArray.d.ts
3
+ /**
4
+ * Represents an array with `unknown` value.
5
+ *
6
+ * Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
7
+ *
8
+ * @example
9
+ * ```
10
+ * import type {UnknownArray} from 'type-fest';
11
+ *
12
+ * type IsArray<T> = T extends UnknownArray ? true : false;
13
+ *
14
+ * type A = IsArray<['foo']>;
15
+ * //=> true
16
+ *
17
+ * type B = IsArray<readonly number[]>;
18
+ * //=> true
19
+ *
20
+ * type C = IsArray<string>;
21
+ * //=> false
22
+ * ```
23
+ *
24
+ * @category Type
25
+ * @category Array
26
+ */
27
+ type UnknownArray = readonly unknown[];
28
+ //#endregion
29
+ //#endregion
30
+ export { UnknownArray };
@@ -0,0 +1,30 @@
1
+ //#region ../hooks/dist/application/models/utilityTypes/unknownArray.d.ts
2
+ //#region src/application/models/utilityTypes/unknownArray.d.ts
3
+ /**
4
+ * Represents an array with `unknown` value.
5
+ *
6
+ * Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
7
+ *
8
+ * @example
9
+ * ```
10
+ * import type {UnknownArray} from 'type-fest';
11
+ *
12
+ * type IsArray<T> = T extends UnknownArray ? true : false;
13
+ *
14
+ * type A = IsArray<['foo']>;
15
+ * //=> true
16
+ *
17
+ * type B = IsArray<readonly number[]>;
18
+ * //=> true
19
+ *
20
+ * type C = IsArray<string>;
21
+ * //=> false
22
+ * ```
23
+ *
24
+ * @category Type
25
+ * @category Array
26
+ */
27
+ type UnknownArray = readonly unknown[];
28
+ //#endregion
29
+ //#endregion
30
+ export { UnknownArray };
@@ -0,0 +1,11 @@
1
+ //#region ../hooks/dist/atoms/search/searchAPI.d.ts
2
+
3
+ //#region src/atoms/search/searchAPI.d.ts
4
+ type SelectedFilterOption = {
5
+ id: string;
6
+ displayName: string;
7
+ filterId: string;
8
+ filterItemId: string;
9
+ };
10
+ //#endregion
11
+ export { SelectedFilterOption };
@@ -0,0 +1,11 @@
1
+ //#region ../hooks/dist/atoms/search/searchAPI.d.ts
2
+
3
+ //#region src/atoms/search/searchAPI.d.ts
4
+ type SelectedFilterOption = {
5
+ id: string;
6
+ displayName: string;
7
+ filterId: string;
8
+ filterItemId: string;
9
+ };
10
+ //#endregion
11
+ export { SelectedFilterOption };
@@ -0,0 +1,17 @@
1
+ import { ColorNames } from "../application/models/colorsConfig.cjs";
2
+
3
+ //#region ../hooks/dist/contexts/types.d.ts
4
+
5
+ type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
6
+ type ProductCardHoverVariant = 'backgroundDark' | 'none';
7
+ type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
8
+ interface ProductCardConfig {
9
+ variant: ProductCardVariant;
10
+ hoverVariant: ProductCardHoverVariant;
11
+ layoutVariant: ProductCardLayoutVariant;
12
+ pricePrefix?: string;
13
+ }
14
+ type SearchInputVariant = 'standard';
15
+ type ProductGridVariant = 'standard' | 'square';
16
+ //#endregion
17
+ export { type ProductCardConfig, ProductGridVariant, SearchInputVariant };
@@ -0,0 +1,17 @@
1
+ import { ColorNames } from "../application/models/colorsConfig.js";
2
+
3
+ //#region ../hooks/dist/contexts/types.d.ts
4
+
5
+ type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
6
+ type ProductCardHoverVariant = 'backgroundDark' | 'none';
7
+ type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
8
+ interface ProductCardConfig {
9
+ variant: ProductCardVariant;
10
+ hoverVariant: ProductCardHoverVariant;
11
+ layoutVariant: ProductCardLayoutVariant;
12
+ pricePrefix?: string;
13
+ }
14
+ type SearchInputVariant = 'standard';
15
+ type ProductGridVariant = 'standard' | 'square';
16
+ //#endregion
17
+ export { type ProductCardConfig, ProductGridVariant, SearchInputVariant };
@@ -0,0 +1,9 @@
1
+ //#region ../hooks/dist/hooks/utils.d.ts
2
+
3
+ declare enum SearchResultsState {
4
+ Loading = 0,
5
+ Results = 1,
6
+ NoResults = 2,
7
+ }
8
+ //#endregion
9
+ export { SearchResultsState };
@@ -0,0 +1,9 @@
1
+ //#region ../hooks/dist/hooks/utils.d.ts
2
+
3
+ declare enum SearchResultsState {
4
+ Loading = 0,
5
+ Results = 1,
6
+ NoResults = 2,
7
+ }
8
+ //#endregion
9
+ export { SearchResultsState };
@@ -0,0 +1,36 @@
1
+ //#region ../hooks/dist/types/search-filter-types.d.ts
2
+
3
+ type CloseIconVariant = 'light' | 'tertiary' | 'dark';
4
+ type SelectFilterItem = ({
5
+ filterId,
6
+ filterItemId,
7
+ isSelected,
8
+ displayName
9
+ }: {
10
+ filterId: string;
11
+ filterItemId: string;
12
+ isSelected: boolean;
13
+ displayName: string;
14
+ }) => void;
15
+ type SearchFilterDatum = {
16
+ filterId: string;
17
+ displayName: string;
18
+ items: SearchFilterItemDatum[];
19
+ };
20
+ type SearchFilterItemDatum = {
21
+ filterItemId: string;
22
+ displayName: string;
23
+ productCount: number;
24
+ isSelected: boolean;
25
+ };
26
+ type FilterFooterProps = {
27
+ closeModal: () => void;
28
+ clearAllFilters: () => void;
29
+ filterCount: number;
30
+ hasFiltersChanged: boolean;
31
+ applyFiltersUnchangedClasses: string;
32
+ applyFiltersChangedClasses: string;
33
+ };
34
+ //#endregion
35
+ //#endregion
36
+ export { CloseIconVariant, FilterFooterProps, SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem };
@@ -0,0 +1,36 @@
1
+ //#region ../hooks/dist/types/search-filter-types.d.ts
2
+
3
+ type CloseIconVariant = 'light' | 'tertiary' | 'dark';
4
+ type SelectFilterItem = ({
5
+ filterId,
6
+ filterItemId,
7
+ isSelected,
8
+ displayName
9
+ }: {
10
+ filterId: string;
11
+ filterItemId: string;
12
+ isSelected: boolean;
13
+ displayName: string;
14
+ }) => void;
15
+ type SearchFilterDatum = {
16
+ filterId: string;
17
+ displayName: string;
18
+ items: SearchFilterItemDatum[];
19
+ };
20
+ type SearchFilterItemDatum = {
21
+ filterItemId: string;
22
+ displayName: string;
23
+ productCount: number;
24
+ isSelected: boolean;
25
+ };
26
+ type FilterFooterProps = {
27
+ closeModal: () => void;
28
+ clearAllFilters: () => void;
29
+ filterCount: number;
30
+ hasFiltersChanged: boolean;
31
+ applyFiltersUnchangedClasses: string;
32
+ applyFiltersChangedClasses: string;
33
+ };
34
+ //#endregion
35
+ //#endregion
36
+ export { CloseIconVariant, FilterFooterProps, SearchFilterDatum, SearchFilterItemDatum, SelectFilterItem };
@@ -0,0 +1,8 @@
1
+ //#region ../hooks/dist/types/test-types.d.ts
2
+ //#region src/types/test-types.d.ts
3
+ interface TestProps {
4
+ dataTestId?: string;
5
+ }
6
+ //#endregion
7
+ //#endregion
8
+ export { TestProps };
@@ -0,0 +1,8 @@
1
+ //#region ../hooks/dist/types/test-types.d.ts
2
+ //#region src/types/test-types.d.ts
3
+ interface TestProps {
4
+ dataTestId?: string;
5
+ }
6
+ //#endregion
7
+ //#endregion
8
+ export { TestProps };
@@ -1,4 +1,4 @@
1
- import { ColorNames } from "@envive-ai/react-hooks/contexts/types";
1
+ import { ColorNames } from "../hooks/dist/application/models/colorsConfig.cjs";
2
2
 
3
3
  //#region src/util/colorVar.d.ts
4
4
  declare const colorVar: (color: ColorNames) => string;
@@ -1,4 +1,4 @@
1
- import { ColorNames } from "@envive-ai/react-hooks/contexts/types";
1
+ import { ColorNames } from "../hooks/dist/application/models/colorsConfig.js";
2
2
 
3
3
  //#region src/util/colorVar.d.ts
4
4
  declare const colorVar: (color: ColorNames) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-toolkit",
3
- "version": "0.2.14",
3
+ "version": "0.3.0",
4
4
  "description": "React component library for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,6 +37,8 @@
37
37
  "react-indiana-drag-scroll": "^3.0.3-alpha"
38
38
  },
39
39
  "peerDependencies": {
40
+ "@envive-ai/react-hooks": "*",
41
+ "@envive-ai/react-icons": "*",
40
42
  "framer-motion": ">=12.23.24",
41
43
  "react": "^18.3.1",
42
44
  "react-dom": "^18.3.1"