@ozen-ui/kit 0.47.1 → 0.48.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 (114) hide show
  1. package/DatePicker/package.json +5 -0
  2. package/__inner__/cjs/components/Autocomplete/Autocomplete.js +57 -63
  3. package/__inner__/cjs/components/Autocomplete/helper.d.ts +6 -0
  4. package/__inner__/cjs/components/Autocomplete/types.d.ts +1 -1
  5. package/__inner__/cjs/components/Calendar/types.d.ts +1 -1
  6. package/__inner__/cjs/components/DatePicker/DatePicker.css +11 -0
  7. package/__inner__/cjs/components/DatePicker/DatePicker.d.ts +39 -0
  8. package/__inner__/cjs/components/DatePicker/DatePicker.js +160 -0
  9. package/__inner__/cjs/components/DatePicker/components/DateInput/DateInput.d.ts +6 -0
  10. package/__inner__/cjs/components/DatePicker/components/DateInput/DateInput.js +14 -0
  11. package/__inner__/cjs/components/DatePicker/components/DateInput/index.d.ts +1 -0
  12. package/__inner__/cjs/components/DatePicker/components/DateInput/index.js +4 -0
  13. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -0
  14. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +20 -0
  15. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/index.d.ts +1 -0
  16. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/dateInputMask/index.js +4 -0
  17. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/index.d.ts +1 -0
  18. package/__inner__/cjs/components/DatePicker/components/DateInput/utils/index.js +4 -0
  19. package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.d.ts +8 -0
  20. package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.js +26 -0
  21. package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/index.d.ts +1 -0
  22. package/__inner__/cjs/components/DatePicker/components/DatePickerRenderRight/index.js +4 -0
  23. package/__inner__/cjs/components/DatePicker/components/index.d.ts +2 -0
  24. package/__inner__/cjs/components/DatePicker/components/index.js +5 -0
  25. package/__inner__/cjs/components/DatePicker/constants.d.ts +1 -0
  26. package/__inner__/cjs/components/DatePicker/constants.js +4 -0
  27. package/__inner__/cjs/components/DatePicker/index.d.ts +2 -0
  28. package/__inner__/cjs/components/DatePicker/index.js +5 -0
  29. package/__inner__/cjs/components/DatePicker/types.d.ts +52 -0
  30. package/__inner__/cjs/components/DatePicker/types.js +2 -0
  31. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +1 -0
  32. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/formatDateToString.js +13 -0
  33. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/index.d.ts +1 -0
  34. package/__inner__/cjs/components/DatePicker/utils/formatDateToString/index.js +4 -0
  35. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +1 -0
  36. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +13 -0
  37. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/index.d.ts +1 -0
  38. package/__inner__/cjs/components/DatePicker/utils/formatStringToDate/index.js +4 -0
  39. package/__inner__/cjs/components/DatePicker/utils/index.d.ts +5 -0
  40. package/__inner__/cjs/components/DatePicker/utils/index.js +8 -0
  41. package/__inner__/cjs/components/DatePicker/utils/isInExclude/index.d.ts +1 -0
  42. package/__inner__/cjs/components/DatePicker/utils/isInExclude/index.js +4 -0
  43. package/__inner__/cjs/components/DatePicker/utils/isInExclude/isInExclude.d.ts +2 -0
  44. package/__inner__/cjs/components/DatePicker/utils/isInExclude/isInExclude.js +14 -0
  45. package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/index.d.ts +1 -0
  46. package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/index.js +4 -0
  47. package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/isOutOfRange.d.ts +2 -0
  48. package/__inner__/cjs/components/DatePicker/utils/isOutOfRange/isOutOfRange.js +11 -0
  49. package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/index.d.ts +1 -0
  50. package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/index.js +4 -0
  51. package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.d.ts +5 -0
  52. package/__inner__/cjs/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.js +10 -0
  53. package/__inner__/cjs/components/Input/Input.css +2 -2
  54. package/__inner__/cjs/components/Input/Input.js +1 -1
  55. package/__inner__/cjs/components/Input/types.d.ts +2 -1
  56. package/__inner__/cjs/components/ThemeProvider/types.d.ts +2 -0
  57. package/__inner__/cjs/locale/locale.js +12 -0
  58. package/__inner__/esm/components/Autocomplete/Autocomplete.js +57 -63
  59. package/__inner__/esm/components/Autocomplete/helper.d.ts +6 -0
  60. package/__inner__/esm/components/Autocomplete/types.d.ts +1 -1
  61. package/__inner__/esm/components/Calendar/types.d.ts +1 -1
  62. package/__inner__/esm/components/DatePicker/DatePicker.css +11 -0
  63. package/__inner__/esm/components/DatePicker/DatePicker.d.ts +39 -0
  64. package/__inner__/esm/components/DatePicker/DatePicker.js +157 -0
  65. package/__inner__/esm/components/DatePicker/components/DateInput/DateInput.d.ts +6 -0
  66. package/__inner__/esm/components/DatePicker/components/DateInput/DateInput.js +11 -0
  67. package/__inner__/esm/components/DatePicker/components/DateInput/index.d.ts +1 -0
  68. package/__inner__/esm/components/DatePicker/components/DateInput/index.js +1 -0
  69. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.d.ts +2 -0
  70. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/dateInputMask.js +15 -0
  71. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/index.d.ts +1 -0
  72. package/__inner__/esm/components/DatePicker/components/DateInput/utils/dateInputMask/index.js +1 -0
  73. package/__inner__/esm/components/DatePicker/components/DateInput/utils/index.d.ts +1 -0
  74. package/__inner__/esm/components/DatePicker/components/DateInput/utils/index.js +1 -0
  75. package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.d.ts +8 -0
  76. package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/DatePickerRenderRight.js +22 -0
  77. package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/index.d.ts +1 -0
  78. package/__inner__/esm/components/DatePicker/components/DatePickerRenderRight/index.js +1 -0
  79. package/__inner__/esm/components/DatePicker/components/index.d.ts +2 -0
  80. package/__inner__/esm/components/DatePicker/components/index.js +2 -0
  81. package/__inner__/esm/components/DatePicker/constants.d.ts +1 -0
  82. package/__inner__/esm/components/DatePicker/constants.js +1 -0
  83. package/__inner__/esm/components/DatePicker/index.d.ts +2 -0
  84. package/__inner__/esm/components/DatePicker/index.js +2 -0
  85. package/__inner__/esm/components/DatePicker/types.d.ts +52 -0
  86. package/__inner__/esm/components/DatePicker/types.js +1 -0
  87. package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.d.ts +1 -0
  88. package/__inner__/esm/components/DatePicker/utils/formatDateToString/formatDateToString.js +9 -0
  89. package/__inner__/esm/components/DatePicker/utils/formatDateToString/index.d.ts +1 -0
  90. package/__inner__/esm/components/DatePicker/utils/formatDateToString/index.js +1 -0
  91. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.d.ts +1 -0
  92. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/formatStringToDate.js +9 -0
  93. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/index.d.ts +1 -0
  94. package/__inner__/esm/components/DatePicker/utils/formatStringToDate/index.js +1 -0
  95. package/__inner__/esm/components/DatePicker/utils/index.d.ts +5 -0
  96. package/__inner__/esm/components/DatePicker/utils/index.js +5 -0
  97. package/__inner__/esm/components/DatePicker/utils/isInExclude/index.d.ts +1 -0
  98. package/__inner__/esm/components/DatePicker/utils/isInExclude/index.js +1 -0
  99. package/__inner__/esm/components/DatePicker/utils/isInExclude/isInExclude.d.ts +2 -0
  100. package/__inner__/esm/components/DatePicker/utils/isInExclude/isInExclude.js +10 -0
  101. package/__inner__/esm/components/DatePicker/utils/isOutOfRange/index.d.ts +1 -0
  102. package/__inner__/esm/components/DatePicker/utils/isOutOfRange/index.js +1 -0
  103. package/__inner__/esm/components/DatePicker/utils/isOutOfRange/isOutOfRange.d.ts +2 -0
  104. package/__inner__/esm/components/DatePicker/utils/isOutOfRange/isOutOfRange.js +7 -0
  105. package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/index.d.ts +1 -0
  106. package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/index.js +1 -0
  107. package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.d.ts +5 -0
  108. package/__inner__/esm/components/DatePicker/utils/matchCalendarSizeToFormElement/matchCalendarSizeToFormElement.js +7 -0
  109. package/__inner__/esm/components/Input/Input.css +2 -2
  110. package/__inner__/esm/components/Input/Input.js +1 -1
  111. package/__inner__/esm/components/Input/types.d.ts +2 -1
  112. package/__inner__/esm/components/ThemeProvider/types.d.ts +2 -0
  113. package/__inner__/esm/locale/locale.js +12 -0
  114. package/package.json +4 -4
@@ -0,0 +1,2 @@
1
+ export * from './DatePicker';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./DatePicker"), exports);
5
+ tslib_1.__exportStar(require("./types"), exports);
@@ -0,0 +1,52 @@
1
+ import type { ComponentPropsWithRef, ChangeEvent } from 'react';
2
+ import type { CalendarBaseProps, CalendarOnChange } from '../Calendar';
3
+ import type { InputProps } from '../Input';
4
+ import type { PopoverBaseProps } from '../Popover';
5
+ export type DatePickerOnChange = CalendarOnChange;
6
+ export type DatePickerOnInputChange = (e: ChangeEvent<HTMLInputElement> | null, value: string) => void;
7
+ export type DatePickerPropOnError = (props: {
8
+ type: 'outOfRange';
9
+ inputValue?: string;
10
+ value?: Date | null;
11
+ } | {
12
+ type: 'inExclude';
13
+ inputValue?: string;
14
+ value?: Date | null;
15
+ }) => void;
16
+ type DatePickerOpenControlledProps = {
17
+ /** Текущее состояние списка. Если `true`, список отображается. */
18
+ open?: boolean;
19
+ /** Состояние открытие по умолчанию (неконтролируемый компонент) */
20
+ defaultOpen?: never;
21
+ };
22
+ type DatePickerOpenUncontrolledProps = {
23
+ /** Текущее состояние списка. Если `true`, список отображается. */
24
+ open?: never;
25
+ /** Состояние открытие по умолчанию (неконтролируемый компонент) */
26
+ defaultOpen?: boolean;
27
+ };
28
+ export type DatePickerProps = {
29
+ /** Выбранная дата */
30
+ value?: Date | null;
31
+ /** Выбранная дата по умолчанию (неконтролируемое состояние) */
32
+ defaultValue?: Date | null;
33
+ /** Функция обратного вызова, которая будет вызвана при выборе значения */
34
+ onChange?: DatePickerOnChange;
35
+ /** Введённое значение в текстовом поле */
36
+ onInputChange?: DatePickerOnInputChange;
37
+ /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает закрытие */
38
+ onClose?: () => void;
39
+ /** Функция обратного вызова, которая будет вызвана когда компонент запрашивает открытие */
40
+ onOpen?: () => void;
41
+ /** Свойства компонента Calendar */
42
+ calendarProps?: CalendarBaseProps;
43
+ /** Свойства компонента Popover */
44
+ popoverProps?: PopoverBaseProps;
45
+ /** Текст для кнопки очистки поля */
46
+ clearText?: string;
47
+ /** Если {true}, то не отображает кнопку закрытия */
48
+ disableClearButton?: boolean;
49
+ /** Функция обратно вызова, которая сработает если пользователь ввёл дату с ошибкой */
50
+ onError?: DatePickerPropOnError;
51
+ } & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'defaultValue' | 'onError'> & Pick<CalendarBaseProps, 'minDate' | 'maxDate' | 'exclude' | 'offsetDate'> & Pick<InputProps, 'label' | 'hint' | 'onKeyDown' | 'size' | 'error' | 'required' | 'fullWidth' | 'disabled' | 'renderLeft' | 'renderRight' | 'placeholder' | 'inputProps'> & (DatePickerOpenControlledProps | DatePickerOpenUncontrolledProps);
52
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export declare const formatDateToString: (date: Date | undefined | null) => string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatDateToString = void 0;
4
+ var formatDateToString = function (date) {
5
+ if (!date) {
6
+ return '';
7
+ }
8
+ var year = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date);
9
+ var month = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date);
10
+ var day = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date);
11
+ return "".concat(day, ".").concat(month, ".").concat(year);
12
+ };
13
+ exports.formatDateToString = formatDateToString;
@@ -0,0 +1 @@
1
+ export * from './formatDateToString';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./formatDateToString"), exports);
@@ -0,0 +1 @@
1
+ export declare const formatStringToDate: (value: string) => Date | null;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatStringToDate = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var utils_1 = require("../../components/DateInput/utils");
6
+ var formatStringToDate = function (value) {
7
+ var _a = tslib_1.__read(value.split('.'), 3), date = _a[0], month = _a[1], year = _a[2];
8
+ if (!(date && month && year) || !(0, utils_1.isCompleted)(value)) {
9
+ return null;
10
+ }
11
+ return new Date(+year, +month - 1, +date);
12
+ };
13
+ exports.formatStringToDate = formatStringToDate;
@@ -0,0 +1 @@
1
+ export * from './formatStringToDate';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./formatStringToDate"), exports);
@@ -0,0 +1,5 @@
1
+ export * from './matchCalendarSizeToFormElement';
2
+ export * from './formatDateToString';
3
+ export * from './formatStringToDate';
4
+ export * from './isOutOfRange';
5
+ export * from './isInExclude';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./matchCalendarSizeToFormElement"), exports);
5
+ tslib_1.__exportStar(require("./formatDateToString"), exports);
6
+ tslib_1.__exportStar(require("./formatStringToDate"), exports);
7
+ tslib_1.__exportStar(require("./isOutOfRange"), exports);
8
+ tslib_1.__exportStar(require("./isInExclude"), exports);
@@ -0,0 +1 @@
1
+ export * from './isInExclude';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./isInExclude"), exports);
@@ -0,0 +1,2 @@
1
+ import type { DatePickerProps } from '../../index';
2
+ export declare const isInExclude: ({ exclude, value, }: Pick<DatePickerProps, 'exclude' | 'value'>) => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInExclude = void 0;
4
+ var isInExclude = function (_a) {
5
+ var _b, _c;
6
+ var exclude = _a.exclude, value = _a.value;
7
+ if (!exclude || !value) {
8
+ return false;
9
+ }
10
+ return (!!(exclude.date &&
11
+ !((_b = exclude.date) === null || _b === void 0 ? void 0 : _b.every(function (date) { return date.getTime() !== value.getTime(); }))) ||
12
+ !!(exclude.day && !((_c = exclude.day) === null || _c === void 0 ? void 0 : _c.every(function (date) { return date !== value.getDay(); }))));
13
+ };
14
+ exports.isInExclude = isInExclude;
@@ -0,0 +1 @@
1
+ export * from './isOutOfRange';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./isOutOfRange"), exports);
@@ -0,0 +1,2 @@
1
+ import type { DatePickerProps } from '../../index';
2
+ export declare const isOutOfRange: ({ minDate, maxDate, value, }: Pick<DatePickerProps, 'minDate' | 'maxDate' | 'value'>) => boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isOutOfRange = void 0;
4
+ var isOutOfRange = function (_a) {
5
+ var minDate = _a.minDate, maxDate = _a.maxDate, value = _a.value;
6
+ if (!minDate || !maxDate || !value) {
7
+ return false;
8
+ }
9
+ return (minDate.getTime() > (value === null || value === void 0 ? void 0 : value.getTime()) || maxDate.getTime() < (value === null || value === void 0 ? void 0 : value.getTime()));
10
+ };
11
+ exports.isOutOfRange = isOutOfRange;
@@ -0,0 +1 @@
1
+ export * from './matchCalendarSizeToFormElement';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./matchCalendarSizeToFormElement"), exports);
@@ -0,0 +1,5 @@
1
+ import type { FormElementSizeVariant } from '../../../../types/FormElementSizeVariant';
2
+ import type { CalendarSizeVariant } from '../../../Calendar';
3
+ export declare const matchCalendarSizeToFormElement: {
4
+ [key in FormElementSizeVariant]: CalendarSizeVariant;
5
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchCalendarSizeToFormElement = void 0;
4
+ exports.matchCalendarSizeToFormElement = {
5
+ '2xs': 's',
6
+ xs: 's',
7
+ s: 's',
8
+ m: 'm',
9
+ l: 'l',
10
+ };
@@ -7,7 +7,7 @@
7
7
  box-sizing: border-box;
8
8
  padding: 0 var(--textfield-gutter-x);
9
9
  background-color: var(--textfield-background-color);
10
- transition: background-color var(--transition-slow);
10
+ transition: background-color box-shadow var(--transition-slow);
11
11
  color: var(--textfield-color);
12
12
  border-radius: var(--textfield-border-radius);
13
13
  }
@@ -36,7 +36,7 @@
36
36
  .Input-Field:-webkit-autofill:focus {
37
37
  box-shadow: 0 0 0 1000px var(--textfield-background-color) inset !important;
38
38
  background-color: transparent !important;
39
- -webkit-text-fill-color: var(--color-content-info-dark);
39
+ -webkit-text-fill-color: var(--textfield-color);
40
40
  }
41
41
  .Input-Field::-webkit-outer-spin-button,
42
42
  .Input-Field::-webkit-inner-spin-button {
@@ -41,7 +41,7 @@ exports.Input = (0, react_1.forwardRef)(function (inProps, ref) {
41
41
  },
42
42
  });
43
43
  return (react_1.default.createElement(FieldControl_1.FieldControl, tslib_1.__assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { ref: ref, className: (0, exports.cnInput)({}, [className]) }),
44
- react_1.default.createElement("label", tslib_1.__assign({}, bodyProps, { className: (0, exports.cnInput)('Body'), ref: (0, useMultiRef_1.useMultiRef)([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
44
+ react_1.default.createElement("label", tslib_1.__assign({}, bodyProps, { className: (0, exports.cnInput)('Body', [bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.className]), ref: (0, useMultiRef_1.useMultiRef)([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
45
45
  react_1.default.createElement(FieldIcon_1.FieldIcon, { icon: renderLeft }),
46
46
  react_1.default.createElement("div", { className: (0, exports.cnInput)('FieldContainer') },
47
47
  react_1.default.createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({}, labelProps, { ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref), className: labelProps === null || labelProps === void 0 ? void 0 : labelProps.className }), label),
@@ -20,6 +20,7 @@ type InputPropsDeprecated = {
20
20
  inputRef?: Ref<HTMLInputElement>;
21
21
  };
22
22
  type InputElement = ComponentPropsWithRef<'input'>;
23
+ export type InputOnChange = InputElement['onChange'];
23
24
  export type InputProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFAULT_TAG>, 'size' | 'onChange'> & {
24
25
  /** Атрибут id для элемента input */
25
26
  id?: string;
@@ -58,7 +59,7 @@ export type InputProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFAULT
58
59
  /** Значение по умолчанию (неконтролируемый компонент) */
59
60
  defaultValue?: InputElement['defaultValue'];
60
61
  /** Обработчик события на изменение значения поля */
61
- onChange?: InputElement['onChange'];
62
+ onChange?: InputOnChange;
62
63
  /** Свойства элемента input */
63
64
  inputProps?: InputElement & {
64
65
  'data-testid'?: string;
@@ -15,6 +15,7 @@ import type { ChipProps as ChiPropsNext } from '../ChipNext';
15
15
  import type { CollapseProps } from '../Collapse';
16
16
  import type { ContainerProps } from '../Container';
17
17
  import type { DataListProps } from '../DataList';
18
+ import type { DatePickerProps } from '../DatePicker';
18
19
  import type { DialogProps } from '../Dialog';
19
20
  import type { DividerProps } from '../Divider';
20
21
  import type { DrawerProps } from '../Drawer';
@@ -86,6 +87,7 @@ export type Theme = {
86
87
  Container?: Partial<ContainerProps>;
87
88
  DataList?: Partial<DataListProps>;
88
89
  Dialog?: Partial<DialogProps>;
90
+ DatePicker?: Partial<DatePickerProps>;
89
91
  Divider?: Partial<DividerProps>;
90
92
  Drawer?: Partial<DrawerProps>;
91
93
  FieldControl?: Partial<FieldControlProps>;
@@ -68,6 +68,10 @@ exports.ruRU = {
68
68
  },
69
69
  },
70
70
  },
71
+ DatePicker: {
72
+ clearText: 'Очистить',
73
+ placeholder: 'ДД.ММ.ГГГГ',
74
+ },
71
75
  },
72
76
  };
73
77
  exports.kkKZ = {
@@ -136,6 +140,10 @@ exports.kkKZ = {
136
140
  },
137
141
  },
138
142
  },
143
+ DatePicker: {
144
+ clearText: 'Тазалау',
145
+ placeholder: 'КК.АА.ЖЖЖЖ',
146
+ },
139
147
  },
140
148
  };
141
149
  exports.enUS = {
@@ -205,5 +213,9 @@ exports.enUS = {
205
213
  },
206
214
  },
207
215
  },
216
+ DatePicker: {
217
+ clearText: 'Clear',
218
+ placeholder: 'DD.MM.YYYY',
219
+ },
208
220
  },
209
221
  };
@@ -2,6 +2,7 @@ import { __assign, __read, __rest, __spreadArray } from "tslib";
2
2
  import './Autocomplete.css';
3
3
  import React, { forwardRef, useEffect, useRef, useState } from 'react';
4
4
  import { useControlled } from '../../hooks/useControlled';
5
+ import { useMultiRef } from '../../hooks/useMultiRef';
5
6
  import { useMutableRef } from '../../hooks/useMutableRef';
6
7
  import { useThemeProps } from '../../hooks/useThemeProps';
7
8
  import { cn } from '../../utils/classname';
@@ -17,8 +18,10 @@ function AutocompleteRender(inProps, ref) {
17
18
  props: inProps,
18
19
  name: 'Autocomplete',
19
20
  });
20
- var _a = withDefaultGetters(props), _b = _a.disabled, disabled = _b === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLED : _b, _c = _a.required, required = _c === void 0 ? AUTOCOMPLETE_DEFAULT_REQUIRED : _c, _d = _a.autoFocus, autoFocus = _d === void 0 ? AUTOCOMPLETE_DEFAULT_AUTOFOCUS : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? AUTOCOMPLETE_DEFAULT_FULLWIDTH : _e, _f = _a.size, size = _f === void 0 ? AUTOCOMPLETE_DEFAULT_SIZE : _f, _g = _a.allowCustomValue, allowCustomValue = _g === void 0 ? AUTOCOMPLETE_DEFAULT_ALLOW_CUSTOM_VALUE : _g, _h = _a.disableShowChevron, disableShowChevron = _h === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_CHEVRON : _h, _j = _a.disableClearButton, disableClearButton = _j === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLEAR_BUTTON : _j, _k = _a.disableShowEmptyOptionsList, disableShowEmptyOptionsList = _k === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_EMPTY_OPTIONS_LIST : _k, _l = _a.disableCloseOnSelect, disableCloseOnSelect = _l === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLOSE_ON_SELECT : _l, _m = _a.renderInput, renderInput = _m === void 0 ? function (props) { return React.createElement(Input, __assign({}, props, { ref: ref })); } : _m, searchFunctionProp = _a.searchFunction, renderOptionProp = _a.renderOption, inputValueProp = _a.inputValue, className = _a.className, valueProp = _a.value, options = _a.options, defaultValue = _a.defaultValue, error = _a.error, onChange = _a.onChange, onInputChange = _a.onInputChange, label = _a.label, placeholder = _a.placeholder, renderLeft = _a.renderLeft, renderRight = _a.renderRight, hint = _a.hint, getOptionKey = _a.getOptionKey, getOptionLabel = _a.getOptionLabel, getOptionDisabled = _a.getOptionDisabled, dataListProps = _a.dataListProps, onCloseProp = _a.onClose, onOpenProp = _a.onOpen, openProp = _a.open, defaultOpen = _a.defaultOpen, loading = _a.loading, inputProps = _a.inputProps, onKeyDown = _a.onKeyDown, noOptionsText = _a.noOptionsText, clearText = _a.clearText, openText = _a.openText, loadingText = _a.loadingText, closeText = _a.closeText, other = __rest(_a, ["disabled", "required", "autoFocus", "fullWidth", "size", "allowCustomValue", "disableShowChevron", "disableClearButton", "disableShowEmptyOptionsList", "disableCloseOnSelect", "renderInput", "searchFunction", "renderOption", "inputValue", "className", "value", "options", "defaultValue", "error", "onChange", "onInputChange", "label", "placeholder", "renderLeft", "renderRight", "hint", "getOptionKey", "getOptionLabel", "getOptionDisabled", "dataListProps", "onClose", "onOpen", "open", "defaultOpen", "loading", "inputProps", "onKeyDown", "noOptionsText", "clearText", "openText", "loadingText", "closeText"]);
21
+ var _a = withDefaultGetters(props), _b = _a.disabled, disabled = _b === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLED : _b, _c = _a.required, required = _c === void 0 ? AUTOCOMPLETE_DEFAULT_REQUIRED : _c, _d = _a.autoFocus, autoFocus = _d === void 0 ? AUTOCOMPLETE_DEFAULT_AUTOFOCUS : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? AUTOCOMPLETE_DEFAULT_FULLWIDTH : _e, _f = _a.size, size = _f === void 0 ? AUTOCOMPLETE_DEFAULT_SIZE : _f, _g = _a.allowCustomValue, allowCustomValue = _g === void 0 ? AUTOCOMPLETE_DEFAULT_ALLOW_CUSTOM_VALUE : _g, _h = _a.disableShowChevron, disableShowChevron = _h === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_CHEVRON : _h, _j = _a.disableClearButton, disableClearButton = _j === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLEAR_BUTTON : _j, _k = _a.disableShowEmptyOptionsList, disableShowEmptyOptionsList = _k === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_SHOW_EMPTY_OPTIONS_LIST : _k, _l = _a.disableCloseOnSelect, disableCloseOnSelect = _l === void 0 ? AUTOCOMPLETE_DEFAULT_DISABLE_CLOSE_ON_SELECT : _l, _m = _a.renderInput, renderInput = _m === void 0 ? function (props) { return React.createElement(Input, __assign({}, props, { ref: ref })); } : _m, searchFunctionProp = _a.searchFunction, renderOptionProp = _a.renderOption, inputValueProp = _a.inputValue, className = _a.className, valueProp = _a.value, options = _a.options, defaultValue = _a.defaultValue, error = _a.error, onChange = _a.onChange, onInputChange = _a.onInputChange, label = _a.label, placeholder = _a.placeholder, renderLeft = _a.renderLeft, renderRight = _a.renderRight, hint = _a.hint, getOptionKey = _a.getOptionKey, getOptionLabel = _a.getOptionLabel, getOptionDisabled = _a.getOptionDisabled, dataListProps = _a.dataListProps, onCloseProp = _a.onClose, onOpenProp = _a.onOpen, openProp = _a.open, defaultOpen = _a.defaultOpen, loading = _a.loading, inputProps = _a.inputProps, bodyProps = _a.bodyProps, onKeyDown = _a.onKeyDown, noOptionsText = _a.noOptionsText, clearText = _a.clearText, openText = _a.openText, loadingText = _a.loadingText, closeText = _a.closeText, other = __rest(_a, ["disabled", "required", "autoFocus", "fullWidth", "size", "allowCustomValue", "disableShowChevron", "disableClearButton", "disableShowEmptyOptionsList", "disableCloseOnSelect", "renderInput", "searchFunction", "renderOption", "inputValue", "className", "value", "options", "defaultValue", "error", "onChange", "onInputChange", "label", "placeholder", "renderLeft", "renderRight", "hint", "getOptionKey", "getOptionLabel", "getOptionDisabled", "dataListProps", "onClose", "onOpen", "open", "defaultOpen", "loading", "inputProps", "bodyProps", "onKeyDown", "noOptionsText", "clearText", "openText", "loadingText", "closeText"]);
21
22
  var anchorRef = useRef(null);
23
+ var lastInputValue = useRef('');
24
+ var inputBodyRef = useMultiRef([anchorRef, bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref]);
22
25
  var _o = __read(useControlled({
23
26
  value: inputValueProp,
24
27
  defaultValue: '',
@@ -51,47 +54,43 @@ function AutocompleteRender(inProps, ref) {
51
54
  var showNoOptions = !hasOptions && !loading;
52
55
  var showLoading = !hasOptions && !!loading;
53
56
  var _s = __read(useState(undefined), 2), search = _s[0], setSearch = _s[1];
54
- /** Эффект фильтрация списка */
57
+ var changeInputValue = function (e, value) {
58
+ var _a;
59
+ setInputValue(value);
60
+ (_a = savedOnInputChange.current) === null || _a === void 0 ? void 0 : _a.call(savedOnInputChange, e, value);
61
+ };
62
+ var callOnChange = function (e, value) {
63
+ var inputValue = value ? getOptionLabel(value) : '';
64
+ setValueState(value);
65
+ onChange === null || onChange === void 0 ? void 0 : onChange(e, value);
66
+ changeInputValue(null, inputValue);
67
+ };
68
+ /** Эффект – фильтрация списка при изменении опций */
55
69
  useEffect(function () {
56
- if (!open) {
70
+ if (!open)
57
71
  return;
58
- }
59
72
  setFilteredOptions(search ? search(options) : __spreadArray([], __read(options), false));
60
73
  }, [search, options, open, searchFunctionProp]);
61
74
  /** Эффект – синхронизируем значение текстового поля со значением в списке */
62
75
  useEffect(function () {
63
- var _a, _b;
64
- var value = valueState ? (_a = savedGetOptionLabel.current) === null || _a === void 0 ? void 0 : _a.call(savedGetOptionLabel, valueState) : '';
65
- if (allowCustomValue) {
66
- value = inputValue || '';
67
- }
68
- if (value !== inputValue) {
69
- setInputValue(value);
70
- (_b = savedOnInputChange.current) === null || _b === void 0 ? void 0 : _b.call(savedOnInputChange, null, value);
76
+ var _a;
77
+ if (allowCustomValue)
78
+ return;
79
+ lastInputValue.current = valueState
80
+ ? (_a = savedGetOptionLabel.current) === null || _a === void 0 ? void 0 : _a.call(savedGetOptionLabel, valueState)
81
+ : '';
82
+ if (lastInputValue.current !== inputValue) {
83
+ changeInputValue(null, lastInputValue.current);
71
84
  }
72
- }, [valueState]);
85
+ }, [valueState, allowCustomValue]);
73
86
  /** Эффект – автофокусировка в текстовом поле */
74
87
  useEffect(function () {
75
88
  var _a;
76
- if (autoFocus) {
89
+ if (autoFocus)
77
90
  (_a = anchorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
78
- }
79
91
  }, [autoFocus]);
80
- /** Актуализация значения текстового поля после его покидания */
81
- var onBlur = function (e) {
82
- var _a;
83
- (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
84
- if (allowCustomValue) {
85
- return;
86
- }
87
- var value = valueState ? getOptionLabel(valueState) : '';
88
- if (inputValue !== value) {
89
- setInputValue(value);
90
- onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, value);
91
- }
92
- };
93
- /** Ждем выполнения анимации на закрытие и делаем сброс */
94
- var onExited = function () {
92
+ /** Ждём выполнения анимации на закрытие и делаем сброс функции фильтрации */
93
+ var handleExited = function () {
95
94
  var _a;
96
95
  setSearch(undefined);
97
96
  (_a = dataListProps === null || dataListProps === void 0 ? void 0 : dataListProps.onExited) === null || _a === void 0 ? void 0 : _a.call(dataListProps);
@@ -110,21 +109,26 @@ function AutocompleteRender(inProps, ref) {
110
109
  var handleToggle = function () {
111
110
  if (disabled)
112
111
  return;
113
- if (open) {
112
+ if (open)
114
113
  handleClose();
115
- }
116
- else {
114
+ else
117
115
  handleOpen();
118
- }
119
116
  };
120
117
  /** Очистка поля */
121
- var onClear = function (e) {
122
- setValueState(null);
123
- setInputValue('');
124
- onChange === null || onChange === void 0 ? void 0 : onChange(e, null);
125
- onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, '');
118
+ var handleClear = function (e) {
119
+ callOnChange(e, null);
126
120
  setSearch(undefined);
127
121
  };
122
+ /** Актуализация значения текстового поля после его покидания */
123
+ var handleBlur = function (e) {
124
+ var _a;
125
+ (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
126
+ if (allowCustomValue)
127
+ return;
128
+ if (inputValue !== lastInputValue.current) {
129
+ changeInputValue(null, lastInputValue.current);
130
+ }
131
+ };
128
132
  /** Открытие списка по клику на текстовом поле */
129
133
  var handleClickOnInput = function (e) {
130
134
  var _a;
@@ -132,49 +136,39 @@ function AutocompleteRender(inProps, ref) {
132
136
  (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onClick) === null || _a === void 0 ? void 0 : _a.call(inputProps, e);
133
137
  };
134
138
  /** Управление элементом контроля через клавиатуру */
135
- var handleKeyDown = function (event) {
136
- if (isKeys(event, ['ArrowDown', 'ArrowUp']) && !open) {
137
- event.preventDefault();
139
+ var handleKeyDown = function (e) {
140
+ if (isKeys(e, ['ArrowDown', 'ArrowUp']) && !open) {
141
+ e.preventDefault();
138
142
  handleToggle();
139
143
  }
140
- onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
144
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
141
145
  };
142
146
  /** Событие ввода значения в текстовом поле */
143
147
  var handleChangeInput = function (e) {
144
148
  var value = e.target.value;
145
149
  // Открываем список при вводе первого символа (при условии, что список еще не открыт)
146
- if (value.length && !open) {
150
+ if (value.length && !open)
147
151
  handleOpen();
152
+ if (value) {
153
+ changeInputValue(e, value);
148
154
  }
149
- // Делаем сброс при пустом значении в текстовом поле
150
- if (!value) {
151
- setValueState(null);
152
- onChange === null || onChange === void 0 ? void 0 : onChange(e, null);
155
+ else {
156
+ callOnChange(e, null);
153
157
  }
154
- // Назначаем значение
155
- setInputValue(value);
156
- onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(e, value);
157
158
  // Задаем функцию фильтрации
158
159
  setSearch(function () { return function (options) { return searchFunction(__spreadArray([], __read(options), false), value); }; });
159
160
  };
160
161
  /** Событие выбора значения из раскрывающегося списка */
161
- var handleChangeDataList = function (event, _a) {
162
+ var handleChangeDataList = function (e, _a) {
162
163
  var value = _a.value;
163
164
  var selectedOption = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.find(function (option) { return (getOptionKey === null || getOptionKey === void 0 ? void 0 : getOptionKey(option)) === value; });
164
- if (selectedOption) {
165
- var newInputValue = getOptionLabel(selectedOption);
166
- setValueState(selectedOption);
167
- onChange === null || onChange === void 0 ? void 0 : onChange(event, selectedOption);
168
- setInputValue(newInputValue);
169
- onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange(null, newInputValue);
170
- }
165
+ callOnChange(e, selectedOption || null);
171
166
  // Закрываем список после выбора
172
- if (!disableCloseOnSelect) {
167
+ if (!disableCloseOnSelect)
173
168
  handleClose();
174
- }
175
169
  };
176
170
  /** Отображение текстового поля */
177
- var input = renderInput(__assign(__assign({ size: size, hint: hint, disabled: disabled, label: label, required: required, error: error, fullWidth: fullWidth, placeholder: placeholder, renderLeft: renderLeft }, other), { renderRight: (React.createElement(AutocompleteRenderRight, { open: open, size: size, disabled: disabled, clearText: clearText, closeText: closeText, openText: openText, hasValue: !!inputValue, onClear: onClear, onOpen: handleToggle, renderRight: renderRight, disableShowChevron: disableShowChevron, disableClearButton: disableClearButton })), onChange: handleChangeInput, onKeyDown: handleKeyDown, value: inputValue || '', inputProps: __assign(__assign({}, inputProps), { onBlur: onBlur, onClick: handleClickOnInput }), bodyProps: { ref: anchorRef, 'aria-expanded': open }, className: cnAutocomplete({ size: size, hasChevron: !disableShowChevron }, [
171
+ var input = renderInput(__assign(__assign({ size: size, hint: hint, disabled: disabled, label: label, required: required, error: error, fullWidth: fullWidth, placeholder: placeholder, renderLeft: renderLeft }, other), { renderRight: (React.createElement(AutocompleteRenderRight, { open: open, size: size, disabled: disabled, clearText: clearText, closeText: closeText, openText: openText, hasValue: !!inputValue, onClear: handleClear, onOpen: handleToggle, renderRight: renderRight, disableShowChevron: disableShowChevron, disableClearButton: disableClearButton })), onChange: handleChangeInput, onKeyDown: handleKeyDown, value: inputValue || '', inputProps: __assign(__assign({}, inputProps), { onBlur: handleBlur, onClick: handleClickOnInput }), bodyProps: __assign(__assign({ 'aria-expanded': open }, bodyProps), { ref: inputBodyRef }), className: cnAutocomplete({ size: size, hasChevron: !disableShowChevron }, [
178
172
  className,
179
173
  ]), ref: ref }));
180
174
  /** Отображение опций */
@@ -191,7 +185,7 @@ function AutocompleteRender(inProps, ref) {
191
185
  });
192
186
  return (React.createElement(React.Fragment, null,
193
187
  input,
194
- React.createElement(DataList, __assign({ size: size, equalAnchorWidth: true, offset: [0, 4], placement: "bottom-start" }, dataListProps, { open: open, onExited: onExited, onClose: handleClose, anchorRef: anchorRef, selected: dataListValue, onSelect: handleChangeDataList, listProps: __assign({ role: 'listbox' }, dataListProps === null || dataListProps === void 0 ? void 0 : dataListProps.listProps) }),
188
+ React.createElement(DataList, __assign({ size: size, equalAnchorWidth: true, offset: [0, 4], placement: "bottom-start" }, dataListProps, { open: open, onClose: handleClose, anchorRef: anchorRef, onExited: handleExited, selected: dataListValue, onSelect: handleChangeDataList, listProps: __assign({ role: 'listbox' }, dataListProps === null || dataListProps === void 0 ? void 0 : dataListProps.listProps) }),
195
189
  renderOptions,
196
190
  !disableShowEmptyOptionsList && (React.createElement(AutocompleteNoOptions, { showNoOptions: showNoOptions, noOptionsText: noOptionsText })),
197
191
  React.createElement(AutocompleteLoading, { showLoading: showLoading, loadingText: loadingText, size: size }))));
@@ -80,6 +80,9 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
80
80
  } & {
81
81
  'data-testid'?: string | undefined;
82
82
  }) | undefined;
83
+ bodyProps?: (Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
84
+ ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
85
+ }) | undefined;
83
86
  hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
84
87
  } & {
85
88
  open?: boolean | undefined;
@@ -177,6 +180,9 @@ export declare function withDefaultGetters<OPTION>(props: AutocompleteProps<OPTI
177
180
  } & {
178
181
  'data-testid'?: string | undefined;
179
182
  }) | undefined;
183
+ bodyProps?: (Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
184
+ ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
185
+ }) | undefined;
180
186
  hintProps?: Omit<import("../FieldHint").FieldHintProps, "children"> | undefined;
181
187
  } & {
182
188
  open?: undefined;
@@ -31,7 +31,7 @@ type AutocompleteOpenUncontrolledProps = {
31
31
  /** Состояние открытие по умолчанию (неконтролируемый компонент) */
32
32
  defaultOpen?: boolean;
33
33
  };
34
- type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'hintProps' | 'onKeyDown'>;
34
+ type AutocompleteInputProps = Pick<InputProps, 'placeholder' | 'autoFocus' | 'fullWidth' | 'disabled' | 'label' | 'required' | 'style' | 'error' | 'hint' | 'renderLeft' | 'renderRight' | 'className' | 'inputProps' | 'hintProps' | 'bodyProps' | 'onKeyDown'>;
35
35
  type AutocompleteDataListProps = Partial<Omit<DataListProps, 'onClose' | 'open' | 'anchorRef' | 'multiple' | 'selected' | 'onSelect'>>;
36
36
  export type AutocompleteProps<OPTION = AutocompleteDefaultOption> = {
37
37
  /** Список вариантов выбора (опции) */
@@ -6,7 +6,7 @@ import type { CALENDAR_DEFAULT_AS } from './constants';
6
6
  export declare const calendarStepVariant: readonly ["days", "months", "years"];
7
7
  export declare const calendarSizeVariant: readonly ["s", "m", "l"];
8
8
  export type CalendarStepVariant = (typeof calendarStepVariant)[number];
9
- export type CalendarOnChange = (date: Date) => void;
9
+ export type CalendarOnChange = (date: Date | null) => void;
10
10
  export type CalendarOnOffsetDateChange = (date: Date) => void;
11
11
  export type CalendarSizeVariant = (typeof calendarSizeVariant)[number];
12
12
  export type CalendarExclude = DPExcludeConfig;
@@ -0,0 +1,11 @@
1
+ .DatePicker-RenderRight {
2
+ display: flex;
3
+ gap: var(--spacing-2xs);
4
+ }
5
+ .DatePicker-ClearButton {
6
+ visibility: hidden;
7
+ transition: visibility var(--transition-default);
8
+ }
9
+ .DatePicker-ClearButton_visibility {
10
+ visibility: visible;
11
+ }