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,46 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
3
|
+
export type SliderSize = "small" | "base" | "mid" | "large";
|
|
4
|
+
/** Толщина дорожки / диаметр кружка: число (px) или CSS-длина. */
|
|
5
|
+
export type SliderThickness = number | string;
|
|
6
|
+
/** CSS-значение толщины: число → px, строка — как есть (`"1rem"`, `"12px"`). */
|
|
7
|
+
export declare function sliderThicknessToCss(thickness: number | string): string;
|
|
8
|
+
type SliderCommonProps = {
|
|
9
|
+
orientation?: SliderOrientation;
|
|
10
|
+
size?: SliderSize;
|
|
11
|
+
/**
|
|
12
|
+
* Толщина дорожки и диаметр кружка. Перекрывает cross-axis из `size`.
|
|
13
|
+
* Число — px; строка — любая CSS-длина (`"0.75rem"`, `"12px"`).
|
|
14
|
+
*/
|
|
15
|
+
thickness?: number | string;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Шаг смещения (игнорируется, если задан `marks`). */
|
|
19
|
+
step?: number;
|
|
20
|
+
/** Дискретные значения: ползунок «прилипает» только к этим точкам; на треке — метки. */
|
|
21
|
+
marks?: number[];
|
|
22
|
+
formatValue?: (value: number) => string;
|
|
23
|
+
/** Иконка внутри кружка: accent в покое, accent-foreground при захвате. */
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Явная подпись ползунков (`aria-label`); перекрывает связь с `<Slider.Label>` через `aria-labelledby`. */
|
|
28
|
+
ariaLabel?: string;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
export type SliderSingleProps = SliderCommonProps & {
|
|
32
|
+
range?: false;
|
|
33
|
+
value?: number;
|
|
34
|
+
defaultValue?: number;
|
|
35
|
+
onValueChange?: (value: number) => void;
|
|
36
|
+
};
|
|
37
|
+
export type SliderRangeProps = SliderCommonProps & {
|
|
38
|
+
range: true;
|
|
39
|
+
value?: [number, number];
|
|
40
|
+
defaultValue?: [number, number];
|
|
41
|
+
onValueChange?: (value: [number, number]) => void;
|
|
42
|
+
};
|
|
43
|
+
export type SliderTrackProps = SliderSingleProps | SliderRangeProps;
|
|
44
|
+
export declare const SliderTrack: import('react').ForwardRefExoticComponent<SliderTrackProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export { SliderFill, SliderIcon, SliderRail, SliderCompoundThumb as SliderThumb, } from './sliderCompound';
|
|
46
|
+
export type { SliderFillProps, SliderIconProps, SliderRailProps, SliderCompoundThumbProps as SliderThumbProps, SliderThumbKind, } from './sliderCompound';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SliderRangeProps, SliderSingleProps, SliderOrientation } from './Slider';
|
|
3
|
+
type SliderRootLayoutProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
id?: string;
|
|
6
|
+
orientation?: SliderOrientation;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
showValue?: boolean;
|
|
9
|
+
valueText?: ReactNode;
|
|
10
|
+
hint?: ReactNode;
|
|
11
|
+
error?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export type SliderRootProps = Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "value"> & SliderRootLayoutProps & (Partial<Omit<SliderSingleProps, "orientation" | "className">> | Partial<Omit<SliderRangeProps, "orientation" | "className">>);
|
|
14
|
+
export declare function SliderRoot({ children, className, id: idProp, orientation, label, showValue, valueText, hint, error, range, value, defaultValue, onValueChange, min, max, step, marks, size, thickness, formatValue, icon, disabled, ariaLabel, ...divRest }: SliderRootProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace SliderRoot {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export type SliderHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
export declare function SliderHeader({ children, className, ...rest }: SliderHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare namespace SliderHeader {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
export type SliderValueProps = HTMLAttributes<HTMLSpanElement> & {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export declare function SliderValue({ children, className, ...rest }: SliderValueProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace SliderValue {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export type SliderHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
export declare function SliderHint({ children, className, id: idProp, ...rest }: SliderHintProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare namespace SliderHint {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
export type SliderErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
export declare function SliderError({ children, className, id: idProp, ...rest }: SliderErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare namespace SliderError {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SliderFill, SliderIcon, SliderRail, SliderThumb, SliderTrackProps, SliderSingleProps, SliderRangeProps, SliderOrientation, SliderSize, SliderThickness, SliderFillProps, SliderIconProps, SliderRailProps, SliderThumbProps, SliderThumbKind, sliderThicknessToCss } from './Slider';
|
|
2
|
+
import { SliderError, SliderHeader, SliderHint, SliderRoot, SliderValue } from './SliderField';
|
|
3
|
+
export declare const Slider: typeof SliderRoot & {
|
|
4
|
+
Header: typeof SliderHeader;
|
|
5
|
+
Label: import('../Label').LabelComponent;
|
|
6
|
+
Value: typeof SliderValue;
|
|
7
|
+
Hint: typeof SliderHint;
|
|
8
|
+
Error: typeof SliderError;
|
|
9
|
+
Track: import('react').ForwardRefExoticComponent<SliderTrackProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Rail: typeof SliderRail;
|
|
11
|
+
Fill: typeof SliderFill;
|
|
12
|
+
Thumb: typeof SliderThumb;
|
|
13
|
+
Icon: typeof SliderIcon;
|
|
14
|
+
};
|
|
15
|
+
export type { SliderTrackProps, SliderSingleProps, SliderRangeProps, SliderOrientation, SliderSize, SliderThickness, SliderFillProps, SliderIconProps, SliderRailProps, SliderThumbProps, SliderThumbKind, };
|
|
16
|
+
export { sliderThicknessToCss };
|
|
17
|
+
export type { SliderRootProps, SliderHeaderProps, SliderValueProps, SliderHintProps, SliderErrorProps } from './SliderField';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { SliderOrientation, SliderSize } from './Slider';
|
|
3
|
+
export type SliderThumbKind = "single" | "start" | "end";
|
|
4
|
+
export type SliderTrackContextValue = {
|
|
5
|
+
fillRef: RefObject<HTMLSpanElement | null>;
|
|
6
|
+
fillClassResolved: string;
|
|
7
|
+
railClass: string;
|
|
8
|
+
markNodes: ReactNode;
|
|
9
|
+
size: SliderSize;
|
|
10
|
+
orientation: SliderOrientation;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
range: boolean;
|
|
14
|
+
renderThumb: (kind: SliderThumbKind, iconOverride?: ReactNode) => ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function useSliderTrackContext(): SliderTrackContextValue;
|
|
17
|
+
export declare function SliderTrackProvider({ value, children, }: {
|
|
18
|
+
value: SliderTrackContextValue;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type SliderRailProps = HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
export declare function SliderRail({ className, children, ...rest }: SliderRailProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare namespace SliderRail {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
export type SliderFillProps = HTMLAttributes<HTMLSpanElement>;
|
|
27
|
+
export declare function SliderFill({ className, ...rest }: SliderFillProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace SliderFill {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export type SliderCompoundThumbProps = {
|
|
32
|
+
thumb?: SliderThumbKind;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
export declare function SliderCompoundThumb({ thumb, children }: SliderCompoundThumbProps): ReactNode;
|
|
36
|
+
export declare namespace SliderCompoundThumb {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
export type SliderIconProps = {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
export declare function SliderIcon({ children }: SliderIconProps): ReactNode;
|
|
43
|
+
export declare namespace SliderIcon {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function partitionSliderTrackChildren(children: ReactNode): {
|
|
47
|
+
body: ReactNode | null;
|
|
48
|
+
hasCompoundParts: boolean;
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SliderOrientation } from './Slider';
|
|
2
|
+
export type SliderDisplayState = {
|
|
3
|
+
valueLabel: string;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
range: boolean;
|
|
7
|
+
singleValue: number;
|
|
8
|
+
rangeValue: [number, number];
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
export type SliderFieldContextValue = {
|
|
12
|
+
sliderId: string;
|
|
13
|
+
labelId: string;
|
|
14
|
+
hintId: string;
|
|
15
|
+
errorId: string;
|
|
16
|
+
hintConnected: boolean;
|
|
17
|
+
errorConnected: boolean;
|
|
18
|
+
orientation: SliderOrientation;
|
|
19
|
+
display: SliderDisplayState | null;
|
|
20
|
+
setDisplay: (next: SliderDisplayState | null) => void;
|
|
21
|
+
};
|
|
22
|
+
declare const SliderFieldContext: import('react').Context<SliderFieldContextValue | null>;
|
|
23
|
+
export declare function useSliderFieldContext(): SliderFieldContextValue;
|
|
24
|
+
export declare function useOptionalSliderFieldContext(): SliderFieldContextValue | null;
|
|
25
|
+
export { SliderFieldContext };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type SurfaceVariant = "default" | "outline" | "secondary";
|
|
3
|
+
export type SurfaceShadow = "none" | "sm" | "md" | "lg";
|
|
4
|
+
export type SurfacePadding = "none" | "small" | "base" | "plus" | "mid";
|
|
5
|
+
export type SurfaceRadius = "base" | "mid" | "large";
|
|
6
|
+
export type SurfaceProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/** Заливка и обводка. По умолчанию `default`. */
|
|
8
|
+
variant?: SurfaceVariant;
|
|
9
|
+
/** Тень панели. По умолчанию `none`. */
|
|
10
|
+
shadow?: SurfaceShadow;
|
|
11
|
+
/** Внутренние отступы. По умолчанию `none` — задайте через `className` или prop. */
|
|
12
|
+
padding?: SurfacePadding;
|
|
13
|
+
/** Скругление углов. По умолчанию `mid`. */
|
|
14
|
+
radius?: SurfaceRadius;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Базовая панель: фон, обводка, скругление и опциональная тень.
|
|
18
|
+
* Примитив для меню, секций, обёрток списков — без семантики Card и без blur у GlassSurface.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Surface: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
/** Заливка и обводка. По умолчанию `default`. */
|
|
22
|
+
variant?: SurfaceVariant;
|
|
23
|
+
/** Тень панели. По умолчанию `none`. */
|
|
24
|
+
shadow?: SurfaceShadow;
|
|
25
|
+
/** Внутренние отступы. По умолчанию `none` — задайте через `className` или prop. */
|
|
26
|
+
padding?: SurfacePadding;
|
|
27
|
+
/** Скругление углов. По умолчанию `mid`. */
|
|
28
|
+
radius?: SurfaceRadius;
|
|
29
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Surface, type SurfaceProps, type SurfaceVariant, type SurfaceShadow, type SurfacePadding, type SurfaceRadius, } from './Surface';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InputHTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SWITCH_LAYOUT, SwitchSize } from './switchGeometry';
|
|
3
|
+
import { SwitchFill, SwitchIcon, SwitchThumb, SwitchTrack, SwitchFillProps, SwitchIconProps, SwitchIconWhen, SwitchThumbProps, SwitchTrackProps } from './switchTrack';
|
|
4
|
+
export type { SwitchSize };
|
|
5
|
+
export type SwitchLabelPosition = "left" | "right";
|
|
6
|
+
export { SWITCH_LAYOUT };
|
|
7
|
+
export type SwitchControlProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "htmlFor" | "onChange"> & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "children" | "className"> & {
|
|
8
|
+
size?: SwitchSize;
|
|
9
|
+
/**
|
|
10
|
+
* Толщина трека и диаметр кружка. Перекрывает cross-axis из `size`.
|
|
11
|
+
* Число — px; строка — любая CSS-длина (`"0.75rem"`, `"12px"`).
|
|
12
|
+
*/
|
|
13
|
+
thickness?: number | string;
|
|
14
|
+
/** Иконка в кружке, когда выключен (цвет accent). Если задана хотя бы одна — accent-заливка кружка при включении. */
|
|
15
|
+
iconOff?: ReactNode;
|
|
16
|
+
/** Иконка в кружке, когда включен (цвет accent-foreground на заливке). */
|
|
17
|
+
iconOn?: ReactNode;
|
|
18
|
+
/** Фон трека во включённом состоянии: CSS-цвет или `linear-gradient(...)`. Заливка кружка всегда accent. */
|
|
19
|
+
color?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export declare const SwitchControl: import('react').ForwardRefExoticComponent<Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "htmlFor"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "className" | "children" | "type"> & {
|
|
24
|
+
size?: SwitchSize;
|
|
25
|
+
/**
|
|
26
|
+
* Толщина трека и диаметр кружка. Перекрывает cross-axis из `size`.
|
|
27
|
+
* Число — px; строка — любая CSS-длина (`"0.75rem"`, `"12px"`).
|
|
28
|
+
*/
|
|
29
|
+
thickness?: number | string;
|
|
30
|
+
/** Иконка в кружке, когда выключен (цвет accent). Если задана хотя бы одна — accent-заливка кружка при включении. */
|
|
31
|
+
iconOff?: ReactNode;
|
|
32
|
+
/** Иконка в кружке, когда включен (цвет accent-foreground на заливке). */
|
|
33
|
+
iconOn?: ReactNode;
|
|
34
|
+
/** Фон трека во включённом состоянии: CSS-цвет или `linear-gradient(...)`. Заливка кружка всегда accent. */
|
|
35
|
+
color?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
39
|
+
export type { SwitchTrackProps, SwitchFillProps, SwitchThumbProps, SwitchIconProps, SwitchIconWhen, };
|
|
40
|
+
export { SwitchTrack, SwitchFill, SwitchThumb, SwitchIcon };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { FieldErrorProps, FieldHintProps } from '../Field';
|
|
3
|
+
import { LabelProps } from '../Label';
|
|
4
|
+
import { SwitchControlProps, SwitchLabelPosition, SwitchSize } from './Switch';
|
|
5
|
+
export type SwitchRootProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "htmlFor" | "onChange"> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
error?: ReactNode;
|
|
10
|
+
labelPosition?: SwitchLabelPosition;
|
|
11
|
+
size?: SwitchSize;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type SwitchSimpleProps = SwitchRootProps & SwitchControlProps;
|
|
15
|
+
export type SwitchContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export declare const SwitchContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export type SwitchLabelProps = Omit<LabelProps, "htmlFor">;
|
|
22
|
+
/** Текст опции внутри `<Switch>` — span, без вложенного `<label>`. */
|
|
23
|
+
export declare function SwitchLabel({ children, className, ...rest }: SwitchLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare namespace SwitchLabel {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export type SwitchHintProps = Omit<FieldHintProps, "id" | "as">;
|
|
28
|
+
export declare function SwitchHint({ children, className, variant, ...rest }: SwitchHintProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace SwitchHint {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export type SwitchErrorProps = Omit<FieldErrorProps, "id" | "as">;
|
|
33
|
+
export declare function SwitchError({ children, className, ...rest }: SwitchErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare namespace SwitchError {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const SwitchRoot: import('react').ForwardRefExoticComponent<Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "htmlFor"> & {
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
label?: ReactNode;
|
|
40
|
+
hint?: ReactNode;
|
|
41
|
+
error?: ReactNode;
|
|
42
|
+
labelPosition?: SwitchLabelPosition;
|
|
43
|
+
size?: SwitchSize;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
} & Partial<SwitchControlProps> & import('react').RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SwitchFill, SwitchIcon, SwitchThumb, SwitchTrack, SwitchControlProps, SwitchFillProps, SwitchIconProps, SwitchIconWhen, SwitchLabelPosition, SwitchSize, SwitchThumbProps, SwitchTrackProps } from './Switch';
|
|
2
|
+
import { SwitchError, SwitchHint, SwitchLabel, SwitchContentProps, SwitchErrorProps, SwitchHintProps, SwitchLabelProps } from './SwitchField';
|
|
3
|
+
export declare const Switch: import('react').ForwardRefExoticComponent<Omit<import('react').LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "htmlFor"> & {
|
|
4
|
+
children?: import('react').ReactNode;
|
|
5
|
+
label?: import('react').ReactNode;
|
|
6
|
+
hint?: import('react').ReactNode;
|
|
7
|
+
error?: import('react').ReactNode;
|
|
8
|
+
labelPosition?: SwitchLabelPosition;
|
|
9
|
+
size?: SwitchSize;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & Partial<SwitchControlProps> & import('react').RefAttributes<HTMLLabelElement>> & {
|
|
12
|
+
Control: import('react').ForwardRefExoticComponent<Omit<import('react').LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "htmlFor"> & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "className" | "children" | "type"> & {
|
|
13
|
+
size?: SwitchSize;
|
|
14
|
+
thickness?: number | string;
|
|
15
|
+
iconOff?: import('react').ReactNode;
|
|
16
|
+
iconOn?: import('react').ReactNode;
|
|
17
|
+
color?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: import('react').ReactNode;
|
|
20
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
21
|
+
Track: typeof SwitchTrack;
|
|
22
|
+
Fill: typeof SwitchFill;
|
|
23
|
+
Thumb: typeof SwitchThumb;
|
|
24
|
+
Icon: typeof SwitchIcon;
|
|
25
|
+
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
26
|
+
children?: import('react').ReactNode;
|
|
27
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
28
|
+
Label: typeof SwitchLabel;
|
|
29
|
+
Hint: typeof SwitchHint;
|
|
30
|
+
Error: typeof SwitchError;
|
|
31
|
+
};
|
|
32
|
+
export type { SwitchControlProps, SwitchTrackProps, SwitchFillProps, SwitchThumbProps, SwitchIconProps, SwitchIconWhen, SwitchSize, SwitchLabelPosition, SwitchContentProps, SwitchLabelProps, SwitchHintProps, SwitchErrorProps, };
|
|
33
|
+
export type { SwitchRootProps, SwitchSimpleProps } from './SwitchField';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { SwitchLabelPosition, SwitchSize } from './Switch';
|
|
3
|
+
export type SwitchFieldContextValue = {
|
|
4
|
+
switchId: string;
|
|
5
|
+
hintId: string;
|
|
6
|
+
errorId: string;
|
|
7
|
+
size: SwitchSize;
|
|
8
|
+
labelPosition: SwitchLabelPosition;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
isCompound: boolean;
|
|
11
|
+
hasCompoundHint: boolean;
|
|
12
|
+
hasCompoundError: boolean;
|
|
13
|
+
hasTextColumn: boolean;
|
|
14
|
+
hintConnected: boolean;
|
|
15
|
+
errorConnected: boolean;
|
|
16
|
+
useInlineCompoundMotion: boolean;
|
|
17
|
+
textMotionRef: RefObject<HTMLElement | null>;
|
|
18
|
+
setSqueezeToken: (fn: (t: number) => number) => void;
|
|
19
|
+
};
|
|
20
|
+
declare const SwitchFieldContext: import('react').Context<SwitchFieldContextValue | null>;
|
|
21
|
+
export declare function useSwitchFieldContext(): SwitchFieldContextValue;
|
|
22
|
+
export declare function useOptionalSwitchFieldContext(): SwitchFieldContextValue | null;
|
|
23
|
+
export { SwitchFieldContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextVariant } from '../Text';
|
|
2
|
+
export type SwitchSize = "small" | "base" | "mid" | "large";
|
|
3
|
+
/** Fallback для геометрии до первого измерения DOM. */
|
|
4
|
+
export declare function resolveFallbackThumbPx(thickness: number | string | undefined, size: SwitchSize): number;
|
|
5
|
+
export declare function measureSwitchTravel(trackEl: HTMLElement, thumbEl: HTMLElement): number;
|
|
6
|
+
export declare const SWITCH_LAYOUT: Record<SwitchSize, {
|
|
7
|
+
track: string;
|
|
8
|
+
travelPx: number;
|
|
9
|
+
title: TextVariant;
|
|
10
|
+
desc: TextVariant;
|
|
11
|
+
gapX: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { SwitchSize } from './switchGeometry';
|
|
3
|
+
type SwitchTrackContextValue = {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
size: SwitchSize;
|
|
7
|
+
color?: string;
|
|
8
|
+
trackFillRef: RefObject<HTMLSpanElement | null>;
|
|
9
|
+
thumbRef: RefObject<HTMLSpanElement | null>;
|
|
10
|
+
thumbShellRef: RefObject<HTMLSpanElement | null>;
|
|
11
|
+
thumbFillRef: RefObject<HTMLSpanElement | null>;
|
|
12
|
+
iconOffRef: RefObject<HTMLSpanElement | null>;
|
|
13
|
+
iconOnRef: RefObject<HTMLSpanElement | null>;
|
|
14
|
+
};
|
|
15
|
+
export declare function useSwitchTrackContext(): SwitchTrackContextValue;
|
|
16
|
+
export type SwitchTrackProps = HTMLAttributes<HTMLSpanElement> & {
|
|
17
|
+
size: SwitchSize;
|
|
18
|
+
thickness?: number | string;
|
|
19
|
+
/** Задаётся `<Switch.Control>`; в compound-разметке можно опустить. */
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
color?: string;
|
|
23
|
+
squeezeToken?: number;
|
|
24
|
+
iconOff?: ReactNode;
|
|
25
|
+
iconOn?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export declare function SwitchTrack({ size, thickness, checked, disabled, color, squeezeToken, iconOff, iconOn, className, children, ...rest }: SwitchTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace SwitchTrack {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export type SwitchFillProps = HTMLAttributes<HTMLSpanElement>;
|
|
32
|
+
export declare function SwitchFill({ className, style, ...rest }: SwitchFillProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace SwitchFill {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export type SwitchThumbProps = HTMLAttributes<HTMLSpanElement> & {
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
};
|
|
39
|
+
export declare function SwitchThumb({ className, children, ...rest }: SwitchThumbProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare namespace SwitchThumb {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
export type SwitchIconWhen = "off" | "on";
|
|
44
|
+
export type SwitchIconProps = HTMLAttributes<HTMLSpanElement> & {
|
|
45
|
+
when: SwitchIconWhen;
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
};
|
|
48
|
+
export declare function SwitchIcon({ when, children, className, ...rest }: SwitchIconProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare namespace SwitchIcon {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function partitionSwitchControlChildren(children: ReactNode): {
|
|
53
|
+
track: ReactNode | null;
|
|
54
|
+
content: ReactNode;
|
|
55
|
+
};
|
|
56
|
+
export declare function hasSwitchThumbChild(children: ReactNode): boolean;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
|
+
import { AlertStatus } from '../Alert/alertUtils';
|
|
3
|
+
export type SortDirection = "ascending" | "descending";
|
|
4
|
+
export type SortDescriptor = {
|
|
5
|
+
column: string;
|
|
6
|
+
direction: SortDirection;
|
|
7
|
+
};
|
|
8
|
+
export type TableVariant = "default" | "secondary" | "toned";
|
|
9
|
+
export type TableRowTone = AlertStatus;
|
|
10
|
+
export type SelectionMode = "none" | "single" | "multiple";
|
|
11
|
+
export type Selection = Set<string | number> | "all";
|
|
12
|
+
export type TableColumnRenderProps = {
|
|
13
|
+
sortDirection?: SortDirection;
|
|
14
|
+
};
|
|
15
|
+
/** Фон строки — те же семантические тоны, что у `Alert`. */
|
|
16
|
+
export declare const TABLE_ROW_TONE_SURFACE: Record<TableRowTone, string>;
|
|
17
|
+
export type TableProps = HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
variant?: TableVariant;
|
|
19
|
+
};
|
|
20
|
+
export type TableScrollContainerProps = HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
export type TableContentProps = HTMLAttributes<HTMLTableElement> & {
|
|
22
|
+
"aria-label"?: string;
|
|
23
|
+
selectionMode?: SelectionMode;
|
|
24
|
+
selectedKeys?: Selection;
|
|
25
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
26
|
+
sortDescriptor?: SortDescriptor;
|
|
27
|
+
onSortChange?: (descriptor: SortDescriptor) => void;
|
|
28
|
+
};
|
|
29
|
+
export type TableHeaderProps = Omit<HTMLAttributes<HTMLTableSectionElement>, "children"> & {
|
|
30
|
+
columns?: any[];
|
|
31
|
+
children?: ReactNode | ((column: any) => ReactNode);
|
|
32
|
+
};
|
|
33
|
+
export type TableColumnProps = Omit<ThHTMLAttributes<HTMLTableCellElement>, "children"> & {
|
|
34
|
+
id?: string;
|
|
35
|
+
allowsSorting?: boolean;
|
|
36
|
+
isRowHeader?: boolean;
|
|
37
|
+
children?: ReactNode | ((props: TableColumnRenderProps) => ReactNode);
|
|
38
|
+
};
|
|
39
|
+
export type TableBodyProps = Omit<HTMLAttributes<HTMLTableSectionElement>, "children"> & {
|
|
40
|
+
items?: any[];
|
|
41
|
+
children?: ReactNode | ((item: any) => ReactNode);
|
|
42
|
+
renderEmptyState?: () => ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export type TableRowProps = Omit<HTMLAttributes<HTMLTableRowElement>, "id"> & {
|
|
45
|
+
id?: string | number;
|
|
46
|
+
/** Семантический фон строки (как у `Alert`). В `variant="toned"` — отдельная «карточка» на строку. */
|
|
47
|
+
tone?: TableRowTone;
|
|
48
|
+
};
|
|
49
|
+
export type TableCellProps = TdHTMLAttributes<HTMLTableCellElement>;
|
|
50
|
+
export type TableFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
51
|
+
export declare const Table: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
52
|
+
variant?: TableVariant;
|
|
53
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
54
|
+
ScrollContainer: import('react').ForwardRefExoticComponent<TableScrollContainerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
55
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLTableElement> & {
|
|
56
|
+
"aria-label"?: string;
|
|
57
|
+
selectionMode?: SelectionMode;
|
|
58
|
+
selectedKeys?: Selection;
|
|
59
|
+
onSelectionChange?: (keys: Selection) => void;
|
|
60
|
+
sortDescriptor?: SortDescriptor;
|
|
61
|
+
onSortChange?: (descriptor: SortDescriptor) => void;
|
|
62
|
+
} & import('react').RefAttributes<HTMLTableElement>>;
|
|
63
|
+
Header: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLTableSectionElement>, "children"> & {
|
|
64
|
+
columns?: any[];
|
|
65
|
+
children?: ReactNode | ((column: any) => ReactNode);
|
|
66
|
+
} & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
67
|
+
Column: import('react').ForwardRefExoticComponent<Omit<ThHTMLAttributes<HTMLTableCellElement>, "children"> & {
|
|
68
|
+
id?: string;
|
|
69
|
+
allowsSorting?: boolean;
|
|
70
|
+
isRowHeader?: boolean;
|
|
71
|
+
children?: ReactNode | ((props: TableColumnRenderProps) => ReactNode);
|
|
72
|
+
} & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
73
|
+
Body: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLTableSectionElement>, "children"> & {
|
|
74
|
+
items?: any[];
|
|
75
|
+
children?: ReactNode | ((item: any) => ReactNode);
|
|
76
|
+
renderEmptyState?: () => ReactNode;
|
|
77
|
+
} & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
78
|
+
Row: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLTableRowElement>, "id"> & {
|
|
79
|
+
id?: string | number;
|
|
80
|
+
/** Семантический фон строки (как у `Alert`). В `variant="toned"` — отдельная «карточка» на строку. */
|
|
81
|
+
tone?: TableRowTone;
|
|
82
|
+
} & import('react').RefAttributes<HTMLTableRowElement>>;
|
|
83
|
+
Cell: import('react').ForwardRefExoticComponent<TableCellProps & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
84
|
+
Footer: import('react').ForwardRefExoticComponent<TableFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table, TABLE_ROW_TONE_SURFACE, type TableProps, type TableVariant, type TableRowTone, type TableScrollContainerProps, type TableContentProps, type TableHeaderProps, type TableColumnProps, type TableColumnRenderProps, type TableBodyProps, type TableRowProps, type TableCellProps, type TableFooterProps, type SortDescriptor, type SortDirection, type SelectionMode, type Selection, } from './Table';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
import { TabsOrientation, TabsVariant, useTabsContext } from './tabsContext';
|
|
4
|
+
export type TabsSize = ComponentSize;
|
|
5
|
+
export type TabsRootProps = Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Контролируемое значение активного таба. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Начальное значение (неконтролируемый режим). */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
orientation?: TabsOrientation;
|
|
13
|
+
size?: TabsSize;
|
|
14
|
+
variant?: TabsVariant;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type TabsListProps = HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
export type TabsTabProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> & {
|
|
19
|
+
value: string;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export type TabsPanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
23
|
+
value: string;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
declare const TabsRoot: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
/** Контролируемое значение активного таба. */
|
|
29
|
+
value?: string;
|
|
30
|
+
/** Начальное значение (неконтролируемый режим). */
|
|
31
|
+
defaultValue?: string;
|
|
32
|
+
onValueChange?: (value: string) => void;
|
|
33
|
+
orientation?: TabsOrientation;
|
|
34
|
+
size?: TabsSize;
|
|
35
|
+
variant?: TabsVariant;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const TabsList: import('react').ForwardRefExoticComponent<TabsListProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
39
|
+
declare const TabsTab: import('react').ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> & {
|
|
40
|
+
value: string;
|
|
41
|
+
children?: ReactNode;
|
|
42
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
declare const TabsPanel: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
44
|
+
value: string;
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export declare const Tabs: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
/** Контролируемое значение активного таба. */
|
|
50
|
+
value?: string;
|
|
51
|
+
/** Начальное значение (неконтролируемый режим). */
|
|
52
|
+
defaultValue?: string;
|
|
53
|
+
onValueChange?: (value: string) => void;
|
|
54
|
+
orientation?: TabsOrientation;
|
|
55
|
+
size?: TabsSize;
|
|
56
|
+
variant?: TabsVariant;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
59
|
+
Root: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
/** Контролируемое значение активного таба. */
|
|
62
|
+
value?: string;
|
|
63
|
+
/** Начальное значение (неконтролируемый режим). */
|
|
64
|
+
defaultValue?: string;
|
|
65
|
+
onValueChange?: (value: string) => void;
|
|
66
|
+
orientation?: TabsOrientation;
|
|
67
|
+
size?: TabsSize;
|
|
68
|
+
variant?: TabsVariant;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
71
|
+
List: import('react').ForwardRefExoticComponent<TabsListProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
72
|
+
Tab: import('react').ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> & {
|
|
73
|
+
value: string;
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
76
|
+
Panel: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
77
|
+
value: string;
|
|
78
|
+
children?: ReactNode;
|
|
79
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
80
|
+
};
|
|
81
|
+
export { TabsRoot, TabsList, TabsTab, TabsPanel, useTabsContext };
|
|
82
|
+
export type { TabsOrientation, TabsVariant };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tabs, TabsRoot, TabsList, TabsTab, TabsPanel, useTabsContext, type TabsRootProps, type TabsListProps, type TabsTabProps, type TabsPanelProps, type TabsSize, type TabsOrientation, type TabsVariant, } from './Tabs';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
|
+
export type TabsOrientation = "horizontal" | "vertical";
|
|
4
|
+
export type TabsVariant = "default" | "outline" | "secondary";
|
|
5
|
+
export type TabsContextValue = {
|
|
6
|
+
value: string;
|
|
7
|
+
setValue: (next: string) => void;
|
|
8
|
+
orientation: TabsOrientation;
|
|
9
|
+
size: ComponentSize;
|
|
10
|
+
variant: TabsVariant;
|
|
11
|
+
baseId: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
tabElementsRef: RefObject<Map<string, HTMLButtonElement>>;
|
|
14
|
+
layoutEpoch: number;
|
|
15
|
+
notifyTabLayout: () => void;
|
|
16
|
+
};
|
|
17
|
+
declare const TabsContext: import('react').Context<TabsContextValue | null>;
|
|
18
|
+
export declare function useTabsContext(): TabsContextValue;
|
|
19
|
+
export { TabsContext };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { TabsOrientation, TabsVariant } from './tabsContext';
|
|
3
|
+
export declare function useSlidingTabIndicator(listRef: RefObject<HTMLElement | null>, indicatorRef: RefObject<HTMLElement | null>, activeValue: string, orientation: TabsOrientation, variant: TabsVariant, tabElementsRef: RefObject<Map<string, HTMLButtonElement>>, layoutEpoch: number): void;
|