burne-ui 0.0.2 → 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 +2 -1
- package/dist/components/core/Selector/Selector.d.ts +0 -48
- package/dist/components/core/Selector/index.d.ts +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FieldsetHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type FieldLegendProps = HTMLAttributes<HTMLLegendElement> & {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare const FieldLegend: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLegendElement> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
} & import('react').RefAttributes<HTMLLegendElement>>;
|
|
8
|
+
export type FieldLegendHeaderProps = HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/** Обёртка для подписи и подсказки внутри `FieldLegend`. */
|
|
12
|
+
export declare function FieldLegendHeader({ children, className, ...rest }: FieldLegendHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export type FieldSetGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/** Основной контент fieldset: поля, списки опций, групповые ошибки. */
|
|
17
|
+
export declare const FieldSetGroup: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export type FieldSetActionsProps = HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/** Кнопки и действия fieldset (submit, reset и т.д.). */
|
|
24
|
+
export declare const FieldSetActions: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export type FieldSetProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
/** id подсказки для `aria-describedby`. */
|
|
30
|
+
hintId?: string;
|
|
31
|
+
/** id ошибки для `aria-describedby`. */
|
|
32
|
+
errorId?: string;
|
|
33
|
+
isRequired?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare const FieldSet: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & {
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/** id подсказки для `aria-describedby`. */
|
|
38
|
+
hintId?: string;
|
|
39
|
+
/** id ошибки для `aria-describedby`. */
|
|
40
|
+
errorId?: string;
|
|
41
|
+
isRequired?: boolean;
|
|
42
|
+
} & import('react').RefAttributes<HTMLFieldSetElement>> & {
|
|
43
|
+
Legend: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLegendElement> & {
|
|
44
|
+
children?: ReactNode;
|
|
45
|
+
} & import('react').RefAttributes<HTMLLegendElement>>;
|
|
46
|
+
LegendHeader: typeof FieldLegendHeader;
|
|
47
|
+
Group: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
50
|
+
Actions: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
53
|
+
};
|
|
54
|
+
/** Стабильный id подсказки для fieldset (или переданный явно). */
|
|
55
|
+
export declare function useFieldSetHintId(providedId?: string): string;
|
|
56
|
+
/** Стабильный id ошибки для fieldset (или переданный явно). */
|
|
57
|
+
export declare function useFieldSetErrorId(providedId?: string): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Объединяет id для `aria-describedby` (hint, error, …). */
|
|
2
|
+
export declare function joinFieldDescribedBy(...ids: (string | undefined)[]): string | undefined;
|
|
3
|
+
export declare function fieldHintId(baseId: string): string;
|
|
4
|
+
export declare function fieldErrorId(baseId: string): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FieldError, FieldHint, FieldLabel, FieldRoot } from './Field';
|
|
2
|
+
import { FieldLegend, FieldLegendHeader, FieldSet, FieldSetActions, FieldSetGroup, useFieldSetErrorId, useFieldSetHintId } from './FieldSet';
|
|
3
|
+
import { fieldErrorId, fieldHintId, joinFieldDescribedBy } from './fieldA11y';
|
|
4
|
+
export declare const Field: typeof FieldRoot & {
|
|
5
|
+
Root: typeof FieldRoot;
|
|
6
|
+
Hint: typeof FieldHint;
|
|
7
|
+
Label: import('../Label').LabelComponent;
|
|
8
|
+
Error: typeof FieldError;
|
|
9
|
+
Set: import('react').ForwardRefExoticComponent<Omit<import('react').FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & {
|
|
10
|
+
children?: import('react').ReactNode;
|
|
11
|
+
hintId?: string;
|
|
12
|
+
errorId?: string;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
} & import('react').RefAttributes<HTMLFieldSetElement>> & {
|
|
15
|
+
Legend: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLegendElement> & {
|
|
16
|
+
children?: import('react').ReactNode;
|
|
17
|
+
} & import('react').RefAttributes<HTMLLegendElement>>;
|
|
18
|
+
LegendHeader: typeof FieldLegendHeader;
|
|
19
|
+
Group: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
children?: import('react').ReactNode;
|
|
21
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
Actions: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
23
|
+
children?: import('react').ReactNode;
|
|
24
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
25
|
+
};
|
|
26
|
+
Legend: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLegendElement> & {
|
|
27
|
+
children?: import('react').ReactNode;
|
|
28
|
+
} & import('react').RefAttributes<HTMLLegendElement>>;
|
|
29
|
+
LegendHeader: typeof FieldLegendHeader;
|
|
30
|
+
Group: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
children?: import('react').ReactNode;
|
|
32
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
33
|
+
Actions: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
34
|
+
children?: import('react').ReactNode;
|
|
35
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
+
};
|
|
37
|
+
export { FieldRoot, FieldHint, FieldLabel, FieldError, FieldSet, FieldSetGroup, FieldSetActions, FieldLegend, FieldLegendHeader, useFieldSetHintId, useFieldSetErrorId, joinFieldDescribedBy, fieldHintId, fieldErrorId, };
|
|
38
|
+
export type { FieldRootProps, FieldHintProps, FieldHintStatus, FieldLabelProps, FieldErrorProps, } from './Field';
|
|
39
|
+
export type { FieldSetProps, FieldSetGroupProps, FieldSetActionsProps, FieldLegendProps, FieldLegendHeaderProps, } from './FieldSet';
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { InputHTMLAttributes, PointerEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { ButtonGroupSegment } from '../utils/buttonGroupSegment';
|
|
3
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
4
|
export type InputVariant = "default" | "outline";
|
|
4
5
|
/** Валидация / обратная связь: бордер оболочки и цвет примечания. */
|
|
5
6
|
export type InputStatus = "default" | "danger" | "success" | "warning";
|
|
6
|
-
/** Совпадает с размерами `Button`
|
|
7
|
-
export type InputSize =
|
|
7
|
+
/** Совпадает с размерами `Button`: `small` · `base` · `mid` · `large`. */
|
|
8
|
+
export type InputSize = ComponentSize;
|
|
8
9
|
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "prefix" | "onPointerDown"> & {
|
|
9
10
|
/** Визуал заливки. */
|
|
10
11
|
variant?: InputVariant;
|
|
11
12
|
/**
|
|
12
|
-
* Высота и отступы поля — как у `Button` того же размера. По умолчанию `base
|
|
13
|
+
* Высота и отступы поля — как у `Button` того же размера. По умолчанию `base`.
|
|
14
|
+
* `className` применяется к оболочке поля (`data-slot="input-shell"`).
|
|
13
15
|
*/
|
|
14
16
|
size?: InputSize;
|
|
15
17
|
/**
|
|
@@ -19,12 +21,6 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "t
|
|
|
19
21
|
groupSegment?: ButtonGroupSegment;
|
|
20
22
|
/** Состояние поля */
|
|
21
23
|
status?: InputStatus;
|
|
22
|
-
/** Подпись над полем. */
|
|
23
|
-
label?: string;
|
|
24
|
-
/** Красная звездочка справа от подписи. */
|
|
25
|
-
isRequired?: boolean;
|
|
26
|
-
/** Примечание под полем (опционально). */
|
|
27
|
-
hint?: string;
|
|
28
24
|
/** Тип значения: текст, число, пароль или файл (с превью для изображений). */
|
|
29
25
|
inputType?: "text" | "number" | "password" | "file";
|
|
30
26
|
/** Слот слева внутри оболочки, отделён вертикальной чертой. */
|
|
@@ -37,11 +33,12 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "t
|
|
|
37
33
|
*/
|
|
38
34
|
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
|
39
35
|
};
|
|
40
|
-
export declare const
|
|
36
|
+
export declare const InputControl: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "onPointerDown" | "type"> & {
|
|
41
37
|
/** Визуал заливки. */
|
|
42
38
|
variant?: InputVariant;
|
|
43
39
|
/**
|
|
44
|
-
* Высота и отступы поля — как у `Button` того же размера. По умолчанию `base
|
|
40
|
+
* Высота и отступы поля — как у `Button` того же размера. По умолчанию `base`.
|
|
41
|
+
* `className` применяется к оболочке поля (`data-slot="input-shell"`).
|
|
45
42
|
*/
|
|
46
43
|
size?: InputSize;
|
|
47
44
|
/**
|
|
@@ -51,12 +48,6 @@ export declare const Input: import('react').ForwardRefExoticComponent<Omit<Input
|
|
|
51
48
|
groupSegment?: ButtonGroupSegment;
|
|
52
49
|
/** Состояние поля */
|
|
53
50
|
status?: InputStatus;
|
|
54
|
-
/** Подпись над полем. */
|
|
55
|
-
label?: string;
|
|
56
|
-
/** Красная звездочка справа от подписи. */
|
|
57
|
-
isRequired?: boolean;
|
|
58
|
-
/** Примечание под полем (опционально). */
|
|
59
|
-
hint?: string;
|
|
60
51
|
/** Тип значения: текст, число, пароль или файл (с превью для изображений). */
|
|
61
52
|
inputType?: "text" | "number" | "password" | "file";
|
|
62
53
|
/** Слот слева внутри оболочки, отделён вертикальной чертой. */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { InputProps, InputSize, InputStatus } from './Input';
|
|
3
|
+
export type InputRootProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
hint?: ReactNode;
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
id?: string;
|
|
9
|
+
isRequired?: boolean;
|
|
10
|
+
status?: InputStatus;
|
|
11
|
+
size?: InputSize;
|
|
12
|
+
};
|
|
13
|
+
export type InputSimpleProps = InputRootProps & InputProps;
|
|
14
|
+
export declare function InputRoot({ children, label, hint, error, className, id: idProp, isRequired, status, size, ...rest }: InputSimpleProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export type InputHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
status?: Exclude<InputStatus, "danger"> | "default";
|
|
18
|
+
};
|
|
19
|
+
export declare function InputHint({ children, status, className, id: idProp, ...rest }: InputHintProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare namespace InputHint {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export type InputErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
export declare function InputError({ children, className, id: idProp, ...rest }: InputErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace InputError {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { InputProps, InputSize, InputStatus, InputVariant } from './Input';
|
|
2
|
+
import { InputError, InputHint, InputRoot } from './InputField';
|
|
3
|
+
export declare const Input: typeof InputRoot & {
|
|
4
|
+
Label: import('../Label').LabelComponent;
|
|
5
|
+
Control: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "onPointerDown" | "type"> & {
|
|
6
|
+
variant?: InputVariant;
|
|
7
|
+
size?: InputSize;
|
|
8
|
+
groupSegment?: import('../utils/buttonGroupSegment').ButtonGroupSegment;
|
|
9
|
+
status?: InputStatus;
|
|
10
|
+
inputType?: "text" | "number" | "password" | "file";
|
|
11
|
+
prefix?: import('react').ReactNode;
|
|
12
|
+
suffix?: import('react').ReactNode;
|
|
13
|
+
onPointerDown?: import('react').PointerEventHandler<HTMLDivElement>;
|
|
14
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
15
|
+
Hint: typeof InputHint;
|
|
16
|
+
Error: typeof InputError;
|
|
17
|
+
};
|
|
18
|
+
export type { InputProps, InputSize, InputStatus, InputVariant, };
|
|
19
|
+
export type { InputRootProps, InputHintProps, InputErrorProps, InputSimpleProps } from './InputField';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InputSize, InputStatus } from './Input';
|
|
2
|
+
export type InputFieldContextValue = {
|
|
3
|
+
inputId: string;
|
|
4
|
+
hintId: string;
|
|
5
|
+
errorId: string;
|
|
6
|
+
labelId: string;
|
|
7
|
+
hintConnected: boolean;
|
|
8
|
+
errorConnected: boolean;
|
|
9
|
+
isRequired: boolean;
|
|
10
|
+
status: InputStatus;
|
|
11
|
+
size: InputSize;
|
|
12
|
+
};
|
|
13
|
+
declare const InputFieldContext: import('react').Context<InputFieldContextValue | null>;
|
|
14
|
+
export declare function useInputFieldContext(): InputFieldContextValue;
|
|
15
|
+
export declare function useOptionalInputFieldContext(): InputFieldContextValue | null;
|
|
16
|
+
export { InputFieldContext };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type LabelProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "children"> & {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
isRequired?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function Label({ children, className, isRequired: isRequiredProp, htmlFor: htmlForProp, id: idProp, ...rest }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
/** Маркер для Switch: текст забирает корень, сам не рендерится. */
|
|
8
|
+
export declare function LabelSlot(_props: LabelProps): null;
|
|
9
|
+
export declare namespace LabelSlot {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export type LabelComponent = typeof Label & {
|
|
13
|
+
Slot: typeof LabelSlot;
|
|
14
|
+
};
|
|
15
|
+
export declare const LabelWithSlot: LabelComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type FieldLabelContextValue = {
|
|
2
|
+
/** `htmlFor` для `<label>` — id контрола поля. */
|
|
3
|
+
controlId?: string;
|
|
4
|
+
/** `id` для `<span>` — подпись для `aria-labelledby`. */
|
|
5
|
+
labelId?: string;
|
|
6
|
+
isRequired?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const FieldLabelContext: import('react').Context<FieldLabelContextValue | null>;
|
|
9
|
+
export declare function useFieldLabelContext(): FieldLabelContextValue;
|
|
10
|
+
export declare function useOptionalFieldLabelContext(): FieldLabelContextValue | null;
|
|
11
|
+
export { FieldLabelContext };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
export type LinkSize = ComponentSize;
|
|
4
|
+
export type LinkIconPosition = "start" | "end";
|
|
5
|
+
export type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children"> & {
|
|
6
|
+
href: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
size?: LinkSize;
|
|
9
|
+
/** Подчёркивание текста ссылки. */
|
|
10
|
+
underline?: boolean;
|
|
11
|
+
/** Иконка слева от текста. */
|
|
12
|
+
leftIcon?: ReactNode;
|
|
13
|
+
/** Иконка справа от текста. */
|
|
14
|
+
rightIcon?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Показать стандартную стрелку ↗, если не переданы `leftIcon` / `rightIcon`.
|
|
17
|
+
* По умолчанию `false`.
|
|
18
|
+
*/
|
|
19
|
+
showDefaultIcon?: boolean;
|
|
20
|
+
/** Сторона для стандартной стрелки. По умолчанию `end`. */
|
|
21
|
+
defaultIconPosition?: LinkIconPosition;
|
|
22
|
+
};
|
|
23
|
+
export declare const Link: import('react').ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children"> & {
|
|
24
|
+
href: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
size?: LinkSize;
|
|
27
|
+
/** Подчёркивание текста ссылки. */
|
|
28
|
+
underline?: boolean;
|
|
29
|
+
/** Иконка слева от текста. */
|
|
30
|
+
leftIcon?: ReactNode;
|
|
31
|
+
/** Иконка справа от текста. */
|
|
32
|
+
rightIcon?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Показать стандартную стрелку ↗, если не переданы `leftIcon` / `rightIcon`.
|
|
35
|
+
* По умолчанию `false`.
|
|
36
|
+
*/
|
|
37
|
+
showDefaultIcon?: boolean;
|
|
38
|
+
/** Сторона для стандартной стрелки. По умолчанию `end`. */
|
|
39
|
+
defaultIconPosition?: LinkIconPosition;
|
|
40
|
+
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link, type LinkProps, type LinkSize, type LinkIconPosition, } from './Link';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { LiquidGlassControls, LiquidGlassShape } from './useLiquidGlass';
|
|
3
|
+
export type { LiquidGlassShape, LiquidGlassControls };
|
|
4
|
+
export type LiquidGlassProps = HTMLAttributes<HTMLDivElement> & LiquidGlassControls & {
|
|
5
|
+
/**
|
|
6
|
+
* Shape of the glass element.
|
|
7
|
+
* @default "rounded"
|
|
8
|
+
*/
|
|
9
|
+
shape?: LiquidGlassShape;
|
|
10
|
+
/**
|
|
11
|
+
* Override border-radius in pixels. Computed automatically for `circle` and `pill` if omitted.
|
|
12
|
+
*/
|
|
13
|
+
borderRadius?: number;
|
|
14
|
+
/** CSS selector pattern for DOM elements to hide from the page capture */
|
|
15
|
+
ignoreSelector?: string;
|
|
16
|
+
/** Class applied to the inner content wrapper */
|
|
17
|
+
contentClassName?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Apple-style Liquid Glass component.
|
|
21
|
+
*
|
|
22
|
+
* Uses WebGL to sample the underlying page content, apply refraction distortion,
|
|
23
|
+
* Gaussian blur, and tint — creating the liquid glass effect from Apple's design language.
|
|
24
|
+
*
|
|
25
|
+
* The component captures a static snapshot of the page on mount via html2canvas.
|
|
26
|
+
* The snapshot is shared across all `LiquidGlass` instances to minimise overhead.
|
|
27
|
+
*/
|
|
28
|
+
export declare function LiquidGlass({ className, contentClassName, children, style, shape, borderRadius, ignoreSelector, edgeIntensity, rimIntensity, baseIntensity, edgeDistance, rimDistance, baseDistance, cornerBoost, rippleEffect, blurRadius, tintOpacity, warp, ...rest }: LiquidGlassProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const VERTEX_SHADER = "\n attribute vec2 a_position;\n attribute vec2 a_texcoord;\n varying vec2 v_texcoord;\n\n void main() {\n gl_Position = vec4(a_position, 0, 1);\n v_texcoord = a_texcoord;\n }\n";
|
|
2
|
+
export declare const FRAGMENT_SHADER_STANDALONE = "\n precision mediump float;\n uniform sampler2D u_image;\n uniform vec2 u_resolution;\n uniform vec2 u_textureSize;\n uniform float u_scrollY;\n uniform float u_pageHeight;\n uniform float u_viewportHeight;\n uniform float u_blurRadius;\n uniform float u_borderRadius;\n uniform vec2 u_containerPosition;\n uniform float u_warp;\n uniform float u_edgeIntensity;\n uniform float u_rimIntensity;\n uniform float u_baseIntensity;\n uniform float u_edgeDistance;\n uniform float u_rimDistance;\n uniform float u_baseDistance;\n uniform float u_cornerBoost;\n uniform float u_rippleEffect;\n uniform float u_tintOpacity;\n varying vec2 v_texcoord;\n\n float roundedRectDistance(vec2 coord, vec2 size, float radius) {\n vec2 center = size * 0.5;\n vec2 pixelCoord = coord * size;\n vec2 toCorner = abs(pixelCoord - center) - (center - radius);\n float outsideCorner = length(max(toCorner, 0.0));\n float insideCorner = min(max(toCorner.x, toCorner.y), 0.0);\n return (outsideCorner + insideCorner - radius);\n }\n\n float circleDistance(vec2 coord, vec2 size, float radius) {\n vec2 center = vec2(0.5, 0.5);\n vec2 pixelCoord = coord * size;\n vec2 centerPixel = center * size;\n float distFromCenter = length(pixelCoord - centerPixel);\n return distFromCenter - radius;\n }\n\n bool isPill(vec2 size, float radius) {\n float heightRatioDiff = abs(radius - size.y * 0.5);\n bool radiusMatchesHeight = heightRatioDiff < 2.0;\n bool isWiderThanTall = size.x > size.y + 4.0;\n return radiusMatchesHeight && isWiderThanTall;\n }\n\n bool isCircle(vec2 size, float radius) {\n float minDim = min(size.x, size.y);\n bool radiusMatchesMinDim = abs(radius - minDim * 0.5) < 1.0;\n bool isRoughlySquare = abs(size.x - size.y) < 4.0;\n return radiusMatchesMinDim && isRoughlySquare;\n }\n\n float pillDistance(vec2 coord, vec2 size, float radius) {\n vec2 center = size * 0.5;\n vec2 pixelCoord = coord * size;\n vec2 capsuleStart = vec2(radius, center.y);\n vec2 capsuleEnd = vec2(size.x - radius, center.y);\n vec2 capsuleAxis = capsuleEnd - capsuleStart;\n float capsuleLength = length(capsuleAxis);\n if (capsuleLength > 0.0) {\n vec2 toPoint = pixelCoord - capsuleStart;\n float t = clamp(dot(toPoint, capsuleAxis) / dot(capsuleAxis, capsuleAxis), 0.0, 1.0);\n vec2 closestPointOnAxis = capsuleStart + t * capsuleAxis;\n return length(pixelCoord - closestPointOnAxis) - radius;\n } else {\n return length(pixelCoord - center) - radius;\n }\n }\n\n void main() {\n vec2 coord = v_texcoord;\n float scrollY = u_scrollY;\n vec2 containerSize = u_resolution;\n vec2 textureSize = u_textureSize;\n\n vec2 containerCenter = u_containerPosition + vec2(0.0, scrollY);\n vec2 containerOffset = (coord - 0.5) * containerSize;\n vec2 pagePixel = containerCenter + containerOffset;\n vec2 textureCoord = pagePixel / textureSize;\n\n float distFromEdgeShape;\n vec2 shapeNormal;\n\n if (isPill(u_resolution, u_borderRadius)) {\n distFromEdgeShape = -pillDistance(coord, u_resolution, u_borderRadius);\n vec2 center = vec2(0.5, 0.5);\n vec2 pixelCoord = coord * u_resolution;\n vec2 capsuleStart = vec2(u_borderRadius, center.y * u_resolution.y);\n vec2 capsuleEnd = vec2(u_resolution.x - u_borderRadius, center.y * u_resolution.y);\n vec2 capsuleAxis = capsuleEnd - capsuleStart;\n float capsuleLength = length(capsuleAxis);\n if (capsuleLength > 0.0) {\n vec2 toPoint = pixelCoord - capsuleStart;\n float t = clamp(dot(toPoint, capsuleAxis) / dot(capsuleAxis, capsuleAxis), 0.0, 1.0);\n vec2 closestPointOnAxis = capsuleStart + t * capsuleAxis;\n vec2 normalDir = pixelCoord - closestPointOnAxis;\n shapeNormal = length(normalDir) > 0.0 ? normalize(normalDir) : vec2(0.0, 1.0);\n } else {\n shapeNormal = normalize(coord - center);\n }\n } else if (isCircle(u_resolution, u_borderRadius)) {\n distFromEdgeShape = -circleDistance(coord, u_resolution, u_borderRadius);\n vec2 center = vec2(0.5, 0.5);\n shapeNormal = normalize(coord - center);\n } else {\n distFromEdgeShape = -roundedRectDistance(coord, u_resolution, u_borderRadius);\n vec2 center = vec2(0.5, 0.5);\n shapeNormal = normalize(coord - center);\n }\n distFromEdgeShape = max(distFromEdgeShape, 0.0);\n\n float distFromLeft = coord.x;\n float distFromRight = 1.0 - coord.x;\n float distFromTop = coord.y;\n float distFromBottom = 1.0 - coord.y;\n float distFromEdge = distFromEdgeShape / min(u_resolution.x, u_resolution.y);\n\n float normalizedDistance = distFromEdge * min(u_resolution.x, u_resolution.y);\n float baseIntensity = 1.0 - exp(-normalizedDistance * u_baseDistance);\n float edgeIntensity = exp(-normalizedDistance * u_edgeDistance);\n float rimIntensity = exp(-normalizedDistance * u_rimDistance);\n\n float baseComponent = u_warp > 0.5 ? baseIntensity * u_baseIntensity : 0.0;\n float totalIntensity = baseComponent + edgeIntensity * u_edgeIntensity + rimIntensity * u_rimIntensity;\n vec2 baseRefraction = shapeNormal * totalIntensity;\n\n float cornerProximityX = min(distFromLeft, distFromRight);\n float cornerProximityY = min(distFromTop, distFromBottom);\n float cornerDistance = max(cornerProximityX, cornerProximityY);\n float cornerNormalized = cornerDistance * min(u_resolution.x, u_resolution.y);\n float cornerBoost = exp(-cornerNormalized * 0.3) * u_cornerBoost;\n vec2 cornerRefraction = shapeNormal * cornerBoost;\n\n vec2 perpendicular = vec2(-shapeNormal.y, shapeNormal.x);\n float rippleEffect = sin(distFromEdge * 25.0) * u_rippleEffect * rimIntensity;\n vec2 textureRefraction = perpendicular * rippleEffect;\n\n vec2 totalRefraction = baseRefraction + cornerRefraction + textureRefraction;\n textureCoord += totalRefraction;\n\n vec4 color = vec4(0.0);\n vec2 texelSize = 1.0 / u_textureSize;\n float sigma = u_blurRadius / 2.0;\n vec2 blurStep = texelSize * sigma;\n float totalWeight = 0.0;\n\n for (float i = -6.0; i <= 6.0; i += 1.0) {\n for (float j = -6.0; j <= 6.0; j += 1.0) {\n float distance = length(vec2(i, j));\n if (distance > 6.0) continue;\n float weight = exp(-(distance * distance) / (2.0 * sigma * sigma));\n vec2 offset = vec2(i, j) * blurStep;\n color += texture2D(u_image, textureCoord + offset) * weight;\n totalWeight += weight;\n }\n }\n color /= totalWeight;\n\n float gradientPosition = coord.y;\n vec3 topTint = vec3(1.0, 1.0, 1.0);\n vec3 bottomTint = vec3(0.7, 0.7, 0.7);\n vec3 gradientTint = mix(topTint, bottomTint, gradientPosition);\n vec3 tintedColor = mix(color.rgb, gradientTint, u_tintOpacity);\n color = vec4(tintedColor, color.a);\n\n vec2 viewportCenter = containerCenter;\n float topY = (viewportCenter.y - containerSize.y * 0.4) / textureSize.y;\n float midY = viewportCenter.y / textureSize.y;\n float bottomY = (viewportCenter.y + containerSize.y * 0.4) / textureSize.y;\n\n vec3 topColor = vec3(0.0);\n vec3 midColor = vec3(0.0);\n vec3 bottomColor = vec3(0.0);\n float sampleCount = 0.0;\n\n for (float x = 0.0; x < 1.0; x += 0.05) {\n for (float yOffset = -5.0; yOffset <= 5.0; yOffset += 1.0) {\n vec2 topSample = vec2(x, topY + yOffset * texelSize.y);\n vec2 midSample = vec2(x, midY + yOffset * texelSize.y);\n vec2 bottomSample = vec2(x, bottomY + yOffset * texelSize.y);\n topColor += texture2D(u_image, topSample).rgb;\n midColor += texture2D(u_image, midSample).rgb;\n bottomColor += texture2D(u_image, bottomSample).rgb;\n sampleCount += 1.0;\n }\n }\n topColor /= sampleCount;\n midColor /= sampleCount;\n bottomColor /= sampleCount;\n\n vec3 sampledGradient;\n if (gradientPosition < 0.1) {\n sampledGradient = topColor;\n } else if (gradientPosition > 0.9) {\n sampledGradient = bottomColor;\n } else {\n float transitionPos = (gradientPosition - 0.1) / 0.8;\n if (transitionPos < 0.5) {\n float t = transitionPos * 2.0;\n sampledGradient = mix(topColor, midColor, t);\n } else {\n float t = (transitionPos - 0.5) * 2.0;\n sampledGradient = mix(midColor, bottomColor, t);\n }\n }\n\n vec3 finalTinted = mix(color.rgb, sampledGradient, u_tintOpacity * 0.3);\n color = vec4(finalTinted, color.a);\n\n float maskDistance;\n if (isPill(u_resolution, u_borderRadius)) {\n maskDistance = pillDistance(coord, u_resolution, u_borderRadius);\n } else if (isCircle(u_resolution, u_borderRadius)) {\n maskDistance = circleDistance(coord, u_resolution, u_borderRadius);\n } else {\n maskDistance = roundedRectDistance(coord, u_resolution, u_borderRadius);\n }\n float mask = 1.0 - smoothstep(-1.0, 1.0, maskDistance);\n\n gl_FragColor = vec4(color.rgb, mask);\n }\n";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type LiquidGlassShape = "rounded" | "circle" | "pill";
|
|
2
|
+
export interface LiquidGlassControls {
|
|
3
|
+
edgeIntensity?: number;
|
|
4
|
+
rimIntensity?: number;
|
|
5
|
+
baseIntensity?: number;
|
|
6
|
+
edgeDistance?: number;
|
|
7
|
+
rimDistance?: number;
|
|
8
|
+
baseDistance?: number;
|
|
9
|
+
cornerBoost?: number;
|
|
10
|
+
rippleEffect?: number;
|
|
11
|
+
blurRadius?: number;
|
|
12
|
+
tintOpacity?: number;
|
|
13
|
+
warp?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UseLiquidGlassOptions extends LiquidGlassControls {
|
|
16
|
+
shape?: LiquidGlassShape;
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
/** CSS selector for elements to ignore during page capture */
|
|
19
|
+
ignoreSelector?: string;
|
|
20
|
+
}
|
|
21
|
+
interface GlRefs {
|
|
22
|
+
gl: WebGLRenderingContext;
|
|
23
|
+
texture: WebGLTexture;
|
|
24
|
+
scrollYLoc: WebGLUniformLocation | null;
|
|
25
|
+
resolutionLoc: WebGLUniformLocation | null;
|
|
26
|
+
textureSizeLoc: WebGLUniformLocation | null;
|
|
27
|
+
pageHeightLoc: WebGLUniformLocation | null;
|
|
28
|
+
viewportHeightLoc: WebGLUniformLocation | null;
|
|
29
|
+
blurRadiusLoc: WebGLUniformLocation | null;
|
|
30
|
+
borderRadiusLoc: WebGLUniformLocation | null;
|
|
31
|
+
containerPositionLoc: WebGLUniformLocation | null;
|
|
32
|
+
warpLoc: WebGLUniformLocation | null;
|
|
33
|
+
edgeIntensityLoc: WebGLUniformLocation | null;
|
|
34
|
+
rimIntensityLoc: WebGLUniformLocation | null;
|
|
35
|
+
baseIntensityLoc: WebGLUniformLocation | null;
|
|
36
|
+
edgeDistanceLoc: WebGLUniformLocation | null;
|
|
37
|
+
rimDistanceLoc: WebGLUniformLocation | null;
|
|
38
|
+
baseDistanceLoc: WebGLUniformLocation | null;
|
|
39
|
+
cornerBoostLoc: WebGLUniformLocation | null;
|
|
40
|
+
rippleEffectLoc: WebGLUniformLocation | null;
|
|
41
|
+
tintOpacityLoc: WebGLUniformLocation | null;
|
|
42
|
+
imageLoc: WebGLUniformLocation | null;
|
|
43
|
+
}
|
|
44
|
+
/** Reset the shared snapshot (call on significant DOM changes or window resize) */
|
|
45
|
+
export declare function resetLiquidGlassSnapshot(): void;
|
|
46
|
+
export declare function useLiquidGlass(canvasRef: React.RefObject<HTMLCanvasElement | null>, containerRef: React.RefObject<HTMLElement | null>, options?: UseLiquidGlassOptions): {
|
|
47
|
+
glRefsRef: import('react').RefObject<GlRefs | null>;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SelectionIndicatorSize, SelectionIndicatorVariant } from '../SelectionIndicator';
|
|
3
|
+
export type ListBoxSize = "small" | "base" | "mid" | "large";
|
|
4
|
+
type ListBoxContextValue = {
|
|
5
|
+
listId: string;
|
|
6
|
+
size: ListBoxSize;
|
|
7
|
+
multiple: boolean;
|
|
8
|
+
selected: Set<string>;
|
|
9
|
+
selectItem: (value: string) => void;
|
|
10
|
+
activeValue: string | null;
|
|
11
|
+
setActiveValue: (value: string | null) => void;
|
|
12
|
+
showIndicator: boolean;
|
|
13
|
+
indicatorMode: "radio" | "multi";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function useListBox(who: string): ListBoxContextValue;
|
|
17
|
+
export type ListBoxRootProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> & {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
size?: ListBoxSize;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
value?: string | string[];
|
|
22
|
+
defaultValue?: string | string[];
|
|
23
|
+
onValueChange?: (value: string | string[]) => void;
|
|
24
|
+
/** Показывать индикатор выбора слева. По умолчанию `true`. */
|
|
25
|
+
selectionIndicator?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Управляемый активный пункт (для combobox `aria-activedescendant`). */
|
|
28
|
+
activeValue?: string | null;
|
|
29
|
+
onActiveValueChange?: (value: string | null) => void;
|
|
30
|
+
/** `id` корня listbox; иначе генерируется. */
|
|
31
|
+
listId?: string;
|
|
32
|
+
};
|
|
33
|
+
declare function ListBoxRoot({ children, className, size, multiple, value: valueProp, defaultValue, onValueChange, selectionIndicator, disabled, activeValue: activeValueProp, onActiveValueChange, listId: listIdProp, ...rest }: ListBoxRootProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare namespace ListBoxRoot {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
37
|
+
export type ListBoxSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
38
|
+
declare function ListBoxSection({ className, children, ...rest }: ListBoxSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare namespace ListBoxSection {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
export type ListBoxHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
43
|
+
declare function ListBoxHeader({ className, children, id: idProp, ...rest }: ListBoxHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare namespace ListBoxHeader {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
export type ListBoxSeparatorProps = HTMLAttributes<HTMLDivElement>;
|
|
48
|
+
declare function ListBoxSeparator({ className, ...rest }: ListBoxSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare namespace ListBoxSeparator {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
export type ListBoxEmptyProps = HTMLAttributes<HTMLParagraphElement>;
|
|
53
|
+
declare function ListBoxEmpty({ className, children, ...rest }: ListBoxEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare namespace ListBoxEmpty {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
57
|
+
export type ListBoxItemProps = Omit<HTMLAttributes<HTMLButtonElement>, "value"> & {
|
|
58
|
+
value: string;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** Текстовая подпись (simple API). */
|
|
61
|
+
label?: ReactNode;
|
|
62
|
+
/** Подсказка под подписью (simple API). */
|
|
63
|
+
hint?: ReactNode;
|
|
64
|
+
/** Иконка справа (simple API). */
|
|
65
|
+
icon?: ReactNode;
|
|
66
|
+
};
|
|
67
|
+
export type ListBoxLabelProps = HTMLAttributes<HTMLSpanElement>;
|
|
68
|
+
declare function ListBoxLabel(props: ListBoxLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
declare namespace ListBoxLabel {
|
|
70
|
+
var displayName: string;
|
|
71
|
+
}
|
|
72
|
+
export type ListBoxHintProps = HTMLAttributes<HTMLSpanElement>;
|
|
73
|
+
declare function ListBoxHint(props: ListBoxHintProps): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
declare namespace ListBoxHint {
|
|
75
|
+
var displayName: string;
|
|
76
|
+
}
|
|
77
|
+
export type ListBoxIconProps = HTMLAttributes<HTMLSpanElement>;
|
|
78
|
+
declare function ListBoxIcon(props: ListBoxIconProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare namespace ListBoxIcon {
|
|
80
|
+
var displayName: string;
|
|
81
|
+
}
|
|
82
|
+
export type ListBoxItemIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
83
|
+
variant?: SelectionIndicatorVariant;
|
|
84
|
+
size?: SelectionIndicatorSize;
|
|
85
|
+
check?: boolean;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
};
|
|
88
|
+
declare function ListBoxItemIndicator({ variant, size, check, children, className, ...rest }: ListBoxItemIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
89
|
+
declare namespace ListBoxItemIndicator {
|
|
90
|
+
var displayName: string;
|
|
91
|
+
}
|
|
92
|
+
export declare const ListBox: typeof ListBoxRoot & {
|
|
93
|
+
Section: typeof ListBoxSection;
|
|
94
|
+
Header: typeof ListBoxHeader;
|
|
95
|
+
Separator: typeof ListBoxSeparator;
|
|
96
|
+
Empty: typeof ListBoxEmpty;
|
|
97
|
+
Item: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLButtonElement>, "value"> & {
|
|
98
|
+
value: string;
|
|
99
|
+
disabled?: boolean;
|
|
100
|
+
/** Текстовая подпись (simple API). */
|
|
101
|
+
label?: ReactNode;
|
|
102
|
+
/** Подсказка под подписью (simple API). */
|
|
103
|
+
hint?: ReactNode;
|
|
104
|
+
/** Иконка справа (simple API). */
|
|
105
|
+
icon?: ReactNode;
|
|
106
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
107
|
+
Label: typeof ListBoxLabel;
|
|
108
|
+
Hint: typeof ListBoxHint;
|
|
109
|
+
Icon: typeof ListBoxIcon;
|
|
110
|
+
ItemIndicator: typeof ListBoxItemIndicator;
|
|
111
|
+
};
|
|
112
|
+
export { useListBox };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListBox, useListBox, type ListBoxRootProps, type ListBoxSectionProps, type ListBoxHeaderProps, type ListBoxSeparatorProps, type ListBoxEmptyProps, type ListBoxItemProps, type ListBoxLabelProps, type ListBoxHintProps, type ListBoxIconProps, type ListBoxItemIndicatorProps, type ListBoxSize, } from './ListBox';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
export type LoadingSize = ComponentSize;
|
|
4
|
+
export type LoadingColor = "accent" | "foreground" | "muted" | "secondary" | "danger" | "success" | "info" | "warning";
|
|
5
|
+
export type LoadingProps = HTMLAttributes<HTMLSpanElement> & {
|
|
6
|
+
/** Габариты индикатора. По умолчанию `base`. */
|
|
7
|
+
size?: LoadingSize;
|
|
8
|
+
/** Цвет кольца. По умолчанию `accent`. */
|
|
9
|
+
color?: LoadingColor;
|
|
10
|
+
/** Текст для screen readers. По умолчанию «Загрузка». */
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Круговой индикатор загрузки: размеры как у спиннера в `Button`, цвета — основные токены темы.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Loading: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & {
|
|
17
|
+
/** Габариты индикатора. По умолчанию `base`. */
|
|
18
|
+
size?: LoadingSize;
|
|
19
|
+
/** Цвет кольца. По умолчанию `accent`. */
|
|
20
|
+
color?: LoadingColor;
|
|
21
|
+
/** Текст для screen readers. По умолчанию «Загрузка». */
|
|
22
|
+
label?: string;
|
|
23
|
+
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading, type LoadingProps, type LoadingSize, type LoadingColor } from './Loading';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type MeterSize = "small" | "base" | "mid" | "large";
|
|
3
|
+
export type MeterOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type MeterTrackProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
5
|
+
/** Текущее значение шкалы. */
|
|
6
|
+
value: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
size?: MeterSize;
|
|
10
|
+
/**
|
|
11
|
+
* Толщина линии. Перекрывает cross-axis из `size`.
|
|
12
|
+
* Число — px; строка — любая CSS-длина (`"0.75rem"`, `"12px"`).
|
|
13
|
+
*/
|
|
14
|
+
thickness?: number | string;
|
|
15
|
+
/** Цвет заливки: CSS-цвет или `linear-gradient(...)`. По умолчанию accent. */
|
|
16
|
+
color?: string;
|
|
17
|
+
formatValue?: (value: number) => string;
|
|
18
|
+
orientation?: MeterOrientation;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const MeterTrack: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
22
|
+
/** Текущее значение шкалы. */
|
|
23
|
+
value: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
size?: MeterSize;
|
|
27
|
+
/**
|
|
28
|
+
* Толщина линии. Перекрывает cross-axis из `size`.
|
|
29
|
+
* Число — px; строка — любая CSS-длина (`"0.75rem"`, `"12px"`).
|
|
30
|
+
*/
|
|
31
|
+
thickness?: number | string;
|
|
32
|
+
/** Цвет заливки: CSS-цвет или `linear-gradient(...)`. По умолчанию accent. */
|
|
33
|
+
color?: string;
|
|
34
|
+
formatValue?: (value: number) => string;
|
|
35
|
+
orientation?: MeterOrientation;
|
|
36
|
+
className?: string;
|
|
37
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { MeterTrackProps, MeterOrientation } from './Meter';
|
|
3
|
+
export type MeterRootProps = HTMLAttributes<HTMLDivElement> & Partial<MeterTrackProps> & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
id?: string;
|
|
6
|
+
orientation?: MeterOrientation;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
showValue?: boolean;
|
|
9
|
+
valueText?: ReactNode;
|
|
10
|
+
hint?: ReactNode;
|
|
11
|
+
error?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function MeterRoot({ children, className, id: idProp, orientation, label, showValue, valueText, hint, error, value, min, max, size, thickness, color, formatValue, ...divRest }: MeterRootProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type MeterHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export declare function MeterHeader({ children, className, ...rest }: MeterHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export type MeterValueProps = HTMLAttributes<HTMLSpanElement> & {
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
export declare function MeterValue({ children, className, ...rest }: MeterValueProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export type MeterHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare function MeterHint({ children, className, id: idProp, ...rest }: MeterHintProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare namespace MeterHint {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
export type MeterErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export declare function MeterError({ children, className, id: idProp, ...rest }: MeterErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace MeterError {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|