burne-ui 0.0.1 → 1.1.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/README.md +46 -3
- package/dist/components/composite/Accordion/Accordion.d.ts +77 -14
- package/dist/components/composite/Accordion/index.d.ts +1 -1
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +4 -7
- package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +1 -21
- package/dist/components/composite/CheckboxGroup/CheckboxGroup.d.ts +42 -33
- package/dist/components/composite/CheckboxGroup/checkboxGroupContext.d.ts +16 -0
- package/dist/components/composite/CheckboxGroup/index.d.ts +2 -1
- package/dist/components/composite/RadioGroup/RadioGroup.d.ts +55 -0
- package/dist/components/composite/RadioGroup/index.d.ts +2 -0
- package/dist/components/composite/RadioGroup/radioGroupContext.d.ts +13 -0
- package/dist/components/composite/ToggleButtonGroup/ToggleButtonGroup.d.ts +33 -0
- package/dist/components/composite/ToggleButtonGroup/index.d.ts +2 -0
- package/dist/components/composite/utils/optionGroupFieldset.d.ts +44 -0
- package/dist/components/core/Alert/Alert.d.ts +49 -11
- package/dist/components/core/Alert/alertContext.d.ts +10 -0
- package/dist/components/core/Alert/alertUtils.d.ts +12 -0
- package/dist/components/core/Alert/index.d.ts +2 -1
- package/dist/components/core/Avatar/Avatar.d.ts +16 -4
- package/dist/components/core/Badge/Badge.d.ts +15 -3
- package/dist/components/core/Badge/index.d.ts +1 -1
- package/dist/components/core/Breadcrumbs/Breadcrumbs.d.ts +34 -15
- package/dist/components/core/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/core/Button/Button.d.ts +2 -1
- package/dist/components/core/Calendar/Calendar.d.ts +79 -0
- package/dist/components/core/Calendar/CalendarInteractiveCell.d.ts +23 -0
- package/dist/components/core/Calendar/index.d.ts +1 -0
- package/dist/components/core/Checkbox/Checkbox.d.ts +55 -20
- package/dist/components/core/Checkbox/checkboxFieldContext.d.ts +41 -0
- package/dist/components/core/Checkbox/index.d.ts +24 -1
- package/dist/components/core/ColorPicker/ColorPicker.d.ts +51 -0
- package/dist/components/core/ColorPicker/ColorSlider.d.ts +73 -0
- package/dist/components/core/ColorPicker/ColorSwatch.d.ts +23 -0
- package/dist/components/core/ColorPicker/colorUtils.d.ts +27 -0
- package/dist/components/core/ColorPicker/index.d.ts +4 -0
- package/dist/components/core/ComboBox/ComboBox.d.ts +23 -0
- package/dist/components/core/ComboBox/ComboBoxField.d.ts +44 -0
- package/dist/components/core/ComboBox/comboBoxContext.d.ts +47 -0
- package/dist/components/core/ComboBox/index.d.ts +14 -0
- package/dist/components/core/Disclosure/Disclosure.d.ts +61 -0
- package/dist/components/core/Disclosure/index.d.ts +1 -0
- package/dist/components/core/Drawer/Drawer.d.ts +50 -0
- package/dist/components/core/Drawer/drawerTypes.d.ts +1 -0
- package/dist/components/core/Drawer/index.d.ts +1 -0
- package/dist/components/core/Drawer/useDrawerHandleDrag.d.ts +8 -0
- package/dist/components/core/Dropdown/Dropdown.d.ts +82 -31
- package/dist/components/core/Dropdown/index.d.ts +1 -1
- package/dist/components/core/Expandable/Expandable.d.ts +53 -4
- package/dist/components/core/Expandable/index.d.ts +1 -1
- package/dist/components/core/Field/Field.d.ts +21 -0
- package/dist/components/core/Field/FieldSet.d.ts +57 -0
- package/dist/components/core/Field/fieldA11y.d.ts +4 -0
- package/dist/components/core/Field/index.d.ts +39 -0
- package/dist/components/core/Input/Input.d.ts +8 -17
- package/dist/components/core/Input/InputField.d.ts +29 -0
- package/dist/components/core/Input/index.d.ts +19 -1
- package/dist/components/core/Input/inputFieldContext.d.ts +16 -0
- package/dist/components/core/Label/Label.d.ts +15 -0
- package/dist/components/core/Label/fieldLabelContext.d.ts +11 -0
- package/dist/components/core/Label/index.d.ts +2 -0
- package/dist/components/core/Link/Link.d.ts +40 -0
- package/dist/components/core/Link/index.d.ts +1 -0
- package/dist/components/core/LiquidGlass/LiquidGlass.d.ts +28 -0
- package/dist/components/core/LiquidGlass/index.d.ts +2 -0
- package/dist/components/core/LiquidGlass/liquidGlassShader.d.ts +2 -0
- package/dist/components/core/LiquidGlass/useLiquidGlass.d.ts +49 -0
- package/dist/components/core/ListBox/ListBox.d.ts +112 -0
- package/dist/components/core/ListBox/index.d.ts +1 -0
- package/dist/components/core/Loading/Loading.d.ts +23 -0
- package/dist/components/core/Loading/index.d.ts +1 -0
- package/dist/components/core/Meter/Meter.d.ts +37 -0
- package/dist/components/core/Meter/MeterField.d.ts +35 -0
- package/dist/components/core/Meter/index.d.ts +22 -0
- package/dist/components/core/Meter/meterFieldContext.d.ts +21 -0
- package/dist/components/core/Pagination/Pagination.d.ts +64 -0
- package/dist/components/core/Pagination/index.d.ts +1 -0
- package/dist/components/core/Popover/Popover.d.ts +92 -0
- package/dist/components/core/Popover/index.d.ts +2 -0
- package/dist/components/core/ProgressBar/ProgressBar.d.ts +41 -0
- package/dist/components/core/ProgressBar/ProgressBarField.d.ts +41 -0
- package/dist/components/core/ProgressBar/index.d.ts +23 -0
- package/dist/components/core/ProgressBar/progressBarFieldContext.d.ts +22 -0
- package/dist/components/core/Radio/Radio.d.ts +54 -0
- package/dist/components/core/Radio/index.d.ts +20 -0
- package/dist/components/core/Radio/radioFieldContext.d.ts +36 -0
- package/dist/components/core/SearchInput/SearchInput.d.ts +16 -7
- package/dist/components/core/SelectionIndicator/SelectionIndicator.d.ts +15 -0
- package/dist/components/core/SelectionIndicator/index.d.ts +3 -0
- package/dist/components/core/SelectionIndicator/selectionIndicatorTokens.d.ts +14 -0
- package/dist/components/core/SelectionIndicator/useSelectionIndicatorAnimation.d.ts +2 -0
- package/dist/components/core/SelectionThumb/SelectionThumb.d.ts +27 -0
- package/dist/components/core/SelectionThumb/index.d.ts +1 -0
- package/dist/components/core/Skeleton/Skeleton.d.ts +51 -0
- package/dist/components/core/Skeleton/index.d.ts +1 -0
- package/dist/components/core/Slider/Slider.d.ts +46 -0
- package/dist/components/core/Slider/SliderField.d.ts +46 -0
- package/dist/components/core/Slider/index.d.ts +17 -0
- package/dist/components/core/Slider/sliderCompound.d.ts +49 -0
- package/dist/components/core/Slider/sliderFieldContext.d.ts +25 -0
- package/dist/components/core/Surface/Surface.d.ts +29 -0
- package/dist/components/core/Surface/index.d.ts +1 -0
- package/dist/components/core/Switch/Switch.d.ts +40 -0
- package/dist/components/core/Switch/SwitchField.d.ts +45 -0
- package/dist/components/core/Switch/index.d.ts +33 -0
- package/dist/components/core/Switch/switchFieldContext.d.ts +23 -0
- package/dist/components/core/Switch/switchGeometry.d.ts +12 -0
- package/dist/components/core/Switch/switchTrack.d.ts +57 -0
- package/dist/components/core/Table/Table.d.ts +85 -0
- package/dist/components/core/Table/index.d.ts +1 -0
- package/dist/components/core/Tabs/Tabs.d.ts +82 -0
- package/dist/components/core/Tabs/index.d.ts +1 -0
- package/dist/components/core/Tabs/tabsContext.d.ts +19 -0
- package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +3 -0
- package/dist/components/core/TextArea/TextArea.d.ts +30 -0
- package/dist/components/core/TextArea/TextAreaField.d.ts +29 -0
- package/dist/components/core/TextArea/index.d.ts +18 -0
- package/dist/components/core/TextArea/textareaFieldContext.d.ts +16 -0
- package/dist/components/core/TextArea/useTextAreaResize.d.ts +5 -0
- package/dist/components/core/TimeField/TimeField.d.ts +97 -0
- package/dist/components/core/TimeField/index.d.ts +1 -0
- package/dist/components/core/Toast/Toast.d.ts +101 -0
- package/dist/components/core/Toast/index.d.ts +2 -0
- package/dist/components/core/Toast/useToast.d.ts +18 -0
- package/dist/components/core/ToggleButton/ToggleButton.d.ts +47 -0
- package/dist/components/core/ToggleButton/index.d.ts +2 -0
- package/dist/components/core/ToggleButton/toggleButtonGroupContext.d.ts +17 -0
- package/dist/components/core/ToggleButton/useToggleButtonFillAnimation.d.ts +3 -0
- package/dist/components/core/Tooltip/Tooltip.d.ts +25 -20
- package/dist/components/core/Tooltip/index.d.ts +1 -1
- package/dist/components/core/Tooltip/tooltipPosition.d.ts +16 -0
- package/dist/components/core/utils/buttonGroupContext.d.ts +9 -0
- package/dist/components/core/utils/componentSize.d.ts +3 -0
- package/dist/components/core/utils/controlSizeLayout.d.ts +26 -0
- package/dist/components/core/utils/dualApiStoryChrome.d.ts +17 -0
- package/dist/components/core/utils/hasCompoundChild.d.ts +3 -0
- package/dist/components/core/utils/hasCompoundChildren.d.ts +3 -0
- package/dist/components/core/utils/hoverInteractiveLift.d.ts +16 -3
- package/dist/components/core/utils/motionTokens.d.ts +4 -0
- package/dist/components/core/utils/optionControlGridLayout.d.ts +15 -0
- package/dist/components/core/utils/optionListItemChildren.d.ts +10 -0
- package/dist/components/core/utils/optionListItemContext.d.ts +15 -0
- package/dist/components/core/utils/optionListItemParts.d.ts +11 -0
- package/dist/components/core/utils/optionListItemStoryLayouts.d.ts +10 -0
- package/dist/components/core/utils/scaleFieldParts.d.ts +33 -0
- package/dist/index.cjs +286 -28
- package/dist/index.d.ts +40 -9
- package/dist/index.js +22051 -7221
- package/dist/tokens/config.d.ts +15 -0
- package/dist/tokens/index.d.ts +1 -1
- package/dist/ui.css +1386 -185
- package/package.json +8 -3
- package/dist/components/core/Selector/Selector.d.ts +0 -48
- package/dist/components/core/Selector/index.d.ts +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PointerEventHandler, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
/** Совпадает с `InputVariant`. */
|
|
4
|
+
export type TextAreaVariant = "default" | "outline";
|
|
5
|
+
export type TextAreaStatus = "default" | "danger" | "success" | "warning";
|
|
6
|
+
export type TextAreaSize = ComponentSize;
|
|
7
|
+
export type TextAreaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & {
|
|
8
|
+
variant?: TextAreaVariant;
|
|
9
|
+
size?: TextAreaSize;
|
|
10
|
+
status?: TextAreaStatus;
|
|
11
|
+
/** Минимальная высота как у `Input` (`rows` только для SSR/fallback). По умолчанию `1`. */
|
|
12
|
+
rows?: number;
|
|
13
|
+
/** Ручка ресайза в правом нижнем углу. По умолчанию `true`. */
|
|
14
|
+
resizable?: boolean;
|
|
15
|
+
/** `className` применяется к оболочке (`data-slot="textarea-shell"`). */
|
|
16
|
+
className?: string;
|
|
17
|
+
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
18
|
+
};
|
|
19
|
+
export declare const TextAreaControl: import('react').ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & {
|
|
20
|
+
variant?: TextAreaVariant;
|
|
21
|
+
size?: TextAreaSize;
|
|
22
|
+
status?: TextAreaStatus;
|
|
23
|
+
/** Минимальная высота как у `Input` (`rows` только для SSR/fallback). По умолчанию `1`. */
|
|
24
|
+
rows?: number;
|
|
25
|
+
/** Ручка ресайза в правом нижнем углу. По умолчанию `true`. */
|
|
26
|
+
resizable?: boolean;
|
|
27
|
+
/** `className` применяется к оболочке (`data-slot="textarea-shell"`). */
|
|
28
|
+
className?: string;
|
|
29
|
+
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
30
|
+
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { TextAreaProps, TextAreaSize, TextAreaStatus } from './TextArea';
|
|
3
|
+
export type TextAreaRootProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
hint?: ReactNode;
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
id?: string;
|
|
9
|
+
isRequired?: boolean;
|
|
10
|
+
status?: TextAreaStatus;
|
|
11
|
+
size?: TextAreaSize;
|
|
12
|
+
};
|
|
13
|
+
export type TextAreaSimpleProps = TextAreaRootProps & TextAreaProps;
|
|
14
|
+
export declare function TextAreaRoot({ children, label, hint, error, className, id: idProp, isRequired, status, size, ...rest }: TextAreaSimpleProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export type TextAreaHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
status?: Exclude<TextAreaStatus, "danger"> | "default";
|
|
18
|
+
};
|
|
19
|
+
export declare function TextAreaHint({ children, status, className, id: idProp, ...rest }: TextAreaHintProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace TextAreaHint {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export type TextAreaErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
export declare function TextAreaError({ children, className, id: idProp, ...rest }: TextAreaErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace TextAreaError {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TextAreaProps, TextAreaSize, TextAreaStatus, TextAreaVariant } from './TextArea';
|
|
2
|
+
import { TextAreaError, TextAreaHint, TextAreaRoot } from './TextAreaField';
|
|
3
|
+
export declare const TextArea: typeof TextAreaRoot & {
|
|
4
|
+
Label: import('../Label').LabelComponent;
|
|
5
|
+
Control: import('react').ForwardRefExoticComponent<Omit<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & {
|
|
6
|
+
variant?: TextAreaVariant;
|
|
7
|
+
size?: TextAreaSize;
|
|
8
|
+
status?: TextAreaStatus;
|
|
9
|
+
rows?: number;
|
|
10
|
+
resizable?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
onPointerDown?: import('react').PointerEventHandler<HTMLDivElement>;
|
|
13
|
+
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
14
|
+
Hint: typeof TextAreaHint;
|
|
15
|
+
Error: typeof TextAreaError;
|
|
16
|
+
};
|
|
17
|
+
export type { TextAreaProps, TextAreaSize, TextAreaStatus, TextAreaVariant };
|
|
18
|
+
export type { TextAreaRootProps, TextAreaHintProps, TextAreaErrorProps, TextAreaSimpleProps, } from './TextAreaField';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TextAreaSize, TextAreaStatus } from './TextArea';
|
|
2
|
+
export type TextAreaFieldContextValue = {
|
|
3
|
+
textareaId: string;
|
|
4
|
+
hintId: string;
|
|
5
|
+
errorId: string;
|
|
6
|
+
labelId: string;
|
|
7
|
+
hintConnected: boolean;
|
|
8
|
+
errorConnected: boolean;
|
|
9
|
+
isRequired: boolean;
|
|
10
|
+
status: TextAreaStatus;
|
|
11
|
+
size: TextAreaSize;
|
|
12
|
+
};
|
|
13
|
+
declare const TextAreaFieldContext: import('react').Context<TextAreaFieldContextValue | null>;
|
|
14
|
+
export declare function useTextAreaFieldContext(): TextAreaFieldContextValue;
|
|
15
|
+
export declare function useOptionalTextAreaFieldContext(): TextAreaFieldContextValue | null;
|
|
16
|
+
export { TextAreaFieldContext };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PointerEvent as ReactPointerEvent, RefObject } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
export declare function useTextAreaResize(shellRef: RefObject<HTMLElement | null>, enabled: boolean, blocked: boolean, size: ComponentSize): {
|
|
4
|
+
onResizePointerDown: (e: ReactPointerEvent<HTMLDivElement>) => void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { HTMLAttributes, PointerEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
export type TimeFieldSize = ComponentSize;
|
|
4
|
+
export type TimeFieldStatus = "default" | "danger" | "success" | "warning";
|
|
5
|
+
/** `segmented` — сегменты в отдельных «ячейках» внутри оболочки. */
|
|
6
|
+
export type TimeFieldVariant = "default" | "outline" | "segmented";
|
|
7
|
+
export type TimeFieldFormat = "HH:mm" | "HH:mm:ss";
|
|
8
|
+
export type TimeFieldControlProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "prefix" | "suffix"> & {
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
format?: TimeFieldFormat;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
size?: TimeFieldSize;
|
|
15
|
+
status?: TimeFieldStatus;
|
|
16
|
+
variant?: TimeFieldVariant;
|
|
17
|
+
/** Оболочка по ширине времени, без растягивания на всю строку. */
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
/** Слот слева внутри оболочки, отделён вертикальной чертой. */
|
|
20
|
+
prefix?: ReactNode;
|
|
21
|
+
/** Слот справа внутри оболочки, отделён вертикальной чертой. */
|
|
22
|
+
suffix?: ReactNode;
|
|
23
|
+
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
24
|
+
};
|
|
25
|
+
export declare const TimeFieldControl: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "prefix" | "onChange" | "suffix"> & {
|
|
26
|
+
value?: string;
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
onValueChange?: (value: string) => void;
|
|
29
|
+
format?: TimeFieldFormat;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
size?: TimeFieldSize;
|
|
32
|
+
status?: TimeFieldStatus;
|
|
33
|
+
variant?: TimeFieldVariant;
|
|
34
|
+
/** Оболочка по ширине времени, без растягивания на всю строку. */
|
|
35
|
+
compact?: boolean;
|
|
36
|
+
/** Слот слева внутри оболочки, отделён вертикальной чертой. */
|
|
37
|
+
prefix?: ReactNode;
|
|
38
|
+
/** Слот справа внутри оболочки, отделён вертикальной чертой. */
|
|
39
|
+
suffix?: ReactNode;
|
|
40
|
+
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
41
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export type TimeFieldRootProps = Omit<HTMLAttributes<HTMLDivElement>, "prefix" | "suffix"> & {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
label?: ReactNode;
|
|
45
|
+
hint?: ReactNode;
|
|
46
|
+
error?: ReactNode;
|
|
47
|
+
id?: string;
|
|
48
|
+
isRequired?: boolean;
|
|
49
|
+
status?: TimeFieldStatus;
|
|
50
|
+
size?: TimeFieldSize;
|
|
51
|
+
variant?: TimeFieldVariant;
|
|
52
|
+
value?: string;
|
|
53
|
+
defaultValue?: string;
|
|
54
|
+
onValueChange?: (value: string) => void;
|
|
55
|
+
format?: TimeFieldFormat;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
compact?: boolean;
|
|
58
|
+
prefix?: ReactNode;
|
|
59
|
+
suffix?: ReactNode;
|
|
60
|
+
};
|
|
61
|
+
export declare function TimeFieldRoot({ children, label, hint, error, className, id: idProp, isRequired, status, size, variant, value, defaultValue, onValueChange, format, disabled, compact, prefix, suffix, ...rest }: TimeFieldRootProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export type TimeFieldHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
63
|
+
children?: ReactNode;
|
|
64
|
+
};
|
|
65
|
+
export type TimeFieldErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
66
|
+
children?: ReactNode;
|
|
67
|
+
};
|
|
68
|
+
export declare function TimeFieldHint({ children, id: idProp, ...rest }: TimeFieldHintProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
export declare namespace TimeFieldHint {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
export declare function TimeFieldError({ children, id: idProp, ...rest }: TimeFieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
73
|
+
export declare namespace TimeFieldError {
|
|
74
|
+
var displayName: string;
|
|
75
|
+
}
|
|
76
|
+
export declare const TimeField: typeof TimeFieldRoot & {
|
|
77
|
+
Label: import('../Label').LabelComponent;
|
|
78
|
+
Control: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "prefix" | "onChange" | "suffix"> & {
|
|
79
|
+
value?: string;
|
|
80
|
+
defaultValue?: string;
|
|
81
|
+
onValueChange?: (value: string) => void;
|
|
82
|
+
format?: TimeFieldFormat;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
size?: TimeFieldSize;
|
|
85
|
+
status?: TimeFieldStatus;
|
|
86
|
+
variant?: TimeFieldVariant;
|
|
87
|
+
/** Оболочка по ширине времени, без растягивания на всю строку. */
|
|
88
|
+
compact?: boolean;
|
|
89
|
+
/** Слот слева внутри оболочки, отделён вертикальной чертой. */
|
|
90
|
+
prefix?: ReactNode;
|
|
91
|
+
/** Слот справа внутри оболочки, отделён вертикальной чертой. */
|
|
92
|
+
suffix?: ReactNode;
|
|
93
|
+
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
94
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
95
|
+
Hint: typeof TimeFieldHint;
|
|
96
|
+
Error: typeof TimeFieldError;
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TimeField, TimeFieldControl, TimeFieldHint, TimeFieldError, TimeFieldRoot, type TimeFieldRootProps, type TimeFieldControlProps, type TimeFieldHintProps, type TimeFieldErrorProps, type TimeFieldSize, type TimeFieldStatus, type TimeFieldVariant, type TimeFieldFormat, } from './TimeField';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ToastStatus = "default" | "success" | "danger" | "info" | "warning";
|
|
3
|
+
export type ToastPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
|
+
export type AddToastOpts = {
|
|
5
|
+
status?: ToastStatus;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
action?: ReactNode;
|
|
9
|
+
/** Таймаут в мс. 0 = без автозакрытия. По умолчанию 4000. */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
placement?: ToastPlacement;
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Показывает `Loading` вместо иконки статуса. */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type PromiseToastOpts<T> = {
|
|
17
|
+
loading?: ReactNode;
|
|
18
|
+
success: ReactNode | ((value: T) => ReactNode);
|
|
19
|
+
error?: ReactNode | ((err: unknown) => ReactNode);
|
|
20
|
+
placement?: ToastPlacement;
|
|
21
|
+
timeout?: number;
|
|
22
|
+
};
|
|
23
|
+
type ToastEntry = {
|
|
24
|
+
id: string;
|
|
25
|
+
status: ToastStatus;
|
|
26
|
+
title?: ReactNode;
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
action?: ReactNode;
|
|
29
|
+
timeout: number;
|
|
30
|
+
placement: ToastPlacement;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
isLoading: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type ToastContextValue = {
|
|
35
|
+
add: (opts: AddToastOpts) => string;
|
|
36
|
+
update: (id: string, patch: Partial<Omit<ToastEntry, "id" | "createdAt">>) => void;
|
|
37
|
+
dismiss: (id: string) => void;
|
|
38
|
+
};
|
|
39
|
+
export declare const ToastContext: import('react').Context<ToastContextValue | null>;
|
|
40
|
+
export declare function useToastContext(): ToastContextValue;
|
|
41
|
+
export type ToastProviderProps = {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
/** Плейсмент по умолчанию. */
|
|
44
|
+
defaultPlacement?: ToastPlacement;
|
|
45
|
+
};
|
|
46
|
+
export type ToastRootProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
47
|
+
status?: ToastStatus;
|
|
48
|
+
title?: ReactNode;
|
|
49
|
+
description?: ReactNode;
|
|
50
|
+
action?: ReactNode;
|
|
51
|
+
isLoading?: boolean;
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
};
|
|
54
|
+
export type ToastIndicatorProps = HTMLAttributes<HTMLSpanElement>;
|
|
55
|
+
export type ToastContentProps = HTMLAttributes<HTMLDivElement>;
|
|
56
|
+
export type ToastTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
57
|
+
export type ToastDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
58
|
+
export type ToastActionButtonProps = HTMLAttributes<HTMLDivElement>;
|
|
59
|
+
export type ToastCloseButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
60
|
+
"aria-label"?: string;
|
|
61
|
+
};
|
|
62
|
+
declare function ToastIndicator({ className, children, ...rest }: ToastIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
63
|
+
declare namespace ToastIndicator {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
66
|
+
declare function ToastContent({ className, ...rest }: ToastContentProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
declare namespace ToastContent {
|
|
68
|
+
var displayName: string;
|
|
69
|
+
}
|
|
70
|
+
declare function ToastTitle({ className, id: idProp, ...rest }: ToastTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
declare namespace ToastTitle {
|
|
72
|
+
var displayName: string;
|
|
73
|
+
}
|
|
74
|
+
declare function ToastDescription({ className, id: idProp, ...rest }: ToastDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
declare namespace ToastDescription {
|
|
76
|
+
var displayName: string;
|
|
77
|
+
}
|
|
78
|
+
declare function ToastActionButton({ className, ...rest }: ToastActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare namespace ToastActionButton {
|
|
80
|
+
var displayName: string;
|
|
81
|
+
}
|
|
82
|
+
declare function ToastProviderRoot({ children, defaultPlacement, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare const Toast: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
84
|
+
status?: ToastStatus;
|
|
85
|
+
title?: ReactNode;
|
|
86
|
+
description?: ReactNode;
|
|
87
|
+
action?: ReactNode;
|
|
88
|
+
isLoading?: boolean;
|
|
89
|
+
onClose?: () => void;
|
|
90
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
91
|
+
Provider: typeof ToastProviderRoot;
|
|
92
|
+
Indicator: typeof ToastIndicator;
|
|
93
|
+
Content: typeof ToastContent;
|
|
94
|
+
Title: typeof ToastTitle;
|
|
95
|
+
Description: typeof ToastDescription;
|
|
96
|
+
ActionButton: typeof ToastActionButton;
|
|
97
|
+
CloseButton: import('react').ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
98
|
+
"aria-label"?: string;
|
|
99
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Toast, ToastContext, useToastContext, type ToastStatus, type ToastPlacement, type ToastProviderProps, type ToastRootProps, type ToastIndicatorProps, type ToastContentProps, type ToastTitleProps, type ToastDescriptionProps, type ToastActionButtonProps, type ToastCloseButtonProps, type AddToastOpts, type PromiseToastOpts, type ToastContextValue, } from './Toast';
|
|
2
|
+
export { useToast } from './useToast';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AddToastOpts, PromiseToastOpts } from './Toast';
|
|
2
|
+
type ToastAPI = {
|
|
3
|
+
/** Показать тост с произвольными параметрами. Возвращает ID. */
|
|
4
|
+
show: (opts: AddToastOpts) => string;
|
|
5
|
+
/** Удобные методы по статусу. */
|
|
6
|
+
success: (title: string, opts?: Omit<AddToastOpts, "status" | "title">) => string;
|
|
7
|
+
danger: (title: string, opts?: Omit<AddToastOpts, "status" | "title">) => string;
|
|
8
|
+
info: (title: string, opts?: Omit<AddToastOpts, "status" | "title">) => string;
|
|
9
|
+
warning: (title: string, opts?: Omit<AddToastOpts, "status" | "title">) => string;
|
|
10
|
+
/** Тост с состоянием промиса: loading → success / error. */
|
|
11
|
+
promise: <T>(p: Promise<T>, opts: PromiseToastOpts<T>) => string;
|
|
12
|
+
/** Закрыть тост по ID. */
|
|
13
|
+
dismiss: (id: string) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function useToast(): {
|
|
16
|
+
toast: ToastAPI;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
import { ButtonGroupSegment } from '../utils/buttonGroupSegment';
|
|
4
|
+
export type ToggleButtonSize = ComponentSize;
|
|
5
|
+
export type ToggleButtonVariant = "default" | "outline" | "ghost";
|
|
6
|
+
export type ToggleButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-pressed" | "aria-checked" | "role" | "value"> & {
|
|
7
|
+
/** Идентификатор внутри `ToggleButtonGroup`. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Склейка с соседями в `ToggleButtonGroup` (без `separated`). */
|
|
10
|
+
groupSegment?: ButtonGroupSegment;
|
|
11
|
+
/** Контролируемое состояние «нажато» (вне группы или override). */
|
|
12
|
+
pressed?: boolean;
|
|
13
|
+
/** Начальное состояние (неконтролируемый режим). */
|
|
14
|
+
defaultPressed?: boolean;
|
|
15
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
16
|
+
/** Поверхность в покое. По умолчанию `outline`. */
|
|
17
|
+
variant?: ToggleButtonVariant;
|
|
18
|
+
/** Габариты по высоте как у `Button`, без `min-w-button-*`. */
|
|
19
|
+
size?: ToggleButtonSize;
|
|
20
|
+
/** Иконка слева от подписи. */
|
|
21
|
+
leftIcon?: ReactNode;
|
|
22
|
+
/** Иконка справа от подписи. */
|
|
23
|
+
rightIcon?: ReactNode;
|
|
24
|
+
/** Включить hover-lift и squeeze при нажатии. По умолчанию `true`. */
|
|
25
|
+
animated?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export declare const ToggleButton: import('react').ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "role" | "aria-checked" | "aria-pressed" | "value"> & {
|
|
28
|
+
/** Идентификатор внутри `ToggleButtonGroup`. */
|
|
29
|
+
value?: string;
|
|
30
|
+
/** Склейка с соседями в `ToggleButtonGroup` (без `separated`). */
|
|
31
|
+
groupSegment?: ButtonGroupSegment;
|
|
32
|
+
/** Контролируемое состояние «нажато» (вне группы или override). */
|
|
33
|
+
pressed?: boolean;
|
|
34
|
+
/** Начальное состояние (неконтролируемый режим). */
|
|
35
|
+
defaultPressed?: boolean;
|
|
36
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
37
|
+
/** Поверхность в покое. По умолчанию `outline`. */
|
|
38
|
+
variant?: ToggleButtonVariant;
|
|
39
|
+
/** Габариты по высоте как у `Button`, без `min-w-button-*`. */
|
|
40
|
+
size?: ToggleButtonSize;
|
|
41
|
+
/** Иконка слева от подписи. */
|
|
42
|
+
leftIcon?: ReactNode;
|
|
43
|
+
/** Иконка справа от подписи. */
|
|
44
|
+
rightIcon?: ReactNode;
|
|
45
|
+
/** Включить hover-lift и squeeze при нажатии. По умолчанию `true`. */
|
|
46
|
+
animated?: boolean;
|
|
47
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ToggleButton, type ToggleButtonProps, type ToggleButtonSize, type ToggleButtonVariant } from './ToggleButton';
|
|
2
|
+
export { useToggleButtonGroupContext, useOptionalToggleButtonGroupContext, type ToggleButtonGroupType, type ToggleButtonGroupOrientation, type ToggleButtonGroupContextValue, } from './toggleButtonGroupContext';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ToggleButtonSize, ToggleButtonVariant } from './ToggleButton';
|
|
2
|
+
export type ToggleButtonGroupType = "multiple" | "single";
|
|
3
|
+
export type ToggleButtonGroupOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type ToggleButtonGroupContextValue = {
|
|
5
|
+
type: ToggleButtonGroupType;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
size: ToggleButtonSize;
|
|
8
|
+
variant: ToggleButtonVariant;
|
|
9
|
+
isSelected: (value: string) => boolean;
|
|
10
|
+
select: (value: string) => void;
|
|
11
|
+
/** Roving tabindex для `type="single"`. */
|
|
12
|
+
tabIndexFor: (value: string) => 0 | -1 | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const ToggleButtonGroupContext: import('react').Context<ToggleButtonGroupContextValue | null>;
|
|
15
|
+
export declare function useOptionalToggleButtonGroupContext(): ToggleButtonGroupContextValue | null;
|
|
16
|
+
export declare function useToggleButtonGroupContext(): ToggleButtonGroupContextValue;
|
|
17
|
+
export { ToggleButtonGroupContext };
|
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { AlertStatus } from '../Alert';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { TooltipSide } from './tooltipPosition';
|
|
4
|
+
export type { TooltipSide };
|
|
3
5
|
/** Варианты заливки — как у `Alert`; `outline` → утилита `surface-outline`. */
|
|
4
6
|
export type TooltipVariant = AlertStatus;
|
|
5
|
-
export type TooltipSize = "small" | "base" | "large";
|
|
6
|
-
/** Сторона триггера, с которой показывается подсказка. */
|
|
7
|
-
export type TooltipSide = "top" | "bottom";
|
|
7
|
+
export type TooltipSize = "small" | "base" | "mid" | "large";
|
|
8
8
|
export type TooltipRootProps = {
|
|
9
9
|
children?: ReactNode;
|
|
10
|
-
/** Размер отступов и типографики. По умолчанию `small`. */
|
|
11
10
|
size?: TooltipSize;
|
|
12
|
-
/** Семантика фона как у Alert. По умолчанию `default`. */
|
|
13
11
|
variant?: TooltipVariant;
|
|
14
|
-
/** Задержка перед показом, мс. */
|
|
15
12
|
delayShowMs?: number;
|
|
16
|
-
/**
|
|
13
|
+
/** Предпочтительная сторона. При нехватке места — flip. По умолчанию `top`. */
|
|
17
14
|
side?: TooltipSide;
|
|
18
|
-
/**
|
|
19
|
-
* Иконка слева от текста. Для вариантов `warning`, `danger`, `success`, `info` при отсутствии
|
|
20
|
-
* `icon` используется иконка статуса из `semanticStatusIcons`.
|
|
21
|
-
*/
|
|
22
15
|
icon?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Показать иконку слева. Для semantic-вариантов по умолчанию `true`, для `default` / `outline` — `false`.
|
|
25
|
-
* Явный `false` скрывает и кастомную `icon`, и семантическую.
|
|
26
|
-
*/
|
|
27
16
|
showIcon?: boolean;
|
|
28
17
|
};
|
|
29
18
|
export type TooltipTriggerProps = HTMLAttributes<HTMLSpanElement>;
|
|
30
|
-
export type TooltipContentProps = HTMLAttributes<HTMLDivElement
|
|
19
|
+
export type TooltipContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
/** Показать стрелку к триггеру. Можно передать свой `<Tooltip.Arrow />` в children. */
|
|
21
|
+
showArrow?: boolean;
|
|
22
|
+
/** Зазор между триггером и тултипом (px). По умолчанию `8`. */
|
|
23
|
+
offset?: number;
|
|
24
|
+
};
|
|
25
|
+
export type TooltipArrowProps = HTMLAttributes<HTMLSpanElement>;
|
|
31
26
|
declare function TooltipRoot({ children, size, variant, delayShowMs, side, icon, showIcon, }: TooltipRootProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
declare
|
|
33
|
-
|
|
27
|
+
declare namespace TooltipRoot {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
declare function TooltipArrow({ className, ...rest }: TooltipArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare namespace TooltipArrow {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
34
34
|
export declare const Tooltip: typeof TooltipRoot & {
|
|
35
35
|
Trigger: import('react').ForwardRefExoticComponent<TooltipTriggerProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
36
|
-
Content:
|
|
36
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
37
|
+
/** Показать стрелку к триггеру. Можно передать свой `<Tooltip.Arrow />` в children. */
|
|
38
|
+
showArrow?: boolean;
|
|
39
|
+
/** Зазор между триггером и тултипом (px). По умолчанию `8`. */
|
|
40
|
+
offset?: number;
|
|
41
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
42
|
+
Arrow: typeof TooltipArrow;
|
|
37
43
|
};
|
|
38
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Tooltip, type TooltipVariant, type TooltipSize, type TooltipSide, type TooltipRootProps, type TooltipTriggerProps, type TooltipContentProps, } from './Tooltip';
|
|
1
|
+
export { Tooltip, type TooltipVariant, type TooltipSize, type TooltipSide, type TooltipRootProps, type TooltipTriggerProps, type TooltipContentProps, type TooltipArrowProps, } from './Tooltip';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
2
|
+
/** Выравнивание плавающей панели вдоль оси, перпендикулярной `side`. */
|
|
3
|
+
export type FloatingAlign = "start" | "center" | "end";
|
|
4
|
+
export type TooltipPlacement = {
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
resolvedSide: TooltipSide;
|
|
8
|
+
};
|
|
9
|
+
export type TooltipPlacementOptions = {
|
|
10
|
+
align?: FloatingAlign;
|
|
11
|
+
};
|
|
12
|
+
/** Позиционирует тултип относительно триггера с flip при нехватке места. */
|
|
13
|
+
export declare function computeTooltipPlacement(triggerRect: DOMRect, floatingRect: DOMRect, preferredSide: TooltipSide, offset: number, options?: TooltipPlacementOptions): TooltipPlacement;
|
|
14
|
+
export declare const TOOLTIP_ARROW_CLASS: Record<TooltipSide, string>;
|
|
15
|
+
/** Отступ оболочки под половину стрелки (size-2 → 4px) для позиционирования и overflow. */
|
|
16
|
+
export declare const TOOLTIP_ARROW_SHELL_PAD: Record<TooltipSide, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonSize } from '../Button';
|
|
2
|
+
import { ButtonGroupSegment } from './buttonGroupSegment';
|
|
3
|
+
export type ButtonGroupSegmentContextValue = {
|
|
4
|
+
segment: ButtonGroupSegment;
|
|
5
|
+
buttonSize: ButtonSize;
|
|
6
|
+
};
|
|
7
|
+
declare const ButtonGroupSegmentContext: import('react').Context<ButtonGroupSegmentContextValue | null>;
|
|
8
|
+
export declare function useOptionalButtonGroupSegment(): ButtonGroupSegmentContextValue | null;
|
|
9
|
+
export { ButtonGroupSegmentContext };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TextVariant } from '../Text';
|
|
2
|
+
import { ComponentSize } from './componentSize';
|
|
3
|
+
export type ControlSizeLayout = {
|
|
4
|
+
/** Фиксированная высота контрола (совпадает с `--control-height-*`). */
|
|
5
|
+
h: string;
|
|
6
|
+
minWButton: string;
|
|
7
|
+
padX: string;
|
|
8
|
+
affixPadX: string;
|
|
9
|
+
affixText: string;
|
|
10
|
+
controlPad: string;
|
|
11
|
+
controlText: TextVariant;
|
|
12
|
+
icon: string;
|
|
13
|
+
chevronIcon: string;
|
|
14
|
+
spinnerIcon: string;
|
|
15
|
+
spinnerBorder: string;
|
|
16
|
+
toggleBox: string;
|
|
17
|
+
toggleIcon: string;
|
|
18
|
+
togglePad: string;
|
|
19
|
+
/** Множитель `--size` для SSR-fallback (SearchInput и т.п.). */
|
|
20
|
+
heightScale: number;
|
|
21
|
+
defaultExpandedSearchWidth: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const CONTROL_SIZE_LAYOUT: Record<ComponentSize, ControlSizeLayout>;
|
|
24
|
+
export declare function controlShellClass(size: ComponentSize, minWButton: string): string;
|
|
25
|
+
/** Высота контрола в px — читает `--control-height-*` с `:root`. */
|
|
26
|
+
export declare function readControlHeightPx(size: ComponentSize, rootPx?: number): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Обёртка для сторис: два варианта API в одной story, JSX компонента остаётся в `.stories.tsx`. */
|
|
3
|
+
export declare function DualApiStoryPanels({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function DualApiStoryPanel({ title, children, }: {
|
|
7
|
+
title: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/** Параметры docs: показывать исходник `render`, а не сгенерированный JSX из args. */
|
|
11
|
+
export declare const dualApiStorySource: {
|
|
12
|
+
docs: {
|
|
13
|
+
source: {
|
|
14
|
+
type: "code";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -32,20 +32,33 @@ export declare const INTERACTIVE_HOVER_LIFT_EASE: "out(2)";
|
|
|
32
32
|
/** @deprecated Используйте `MOTION_HOVER_LIFT_SCALE` */
|
|
33
33
|
export declare const INTERACTIVE_HOVER_LIFT_SCALE = 1.015;
|
|
34
34
|
export declare function prefersReducedInteractiveHoverLift(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Возвращает scale < 1 для squeeze, адаптированный под фактический размер элемента.
|
|
37
|
+
* Все компоненты автоматически используют его через `animateInteractivePressSqueeze`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function adaptiveSqueezeScale(element: HTMLElement): number;
|
|
40
|
+
/**
|
|
41
|
+
* Возвращает scale > 1 для hover-lift, адаптированный под фактический размер элемента.
|
|
42
|
+
* Передайте явный `liftScale`, чтобы переопределить (напр. Badge.Anchor).
|
|
43
|
+
*/
|
|
44
|
+
export declare function adaptiveHoverLiftScale(element: HTMLElement): number;
|
|
35
45
|
/**
|
|
36
46
|
* `remove(target)` затем плавное масштабирование только по scale (без смещения).
|
|
37
|
-
*
|
|
47
|
+
* Если `liftScale` не передан — вычисляется адаптивно по размеру элемента.
|
|
38
48
|
* Опционально: `shadow` — конфиг для плавного изменения `box-shadow` вместе со scale.
|
|
39
49
|
*/
|
|
40
50
|
export declare function animateInteractiveHoverLift(element: HTMLElement, lifted: boolean, liftScale?: number, shadow?: HoverShadowConfig): void;
|
|
41
51
|
/**
|
|
42
|
-
* Короткий «сжимающий» импульс при pointer down
|
|
52
|
+
* Короткий «сжимающий» импульс при pointer down.
|
|
53
|
+
* Степень сжатия автоматически адаптируется к размеру элемента:
|
|
54
|
+
* маленькие элементы сжимаются на ~2%, большие — меньше,
|
|
55
|
+
* сохраняя одинаковое абсолютное ощущение во всех компонентах.
|
|
43
56
|
* Возвращает промис окончания анимации.
|
|
44
57
|
*/
|
|
45
58
|
export declare function animateInteractivePressSqueeze(element: HTMLElement): import('animejs').JSAnimation;
|
|
46
59
|
/** Возвращённые обработчики вешайте на тот же корень, где был бы `pointer` у Button (`currentTarget`). */
|
|
47
60
|
export declare function useInteractiveHoverLiftContainerHandlers<Element extends HTMLElement = HTMLElement>(liftedRef: RefObject<HTMLElement | null>, enabled: boolean, pointerInsideRef?: MutableRefObject<boolean>,
|
|
48
|
-
/**
|
|
61
|
+
/** Явный scale подъёма; `undefined` (дефолт) — адаптивный по размеру элемента. */
|
|
49
62
|
liftScale?: number, shadow?: HoverShadowConfig): {
|
|
50
63
|
onPointerOver: (e: ReactPointerEvent<Element>) => void;
|
|
51
64
|
onPointerOut: (e: ReactPointerEvent<Element>) => void;
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const MOTION_INTERACTIVE_MS = 280;
|
|
5
5
|
export declare const MOTION_INTERACTIVE_EASE: "out(2)";
|
|
6
|
+
export declare const MOTION_COLOR_CHANGE_MS = 200;
|
|
7
|
+
/** Лёгкий overshoot кружка Switch при переключении. */
|
|
8
|
+
export declare const MOTION_SWITCH_THUMB_MS = 340;
|
|
9
|
+
export declare const MOTION_SWITCH_THUMB_EASE: import('animejs').Spring;
|
|
6
10
|
/** Fade появление / скрытие Tooltip (portal). */
|
|
7
11
|
export declare const MOTION_TOOLTIP_MS = 200;
|
|
8
12
|
export declare const MOTION_HOVER_LIFT_SCALE = 1.015;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type OptionControlLabelSide = "left" | "right";
|
|
2
|
+
/** Строки grid: label в row 1, hint/error — row 2 (+ row 3 при hint и error). */
|
|
3
|
+
export declare function optionControlSecondaryLineCount(hasHint: boolean, hasError: boolean): number;
|
|
4
|
+
export declare function optionControlGridClass(secondaryLines: number, gapX: string, labelSide?: OptionControlLabelSide, extra?: string): string;
|
|
5
|
+
export declare function optionControlCellClass(labelSide?: OptionControlLabelSide): string;
|
|
6
|
+
export declare function optionLabelCellClass(labelSide?: OptionControlLabelSide): string;
|
|
7
|
+
/** row: 2 — hint или единственная secondary; 3 — error при наличии hint. */
|
|
8
|
+
export declare function optionSecondaryCellClass(row: 2 | 3, labelSide?: OptionControlLabelSide): string;
|
|
9
|
+
export declare function optionErrorRow(hasHint: boolean): 2 | 3;
|
|
10
|
+
/** Grid для пункта Dropdown / ListBox: indicator | label+hint | icon (icon только row 1). */
|
|
11
|
+
export declare function optionListItemGridClass(hasHint: boolean, gapX: string, hasIndicator: boolean, hasIcon: boolean): string;
|
|
12
|
+
export declare function optionListItemIndicatorCellClass(): string;
|
|
13
|
+
export declare function optionListItemLabelCellClass(hasIndicator: boolean): string;
|
|
14
|
+
export declare function optionListItemHintCellClass(hasIndicator: boolean): string;
|
|
15
|
+
export declare function optionListItemIconCellClass(hasIndicator: boolean): string;
|