burne-ui 0.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -3
- package/dist/components/composite/Accordion/Accordion.d.ts +77 -14
- package/dist/components/composite/Accordion/index.d.ts +1 -1
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +4 -7
- package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +1 -21
- package/dist/components/composite/CheckboxGroup/CheckboxGroup.d.ts +42 -33
- package/dist/components/composite/CheckboxGroup/checkboxGroupContext.d.ts +16 -0
- package/dist/components/composite/CheckboxGroup/index.d.ts +2 -1
- package/dist/components/composite/RadioGroup/RadioGroup.d.ts +55 -0
- package/dist/components/composite/RadioGroup/index.d.ts +2 -0
- package/dist/components/composite/RadioGroup/radioGroupContext.d.ts +13 -0
- package/dist/components/composite/ToggleButtonGroup/ToggleButtonGroup.d.ts +33 -0
- package/dist/components/composite/ToggleButtonGroup/index.d.ts +2 -0
- package/dist/components/composite/utils/optionGroupFieldset.d.ts +44 -0
- package/dist/components/core/Alert/Alert.d.ts +49 -11
- package/dist/components/core/Alert/alertContext.d.ts +10 -0
- package/dist/components/core/Alert/alertUtils.d.ts +12 -0
- package/dist/components/core/Alert/index.d.ts +2 -1
- package/dist/components/core/Avatar/Avatar.d.ts +16 -4
- package/dist/components/core/Badge/Badge.d.ts +15 -3
- package/dist/components/core/Badge/index.d.ts +1 -1
- package/dist/components/core/Breadcrumbs/Breadcrumbs.d.ts +34 -15
- package/dist/components/core/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/core/Button/Button.d.ts +2 -1
- package/dist/components/core/Calendar/Calendar.d.ts +79 -0
- package/dist/components/core/Calendar/CalendarInteractiveCell.d.ts +23 -0
- package/dist/components/core/Calendar/index.d.ts +1 -0
- package/dist/components/core/Checkbox/Checkbox.d.ts +55 -20
- package/dist/components/core/Checkbox/checkboxFieldContext.d.ts +41 -0
- package/dist/components/core/Checkbox/index.d.ts +24 -1
- package/dist/components/core/ColorPicker/ColorPicker.d.ts +51 -0
- package/dist/components/core/ColorPicker/ColorSlider.d.ts +73 -0
- package/dist/components/core/ColorPicker/ColorSwatch.d.ts +23 -0
- package/dist/components/core/ColorPicker/colorUtils.d.ts +27 -0
- package/dist/components/core/ColorPicker/index.d.ts +4 -0
- package/dist/components/core/ComboBox/ComboBox.d.ts +23 -0
- package/dist/components/core/ComboBox/ComboBoxField.d.ts +44 -0
- package/dist/components/core/ComboBox/comboBoxContext.d.ts +47 -0
- package/dist/components/core/ComboBox/index.d.ts +14 -0
- package/dist/components/core/Disclosure/Disclosure.d.ts +61 -0
- package/dist/components/core/Disclosure/index.d.ts +1 -0
- package/dist/components/core/Drawer/Drawer.d.ts +50 -0
- package/dist/components/core/Drawer/drawerTypes.d.ts +1 -0
- package/dist/components/core/Drawer/index.d.ts +1 -0
- package/dist/components/core/Drawer/useDrawerHandleDrag.d.ts +8 -0
- package/dist/components/core/Dropdown/Dropdown.d.ts +82 -31
- package/dist/components/core/Dropdown/index.d.ts +1 -1
- package/dist/components/core/Expandable/Expandable.d.ts +53 -4
- package/dist/components/core/Expandable/index.d.ts +1 -1
- package/dist/components/core/Field/Field.d.ts +21 -0
- package/dist/components/core/Field/FieldSet.d.ts +57 -0
- package/dist/components/core/Field/fieldA11y.d.ts +4 -0
- package/dist/components/core/Field/index.d.ts +39 -0
- package/dist/components/core/Input/Input.d.ts +8 -17
- package/dist/components/core/Input/InputField.d.ts +29 -0
- package/dist/components/core/Input/index.d.ts +19 -1
- package/dist/components/core/Input/inputFieldContext.d.ts +16 -0
- package/dist/components/core/Label/Label.d.ts +15 -0
- package/dist/components/core/Label/fieldLabelContext.d.ts +11 -0
- package/dist/components/core/Label/index.d.ts +2 -0
- package/dist/components/core/Link/Link.d.ts +40 -0
- package/dist/components/core/Link/index.d.ts +1 -0
- package/dist/components/core/LiquidGlass/LiquidGlass.d.ts +28 -0
- package/dist/components/core/LiquidGlass/index.d.ts +2 -0
- package/dist/components/core/LiquidGlass/liquidGlassShader.d.ts +2 -0
- package/dist/components/core/LiquidGlass/useLiquidGlass.d.ts +49 -0
- package/dist/components/core/ListBox/ListBox.d.ts +112 -0
- package/dist/components/core/ListBox/index.d.ts +1 -0
- package/dist/components/core/Loading/Loading.d.ts +23 -0
- package/dist/components/core/Loading/index.d.ts +1 -0
- package/dist/components/core/Meter/Meter.d.ts +37 -0
- package/dist/components/core/Meter/MeterField.d.ts +35 -0
- package/dist/components/core/Meter/index.d.ts +22 -0
- package/dist/components/core/Meter/meterFieldContext.d.ts +21 -0
- package/dist/components/core/Pagination/Pagination.d.ts +64 -0
- package/dist/components/core/Pagination/index.d.ts +1 -0
- package/dist/components/core/Popover/Popover.d.ts +92 -0
- package/dist/components/core/Popover/index.d.ts +2 -0
- package/dist/components/core/ProgressBar/ProgressBar.d.ts +41 -0
- package/dist/components/core/ProgressBar/ProgressBarField.d.ts +41 -0
- package/dist/components/core/ProgressBar/index.d.ts +23 -0
- package/dist/components/core/ProgressBar/progressBarFieldContext.d.ts +22 -0
- package/dist/components/core/Radio/Radio.d.ts +54 -0
- package/dist/components/core/Radio/index.d.ts +20 -0
- package/dist/components/core/Radio/radioFieldContext.d.ts +36 -0
- package/dist/components/core/SearchInput/SearchInput.d.ts +16 -7
- package/dist/components/core/SelectionIndicator/SelectionIndicator.d.ts +15 -0
- package/dist/components/core/SelectionIndicator/index.d.ts +3 -0
- package/dist/components/core/SelectionIndicator/selectionIndicatorTokens.d.ts +14 -0
- package/dist/components/core/SelectionIndicator/useSelectionIndicatorAnimation.d.ts +2 -0
- package/dist/components/core/SelectionThumb/SelectionThumb.d.ts +27 -0
- package/dist/components/core/SelectionThumb/index.d.ts +1 -0
- package/dist/components/core/Skeleton/Skeleton.d.ts +51 -0
- package/dist/components/core/Skeleton/index.d.ts +1 -0
- package/dist/components/core/Slider/Slider.d.ts +46 -0
- package/dist/components/core/Slider/SliderField.d.ts +46 -0
- package/dist/components/core/Slider/index.d.ts +17 -0
- package/dist/components/core/Slider/sliderCompound.d.ts +49 -0
- package/dist/components/core/Slider/sliderFieldContext.d.ts +25 -0
- package/dist/components/core/Surface/Surface.d.ts +29 -0
- package/dist/components/core/Surface/index.d.ts +1 -0
- package/dist/components/core/Switch/Switch.d.ts +40 -0
- package/dist/components/core/Switch/SwitchField.d.ts +45 -0
- package/dist/components/core/Switch/index.d.ts +33 -0
- package/dist/components/core/Switch/switchFieldContext.d.ts +23 -0
- package/dist/components/core/Switch/switchGeometry.d.ts +12 -0
- package/dist/components/core/Switch/switchTrack.d.ts +57 -0
- package/dist/components/core/Table/Table.d.ts +85 -0
- package/dist/components/core/Table/index.d.ts +1 -0
- package/dist/components/core/Tabs/Tabs.d.ts +82 -0
- package/dist/components/core/Tabs/index.d.ts +1 -0
- package/dist/components/core/Tabs/tabsContext.d.ts +19 -0
- package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +3 -0
- package/dist/components/core/TextArea/TextArea.d.ts +30 -0
- package/dist/components/core/TextArea/TextAreaField.d.ts +29 -0
- package/dist/components/core/TextArea/index.d.ts +18 -0
- package/dist/components/core/TextArea/textareaFieldContext.d.ts +16 -0
- package/dist/components/core/TextArea/useTextAreaResize.d.ts +5 -0
- package/dist/components/core/TimeField/TimeField.d.ts +97 -0
- package/dist/components/core/TimeField/index.d.ts +1 -0
- package/dist/components/core/Toast/Toast.d.ts +101 -0
- package/dist/components/core/Toast/index.d.ts +2 -0
- package/dist/components/core/Toast/useToast.d.ts +18 -0
- package/dist/components/core/ToggleButton/ToggleButton.d.ts +47 -0
- package/dist/components/core/ToggleButton/index.d.ts +2 -0
- package/dist/components/core/ToggleButton/toggleButtonGroupContext.d.ts +17 -0
- package/dist/components/core/ToggleButton/useToggleButtonFillAnimation.d.ts +3 -0
- package/dist/components/core/Tooltip/Tooltip.d.ts +25 -20
- package/dist/components/core/Tooltip/index.d.ts +1 -1
- package/dist/components/core/Tooltip/tooltipPosition.d.ts +16 -0
- package/dist/components/core/utils/buttonGroupContext.d.ts +9 -0
- package/dist/components/core/utils/componentSize.d.ts +3 -0
- package/dist/components/core/utils/controlSizeLayout.d.ts +26 -0
- package/dist/components/core/utils/dualApiStoryChrome.d.ts +17 -0
- package/dist/components/core/utils/hasCompoundChild.d.ts +3 -0
- package/dist/components/core/utils/hasCompoundChildren.d.ts +3 -0
- package/dist/components/core/utils/hoverInteractiveLift.d.ts +16 -3
- package/dist/components/core/utils/motionTokens.d.ts +4 -0
- package/dist/components/core/utils/optionControlGridLayout.d.ts +15 -0
- package/dist/components/core/utils/optionListItemChildren.d.ts +10 -0
- package/dist/components/core/utils/optionListItemContext.d.ts +15 -0
- package/dist/components/core/utils/optionListItemParts.d.ts +11 -0
- package/dist/components/core/utils/optionListItemStoryLayouts.d.ts +10 -0
- package/dist/components/core/utils/scaleFieldParts.d.ts +33 -0
- package/dist/index.cjs +286 -28
- package/dist/index.d.ts +40 -9
- package/dist/index.js +22051 -7221
- package/dist/tokens/config.d.ts +15 -0
- package/dist/tokens/index.d.ts +1 -1
- package/dist/ui.css +1386 -185
- package/package.json +8 -3
- package/dist/components/core/Selector/Selector.d.ts +0 -48
- package/dist/components/core/Selector/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ import "burne-ui/styles.css";
|
|
|
26
26
|
|
|
27
27
|
В нём:
|
|
28
28
|
|
|
29
|
-
- **Дизайн-токены** как CSS-переменные: `--color-*`, `--space
|
|
29
|
+
- **Дизайн-токены** как CSS-переменные: `--color-*`, `--space` / `--space-*`, `--size` / `--size-*`, `--radius`, `--text-scale-*`, и др. Полный перечень имён — экспорт **`designTokenNames`** из `burne-ui`; исходные значения по умолчанию смотрите в репозитории в `src/tokens/styles.css`.
|
|
30
30
|
- **Мост Tailwind** (`@theme inline`): цвета в утилитах вида `bg-background`, `text-foreground`, `border-base`, `bg-accent`, отступы `gap-mid`, `p-plus`, радиусы `rounded-base` и т.д.
|
|
31
31
|
- **Кастомные утилиты** (`@utility`): например `text-header-1`, `text-mid`, `max-w-component-base`, `min-w-button-base`.
|
|
32
32
|
|
|
@@ -46,9 +46,11 @@ import "./burne-theme-overrides.css";
|
|
|
46
46
|
```css
|
|
47
47
|
:root {
|
|
48
48
|
--color-accent: #6366f1;
|
|
49
|
-
--space
|
|
49
|
+
--space: 0.5625rem; /* плотнее/просторнее отступы */
|
|
50
|
+
--size: 1.0625rem; /* крупнее иконки, индикаторы, кнопки */
|
|
51
|
+
--radius: 0.625rem; /* мягче скругления */
|
|
50
52
|
--font-family-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
|
|
51
|
-
--text-
|
|
53
|
+
--text-scale-sm: 0.9375rem; /* UI-текст (роль text-base) */
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
/* Светлая тема: те же ветки, что и в пакете */
|
|
@@ -103,6 +105,47 @@ import { cn } from "burne-ui";
|
|
|
103
105
|
|
|
104
106
|
Функция реэкспортируется из корня пакета; зависимости уже входят в `burne-ui`, отдельно ставить их не обязательно.
|
|
105
107
|
|
|
108
|
+
## Поля формы: `Field`, `Hint`, dual API
|
|
109
|
+
|
|
110
|
+
### Примитив `Field`
|
|
111
|
+
|
|
112
|
+
Общая оболочка для кастомных полей и внутренних компонентов:
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { Field, Label } from "burne-ui";
|
|
116
|
+
|
|
117
|
+
<Field>
|
|
118
|
+
<Label htmlFor="custom-id">Подпись</Label>
|
|
119
|
+
<input id="custom-id" />
|
|
120
|
+
<Field.Hint status="danger">Сообщение об ошибке</Field.Hint>
|
|
121
|
+
</Field>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`Field.Hint` — единый компонент подсказки для всех field-like компонентов. По умолчанию `as="p"` (под полем); для inline-подписи внутри label/grid — `as="span"`.
|
|
125
|
+
|
|
126
|
+
### Dual API (simple + compound)
|
|
127
|
+
|
|
128
|
+
У **Input**, **Selector**, **Switch**, **Meter**, **ProgressBar**, **Slider**, **Avatar**:
|
|
129
|
+
|
|
130
|
+
| Режим | Когда | Пример |
|
|
131
|
+
|-------|-------|--------|
|
|
132
|
+
| **Simple** | Без `children` | `<Input label="Email" hint="…" placeholder="…" />`, `<Avatar label="Ada" src="…" />` |
|
|
133
|
+
| **Compound** | С `children` | `<Input><Input.Label>…</Input.Label><Input.Control … /></Input>`, `<Avatar><Avatar.Image … /><Avatar.Fallback /></Avatar>` |
|
|
134
|
+
|
|
135
|
+
В compound-режиме props layout (`label`, `hint`, `showValue`, `src` …) на root **игнорируются**.
|
|
136
|
+
|
|
137
|
+
**Checkbox** / **Radio** — **Simple** (`label`, `hint`) и **Compound** (`*.Control`, `*.Indicator`, `*.Content`, `*.Label`, `*.Hint`). **CheckboxGroup** / **RadioGroup** — compound с `Legend`, `Label`, `Hint`, `List`; у **RadioGroup** также **`Error`** для сообщения валидации на fieldset.
|
|
138
|
+
|
|
139
|
+
**Badge** — simple-only для контента (`children`, prop `icon`); иконки в разметке — `data-icon="inline-start" | "inline-end"` на child; для наложения на якорь — **`Badge.Anchor`**.
|
|
140
|
+
|
|
141
|
+
### SearchInput
|
|
142
|
+
|
|
143
|
+
`SearchInput` — отдельный atomic-компонент для строки поиска (иконка, ripple, clear, раскрытие). Для полей формы используйте `Input` (simple или compound) или `Input.Control` с `prefix`. Задавайте **`aria-label`** — placeholder не заменяет подпись для AT.
|
|
144
|
+
|
|
145
|
+
### Миграция
|
|
146
|
+
|
|
147
|
+
См. [CHANGELOG.md](./CHANGELOG.md): `description` → `hint`, `*.Description` → `*.Hint`, `descriptionId` → `hintId`.
|
|
148
|
+
|
|
106
149
|
## Сборка и разработка репозитория
|
|
107
150
|
|
|
108
151
|
```bash
|
|
@@ -1,20 +1,83 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
title: ReactNode;
|
|
5
|
-
description?: ReactNode;
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
/** Узел перед иконкой/контентом триггера (например `<Ripple color="accentMuted" />`). */
|
|
8
|
-
triggerBefore?: ReactNode;
|
|
9
|
-
content: ReactNode;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
};
|
|
2
|
+
import { ExpandableContentProps, ExpandableDescriptionProps, ExpandableIconProps, ExpandableMessageProps, ExpandableTitleProps, ExpandableTriggerProps } from '../../core/Expandable';
|
|
12
3
|
export type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
13
|
-
|
|
14
|
-
/** Начально открытый item id (неконтролируемый режим). */
|
|
4
|
+
/** Начально открытый пункт по id (`Accordion.Item value`) или индексу. */
|
|
15
5
|
defaultOpenId?: string | null;
|
|
16
|
-
/**
|
|
6
|
+
/** Начально открытый пункт по порядковому номеру (0-based), если `value` не задан. */
|
|
7
|
+
defaultOpenIndex?: number | null;
|
|
17
8
|
openId?: string | null;
|
|
18
9
|
onOpenIdChange?: (id: string | null) => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare function AccordionRoot({ defaultOpenId: defaultOpenIdProp, defaultOpenIndex, openId: openIdProp, onOpenIdChange, className, children, ...rest }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export type AccordionItemProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
14
|
+
/** Явный id пункта; без него используется порядковый номер среди siblings. */
|
|
15
|
+
value?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type AccordionHeadingProps = HTMLAttributes<HTMLHeadingElement>;
|
|
20
|
+
declare function AccordionHeading({ className, children, ...rest }: AccordionHeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare namespace AccordionHeading {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export type AccordionTriggerProps = ExpandableTriggerProps;
|
|
25
|
+
export type AccordionMessageProps = ExpandableMessageProps;
|
|
26
|
+
declare function AccordionMessage(props: AccordionMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare namespace AccordionMessage {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
export type AccordionIconProps = ExpandableIconProps;
|
|
31
|
+
declare function AccordionIcon(props: AccordionIconProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare namespace AccordionIcon {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
35
|
+
export type AccordionContentProps = ExpandableContentProps;
|
|
36
|
+
declare function AccordionContent(props: AccordionContentProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare namespace AccordionContent {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
export type AccordionTitleProps = ExpandableTitleProps;
|
|
41
|
+
declare function AccordionTitle(props: AccordionTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare namespace AccordionTitle {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
45
|
+
export type AccordionDescriptionProps = ExpandableDescriptionProps;
|
|
46
|
+
declare function AccordionDescription(props: AccordionDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare namespace AccordionDescription {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
export type AccordionIndicatorProps = HTMLAttributes<HTMLSpanElement> & {
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
};
|
|
53
|
+
declare function AccordionIndicator({ className, children, ...rest }: AccordionIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
54
|
+
declare namespace AccordionIndicator {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
57
|
+
export type AccordionPanelProps = HTMLAttributes<HTMLDivElement>;
|
|
58
|
+
export type AccordionBodyProps = HTMLAttributes<HTMLDivElement>;
|
|
59
|
+
declare function AccordionBody({ className, ...rest }: AccordionBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
declare namespace AccordionBody {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
|
63
|
+
export declare const Accordion: typeof AccordionRoot & {
|
|
64
|
+
Item: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
65
|
+
/** Явный id пункта; без него используется порядковый номер среди siblings. */
|
|
66
|
+
value?: string;
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
70
|
+
Heading: typeof AccordionHeading;
|
|
71
|
+
Trigger: import('react').ForwardRefExoticComponent<import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
72
|
+
hideChevron?: boolean;
|
|
73
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
Message: typeof AccordionMessage;
|
|
75
|
+
Icon: typeof AccordionIcon;
|
|
76
|
+
Content: typeof AccordionContent;
|
|
77
|
+
Title: typeof AccordionTitle;
|
|
78
|
+
Description: typeof AccordionDescription;
|
|
79
|
+
Indicator: typeof AccordionIndicator;
|
|
80
|
+
Panel: import('react').ForwardRefExoticComponent<AccordionPanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
81
|
+
Body: typeof AccordionBody;
|
|
19
82
|
};
|
|
20
|
-
export
|
|
83
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Accordion, type AccordionProps, type
|
|
1
|
+
export { Accordion, type AccordionProps, type AccordionItemProps, type AccordionHeadingProps, type AccordionTriggerProps, type AccordionMessageProps, type AccordionIconProps, type AccordionContentProps, type AccordionTitleProps, type AccordionDescriptionProps, type AccordionIndicatorProps, type AccordionPanelProps, type AccordionBodyProps, } from './Accordion';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { AlertStatus
|
|
2
|
+
import { AlertStatus } from '../../core/Alert/Alert';
|
|
3
3
|
import { ButtonSize, ButtonVariant } from '../../core/Button';
|
|
4
4
|
import { CloseButtonProps } from '../../core/CloseButton';
|
|
5
5
|
import { TextVariant } from '../../core/Text';
|
|
6
6
|
/** Ширина и типографика панели. */
|
|
7
|
-
export type AlertDialogSize = "small" | "base" | "large";
|
|
7
|
+
export type AlertDialogSize = "small" | "base" | "mid" | "large";
|
|
8
8
|
/** Размер кнопок футера для заданного `size` модалки (если не используете `AlertDialog.Footer` с авто-подстановкой). */
|
|
9
9
|
export declare function footerButtonSizeForAlertDialog(dialogSize: AlertDialogSize): ButtonSize;
|
|
10
10
|
declare const ALERT_DIALOG_SIZE: Record<AlertDialogSize, {
|
|
@@ -17,11 +17,9 @@ declare const ALERT_DIALOG_SIZE: Record<AlertDialogSize, {
|
|
|
17
17
|
headingBlockGap: string;
|
|
18
18
|
iconClass: string;
|
|
19
19
|
titleVariant: TextVariant;
|
|
20
|
-
titleClassName: string;
|
|
21
20
|
descVariant: TextVariant;
|
|
22
21
|
descClassName: string;
|
|
23
22
|
bodyVariant: TextVariant;
|
|
24
|
-
bodyClassName: string;
|
|
25
23
|
}>;
|
|
26
24
|
/** Основная кнопка действия в футере модалки в тон окна. */
|
|
27
25
|
export declare function primaryButtonVariantForAlertTone(tone: AlertStatus): ButtonVariant;
|
|
@@ -30,8 +28,7 @@ export type AlertDialogProps = {
|
|
|
30
28
|
onOpenChange: (open: boolean) => void;
|
|
31
29
|
children?: ReactNode;
|
|
32
30
|
className?: string;
|
|
33
|
-
/** Как у `Alert`: default, outline, secondary, danger, success, info
|
|
34
|
-
variant?: AlertVariant;
|
|
31
|
+
/** Как у `Alert`: default, outline, secondary, danger, success, info, warning. */
|
|
35
32
|
status?: AlertStatus;
|
|
36
33
|
/** По умолчанию `m`. */
|
|
37
34
|
size?: AlertDialogSize;
|
|
@@ -69,7 +66,7 @@ declare function AlertDialogDescription({ className, id, ...rest }: AlertDialogD
|
|
|
69
66
|
declare function AlertDialogHeadingBlock({ className, ...rest }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
70
67
|
declare function AlertDialogBody({ className, children, ...rest }: AlertDialogBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
71
68
|
declare function AlertDialogFooter({ className, children, ...rest }: AlertDialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
-
export declare const AlertDialog: (({ open, onOpenChange, children, className,
|
|
69
|
+
export declare const AlertDialog: (({ open, onOpenChange, children, className, status, size, }: AlertDialogProps) => import('react').ReactPortal | null) & {
|
|
73
70
|
Header: typeof AlertDialogHeader;
|
|
74
71
|
HeadingBlock: typeof AlertDialogHeadingBlock;
|
|
75
72
|
Title: import('react').ForwardRefExoticComponent<AlertDialogTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
@@ -2,41 +2,21 @@ import { ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
import { ButtonSize } from '../../core/Button';
|
|
3
3
|
import { ButtonGroupSegment } from '../../core/utils/buttonGroupSegment';
|
|
4
4
|
export type ButtonGroupTextProps = ComponentPropsWithoutRef<"span"> & {
|
|
5
|
-
/**
|
|
6
|
-
* @internal Позиция в группе; выставляется из `<ButtonGroup>`.
|
|
7
|
-
*/
|
|
8
5
|
groupSegment?: ButtonGroupSegment;
|
|
9
|
-
/** Высота/отступы в духу `Button` того же размера. По умолчанию `base`. */
|
|
10
6
|
buttonSize?: ButtonSize;
|
|
11
7
|
};
|
|
12
|
-
/**
|
|
13
|
-
* Неактивная подпись внутри склеенной группы (`Button`, `SearchInput`-рядом и т.д.).
|
|
14
|
-
*/
|
|
15
8
|
export declare const ButtonGroupText: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
16
|
-
/**
|
|
17
|
-
* @internal Позиция в группе; выставляется из `<ButtonGroup>`.
|
|
18
|
-
*/
|
|
19
9
|
groupSegment?: ButtonGroupSegment;
|
|
20
|
-
/** Высота/отступы в духу `Button` того же размера. По умолчанию `base`. */
|
|
21
10
|
buttonSize?: ButtonSize;
|
|
22
11
|
} & import('react').RefAttributes<HTMLSpanElement>>;
|
|
23
12
|
export type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
24
13
|
export type ButtonGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "role" | "children"> & {
|
|
25
|
-
/** Ряд или колонка. По умолчанию `horizontal`. */
|
|
26
14
|
orientation?: ButtonGroupOrientation;
|
|
27
|
-
/** Совпадает с `size` вложенных `Button`; влияет на `ButtonGroupText`. По умолчанию `base`. */
|
|
28
15
|
buttonSize?: ButtonSize;
|
|
29
16
|
children: ReactNode;
|
|
30
17
|
};
|
|
31
|
-
|
|
32
|
-
* Группа сегментов без зазоров: общий контур скругления только по внешним краям (`Button`, `Input`, `ButtonGroup.Text`).
|
|
33
|
-
*
|
|
34
|
-
* Скругления у `SearchInput` по-прежнему задаются инлайново — для тулбара используйте `Input` в группе или отдельный ряд.
|
|
35
|
-
*/
|
|
36
|
-
export declare const ButtonGroup: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "role"> & {
|
|
37
|
-
/** Ряд или колонка. По умолчанию `horizontal`. */
|
|
18
|
+
export declare const ButtonGroup: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "role" | "children"> & {
|
|
38
19
|
orientation?: ButtonGroupOrientation;
|
|
39
|
-
/** Совпадает с `size` вложенных `Button`; влияет на `ButtonGroupText`. По умолчанию `base`. */
|
|
40
20
|
buttonSize?: ButtonSize;
|
|
41
21
|
children: ReactNode;
|
|
42
22
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,49 +1,58 @@
|
|
|
1
1
|
import { FieldsetHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { FieldErrorProps } from '../../core/Field';
|
|
3
|
+
import { OptionGroupHintProps, OptionGroupLegendProps, OptionGroupListProps, OptionGroupOrientation } from '../utils/optionGroupFieldset';
|
|
4
|
+
import { CheckboxGroupSelection } from './checkboxGroupContext';
|
|
5
|
+
export type { CheckboxGroupSelection };
|
|
4
6
|
export type CheckboxGroupProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange"> & {
|
|
5
|
-
/** Заголовок над списком чекбоксов (`<legend>`). */
|
|
6
|
-
title: ReactNode;
|
|
7
|
-
/** Подзаголовок под заголовком. */
|
|
8
|
-
description?: ReactNode;
|
|
9
|
-
/** Красная звездочка справа от заголовка. */
|
|
10
7
|
isRequired?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* `single` — только один отмеченный пункт; при выборе другого предыдущий снимается.
|
|
13
|
-
* У каждого дочернего `Checkbox` должен быть уникальный строковый `value` (или задаётся индекс).
|
|
14
|
-
*/
|
|
15
8
|
selection?: CheckboxGroupSelection;
|
|
16
|
-
/**
|
|
17
|
-
* Выбранное значение при `selection="single"` (контролируемый режим).
|
|
18
|
-
* `null` — ни один пункт не выбран. Если проп не передан, группа неконтролируемая (`defaultValue`).
|
|
19
|
-
*/
|
|
20
9
|
value?: string | null;
|
|
21
|
-
/** Начальное значение при `selection="single"` без `value`. */
|
|
22
10
|
defaultValue?: string;
|
|
23
|
-
/** Смена выбранного значения в режиме `single`. */
|
|
24
11
|
onValueChange?: (value: string | undefined) => void;
|
|
12
|
+
/** id для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
13
|
+
hintId?: string;
|
|
14
|
+
/** id ошибки для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
15
|
+
errorId?: string;
|
|
25
16
|
children?: ReactNode;
|
|
26
17
|
};
|
|
18
|
+
declare function CheckboxGroupLegend({ children, ...rest }: OptionGroupLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare namespace CheckboxGroupLegend {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare function CheckboxGroupHint({ id, ...rest }: OptionGroupHintProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare namespace CheckboxGroupHint {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
declare function CheckboxGroupError({ id, ...rest }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare namespace CheckboxGroupError {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
27
30
|
export declare const CheckboxGroup: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange"> & {
|
|
28
|
-
/** Заголовок над списком чекбоксов (`<legend>`). */
|
|
29
|
-
title: ReactNode;
|
|
30
|
-
/** Подзаголовок под заголовком. */
|
|
31
|
-
description?: ReactNode;
|
|
32
|
-
/** Красная звездочка справа от заголовка. */
|
|
33
31
|
isRequired?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* `single` — только один отмеченный пункт; при выборе другого предыдущий снимается.
|
|
36
|
-
* У каждого дочернего `Checkbox` должен быть уникальный строковый `value` (или задаётся индекс).
|
|
37
|
-
*/
|
|
38
32
|
selection?: CheckboxGroupSelection;
|
|
39
|
-
/**
|
|
40
|
-
* Выбранное значение при `selection="single"` (контролируемый режим).
|
|
41
|
-
* `null` — ни один пункт не выбран. Если проп не передан, группа неконтролируемая (`defaultValue`).
|
|
42
|
-
*/
|
|
43
33
|
value?: string | null;
|
|
44
|
-
/** Начальное значение при `selection="single"` без `value`. */
|
|
45
34
|
defaultValue?: string;
|
|
46
|
-
/** Смена выбранного значения в режиме `single`. */
|
|
47
35
|
onValueChange?: (value: string | undefined) => void;
|
|
36
|
+
/** id для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
37
|
+
hintId?: string;
|
|
38
|
+
/** id ошибки для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
39
|
+
errorId?: string;
|
|
48
40
|
children?: ReactNode;
|
|
49
|
-
} & import('react').RefAttributes<HTMLFieldSetElement
|
|
41
|
+
} & import('react').RefAttributes<HTMLFieldSetElement>> & {
|
|
42
|
+
Legend: typeof CheckboxGroupLegend;
|
|
43
|
+
Label: import('../../core/Label').LabelComponent;
|
|
44
|
+
Hint: typeof CheckboxGroupHint;
|
|
45
|
+
Error: typeof CheckboxGroupError;
|
|
46
|
+
List: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
orientation?: OptionGroupOrientation;
|
|
48
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
49
|
+
Group: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
|
+
Actions: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
53
|
+
children?: ReactNode;
|
|
54
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
55
|
+
};
|
|
56
|
+
export type { OptionGroupHintProps as CheckboxGroupHintProps, OptionGroupLegendProps as CheckboxGroupLegendProps, OptionGroupListProps as CheckboxGroupListProps, OptionGroupOrientation as CheckboxGroupOrientation, };
|
|
57
|
+
export type { FieldErrorProps as CheckboxGroupErrorProps } from '../../core/Field';
|
|
58
|
+
export type { LabelProps as CheckboxGroupLabelProps } from '../../core/Label';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type CheckboxGroupSelection = "multiple" | "single";
|
|
2
|
+
export type CheckboxGroupContextValue = {
|
|
3
|
+
selection: CheckboxGroupSelection;
|
|
4
|
+
disabled: boolean;
|
|
5
|
+
isRequired: boolean;
|
|
6
|
+
hintId: string;
|
|
7
|
+
errorId: string;
|
|
8
|
+
/** Только для `selection="single"`. */
|
|
9
|
+
selectedValue: string | undefined;
|
|
10
|
+
/** Только для `selection="single"`. */
|
|
11
|
+
selectSingleValue: (value: string, checked: boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const CheckboxGroupContext: import('react').Context<CheckboxGroupContextValue | null>;
|
|
14
|
+
export declare function useCheckboxGroupContext(): CheckboxGroupContextValue;
|
|
15
|
+
export declare function useOptionalCheckboxGroupContext(): CheckboxGroupContextValue | null;
|
|
16
|
+
export { CheckboxGroupContext };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupSelection, } from './CheckboxGroup';
|
|
1
|
+
export { CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupSelection, type CheckboxGroupOrientation, type CheckboxGroupHintProps, type CheckboxGroupLabelProps, type CheckboxGroupLegendProps, type CheckboxGroupListProps, } from './CheckboxGroup';
|
|
2
|
+
export { useCheckboxGroupContext, useOptionalCheckboxGroupContext, type CheckboxGroupContextValue, } from './checkboxGroupContext';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { FieldsetHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { OptionGroupHintProps, OptionGroupLegendProps, OptionGroupListProps, OptionGroupOrientation } from '../utils/optionGroupFieldset';
|
|
3
|
+
import { FieldErrorProps } from '../../core/Field';
|
|
4
|
+
export type RadioGroupOrientation = OptionGroupOrientation;
|
|
5
|
+
export type RadioGroupProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange"> & {
|
|
6
|
+
isRequired?: boolean;
|
|
7
|
+
value?: string | null;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string | undefined) => void;
|
|
10
|
+
/** id для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
11
|
+
hintId?: string;
|
|
12
|
+
/** id ошибки для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
13
|
+
errorId?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
declare function RadioGroupLegend({ children, ...rest }: OptionGroupLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare namespace RadioGroupLegend {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
declare function RadioGroupHint({ id, ...rest }: OptionGroupHintProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare namespace RadioGroupHint {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
declare function RadioGroupError({ id, ...rest }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare namespace RadioGroupError {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" | "onChange"> & {
|
|
29
|
+
isRequired?: boolean;
|
|
30
|
+
value?: string | null;
|
|
31
|
+
defaultValue?: string;
|
|
32
|
+
onValueChange?: (value: string | undefined) => void;
|
|
33
|
+
/** id для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
34
|
+
hintId?: string;
|
|
35
|
+
/** id ошибки для `aria-describedby`; по умолчанию генерируется автоматически. */
|
|
36
|
+
errorId?: string;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
} & import('react').RefAttributes<HTMLFieldSetElement>> & {
|
|
39
|
+
Legend: typeof RadioGroupLegend;
|
|
40
|
+
Label: import('../../core/Label').LabelComponent;
|
|
41
|
+
Hint: typeof RadioGroupHint;
|
|
42
|
+
Error: typeof RadioGroupError;
|
|
43
|
+
List: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
44
|
+
orientation?: OptionGroupOrientation;
|
|
45
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
46
|
+
Group: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
49
|
+
Actions: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
|
+
};
|
|
53
|
+
export type { OptionGroupHintProps as RadioGroupHintProps, OptionGroupLegendProps as RadioGroupLegendProps, OptionGroupListProps as RadioGroupListProps, };
|
|
54
|
+
export type { FieldErrorProps as RadioGroupErrorProps } from '../../core/Field';
|
|
55
|
+
export type { LabelProps as RadioGroupLabelProps } from '../../core/Label';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { RadioGroup, type RadioGroupProps, type RadioGroupOrientation, type RadioGroupHintProps, type RadioGroupErrorProps, type RadioGroupLabelProps, type RadioGroupLegendProps, type RadioGroupListProps, } from './RadioGroup';
|
|
2
|
+
export { useRadioGroupContext, useOptionalRadioGroupContext, type RadioGroupContextValue, } from './radioGroupContext';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type RadioGroupContextValue = {
|
|
2
|
+
name: string;
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
isRequired: boolean;
|
|
5
|
+
hintId: string;
|
|
6
|
+
errorId: string;
|
|
7
|
+
selectedValue: string | undefined;
|
|
8
|
+
selectValue: (value: string | undefined) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const RadioGroupContext: import('react').Context<RadioGroupContextValue | null>;
|
|
11
|
+
export declare function useRadioGroupContext(): RadioGroupContextValue;
|
|
12
|
+
export declare function useOptionalRadioGroupContext(): RadioGroupContextValue | null;
|
|
13
|
+
export { RadioGroupContext };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ToggleButtonGroupOrientation, ToggleButtonGroupType } from '../../core/ToggleButton/toggleButtonGroupContext';
|
|
3
|
+
import { ToggleButtonSize, ToggleButtonVariant } from '../../core/ToggleButton/ToggleButton';
|
|
4
|
+
export type ToggleButtonGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** `multiple` — независимые toggle; `single` — только один выбран (radio). По умолчанию `multiple`. */
|
|
7
|
+
type?: ToggleButtonGroupType;
|
|
8
|
+
orientation?: ToggleButtonGroupOrientation;
|
|
9
|
+
/** Разделить кнопки зазором вместо склейки. */
|
|
10
|
+
separated?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
size?: ToggleButtonSize;
|
|
13
|
+
variant?: ToggleButtonVariant;
|
|
14
|
+
/** Контролируемое значение: `string` при `type="single"`, `string[]` при `type="multiple"`. */
|
|
15
|
+
value?: string | string[];
|
|
16
|
+
defaultValue?: string | string[];
|
|
17
|
+
onValueChange?: (value: string | string[]) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const ToggleButtonGroup: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> & {
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
/** `multiple` — независимые toggle; `single` — только один выбран (radio). По умолчанию `multiple`. */
|
|
22
|
+
type?: ToggleButtonGroupType;
|
|
23
|
+
orientation?: ToggleButtonGroupOrientation;
|
|
24
|
+
/** Разделить кнопки зазором вместо склейки. */
|
|
25
|
+
separated?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
size?: ToggleButtonSize;
|
|
28
|
+
variant?: ToggleButtonVariant;
|
|
29
|
+
/** Контролируемое значение: `string` при `type="single"`, `string[]` при `type="multiple"`. */
|
|
30
|
+
value?: string | string[];
|
|
31
|
+
defaultValue?: string | string[];
|
|
32
|
+
onValueChange?: (value: string | string[]) => void;
|
|
33
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ToggleButtonGroup, type ToggleButtonGroupProps, } from './ToggleButtonGroup';
|
|
2
|
+
export { useToggleButtonGroupContext, useOptionalToggleButtonGroupContext, type ToggleButtonGroupType, type ToggleButtonGroupOrientation, type ToggleButtonGroupContextValue, } from '../../core/ToggleButton/toggleButtonGroupContext';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FieldsetHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { FieldSetActions, FieldSetGroup } from '../../core/Field/FieldSet';
|
|
3
|
+
export type OptionGroupOrientation = "vertical" | "horizontal";
|
|
4
|
+
export declare const OPTION_GROUP_ORIENTATION_LAYOUT: Record<OptionGroupOrientation, string>;
|
|
5
|
+
export { joinFieldDescribedBy as joinAriaDescribedBy } from '../../core/Field/fieldA11y';
|
|
6
|
+
export type OptionGroupFieldsetProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** id для `aria-describedby` у поля; задаётся корнем группы. */
|
|
9
|
+
hintId?: string;
|
|
10
|
+
errorId?: string;
|
|
11
|
+
isRequired?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const OptionGroupFieldset: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** id для `aria-describedby` у поля; задаётся корнем группы. */
|
|
16
|
+
hintId?: string;
|
|
17
|
+
errorId?: string;
|
|
18
|
+
isRequired?: boolean;
|
|
19
|
+
} & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
20
|
+
export type OptionGroupLegendProps = HTMLAttributes<HTMLLegendElement>;
|
|
21
|
+
export declare const OptionGroupLegend: import('react').ForwardRefExoticComponent<OptionGroupLegendProps & import('react').RefAttributes<HTMLLegendElement>>;
|
|
22
|
+
export { FieldSetGroup as OptionGroupGroup, FieldSetActions as OptionGroupActions };
|
|
23
|
+
/** @deprecated Используйте `Label` из `@/components/core/Label`. */
|
|
24
|
+
export { Label as OptionGroupLabel, type LabelProps as OptionGroupLabelProps } from '../../core/Label';
|
|
25
|
+
export type OptionGroupHintProps = HTMLAttributes<HTMLSpanElement> & {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function OptionGroupHint({ children, className, id, ...rest }: OptionGroupHintProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export type OptionGroupHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/** Обёртка для `Label` + `Hint` внутри `Legend`. */
|
|
34
|
+
export declare function OptionGroupHeader({ children, className, ...rest }: OptionGroupHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export type OptionGroupListProps = HTMLAttributes<HTMLDivElement> & {
|
|
36
|
+
orientation?: OptionGroupOrientation;
|
|
37
|
+
};
|
|
38
|
+
export declare const OptionGroupList: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
39
|
+
orientation?: OptionGroupOrientation;
|
|
40
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
41
|
+
/** @deprecated Используйте `useFieldSetHintId` из `@/components/core/Field`. */
|
|
42
|
+
export declare function useOptionGroupHintId(providedId?: string): string;
|
|
43
|
+
/** @deprecated Используйте `useFieldSetErrorId` из `@/components/core/Field`. */
|
|
44
|
+
export declare function useOptionGroupErrorId(providedId?: string): string;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export type AlertStatus = AlertVariant | "warning";
|
|
5
|
-
export declare function resolveAlertStatus(status?: AlertStatus, variant?: AlertVariant): AlertStatus;
|
|
6
|
-
export type AlertProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
variant?: AlertVariant;
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { AlertLiveRole, AlertStatus } from './alertUtils';
|
|
3
|
+
export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, "role"> & {
|
|
8
4
|
status?: AlertStatus;
|
|
5
|
+
/** Live region: `alert` (срочно) или `status` (информативно). По умолчанию — из `status`. */
|
|
6
|
+
role?: AlertLiveRole;
|
|
7
|
+
/** Simple API: заголовок. В compound игнорируется. */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/** Simple API: описание. В compound — `<Alert.Description>`. */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Simple API: иконка в `Indicator`.
|
|
13
|
+
* Не задано — дефолт по `status`; `null` — без иконки.
|
|
14
|
+
*/
|
|
15
|
+
icon?: ReactNode | null;
|
|
16
|
+
/** Simple API: слот действия справа. В compound — `<Alert.Action>`. */
|
|
17
|
+
action?: ReactNode;
|
|
9
18
|
};
|
|
10
19
|
type AlertIndicatorProps = HTMLAttributes<HTMLSpanElement> & {
|
|
11
20
|
status?: AlertStatus;
|
|
@@ -16,13 +25,40 @@ type AlertTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
|
16
25
|
type AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;
|
|
17
26
|
type AlertActionProps = HTMLAttributes<HTMLDivElement>;
|
|
18
27
|
declare function AlertIndicator({ status, className, children, ...rest }: AlertIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
declare namespace AlertIndicator {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
19
31
|
declare function AlertContent({ className, ...rest }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
declare
|
|
21
|
-
|
|
32
|
+
declare namespace AlertContent {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
35
|
+
declare function AlertTitle({ className, id: idProp, ...rest }: AlertTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare namespace AlertTitle {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
declare function AlertDescription({ className, id: idProp, ...rest }: AlertDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare namespace AlertDescription {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
22
43
|
declare function AlertAction({ className, ...rest }: AlertActionProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
declare namespace AlertAction {
|
|
45
|
+
var displayName: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const Alert: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "role"> & {
|
|
25
48
|
status?: AlertStatus;
|
|
49
|
+
/** Live region: `alert` (срочно) или `status` (информативно). По умолчанию — из `status`. */
|
|
50
|
+
role?: AlertLiveRole;
|
|
51
|
+
/** Simple API: заголовок. В compound игнорируется. */
|
|
52
|
+
title?: ReactNode;
|
|
53
|
+
/** Simple API: описание. В compound — `<Alert.Description>`. */
|
|
54
|
+
description?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Simple API: иконка в `Indicator`.
|
|
57
|
+
* Не задано — дефолт по `status`; `null` — без иконки.
|
|
58
|
+
*/
|
|
59
|
+
icon?: ReactNode | null;
|
|
60
|
+
/** Simple API: слот действия справа. В compound — `<Alert.Action>`. */
|
|
61
|
+
action?: ReactNode;
|
|
26
62
|
} & import('react').RefAttributes<HTMLDivElement>> & {
|
|
27
63
|
Indicator: typeof AlertIndicator;
|
|
28
64
|
Message: import('react').ForwardRefExoticComponent<AlertMessageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -32,3 +68,5 @@ export declare const Alert: import('react').ForwardRefExoticComponent<HTMLAttrib
|
|
|
32
68
|
Action: typeof AlertAction;
|
|
33
69
|
};
|
|
34
70
|
export type { AlertIndicatorProps, AlertContentProps, AlertMessageProps, AlertTitleProps, AlertDescriptionProps, AlertActionProps, };
|
|
71
|
+
export type { AlertStatus, AlertLiveRole } from './alertUtils';
|
|
72
|
+
export { resolveAlertStatus } from './alertUtils';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AlertStatus } from './alertUtils';
|
|
2
|
+
export type AlertContextValue = {
|
|
3
|
+
status: AlertStatus;
|
|
4
|
+
titleId: string;
|
|
5
|
+
descriptionId: string;
|
|
6
|
+
};
|
|
7
|
+
declare const AlertContext: import('react').Context<AlertContextValue | null>;
|
|
8
|
+
export declare function useAlertContext(): AlertContextValue;
|
|
9
|
+
export declare function useOptionalAlertContext(): AlertContextValue | null;
|
|
10
|
+
export { AlertContext };
|