@ozen-ui/kit 0.16.1 → 0.17.0-canary.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 (130) hide show
  1. package/__inner__/cjs/components/DataList/DataList.css +19 -46
  2. package/__inner__/cjs/components/DataList/DataList.js +101 -40
  3. package/__inner__/cjs/components/DataList/components/DataListCheckIcon/DataListCheckIcon.css +13 -0
  4. package/__inner__/cjs/components/{Select/components/SelectCheckIcon/SelectCheckIcon.d.ts → DataList/components/DataListCheckIcon/DataListCheckIcon.d.ts} +2 -2
  5. package/__inner__/cjs/components/DataList/components/DataListCheckIcon/DataListCheckIcon.js +16 -0
  6. package/__inner__/cjs/components/DataList/components/DataListCheckIcon/index.d.ts +1 -0
  7. package/__inner__/cjs/components/DataList/components/DataListCheckIcon/index.js +4 -0
  8. package/__inner__/cjs/components/DataList/components/DataListOption/DataListOption.css +20 -0
  9. package/__inner__/{esm/components/DataList/components → cjs/components/DataList/components/DataListOption}/DataListOption.d.ts +15 -4
  10. package/__inner__/cjs/components/DataList/components/DataListOption/DataListOption.js +39 -0
  11. package/__inner__/cjs/components/DataList/components/DataListOption/index.d.ts +1 -0
  12. package/__inner__/cjs/components/{Select/components/SelectCheckIcon → DataList/components/DataListOption}/index.js +1 -1
  13. package/__inner__/cjs/components/DataList/constants.d.ts +1 -0
  14. package/__inner__/cjs/components/DataList/constants.js +3 -1
  15. package/__inner__/cjs/components/DataList/helpers/index.d.ts +4 -0
  16. package/__inner__/cjs/components/DataList/helpers/index.js +7 -0
  17. package/__inner__/cjs/components/DataList/helpers/lastSelectedValue.d.ts +1 -0
  18. package/__inner__/cjs/components/DataList/helpers/lastSelectedValue.js +8 -0
  19. package/__inner__/cjs/components/DataList/helpers/types.d.ts +10 -0
  20. package/__inner__/cjs/components/DataList/helpers/types.js +7 -0
  21. package/__inner__/cjs/components/DataList/helpers/useDataListNavigation.d.ts +23 -0
  22. package/__inner__/cjs/components/DataList/helpers/useDataListNavigation.js +85 -0
  23. package/__inner__/cjs/components/DataList/helpers/useScrollContainerToElement.d.ts +3 -0
  24. package/__inner__/cjs/components/DataList/helpers/useScrollContainerToElement.js +15 -0
  25. package/__inner__/cjs/components/DataList/types.d.ts +3 -4
  26. package/__inner__/cjs/components/DataList/types.js +0 -5
  27. package/__inner__/cjs/components/FieldControl/FieldControl.js +1 -0
  28. package/__inner__/cjs/components/Input/Input.js +1 -1
  29. package/__inner__/cjs/components/Input/types.d.ts +3 -2
  30. package/__inner__/cjs/components/Select/Select.css +33 -128
  31. package/__inner__/cjs/components/Select/Select.d.ts +2 -3
  32. package/__inner__/cjs/components/Select/Select.js +92 -80
  33. package/__inner__/cjs/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +5 -0
  34. package/__inner__/cjs/components/Select/components/SelectConsumer/SelectInputConsumer.js +21 -0
  35. package/__inner__/cjs/components/Select/components/SelectConsumer/index.d.ts +1 -0
  36. package/__inner__/cjs/components/Select/components/SelectConsumer/index.js +4 -0
  37. package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.d.ts +1 -72
  38. package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +23 -22
  39. package/__inner__/cjs/components/Select/components/SelectInput/index.d.ts +1 -0
  40. package/__inner__/cjs/components/Select/components/SelectInput/index.js +1 -0
  41. package/__inner__/cjs/components/Select/components/SelectInput/types.d.ts +89 -0
  42. package/__inner__/cjs/components/Select/components/SelectInput/types.js +2 -0
  43. package/__inner__/cjs/components/Select/components/index.d.ts +0 -1
  44. package/__inner__/cjs/components/Select/components/index.js +0 -1
  45. package/__inner__/cjs/components/Select/constants.d.ts +1 -1
  46. package/__inner__/cjs/components/Select/constants.js +2 -2
  47. package/__inner__/cjs/components/Select/helpers/index.d.ts +1 -0
  48. package/__inner__/cjs/components/Select/helpers/index.js +4 -0
  49. package/__inner__/cjs/components/Select/helpers/types.d.ts +8 -0
  50. package/__inner__/cjs/components/Select/helpers/types.js +7 -0
  51. package/__inner__/cjs/components/Select/index.d.ts +2 -1
  52. package/__inner__/cjs/components/Select/index.js +5 -4
  53. package/__inner__/cjs/components/Select/types.d.ts +31 -18
  54. package/__inner__/cjs/components/Textarea/Textarea.js +1 -1
  55. package/__inner__/cjs/components/Textarea/types.d.ts +2 -2
  56. package/__inner__/cjs/utils/scrollContainerToElement.d.ts +3 -4
  57. package/__inner__/esm/components/DataList/DataList.css +19 -46
  58. package/__inner__/esm/components/DataList/DataList.js +101 -40
  59. package/__inner__/esm/components/DataList/components/DataListCheckIcon/DataListCheckIcon.css +13 -0
  60. package/__inner__/esm/components/{Select/components/SelectCheckIcon/SelectCheckIcon.d.ts → DataList/components/DataListCheckIcon/DataListCheckIcon.d.ts} +2 -2
  61. package/__inner__/esm/components/DataList/components/DataListCheckIcon/DataListCheckIcon.js +11 -0
  62. package/__inner__/esm/components/DataList/components/DataListCheckIcon/index.d.ts +1 -0
  63. package/__inner__/esm/components/DataList/components/DataListCheckIcon/index.js +1 -0
  64. package/__inner__/esm/components/DataList/components/DataListOption/DataListOption.css +20 -0
  65. package/__inner__/{cjs/components/DataList/components → esm/components/DataList/components/DataListOption}/DataListOption.d.ts +15 -4
  66. package/__inner__/esm/components/DataList/components/DataListOption/DataListOption.js +36 -0
  67. package/__inner__/esm/components/DataList/components/DataListOption/index.d.ts +1 -0
  68. package/__inner__/esm/components/DataList/components/DataListOption/index.js +1 -0
  69. package/__inner__/esm/components/DataList/constants.d.ts +1 -0
  70. package/__inner__/esm/components/DataList/constants.js +2 -0
  71. package/__inner__/esm/components/DataList/helpers/index.d.ts +4 -0
  72. package/__inner__/esm/components/DataList/helpers/index.js +4 -0
  73. package/__inner__/esm/components/DataList/helpers/lastSelectedValue.d.ts +1 -0
  74. package/__inner__/esm/components/DataList/helpers/lastSelectedValue.js +4 -0
  75. package/__inner__/esm/components/DataList/helpers/types.d.ts +10 -0
  76. package/__inner__/esm/components/DataList/helpers/types.js +2 -0
  77. package/__inner__/esm/components/DataList/helpers/useDataListNavigation.d.ts +23 -0
  78. package/__inner__/esm/components/DataList/helpers/useDataListNavigation.js +81 -0
  79. package/__inner__/esm/components/DataList/helpers/useScrollContainerToElement.d.ts +3 -0
  80. package/__inner__/esm/components/DataList/helpers/useScrollContainerToElement.js +11 -0
  81. package/__inner__/esm/components/DataList/types.d.ts +3 -4
  82. package/__inner__/esm/components/DataList/types.js +1 -2
  83. package/__inner__/esm/components/FieldControl/FieldControl.js +1 -0
  84. package/__inner__/esm/components/Input/Input.js +1 -1
  85. package/__inner__/esm/components/Input/types.d.ts +3 -2
  86. package/__inner__/esm/components/Select/Select.css +33 -128
  87. package/__inner__/esm/components/Select/Select.d.ts +2 -3
  88. package/__inner__/esm/components/Select/Select.js +96 -84
  89. package/__inner__/esm/components/Select/components/SelectConsumer/SelectInputConsumer.d.ts +5 -0
  90. package/__inner__/esm/components/Select/components/SelectConsumer/SelectInputConsumer.js +17 -0
  91. package/__inner__/esm/components/Select/components/SelectConsumer/index.d.ts +1 -0
  92. package/__inner__/esm/components/Select/components/SelectConsumer/index.js +1 -0
  93. package/__inner__/esm/components/Select/components/SelectInput/SelectInput.d.ts +1 -72
  94. package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +25 -24
  95. package/__inner__/esm/components/Select/components/SelectInput/index.d.ts +1 -0
  96. package/__inner__/esm/components/Select/components/SelectInput/index.js +1 -0
  97. package/__inner__/esm/components/Select/components/SelectInput/types.d.ts +89 -0
  98. package/__inner__/esm/components/Select/components/SelectInput/types.js +1 -0
  99. package/__inner__/esm/components/Select/components/index.d.ts +0 -1
  100. package/__inner__/esm/components/Select/components/index.js +0 -1
  101. package/__inner__/esm/components/Select/constants.d.ts +1 -1
  102. package/__inner__/esm/components/Select/constants.js +1 -1
  103. package/__inner__/esm/components/Select/helpers/index.d.ts +1 -0
  104. package/__inner__/esm/components/Select/helpers/index.js +1 -0
  105. package/__inner__/esm/components/Select/helpers/types.d.ts +8 -0
  106. package/__inner__/esm/components/Select/helpers/types.js +2 -0
  107. package/__inner__/esm/components/Select/index.d.ts +2 -1
  108. package/__inner__/esm/components/Select/index.js +2 -1
  109. package/__inner__/esm/components/Select/types.d.ts +31 -18
  110. package/__inner__/esm/components/Textarea/Textarea.js +1 -1
  111. package/__inner__/esm/components/Textarea/types.d.ts +2 -2
  112. package/__inner__/esm/utils/scrollContainerToElement.d.ts +3 -4
  113. package/package.json +1 -1
  114. package/__inner__/cjs/components/DataList/DataListProvider.d.ts +0 -16
  115. package/__inner__/cjs/components/DataList/DataListProvider.js +0 -11
  116. package/__inner__/cjs/components/DataList/components/DataListOption.js +0 -40
  117. package/__inner__/cjs/components/DataList/useDataListNavigation.d.ts +0 -23
  118. package/__inner__/cjs/components/DataList/useDataListNavigation.js +0 -109
  119. package/__inner__/cjs/components/Select/components/SelectCheckIcon/SelectCheckIcon.css +0 -13
  120. package/__inner__/cjs/components/Select/components/SelectCheckIcon/SelectCheckIcon.js +0 -14
  121. package/__inner__/cjs/components/Select/components/SelectCheckIcon/index.d.ts +0 -1
  122. package/__inner__/esm/components/DataList/DataListProvider.d.ts +0 -16
  123. package/__inner__/esm/components/DataList/DataListProvider.js +0 -7
  124. package/__inner__/esm/components/DataList/components/DataListOption.js +0 -37
  125. package/__inner__/esm/components/DataList/useDataListNavigation.d.ts +0 -23
  126. package/__inner__/esm/components/DataList/useDataListNavigation.js +0 -105
  127. package/__inner__/esm/components/Select/components/SelectCheckIcon/SelectCheckIcon.css +0 -13
  128. package/__inner__/esm/components/Select/components/SelectCheckIcon/SelectCheckIcon.js +0 -9
  129. package/__inner__/esm/components/Select/components/SelectCheckIcon/index.d.ts +0 -1
  130. package/__inner__/esm/components/Select/components/SelectCheckIcon/index.js +0 -1
@@ -1,39 +1,40 @@
1
- import { __assign, __rest } from "tslib";
1
+ import { __assign, __read, __rest } from "tslib";
2
2
  import '../../Select.css';
3
- import React, { forwardRef, useRef } from 'react';
3
+ import React, { forwardRef, useCallback } from 'react';
4
4
  import { classnames } from '@bem-react/classnames';
5
5
  import { ChevronDownIcon } from '@ozen-ui/icons';
6
- import { useMultiRef } from '../../../../hooks/useMultiRef';
6
+ import { useBoolean } from '../../../../hooks/useBoolean';
7
+ import { FieldControl } from '../../../FieldControl';
7
8
  import { FieldHint } from '../../../FieldHint';
8
9
  import { FieldIcon } from '../../../FieldIcon';
9
10
  import { FieldLabel } from '../../../FieldLabel';
10
11
  import { Fieldset } from '../../../Fieldset';
12
+ import { SELECT_DEFAULT_MULTILINE, SELECT_DEFAULT_SIZE } from '../../constants';
11
13
  import { cnSelect } from '../../index';
14
+ import { SelectInputConsumer } from '../SelectConsumer';
12
15
  export var SelectInput = forwardRef(function (_a, ref) {
13
- var _b = _a.size, size = _b === void 0 ? 'm' : _b, _c = _a.multiline, multiline = _c === void 0 ? false : _c, label = _a.label, error = _a.error, id = _a.id, name = _a.name, renderLeft = _a.renderLeft, renderRight = _a.renderRight, inputRef = _a.inputRef, fieldRef = _a.fieldRef, fullWidth = _a.fullWidth, disabled = _a.disabled, hint = _a.hint, required = _a.required, className = _a.className, inputProps = _a.inputProps, valueProp = _a.value, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown, labelRef = _a.labelRef, labelProps = _a.labelProps, fieldProps = _a.fieldProps, onClick = _a.onClick, focused = _a.focused, placeholderProp = _a.placeholder, renderedValue = _a.renderedValue, bodyProps = _a.bodyProps, bodyRefProp = _a.bodyRef, open = _a.open, other = __rest(_a, ["size", "multiline", "label", "error", "id", "name", "renderLeft", "renderRight", "inputRef", "fieldRef", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "defaultValue", "onFocus", "onBlur", "onKeyDown", "labelRef", "labelProps", "fieldProps", "onClick", "focused", "placeholder", "renderedValue", "bodyProps", "bodyRef", "open"]);
14
- var bodyRef = useRef(null);
15
- var filled = focused || !!valueProp;
16
- var hasLabel = !!label;
17
- var placeholder = (focused || !hasLabel) && !valueProp && placeholderProp;
18
- return (React.createElement("div", __assign({}, other, { className: cnSelect({
19
- fullWidth: fullWidth,
20
- size: size,
21
- error: error,
22
- disabled: disabled,
23
- required: required,
24
- hasLabel: hasLabel,
16
+ var _b = _a.size, size = _b === void 0 ? SELECT_DEFAULT_SIZE : _b, _c = _a.multiline, multiline = _c === void 0 ? SELECT_DEFAULT_MULTILINE : _c, open = _a.open, label = _a.label, error = _a.error, id = _a.id, name = _a.name, renderLeft = _a.renderLeft, renderRight = _a.renderRight, renderedValue = _a.renderedValue, fullWidth = _a.fullWidth, disabled = _a.disabled, hint = _a.hint, required = _a.required, className = _a.className, inputProps = _a.inputProps, valueProp = _a.value, placeholderProp = _a.placeholder, defaultValue = _a.defaultValue, onFocus = _a.onFocus, onBlur = _a.onBlur, onClick = _a.onClick, onKeyDown = _a.onKeyDown, labelProps = _a.labelProps, fieldProps = _a.fieldProps, labelRef = _a.labelRef, inputRef = _a.inputRef, fieldRef = _a.fieldRef, bodyProps = _a.bodyProps, other = __rest(_a, ["size", "multiline", "open", "label", "error", "id", "name", "renderLeft", "renderRight", "renderedValue", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "placeholder", "defaultValue", "onFocus", "onBlur", "onClick", "onKeyDown", "labelProps", "fieldProps", "labelRef", "inputRef", "fieldRef", "bodyProps"]);
17
+ var _d = __read(useBoolean(), 2), focused = _d[0], _e = _d[1], on = _e.on, off = _e.off;
18
+ var filled = !!valueProp || valueProp === 0;
19
+ var handleFocus = useCallback(function (e) {
20
+ on();
21
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
22
+ }, [onFocus]);
23
+ var handleBlur = useCallback(function (e) {
24
+ off();
25
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
26
+ }, [onBlur]);
27
+ return (React.createElement(FieldControl, __assign({ error: error, size: size, filled: filled, focused: focused, disabled: disabled, fullWidth: fullWidth, required: required }, other, { className: cnSelect({
25
28
  multiline: multiline,
26
- focused: focused,
27
29
  }, [className]), ref: ref }),
28
- React.createElement("div", __assign({ tabIndex: disabled ? -1 : 0, role: "button", onClick: onClick, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, "aria-haspopup": "listbox", "aria-expanded": open }, bodyProps, { className: cnSelect('Body', [bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.className]), ref: useMultiRef([bodyRef, bodyRefProp]) }),
29
- React.createElement(FieldIcon, { className: cnSelect('RenderLeft'), icon: renderLeft, size: size }),
30
+ React.createElement("div", __assign({ role: "button", "aria-haspopup": "listbox", "aria-expanded": open }, bodyProps, { onClick: onClick, onKeyDown: onKeyDown, tabIndex: disabled ? -1 : 0, onFocus: handleFocus, onBlur: handleBlur, className: cnSelect('Body', [bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.className]) }),
31
+ React.createElement(FieldIcon, { icon: renderLeft, className: cnSelect('RenderLeft') }),
30
32
  React.createElement("div", { className: cnSelect('FieldContainer') },
31
- label && (React.createElement(FieldLabel, __assign({ filled: filled, focused: focused, required: required, disabled: disabled, size: size }, labelProps, { className: cnSelect('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef }), label)),
32
- React.createElement("div", __assign({}, fieldProps, { className: cnSelect('Field', { filled: filled, asPlaceholder: !!placeholder }, [fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.className]), ref: fieldRef }), placeholder || renderedValue),
33
- React.createElement("input", __assign({ id: id, name: name, defaultValue: defaultValue, value: valueProp, disabled: disabled, required: required, tabIndex: -1, "aria-hidden": true, readOnly: true }, inputProps, { className: cnSelect('Input', [inputProps === null || inputProps === void 0 ? void 0 : inputProps.className]), ref: inputRef }))),
34
- React.createElement(FieldIcon, { className: cnSelect('RenderRight'), icon: renderRight, size: size }),
35
- React.createElement(FieldIcon, { className: classnames(cnSelect('RenderRight'), cnSelect('DropDownIcon', { open: open })), icon: ChevronDownIcon, size: size }),
33
+ React.createElement(FieldLabel, __assign({}, labelProps, { className: cnSelect('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref) || labelRef }), label),
34
+ React.createElement(SelectInputConsumer, { id: id, name: name, value: valueProp, defaultValue: defaultValue, placeholder: placeholderProp, fieldProps: fieldProps, inputProps: inputProps, fieldRef: (fieldProps === null || fieldProps === void 0 ? void 0 : fieldProps.ref) || fieldRef, inputRef: (inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref) || inputRef, renderedValue: renderedValue })),
35
+ React.createElement(FieldIcon, { icon: renderRight, className: cnSelect('RenderRight') }),
36
+ React.createElement(FieldIcon, { icon: ChevronDownIcon, className: classnames(cnSelect('RenderRight'), cnSelect('DropDownIcon', { open: open })) }),
36
37
  React.createElement(Fieldset, { className: cnSelect('Fieldset') })),
37
- React.createElement(FieldHint, { size: size, error: error, disabled: disabled }, hint)));
38
+ React.createElement(FieldHint, null, hint)));
38
39
  });
39
40
  SelectInput.displayName = 'SelectInput';
@@ -1 +1,2 @@
1
1
  export * from './SelectInput';
2
+ export * from './types';
@@ -1 +1,2 @@
1
1
  export * from './SelectInput';
2
+ export * from './types';
@@ -0,0 +1,89 @@
1
+ import type { Ref, ReactNode, ComponentPropsWithRef } from 'react';
2
+ import type { FormElementSizeVariant } from '../../../../types/FormElementSizeVariant';
3
+ import type { FieldIconProps } from '../../../FieldIcon';
4
+ import type { FieldLabelProps } from '../../../FieldLabel';
5
+ export type SelectInputSizeVariant = FormElementSizeVariant;
6
+ type LabelProps = FieldLabelProps;
7
+ type InputProps = ComponentPropsWithRef<'input'> & {
8
+ 'data-testid'?: string;
9
+ };
10
+ type BodyProps = ComponentPropsWithRef<'div'> & {
11
+ 'data-testid'?: string;
12
+ };
13
+ type FieldProps = ComponentPropsWithRef<'div'> & {
14
+ 'data-testid'?: string;
15
+ };
16
+ type SelectInputPropsDeprecated = {
17
+ /**
18
+ * Ссылка на Field
19
+ * @deprecated Используйте fieldProps.ref
20
+ * */
21
+ fieldRef?: Ref<HTMLDivElement>;
22
+ /**
23
+ * Ссылка на элемент input
24
+ * @deprecated Используйте inputProps.ref
25
+ * */
26
+ inputRef?: Ref<HTMLInputElement>;
27
+ /**
28
+ * Ссылка на FieldLabel
29
+ * @deprecated Используйте labelProps.ref
30
+ * */
31
+ labelRef?: FieldLabelProps['ref'];
32
+ /**
33
+ * Ссылка на Body
34
+ * @deprecated Используйте bodyProps.ref
35
+ * */
36
+ bodyRef?: Ref<HTMLDivElement>;
37
+ };
38
+ export type SelectInputProps = Omit<ComponentPropsWithRef<'div'>, 'value' | 'defaultValue' | 'onChange'> & {
39
+ /** Атрибут id для элемента input */
40
+ id?: string;
41
+ /** Атрибут name для элемента input */
42
+ name?: string;
43
+ /** Лейбл */
44
+ label?: string;
45
+ /** Размер компонента */
46
+ size?: SelectInputSizeVariant;
47
+ /** Подсказка. Отображается, когда вариант не выбран */
48
+ placeholder?: string;
49
+ /** Если {true} устанавливает автофокус */
50
+ autoFocus?: boolean;
51
+ /** Если {true} переводит поле в состояние ошибки */
52
+ error?: boolean;
53
+ /** Если {true} растягивает поле на всю ширину */
54
+ fullWidth?: boolean;
55
+ /** Дополнительное описание к полю */
56
+ hint?: string | null | undefined;
57
+ /** Если {true} делает элемент неактивным */
58
+ disabled?: boolean;
59
+ /** Если {true} делает элемент обязательным к заполнению */
60
+ required?: boolean;
61
+ /** Если {true} предотвращает сокращение текста в значении и
62
+ * задает гибкую высоту контейнера компонента */
63
+ multiline?: boolean;
64
+ /** Текст или иконка слева */
65
+ renderLeft?: FieldIconProps['icon'];
66
+ /** Текст или иконка справа */
67
+ renderRight?: FieldIconProps['icon'];
68
+ /** Значение для отображения */
69
+ renderedValue?: ReactNode;
70
+ /** Выбранное значение */
71
+ value?: InputProps['value'];
72
+ /** Значение умолчанию (неконтролируемый компонент) */
73
+ defaultValue?: InputProps['defaultValue'];
74
+ /** Свойства Field */
75
+ fieldProps?: FieldProps;
76
+ /** Свойства элемента input */
77
+ inputProps?: InputProps;
78
+ /** Свойства FieldLabel */
79
+ labelProps?: LabelProps;
80
+ /** Свойства Body */
81
+ bodyProps?: BodyProps;
82
+ /** Признак раскрытого списка */
83
+ open?: boolean;
84
+ /** Идентификатор компонента для тестов */
85
+ 'data-testid'?: string;
86
+ /** Содержимое компонента */
87
+ children?: never;
88
+ } & SelectInputPropsDeprecated;
89
+ export {};
@@ -1,2 +1 @@
1
1
  export * from './SelectInput';
2
- export * from './SelectCheckIcon';
@@ -1,2 +1 @@
1
1
  export * from './SelectInput';
2
- export * from './SelectCheckIcon';
@@ -4,4 +4,4 @@ export declare const SELECT_DEFAULT_DISABLED = false;
4
4
  export declare const SELECT_DEFAULT_REQUIRED = false;
5
5
  export declare const SELECT_DEFAULT_MULTILINE = false;
6
6
  export declare const SELECT_DEFAULT_DEFAULT_OPEN = false;
7
- export declare const SELECT_DEFAULT_AUTO_SIZE = "m";
7
+ export declare const SELECT_DEFAULT_SIZE = "m";
@@ -4,4 +4,4 @@ export var SELECT_DEFAULT_DISABLED = false;
4
4
  export var SELECT_DEFAULT_REQUIRED = false;
5
5
  export var SELECT_DEFAULT_MULTILINE = false;
6
6
  export var SELECT_DEFAULT_DEFAULT_OPEN = false;
7
- export var SELECT_DEFAULT_AUTO_SIZE = 'm';
7
+ export var SELECT_DEFAULT_SIZE = 'm';
@@ -0,0 +1 @@
1
+ export * from './types';
@@ -0,0 +1 @@
1
+ export * from './types';
@@ -0,0 +1,8 @@
1
+ import type { SelectPropLabel, SelectProps, SelectPropValue } from '../types';
2
+ export type SelectedParams<MULTIPLE extends boolean = false> = {
3
+ multiple: SelectProps<MULTIPLE>['multiple'];
4
+ value?: SelectPropValue<MULTIPLE>;
5
+ label?: SelectPropLabel<MULTIPLE>;
6
+ };
7
+ export declare const isMultipleParams: (params: SelectedParams<boolean>) => params is SelectedParams<true>;
8
+ export declare const isNotMultipleParams: (params: SelectedParams<boolean>) => params is SelectedParams<false>;
@@ -0,0 +1,2 @@
1
+ export var isMultipleParams = function (params) { return !!params.multiple; };
2
+ export var isNotMultipleParams = function (params) { return !params.multiple; };
@@ -1,3 +1,4 @@
1
- export { MenuItem as Option, MenuItemText as OptionItemText, MenuItemIcon as OptionItemIcon, } from '../Menu';
1
+ export { DataListOption as Option } from '../DataList';
2
+ export { ListItemText as OptionItemText, ListItemIcon as OptionItemIcon, } from '../List';
2
3
  export * from './Select';
3
4
  export * from './types';
@@ -1,3 +1,4 @@
1
- export { MenuItem as Option, MenuItemText as OptionItemText, MenuItemIcon as OptionItemIcon, } from '../Menu';
1
+ export { DataListOption as Option } from '../DataList';
2
+ export { ListItemText as OptionItemText, ListItemIcon as OptionItemIcon, } from '../List';
2
3
  export * from './Select';
3
4
  export * from './types';
@@ -1,15 +1,17 @@
1
- import type { HTMLAttributes, SyntheticEvent, ReactNode } from 'react';
1
+ import type { SyntheticEvent, ReactNode, ReactElement, ComponentPropsWithRef } from 'react';
2
2
  import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
3
- import type { MenuProps } from '../Menu';
3
+ import type { DataListBaseProps, DataListSelected } from '../DataList';
4
4
  import type { SelectInputProps } from './components';
5
5
  export type SelectSizeVariant = FormElementSizeVariant;
6
- export type SelectPropLabel = string;
7
- export type SelectPropValue = string | number | undefined;
8
- export type SelectedOptionProp = {
9
- label?: SelectPropLabel;
10
- value?: SelectPropValue;
6
+ export type SelectLabel = string | number | undefined;
7
+ export type SelectPropLabel<MULTIPLE extends boolean> = (MULTIPLE extends true ? SelectLabel[] : SelectLabel) | undefined;
8
+ export type SelectValue = string | number | undefined;
9
+ export type SelectPropValue<MULTIPLE extends boolean> = DataListSelected<MULTIPLE>;
10
+ export type SelectedOptionProp<MULTIPLE extends boolean> = {
11
+ label?: SelectPropLabel<MULTIPLE>;
12
+ value?: SelectPropValue<MULTIPLE>;
11
13
  };
12
- export type SelectRenderValue = (option: SelectedOptionProp) => ReactNode | null;
14
+ export type SelectRenderValue<MULTIPLE extends boolean> = (option: SelectedOptionProp<MULTIPLE>) => ReactNode | null;
13
15
  type SelectOpenControlledProps = {
14
16
  /** Текущее состояние списка. Если `true`, список отображается. */
15
17
  open?: boolean;
@@ -22,37 +24,48 @@ type SelectOpenUncontrolledProps = {
22
24
  /** Состояние открытие по умолчанию (неконтролируемый компонент) */
23
25
  defaultOpen: boolean;
24
26
  };
25
- type SelectControlledProps = {
27
+ type SelectControlledProps<MULTIPLE extends boolean = false> = {
26
28
  /** Выбранное значение */
27
- value?: SelectPropValue;
29
+ value?: SelectPropValue<MULTIPLE>;
28
30
  /** Обработчик события на изменение выбранного значения */
29
- onChange?: (value: SelectPropValue, e: SyntheticEvent) => void;
31
+ onChange?: (value: SelectPropValue<MULTIPLE>, e: SyntheticEvent | KeyboardEvent) => void;
30
32
  /** Значение поля по умолчанию (неконтролируемый компонент) */
31
33
  defaultValue?: never;
32
34
  };
33
- type SelectUncontrolledProps = {
35
+ type SelectUncontrolledProps<MULTIPLE extends boolean = false> = {
34
36
  /** Значение поля по умолчанию (неконтролируемый компонент) */
35
- defaultValue: SelectPropValue;
37
+ defaultValue: SelectPropValue<MULTIPLE>;
36
38
  /** Выбранное значение */
37
39
  value?: never;
38
40
  /** Обработчик события на изменение выбранного значения */
39
41
  onChange?: never;
40
42
  };
41
- export type SelectProps = {
43
+ type SelectPropsDeprecated<MULTIPLE extends boolean = false> = {
44
+ /**
45
+ * Свойства компонента Menu
46
+ * @deprecated Используйте dataListProps
47
+ * */
48
+ menuProps?: Partial<Omit<DataListBaseProps<MULTIPLE>, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
49
+ };
50
+ export type SelectProps<MULTIPLE extends boolean = false> = {
42
51
  /** Если {true} устанавливает автофокус */
43
52
  autoFocus?: boolean;
44
53
  /** Размер компонента */
45
54
  size?: SelectSizeVariant;
46
55
  /** Рендер-функция для выбранного значения */
47
- renderValue?: SelectRenderValue;
56
+ renderValue?: SelectRenderValue<MULTIPLE>;
48
57
  /** Содержимое компонента */
49
58
  children?: ReactNode;
50
- /** Свойства компонента Menu */
51
- menuProps?: Omit<MenuProps, 'onClose' | 'open' | 'anchorRef'>;
59
+ /** Свойства компонента DataList */
60
+ dataListProps?: Partial<Omit<DataListBaseProps<MULTIPLE>, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
52
61
  /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает закрытие */
53
62
  onClose?: () => void;
54
63
  /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает открытие */
55
64
  onOpen?: () => void;
65
+ /** Если {true} из списка можно выбрать несколько вариантов */
66
+ multiple?: MULTIPLE;
67
+ /** Идентификатор компонента для тестов */
56
68
  'data-testid'?: string;
57
- } & Pick<SelectInputProps, 'id' | 'name' | 'inputProps' | 'inputRef' | 'label' | 'placeholder' | 'disabled' | 'required' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'labelProps' | 'labelRef'> & Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> & (SelectControlledProps | SelectUncontrolledProps) & (SelectOpenControlledProps | SelectOpenUncontrolledProps);
69
+ } & Pick<SelectInputProps, 'id' | 'name' | 'label' | 'placeholder' | 'disabled' | 'required' | 'error' | 'hint' | 'fullWidth' | 'renderLeft' | 'renderRight' | 'multiline' | 'inputProps' | 'labelProps' | 'bodyProps' | 'inputRef' | 'labelRef' | 'bodyRef'> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue'> & SelectPropsDeprecated<MULTIPLE> & (SelectControlledProps<MULTIPLE> | SelectUncontrolledProps<MULTIPLE>) & (SelectOpenControlledProps | SelectOpenUncontrolledProps);
70
+ export type SelectComponent = <MULTIPLE extends boolean = false>(props: SelectProps<MULTIPLE>) => ReactElement | null;
58
71
  export {};
@@ -12,7 +12,7 @@ export var Textarea = forwardRef(function (inProps, ref) {
12
12
  props: inProps,
13
13
  name: 'Textarea',
14
14
  });
15
- var _a = props.size, size = _a === void 0 ? TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, textareaRef = props.textareaRef, disabled = props.disabled, textareaProps = props.textareaProps, labelRef = props.labelRef, labelProps = props.labelProps, other = __rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "textareaRef", "disabled", "textareaProps", "labelRef", "labelProps"]);
15
+ var _a = props.size, size = _a === void 0 ? TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, disabled = props.disabled, textareaProps = props.textareaProps, labelProps = props.labelProps, labelRef = props.labelRef, textareaRef = props.textareaRef, other = __rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "disabled", "textareaProps", "labelProps", "labelRef", "textareaRef"]);
16
16
  return (React.createElement(FieldControl, __assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { className: cnTextarea({
17
17
  expand: expand,
18
18
  }, [className]), ref: ref }),
@@ -7,13 +7,13 @@ export declare const textareaExpandVariant: readonly ["autoSize", "verticalResiz
7
7
  export type TextareaExpandVariant = (typeof textareaExpandVariant)[number];
8
8
  type TextareaPropsDeprecated = {
9
9
  /**
10
- * deprecated
11
10
  * Ссылка на FieldLabel
11
+ * @deprecated Используйте labelProps.ref
12
12
  * */
13
13
  labelRef?: FieldLabelProps['ref'];
14
14
  /**
15
- * deprecated
16
15
  * Ссылка на элемент textarea
16
+ * @deprecated Используйте textareaProps.ref
17
17
  * */
18
18
  textareaRef?: Ref<HTMLTextAreaElement>;
19
19
  };
@@ -1,7 +1,6 @@
1
- type ScrollContainerToElement = {
2
- container?: HTMLElement;
3
- element?: HTMLElement;
1
+ export type ScrollContainerToElement = {
2
+ container?: HTMLElement | null;
3
+ element?: HTMLElement | null;
4
4
  behavior?: ScrollBehavior;
5
5
  };
6
6
  export declare function scrollContainerToElement({ container, element, behavior, }: ScrollContainerToElement): void;
7
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozen-ui/kit",
3
- "version": "0.16.1",
3
+ "version": "0.17.0-canary.0",
4
4
  "description": "React component library",
5
5
  "files": [
6
6
  "*"
@@ -1,16 +0,0 @@
1
- import type { SyntheticEvent, MouseEvent } from 'react';
2
- import type React from 'react';
3
- import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
4
- export type DataListContextState = {
5
- 'data-list': string;
6
- selected?: string | string[];
7
- focused?: string | null;
8
- highlighted?: string | null;
9
- size: FormElementSizeVariant;
10
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
11
- onSelect?: (event: SyntheticEvent, option: string) => void;
12
- onMouseMove?: (event: MouseEvent<HTMLElement>) => void;
13
- onMouseLeave?: (event: MouseEvent<HTMLElement>) => void;
14
- };
15
- export declare const DataListContext: React.Context<DataListContextState>;
16
- export declare const useDataListContext: () => DataListContextState;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDataListContext = exports.DataListContext = void 0;
4
- var react_1 = require("react");
5
- var constants_1 = require("./constants");
6
- exports.DataListContext = (0, react_1.createContext)({
7
- 'data-list': '',
8
- size: constants_1.DATA_LIST_DEFAULT_SIZE,
9
- });
10
- var useDataListContext = function () { return (0, react_1.useContext)(exports.DataListContext); };
11
- exports.useDataListContext = useDataListContext;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataListOption = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = tslib_1.__importStar(require("react"));
6
- var icons_1 = require("@ozen-ui/icons");
7
- var getIconSizeToFormElement_1 = require("../../../utils/getIconSizeToFormElement");
8
- var List_1 = require("../../List");
9
- var constants_1 = require("../constants");
10
- var DataList_1 = require("../DataList");
11
- var DataListProvider_1 = require("../DataListProvider");
12
- exports.DataListOption = (0, react_1.forwardRef)(function (_a, ref) {
13
- var value = _a.value, onMouseMoveProp = _a.onMouseMove, onMouseLeaveProp = _a.onMouseLeave, onClickProp = _a.onClick, _b = _a.disabled, disabled = _b === void 0 ? constants_1.DATA_LIST_OPTION_DEFAULT_DISABLED : _b, label = _a.children, className = _a.className, other = tslib_1.__rest(_a, ["value", "onMouseMove", "onMouseLeave", "onClick", "disabled", "children", "className"]);
14
- var _c = (0, DataListProvider_1.useDataListContext)(), size = _c.size, _d = _c.selected, selected = _d === void 0 ? [] : _d, focused = _c.focused, highlighted = _c.highlighted, onClick = _c.onClick, onMouseMove = _c.onMouseMove, onMouseLeave = _c.onMouseLeave, dataListName = _c["data-list"];
15
- var iconSize = (0, getIconSizeToFormElement_1.getIconSizeToFormElement)(size);
16
- var isSelected = Array.isArray(selected)
17
- ? selected.includes(value)
18
- : selected === value;
19
- var handleClick = function (event) {
20
- onClickProp === null || onClickProp === void 0 ? void 0 : onClickProp(event);
21
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
22
- };
23
- var handleMouseMove = function (event) {
24
- onMouseMoveProp === null || onMouseMoveProp === void 0 ? void 0 : onMouseMoveProp(event);
25
- onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(event);
26
- };
27
- var handleMouseLeave = function (event) {
28
- onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(event);
29
- onMouseLeaveProp === null || onMouseLeaveProp === void 0 ? void 0 : onMouseLeaveProp(event);
30
- };
31
- return (react_1.default.createElement(List_1.ListItem, tslib_1.__assign({ role: "option", "data-list": dataListName, "data-list-value": value, "data-list-disabled": disabled, "aria-selected": isSelected, "aria-disabled": disabled, onClick: handleClick, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave, className: (0, DataList_1.cnDataList)('Option', {
32
- disabled: disabled,
33
- highlighted: !disabled && highlighted === value,
34
- focused: !disabled && focused === value,
35
- }, [className]) }, other, { ref: ref }), typeof label === 'string' ? (react_1.default.createElement(react_1.default.Fragment, null,
36
- react_1.default.createElement(List_1.ListItemText, { className: (0, DataList_1.cnDataList)('Text'), primary: label }),
37
- react_1.default.createElement("div", { className: (0, DataList_1.cnDataList)('IconWrapper', { size: iconSize }) }, isSelected && (react_1.default.createElement(List_1.ListItemIcon, null,
38
- react_1.default.createElement(icons_1.TickIcon, { size: iconSize })))))) : (label)));
39
- });
40
- exports.DataListOption.displayName = 'DataListOption';
@@ -1,23 +0,0 @@
1
- import type React from 'react';
2
- import type { MouseEvent, RefObject } from 'react';
3
- type UserListItemValue = string | null;
4
- export type UseListNavigationProps = {
5
- name?: string;
6
- ref?: RefObject<HTMLElement>;
7
- selected?: UserListItemValue;
8
- active?: boolean;
9
- onSelect?: (e: React.SyntheticEvent | KeyboardEvent, selectedItem: string) => void;
10
- };
11
- export type UseListNavigationValue = {
12
- 'data-list': string;
13
- focused?: UserListItemValue;
14
- highlighted?: UserListItemValue;
15
- ref?: RefObject<HTMLElement>;
16
- onKeyDown: (event: KeyboardEvent) => void;
17
- onMouseMove: (event: MouseEvent<HTMLElement>) => void;
18
- onMouseLeave: (event: MouseEvent<HTMLElement>) => void;
19
- onClick: (event: React.MouseEvent<HTMLElement>) => void;
20
- };
21
- /** Навигация по элементам списка без перехвата фокуса с элемента контроля */
22
- export declare function useDataListNavigation({ name: nameProp, selected, active, onSelect, }?: UseListNavigationProps): UseListNavigationValue;
23
- export {};
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDataListNavigation = void 0;
4
- var tslib_1 = require("tslib");
5
- var react_1 = require("react");
6
- var useUniqueId_1 = require("../../hooks/useUniqueId");
7
- var getNextIndex_1 = require("../../utils/getNextIndex");
8
- var getPrevIndex_1 = require("../../utils/getPrevIndex");
9
- var isKey_1 = require("../../utils/isKey");
10
- var scrollContainerToElement_1 = require("../../utils/scrollContainerToElement");
11
- var getData = function (el, attr) {
12
- if (!el) {
13
- return null;
14
- }
15
- if ('currentTarget' in el)
16
- return el.currentTarget.getAttribute("data-list-".concat(attr));
17
- return el.getAttribute("data-list-".concat(attr));
18
- };
19
- /** Навигация по элементам списка без перехвата фокуса с элемента контроля */
20
- function useDataListNavigation(_a) {
21
- var _b = _a === void 0 ? {} : _a, nameProp = _b.name, selected = _b.selected, _c = _b.active, active = _c === void 0 ? false : _c, onSelect = _b.onSelect;
22
- var name = (0, useUniqueId_1.useUniqueId)(nameProp);
23
- var ref = (0, react_1.useRef)(null);
24
- var _d = tslib_1.__read((0, react_1.useState)(null), 2), current = _d[0], setCurrent = _d[1];
25
- var _e = tslib_1.__read((0, react_1.useState)(), 2), focused = _e[0], serFocused = _e[1];
26
- var _f = tslib_1.__read((0, react_1.useState)(), 2), highlighted = _f[0], setHighlighted = _f[1];
27
- var getItems = (0, react_1.useCallback)(function () {
28
- var _a;
29
- return Array.from(((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll("[data-list=\"".concat(name, "\"]"))) ||
30
- []).filter(function (item) { return getData(item, 'disabled') !== 'true'; });
31
- }, [name]);
32
- var getCurrentItem = (0, react_1.useCallback)(function (value) {
33
- return getItems().find(function (item) { return getData(item, 'value') === value; });
34
- }, []);
35
- var getItemsValues = (0, react_1.useCallback)(function () { return getItems().map(function (item) { return getData(item, 'value'); }); }, []);
36
- var currentValue = current || selected;
37
- (0, react_1.useEffect)(function () {
38
- if (!active) {
39
- return undefined;
40
- }
41
- var selectedItem = getCurrentItem(currentValue || '');
42
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
43
- (0, scrollContainerToElement_1.scrollContainerToElement)({
44
- container: ref.current,
45
- element: selectedItem,
46
- });
47
- setCurrent(getData(selectedItem, 'value') || '');
48
- }
49
- return function () {
50
- setCurrent(null);
51
- serFocused(null);
52
- setHighlighted(null);
53
- };
54
- }, [active]);
55
- var onClick = function (event) {
56
- if (getData(event, 'disabled') === 'true') {
57
- return;
58
- }
59
- var value = getData(event, 'value');
60
- serFocused(null);
61
- setCurrent(value);
62
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, value || '');
63
- };
64
- var onKeyDown = function (event) {
65
- if ((0, isKey_1.isKey)(event, 'Enter')) {
66
- event.preventDefault();
67
- var test_1 = currentValue || getItemsValues()[0] || '';
68
- serFocused(test_1);
69
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, test_1);
70
- }
71
- if (!(0, isKey_1.isKey)(event, 'ArrowUp') && !(0, isKey_1.isKey)(event, 'ArrowDown')) {
72
- return;
73
- }
74
- event.preventDefault();
75
- var values = getItemsValues();
76
- var currentIndex = currentValue ? values.indexOf(currentValue) : null;
77
- var isArrowUp = (0, isKey_1.isKey)(event, 'ArrowUp');
78
- var newIndex = isArrowUp
79
- ? (0, getPrevIndex_1.getPrevIndex)(currentIndex !== null && currentIndex !== void 0 ? currentIndex : 0, values.length)
80
- : (0, getNextIndex_1.getNextIndex)(currentIndex !== null && currentIndex !== void 0 ? currentIndex : -1, values.length);
81
- var newValue = values[newIndex] || '';
82
- setCurrent(newValue);
83
- serFocused(newValue);
84
- if (ref === null || ref === void 0 ? void 0 : ref.current) {
85
- (0, scrollContainerToElement_1.scrollContainerToElement)({
86
- container: ref.current,
87
- element: getCurrentItem(newValue || ''),
88
- });
89
- }
90
- };
91
- var onMouseMove = function (event) {
92
- if (getData(event, 'disabled') !== 'true')
93
- setHighlighted(getData(event, 'value'));
94
- };
95
- var onMouseLeave = function () {
96
- setHighlighted(null);
97
- };
98
- return {
99
- 'data-list': name,
100
- ref: ref,
101
- focused: focused,
102
- highlighted: highlighted,
103
- onClick: onClick,
104
- onKeyDown: onKeyDown,
105
- onMouseMove: onMouseMove,
106
- onMouseLeave: onMouseLeave,
107
- };
108
- }
109
- exports.useDataListNavigation = useDataListNavigation;
@@ -1,13 +0,0 @@
1
- .SelectCheckIcon {
2
- inline-size: var(--select-check-icon-size);
3
- block-size: var(--select-check-icon-size);
4
- display: flex;
5
- }
6
-
7
- .SelectCheckIcon_size_s {
8
- --select-check-icon-size: 16px;
9
- }
10
-
11
- .SelectCheckIcon_size_m {
12
- --select-check-icon-size: 24px;
13
- }
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SelectCheckIcon = void 0;
4
- var tslib_1 = require("tslib");
5
- require("./SelectCheckIcon.css");
6
- var react_1 = tslib_1.__importDefault(require("react"));
7
- var icons_1 = require("@ozen-ui/icons");
8
- var classname_1 = require("../../../../utils/classname");
9
- var cnSelectCheckIcon = (0, classname_1.cn)('SelectCheckIcon');
10
- var SelectCheckIcon = function (_a) {
11
- var size = _a.size, selected = _a.selected;
12
- return (react_1.default.createElement("div", { className: cnSelectCheckIcon({ size: size }) }, selected && react_1.default.createElement(icons_1.TickIcon, { size: size })));
13
- };
14
- exports.SelectCheckIcon = SelectCheckIcon;
@@ -1 +0,0 @@
1
- export * from './SelectCheckIcon';