@ozen-ui/kit 0.63.1 → 0.65.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.
- package/ChipGroup/package.json +5 -0
- package/InputOTP/package.json +5 -0
- package/Title/package.json +5 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.css +16 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.d.ts +4 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroup.js +52 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroupContext.d.ts +10 -0
- package/__inner__/cjs/components/ChipGroup/ChipGroupContext.js +5 -0
- package/__inner__/cjs/components/ChipGroup/constants.d.ts +5 -0
- package/__inner__/cjs/components/ChipGroup/constants.js +6 -0
- package/__inner__/cjs/components/ChipGroup/index.d.ts +2 -0
- package/__inner__/cjs/components/ChipGroup/index.js +5 -0
- package/__inner__/cjs/components/ChipGroup/types.d.ts +33 -0
- package/__inner__/cjs/components/ChipGroup/types.js +2 -0
- package/__inner__/cjs/components/ChipNext/Chip.css +50 -17
- package/__inner__/cjs/components/ChipNext/Chip.js +32 -5
- package/__inner__/cjs/components/ChipNext/types.d.ts +9 -5
- package/__inner__/cjs/components/ChipNext/types.js +9 -2
- package/__inner__/cjs/components/FormGroup/types.d.ts +2 -0
- package/__inner__/cjs/components/FormTitle/FormTitle.d.ts +1 -0
- package/__inner__/cjs/components/IconButtonNext/types.d.ts +4 -1
- package/__inner__/cjs/components/IconButtonNext/utils.d.ts +2 -2
- package/__inner__/cjs/components/InputOTP/InputOTP.css +60 -0
- package/__inner__/cjs/components/InputOTP/InputOTP.d.ts +4 -0
- package/__inner__/cjs/components/InputOTP/InputOTP.js +179 -0
- package/__inner__/cjs/components/InputOTP/constants.d.ts +8 -0
- package/__inner__/cjs/components/InputOTP/constants.js +13 -0
- package/__inner__/cjs/components/InputOTP/helper.d.ts +13 -0
- package/__inner__/cjs/components/InputOTP/helper.js +87 -0
- package/__inner__/cjs/components/InputOTP/hooks/index.d.ts +1 -0
- package/__inner__/cjs/components/InputOTP/hooks/index.js +4 -0
- package/__inner__/cjs/components/InputOTP/hooks/useInputOTPEvents.d.ts +20 -0
- package/__inner__/cjs/components/InputOTP/hooks/useInputOTPEvents.js +183 -0
- package/__inner__/cjs/components/InputOTP/index.d.ts +3 -0
- package/__inner__/cjs/components/InputOTP/index.js +6 -0
- package/__inner__/cjs/components/InputOTP/presets.d.ts +12 -0
- package/__inner__/cjs/components/InputOTP/presets.js +27 -0
- package/__inner__/cjs/components/InputOTP/types.d.ts +101 -0
- package/__inner__/cjs/components/InputOTP/types.js +7 -0
- package/__inner__/cjs/components/TagNext/types.d.ts +1 -1
- package/__inner__/cjs/components/TagNext/types.js +1 -0
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +7 -2
- package/__inner__/cjs/components/Title/Title.d.ts +4 -0
- package/__inner__/cjs/components/Title/Title.js +27 -0
- package/__inner__/cjs/components/Title/TitleContext.d.ts +8 -0
- package/__inner__/cjs/components/Title/TitleContext.js +17 -0
- package/__inner__/cjs/components/Title/components/index.d.ts +1 -0
- package/__inner__/cjs/components/Title/components/index.js +4 -0
- package/__inner__/cjs/components/Title/components/variant/TitleVariant.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/TitleVariant.js +24 -0
- package/__inner__/cjs/components/Title/components/variant/index.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/index.js +7 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.css +38 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/main/TitleMain.js +35 -0
- package/__inner__/cjs/components/Title/components/variant/main/config.d.ts +3 -0
- package/__inner__/cjs/components/Title/components/variant/main/config.js +7 -0
- package/__inner__/cjs/components/Title/components/variant/main/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/main/index.js +5 -0
- package/__inner__/cjs/components/Title/components/variant/main/types.d.ts +13 -0
- package/__inner__/cjs/components/Title/components/variant/main/types.js +2 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/TitleSecondary.js +15 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/index.js +5 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/types.d.ts +10 -0
- package/__inner__/cjs/components/Title/components/variant/secondary/types.js +2 -0
- package/__inner__/cjs/components/Title/components/variant/types.d.ts +8 -0
- package/__inner__/cjs/components/Title/components/variant/types.js +2 -0
- package/__inner__/cjs/components/Title/constants.d.ts +4 -0
- package/__inner__/cjs/components/Title/constants.js +6 -0
- package/__inner__/cjs/components/Title/entities/icon.d.ts +3 -0
- package/__inner__/cjs/components/Title/entities/icon.js +2 -0
- package/__inner__/cjs/components/Title/entities/index.d.ts +3 -0
- package/__inner__/cjs/components/Title/entities/index.js +6 -0
- package/__inner__/cjs/components/Title/entities/size.d.ts +2 -0
- package/__inner__/cjs/components/Title/entities/size.js +4 -0
- package/__inner__/cjs/components/Title/entities/variant.d.ts +7 -0
- package/__inner__/cjs/components/Title/entities/variant.js +4 -0
- package/__inner__/cjs/components/Title/index.d.ts +4 -0
- package/__inner__/cjs/components/Title/index.js +7 -0
- package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
- package/__inner__/cjs/components/Title/modules/icon-button/TitleIconButton.js +16 -0
- package/__inner__/cjs/components/Title/modules/icon-button/constants.d.ts +1 -0
- package/__inner__/cjs/components/Title/modules/icon-button/constants.js +4 -0
- package/__inner__/cjs/components/Title/modules/icon-button/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/icon-button/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/icon-button/types.d.ts +6 -0
- package/__inner__/cjs/components/Title/modules/icon-button/types.js +2 -0
- package/__inner__/cjs/components/Title/modules/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.css +4 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.d.ts +3 -0
- package/__inner__/cjs/components/Title/modules/tag/TitleTag.js +11 -0
- package/__inner__/cjs/components/Title/modules/tag/constants.d.ts +1 -0
- package/__inner__/cjs/components/Title/modules/tag/constants.js +4 -0
- package/__inner__/cjs/components/Title/modules/tag/index.d.ts +2 -0
- package/__inner__/cjs/components/Title/modules/tag/index.js +5 -0
- package/__inner__/cjs/components/Title/modules/tag/types.d.ts +6 -0
- package/__inner__/cjs/components/Title/modules/tag/types.js +2 -0
- package/__inner__/cjs/components/Title/types.d.ts +10 -0
- package/__inner__/cjs/components/Title/types.js +2 -0
- package/__inner__/cjs/constants/environment/index.d.ts +2 -0
- package/__inner__/cjs/constants/environment/index.js +5 -0
- package/__inner__/cjs/constants/environment/isDev.d.ts +1 -0
- package/__inner__/cjs/constants/environment/isDev.js +5 -0
- package/__inner__/cjs/constants/environment/isProduction.d.ts +1 -0
- package/__inner__/cjs/constants/environment/isProduction.js +4 -0
- package/__inner__/cjs/hooks/useStoredValue/index.d.ts +3 -0
- package/__inner__/cjs/hooks/useStoredValue/index.js +6 -0
- package/__inner__/cjs/hooks/useStoredValue/types.d.ts +2 -0
- package/__inner__/cjs/hooks/useStoredValue/types.js +2 -0
- package/__inner__/cjs/hooks/useStoredValue/useStoredValue.d.ts +4 -0
- package/__inner__/cjs/hooks/useStoredValue/useStoredValue.js +16 -0
- package/__inner__/cjs/hooks/useStoredValue/utils.d.ts +2 -0
- package/__inner__/cjs/hooks/useStoredValue/utils.js +8 -0
- package/__inner__/cjs/types/object/withPartial.d.ts +3 -0
- package/__inner__/cjs/types/object/withPartial.js +2 -0
- package/__inner__/cjs/utils/array/create-empty/createEmptyArray.d.ts +1 -0
- package/__inner__/cjs/utils/array/create-empty/createEmptyArray.js +8 -0
- package/__inner__/cjs/utils/array/create-empty/index.d.ts +1 -0
- package/__inner__/cjs/utils/array/create-empty/index.js +4 -0
- package/__inner__/cjs/utils/array/create-filled/createFilledArray.d.ts +1 -0
- package/__inner__/cjs/utils/array/create-filled/createFilledArray.js +7 -0
- package/__inner__/cjs/utils/array/create-filled/index.d.ts +1 -0
- package/__inner__/cjs/utils/array/create-filled/index.js +4 -0
- package/__inner__/cjs/utils/array/index.d.ts +2 -0
- package/__inner__/cjs/utils/array/index.js +5 -0
- package/__inner__/cjs/utils/isFunction.d.ts +1 -0
- package/__inner__/cjs/utils/isFunction.js +8 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.css +16 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.d.ts +4 -0
- package/__inner__/esm/components/ChipGroup/ChipGroup.js +49 -0
- package/__inner__/esm/components/ChipGroup/ChipGroupContext.d.ts +10 -0
- package/__inner__/esm/components/ChipGroup/ChipGroupContext.js +2 -0
- package/__inner__/esm/components/ChipGroup/constants.d.ts +5 -0
- package/__inner__/esm/components/ChipGroup/constants.js +3 -0
- package/__inner__/esm/components/ChipGroup/index.d.ts +2 -0
- package/__inner__/esm/components/ChipGroup/index.js +2 -0
- package/__inner__/esm/components/ChipGroup/types.d.ts +33 -0
- package/__inner__/esm/components/ChipGroup/types.js +1 -0
- package/__inner__/esm/components/ChipNext/Chip.css +50 -17
- package/__inner__/esm/components/ChipNext/Chip.js +32 -5
- package/__inner__/esm/components/ChipNext/types.d.ts +9 -5
- package/__inner__/esm/components/ChipNext/types.js +8 -1
- package/__inner__/esm/components/FormGroup/types.d.ts +2 -0
- package/__inner__/esm/components/FormTitle/FormTitle.d.ts +1 -0
- package/__inner__/esm/components/IconButtonNext/types.d.ts +4 -1
- package/__inner__/esm/components/IconButtonNext/utils.d.ts +2 -2
- package/__inner__/esm/components/InputOTP/InputOTP.css +60 -0
- package/__inner__/esm/components/InputOTP/InputOTP.d.ts +4 -0
- package/__inner__/esm/components/InputOTP/InputOTP.js +176 -0
- package/__inner__/esm/components/InputOTP/constants.d.ts +8 -0
- package/__inner__/esm/components/InputOTP/constants.js +10 -0
- package/__inner__/esm/components/InputOTP/helper.d.ts +13 -0
- package/__inner__/esm/components/InputOTP/helper.js +79 -0
- package/__inner__/esm/components/InputOTP/hooks/index.d.ts +1 -0
- package/__inner__/esm/components/InputOTP/hooks/index.js +1 -0
- package/__inner__/esm/components/InputOTP/hooks/useInputOTPEvents.d.ts +20 -0
- package/__inner__/esm/components/InputOTP/hooks/useInputOTPEvents.js +179 -0
- package/__inner__/esm/components/InputOTP/index.d.ts +3 -0
- package/__inner__/esm/components/InputOTP/index.js +3 -0
- package/__inner__/esm/components/InputOTP/presets.d.ts +12 -0
- package/__inner__/esm/components/InputOTP/presets.js +24 -0
- package/__inner__/esm/components/InputOTP/types.d.ts +101 -0
- package/__inner__/esm/components/InputOTP/types.js +4 -0
- package/__inner__/esm/components/TagNext/types.d.ts +1 -1
- package/__inner__/esm/components/TagNext/types.js +1 -0
- package/__inner__/esm/components/ThemeProvider/types.d.ts +7 -2
- package/__inner__/esm/components/Title/Title.d.ts +4 -0
- package/__inner__/esm/components/Title/Title.js +24 -0
- package/__inner__/esm/components/Title/TitleContext.d.ts +8 -0
- package/__inner__/esm/components/Title/TitleContext.js +12 -0
- package/__inner__/esm/components/Title/components/index.d.ts +1 -0
- package/__inner__/esm/components/Title/components/index.js +1 -0
- package/__inner__/esm/components/Title/components/variant/TitleVariant.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/TitleVariant.js +21 -0
- package/__inner__/esm/components/Title/components/variant/index.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/index.js +4 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.css +38 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/main/TitleMain.js +32 -0
- package/__inner__/esm/components/Title/components/variant/main/config.d.ts +3 -0
- package/__inner__/esm/components/Title/components/variant/main/config.js +4 -0
- package/__inner__/esm/components/Title/components/variant/main/index.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/main/index.js +2 -0
- package/__inner__/esm/components/Title/components/variant/main/types.d.ts +13 -0
- package/__inner__/esm/components/Title/components/variant/main/types.js +1 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.css +26 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.d.ts +4 -0
- package/__inner__/esm/components/Title/components/variant/secondary/TitleSecondary.js +12 -0
- package/__inner__/esm/components/Title/components/variant/secondary/index.d.ts +2 -0
- package/__inner__/esm/components/Title/components/variant/secondary/index.js +2 -0
- package/__inner__/esm/components/Title/components/variant/secondary/types.d.ts +10 -0
- package/__inner__/esm/components/Title/components/variant/secondary/types.js +1 -0
- package/__inner__/esm/components/Title/components/variant/types.d.ts +8 -0
- package/__inner__/esm/components/Title/components/variant/types.js +1 -0
- package/__inner__/esm/components/Title/constants.d.ts +4 -0
- package/__inner__/esm/components/Title/constants.js +3 -0
- package/__inner__/esm/components/Title/entities/icon.d.ts +3 -0
- package/__inner__/esm/components/Title/entities/icon.js +1 -0
- package/__inner__/esm/components/Title/entities/index.d.ts +3 -0
- package/__inner__/esm/components/Title/entities/index.js +3 -0
- package/__inner__/esm/components/Title/entities/size.d.ts +2 -0
- package/__inner__/esm/components/Title/entities/size.js +1 -0
- package/__inner__/esm/components/Title/entities/variant.d.ts +7 -0
- package/__inner__/esm/components/Title/entities/variant.js +1 -0
- package/__inner__/esm/components/Title/index.d.ts +4 -0
- package/__inner__/esm/components/Title/index.js +4 -0
- package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.d.ts +3 -0
- package/__inner__/esm/components/Title/modules/icon-button/TitleIconButton.js +13 -0
- package/__inner__/esm/components/Title/modules/icon-button/constants.d.ts +1 -0
- package/__inner__/esm/components/Title/modules/icon-button/constants.js +1 -0
- package/__inner__/esm/components/Title/modules/icon-button/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/icon-button/index.js +2 -0
- package/__inner__/esm/components/Title/modules/icon-button/types.d.ts +6 -0
- package/__inner__/esm/components/Title/modules/icon-button/types.js +1 -0
- package/__inner__/esm/components/Title/modules/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/index.js +2 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.css +4 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.d.ts +3 -0
- package/__inner__/esm/components/Title/modules/tag/TitleTag.js +8 -0
- package/__inner__/esm/components/Title/modules/tag/constants.d.ts +1 -0
- package/__inner__/esm/components/Title/modules/tag/constants.js +1 -0
- package/__inner__/esm/components/Title/modules/tag/index.d.ts +2 -0
- package/__inner__/esm/components/Title/modules/tag/index.js +2 -0
- package/__inner__/esm/components/Title/modules/tag/types.d.ts +6 -0
- package/__inner__/esm/components/Title/modules/tag/types.js +1 -0
- package/__inner__/esm/components/Title/types.d.ts +10 -0
- package/__inner__/esm/components/Title/types.js +1 -0
- package/__inner__/esm/constants/environment/index.d.ts +2 -0
- package/__inner__/esm/constants/environment/index.js +2 -0
- package/__inner__/esm/constants/environment/isDev.d.ts +1 -0
- package/__inner__/esm/constants/environment/isDev.js +2 -0
- package/__inner__/esm/constants/environment/isProduction.d.ts +1 -0
- package/__inner__/esm/constants/environment/isProduction.js +1 -0
- package/__inner__/esm/hooks/useStoredValue/index.d.ts +3 -0
- package/__inner__/esm/hooks/useStoredValue/index.js +3 -0
- package/__inner__/esm/hooks/useStoredValue/types.d.ts +2 -0
- package/__inner__/esm/hooks/useStoredValue/types.js +1 -0
- package/__inner__/esm/hooks/useStoredValue/useStoredValue.d.ts +4 -0
- package/__inner__/esm/hooks/useStoredValue/useStoredValue.js +13 -0
- package/__inner__/esm/hooks/useStoredValue/utils.d.ts +2 -0
- package/__inner__/esm/hooks/useStoredValue/utils.js +5 -0
- package/__inner__/esm/types/object/withPartial.d.ts +3 -0
- package/__inner__/esm/types/object/withPartial.js +1 -0
- package/__inner__/esm/utils/array/create-empty/createEmptyArray.d.ts +1 -0
- package/__inner__/esm/utils/array/create-empty/createEmptyArray.js +4 -0
- package/__inner__/esm/utils/array/create-empty/index.d.ts +1 -0
- package/__inner__/esm/utils/array/create-empty/index.js +1 -0
- package/__inner__/esm/utils/array/create-filled/createFilledArray.d.ts +1 -0
- package/__inner__/esm/utils/array/create-filled/createFilledArray.js +3 -0
- package/__inner__/esm/utils/array/create-filled/index.d.ts +1 -0
- package/__inner__/esm/utils/array/create-filled/index.js +1 -0
- package/__inner__/esm/utils/array/index.d.ts +2 -0
- package/__inner__/esm/utils/array/index.js +2 -0
- package/__inner__/esm/utils/isFunction.d.ts +1 -0
- package/__inner__/esm/utils/isFunction.js +4 -0
- package/package.json +4 -4
- package/useStoredValue/package.json +5 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export var INPUT_OTP_VALIDATE_PRESET = {
|
|
2
|
+
TEXT: function (value) { return /[a-zA-Z]{1}/.test(value); },
|
|
3
|
+
NUMERIC: function (value) { return /\d{1}/.test(value); },
|
|
4
|
+
TEXT_NUMERIC: function (value) { return /[a-zA-Z0-9]{1}/.test(value); },
|
|
5
|
+
};
|
|
6
|
+
export var INPUT_OTP_MASK_PRESET = {
|
|
7
|
+
PASSWORD: '•',
|
|
8
|
+
};
|
|
9
|
+
export var INPUT_OTP_FINISH_BEHAVIOR_PRESET = {
|
|
10
|
+
FULL_FILLED_NON_LAST_INPUT: function (_a) {
|
|
11
|
+
var isFullFilled = _a.isFullFilled;
|
|
12
|
+
return isFullFilled;
|
|
13
|
+
},
|
|
14
|
+
FULL_FILLED_ON_LAST_INPUT: function (_a) {
|
|
15
|
+
var isFullFilled = _a.isFullFilled, isChangeOnLastInput = _a.isChangeOnLastInput, isEnter = _a.isEnter;
|
|
16
|
+
if (isFullFilled && isChangeOnLastInput) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (isFullFilled && isEnter) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { FIELD_CONTROL_DEFAULT_TAG, FieldControlBaseProps } from '../FieldControl';
|
|
4
|
+
import type { FieldInputProps } from '../FieldInput';
|
|
5
|
+
import type { INPUT_OTP_DEFAULT_TAG } from './constants';
|
|
6
|
+
export declare const inputOTPAutoCompleteMode: readonly ["firstOnly", "all"];
|
|
7
|
+
export type InputOTPAutoCompleteMode = (typeof inputOTPAutoCompleteMode)[number];
|
|
8
|
+
export declare const inputOTPSizeVariant: readonly ["s", "m"];
|
|
9
|
+
export type InputOTPSizeVariant = (typeof inputOTPSizeVariant)[number];
|
|
10
|
+
export type InputOTPValidate = (value: string) => boolean;
|
|
11
|
+
export type InputOTPRawValue = string[];
|
|
12
|
+
export type InputOTPValue = InputOTPRawValue | string;
|
|
13
|
+
export type InputOTPOnChange = (value: string, rawValue: InputOTPRawValue, maskedValue: string, maskedRawValue: InputOTPRawValue) => void;
|
|
14
|
+
export type InputOTPOnFinish = (value: string, rawValue: InputOTPRawValue, maskedValue: string, maskedRawValue: InputOTPRawValue) => void;
|
|
15
|
+
export type InputOTPInputs = HTMLInputElement[];
|
|
16
|
+
export type InputOTPInputProps = FieldInputProps;
|
|
17
|
+
export type InputOTPCalculatedInput = {
|
|
18
|
+
/** Значение input */
|
|
19
|
+
value: string;
|
|
20
|
+
/** Необработанное input */
|
|
21
|
+
rawValue: string;
|
|
22
|
+
/** Флаг: это предыдущий input */
|
|
23
|
+
isPrevious: boolean;
|
|
24
|
+
/** Флаг: это следующий input */
|
|
25
|
+
isNext: boolean;
|
|
26
|
+
/** Флаг: это текущий input */
|
|
27
|
+
isCurrentInput: boolean;
|
|
28
|
+
/** Флаг: это последний input */
|
|
29
|
+
isLast: boolean;
|
|
30
|
+
/** Флаг: input отключен */
|
|
31
|
+
isDisabled: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type InputOTPMask = string | ((value: string, index: number) => string);
|
|
34
|
+
export type InputOTPFinishBehaviorContext = {
|
|
35
|
+
/** Флаг: Поле полностью заполнено */
|
|
36
|
+
isFullFilled: boolean;
|
|
37
|
+
/** Значение */
|
|
38
|
+
value: string;
|
|
39
|
+
/** Необработанное значение */
|
|
40
|
+
rawValue: InputOTPRawValue;
|
|
41
|
+
/** Значение с маской */
|
|
42
|
+
maskedValue: string;
|
|
43
|
+
/** Необработанное значение с маской */
|
|
44
|
+
maskedRawValue: InputOTPRawValue;
|
|
45
|
+
/** Флаг: Это изменение на последнем input'е */
|
|
46
|
+
isChangeOnLastInput: boolean;
|
|
47
|
+
/** index input'а, на котором произошло изменение */
|
|
48
|
+
inputIndex: number;
|
|
49
|
+
/** Флаг: Был нажат enter */
|
|
50
|
+
isEnter: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type InputOTPFinishBehavior = (context: InputOTPFinishBehaviorContext) => boolean;
|
|
53
|
+
export type InputOTPDynamicInputParameter<Parameter> = Parameter | ((calculatedInput: InputOTPCalculatedInput, index: number) => Parameter);
|
|
54
|
+
export type InputOTPBaseProps = {
|
|
55
|
+
/** Длина кода */
|
|
56
|
+
length: number;
|
|
57
|
+
/** Значение */
|
|
58
|
+
value?: InputOTPValue;
|
|
59
|
+
/** Значение по умолчанию */
|
|
60
|
+
defaultValue?: InputOTPValue;
|
|
61
|
+
/** Обработчик события на изменение значения поля */
|
|
62
|
+
onChange?: InputOTPOnChange;
|
|
63
|
+
/** Обработчик события на завершение ввода */
|
|
64
|
+
onFinish?: InputOTPOnFinish;
|
|
65
|
+
/** Маска значения */
|
|
66
|
+
mask?: InputOTPMask;
|
|
67
|
+
/** autoComplete */
|
|
68
|
+
autoComplete?: InputOTPInputProps['autoComplete'];
|
|
69
|
+
/**
|
|
70
|
+
* Мод autoComplete.
|
|
71
|
+
* В зависимости от режима, autoComplete будет устанавливаться разным input
|
|
72
|
+
*/
|
|
73
|
+
autoCompleteMode?: InputOTPAutoCompleteMode;
|
|
74
|
+
/** Если `true` переводит поле в состояние ошибки */
|
|
75
|
+
error?: boolean;
|
|
76
|
+
/** Если `true` делает элемент неактивным */
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
/** Функция-валидатор */
|
|
79
|
+
validate?: InputOTPValidate;
|
|
80
|
+
/** Размер */
|
|
81
|
+
size?: InputOTPSizeVariant;
|
|
82
|
+
/** Лейбл */
|
|
83
|
+
ariaLabel?: string;
|
|
84
|
+
/** Если `true` отключает обводку */
|
|
85
|
+
disableStroke?: boolean;
|
|
86
|
+
/** Подсказка. Отображается, когда значение не введено */
|
|
87
|
+
placeholder?: InputOTPDynamicInputParameter<string>;
|
|
88
|
+
/** Свойства Field */
|
|
89
|
+
fieldProps?: InputOTPDynamicInputParameter<PolymorphicComponentPropsWithRef<FieldControlBaseProps, typeof FIELD_CONTROL_DEFAULT_TAG>>;
|
|
90
|
+
/** Свойства Input */
|
|
91
|
+
inputProps?: InputOTPDynamicInputParameter<FieldInputProps>;
|
|
92
|
+
/** Свойства InputContainer */
|
|
93
|
+
inputContainerProps?: InputOTPDynamicInputParameter<ComponentPropsWithRef<'div'> & {
|
|
94
|
+
'data-testid'?: string;
|
|
95
|
+
}>;
|
|
96
|
+
/** Функция, которая определяет поведение финиша */
|
|
97
|
+
finishBehavior?: InputOTPFinishBehavior;
|
|
98
|
+
/** data-атрибут для тестирования */
|
|
99
|
+
'data-testid'?: string;
|
|
100
|
+
};
|
|
101
|
+
export type InputOTPProps<As extends ElementType = typeof INPUT_OTP_DEFAULT_TAG> = PolymorphicComponentPropsWithRef<InputOTPBaseProps, As>;
|
|
@@ -5,7 +5,7 @@ import type { PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphi
|
|
|
5
5
|
import type { RenderContentType } from '../../utils/renderContent';
|
|
6
6
|
import type { TAG_DEFAULT_TAG } from './constants';
|
|
7
7
|
export declare const tagVariant: readonly ["primary", "secondary"];
|
|
8
|
-
export declare const tagColorVariant: readonly ["neutral", "action", "error", "warning", "success", "info"];
|
|
8
|
+
export declare const tagColorVariant: readonly ["neutral", "action", "error", "warning", "success", "info", "uncolored"];
|
|
9
9
|
export type TagVariant = (typeof tagVariant)[number];
|
|
10
10
|
export type TagColor = (typeof tagColorVariant)[number];
|
|
11
11
|
export type TagIcon = RenderContentType<IconProps>['content'];
|
|
@@ -16,7 +16,8 @@ import type { CardProps } from '../Card';
|
|
|
16
16
|
import type { CheckboxProps } from '../Checkbox';
|
|
17
17
|
import type { CheckboxGroupProps } from '../CheckboxGroup';
|
|
18
18
|
import type { ChipProps } from '../Chip';
|
|
19
|
-
import type {
|
|
19
|
+
import type { ChipGroupProps } from '../ChipGroup';
|
|
20
|
+
import type { ChipProps as ChipNextProps } from '../ChipNext';
|
|
20
21
|
import type { CollapseProps } from '../Collapse';
|
|
21
22
|
import type { ContainerProps } from '../Container';
|
|
22
23
|
import type { DataListProps } from '../DataList';
|
|
@@ -56,6 +57,7 @@ import type { TableContainerProps, TableProps, TableCaptionProps, TableCellProps
|
|
|
56
57
|
import type { TagProps } from '../Tag';
|
|
57
58
|
import type { TagProps as TagPropsNext } from '../TagNext';
|
|
58
59
|
import type { TextareaProps } from '../Textarea';
|
|
60
|
+
import type { TitleProps } from '../Title';
|
|
59
61
|
import type { ToggleProps } from '../Toggle';
|
|
60
62
|
import type { TooltipProps } from '../Tooltip';
|
|
61
63
|
import type { TypographyProps } from '../Typography';
|
|
@@ -91,7 +93,8 @@ export type Theme = {
|
|
|
91
93
|
Checkbox?: Partial<CheckboxProps>;
|
|
92
94
|
CheckboxGroup?: Partial<CheckboxGroupProps>;
|
|
93
95
|
Chip?: Partial<ChipProps>;
|
|
94
|
-
ChipNext?: Partial<
|
|
96
|
+
ChipNext?: Partial<ChipNextProps>;
|
|
97
|
+
ChipGroup?: Partial<ChipGroupProps>;
|
|
95
98
|
Collapse?: Partial<CollapseProps>;
|
|
96
99
|
Container?: Partial<ContainerProps>;
|
|
97
100
|
DataList?: Partial<DataListProps>;
|
|
@@ -111,6 +114,7 @@ export type Theme = {
|
|
|
111
114
|
Indicator?: Partial<IndicatorProps>;
|
|
112
115
|
Input?: Partial<InputProps>;
|
|
113
116
|
InputNumber?: Partial<InputNumberProps>;
|
|
117
|
+
InputOTP?: Partial<InputProps>;
|
|
114
118
|
Link?: Partial<LinkProps>;
|
|
115
119
|
List?: Partial<ListProps>;
|
|
116
120
|
ListItem?: Partial<ListItemProps>;
|
|
@@ -139,6 +143,7 @@ export type Theme = {
|
|
|
139
143
|
Tag?: Partial<TagProps>;
|
|
140
144
|
TagNext?: Partial<TagPropsNext>;
|
|
141
145
|
Textarea?: Partial<TextareaProps>;
|
|
146
|
+
Title?: Partial<TitleProps>;
|
|
142
147
|
Toggle?: Partial<ToggleProps>;
|
|
143
148
|
Tooltip?: Partial<TooltipProps>;
|
|
144
149
|
Typography?: Partial<TypographyProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './modules/tag/TitleTag.css';
|
|
2
|
+
import type { TitleBaseProps } from './types';
|
|
3
|
+
export declare const cnTitle: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const Title: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleBaseProps, "div">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './modules/tag/TitleTag.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
5
|
+
import { cn } from '../../utils/classname';
|
|
6
|
+
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
7
|
+
import { TitleVariant } from './components';
|
|
8
|
+
import { TITLE_DEFAULT_SIZE, TITLE_DEFAULT_TAG, TITLE_DEFAULT_VARIANT, } from './constants';
|
|
9
|
+
import { TitleContext } from './TitleContext';
|
|
10
|
+
export var cnTitle = cn('Title');
|
|
11
|
+
export var Title = polymorphicComponentWithRef(function (inProps, ref) {
|
|
12
|
+
var props = useThemeProps({
|
|
13
|
+
props: inProps,
|
|
14
|
+
name: 'Title',
|
|
15
|
+
});
|
|
16
|
+
var _a = props.size, size = _a === void 0 ? TITLE_DEFAULT_SIZE : _a, classNameProp = props.className, _b = props.as, as = _b === void 0 ? TITLE_DEFAULT_TAG : _b, _c = props.variant, variant = _c === void 0 ? TITLE_DEFAULT_VARIANT : _c, other = __rest(props, ["size", "className", "as", "variant"]);
|
|
17
|
+
var className = cnTitle('', [classNameProp]);
|
|
18
|
+
return (React.createElement(TitleContext.Provider, { value: {
|
|
19
|
+
size: size,
|
|
20
|
+
variant: variant,
|
|
21
|
+
} },
|
|
22
|
+
React.createElement(TitleVariant, __assign({}, other, { ref: ref, as: as, className: className, size: size, variant: variant }))));
|
|
23
|
+
});
|
|
24
|
+
Title.displayName = 'Title';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TitleVariant, TitleSizeVariant } from './entities';
|
|
3
|
+
export type TitleContextValue = {
|
|
4
|
+
variant: TitleVariant;
|
|
5
|
+
size: TitleSizeVariant;
|
|
6
|
+
};
|
|
7
|
+
export declare const TitleContext: React.Context<TitleContextValue>;
|
|
8
|
+
export declare const useTitleContext: () => TitleContextValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { IS_DEV } from '../../constants/environment';
|
|
3
|
+
import { TITLE_DEFAULT_SIZE, TITLE_DEFAULT_VARIANT } from './constants';
|
|
4
|
+
export var TitleContext = React.createContext({
|
|
5
|
+
variant: TITLE_DEFAULT_VARIANT,
|
|
6
|
+
size: TITLE_DEFAULT_SIZE,
|
|
7
|
+
});
|
|
8
|
+
export var useTitleContext = function () { return useContext(TitleContext); };
|
|
9
|
+
// Именованный провайдер
|
|
10
|
+
if (IS_DEV) {
|
|
11
|
+
TitleContext.displayName = 'TitleContext';
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './variant';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './variant';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { logger } from '@ozen-ui/logger';
|
|
4
|
+
import { IS_DEV } from '../../../../constants/environment';
|
|
5
|
+
import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
6
|
+
import { titleVariant } from '../../entities';
|
|
7
|
+
import { TitleMain } from './main';
|
|
8
|
+
import { TitleSecondary } from './secondary';
|
|
9
|
+
export var TitleVariant = polymorphicComponentWithRef(function (_a, ref) {
|
|
10
|
+
var variant = _a.variant, as = _a.as, other = __rest(_a, ["variant", "as"]);
|
|
11
|
+
if (variant === 'main') {
|
|
12
|
+
return React.createElement(TitleMain, __assign({}, other, { as: as, ref: ref }));
|
|
13
|
+
}
|
|
14
|
+
if (variant === 'secondary') {
|
|
15
|
+
return React.createElement(TitleSecondary, __assign({}, other, { as: as, ref: ref }));
|
|
16
|
+
}
|
|
17
|
+
if (IS_DEV) {
|
|
18
|
+
logger.error("\u0423 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0430 'Title' \u043D\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0430 '".concat(variant, "'. \u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u044B: [").concat(titleVariant.join(', '), "]'"));
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
.TitleMain {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: var(--space-xs);
|
|
7
|
+
}
|
|
8
|
+
.TitleMain_defaultMargin {
|
|
9
|
+
margin-block: var(--title-main-default-margin-block);
|
|
10
|
+
}
|
|
11
|
+
.TitleMain_defaultMargin .TitleMain-Label {
|
|
12
|
+
block-size: 1em;
|
|
13
|
+
}
|
|
14
|
+
.TitleMain_size_s {
|
|
15
|
+
--title-main-default-margin-block: 12px 16px;
|
|
16
|
+
}
|
|
17
|
+
.TitleMain_size_s .TitleMain-Content {
|
|
18
|
+
font: var(--typography-heading-xl-font);
|
|
19
|
+
letter-spacing: var(--typography-heading-xl-letter_spacing, 0);
|
|
20
|
+
text-transform: var(--typography-heading-xl-text_transform, none);
|
|
21
|
+
}
|
|
22
|
+
.TitleMain_size_m {
|
|
23
|
+
--title-main-default-margin-block: 16px 24px;
|
|
24
|
+
}
|
|
25
|
+
.TitleMain_size_m .TitleMain-Content {
|
|
26
|
+
font: var(--typography-heading-2xl-font);
|
|
27
|
+
letter-spacing: var(--typography-heading-2xl-letter_spacing, 0);
|
|
28
|
+
text-transform: var(--typography-heading-2xl-text_transform, none);
|
|
29
|
+
}
|
|
30
|
+
.TitleMain-ContentContainer {
|
|
31
|
+
color: var(--color-content-tertiary);
|
|
32
|
+
}
|
|
33
|
+
.TitleMain-Content {
|
|
34
|
+
color: var(--color-content-primary);
|
|
35
|
+
}
|
|
36
|
+
.TitleMain-Label {
|
|
37
|
+
cursor: default;
|
|
38
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './TitleMain.css';
|
|
2
|
+
import type { TitleMainBaseProps } from './types';
|
|
3
|
+
export declare const cnTitleMain: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const TitleMain: import("../../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleMainBaseProps, "div">;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './TitleMain.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { cn } from '../../../../../utils/classname';
|
|
5
|
+
import { getIconSizeToFormElement } from '../../../../../utils/getIconSizeToFormElement';
|
|
6
|
+
import { polymorphicComponentWithRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
7
|
+
import { renderContent } from '../../../../../utils/renderContent';
|
|
8
|
+
import { BreadcrumbItem, Breadcrumbs } from '../../../../Breadcrumbs';
|
|
9
|
+
import { Stack } from '../../../../Stack';
|
|
10
|
+
import { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
11
|
+
import { TITLE_MAIN_LABEL_SIZE_MAP } from './config';
|
|
12
|
+
export var cnTitleMain = cn('TitleMain');
|
|
13
|
+
export var TitleMain = polymorphicComponentWithRef(function (_a, ref) {
|
|
14
|
+
var size = _a.size, className = _a.className, _b = _a.as, Tag = _b === void 0 ? TITLE_DEFAULT_TAG : _b, children = _a.children, renderLeft = _a.renderLeft, renderRight = _a.renderRight, label = _a.label, defaultMarginProp = _a.defaultMargin, other = __rest(_a, ["size", "className", "as", "children", "renderLeft", "renderRight", "label", "defaultMargin"]);
|
|
15
|
+
var defaultMargin = defaultMarginProp === undefined ? !!label : defaultMarginProp;
|
|
16
|
+
var renderIcon = function (content) {
|
|
17
|
+
return renderContent({
|
|
18
|
+
content: content,
|
|
19
|
+
props: {
|
|
20
|
+
size: getIconSizeToFormElement(size),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement(Tag, __assign({ className: cnTitleMain({ size: size, defaultMargin: defaultMargin }, [className]) }, other, { ref: ref }),
|
|
25
|
+
(label || defaultMargin) && (React.createElement(Breadcrumbs, { size: TITLE_MAIN_LABEL_SIZE_MAP[size], className: cnTitleMain('LabelContainer') },
|
|
26
|
+
React.createElement(BreadcrumbItem, { as: "span", className: cnTitleMain('Label') }, label))),
|
|
27
|
+
React.createElement(Stack, { gap: "s", align: "center", className: cnTitleMain('ContentContainer') },
|
|
28
|
+
renderIcon(renderLeft),
|
|
29
|
+
React.createElement("span", { className: cnTitleMain('Content') }, children),
|
|
30
|
+
renderIcon(renderRight))));
|
|
31
|
+
});
|
|
32
|
+
TitleMain.displayName = 'TitleMain';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
4
|
+
import type { TitleIcon, TitleSizeVariant } from '../../../entities';
|
|
5
|
+
export type TitleMainBaseProps = {
|
|
6
|
+
size: TitleSizeVariant;
|
|
7
|
+
label?: string;
|
|
8
|
+
renderLeft?: TitleIcon;
|
|
9
|
+
renderRight?: TitleIcon;
|
|
10
|
+
defaultMargin?: boolean;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
};
|
|
13
|
+
export type TitleMainProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleMainBaseProps, As>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
.TitleSecondary {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
color: var(--color-content-secondary);
|
|
5
|
+
}
|
|
6
|
+
.TitleSecondary_size_s {
|
|
7
|
+
--title-secondary-default-margin-block: 24px 12px;
|
|
8
|
+
|
|
9
|
+
font: var(--typography-text-s_1-font);
|
|
10
|
+
|
|
11
|
+
letter-spacing: var(--typography-text-s_1-letter_spacing, 0);
|
|
12
|
+
|
|
13
|
+
text-transform: var(--typography-text-s_1-text_transform, none);
|
|
14
|
+
}
|
|
15
|
+
.TitleSecondary_size_m {
|
|
16
|
+
--title-secondary-default-margin-block: 32px 16px;
|
|
17
|
+
|
|
18
|
+
font: var(--typography-text-m_1-font);
|
|
19
|
+
|
|
20
|
+
letter-spacing: var(--typography-text-m_1-letter_spacing, 0);
|
|
21
|
+
|
|
22
|
+
text-transform: var(--typography-text-m_1-text_transform, none);
|
|
23
|
+
}
|
|
24
|
+
.TitleSecondary_defaultMargin {
|
|
25
|
+
margin-block: var(--title-secondary-default-margin-block);
|
|
26
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import './TitleSecondary.css';
|
|
2
|
+
import type { TitleSecondaryBaseProps } from './types';
|
|
3
|
+
export declare const cnTitleSecondary: import("@bem-react/classname").ClassNameFormatter;
|
|
4
|
+
export declare const TitleSecondary: import("../../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleSecondaryBaseProps, "div">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
|
+
import './TitleSecondary.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { cn } from '../../../../../utils/classname';
|
|
5
|
+
import { polymorphicComponentWithRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
6
|
+
import { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
7
|
+
export var cnTitleSecondary = cn('TitleSecondary');
|
|
8
|
+
export var TitleSecondary = polymorphicComponentWithRef(function (_a, ref) {
|
|
9
|
+
var size = _a.size, className = _a.className, _b = _a.as, Tag = _b === void 0 ? TITLE_DEFAULT_TAG : _b, children = _a.children, defaultMargin = _a.defaultMargin, other = __rest(_a, ["size", "className", "as", "children", "defaultMargin"]);
|
|
10
|
+
return (React.createElement(Tag, __assign({ className: cnTitleSecondary({ size: size, defaultMargin: defaultMargin }, [className]) }, other, { ref: ref }), children));
|
|
11
|
+
});
|
|
12
|
+
TitleSecondary.displayName = 'TitleSecondary';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../../constants';
|
|
4
|
+
import type { TitleSizeVariant } from '../../../entities';
|
|
5
|
+
export type TitleSecondaryBaseProps = {
|
|
6
|
+
size: TitleSizeVariant;
|
|
7
|
+
defaultMargin?: boolean;
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
export type TitleSecondaryProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleSecondaryBaseProps, As>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { TITLE_DEFAULT_TAG } from '../../constants';
|
|
4
|
+
import type { TitleVariantValue } from '../../entities';
|
|
5
|
+
import type { TitleMainBaseProps } from '../variant/main';
|
|
6
|
+
import type { TitleSecondaryBaseProps } from '../variant/secondary';
|
|
7
|
+
export type TitleVariantBaseProps = TitleVariantValue<'main', TitleMainBaseProps> | TitleVariantValue<'secondary', TitleSecondaryBaseProps> | TitleVariantValue<undefined, TitleMainBaseProps>;
|
|
8
|
+
export type TitleVariantProps<As extends ElementType = typeof TITLE_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleVariantBaseProps, As>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var titleSizeVariant = ['s', 'm'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const titleVariant: readonly ["main", "secondary"];
|
|
2
|
+
export type TitleVariant = (typeof titleVariant)[number];
|
|
3
|
+
export type TitleVariantValue<Variant extends TitleVariant | undefined, Value> = (Variant extends undefined ? {
|
|
4
|
+
variant?: undefined;
|
|
5
|
+
} : {
|
|
6
|
+
variant: Variant;
|
|
7
|
+
}) & Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var titleVariant = ['main', 'secondary'];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TitleIconButtonBaseProps } from './types';
|
|
2
|
+
export declare const cnTitleIconButton: import("@bem-react/classname").ClassNameFormatter;
|
|
3
|
+
export declare const TitleIconButton: import("../../../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<TitleIconButtonBaseProps, "button">;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn } from '../../../../utils/classname';
|
|
4
|
+
import { polymorphicComponentWithRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
5
|
+
import { IconButton } from '../../../IconButtonNext';
|
|
6
|
+
import { useTitleContext } from '../../TitleContext';
|
|
7
|
+
import { TITLE_ICON_BUTTON_DEFAULT_TAG } from './constants';
|
|
8
|
+
export var cnTitleIconButton = cn('TitleIconButton');
|
|
9
|
+
export var TitleIconButton = polymorphicComponentWithRef(function (props, ref) {
|
|
10
|
+
var size = useTitleContext().size;
|
|
11
|
+
return (React.createElement(IconButton, __assign({ compressed: true, as: TITLE_ICON_BUTTON_DEFAULT_TAG }, props, { ref: ref, size: size, className: cnTitleIconButton('', [props.className]) })));
|
|
12
|
+
});
|
|
13
|
+
TitleIconButton.displayName = 'TitleIconButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TITLE_ICON_BUTTON_DEFAULT_TAG = "button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var TITLE_ICON_BUTTON_DEFAULT_TAG = 'button';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import type { PolymorphicComponentPropsWithoutRef } from '../../../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { IconButtonBaseProps } from '../../../IconButtonNext';
|
|
4
|
+
import type { TITLE_ICON_BUTTON_DEFAULT_TAG } from './constants';
|
|
5
|
+
export type TitleIconButtonBaseProps = Omit<IconButtonBaseProps, 'size'>;
|
|
6
|
+
export type TitleIconButtonProps<As extends ElementType = typeof TITLE_ICON_BUTTON_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<TitleIconButtonBaseProps, As>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|