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,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Семантический тон алерта и заливки. */
|
|
3
|
+
export type AlertStatus = "default" | "outline" | "secondary" | "danger" | "success" | "info" | "warning";
|
|
4
|
+
export type AlertLiveRole = "status" | "alert";
|
|
5
|
+
export declare function alertHasTitle(children: ReactNode): boolean;
|
|
6
|
+
export declare function alertHasDescription(children: ReactNode): boolean;
|
|
7
|
+
export declare function hasAlertCompoundChildren(children: ReactNode): boolean;
|
|
8
|
+
/** `alert` для срочных тонов; иначе `status`. */
|
|
9
|
+
export declare function resolveAlertLiveRole(status: AlertStatus, roleProp?: AlertLiveRole): AlertLiveRole;
|
|
10
|
+
export declare function resolveAlertAriaLabelledBy(titleId: string, descriptionId: string, hasTitle: boolean, hasDescription: boolean): string | undefined;
|
|
11
|
+
export declare function resolveAlertAriaDescribedBy(descriptionId: string, hasTitle: boolean, hasDescription: boolean): string | undefined;
|
|
12
|
+
export declare function resolveAlertStatus(status?: AlertStatus): AlertStatus;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Alert, resolveAlertStatus, type AlertProps, type
|
|
1
|
+
export { Alert, resolveAlertStatus, type AlertProps, type AlertStatus, type AlertIndicatorProps, type AlertContentProps, type AlertMessageProps, type AlertTitleProps, type AlertDescriptionProps, type AlertActionProps, } from './Alert';
|
|
2
|
+
export { resolveAlertLiveRole, type AlertLiveRole } from './alertUtils';
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { ImgHTMLAttributes, HTMLAttributes } from 'react';
|
|
2
2
|
import { TooltipSide, TooltipSize, TooltipVariant } from '../Tooltip';
|
|
3
3
|
/** Размер круга аватара. */
|
|
4
|
-
export type AvatarSize = "small" | "base" | "large";
|
|
4
|
+
export type AvatarSize = "small" | "base" | "mid" | "large";
|
|
5
5
|
export type AvatarProps = Omit<HTMLAttributes<HTMLDivElement>, "aria-label"> & {
|
|
6
|
-
/** Круг диаметром small / base / large. По умолчанию `base`. */
|
|
6
|
+
/** Круг диаметром small / base / mid / large. По умолчанию `base`. */
|
|
7
7
|
size?: AvatarSize;
|
|
8
8
|
/** Подпись пользователя — первая буква во `Avatar.Fallback`, если там нет текста; также `aria-label` корня. */
|
|
9
9
|
label?: string;
|
|
10
|
+
/** URL фото — только **simple API** (без `children`). В compound игнорируется. */
|
|
11
|
+
src?: string;
|
|
12
|
+
/** `alt` для `<img>` в simple API. По умолчанию пустая строка. */
|
|
13
|
+
alt?: string;
|
|
14
|
+
/** `loading` для `<img>` в simple API. */
|
|
15
|
+
loading?: ImgHTMLAttributes<HTMLImageElement>["loading"];
|
|
10
16
|
/** Никнейм во всплывающем `Tooltip` при наведении. Без текста тултип не показывается. */
|
|
11
17
|
nickname?: string;
|
|
12
18
|
/** Размер тултипа при заданном `nickname`. По умолчанию `base`. */
|
|
@@ -19,12 +25,18 @@ export type AvatarProps = Omit<HTMLAttributes<HTMLDivElement>, "aria-label"> & {
|
|
|
19
25
|
export type AvatarImageProps = ImgHTMLAttributes<HTMLImageElement>;
|
|
20
26
|
export type AvatarFallbackProps = HTMLAttributes<HTMLSpanElement>;
|
|
21
27
|
export type AvatarGroupProps = HTMLAttributes<HTMLDivElement>;
|
|
22
|
-
/** Аватар:
|
|
28
|
+
/** Аватар: simple (`src` + `label`) или compound (`Avatar.Image` / `Avatar.Fallback`). */
|
|
23
29
|
export declare const Avatar: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "aria-label"> & {
|
|
24
|
-
/** Круг диаметром small / base / large. По умолчанию `base`. */
|
|
30
|
+
/** Круг диаметром small / base / mid / large. По умолчанию `base`. */
|
|
25
31
|
size?: AvatarSize;
|
|
26
32
|
/** Подпись пользователя — первая буква во `Avatar.Fallback`, если там нет текста; также `aria-label` корня. */
|
|
27
33
|
label?: string;
|
|
34
|
+
/** URL фото — только **simple API** (без `children`). В compound игнорируется. */
|
|
35
|
+
src?: string;
|
|
36
|
+
/** `alt` для `<img>` в simple API. По умолчанию пустая строка. */
|
|
37
|
+
alt?: string;
|
|
38
|
+
/** `loading` для `<img>` в simple API. */
|
|
39
|
+
loading?: ImgHTMLAttributes<HTMLImageElement>["loading"];
|
|
28
40
|
/** Никнейм во всплывающем `Tooltip` при наведении. Без текста тултип не показывается. */
|
|
29
41
|
nickname?: string;
|
|
30
42
|
/** Размер тултипа при заданном `nickname`. По умолчанию `base`. */
|
|
@@ -6,10 +6,12 @@ export type BadgeTone = AlertStatus;
|
|
|
6
6
|
export type BadgeColor = BadgeTone;
|
|
7
7
|
/** @deprecated Используйте `BadgeColor`; оставлено для совместимости. */
|
|
8
8
|
export type BadgeVariant = BadgeTone;
|
|
9
|
-
export type BadgeSize = "small" | "base" | "large";
|
|
9
|
+
export type BadgeSize = "small" | "base" | "mid" | "large";
|
|
10
10
|
/** Угол привязки внутри `Badge.Anchor`. */
|
|
11
11
|
export type BadgePlacement = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
12
12
|
export type BadgeIconPosition = "start" | "end";
|
|
13
|
+
/** Значение `data-icon` на inline-иконке в children. */
|
|
14
|
+
export type BadgeInlineIconPosition = "inline-start" | "inline-end";
|
|
13
15
|
/** Устаревший литерал из API; сводим к `secondary`. */
|
|
14
16
|
type BadgeToneProp = BadgeTone | "accent";
|
|
15
17
|
export type BadgeAnchorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
@@ -33,8 +35,9 @@ export type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
|
33
35
|
color?: BadgeToneProp;
|
|
34
36
|
/** Совместимость с прежним API; если задан только он — работает как `color`. */
|
|
35
37
|
variant?: BadgeToneProp;
|
|
36
|
-
/** `small` · `base` · `large`. По умолчанию `base`. */
|
|
38
|
+
/** `small` · `base` · `mid` · `large`. По умолчанию `base`. */
|
|
37
39
|
size?: BadgeSize;
|
|
40
|
+
/** Simple API: иконка через prop. Игнорируется, если в `children` есть элемент с `data-icon`. */
|
|
38
41
|
icon?: ReactNode;
|
|
39
42
|
iconPosition?: BadgeIconPosition;
|
|
40
43
|
iconOnly?: boolean;
|
|
@@ -44,6 +47,10 @@ export type BadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
|
44
47
|
* По умолчанию `top-right`. Внутри вложенных контейнеров не действует.
|
|
45
48
|
*/
|
|
46
49
|
placement?: BadgePlacement;
|
|
50
|
+
/**
|
|
51
|
+
* Текст или compound-иконки: `data-icon="inline-start" | "inline-end"` (также `start` / `end`).
|
|
52
|
+
* Декоративные иконки получают `aria-hidden`, если нет `aria-label`.
|
|
53
|
+
*/
|
|
47
54
|
children?: ReactNode;
|
|
48
55
|
};
|
|
49
56
|
/** Компактный статус-бейдж; с `Badge.Anchor` — наложение и hover-scale как у `Button`. */
|
|
@@ -52,8 +59,9 @@ export declare const Badge: import('react').ForwardRefExoticComponent<Omit<HTMLA
|
|
|
52
59
|
color?: BadgeToneProp;
|
|
53
60
|
/** Совместимость с прежним API; если задан только он — работает как `color`. */
|
|
54
61
|
variant?: BadgeToneProp;
|
|
55
|
-
/** `small` · `base` · `large`. По умолчанию `base`. */
|
|
62
|
+
/** `small` · `base` · `mid` · `large`. По умолчанию `base`. */
|
|
56
63
|
size?: BadgeSize;
|
|
64
|
+
/** Simple API: иконка через prop. Игнорируется, если в `children` есть элемент с `data-icon`. */
|
|
57
65
|
icon?: ReactNode;
|
|
58
66
|
iconPosition?: BadgeIconPosition;
|
|
59
67
|
iconOnly?: boolean;
|
|
@@ -63,6 +71,10 @@ export declare const Badge: import('react').ForwardRefExoticComponent<Omit<HTMLA
|
|
|
63
71
|
* По умолчанию `top-right`. Внутри вложенных контейнеров не действует.
|
|
64
72
|
*/
|
|
65
73
|
placement?: BadgePlacement;
|
|
74
|
+
/**
|
|
75
|
+
* Текст или compound-иконки: `data-icon="inline-start" | "inline-end"` (также `start` / `end`).
|
|
76
|
+
* Декоративные иконки получают `aria-hidden`, если нет `aria-label`.
|
|
77
|
+
*/
|
|
66
78
|
children?: ReactNode;
|
|
67
79
|
} & import('react').RefAttributes<HTMLSpanElement>> & {
|
|
68
80
|
Anchor: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Badge, BadgeAnchor, type BadgeProps, type BadgeTone, type BadgeColor, type BadgeVariant, type BadgeSize, type BadgePlacement, type BadgeIconPosition, type BadgeAnchorProps, } from './Badge';
|
|
1
|
+
export { Badge, BadgeAnchor, type BadgeProps, type BadgeTone, type BadgeColor, type BadgeVariant, type BadgeSize, type BadgePlacement, type BadgeIconPosition, type BadgeInlineIconPosition, type BadgeAnchorProps, } from './Badge';
|
|
@@ -1,19 +1,38 @@
|
|
|
1
|
-
import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
export type
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { HTMLAttributes, MouseEvent, OlHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type BreadcrumbsProps = Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
3
|
+
/** Сжимать длинные цепочки: первый · … · два последних. По умолчанию `true`. */
|
|
4
|
+
collapse?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export type BreadcrumbsListProps = OlHTMLAttributes<HTMLOListElement> & {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type BreadcrumbsItemProps = {
|
|
6
11
|
href?: string;
|
|
7
|
-
/** Клик без навигации (кнопка). */
|
|
8
12
|
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
13
|
+
/** Текущая страница; по умолчанию последний пункт. */
|
|
14
|
+
current?: boolean;
|
|
15
|
+
children?: ReactNode;
|
|
9
16
|
};
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
/** Маркер данных для `Breadcrumbs.List` — в DOM не рендерится. */
|
|
18
|
+
declare function BreadcrumbsItem(_props: BreadcrumbsItemProps): null;
|
|
19
|
+
declare namespace BreadcrumbsItem {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
/** Разделитель для кастомной разметки; в `Breadcrumbs.List` chevron добавляется автоматически. */
|
|
23
|
+
declare function BreadcrumbsSeparator({ className, ...rest }: HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare namespace BreadcrumbsSeparator {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const Breadcrumbs: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
28
|
+
/** Сжимать длинные цепочки: первый · … · два последних. По умолчанию `true`. */
|
|
29
|
+
collapse?: boolean;
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
} & import('react').RefAttributes<HTMLElement>> & {
|
|
32
|
+
List: import('react').ForwardRefExoticComponent<OlHTMLAttributes<HTMLOListElement> & {
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
} & import('react').RefAttributes<HTMLOListElement>>;
|
|
35
|
+
Item: typeof BreadcrumbsItem;
|
|
36
|
+
Separator: typeof BreadcrumbsSeparator;
|
|
12
37
|
};
|
|
13
|
-
|
|
14
|
-
* Навигационная цепочка: последний пункт — текст; остальные — `muted` с hover-scale и squeeze при нажатии (без тени и без рамки при клике мышью).
|
|
15
|
-
* Если сегментов больше трёх: первый, затем «…», затем два последних.
|
|
16
|
-
*/
|
|
17
|
-
export declare const Breadcrumbs: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children" | "role"> & {
|
|
18
|
-
items: readonly BreadcrumbItem[];
|
|
19
|
-
} & import('react').RefAttributes<HTMLElement>>;
|
|
38
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Breadcrumbs } from './Breadcrumbs';
|
|
2
|
-
export type { BreadcrumbsProps,
|
|
2
|
+
export type { BreadcrumbsProps, BreadcrumbsListProps, BreadcrumbsItemProps, } from './Breadcrumbs';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { ButtonGroupSegment } from '../utils/buttonGroupSegment';
|
|
3
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
3
4
|
/** Состояние асинхронного сценария после клика. */
|
|
4
5
|
export type ButtonAsyncState = "idle" | "loading" | "success" | "error";
|
|
5
6
|
/** Размер кнопки: высота, отступы, типографика, спиннер и иконки результата. */
|
|
6
|
-
export type ButtonSize =
|
|
7
|
+
export type ButtonSize = ComponentSize;
|
|
7
8
|
/** Визуальный вариант заливки и обводки. */
|
|
8
9
|
export type ButtonVariant = "default" | "outline" | "secondary" | "ghost" | "danger" | "success" | "info" | "warning";
|
|
9
10
|
/** CSS-цвет converge-ripple под вариант кнопки — для собственного `<Ripple color={…} />` без `Button`. */
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type CalendarMode = "single" | "range" | "multiple";
|
|
3
|
+
export type CalendarView = "days" | "months" | "years";
|
|
4
|
+
export type CalendarVariant = "default" | "secondary" | "outline";
|
|
5
|
+
export type CalendarSize = "small" | "base" | "mid" | "large";
|
|
6
|
+
export type CalendarRangeValue = {
|
|
7
|
+
start: Date | null;
|
|
8
|
+
end: Date | null;
|
|
9
|
+
};
|
|
10
|
+
export type CalendarLocale = {
|
|
11
|
+
/** 7 items: Mon → Sun */
|
|
12
|
+
weekDays: string[];
|
|
13
|
+
/** 12 full month names */
|
|
14
|
+
months: string[];
|
|
15
|
+
/** 12 abbreviated month names */
|
|
16
|
+
monthsShort: string[];
|
|
17
|
+
today: string;
|
|
18
|
+
clear: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const RU_LOCALE: CalendarLocale;
|
|
21
|
+
type CalendarCtx = {
|
|
22
|
+
mode: CalendarMode;
|
|
23
|
+
view: CalendarView;
|
|
24
|
+
setView: (v: CalendarView) => void;
|
|
25
|
+
viewDate: Date;
|
|
26
|
+
navigate: (delta: number) => void;
|
|
27
|
+
selectedDates: Date[];
|
|
28
|
+
rangeStart: Date | null;
|
|
29
|
+
rangeEnd: Date | null;
|
|
30
|
+
hoverDate: Date | null;
|
|
31
|
+
setHoverDate: (d: Date | null) => void;
|
|
32
|
+
onDayPress: (d: Date) => void;
|
|
33
|
+
onMonthPress: (month: number) => void;
|
|
34
|
+
onYearPress: (year: number) => void;
|
|
35
|
+
onClear: () => void;
|
|
36
|
+
onToday: () => void;
|
|
37
|
+
size: CalendarSize;
|
|
38
|
+
variant: CalendarVariant;
|
|
39
|
+
locale: CalendarLocale;
|
|
40
|
+
minDate?: Date;
|
|
41
|
+
maxDate?: Date;
|
|
42
|
+
};
|
|
43
|
+
declare function useCalendar(): CalendarCtx;
|
|
44
|
+
type CalendarCommonProps = HTMLAttributes<HTMLDivElement> & {
|
|
45
|
+
variant?: CalendarVariant;
|
|
46
|
+
size?: CalendarSize;
|
|
47
|
+
/** Initial month/year displayed. */
|
|
48
|
+
defaultMonth?: Date;
|
|
49
|
+
/** Which picker to open first. */
|
|
50
|
+
initialView?: CalendarView;
|
|
51
|
+
locale?: CalendarLocale;
|
|
52
|
+
minDate?: Date;
|
|
53
|
+
maxDate?: Date;
|
|
54
|
+
};
|
|
55
|
+
export type CalendarProps = (CalendarCommonProps & {
|
|
56
|
+
mode?: "single";
|
|
57
|
+
value?: Date | null;
|
|
58
|
+
defaultValue?: Date | null;
|
|
59
|
+
onValueChange?: (date: Date | null) => void;
|
|
60
|
+
}) | (CalendarCommonProps & {
|
|
61
|
+
mode: "range";
|
|
62
|
+
value?: CalendarRangeValue;
|
|
63
|
+
defaultValue?: CalendarRangeValue;
|
|
64
|
+
onValueChange?: (range: CalendarRangeValue) => void;
|
|
65
|
+
}) | (CalendarCommonProps & {
|
|
66
|
+
mode: "multiple";
|
|
67
|
+
value?: Date[];
|
|
68
|
+
defaultValue?: Date[];
|
|
69
|
+
onValueChange?: (dates: Date[]) => void;
|
|
70
|
+
});
|
|
71
|
+
export type CalendarHeaderProps = HTMLAttributes<HTMLDivElement>;
|
|
72
|
+
export type CalendarGridProps = HTMLAttributes<HTMLDivElement>;
|
|
73
|
+
export type CalendarFooterProps = HTMLAttributes<HTMLDivElement>;
|
|
74
|
+
export declare const Calendar: import('react').ForwardRefExoticComponent<CalendarProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
75
|
+
Header: import('react').ForwardRefExoticComponent<CalendarHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
76
|
+
Grid: import('react').ForwardRefExoticComponent<CalendarGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
77
|
+
Footer: import('react').ForwardRefExoticComponent<CalendarFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
78
|
+
};
|
|
79
|
+
export { useCalendar };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextVariant } from '../Text';
|
|
3
|
+
import { ComponentSize } from '../utils/componentSize';
|
|
4
|
+
type CalendarSize = ComponentSize;
|
|
5
|
+
declare const DAY_TEXT: Record<CalendarSize, TextVariant>;
|
|
6
|
+
declare const DAY_BTN: Record<CalendarSize, string>;
|
|
7
|
+
type CalendarInteractiveCellProps = {
|
|
8
|
+
selected: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size: CalendarSize;
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
ariaSelected?: boolean;
|
|
13
|
+
rounded?: "full" | "mid";
|
|
14
|
+
isToday?: boolean;
|
|
15
|
+
isCurrent?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
onPress: () => void;
|
|
18
|
+
onMouseEnter?: () => void;
|
|
19
|
+
onMouseLeave?: () => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export declare const CalendarInteractiveCell: import('react').ForwardRefExoticComponent<CalendarInteractiveCellProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
export { DAY_BTN, DAY_TEXT };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar, RU_LOCALE, useCalendar, type CalendarProps, type CalendarHeaderProps, type CalendarGridProps, type CalendarFooterProps, type CalendarMode, type CalendarView, type CalendarVariant, type CalendarSize, type CalendarRangeValue, type CalendarLocale, } from './Calendar';
|
|
@@ -1,32 +1,67 @@
|
|
|
1
|
-
import { InputHTMLAttributes, LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, PointerEvent, ReactNode } from 'react';
|
|
2
|
+
import { FieldErrorProps, FieldHintProps } from '../Field';
|
|
3
|
+
import { LabelProps } from '../Label';
|
|
4
|
+
import { CheckboxSize, CheckboxVariant } from './checkboxFieldContext';
|
|
5
|
+
export type { CheckboxSize, CheckboxVariant };
|
|
6
|
+
export type CheckboxRootProps = Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "htmlFor" | "onChange" | "onPointerDown"> & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "children" | "className"> & {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** Simple API: подпись справа от индикатора. В compound игнорируется. */
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
/** Simple API: подсказка под заголовком. В compound — `<Checkbox.Hint>`. */
|
|
11
|
+
hint?: ReactNode;
|
|
12
|
+
error?: ReactNode;
|
|
10
13
|
size?: CheckboxSize;
|
|
11
14
|
variant?: CheckboxVariant;
|
|
12
|
-
/** Иконка внутри залитого кружка. По умолчанию
|
|
15
|
+
/** Иконка внутри залитого кружка. По умолчанию `IoCheckmark`. */
|
|
13
16
|
checkIcon?: ReactNode;
|
|
14
|
-
/** Заголовок в цвете danger (подзаголовок остаётся muted). */
|
|
15
17
|
danger?: boolean;
|
|
16
|
-
/** className на корневой `<label>`. */
|
|
17
18
|
className?: string;
|
|
19
|
+
onPointerDown?: (e: PointerEvent<HTMLElement>) => void;
|
|
18
20
|
};
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export type CheckboxProps = CheckboxRootProps;
|
|
22
|
+
export type CheckboxControlProps = HTMLAttributes<HTMLSpanElement>;
|
|
23
|
+
export declare const CheckboxControl: import('react').ForwardRefExoticComponent<CheckboxControlProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
24
|
+
export type CheckboxIndicatorProps = HTMLAttributes<HTMLSpanElement> & {
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export declare function CheckboxIndicator({ children, className, ...rest }: CheckboxIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace CheckboxIndicator {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
export type CheckboxContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare const CheckboxContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export type CheckboxLabelProps = Omit<LabelProps, "htmlFor">;
|
|
38
|
+
/** Подпись в compound; `id` для a11y на `<Checkbox.Content>` (label). Для `<Label htmlFor>` — без обёртки Content в label. */
|
|
39
|
+
export declare function CheckboxLabel({ children, className, isRequired: isRequiredProp, id: idProp, ...rest }: CheckboxLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare namespace CheckboxLabel {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
export type CheckboxHintProps = Omit<FieldHintProps, "id" | "as">;
|
|
44
|
+
export declare function CheckboxHint({ children, className, variant, ...rest }: CheckboxHintProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare namespace CheckboxHint {
|
|
46
|
+
var displayName: string;
|
|
47
|
+
}
|
|
48
|
+
export type CheckboxErrorProps = Omit<FieldErrorProps, "id" | "as">;
|
|
49
|
+
export declare function CheckboxError({ children, className, ...rest }: CheckboxErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare namespace CheckboxError {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const CheckboxRoot: import('react').ForwardRefExoticComponent<Omit<LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "onPointerDown" | "htmlFor"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "className" | "children" | "type"> & {
|
|
54
|
+
children?: ReactNode;
|
|
55
|
+
/** Simple API: подпись справа от индикатора. В compound игнорируется. */
|
|
56
|
+
label?: ReactNode;
|
|
57
|
+
/** Simple API: подсказка под заголовком. В compound — `<Checkbox.Hint>`. */
|
|
58
|
+
hint?: ReactNode;
|
|
59
|
+
error?: ReactNode;
|
|
24
60
|
size?: CheckboxSize;
|
|
25
61
|
variant?: CheckboxVariant;
|
|
26
|
-
/** Иконка внутри залитого кружка. По умолчанию
|
|
62
|
+
/** Иконка внутри залитого кружка. По умолчанию `IoCheckmark`. */
|
|
27
63
|
checkIcon?: ReactNode;
|
|
28
|
-
/** Заголовок в цвете danger (подзаголовок остаётся muted). */
|
|
29
64
|
danger?: boolean;
|
|
30
|
-
/** className на корневой `<label>`. */
|
|
31
65
|
className?: string;
|
|
66
|
+
onPointerDown?: (e: PointerEvent<HTMLElement>) => void;
|
|
32
67
|
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ChangeEvent, InputHTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
/** Внешний вид обода кружка в состоянии «не отмечено». */
|
|
3
|
+
export type CheckboxVariant = "default" | "secondary" | "outline";
|
|
4
|
+
export type CheckboxSize = "small" | "base" | "mid" | "large";
|
|
5
|
+
export type CheckboxFieldContextValue = {
|
|
6
|
+
inputId: string;
|
|
7
|
+
hintId: string;
|
|
8
|
+
errorId: string;
|
|
9
|
+
labelId: string;
|
|
10
|
+
size: CheckboxSize;
|
|
11
|
+
variant: CheckboxVariant;
|
|
12
|
+
mergedChecked: boolean;
|
|
13
|
+
isDisabled: boolean;
|
|
14
|
+
isControlled: boolean;
|
|
15
|
+
isCompound: boolean;
|
|
16
|
+
hasCompoundHint: boolean;
|
|
17
|
+
hasCompoundError: boolean;
|
|
18
|
+
useInlineCompoundMotion: boolean;
|
|
19
|
+
textMotionRef: RefObject<HTMLElement | null>;
|
|
20
|
+
hintConnected: boolean;
|
|
21
|
+
errorConnected: boolean;
|
|
22
|
+
danger: boolean;
|
|
23
|
+
checkIcon?: ReactNode;
|
|
24
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
25
|
+
inputProps: {
|
|
26
|
+
name?: string;
|
|
27
|
+
value?: InputHTMLAttributes<HTMLInputElement>["value"];
|
|
28
|
+
defaultChecked?: boolean;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
form?: string;
|
|
31
|
+
autoFocus?: boolean;
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
onBlur?: InputHTMLAttributes<HTMLInputElement>["onBlur"];
|
|
35
|
+
onFocus?: InputHTMLAttributes<HTMLInputElement>["onFocus"];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const CheckboxFieldContext: import('react').Context<CheckboxFieldContextValue | null>;
|
|
39
|
+
export declare function useCheckboxFieldContext(): CheckboxFieldContextValue;
|
|
40
|
+
export declare function useOptionalCheckboxFieldContext(): CheckboxFieldContextValue | null;
|
|
41
|
+
export { CheckboxFieldContext };
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { CheckboxError, CheckboxHint, CheckboxIndicator, CheckboxLabel, CheckboxContentProps, CheckboxControlProps, CheckboxErrorProps, CheckboxHintProps, CheckboxIndicatorProps, CheckboxLabelProps, CheckboxProps, CheckboxRootProps } from './Checkbox';
|
|
2
|
+
export type { CheckboxSize, CheckboxVariant } from './checkboxFieldContext';
|
|
3
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<Omit<import('react').LabelHTMLAttributes<HTMLLabelElement>, "children" | "onChange" | "onPointerDown" | "htmlFor"> & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "className" | "children" | "type"> & {
|
|
4
|
+
children?: import('react').ReactNode;
|
|
5
|
+
label?: import('react').ReactNode;
|
|
6
|
+
hint?: import('react').ReactNode;
|
|
7
|
+
error?: import('react').ReactNode;
|
|
8
|
+
size?: import('./checkboxFieldContext').CheckboxSize;
|
|
9
|
+
variant?: import('./checkboxFieldContext').CheckboxVariant;
|
|
10
|
+
checkIcon?: import('react').ReactNode;
|
|
11
|
+
danger?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
onPointerDown?: (e: import('react').PointerEvent<HTMLElement>) => void;
|
|
14
|
+
} & import('react').RefAttributes<HTMLLabelElement>> & {
|
|
15
|
+
Control: import('react').ForwardRefExoticComponent<CheckboxControlProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
16
|
+
Indicator: typeof CheckboxIndicator;
|
|
17
|
+
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
children?: import('react').ReactNode;
|
|
19
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Label: typeof CheckboxLabel;
|
|
21
|
+
Hint: typeof CheckboxHint;
|
|
22
|
+
Error: typeof CheckboxError;
|
|
23
|
+
};
|
|
24
|
+
export type { CheckboxProps, CheckboxRootProps, CheckboxControlProps, CheckboxIndicatorProps, CheckboxContentProps, CheckboxLabelProps, CheckboxHintProps, CheckboxErrorProps, };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { HSVA } from './colorUtils';
|
|
3
|
+
import { ColorSwatchSize } from './ColorSwatch';
|
|
4
|
+
export type ColorPickerSize = "small" | "base" | "mid";
|
|
5
|
+
export type ColorPickerProps = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/** Controlled value (hex string). */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Uncontrolled default (hex string). */
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (hex: string) => void;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
size?: ColorPickerSize;
|
|
16
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type ColorPickerTriggerProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
20
|
+
swatchSize?: ColorSwatchSize;
|
|
21
|
+
};
|
|
22
|
+
export type ColorPickerContentProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
23
|
+
/** Show alpha slider. Default false. */
|
|
24
|
+
showAlpha?: boolean;
|
|
25
|
+
/** Preset color strings (hex). */
|
|
26
|
+
presets?: string[];
|
|
27
|
+
};
|
|
28
|
+
type ColorPickerCtx = {
|
|
29
|
+
hsva: HSVA;
|
|
30
|
+
setHsva: (next: HSVA) => void;
|
|
31
|
+
hex: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
size: ColorPickerSize;
|
|
34
|
+
};
|
|
35
|
+
declare function useColorPickerContext(): ColorPickerCtx;
|
|
36
|
+
declare function ColorPickerRoot({ children, value, defaultValue, onValueChange, open: openProp, defaultOpen, onOpenChange, size, side, disabled, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare namespace ColorPickerRoot {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const ColorPicker: typeof ColorPickerRoot & {
|
|
41
|
+
Trigger: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
|
|
42
|
+
swatchSize?: ColorSwatchSize;
|
|
43
|
+
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
44
|
+
Content: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
45
|
+
/** Show alpha slider. Default false. */
|
|
46
|
+
showAlpha?: boolean;
|
|
47
|
+
/** Preset color strings (hex). */
|
|
48
|
+
presets?: string[];
|
|
49
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
50
|
+
};
|
|
51
|
+
export { useColorPickerContext as useColorPicker };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { SelectionIndicatorSize } from '../SelectionIndicator/selectionIndicatorTokens';
|
|
3
|
+
import { HSVA } from './colorUtils';
|
|
4
|
+
export type ColorChannel = "hue" | "saturation" | "value" | "alpha" | "red" | "green" | "blue";
|
|
5
|
+
export type ColorSliderSize = SelectionIndicatorSize;
|
|
6
|
+
export type ColorSliderOrientation = "horizontal" | "vertical";
|
|
7
|
+
export type ColorSliderTrackProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
8
|
+
channel: ColorChannel;
|
|
9
|
+
/** Current full HSVA color (provides context for gradient generation). */
|
|
10
|
+
color?: HSVA;
|
|
11
|
+
value?: number;
|
|
12
|
+
defaultValue?: number;
|
|
13
|
+
onValueChange?: (value: number) => void;
|
|
14
|
+
size?: ColorSliderSize;
|
|
15
|
+
orientation?: ColorSliderOrientation;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ColorSliderRootProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
19
|
+
channel: ColorChannel;
|
|
20
|
+
color?: HSVA;
|
|
21
|
+
label?: string;
|
|
22
|
+
value?: number;
|
|
23
|
+
defaultValue?: number;
|
|
24
|
+
onValueChange?: (value: number) => void;
|
|
25
|
+
size?: ColorSliderSize;
|
|
26
|
+
orientation?: ColorSliderOrientation;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const ColorSliderTrack: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
30
|
+
channel: ColorChannel;
|
|
31
|
+
/** Current full HSVA color (provides context for gradient generation). */
|
|
32
|
+
color?: HSVA;
|
|
33
|
+
value?: number;
|
|
34
|
+
defaultValue?: number;
|
|
35
|
+
onValueChange?: (value: number) => void;
|
|
36
|
+
size?: ColorSliderSize;
|
|
37
|
+
orientation?: ColorSliderOrientation;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
40
|
+
export declare const ColorSliderRoot: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
41
|
+
channel: ColorChannel;
|
|
42
|
+
color?: HSVA;
|
|
43
|
+
label?: string;
|
|
44
|
+
value?: number;
|
|
45
|
+
defaultValue?: number;
|
|
46
|
+
onValueChange?: (value: number) => void;
|
|
47
|
+
size?: ColorSliderSize;
|
|
48
|
+
orientation?: ColorSliderOrientation;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export declare const ColorSlider: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
52
|
+
channel: ColorChannel;
|
|
53
|
+
color?: HSVA;
|
|
54
|
+
label?: string;
|
|
55
|
+
value?: number;
|
|
56
|
+
defaultValue?: number;
|
|
57
|
+
onValueChange?: (value: number) => void;
|
|
58
|
+
size?: ColorSliderSize;
|
|
59
|
+
orientation?: ColorSliderOrientation;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
62
|
+
Track: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
63
|
+
channel: ColorChannel;
|
|
64
|
+
/** Current full HSVA color (provides context for gradient generation). */
|
|
65
|
+
color?: HSVA;
|
|
66
|
+
value?: number;
|
|
67
|
+
defaultValue?: number;
|
|
68
|
+
onValueChange?: (value: number) => void;
|
|
69
|
+
size?: ColorSliderSize;
|
|
70
|
+
orientation?: ColorSliderOrientation;
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
73
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export type ColorSwatchSize = "xsmall" | "small" | "base" | "mid" | "large" | "xlarge";
|
|
3
|
+
export type ColorSwatchShape = "square" | "circle" | "rounded";
|
|
4
|
+
export type ColorSwatchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color"> & {
|
|
5
|
+
/** CSS color string to display. */
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: ColorSwatchSize;
|
|
8
|
+
shape?: ColorSwatchShape;
|
|
9
|
+
/** Highlighted ring indicating current selection. */
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
/** Show a checkerboard background (useful for semi-transparent colors). */
|
|
12
|
+
showChecker?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const ColorSwatch: import('react').ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "color"> & {
|
|
15
|
+
/** CSS color string to display. */
|
|
16
|
+
color?: string;
|
|
17
|
+
size?: ColorSwatchSize;
|
|
18
|
+
shape?: ColorSwatchShape;
|
|
19
|
+
/** Highlighted ring indicating current selection. */
|
|
20
|
+
selected?: boolean;
|
|
21
|
+
/** Show a checkerboard background (useful for semi-transparent colors). */
|
|
22
|
+
showChecker?: boolean;
|
|
23
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|