@ozen-ui/kit 0.60.0 → 0.61.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 (44) hide show
  1. package/__inner__/cjs/components/Autocomplete/helper.d.ts +7 -72
  2. package/__inner__/cjs/components/Autocomplete/types.d.ts +11 -17
  3. package/__inner__/cjs/components/AutocompleteNext/helpers.d.ts +7 -77
  4. package/__inner__/cjs/components/AutocompleteNext/types.d.ts +10 -16
  5. package/__inner__/cjs/components/DatePicker/DatePicker.d.ts +2 -36
  6. package/__inner__/cjs/components/DatePicker/types.d.ts +5 -14
  7. package/__inner__/cjs/components/Segment/Segment.js +1 -1
  8. package/__inner__/cjs/components/Segment/components/SegmentItem/SegmentItem.js +1 -1
  9. package/__inner__/cjs/components/Select/Select.css +6 -0
  10. package/__inner__/cjs/components/Select/Select.js +41 -59
  11. package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +5 -6
  12. package/__inner__/cjs/components/Select/components/SelectInputContextConsumer/SelectInputContextConsumer.d.ts +5 -0
  13. package/__inner__/cjs/components/Select/components/{SelectConsumer/SelectInputConsumer.js → SelectInputContextConsumer/SelectInputContextConsumer.js} +3 -3
  14. package/__inner__/cjs/components/Select/components/SelectInputContextConsumer/index.d.ts +1 -0
  15. package/__inner__/cjs/components/Select/components/{SelectConsumer → SelectInputContextConsumer}/index.js +1 -1
  16. package/__inner__/cjs/components/Select/helpers/types.d.ts +5 -8
  17. package/__inner__/cjs/components/Select/helpers/types.js +5 -1
  18. package/__inner__/cjs/components/Select/types.d.ts +43 -41
  19. package/__inner__/cjs/components/Stack/types.d.ts +2 -2
  20. package/__inner__/esm/components/Autocomplete/helper.d.ts +7 -72
  21. package/__inner__/esm/components/Autocomplete/types.d.ts +11 -17
  22. package/__inner__/esm/components/AutocompleteNext/helpers.d.ts +7 -77
  23. package/__inner__/esm/components/AutocompleteNext/types.d.ts +10 -16
  24. package/__inner__/esm/components/DatePicker/DatePicker.d.ts +2 -36
  25. package/__inner__/esm/components/DatePicker/types.d.ts +5 -14
  26. package/__inner__/esm/components/Segment/Segment.js +1 -1
  27. package/__inner__/esm/components/Segment/components/SegmentItem/SegmentItem.js +1 -1
  28. package/__inner__/esm/components/Select/Select.css +6 -0
  29. package/__inner__/esm/components/Select/Select.js +42 -60
  30. package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +5 -6
  31. package/__inner__/esm/components/Select/components/SelectInputContextConsumer/SelectInputContextConsumer.d.ts +5 -0
  32. package/__inner__/esm/components/Select/components/{SelectConsumer/SelectInputConsumer.js → SelectInputContextConsumer/SelectInputContextConsumer.js} +1 -1
  33. package/__inner__/esm/components/Select/components/SelectInputContextConsumer/index.d.ts +1 -0
  34. package/__inner__/esm/components/Select/components/SelectInputContextConsumer/index.js +1 -0
  35. package/__inner__/esm/components/Select/helpers/types.d.ts +5 -8
  36. package/__inner__/esm/components/Select/helpers/types.js +2 -0
  37. package/__inner__/esm/components/Select/types.d.ts +43 -41
  38. package/__inner__/esm/components/Stack/types.d.ts +2 -2
  39. package/package.json +4 -4
  40. package/__inner__/cjs/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +0 -5
  41. package/__inner__/cjs/components/Select/components/SelectConsumer/index.d.ts +0 -1
  42. package/__inner__/esm/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +0 -5
  43. package/__inner__/esm/components/Select/components/SelectConsumer/index.d.ts +0 -1
  44. package/__inner__/esm/components/Select/components/SelectConsumer/index.js +0 -1
@@ -1,45 +1,37 @@
1
1
  import type { ReactElement, ReactNode, SyntheticEvent } from 'react';
2
2
  import type { ExtendableComponentPropsWithRef } from '../../types/ExtendableComponentPropsWithRef';
3
3
  import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
4
- import type { DataListBaseProps, DataListSelected } from '../DataList';
4
+ import type { DataListBaseProps, DataListOptionProps, DataListSelected } from '../DataList';
5
5
  import type { SelectInputProps, SelectInputRef } from './components';
6
- export type SelectSizeVariant = FormElementSizeVariant;
7
- export type SelectLabel = string | number | undefined;
8
- export type SelectPropLabel<MULTIPLE extends boolean> = (MULTIPLE extends true ? SelectLabel[] : SelectLabel) | undefined;
9
- export type SelectPropValue<MULTIPLE extends boolean> = DataListSelected<MULTIPLE>;
10
- export type SelectedOptionProp<MULTIPLE extends boolean> = {
11
- label?: SelectPropLabel<MULTIPLE>;
6
+ export type SelectPropSize = FormElementSizeVariant;
7
+ export type SelectLabel<MULTIPLE extends boolean = false> = (MULTIPLE extends true ? DataListOptionProps['label'][] : DataListOptionProps['label']) | undefined;
8
+ export type SelectPropValue<MULTIPLE extends boolean = false> = DataListSelected<MULTIPLE>;
9
+ export type SelectPropOnChange<MULTIPLE extends boolean = false> = (value: SelectPropValue<MULTIPLE>, e: SyntheticEvent | KeyboardEvent) => void;
10
+ export type SelectedOption<MULTIPLE extends boolean = false> = {
11
+ label?: SelectLabel<MULTIPLE>;
12
12
  value?: SelectPropValue<MULTIPLE>;
13
13
  };
14
- export type SelectRenderValue<MULTIPLE extends boolean> = (option: SelectedOptionProp<MULTIPLE>) => ReactNode | null;
15
- type SelectOpenControlledProps = {
16
- /** Текущее состояние списка. Если `true`, список отображается. */
17
- open?: boolean;
18
- /** Состояние открытие по умолчанию (неконтролируемый компонент) */
19
- defaultOpen?: never;
20
- };
21
- type SelectOpenUncontrolledProps = {
22
- /** Текущее состояние списка. Если `true`, список отображается. */
23
- open?: never;
24
- /** Состояние открытие по умолчанию (неконтролируемый компонент) */
25
- defaultOpen: boolean;
26
- };
27
- type SelectControlledProps<MULTIPLE extends boolean = false> = {
28
- /** Выбранное значение */
29
- value?: SelectPropValue<MULTIPLE>;
30
- /** Обработчик события на изменение выбранного значения */
31
- onChange?: (value: SelectPropValue<MULTIPLE>, e: SyntheticEvent | KeyboardEvent) => void;
32
- /** Значение поля по умолчанию (неконтролируемый компонент) */
33
- defaultValue?: never;
34
- };
35
- type SelectUncontrolledProps<MULTIPLE extends boolean = false> = {
36
- /** Значение поля по умолчанию (неконтролируемый компонент) */
37
- defaultValue: SelectPropValue<MULTIPLE>;
38
- /** Выбранное значение */
39
- value?: never;
40
- /** Обработчик события на изменение выбранного значения */
41
- onChange?: never;
42
- };
14
+ export type SelectPropRenderValue<MULTIPLE extends boolean = false> = (option: SelectedOption<MULTIPLE>) => ReactNode | null;
15
+ /**
16
+ * @deprecated
17
+ * Use the `SelectRenderValueProp` type to replace it.
18
+ * */
19
+ export type SelectRenderValue<MULTIPLE extends boolean = false> = SelectPropRenderValue<MULTIPLE>;
20
+ /**
21
+ * @deprecated
22
+ * Use the `SelectLabel` type to replace it.
23
+ * */
24
+ export type SelectPropLabel<MULTIPLE extends boolean = false> = SelectLabel<MULTIPLE>;
25
+ /**
26
+ * @deprecated
27
+ * Use the `SelectSizeProp` type to replace it.
28
+ * */
29
+ export type SelectSizeVariant = SelectPropSize;
30
+ /**
31
+ * @deprecated
32
+ * Use the `SelectedPropOption` type to replace it.
33
+ * */
34
+ export type SelectedOptionProp<MULTIPLE extends boolean = false> = SelectedOption<MULTIPLE>;
43
35
  type SelectPropsDeprecated<MULTIPLE extends boolean = false> = {
44
36
  /**
45
37
  * Свойства компонента Menu
@@ -52,21 +44,31 @@ export type SelectProps<MULTIPLE extends boolean = false> = ExtendableComponentP
52
44
  /** Если `true` устанавливает автофокус */
53
45
  autoFocus?: boolean;
54
46
  /** Размер компонента */
55
- size?: SelectSizeVariant;
47
+ size?: SelectPropSize;
48
+ /** Текущее состояние списка. Если `true`, список отображается. */
49
+ open?: boolean;
50
+ /** Состояние открытие по умолчанию (неконтролируемый компонент) */
51
+ defaultOpen?: boolean;
52
+ /** Выбранное значение */
53
+ value?: SelectPropValue<MULTIPLE>;
54
+ /** Обработчик события на изменение выбранного значения */
55
+ onChange?: SelectPropOnChange<MULTIPLE>;
56
+ /** Значение поля по умолчанию (неконтролируемый компонент) */
57
+ defaultValue?: SelectPropValue<MULTIPLE>;
56
58
  /** Рендер-функция для выбранного значения */
57
- renderValue?: SelectRenderValue<MULTIPLE>;
59
+ renderValue?: SelectPropRenderValue<MULTIPLE>;
58
60
  /** Содержимое компонента */
59
61
  children?: ReactNode;
60
62
  /** Свойства компонента DataList */
61
63
  dataListProps?: Partial<Omit<DataListBaseProps<MULTIPLE>, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
62
64
  /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает закрытие */
63
- onClose?: () => void;
65
+ onClose?(): void;
64
66
  /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает открытие */
65
- onOpen?: () => void;
67
+ onOpen?(): void;
66
68
  /** Если `true` из списка можно выбрать несколько вариантов */
67
69
  multiple?: MULTIPLE;
68
70
  /** Идентификатор компонента для тестов */
69
71
  'data-testid'?: string;
70
- } & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'disableStroke' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'hintProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & SelectPropsDeprecated<MULTIPLE> & (SelectControlledProps<MULTIPLE> | SelectUncontrolledProps<MULTIPLE>) & (SelectOpenControlledProps | SelectOpenUncontrolledProps), 'div'>;
72
+ } & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'disableStroke' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'hintProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & SelectPropsDeprecated<MULTIPLE>, 'div'>;
71
73
  export type SelectComponent = <MULTIPLE extends boolean = false>(props: SelectProps<MULTIPLE>) => ReactElement | null;
72
74
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ElementType, ReactElement } from 'react';
2
2
  import type { ResponsiveValue } from '../../types/ResponsiveValue';
3
- import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
3
+ import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
4
4
  export declare const stackGapVariant: readonly ["0", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "8xl"];
5
5
  export declare const stackDirectionVariant: readonly ["row", "column", "rowReverse", "columnReverse"];
6
6
  export declare const stackAlignVariant: readonly ["center", "start", "end", "baseline"];
@@ -27,4 +27,4 @@ export type StackBaseProps = {
27
27
  /** React-элемент для разделителя между дочерними компонентами стека */
28
28
  divider?: ReactElement;
29
29
  };
30
- export type StackProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithoutRef<StackBaseProps, As>;
30
+ export type StackProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<StackBaseProps, As>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozen-ui/kit",
3
- "version": "0.60.0",
3
+ "version": "0.61.0",
4
4
  "description": "React component library",
5
5
  "files": [
6
6
  "*"
@@ -27,9 +27,9 @@
27
27
  "react-popper": "^2.3.0",
28
28
  "react-transition-group": "^4.4.5",
29
29
  "tslib": "^2.6.3",
30
- "@ozen-ui/icons": "0.60.0",
31
- "@ozen-ui/fonts": "0.60.0",
32
- "@ozen-ui/logger": "0.60.0"
30
+ "@ozen-ui/fonts": "0.61.0",
31
+ "@ozen-ui/icons": "0.61.0",
32
+ "@ozen-ui/logger": "0.61.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=17.0.2 <19.0.0",
@@ -1,5 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { SelectInputProps } from '../SelectInput';
3
- type SelectInputConsumerProps = Pick<SelectInputProps, 'value' | 'placeholder' | 'defaultValue' | 'id' | 'name' | 'fieldProps' | 'fieldRef' | 'inputProps' | 'inputRef' | 'renderedValue'>;
4
- export declare const SelectInputConsumer: FC<SelectInputConsumerProps>;
5
- export {};
@@ -1 +0,0 @@
1
- export * from './SelectInputConsumer';
@@ -1,5 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { SelectInputProps } from '../SelectInput';
3
- type SelectInputConsumerProps = Pick<SelectInputProps, 'value' | 'placeholder' | 'defaultValue' | 'id' | 'name' | 'fieldProps' | 'fieldRef' | 'inputProps' | 'inputRef' | 'renderedValue'>;
4
- export declare const SelectInputConsumer: FC<SelectInputConsumerProps>;
5
- export {};
@@ -1 +0,0 @@
1
- export * from './SelectInputConsumer';
@@ -1 +0,0 @@
1
- export * from './SelectInputConsumer';