@itcase/ui 1.9.51 → 1.9.52

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 (104) hide show
  1. package/dist/{Avatar_cjs_CZ0XJ6d2.js → Avatar_cjs_CvbURI0f.js} +1 -1
  2. package/dist/{Avatar_es_B2gMldVe.js → Avatar_es_CV-ffIJu.js} +1 -1
  3. package/dist/{ChipsGroup_cjs_D0xy5I4S.js → ChipsGroup_cjs_CE-nNENH.js} +2 -4
  4. package/dist/{ChipsGroup_es_C_dgXLfC.js → ChipsGroup_es_CxqwFgoo.js} +2 -4
  5. package/dist/{Image_cjs_C_FMjUjx.js → Image_cjs_Hvjp2QDB.js} +2 -2
  6. package/dist/{Image_es_Ca7UQOkj.js → Image_es_DpOCNWpn.js} +2 -2
  7. package/dist/{SelectContainer_cjs_DshFNYWN.js → SelectContainer_cjs_qWAMLIkz.js} +5 -5
  8. package/dist/{SelectContainer_es_BQ3-SqL2.js → SelectContainer_es_kRH4DsEh.js} +5 -5
  9. package/dist/cjs/components/Avatar.js +2 -2
  10. package/dist/cjs/components/AvatarStack.js +2 -2
  11. package/dist/cjs/components/Checkbox.js +47 -50
  12. package/dist/cjs/components/Checkmark.js +31 -6
  13. package/dist/cjs/components/Chips.js +1 -1
  14. package/dist/cjs/components/DatePeriod.js +8 -8
  15. package/dist/cjs/components/DatePicker.js +4 -4
  16. package/dist/cjs/components/Drawer.js +23 -24
  17. package/dist/cjs/components/Image.js +1 -1
  18. package/dist/cjs/components/InputPassword.js +1 -1
  19. package/dist/cjs/components/Select/stories/__mock__.js +4 -4
  20. package/dist/cjs/components/Select.js +2 -2
  21. package/dist/cjs/components/Tile.js +2 -1
  22. package/dist/cjs/context/Notifications.js +1 -1
  23. package/dist/cjs/context/UIContext.js +7 -1
  24. package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
  25. package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +3 -3
  26. package/dist/cjs/hooks/useStyles/styleAttributes.js +166 -43
  27. package/dist/cjs/hooks/useStyles/useStyles.js +169 -155
  28. package/dist/cjs/utils/mergeAppearanceKeys.js +14 -1
  29. package/dist/components/Avatar.js +2 -2
  30. package/dist/components/AvatarStack.js +2 -2
  31. package/dist/components/Checkbox.js +47 -50
  32. package/dist/components/Checkmark.js +31 -6
  33. package/dist/components/Chips.js +1 -1
  34. package/dist/components/DatePeriod.js +8 -8
  35. package/dist/components/DatePicker.js +4 -4
  36. package/dist/components/Drawer.js +23 -24
  37. package/dist/components/Image.js +1 -1
  38. package/dist/components/InputPassword.js +1 -1
  39. package/dist/components/Select/stories/__mock__.js +4 -4
  40. package/dist/components/Select.js +2 -2
  41. package/dist/components/Tile.js +2 -1
  42. package/dist/context/Notifications.js +1 -1
  43. package/dist/context/UIContext.js +7 -1
  44. package/dist/css/styles/bundles.css +102 -97
  45. package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +9 -9
  46. package/dist/hooks/useActiveClasses/useActiveClasses.js +3 -3
  47. package/dist/hooks/useStyles/styleAttributes.js +166 -43
  48. package/dist/hooks/useStyles/useStyles.js +169 -155
  49. package/dist/types/components/Avatar/Avatar.interface.d.ts +2 -2
  50. package/dist/types/components/AvatarStack/AvatarStack.interface.d.ts +9 -15
  51. package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +9 -8
  52. package/dist/types/components/Checkbox/Checkbox.interface.d.ts +3 -3
  53. package/dist/types/components/Checkbox/appearance/checkboxShape.d.ts +3 -0
  54. package/dist/types/components/Checkmark/Checkmark.interface.d.ts +8 -2
  55. package/dist/types/components/Checkmark/appearance/checkmarkError.d.ts +3 -0
  56. package/dist/types/components/Checkmark/stories/CheckmarkError.stories.d.ts +23 -0
  57. package/dist/types/components/Chips/Chips.interface.d.ts +2 -2
  58. package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +20 -19
  59. package/dist/types/components/DatePeriod/stories/DatePeriodSize.stories.d.ts +3 -0
  60. package/dist/types/components/DatePicker/DatePicker.interface.d.ts +4 -3
  61. package/dist/types/components/HeroTitle/HeroTitle.interface.d.ts +1 -1
  62. package/dist/types/components/Link/Link.interface.d.ts +1 -1
  63. package/dist/types/components/List/List.interface.d.ts +1 -1
  64. package/dist/types/components/Loader/Loader.interface.d.ts +4 -3
  65. package/dist/types/components/MenuItem/MenuItem.interface.d.ts +1 -1
  66. package/dist/types/components/Notification/Notification.interface.d.ts +2 -2
  67. package/dist/types/components/Search/Search.interface.d.ts +10 -9
  68. package/dist/types/components/Search/SearchInput.d.ts +7 -7
  69. package/dist/types/components/Search/stories/SearchInputDefault.stories.d.ts +7 -7
  70. package/dist/types/components/Search/stories/SearchInputDemo.stories.d.ts +7 -7
  71. package/dist/types/components/Search/stories/SearchInputDisabled.stories.d.ts +7 -7
  72. package/dist/types/components/Search/stories/SearchInputError.stories.d.ts +7 -7
  73. package/dist/types/components/Search/stories/SearchInputRequire.stories.d.ts +7 -7
  74. package/dist/types/components/Search/stories/SearchInputShape.stories.d.ts +7 -7
  75. package/dist/types/components/Search/stories/SearchInputSize.stories.d.ts +7 -7
  76. package/dist/types/components/Search/stories/SearchInputStyle.stories.d.ts +7 -7
  77. package/dist/types/components/Search/stories/SearchInputSuccess.stories.d.ts +7 -7
  78. package/dist/types/components/Select/Select.interface.d.ts +9 -7
  79. package/dist/types/components/Select/SelectContainer.d.ts +4 -1
  80. package/dist/types/components/Select/SelectMultiValue.d.ts +2 -2
  81. package/dist/types/components/Select/stories/Select.stories.d.ts +5 -3
  82. package/dist/types/components/Select/stories/SelectDefault.stories.d.ts +5 -3
  83. package/dist/types/components/Select/stories/SelectDisabled.stories.d.ts +5 -3
  84. package/dist/types/components/Select/stories/SelectError.stories.d.ts +5 -3
  85. package/dist/types/components/Select/stories/SelectRequire.stories.d.ts +5 -3
  86. package/dist/types/components/Select/stories/SelectShape.stories.d.ts +5 -3
  87. package/dist/types/components/Select/stories/SelectSize.stories.d.ts +5 -3
  88. package/dist/types/components/Select/stories/SelectStyle.stories.d.ts +5 -3
  89. package/dist/types/components/Select/stories/SelectSuccess.stories.d.ts +5 -3
  90. package/dist/types/components/Select/stories/__mock__/index.d.ts +2 -2
  91. package/dist/types/components/Swiper/Swiper.interface.d.ts +2 -11
  92. package/dist/types/components/Text/Text.interface.d.ts +2 -2
  93. package/dist/types/context/Notifications.d.ts +1 -1
  94. package/dist/types/context/Notifications.interface.d.ts +2 -1
  95. package/dist/types/context/UIContext.d.ts +10 -4
  96. package/dist/types/hooks/useActiveClasses/useActiveClasses.interface.d.ts +1 -2
  97. package/dist/types/hooks/useStyles/styleAttributes.d.ts +2 -3
  98. package/dist/types/hooks/useStyles/styleAttributes.interface.d.ts +9 -3
  99. package/dist/types/hooks/useStyles/useStyles.d.ts +4 -1
  100. package/dist/types/utils/mergeAppearanceKeys.d.ts +6 -1
  101. package/dist/utils/mergeAppearanceKeys.js +14 -1
  102. package/package.json +12 -12
  103. package/dist/{DatePicker_cjs_avA-OHmZ.js → DatePicker_cjs_BJzVpk0o.js} +3 -3
  104. package/dist/{DatePicker_es_ungoFvip.js → DatePicker_es_BP0iWHMt.js} +3 -3
@@ -21,14 +21,14 @@ declare const meta: {
21
21
  iconClearSize?: import("../../Icon/Icon.interface").IconProps["size"];
22
22
  iconClearSrc?: import("../../Icon/Icon.interface").IconProps["imageSrc"];
23
23
  inputFill?: import("@itcase/types-ui").FillProps;
24
- inputTextColor?: import("@itcase/types-ui").TextColorProps;
25
- inputTextSize?: import("@itcase/types-ui").TextSizeProps;
26
- inputTextStyle?: "italic" | "normal";
24
+ inputTextColor?: import("../../Text/Text.interface").TextProps["textColor"];
25
+ inputTextSize?: import("../../Text/Text.interface").TextProps["size"];
26
+ inputTextStyle?: import("../../Text/Text.interface").TextProps["textStyle"];
27
27
  inputTextWeight?: import("@itcase/types-ui").TextWeightProps;
28
- placeholderTextColor?: import("@itcase/types-ui").TextColorProps;
29
- placeholderTextSize?: import("@itcase/types-ui").TextSizeProps;
30
- placeholderTextStyle?: "italic" | "normal";
31
- placeholderTextWeight?: import("@itcase/types-ui").TextWeightProps;
28
+ placeholderTextColor?: import("../../Text/Text.interface").TextProps["textColor"];
29
+ placeholderTextSize?: import("../../Text/Text.interface").TextProps["size"];
30
+ placeholderTextStyle?: import("../../Text/Text.interface").TextProps["textStyle"];
31
+ placeholderTextWeight?: import("../../Text/Text.interface").TextProps["textWeight"];
32
32
  shape?: import("@itcase/types-ui").ShapeProps;
33
33
  shapeStrength?: import("@itcase/types-ui").ShapeStrengthProps;
34
34
  size?: import("@itcase/types-ui").SizeProps;
@@ -21,14 +21,14 @@ declare const meta: {
21
21
  iconClearSize?: import("../../Icon/Icon.interface").IconProps["size"];
22
22
  iconClearSrc?: import("../../Icon/Icon.interface").IconProps["imageSrc"];
23
23
  inputFill?: import("@itcase/types-ui").FillProps;
24
- inputTextColor?: import("@itcase/types-ui").TextColorProps;
25
- inputTextSize?: import("@itcase/types-ui").TextSizeProps;
26
- inputTextStyle?: "italic" | "normal";
24
+ inputTextColor?: import("../../Text/Text.interface").TextProps["textColor"];
25
+ inputTextSize?: import("../../Text/Text.interface").TextProps["size"];
26
+ inputTextStyle?: import("../../Text/Text.interface").TextProps["textStyle"];
27
27
  inputTextWeight?: import("@itcase/types-ui").TextWeightProps;
28
- placeholderTextColor?: import("@itcase/types-ui").TextColorProps;
29
- placeholderTextSize?: import("@itcase/types-ui").TextSizeProps;
30
- placeholderTextStyle?: "italic" | "normal";
31
- placeholderTextWeight?: import("@itcase/types-ui").TextWeightProps;
28
+ placeholderTextColor?: import("../../Text/Text.interface").TextProps["textColor"];
29
+ placeholderTextSize?: import("../../Text/Text.interface").TextProps["size"];
30
+ placeholderTextStyle?: import("../../Text/Text.interface").TextProps["textStyle"];
31
+ placeholderTextWeight?: import("../../Text/Text.interface").TextProps["textWeight"];
32
32
  shape?: import("@itcase/types-ui").ShapeProps;
33
33
  shapeStrength?: import("@itcase/types-ui").ShapeStrengthProps;
34
34
  size?: import("@itcase/types-ui").SizeProps;
@@ -1,17 +1,17 @@
1
1
  import type { ReactNode } from 'react';
2
- import { GroupBase, PropsValue } from 'react-select';
2
+ import { ActionMeta, GroupBase, OnChangeValue, PropsValue, SingleValue } from 'react-select';
3
3
  import { Props } from 'react-select/base';
4
4
  import { Option as SelectOption } from '@itcase/types-core';
5
- import { AppearanceShapeKey, AppearanceSizeKey, AppearanceStateKeysDefault, AppearanceStyleKey, BorderColorHoverProps, BorderColorProps, BorderTypeProps, CompositeAppearanceKey, DirectionProps, FillHoverProps, FillProps, ShapeProps, ShapeStrengthProps, SizeProps, WidthProps } from '@itcase/types-ui';
5
+ import { AppearanceShapeKey, AppearanceSizeKey, AppearanceStateKeysDefault, AppearanceStyleKey, BorderColorHoverProps, BorderColorProps, BorderTypeProps, CompositeAppearanceStateKeys, DirectionProps, FillHoverProps, FillProps, ShapeProps, ShapeStrengthProps, SizeProps, WidthProps } from '@itcase/types-ui';
6
6
  import { BadgeProps } from 'src/components/Badge/Badge.interface';
7
7
  import { DividerProps } from 'src/components/Divider/Divider.interface';
8
8
  import { DropdownProps } from 'src/components/Dropdown/Dropdown.interface';
9
9
  import { IconProps } from 'src/components/Icon/Icon.interface';
10
10
  import { LoaderProps } from 'src/components/Loader/Loader.interface';
11
11
  import { TextProps } from 'src/components/Text/Text.interface';
12
- type SelectAppearanceProps<Option = SelectOption> = {
12
+ type SelectAppearanceProps<Option> = {
13
13
  after?: React.ReactNode;
14
- appearance?: CompositeAppearanceKey;
14
+ appearance?: CompositeAppearanceStateKeys;
15
15
  badgeAppearance?: BadgeProps['appearance'];
16
16
  badgeAppearanceSize?: AppearanceSizeKey;
17
17
  badgeSize?: BadgeProps['size'];
@@ -127,12 +127,14 @@ type SelectAppearanceProps<Option = SelectOption> = {
127
127
  };
128
128
  type AppearanceKeys = AppearanceShapeKey | AppearanceSizeKey | AppearanceStateKeysDefault | AppearanceStyleKey;
129
129
  type SelectAppearance = {
130
- [key in AppearanceKeys]?: SelectAppearanceProps;
130
+ [key in AppearanceKeys]?: SelectAppearanceProps<SelectOption>;
131
131
  };
132
132
  type SelectConfig = {
133
133
  appearance: SelectAppearance;
134
134
  setAppearance: (appearanceConfig: SelectAppearance) => void;
135
135
  };
136
- type SelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Partial<Pick<Props<Option, IsMulti, Group>, 'className' | 'closeMenuOnSelect' | 'filterOption' | 'hideSelectedOptions' | 'hideValueContainer' | 'instanceId' | 'isClearable' | 'isDisabled' | 'isLoading' | 'isMulti' | 'isSearchable' | 'loadingMessage' | 'onChange' | 'onInputChange' | 'openMenuOnClick' | 'options' | 'value'>> & SelectAppearanceProps<Option> & SelectPropsCustom<Option> & {};
137
- type SelectPropsCustom<Option> = SelectAppearanceProps<Option> & {};
136
+ type SelectProps<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = Partial<Pick<Props<Option, IsMulti, Group>, 'className' | 'closeMenuOnSelect' | 'filterOption' | 'hideSelectedOptions' | 'hideValueContainer' | 'instanceId' | 'isClearable' | 'isDisabled' | 'isLoading' | 'isMulti' | 'isSearchable' | 'loadingMessage' | 'onInputChange' | 'openMenuOnClick' | 'options' | 'value'>> & SelectAppearanceProps<Option> & SelectPropsCustom<Option>;
137
+ type SelectPropsCustom<Option> = SelectAppearanceProps<Option> & {
138
+ onChange?: (newValue: OnChangeValue<Option, boolean> | SingleValue<Option>, actionMeta?: ActionMeta<Option>) => void;
139
+ };
138
140
  export type { SelectAppearance, SelectAppearanceProps, SelectConfig, SelectProps, SelectPropsCustom, };
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  import { GroupBase, SelectInstance } from 'react-select';
3
+ import { Option as SelectOptionType } from '@itcase/types-core';
3
4
  import { SelectConfig } from './Select.interface';
4
5
  declare const selectConfig: SelectConfig;
5
- declare const SelectContainer: React.ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("./Select.interface").SelectAppearanceProps<unknown> & React.RefAttributes<SelectInstance<unknown, boolean, GroupBase<unknown>>>>;
6
+ declare const SelectContainer: React.ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<SelectOptionType, boolean, GroupBase<SelectOptionType>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("./Select.interface").SelectAppearanceProps<SelectOptionType> & {
7
+ onChange?: (newValue: import("react-select").OnChangeValue<SelectOptionType, boolean>, actionMeta?: import("react-select").ActionMeta<SelectOptionType>) => void;
8
+ } & React.RefAttributes<SelectInstance<SelectOptionType, boolean, GroupBase<SelectOptionType>>>>;
6
9
  export { selectConfig, SelectContainer };
@@ -1,4 +1,4 @@
1
1
  import { GroupBase, MultiValueProps } from 'react-select';
2
- import { Option } from '@itcase/types-core';
3
- declare const SelectMultiValue: <SelectOption extends Option, IsMulti extends boolean, Group extends GroupBase<SelectOption>>(props: MultiValueProps<SelectOption, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
2
+ import { Option as SelectOption } from '@itcase/types-core';
3
+ declare const SelectMultiValue: <Option extends SelectOption, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: MultiValueProps<Option, IsMulti, Group>) => import("react/jsx-runtime").JSX.Element;
4
4
  export { SelectMultiValue };
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  elevation: number;
8
10
  hideSelectedOptions: boolean;
@@ -15,14 +17,14 @@ declare const meta: {
15
17
  label: string;
16
18
  value: string;
17
19
  }[];
18
- isDisabled?: undefined;
19
20
  value?: undefined;
21
+ isDisabled?: undefined;
20
22
  isFixed?: undefined;
21
23
  isSelected?: undefined;
22
24
  } | {
23
25
  label: string;
24
- isDisabled: boolean;
25
26
  value: string;
27
+ isDisabled: boolean;
26
28
  options?: undefined;
27
29
  isFixed?: undefined;
28
30
  isSelected?: undefined;
@@ -2,7 +2,9 @@ import { Option } from '@itcase/types-core';
2
2
  import { SelectPropsCustom } from '../Select.interface';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<unknown, boolean, import("react-select").GroupBase<unknown>>, "value" | "isLoading" | "className" | "isDisabled" | "onChange" | "options" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isClearable" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<unknown> & import("react").RefAttributes<import("react-select").SelectInstance<unknown, boolean, import("react-select").GroupBase<unknown>>>>;
5
+ component: import("react").ForwardRefExoticComponent<Partial<Pick<import("react-select/base").Props<Option, boolean, import("react-select").GroupBase<Option>>, "value" | "isLoading" | "className" | "isDisabled" | "options" | "isClearable" | "closeMenuOnSelect" | "filterOption" | "hideSelectedOptions" | "hideValueContainer" | "instanceId" | "isMulti" | "isSearchable" | "loadingMessage" | "onInputChange" | "openMenuOnClick">> & import("../Select.interface").SelectAppearanceProps<Option> & {
6
+ onChange?: (newValue: import("react-select").OnChangeValue<Option, boolean>, actionMeta?: import("react-select").ActionMeta<Option>) => void;
7
+ } & import("react").RefAttributes<import("react-select").SelectInstance<Option, boolean, import("react-select").GroupBase<Option>>>>;
6
8
  args: {
7
9
  appearance: string;
8
10
  elevation: number;
@@ -16,14 +18,14 @@ declare const meta: {
16
18
  label: string;
17
19
  value: string;
18
20
  }[];
19
- isDisabled?: undefined;
20
21
  value?: undefined;
22
+ isDisabled?: undefined;
21
23
  isFixed?: undefined;
22
24
  isSelected?: undefined;
23
25
  } | {
24
26
  label: string;
25
- isDisabled: boolean;
26
27
  value: string;
28
+ isDisabled: boolean;
27
29
  options?: undefined;
28
30
  isFixed?: undefined;
29
31
  isSelected?: undefined;
@@ -10,14 +10,14 @@ export namespace SelectDefaultMock {
10
10
  label: string;
11
11
  value: string;
12
12
  }[];
13
- isDisabled?: undefined;
14
13
  value?: undefined;
14
+ isDisabled?: undefined;
15
15
  isFixed?: undefined;
16
16
  isSelected?: undefined;
17
17
  } | {
18
18
  label: string;
19
- isDisabled: boolean;
20
19
  value: string;
20
+ isDisabled: boolean;
21
21
  options?: undefined;
22
22
  isFixed?: undefined;
23
23
  isSelected?: undefined;
@@ -6,17 +6,6 @@ import { StyleAttributes } from 'src/hooks/useStyles/styleAttributes.interface';
6
6
  type SwiperAppearanceProps = {
7
7
  align?: AlignProps;
8
8
  alignDirection?: DirectionProps;
9
- allowTouchMove?: boolean;
10
- autoHeight?: boolean;
11
- breakpoints?: {
12
- [ratio: string]: SwiperOptions;
13
- [width: number]: SwiperOptions;
14
- };
15
- children?: ReactNode;
16
- className?: string;
17
- dataTestId?: string;
18
- dataTour?: string;
19
- direction?: 'horizontal' | 'vertical';
20
9
  fill?: FillProps;
21
10
  shape?: ShapeProps;
22
11
  };
@@ -31,6 +20,8 @@ type SwiperProps = StyleAttributes & SwiperAppearanceProps & {
31
20
  };
32
21
  children?: ReactNode;
33
22
  className?: string;
23
+ dataTestId?: string;
24
+ dataTour?: string;
34
25
  direction?: 'horizontal' | 'vertical';
35
26
  forwardedRef: Ref<SwiperRef>;
36
27
  freeMode?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
- import { AppearanceKeysDefault, AppearanceShapeKey, AppearanceSizeKey, AppearanceStyleKey, CompositeAppearanceSizePxKey, TextAlignProps, TextColorActiveHoverProps, TextColorActiveProps, TextColorHoverProps, TextColorProps, TextFontProps, TextSizeProps, TextTagProps, TextWeightProps, TextWrapProps } from '@itcase/types-ui';
2
+ import { AppearanceKeysDefault, AppearanceShapeKey, AppearanceSizeKey, AppearanceStyleKey, CompositeAppearanceSizePxKey, TextAlignProps, TextColorActiveHoverProps, TextColorActiveProps, TextColorHoverProps, TextColorProps, TextFontProps, TextSizeProps, TextStyleProps, TextTagProps, TextWeightProps, TextWrapProps } from '@itcase/types-ui';
3
3
  import { StyleAttributes } from 'src/hooks/useStyles/styleAttributes.interface';
4
4
  type TextAppearanceProps = {
5
5
  cursor?: string;
@@ -13,7 +13,7 @@ type TextAppearanceProps = {
13
13
  textColorGradient?: string;
14
14
  textColorHover?: TextColorHoverProps | TextColorProps;
15
15
  textFont?: TextFontProps;
16
- textStyle?: 'italic' | 'normal';
16
+ textStyle?: TextStyleProps;
17
17
  textTruncate?: boolean;
18
18
  textWeight?: TextWeightProps;
19
19
  textWrap?: TextWrapProps;
@@ -3,7 +3,7 @@ import type { CreatedNotification, Notification, NotificationsProviderProps } fr
3
3
  declare function NotificationsProvider(props: NotificationsProviderProps): import("react/jsx-runtime").JSX.Element;
4
4
  declare function useNotifications(): Notification[];
5
5
  declare function useNotificationsAPI(): {
6
- hideNotifications: (targetId: GeneratedId) => void;
6
+ hideNotifications: (targetId?: GeneratedId) => void;
7
7
  showNotification: (notification: string | CreatedNotification, onClose?: SimpleCallback) => void;
8
8
  notificationStatuses: {
9
9
  readonly error: "error";
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { GeneratedId } from '@itcase/types-core';
3
+ import { ButtonProps } from 'src/components/Button/Button.interface';
3
4
  import { NotificationProps } from 'src/components/Notification/Notification.interface';
4
5
  interface Notification {
5
6
  id: GeneratedId;
@@ -17,7 +18,7 @@ interface Notification {
17
18
  title: string;
18
19
  type?: 'float' | 'global' | 'toast';
19
20
  isLoading: boolean;
20
- onClickButton: (() => void) | null;
21
+ onClickButton: ButtonProps['onClick'];
21
22
  onClose?: () => void;
22
23
  }
23
24
  interface CreatedNotification {
@@ -1,7 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
+ type DeviceType = '' | 'desktop' | 'mobile' | 'tablet';
2
3
  type UIProviderProps = {
3
4
  children?: ReactNode;
4
5
  userDeviceState?: {
6
+ deviceCurrentMainType: DeviceType;
7
+ deviceCurrentType: string;
8
+ deviceTypesList: string[];
5
9
  isDesktop?: boolean;
6
10
  isMobile?: boolean;
7
11
  isTablet?: boolean;
@@ -9,9 +13,11 @@ type UIProviderProps = {
9
13
  };
10
14
  declare const UIProvider: import("react").NamedExoticComponent<UIProviderProps>;
11
15
  declare function useUserDeviceContext(): {
12
- isMobile: boolean;
13
- isTablet: boolean;
14
- isDesktop: boolean;
15
- deviceCurrentMainType: string;
16
+ deviceCurrentMainType: DeviceType;
17
+ deviceCurrentType: string;
18
+ deviceTypesList: string[];
19
+ isDesktop?: boolean;
20
+ isMobile?: boolean;
21
+ isTablet?: boolean;
16
22
  };
17
23
  export { UIProvider, useUserDeviceContext };
@@ -3,9 +3,8 @@ type SuffixComponents = (typeof suffix)[number];
3
3
  type SpecialSuffix<T extends string> = T extends 'HTMLContent' ? 'htmlContent' : Uncapitalize<T>;
4
4
  type SuffixKeys = SpecialSuffix<SuffixComponents>;
5
5
  interface PropsGenerator {
6
- [key: string]: string | number | undefined | any;
6
+ [key: string]: any | number | string | undefined;
7
7
  getProp?: (propKey: string) => number | string | undefined;
8
- getClassName?: <K extends string, P = undefined>(propKey: K, params?: P) => string;
9
8
  }
10
9
  interface UseActiveClassesReturn {
11
10
  rootClasses: string;
@@ -1,4 +1,3 @@
1
- declare const _default: (string | (string | {
2
- validate: (value: any) => boolean;
3
- })[])[];
1
+ import { StyleAttributeOrValidator } from './styleAttributes.interface';
2
+ declare const _default: StyleAttributeOrValidator[];
4
3
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from 'react';
1
2
  import type * as CSS from 'csstype';
2
3
  import { HeightProps, ResizeModeProps, WidthProps } from '@itcase/types-ui';
3
4
  export interface StyleAttributes {
@@ -129,13 +130,18 @@ type LabelInterface<T> = {
129
130
  type ImageInterface<T> = {
130
131
  [P in keyof T as `${P & string}Image`]: T[P];
131
132
  };
133
+ export type CSSPropertiesKey = keyof CSSProperties;
132
134
  export interface TypeStyleWrapperAttributes extends WrappedInterface<StyleAttributes> {
133
135
  }
134
136
  export interface TypeStyleLabelAttributes extends LabelInterface<StyleAttributes> {
135
137
  }
136
138
  export interface TypeStyleImageAttributes extends ImageInterface<StyleAttributes> {
137
139
  }
138
- export type StyleAttributeOrValidator = StyleAttributes | [StyleAttributes['width'], {
139
- validate?: (value: string) => boolean;
140
- }];
140
+ export type StyleValidator = [
141
+ StyleAttributes['width'],
142
+ {
143
+ validate?: (value: string) => boolean;
144
+ }
145
+ ];
146
+ export type StyleAttributeOrValidator = StyleAttributes | StyleValidator;
141
147
  export {};
@@ -1 +1,4 @@
1
- export function useStyles(props: any): {};
1
+ import { CSSProperties } from 'react';
2
+ import { ComponentProps } from '../useDevicePropsGenerator/useDevicePropsGenerator.interface';
3
+ declare function useStyles<Props extends ComponentProps>(props: Props): Record<string, CSSProperties>;
4
+ export { useStyles };
@@ -1,2 +1,7 @@
1
- declare const mergeAppearanceKeys: <T extends string>(...values: string[]) => T;
1
+ type MergeAppearanceKeysReturn = any;
2
+ /**
3
+ * @example
4
+ * mergeAppearanceKeys(' ', '1', undefined, '2', '1') === '1 2'
5
+ */
6
+ declare const mergeAppearanceKeys: (...appearances: Array<string | undefined>) => MergeAppearanceKeysReturn;
2
7
  export { mergeAppearanceKeys };
@@ -1,3 +1,16 @@
1
- const mergeAppearanceKeys = (...values) => values.join(' ');
1
+ /**
2
+ * @example
3
+ * mergeAppearanceKeys(' ', '1', undefined, '2', '1') === '1 2'
4
+ */
5
+ const mergeAppearanceKeys = (...appearances) => {
6
+ const trimmedAppearances = appearances
7
+ .map((appearance) => appearance?.trim())
8
+ .filter(Boolean);
9
+ if (trimmedAppearances.length < 2) {
10
+ return trimmedAppearances[0] ?? '';
11
+ }
12
+ const uniqueAppearances = Array.from(new Set(trimmedAppearances));
13
+ return uniqueAppearances.join(' ');
14
+ };
2
15
 
3
16
  export { mergeAppearanceKeys };