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,27 @@
|
|
|
1
|
+
/** HSV (Hue-Saturation-Value) + Alpha color model used internally. */
|
|
2
|
+
export type HSVA = {
|
|
3
|
+
h: number;
|
|
4
|
+
s: number;
|
|
5
|
+
v: number;
|
|
6
|
+
a: number;
|
|
7
|
+
};
|
|
8
|
+
/** RGBA in 0-255 range; alpha 0-100. */
|
|
9
|
+
export type RGBA = {
|
|
10
|
+
r: number;
|
|
11
|
+
g: number;
|
|
12
|
+
b: number;
|
|
13
|
+
a: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function clampN(n: number, min: number, max: number): number;
|
|
16
|
+
export declare function hsvaToRgba({ h, s, v, a }: HSVA): RGBA;
|
|
17
|
+
export declare function rgbaToHsva({ r, g, b, a }: RGBA): HSVA;
|
|
18
|
+
export declare function rgbaToHex({ r, g, b, a }: RGBA): string;
|
|
19
|
+
export declare function hexToRgba(hex: string): RGBA | null;
|
|
20
|
+
export declare function hsvaToHex(hsva: HSVA): string;
|
|
21
|
+
export declare function hexToHsva(hex: string): HSVA | null;
|
|
22
|
+
/** CSS color string from HSVA */
|
|
23
|
+
export declare function hsvaToColorString(hsva: HSVA): string;
|
|
24
|
+
/** Pure hue color at s=100, v=100 for gradient display */
|
|
25
|
+
export declare function hueToRgbString(hue: number): string;
|
|
26
|
+
/** Inline style for checkerboard (for alpha display) */
|
|
27
|
+
export declare const CHECKER_STYLE: React.CSSProperties;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ColorPicker, useColorPicker, type ColorPickerProps, type ColorPickerTriggerProps, type ColorPickerContentProps, type ColorPickerSize, } from './ColorPicker';
|
|
2
|
+
export { ColorSlider, ColorSliderTrack, type ColorSliderTrackProps, type ColorSliderRootProps, type ColorChannel, type ColorSliderSize, type ColorSliderOrientation, } from './ColorSlider';
|
|
3
|
+
export { ColorSwatch, type ColorSwatchProps, type ColorSwatchSize, type ColorSwatchShape, } from './ColorSwatch';
|
|
4
|
+
export { hsvaToHex, hexToHsva, hsvaToRgba, rgbaToHsva, rgbaToHex, hexToRgba, hsvaToColorString, hueToRgbString, type HSVA, type RGBA, } from './colorUtils';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { ComboBoxOption } from './comboBoxContext';
|
|
3
|
+
export type ComboBoxInputGroupProps = HTMLAttributes<HTMLDivElement>;
|
|
4
|
+
export declare const ComboBoxInputGroup: import('react').ForwardRefExoticComponent<ComboBoxInputGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export type ComboBoxInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "size">;
|
|
6
|
+
export declare const ComboBoxInput: import('react').ForwardRefExoticComponent<ComboBoxInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
|
+
export type ComboBoxTriggerProps = HTMLAttributes<HTMLButtonElement>;
|
|
8
|
+
export declare const ComboBoxTrigger: import('react').ForwardRefExoticComponent<ComboBoxTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export type ComboBoxPopoverProps = HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
offset?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function ComboBoxPopover({ children, className, offset, ...rest }: ComboBoxPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace ComboBoxPopover {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export type ComboBoxOptionsProps = {
|
|
18
|
+
options: ComboBoxOption[];
|
|
19
|
+
};
|
|
20
|
+
/** Внутренний хелпер: прокидывает options в контекст через ComboBoxRoot. */
|
|
21
|
+
export declare function comboBoxOptionSearchHaystack(opt: ComboBoxOption): string;
|
|
22
|
+
export declare function comboBoxOptionMatchesFilter(opt: ComboBoxOption, query: string): boolean;
|
|
23
|
+
export type { ComboBoxOption };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { InputSize, InputStatus, InputVariant } from '../Input';
|
|
3
|
+
import { ComboBoxOption } from './ComboBox';
|
|
4
|
+
export type ComboBoxRootProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
id?: string;
|
|
10
|
+
isRequired?: boolean;
|
|
11
|
+
status?: InputStatus;
|
|
12
|
+
size?: InputSize;
|
|
13
|
+
/** Варианты для simple API и дефолтного `<ComboBox.Popover>`. */
|
|
14
|
+
options?: ComboBoxOption[];
|
|
15
|
+
value?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
onValueChange?: (value: string) => void;
|
|
18
|
+
variant?: InputVariant;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
menuMaxHeight?: string;
|
|
22
|
+
};
|
|
23
|
+
export type ComboBoxSimpleProps = ComboBoxRootProps & {
|
|
24
|
+
options: ComboBoxOption[];
|
|
25
|
+
};
|
|
26
|
+
export declare function ComboBoxRoot({ children, label, hint, error, className, id: idProp, isRequired, status, size, options, value: valueProp, defaultValue, onValueChange, variant, disabled, placeholder, menuMaxHeight, ...rest }: ComboBoxRootProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace ComboBoxRoot {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
export type ComboBoxHintProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
status?: Exclude<InputStatus, "danger"> | "default";
|
|
33
|
+
};
|
|
34
|
+
export declare function ComboBoxHint({ children, status, className, id: idProp, ...rest }: ComboBoxHintProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare namespace ComboBoxHint {
|
|
36
|
+
var displayName: string;
|
|
37
|
+
}
|
|
38
|
+
export type ComboBoxErrorProps = HTMLAttributes<HTMLParagraphElement> & {
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
export declare function ComboBoxError({ children, className, id: idProp, ...rest }: ComboBoxErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare namespace ComboBoxError {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { InputSize, InputStatus, InputVariant } from '../Input';
|
|
3
|
+
export type ComboBoxOption = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
hint?: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
filterText?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ComboBoxFieldContextValue = {
|
|
12
|
+
comboBoxId: string;
|
|
13
|
+
hintId: string;
|
|
14
|
+
errorId: string;
|
|
15
|
+
labelId: string;
|
|
16
|
+
hintConnected: boolean;
|
|
17
|
+
errorConnected: boolean;
|
|
18
|
+
isRequired: boolean;
|
|
19
|
+
status: InputStatus;
|
|
20
|
+
size: InputSize;
|
|
21
|
+
};
|
|
22
|
+
export type ComboBoxContextValue = ComboBoxFieldContextValue & {
|
|
23
|
+
open: boolean;
|
|
24
|
+
setOpen: (open: boolean) => void;
|
|
25
|
+
value: string;
|
|
26
|
+
setValue: (value: string) => void;
|
|
27
|
+
filterQuery: string;
|
|
28
|
+
setFilterQuery: (query: string) => void;
|
|
29
|
+
listId: string;
|
|
30
|
+
activeValue: string | null;
|
|
31
|
+
setActiveValue: (value: string | null) => void;
|
|
32
|
+
anchorRef: RefObject<HTMLDivElement | null>;
|
|
33
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
34
|
+
variant: InputVariant;
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
placeholder: string;
|
|
37
|
+
menuMaxHeight: string;
|
|
38
|
+
options: ComboBoxOption[];
|
|
39
|
+
filteredValues: string[];
|
|
40
|
+
};
|
|
41
|
+
declare const ComboBoxFieldContext: import('react').Context<ComboBoxFieldContextValue | null>;
|
|
42
|
+
declare const ComboBoxContext: import('react').Context<ComboBoxContextValue | null>;
|
|
43
|
+
export declare function useComboBoxFieldContext(): ComboBoxFieldContextValue;
|
|
44
|
+
export declare function useOptionalComboBoxFieldContext(): ComboBoxFieldContextValue | null;
|
|
45
|
+
export declare function useComboBoxContext(): ComboBoxContextValue;
|
|
46
|
+
export declare function useOptionalComboBoxContext(): ComboBoxContextValue | null;
|
|
47
|
+
export { ComboBoxFieldContext, ComboBoxContext };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComboBoxPopover, ComboBoxOption } from './ComboBox';
|
|
2
|
+
import { ComboBoxError, ComboBoxHint, ComboBoxRoot } from './ComboBoxField';
|
|
3
|
+
export declare const ComboBox: typeof ComboBoxRoot & {
|
|
4
|
+
Label: import('../Label').LabelComponent;
|
|
5
|
+
InputGroup: import('react').ForwardRefExoticComponent<import('./ComboBox').ComboBoxInputGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Input: import('react').ForwardRefExoticComponent<import('./ComboBox').ComboBoxInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
7
|
+
Trigger: import('react').ForwardRefExoticComponent<import('./ComboBox').ComboBoxTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
Popover: typeof ComboBoxPopover;
|
|
9
|
+
Hint: typeof ComboBoxHint;
|
|
10
|
+
Error: typeof ComboBoxError;
|
|
11
|
+
};
|
|
12
|
+
export type { ComboBoxOption };
|
|
13
|
+
export type { ComboBoxRootProps, ComboBoxSimpleProps, ComboBoxHintProps, ComboBoxErrorProps, } from './ComboBoxField';
|
|
14
|
+
export type { ComboBoxInputGroupProps, ComboBoxInputProps, ComboBoxTriggerProps, ComboBoxPopoverProps, } from './ComboBox';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type DisclosureVariant = "default" | "outline" | "secondary" | "card" | "ghost";
|
|
3
|
+
export type DisclosureSize = "small" | "base" | "mid" | "large";
|
|
4
|
+
export type DisclosureIconPos = "left" | "right";
|
|
5
|
+
export type DisclosureTriggerProps = HTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
icon?: ReactNode | null;
|
|
8
|
+
};
|
|
9
|
+
export type DisclosureContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type DisclosureProps = HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
open?: boolean;
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
value?: string;
|
|
18
|
+
variant?: DisclosureVariant;
|
|
19
|
+
size?: DisclosureSize;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
iconPos?: DisclosureIconPos;
|
|
22
|
+
};
|
|
23
|
+
export declare const Disclosure: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
open?: boolean;
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
value?: string;
|
|
29
|
+
variant?: DisclosureVariant;
|
|
30
|
+
size?: DisclosureSize;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
iconPos?: DisclosureIconPos;
|
|
33
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
34
|
+
Trigger: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
icon?: ReactNode | null;
|
|
37
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
41
|
+
};
|
|
42
|
+
export type DisclosureGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
accordion?: boolean;
|
|
45
|
+
separated?: boolean;
|
|
46
|
+
variant?: DisclosureVariant;
|
|
47
|
+
size?: DisclosureSize;
|
|
48
|
+
value?: string | null;
|
|
49
|
+
defaultValue?: string | null;
|
|
50
|
+
onValueChange?: (value: string | null) => void;
|
|
51
|
+
};
|
|
52
|
+
export declare const DisclosureGroup: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
accordion?: boolean;
|
|
55
|
+
separated?: boolean;
|
|
56
|
+
variant?: DisclosureVariant;
|
|
57
|
+
size?: DisclosureSize;
|
|
58
|
+
value?: string | null;
|
|
59
|
+
defaultValue?: string | null;
|
|
60
|
+
onValueChange?: (value: string | null) => void;
|
|
61
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Disclosure, DisclosureGroup, type DisclosureProps, type DisclosureGroupProps, type DisclosureTriggerProps, type DisclosureContentProps, type DisclosureVariant, type DisclosureSize, type DisclosureIconPos, } from './Disclosure';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { CloseButtonProps } from '../CloseButton';
|
|
3
|
+
import { DrawerPlacement } from './drawerTypes';
|
|
4
|
+
export type { DrawerPlacement };
|
|
5
|
+
export type DrawerSize = "default" | "mid" | "full";
|
|
6
|
+
export type DrawerProps = {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** Откуда выезжает ящик. По умолчанию `right`. */
|
|
11
|
+
placement?: DrawerPlacement;
|
|
12
|
+
/** Ширина/высота панели. `default` — до 24rem, `mid` — половина экрана, `full` — весь экран. */
|
|
13
|
+
size?: DrawerSize;
|
|
14
|
+
/** Доп. класс на панель. */
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
export type DrawerBackdropProps = HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
/** Закрывать по клику вне панели. По умолчанию `true`. */
|
|
19
|
+
isDismissable?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type DrawerHandleProps = HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
export type DrawerHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
export type DrawerHeadingBlockProps = HTMLAttributes<HTMLDivElement>;
|
|
24
|
+
export type DrawerTitleProps = HTMLAttributes<HTMLHeadingElement>;
|
|
25
|
+
export type DrawerDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
|
|
26
|
+
export type DrawerBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
27
|
+
export type DrawerFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
export type DrawerCloseProps = CloseButtonProps;
|
|
29
|
+
declare function DrawerBackdropInner(_props: DrawerBackdropProps): null;
|
|
30
|
+
declare function DrawerHandleInner({ className, onPointerDown, ...rest }: DrawerHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function DrawerHeader({ className, ...rest }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function DrawerHeadingBlock({ className, ...rest }: DrawerHeadingBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function DrawerDescription({ className, id, ...rest }: DrawerDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function DrawerBody({ className, ...rest }: DrawerBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function DrawerFooter({ className, ...rest }: DrawerFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const Drawer: (({ open, onOpenChange, children, placement, size, className, }: DrawerProps) => import('react').ReactPortal | null) & {
|
|
37
|
+
/** Конфигурирует подложку (`isDismissable`). Сам ничего не рендерит. */
|
|
38
|
+
Backdrop: typeof DrawerBackdropInner;
|
|
39
|
+
/** Полоска перетягивания для свайп-закрытия. */
|
|
40
|
+
Handle: typeof DrawerHandleInner;
|
|
41
|
+
Header: typeof DrawerHeader;
|
|
42
|
+
HeadingBlock: typeof DrawerHeadingBlock;
|
|
43
|
+
Title: import('react').ForwardRefExoticComponent<DrawerTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
44
|
+
Description: typeof DrawerDescription;
|
|
45
|
+
Close: import('react').ForwardRefExoticComponent<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
46
|
+
variant?: import('../CloseButton').CloseButtonVariant;
|
|
47
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
Body: typeof DrawerBody;
|
|
49
|
+
Footer: typeof DrawerFooter;
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DrawerPlacement = "left" | "right" | "top" | "bottom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Drawer, type DrawerProps, type DrawerPlacement, type DrawerSize, type DrawerBackdropProps, type DrawerHandleProps, type DrawerHeaderProps, type DrawerHeadingBlockProps, type DrawerTitleProps, type DrawerDescriptionProps, type DrawerBodyProps, type DrawerFooterProps, type DrawerCloseProps, } from './Drawer';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PointerEvent as ReactPointerEvent, RefObject } from 'react';
|
|
2
|
+
import { DrawerPlacement } from './drawerTypes';
|
|
3
|
+
export declare function useDrawerHandleDrag(panelRef: RefObject<HTMLElement | null>, placement: DrawerPlacement, onClose: () => void, disabled: boolean,
|
|
4
|
+
/** Ref, который нужно поставить в `true` перед вызовом onClose, чтобы
|
|
5
|
+
* close-эффект в DrawerRoot пропустил повторную анимацию. */
|
|
6
|
+
skipCloseAnimRef?: RefObject<boolean>): {
|
|
7
|
+
onPointerDown: (e: ReactPointerEvent<HTMLElement>) => void;
|
|
8
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SelectionIndicatorSize, SelectionIndicatorVariant } from '../SelectionIndicator';
|
|
2
3
|
export type DropdownProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
3
4
|
children: ReactNode;
|
|
4
5
|
/** Управляемое открытие. */
|
|
@@ -34,8 +35,20 @@ export declare const DropdownTrigger: import('react').ForwardRefExoticComponent<
|
|
|
34
35
|
/** Пробросить пропы на единственного ребёнка (например `<Button />`). */
|
|
35
36
|
asChild?: boolean;
|
|
36
37
|
} & import('react').RefAttributes<HTMLElement>>;
|
|
37
|
-
export type
|
|
38
|
-
|
|
38
|
+
export type DropdownPopoverProps = HTMLAttributes<HTMLDivElement> & {
|
|
39
|
+
/** Классы для внутренней панели меню (`Popover.Body`): padding, gap, max-height, … */
|
|
40
|
+
bodyClassName?: string;
|
|
41
|
+
};
|
|
42
|
+
export type DropdownContentProps = DropdownPopoverProps;
|
|
43
|
+
export declare const DropdownPopover: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
44
|
+
/** Классы для внутренней панели меню (`Popover.Body`): padding, gap, max-height, … */
|
|
45
|
+
bodyClassName?: string;
|
|
46
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
47
|
+
/** @deprecated Используйте `Dropdown.Popover`. */
|
|
48
|
+
export declare const DropdownContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
49
|
+
/** Классы для внутренней панели меню (`Popover.Body`): padding, gap, max-height, … */
|
|
50
|
+
bodyClassName?: string;
|
|
51
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
39
52
|
export type DropdownGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
40
53
|
/**
|
|
41
54
|
* Переопределить показ индикатора выбора слева для этой группы и вложенных групп (только при одиночном выборе).
|
|
@@ -51,7 +64,7 @@ export declare namespace DropdownGroup {
|
|
|
51
64
|
var displayName: string;
|
|
52
65
|
}
|
|
53
66
|
export type DropdownLabelProps = HTMLAttributes<HTMLDivElement>;
|
|
54
|
-
export declare function DropdownLabel({ className, children, ...rest }: DropdownLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export declare function DropdownLabel({ className, children, id: idProp, ...rest }: DropdownLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
55
68
|
export declare namespace DropdownLabel {
|
|
56
69
|
var displayName: string;
|
|
57
70
|
}
|
|
@@ -78,65 +91,103 @@ export declare const DropdownSubTrigger: import('react').ForwardRefExoticCompone
|
|
|
78
91
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
79
92
|
export type DropdownSubContentProps = HTMLAttributes<HTMLDivElement>;
|
|
80
93
|
export declare const DropdownSubContent: import('react').ForwardRefExoticComponent<DropdownSubContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
94
|
+
export type DropdownItemLabelProps = HTMLAttributes<HTMLSpanElement>;
|
|
95
|
+
export declare function DropdownItemLabel(props: DropdownItemLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export declare namespace DropdownItemLabel {
|
|
97
|
+
var displayName: string;
|
|
98
|
+
}
|
|
99
|
+
export type DropdownItemHintProps = HTMLAttributes<HTMLSpanElement>;
|
|
100
|
+
export declare function DropdownItemHint(props: DropdownItemHintProps): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
export declare namespace DropdownItemHint {
|
|
102
|
+
var displayName: string;
|
|
103
|
+
}
|
|
104
|
+
export type DropdownItemIconProps = HTMLAttributes<HTMLSpanElement>;
|
|
105
|
+
export declare function DropdownItemIcon(props: DropdownItemIconProps): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
export declare namespace DropdownItemIcon {
|
|
107
|
+
var displayName: string;
|
|
108
|
+
}
|
|
109
|
+
export type DropdownItemIndicatorProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
110
|
+
variant?: SelectionIndicatorVariant;
|
|
111
|
+
size?: SelectionIndicatorSize;
|
|
112
|
+
/** Галочка при выборе; по умолчанию — в режиме `multiple`. */
|
|
113
|
+
check?: boolean;
|
|
114
|
+
/** Своя иконка поверх заливки вместо галочки. */
|
|
115
|
+
children?: ReactNode;
|
|
116
|
+
};
|
|
117
|
+
export declare function DropdownItemIndicator({ variant, size, check, children, className, ...rest }: DropdownItemIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
118
|
+
export declare namespace DropdownItemIndicator {
|
|
119
|
+
var displayName: string;
|
|
120
|
+
}
|
|
81
121
|
export type DropdownItemVariant = "default" | "danger" | "warning" | "info" | "success";
|
|
82
|
-
export type DropdownItemProps = Omit<HTMLAttributes<
|
|
83
|
-
/**
|
|
84
|
-
|
|
122
|
+
export type DropdownItemProps = Omit<HTMLAttributes<HTMLElement>, "value"> & {
|
|
123
|
+
/**
|
|
124
|
+
* Ключ для режима выбора. Не нужен при `selection={false}` или при `href`.
|
|
125
|
+
*/
|
|
126
|
+
value?: string;
|
|
127
|
+
/** Навигационная ссылка — рендер `<a role="menuitem">`; выбор значения отключён. */
|
|
128
|
+
href?: string;
|
|
85
129
|
disabled?: boolean;
|
|
86
130
|
/**
|
|
87
131
|
* Пункт участвует в выборе значения; при `multiple` или при включённом `selectionIndicator` у `Dropdown` / `Dropdown.Group` слева показывается индикатор.
|
|
88
132
|
* `false` — действие: без выбора значения; клик закрывает меню.
|
|
89
133
|
*/
|
|
90
134
|
selection?: boolean;
|
|
91
|
-
/** Семантический цвет подписи и строки (
|
|
135
|
+
/** Семантический цвет подписи и строки (hint наследует тон с прозрачностью). */
|
|
92
136
|
variant?: DropdownItemVariant;
|
|
93
|
-
/** Второстепенная строка под заголовком. */
|
|
94
|
-
description?: ReactNode;
|
|
95
|
-
/** Справа: подсказка или иконка (`text-muted` у варианта `default`). */
|
|
96
|
-
hint?: ReactNode;
|
|
97
137
|
};
|
|
98
|
-
export declare const DropdownItem: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<
|
|
99
|
-
/**
|
|
100
|
-
|
|
138
|
+
export declare const DropdownItem: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "value"> & {
|
|
139
|
+
/**
|
|
140
|
+
* Ключ для режима выбора. Не нужен при `selection={false}` или при `href`.
|
|
141
|
+
*/
|
|
142
|
+
value?: string;
|
|
143
|
+
/** Навигационная ссылка — рендер `<a role="menuitem">`; выбор значения отключён. */
|
|
144
|
+
href?: string;
|
|
101
145
|
disabled?: boolean;
|
|
102
146
|
/**
|
|
103
147
|
* Пункт участвует в выборе значения; при `multiple` или при включённом `selectionIndicator` у `Dropdown` / `Dropdown.Group` слева показывается индикатор.
|
|
104
148
|
* `false` — действие: без выбора значения; клик закрывает меню.
|
|
105
149
|
*/
|
|
106
150
|
selection?: boolean;
|
|
107
|
-
/** Семантический цвет подписи и строки (
|
|
151
|
+
/** Семантический цвет подписи и строки (hint наследует тон с прозрачностью). */
|
|
108
152
|
variant?: DropdownItemVariant;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/** Справа: подсказка или иконка (`text-muted` у варианта `default`). */
|
|
112
|
-
hint?: ReactNode;
|
|
113
|
-
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
114
|
-
/** Составной API: `Dropdown.Trigger`, `Dropdown.Content`, `Dropdown.Item`, … — как у `Expandable.Panel`. */
|
|
153
|
+
} & import('react').RefAttributes<HTMLElement>>;
|
|
154
|
+
/** Составной API: `Dropdown.Trigger`, `Dropdown.Popover`, `Dropdown.Item`, … */
|
|
115
155
|
export declare const Dropdown: typeof DropdownRoot & {
|
|
116
156
|
Trigger: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
117
157
|
/** Пробросить пропы на единственного ребёнка (например `<Button />`). */
|
|
118
158
|
asChild?: boolean;
|
|
119
159
|
} & import('react').RefAttributes<HTMLElement>>;
|
|
120
|
-
|
|
160
|
+
Popover: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
161
|
+
/** Классы для внутренней панели меню (`Popover.Body`): padding, gap, max-height, … */
|
|
162
|
+
bodyClassName?: string;
|
|
163
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
164
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
165
|
+
/** Классы для внутренней панели меню (`Popover.Body`): padding, gap, max-height, … */
|
|
166
|
+
bodyClassName?: string;
|
|
167
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
121
168
|
Group: typeof DropdownGroup;
|
|
122
169
|
Label: typeof DropdownLabel;
|
|
123
170
|
Separator: typeof DropdownSeparator;
|
|
124
|
-
Item: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<
|
|
125
|
-
/**
|
|
126
|
-
|
|
171
|
+
Item: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "value"> & {
|
|
172
|
+
/**
|
|
173
|
+
* Ключ для режима выбора. Не нужен при `selection={false}` или при `href`.
|
|
174
|
+
*/
|
|
175
|
+
value?: string;
|
|
176
|
+
/** Навигационная ссылка — рендер `<a role="menuitem">`; выбор значения отключён. */
|
|
177
|
+
href?: string;
|
|
127
178
|
disabled?: boolean;
|
|
128
179
|
/**
|
|
129
180
|
* Пункт участвует в выборе значения; при `multiple` или при включённом `selectionIndicator` у `Dropdown` / `Dropdown.Group` слева показывается индикатор.
|
|
130
181
|
* `false` — действие: без выбора значения; клик закрывает меню.
|
|
131
182
|
*/
|
|
132
183
|
selection?: boolean;
|
|
133
|
-
/** Семантический цвет подписи и строки (
|
|
184
|
+
/** Семантический цвет подписи и строки (hint наследует тон с прозрачностью). */
|
|
134
185
|
variant?: DropdownItemVariant;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
186
|
+
} & import('react').RefAttributes<HTMLElement>>;
|
|
187
|
+
ItemLabel: typeof DropdownItemLabel;
|
|
188
|
+
ItemHint: typeof DropdownItemHint;
|
|
189
|
+
ItemIcon: typeof DropdownItemIcon;
|
|
190
|
+
ItemIndicator: typeof DropdownItemIndicator;
|
|
140
191
|
Sub: typeof DropdownSub;
|
|
141
192
|
SubTrigger: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
142
193
|
/** Пробросить пропы на единственного ребёнка (обёртка вокруг текста). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Dropdown, DropdownTrigger, DropdownContent, DropdownGroup, DropdownLabel, DropdownSeparator, DropdownItem, DropdownSub, DropdownSubTrigger, DropdownSubContent, type DropdownProps, type DropdownTriggerProps, type DropdownContentProps, type DropdownGroupProps, type DropdownLabelProps, type DropdownSeparatorProps, type DropdownItemProps, type DropdownItemVariant, type DropdownSubProps, type DropdownSubTriggerProps, type DropdownSubContentProps, } from './Dropdown';
|
|
1
|
+
export { Dropdown, DropdownTrigger, DropdownPopover, DropdownContent, DropdownGroup, DropdownLabel, DropdownSeparator, DropdownItem, DropdownItemLabel, DropdownItemHint, DropdownItemIcon, DropdownItemIndicator, DropdownSub, DropdownSubTrigger, DropdownSubContent, type DropdownProps, type DropdownTriggerProps, type DropdownPopoverProps, type DropdownContentProps, type DropdownGroupProps, type DropdownLabelProps, type DropdownSeparatorProps, type DropdownItemProps, type DropdownItemLabelProps, type DropdownItemHintProps, type DropdownItemIconProps, type DropdownItemIndicatorProps, type DropdownItemVariant, type DropdownSubProps, type DropdownSubTriggerProps, type DropdownSubContentProps, } from './Dropdown';
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type ExpandableRootProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Составная разметка (`Trigger` / `Panel` и слоты).
|
|
6
|
+
* `Accordion.Item` включает автоматически.
|
|
7
|
+
*/
|
|
8
|
+
compound?: boolean;
|
|
9
|
+
/** Simple API: заголовок триггера. В compound игнорируется. */
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
/** Simple API: подзаголовок под заголовком. В compound — `<Expandable.Description>`. */
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** Simple API: иконка слева от текста. В compound — `<Expandable.Icon>`. */
|
|
14
|
+
icon?: ReactNode;
|
|
4
15
|
defaultOpen?: boolean;
|
|
5
16
|
open?: boolean;
|
|
6
17
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -11,20 +22,58 @@ export type ExpandableTriggerProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
11
22
|
hideChevron?: boolean;
|
|
12
23
|
};
|
|
13
24
|
export type ExpandableIconProps = HTMLAttributes<HTMLSpanElement>;
|
|
25
|
+
export type ExpandableMessageProps = HTMLAttributes<HTMLDivElement>;
|
|
14
26
|
export type ExpandableContentProps = HTMLAttributes<HTMLDivElement>;
|
|
15
|
-
export type ExpandableTitleProps = HTMLAttributes<
|
|
16
|
-
export type ExpandableDescriptionProps = HTMLAttributes<
|
|
27
|
+
export type ExpandableTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
export type ExpandableDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
17
29
|
export type ExpandableChevronProps = HTMLAttributes<HTMLSpanElement>;
|
|
18
30
|
export type ExpandablePanelProps = HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
type ExpandableContextValue = {
|
|
32
|
+
open: boolean;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
hasPanel: boolean;
|
|
35
|
+
toggle: () => void;
|
|
36
|
+
headerId: string;
|
|
37
|
+
panelId: string;
|
|
38
|
+
setHasPanel: (v: boolean) => void;
|
|
39
|
+
};
|
|
40
|
+
declare function useExpandable(): ExpandableContextValue;
|
|
41
|
+
export { useExpandable as useExpandableContext };
|
|
19
42
|
declare function ExpandableIcon({ className, ...props }: ExpandableIconProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare namespace ExpandableIcon {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
20
46
|
declare function ExpandableContent({ className, ...props }: ExpandableContentProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare namespace ExpandableContent {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
21
50
|
declare function ExpandableTitle({ className, ...props }: ExpandableTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare namespace ExpandableTitle {
|
|
52
|
+
var displayName: string;
|
|
53
|
+
}
|
|
22
54
|
declare function ExpandableDescription({ className, ...props }: ExpandableDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
declare namespace ExpandableDescription {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
23
58
|
declare function ExpandableChevron({ className, ...props }: ExpandableChevronProps): import("react/jsx-runtime").JSX.Element | null;
|
|
59
|
+
declare namespace ExpandableChevron {
|
|
60
|
+
var displayName: string;
|
|
61
|
+
}
|
|
24
62
|
export type ExpandableProps = ExpandableRootProps;
|
|
25
|
-
/** Раскрывающийся
|
|
63
|
+
/** Раскрывающийся блок. **Simple** — `title`, `description`, `icon` на root, контент в `children`. **Compound** — `Trigger`, `Panel`, опционально `Message`, `Icon`, `Content`, `Title`, `Description`, `Chevron`. */
|
|
26
64
|
export declare const Expandable: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
27
65
|
children?: ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Составная разметка (`Trigger` / `Panel` и слоты).
|
|
68
|
+
* `Accordion.Item` включает автоматически.
|
|
69
|
+
*/
|
|
70
|
+
compound?: boolean;
|
|
71
|
+
/** Simple API: заголовок триггера. В compound игнорируется. */
|
|
72
|
+
title?: ReactNode;
|
|
73
|
+
/** Simple API: подзаголовок под заголовком. В compound — `<Expandable.Description>`. */
|
|
74
|
+
description?: ReactNode;
|
|
75
|
+
/** Simple API: иконка слева от текста. В compound — `<Expandable.Icon>`. */
|
|
76
|
+
icon?: ReactNode;
|
|
28
77
|
defaultOpen?: boolean;
|
|
29
78
|
open?: boolean;
|
|
30
79
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -34,6 +83,7 @@ export declare const Expandable: import('react').ForwardRefExoticComponent<Omit<
|
|
|
34
83
|
/** Если `true`, автоматический шеврон справа не показывается — используйте `<Expandable.Chevron />` внутри. */
|
|
35
84
|
hideChevron?: boolean;
|
|
36
85
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
86
|
+
Message: import('react').ForwardRefExoticComponent<ExpandableMessageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
87
|
Icon: typeof ExpandableIcon;
|
|
38
88
|
Content: typeof ExpandableContent;
|
|
39
89
|
Title: typeof ExpandableTitle;
|
|
@@ -41,4 +91,3 @@ export declare const Expandable: import('react').ForwardRefExoticComponent<Omit<
|
|
|
41
91
|
Chevron: typeof ExpandableChevron;
|
|
42
92
|
Panel: import('react').ForwardRefExoticComponent<ExpandablePanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
43
93
|
};
|
|
44
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Expandable, type ExpandableProps, type ExpandableRootProps, type ExpandableTriggerProps, type ExpandableIconProps, type ExpandableContentProps, type ExpandableTitleProps, type ExpandableDescriptionProps, type ExpandableChevronProps, type ExpandablePanelProps, } from './Expandable';
|
|
1
|
+
export { Expandable, useExpandableContext, type ExpandableProps, type ExpandableRootProps, type ExpandableTriggerProps, type ExpandableMessageProps, type ExpandableIconProps, type ExpandableContentProps, type ExpandableTitleProps, type ExpandableDescriptionProps, type ExpandableChevronProps, type ExpandablePanelProps, } from './Expandable';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { LabelProps } from '../Label';
|
|
3
|
+
import { TextVariant } from '../Text';
|
|
4
|
+
export type FieldHintStatus = "default" | "danger" | "success" | "warning";
|
|
5
|
+
export type FieldRootProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare function FieldRoot({ className, children, ...rest }: FieldRootProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export type FieldHintProps = HTMLAttributes<HTMLElement> & {
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
status?: FieldHintStatus;
|
|
12
|
+
/** Тег подсказки. `span` — внутри label/grid; `p` — под полем. */
|
|
13
|
+
as?: "p" | "span";
|
|
14
|
+
variant?: TextVariant;
|
|
15
|
+
};
|
|
16
|
+
export declare function FieldHint({ children, className, status, as, variant, ...rest }: FieldHintProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export type FieldLabelProps = LabelProps;
|
|
18
|
+
export declare const FieldLabel: import('../Label').LabelComponent;
|
|
19
|
+
export type FieldErrorProps = Omit<FieldHintProps, "status">;
|
|
20
|
+
/** Сообщение об ошибке поля (`FieldHint` со `status="danger"`). */
|
|
21
|
+
export declare function FieldError({ role, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|