prime-ui-kit 0.2.5 → 0.3.1
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 +161 -35
- package/dist/components/accordion/Accordion.d.ts +70 -0
- package/dist/components/accordion/Accordion.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.d.ts +58 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/badge/Badge.d.ts +51 -0
- package/dist/components/badge/Badge.d.ts.map +1 -0
- package/dist/components/banner/Banner.d.ts +78 -0
- package/dist/components/banner/Banner.d.ts.map +1 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +47 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts +57 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +34 -0
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
- package/dist/components/card/Card.d.ts +234 -0
- package/dist/components/card/Card.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +42 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/code-block/CodeBlock.d.ts +17 -0
- package/dist/components/code-block/CodeBlock.d.ts.map +1 -0
- package/dist/components/color-picker/ColorPicker.d.ts +76 -0
- package/dist/components/color-picker/ColorPicker.d.ts.map +1 -0
- package/dist/components/color-picker/ColorPickerRac.d.ts +76 -0
- package/dist/components/color-picker/ColorPickerRac.d.ts.map +1 -0
- package/dist/components/command-menu/CommandMenu.d.ts +74 -0
- package/dist/components/command-menu/CommandMenu.d.ts.map +1 -0
- package/dist/components/data-table/DataTable.d.ts +78 -0
- package/dist/components/data-table/DataTable.d.ts.map +1 -0
- package/dist/components/datepicker/Datepicker.d.ts +104 -0
- package/dist/components/datepicker/Datepicker.d.ts.map +1 -0
- package/dist/components/digit-input/DigitInput.d.ts +21 -0
- package/dist/components/digit-input/DigitInput.d.ts.map +1 -0
- package/dist/components/divider/Divider.d.ts +26 -0
- package/dist/components/divider/Divider.d.ts.map +1 -0
- package/dist/components/drawer/Drawer.d.ts +71 -0
- package/dist/components/drawer/Drawer.d.ts.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +147 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/dropdownGeometry.d.ts +10 -0
- package/dist/components/dropdown/dropdownGeometry.d.ts.map +1 -0
- package/dist/components/dropdown/menuKeyboard.d.ts +4 -0
- package/dist/components/dropdown/menuKeyboard.d.ts.map +1 -0
- package/dist/components/dropdown/useDropdownPosition.d.ts +18 -0
- package/dist/components/dropdown/useDropdownPosition.d.ts.map +1 -0
- package/dist/components/example-frame/ExampleFrame.d.ts +53 -0
- package/dist/components/example-frame/ExampleFrame.d.ts.map +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +176 -0
- package/dist/components/file-upload/FileUpload.d.ts.map +1 -0
- package/dist/components/hint/Hint.d.ts +27 -0
- package/dist/components/hint/Hint.d.ts.map +1 -0
- package/dist/components/index.css +6101 -5759
- package/dist/components/index.css.map +4 -4
- package/dist/components/index.d.ts +95 -2679
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +8510 -7659
- package/dist/components/index.js.map +4 -4
- package/dist/components/input/Input.d.ts +73 -0
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/kbd/Kbd.d.ts +15 -0
- package/dist/components/kbd/Kbd.d.ts.map +1 -0
- package/dist/components/label/Label.d.ts +29 -0
- package/dist/components/label/Label.d.ts.map +1 -0
- package/dist/components/link-button/LinkButton.d.ts +18 -0
- package/dist/components/link-button/LinkButton.d.ts.map +1 -0
- package/dist/components/modal/Modal.d.ts +58 -0
- package/dist/components/modal/Modal.d.ts.map +1 -0
- package/dist/components/notification/Notification.d.ts +42 -0
- package/dist/components/notification/Notification.d.ts.map +1 -0
- package/dist/components/notification/NotificationStore.d.ts +18 -0
- package/dist/components/notification/NotificationStore.d.ts.map +1 -0
- package/dist/components/page-content/PageContent.d.ts +51 -0
- package/dist/components/page-content/PageContent.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.d.ts +19 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/popover/Popover.d.ts +48 -0
- package/dist/components/popover/Popover.d.ts.map +1 -0
- package/dist/components/popover/popoverGeometry.d.ts +6 -0
- package/dist/components/popover/popoverGeometry.d.ts.map +1 -0
- package/dist/components/popover/usePopoverPosition.d.ts +18 -0
- package/dist/components/popover/usePopoverPosition.d.ts.map +1 -0
- package/dist/components/progress-bar/ProgressBar.d.ts +14 -0
- package/dist/components/progress-bar/ProgressBar.d.ts.map +1 -0
- package/dist/components/progress-circle/ProgressCircle.d.ts +33 -0
- package/dist/components/progress-circle/ProgressCircle.d.ts.map +1 -0
- package/dist/components/radio/Radio.d.ts +40 -0
- package/dist/components/radio/Radio.d.ts.map +1 -0
- package/dist/components/scroll-container/ScrollContainer.d.ts +42 -0
- package/dist/components/scroll-container/ScrollContainer.d.ts.map +1 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +40 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts.map +1 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +22 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts.map +1 -0
- package/dist/components/select/Select.d.ts +84 -0
- package/dist/components/select/Select.d.ts.map +1 -0
- package/dist/components/select/selectListbox.d.ts +13 -0
- package/dist/components/select/selectListbox.d.ts.map +1 -0
- package/dist/components/slider/Slider.d.ts +23 -0
- package/dist/components/slider/Slider.d.ts.map +1 -0
- package/dist/components/stepper/HorizontalStepper.d.ts +41 -0
- package/dist/components/stepper/HorizontalStepper.d.ts.map +1 -0
- package/dist/components/stepper/Stepper.d.ts +77 -0
- package/dist/components/stepper/Stepper.d.ts.map +1 -0
- package/dist/components/stepper/VerticalStepper.d.ts +41 -0
- package/dist/components/stepper/VerticalStepper.d.ts.map +1 -0
- package/dist/components/stepper/stepperAlignContext.d.ts +11 -0
- package/dist/components/stepper/stepperAlignContext.d.ts.map +1 -0
- package/dist/components/switch/Switch.d.ts +48 -0
- package/dist/components/switch/Switch.d.ts.map +1 -0
- package/dist/components/tabs/Tabs.d.ts +69 -0
- package/dist/components/tabs/Tabs.d.ts.map +1 -0
- package/dist/components/tag/Tag.d.ts +29 -0
- package/dist/components/tag/Tag.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.d.ts +43 -0
- package/dist/components/textarea/Textarea.d.ts.map +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +47 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/typography/Typography.d.ts +30 -0
- package/dist/components/typography/Typography.d.ts.map +1 -0
- package/dist/hooks/useControllableState.d.ts +8 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useEscapeKey.d.ts +7 -0
- package/dist/hooks/useEscapeKey.d.ts.map +1 -0
- package/dist/hooks/useFieldIds.d.ts +17 -0
- package/dist/hooks/useFieldIds.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.d.ts +16 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.d.ts +3 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useOutsideClick.d.ts +16 -0
- package/dist/hooks/useOutsideClick.d.ts.map +1 -0
- package/dist/hooks/useOverlayModal.d.ts +7 -0
- package/dist/hooks/useOverlayModal.d.ts.map +1 -0
- package/dist/hooks/usePosition.d.ts +41 -0
- package/dist/hooks/usePosition.d.ts.map +1 -0
- package/dist/hooks/useResponsiveMonths.d.ts +18 -0
- package/dist/hooks/useResponsiveMonths.d.ts.map +1 -0
- package/dist/hooks/useScrollLock.d.ts +8 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +13 -0
- package/dist/icons/Icon.d.ts.map +1 -0
- package/dist/icons/index.d.ts +40 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/index.css +6101 -5759
- package/dist/index.css.map +4 -4
- package/dist/index.d.ts +4 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8509 -7660
- package/dist/index.js.map +4 -4
- package/dist/internal/ControlSizeContext.d.ts +17 -0
- package/dist/internal/ControlSizeContext.d.ts.map +1 -0
- package/dist/internal/DividerContentContext.d.ts +4 -0
- package/dist/internal/DividerContentContext.d.ts.map +1 -0
- package/dist/internal/OverlayPortalLayerContext.d.ts +13 -0
- package/dist/internal/OverlayPortalLayerContext.d.ts.map +1 -0
- package/dist/internal/Portal.d.ts +8 -0
- package/dist/internal/Portal.d.ts.map +1 -0
- package/dist/internal/context.d.ts +11 -0
- package/dist/internal/context.d.ts.map +1 -0
- package/dist/internal/cx.d.ts +2 -0
- package/dist/internal/cx.d.ts.map +1 -0
- package/dist/internal/data-attributes.d.ts +6 -0
- package/dist/internal/data-attributes.d.ts.map +1 -0
- package/dist/internal/highlightTsxHtml.d.ts +3 -0
- package/dist/internal/highlightTsxHtml.d.ts.map +1 -0
- package/dist/internal/layoutPxFromPrimitives.d.ts +13 -0
- package/dist/internal/layoutPxFromPrimitives.d.ts.map +1 -0
- package/dist/internal/mergeRefs.d.ts +4 -0
- package/dist/internal/mergeRefs.d.ts.map +1 -0
- package/dist/internal/runtimeUnits.d.ts +3 -0
- package/dist/internal/runtimeUnits.d.ts.map +1 -0
- package/dist/internal/scrollAncestors.d.ts +3 -0
- package/dist/internal/scrollAncestors.d.ts.map +1 -0
- package/dist/internal/slot.d.ts +19 -0
- package/dist/internal/slot.d.ts.map +1 -0
- package/dist/internal/states.d.ts +87 -0
- package/dist/internal/states.d.ts.map +1 -0
- package/dist/layout/app-shell/AppShell.d.ts +54 -0
- package/dist/layout/app-shell/AppShell.d.ts.map +1 -0
- package/dist/layout/index.d.ts +7 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/sidebar/Sidebar.d.ts +241 -0
- package/dist/layout/sidebar/Sidebar.d.ts.map +1 -0
- package/dist/layout/sidebar/SidebarRoot.d.ts +51 -0
- package/dist/layout/sidebar/SidebarRoot.d.ts.map +1 -0
- package/dist/layout/sidebar/sidebar-context.d.ts +19 -0
- package/dist/layout/sidebar/sidebar-context.d.ts.map +1 -0
- package/dist/layout/sidebar/sidebarLayout.d.ts +12 -0
- package/dist/layout/sidebar/sidebarLayout.d.ts.map +1 -0
- package/dist/tokens/primitives.d.ts +390 -0
- package/dist/tokens/primitives.d.ts.map +1 -0
- package/dist/tokens/semantic.d.ts +732 -0
- package/dist/tokens/semantic.d.ts.map +1 -0
- package/dist/tokens/themes/dark.d.ts +143 -0
- package/dist/tokens/themes/dark.d.ts.map +1 -0
- package/dist/tokens/themes/light.d.ts +16 -0
- package/dist/tokens/themes/light.d.ts.map +1 -0
- package/package.json +9 -4
- package/src/components/accordion/COMPONENT.md +137 -0
- package/src/components/avatar/COMPONENT.md +100 -0
- package/src/components/badge/COMPONENT.md +78 -0
- package/src/components/banner/COMPONENT.md +118 -0
- package/src/components/breadcrumb/COMPONENT.md +94 -0
- package/src/components/button/COMPONENT.md +80 -0
- package/src/components/button-group/COMPONENT.md +83 -0
- package/src/components/card/COMPONENT.md +489 -0
- package/src/components/checkbox/COMPONENT.md +98 -0
- package/src/components/code-block/COMPONENT.md +58 -0
- package/src/components/color-picker/COMPONENT.md +149 -0
- package/src/components/command-menu/COMPONENT.md +167 -0
- package/src/components/data-table/COMPONENT.md +113 -0
- package/src/components/datepicker/COMPONENT.md +137 -0
- package/src/components/digit-input/COMPONENT.md +68 -0
- package/src/components/divider/COMPONENT.md +70 -0
- package/src/components/drawer/COMPONENT.md +149 -0
- package/src/components/dropdown/COMPONENT.md +192 -0
- package/src/components/file-upload/COMPONENT.md +200 -0
- package/src/components/hint/COMPONENT.md +67 -0
- package/src/components/input/COMPONENT.md +119 -0
- package/src/components/kbd/COMPONENT.md +59 -0
- package/src/components/label/COMPONENT.md +94 -0
- package/src/components/link-button/COMPONENT.md +60 -0
- package/src/components/modal/COMPONENT.md +105 -0
- package/src/components/notification/COMPONENT.md +120 -0
- package/src/components/pagination/COMPONENT.md +61 -0
- package/src/components/popover/COMPONENT.md +93 -0
- package/src/components/progress-bar/COMPONENT.md +59 -0
- package/src/components/progress-circle/COMPONENT.md +63 -0
- package/src/components/radio/COMPONENT.md +95 -0
- package/src/components/segmented-control/COMPONENT.md +86 -0
- package/src/components/segmented-progress-bar/COMPONENT.md +75 -0
- package/src/components/select/COMPONENT.md +175 -0
- package/src/components/slider/COMPONENT.md +62 -0
- package/src/components/stepper/COMPONENT.md +186 -0
- package/src/components/switch/COMPONENT.md +98 -0
- package/src/components/tabs/COMPONENT.md +114 -0
- package/src/components/tag/COMPONENT.md +67 -0
- package/src/components/textarea/COMPONENT.md +98 -0
- package/src/components/tooltip/COMPONENT.md +87 -0
- package/src/components/typography/COMPONENT.md +89 -0
- package/src/styles/theme-dark.css +43 -0
- package/src/styles/theme-light.css +43 -0
- package/src/styles/tokens.css +23 -4
- package/src/styles/tokens.test.ts +0 -27
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
A compound on/off control: a native `input type="checkbox"` with `role="switch"`, a visual track and thumb, and optional slots for label text, hint, and error wired through `aria-describedby` and invalid state.
|
|
8
|
+
|
|
9
|
+
- **When to use** — binary settings (notifications, feature flags, consent) where the UI should read as on/off rather than a small checkbox in a list.
|
|
10
|
+
- **When to use** — forms that need `name`, `value`, or `required` on the underlying input together with hint or error copy under the label column.
|
|
11
|
+
- **When to use** — a single independent toggle per row; state is obvious from the thumb position and `aria-checked`.
|
|
12
|
+
- **When not to use** — picking exactly one option from mutually exclusive alternatives (prefer [Radio](../radio/COMPONENT.md)).
|
|
13
|
+
- **When not to use** — lists with partial selection or an **indeterminate** state (prefer [Checkbox](../checkbox/COMPONENT.md)).
|
|
14
|
+
- **When not to use** — you need `asChild` or fully custom markup; the structure is fixed to `Switch.*` parts and [Label](../label/COMPONENT.md) / [Hint](../hint/COMPONENT.md) primitives.
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
- **`Switch.Root`** — field wrapper `div` with `data-size`, `data-variant`, `data-disabled`, `data-invalid`, `data-checked`, `data-readonly`; provides context and **`ControlSizeProvider`** for child parts. Renders **`children` only** (no shortcut that replaces **`Switch.Label`**).
|
|
19
|
+
- **`Switch.Label`** — **`Label.Root`** row: the native switch **`input`**, the decorative **`track`**, and optional label copy; **`htmlFor`** / **`size`** come from context; **`ref`** on **`Root`** is forwarded to this **`input`**.
|
|
20
|
+
- **`Switch.Hint`** — optional; registers hint text and contributes its id to **`aria-describedby`**; uses a dimmed hint variant when the field is **`disabled`**.
|
|
21
|
+
- **`Switch.Error`** — optional; error-styled **[Hint](../hint/COMPONENT.md)** and registers invalid state when mounted (with **`variant="error"`** on **`Root`** when you want error chrome without the slot).
|
|
22
|
+
- **Order:** **`Root`** → **`Label`** (required for the control to exist) → **`Hint`** / **`Error`** below when needed. Public API: **`Switch`** with **`Root`**, **`Label`**, **`Hint`**, **`Error`**.
|
|
23
|
+
|
|
24
|
+
### Minimal example
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { Switch } from "prime-ui-kit";
|
|
28
|
+
|
|
29
|
+
export function Example() {
|
|
30
|
+
return (
|
|
31
|
+
<Switch.Root defaultChecked name="reminders">
|
|
32
|
+
<Switch.Label>Deadline reminders</Switch.Label>
|
|
33
|
+
</Switch.Root>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
- **Controlled:** pass **`checked`** with **`onCheckedChange`**. **Uncontrolled:** use **`defaultChecked`** (defaults to **`false`**). User toggles run through the internal change handler; **`onChange`** on **`Root`** is not the switch API—use **`onCheckedChange`** only.
|
|
41
|
+
- **`readOnly`** calls **`preventDefault`** in the change handler so the value does not change on click; **`aria-readonly`** is set on the input.
|
|
42
|
+
- **`variant="error"`** or a mounted **`Switch.Error`** sets **`invalid`** in context, **`aria-invalid`** on the input, and error styling; **`disabled`** disables the input and adjusts hint styling.
|
|
43
|
+
- **`aria-describedby`** on **`Root`** is merged with hint and error ids when those slots are mounted; add your own ids in **`aria-describedby`** if you need extra descriptors.
|
|
44
|
+
- **`Switch.Label`** with no visible **`children`** leaves only the track; set an accessible name with **`aria-label`** or **`aria-labelledby`** on **`Root`** (or ensure context from nearby text).
|
|
45
|
+
- The public props type includes **`label?: React.ReactNode`**, but **`Root`** does not render it as **`Switch.Label`**—always compose **`Switch.Label`** (and optional **`Hint`** / **`Error`**) as **`children`**.
|
|
46
|
+
- Keyboard and role follow the native checkbox pattern with **`role="switch"`** and **`aria-checked`**; focus visibility uses **`focus-visible`** on the track.
|
|
47
|
+
- There is no **indeterminate** or **loading** state; **`size`** on **`Root`** drives layout tokens, not a DOM **`size`** attribute on the input.
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
### Switch.Root
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Default | Required | Description |
|
|
54
|
+
|------|------|---------|----------|-------------|
|
|
55
|
+
| size | `"s" \| "m" \| "l" \| "xl"` | `"m"` | no | Track and thumb scale from switch tokens. |
|
|
56
|
+
| variant | `"default" \| "error"` | `"default"` | no | Error styling; **`invalid`** is also true when **`Switch.Error`** is mounted. |
|
|
57
|
+
| checked | `boolean` | — | no | Controlled on state. |
|
|
58
|
+
| defaultChecked | `boolean` | `false` | no | Initial on state when uncontrolled. |
|
|
59
|
+
| onCheckedChange | `(checked: boolean) => void` | — | no | Called after the checked value changes from user input. |
|
|
60
|
+
| disabled | `boolean` | — | no | Disables the input; **`data-disabled`** on the field root. |
|
|
61
|
+
| readOnly | `boolean` | — | no | Prevents toggling; **`data-readonly`** and **`aria-readonly`**. |
|
|
62
|
+
| label | `React.ReactNode` | — | no | Present on the type only; not used to render **`Switch.Label`**—compose **`Switch.Label`** as a child instead. |
|
|
63
|
+
| id | `string` | auto (`useId`) | no | Stable input id; paired with **`Switch.Label`** via **`htmlFor`**. |
|
|
64
|
+
| className | `string` | — | no | Class on the field wrapper **`div`**. |
|
|
65
|
+
| aria-describedby | `string` | — | no | Combined with hint and error ids when those slots exist. |
|
|
66
|
+
| children | `React.ReactNode` | — | no | Typically **`Switch.Label`** and optional **`Switch.Hint`** / **`Switch.Error`**. |
|
|
67
|
+
| ref | `React.Ref<HTMLInputElement>` | — | no | Ref to the native **`input`**. |
|
|
68
|
+
| …rest | `Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" \| "size" \| "checked" \| "defaultChecked" \| "onChange">` | — | no | Other native attributes forwarded to the **`input`** (e.g. **`name`**, **`value`**, **`required`**, **`autoFocus`**, **`aria-*`**). **`type`** is always **`checkbox`**. |
|
|
69
|
+
|
|
70
|
+
### Switch.Label
|
|
71
|
+
|
|
72
|
+
| Prop | Type | Default | Required | Description |
|
|
73
|
+
|------|------|---------|----------|-------------|
|
|
74
|
+
| children | `React.ReactNode` | — | no | Text beside the switch; omit only when an accessible name is provided elsewhere. |
|
|
75
|
+
| className | `string` | — | no | Class on the label row. |
|
|
76
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLLabelElement>, "htmlFor" \| "size">` | — | no | Other label attributes; **`htmlFor`** and **`size`** are managed internally. |
|
|
77
|
+
|
|
78
|
+
### Switch.Hint
|
|
79
|
+
|
|
80
|
+
| Prop | Type | Default | Required | Description |
|
|
81
|
+
|------|------|---------|----------|-------------|
|
|
82
|
+
| children | `React.ReactNode` | — | yes | Supplementary text below the label. |
|
|
83
|
+
| className | `string` | — | no | Class on the hint slot. |
|
|
84
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLParagraphElement>, "id">` | — | no | Paragraph attributes; **`id`** is managed internally. |
|
|
85
|
+
|
|
86
|
+
### Switch.Error
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Required | Description |
|
|
89
|
+
|------|------|---------|----------|-------------|
|
|
90
|
+
| children | `React.ReactNode` | — | yes | Error message text. |
|
|
91
|
+
| className | `string` | — | no | Class on the error block. |
|
|
92
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLParagraphElement>, "id">` | — | no | Paragraph attributes; **`id`** is managed internally. |
|
|
93
|
+
|
|
94
|
+
## Related
|
|
95
|
+
|
|
96
|
+
- [Checkbox](../checkbox/COMPONENT.md) — groups, **indeterminate**, and checkbox semantics.
|
|
97
|
+
- [Radio](../radio/COMPONENT.md) — one selected option from a set.
|
|
98
|
+
- [Label](../label/COMPONENT.md), [Hint](../hint/COMPONENT.md) — primitives inside the switch; pair with [Input](../input/COMPONENT.md) in larger forms.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
Compound tabs: a `tablist` of triggers, an animated indicator, and one visible `tabpanel` at a time. Values on `Tabs.Tab` and `Tabs.Panel` must align so the active pair matches.
|
|
8
|
+
|
|
9
|
+
- **Use** to switch sections on a single view (settings areas, product details blocks, dashboard sub-views) without route changes.
|
|
10
|
+
- **Use** controlled `value` / `onValueChange` when the active tab must follow URL, store, or wizard step.
|
|
11
|
+
- **Use** `orientation="vertical"` for a sidebar-style tab rail next to content.
|
|
12
|
+
- **Do not use** for primary page-to-page navigation; prefer links and routes (see [Breadcrumb](../breadcrumb/COMPONENT.md) for hierarchy).
|
|
13
|
+
- **Do not use** for two to four lightweight mutually exclusive options without rich panels; consider [SegmentedControl](../segmented-control/COMPONENT.md).
|
|
14
|
+
- **Do not use** expecting inactive panel subtrees to stay mounted; hidden panels are not rendered (see Rules).
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
- **`Tabs.Root`** — context wrapper (`div` with `data-orientation`, `data-size`). Put **`Tabs.List`** and **`Tabs.Panel`** nodes as direct structure; order in the tree is list first, then panels (typical reading order).
|
|
19
|
+
- **`Tabs.List`** — `role="tablist"` with `aria-orientation`, keyboard handling, internal indicator, and **`ControlSizeProvider`** for descendants. Children should be **`Tabs.Tab`** triggers only.
|
|
20
|
+
- **`Tabs.Tab`** — `role="tab"` / `button type="button"`. Optional **`Tabs.Icon`** (before label) and **`Tabs.Label`** for text; `value` must match a **`Tabs.Panel`** `value`.
|
|
21
|
+
- **`Tabs.Panel`** — `role="tabpanel"`; renders **only** when its `value` equals the root’s active value.
|
|
22
|
+
|
|
23
|
+
### Minimal example
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Tabs } from "prime-ui-kit";
|
|
27
|
+
|
|
28
|
+
export function Example() {
|
|
29
|
+
return (
|
|
30
|
+
<Tabs.Root defaultValue="a">
|
|
31
|
+
<Tabs.List>
|
|
32
|
+
<Tabs.Tab value="a">
|
|
33
|
+
<Tabs.Label>Tab</Tabs.Label>
|
|
34
|
+
</Tabs.Tab>
|
|
35
|
+
</Tabs.List>
|
|
36
|
+
<Tabs.Panel value="a">Panel content</Tabs.Panel>
|
|
37
|
+
</Tabs.Root>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
|
|
44
|
+
- **Uncontrolled:** omit `value`, set `defaultValue` on `Tabs.Root` (implementation default for `defaultValue` is `""` if omitted). **Controlled:** pass `value` and `onValueChange`; state follows `useControllableState` semantics.
|
|
45
|
+
- **Disabled tabs:** `disabled` on `Tabs.Tab` sets native `disabled`, `data-disabled`, and excludes the tab from arrow-key traversal; disabled targets are skipped.
|
|
46
|
+
- **Keyboard** (focus inside `Tabs.List`): **ArrowLeft** / **ArrowRight** in horizontal mode, **ArrowUp** / **ArrowDown** in vertical mode; **Home** / **End** move to first / last **enabled** tab; focus moves to the newly selected tab after arrow navigation.
|
|
47
|
+
- **Focus order:** the selected tab has `tabIndex={0}`; others use `tabIndex={-1}`.
|
|
48
|
+
- **ARIA:** `aria-controls` / `aria-labelledby` wire tab buttons to panels; list `aria-orientation` mirrors `orientation`.
|
|
49
|
+
- **`Tabs.Icon`** sets `aria-hidden="true"` on the wrapper span; ensure the tab still has a clear name (e.g. `Tabs.Label` or visible text).
|
|
50
|
+
- **Inactive panels:** `Tabs.Panel` returns `null` when inactive—avoid putting expensive trees in panels without app-level lazy loading or conditional data fetching.
|
|
51
|
+
- **No `asChild`:** each tab is always a `<button>`; there is no built-in URL synchronization.
|
|
52
|
+
- **Pairs:** for every panel `value` you expose, provide a corresponding tab (and vice versa) so the tab/panel relationship stays consistent for assistive tech.
|
|
53
|
+
- **Layout:** full-width or custom layout is achieved with `className` and your own flex/grid CSS on the root, list, or tabs—there is no dedicated “full width” prop.
|
|
54
|
+
|
|
55
|
+
## API
|
|
56
|
+
|
|
57
|
+
### Tabs.Root
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Required | Description |
|
|
60
|
+
|------|------|---------|----------|-------------|
|
|
61
|
+
| value | `string` | — | No | Active tab id (controlled) |
|
|
62
|
+
| defaultValue | `string` | `""` | No | Initial active tab when uncontrolled |
|
|
63
|
+
| onValueChange | `(value: string) => void` | — | No | Called when the active tab changes |
|
|
64
|
+
| orientation | `"horizontal" \| "vertical"` | `"horizontal"` | No | Tab list axis and arrow-key mapping |
|
|
65
|
+
| size | `"s" \| "m" \| "l" \| "xl"` | `"m"` | No | Trigger and panel typography scale |
|
|
66
|
+
| children | `React.ReactNode` | — | Yes | `Tabs.List` and `Tabs.Panel` (and related structure) |
|
|
67
|
+
| className | `string` | — | No | Class on the root `div` |
|
|
68
|
+
|
|
69
|
+
### Tabs.List
|
|
70
|
+
|
|
71
|
+
| Prop | Type | Default | Required | Description |
|
|
72
|
+
|------|------|---------|----------|-------------|
|
|
73
|
+
| children | `React.ReactNode` | — | Yes | Typically `Tabs.Tab` elements |
|
|
74
|
+
| className | `string` | — | No | Class on the tablist container |
|
|
75
|
+
|
|
76
|
+
### Tabs.Tab
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Required | Description |
|
|
79
|
+
|------|------|---------|----------|-------------|
|
|
80
|
+
| value | `string` | — | Yes | Id matching the associated `Tabs.Panel` |
|
|
81
|
+
| disabled | `boolean` | `false` | No | Non-interactive; skipped in keyboard roving |
|
|
82
|
+
| children | `React.ReactNode` | — | Yes | Trigger content (e.g. `Tabs.Icon`, `Tabs.Label`) |
|
|
83
|
+
| className | `string` | — | No | Class on the `button` |
|
|
84
|
+
|
|
85
|
+
### Tabs.Icon
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default | Required | Description |
|
|
88
|
+
|------|------|---------|----------|-------------|
|
|
89
|
+
| children | `React.ReactNode` | — | Yes | Icon glyph |
|
|
90
|
+
| className | `string` | — | No | Class on the `span` |
|
|
91
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLSpanElement>, "children">` | — | No | Other span attributes |
|
|
92
|
+
|
|
93
|
+
### Tabs.Label
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Default | Required | Description |
|
|
96
|
+
|------|------|---------|----------|-------------|
|
|
97
|
+
| children | `React.ReactNode` | — | Yes | Label text |
|
|
98
|
+
| className | `string` | — | No | Class on the `span` |
|
|
99
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLSpanElement>, "children">` | — | No | Other span attributes |
|
|
100
|
+
|
|
101
|
+
### Tabs.Panel
|
|
102
|
+
|
|
103
|
+
| Prop | Type | Default | Required | Description |
|
|
104
|
+
|------|------|---------|----------|-------------|
|
|
105
|
+
| value | `string` | — | Yes | Must match the active `Tabs.Tab` `value` to render |
|
|
106
|
+
| children | `React.ReactNode` | — | Yes | Panel body |
|
|
107
|
+
| className | `string` | — | No | Class on the panel `div` |
|
|
108
|
+
|
|
109
|
+
## Related
|
|
110
|
+
|
|
111
|
+
- [Typography](../typography/COMPONENT.md)
|
|
112
|
+
- [SegmentedControl](../segmented-control/COMPONENT.md)
|
|
113
|
+
- [Breadcrumb](../breadcrumb/COMPONENT.md)
|
|
114
|
+
- **Icon** — use inside `Tabs.Icon` for glyphs sized with the tab control tokens
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
A compact chip-style label: optional leading icon (`Tag.Icon`), optional removable close control when `onRemove` is set. Root is a `span` with `data-size` / `data-disabled`; the inner body wraps children in `ControlSizeProvider` so nested icons pick up the same control size tier.
|
|
8
|
+
|
|
9
|
+
- **Use** for filter chips, selected values (recipients, skills), or metadata labels where space is tight and optional one-click removal helps.
|
|
10
|
+
- **Use** `Tag.Icon` when a small icon should align with tag typography and scale with `size`.
|
|
11
|
+
- **Do not use** as a toggle or single-choice control; use [Checkbox](../checkbox/COMPONENT.md), [SegmentedControl](../segmented-control/COMPONENT.md), or [Select](../select/COMPONENT.md).
|
|
12
|
+
- **Do not use** when the whole chip must navigate or submit a primary action; prefer [Button](../button/COMPONENT.md) or [LinkButton](../link-button/COMPONENT.md).
|
|
13
|
+
- **Do not use** expecting localized copy for the remove button without wrapping; the built-in remove `aria-label` is fixed to `"Remove"` in source.
|
|
14
|
+
- **Do not use** as a status/count pill without removal semantics when [Badge](../badge/COMPONENT.md) fits better.
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
- **`Tag.Root`** — outer `span`; holds a **`span`** body with **`ControlSizeProvider`** around **`children`**, then an optional remove **`button`** when **`onRemove`** is defined. Put plain text, **`Tag.Icon`**, or other nodes inside **`Tag.Root`**; place **`Tag.Icon`** before text when both are used so the icon sits on the left.
|
|
19
|
+
- **`Tag.Icon`** — wrapper **`span`** for the icon node; inherits size from the surrounding **`Tag.Root`** context.
|
|
20
|
+
|
|
21
|
+
### Minimal example
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Tag } from "prime-ui-kit";
|
|
25
|
+
|
|
26
|
+
export function Example() {
|
|
27
|
+
return <Tag.Root>Label</Tag.Root>;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Rules
|
|
32
|
+
|
|
33
|
+
- Omit **`size`** to follow the nearest ancestor **`ControlSizeProvider`**; context **`xs`** maps to tag size **`s`**. With no provider and no **`size`**, the effective size is **`m`**.
|
|
34
|
+
- **`onRemove`** is optional; when present, a **`type="button"`** remove control is rendered with **`aria-label="Remove"`** and **`aria-hidden`** on the cross SVG. **`disabled`** sets **`aria-disabled`** on the root and disables the remove button.
|
|
35
|
+
- Without **`onRemove`**, there is no focusable control inside the tag; the root is not a button or link.
|
|
36
|
+
- For lists of removable tags, give the group a clear name (**`aria-label`** or **`aria-labelledby`**) so “Remove” has context.
|
|
37
|
+
- **`Tag.Icon`** does not force **`aria-hidden`** on icons; if the icon is decorative, rely on adjacent text or set **`aria-hidden`** on the icon content yourself.
|
|
38
|
+
- There is no **`variant`** prop; appearance follows **`size`** and whether removal is enabled.
|
|
39
|
+
|
|
40
|
+
## API
|
|
41
|
+
|
|
42
|
+
### Tag.Root
|
|
43
|
+
|
|
44
|
+
| Prop | Type | Default | Required | Description |
|
|
45
|
+
|------|------|---------|----------|-------------|
|
|
46
|
+
| size | `"s" \| "m" \| "l" \| "xl"` | `"m"` or from `ControlSizeProvider` | No | Visual tier for height, radius, text, and nested icon scale |
|
|
47
|
+
| onRemove | `() => void` | — | No | When set, renders the remove button on the right |
|
|
48
|
+
| disabled | `boolean` | — | No | Disables removal and sets `aria-disabled` on the root |
|
|
49
|
+
| children | `React.ReactNode` | — | No | Text, `Tag.Icon`, or other nodes |
|
|
50
|
+
| className | `string` | — | No | Extra class on the root `span` |
|
|
51
|
+
| …rest | `React.HTMLAttributes<HTMLSpanElement>` | — | No | Other root attributes (`data-*`, `aria-*`, etc.) |
|
|
52
|
+
|
|
53
|
+
### Tag.Icon
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Default | Required | Description |
|
|
56
|
+
|------|------|---------|----------|-------------|
|
|
57
|
+
| children | `React.ReactNode` | — | Yes | Icon or other content |
|
|
58
|
+
| className | `string` | — | No | Extra class on the wrapper |
|
|
59
|
+
|
|
60
|
+
## Related
|
|
61
|
+
|
|
62
|
+
- [Badge](../badge/COMPONENT.md)
|
|
63
|
+
- [Button](../button/COMPONENT.md)
|
|
64
|
+
- [Input](../input/COMPONENT.md)
|
|
65
|
+
- [Select](../select/COMPONENT.md)
|
|
66
|
+
- [LinkButton](../link-button/COMPONENT.md)
|
|
67
|
+
- [SegmentedControl](../segmented-control/COMPONENT.md)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
A composite multiline field: native `textarea` inside a bordered `label`, optional footer for a character counter, and optional hint or error lines below wired through `aria-describedby`.
|
|
8
|
+
|
|
9
|
+
**When to use**
|
|
10
|
+
|
|
11
|
+
- Long or growing text in forms, feedback, notes, descriptions, and comments where a single line is not enough.
|
|
12
|
+
- Flows that need a built-in counter, hint, or error message aligned with the same sizing scale as other controls.
|
|
13
|
+
- Layouts where auto-growing height (`autoResize`) should track content without manual `rows` tuning.
|
|
14
|
+
|
|
15
|
+
**When not to use**
|
|
16
|
+
|
|
17
|
+
- Single-line values — use [Input](../input/COMPONENT.md).
|
|
18
|
+
- Rich text or embedded formatting — use a dedicated editor component.
|
|
19
|
+
- When the visible label must sit only above the chrome — pair [Label](../label/COMPONENT.md) with a stable `id` on `Textarea.Root` and avoid nesting a second `label`.
|
|
20
|
+
|
|
21
|
+
## Composition
|
|
22
|
+
|
|
23
|
+
- **`Textarea.Root`** — outer `div` (`field`) with `data-size`, `TextareaProvider`, and `ControlSizeProvider`. The native `textarea` sits inside a `label` (`htmlFor` → input id) with the bordered `control` styling; when `autoResize` is true, the textarea is wrapped so `data-value` can drive height.
|
|
24
|
+
- **`Textarea.CharCounter`** — must be a **direct** child of `Root`; implementation partitions children by reference equality to `Textarea.CharCounter` and renders matching nodes in the control footer.
|
|
25
|
+
- **`Textarea.Hint`** / **`Textarea.Error`** — direct children of `Root`, **not** passed as `CharCounter`; they render after the `label` and register ids merged into the textarea’s `aria-describedby`.
|
|
26
|
+
|
|
27
|
+
### Minimal example
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { Textarea } from "prime-ui-kit";
|
|
31
|
+
|
|
32
|
+
export function Example() {
|
|
33
|
+
return <Textarea.Root placeholder="Notes" />;
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- **Controlled vs uncontrolled:** pass **`value`** with **`onChange`** / **`onInput`** as needed for controlled text; omit **`value`** and optionally set **`defaultValue`** for uncontrolled usage.
|
|
40
|
+
- **`autoResize`** defaults to **`true`**: input events update a wrapper `data-value` mirror; set **`autoResize={false}`** to rely on fixed height / native resize behavior.
|
|
41
|
+
- **`variant="error"`** or mounting **`Textarea.Error`** sets invalid styling; **`aria-invalid`** defaults from that unless overridden.
|
|
42
|
+
- **`aria-describedby`** you pass is **merged** with auto-added hint and error ids (your ids first, then hint and error when those parts mount).
|
|
43
|
+
- **`disabled`** / **`readOnly`** on `Root` flow to the native textarea; **`Textarea.Hint`** switches to a disabled visual variant when either is true.
|
|
44
|
+
- Do not pass **`size`** as a DOM attribute on the textarea — it is omitted from the element API and reserved for **`Textarea.Root`** (`"s"` \| `"m"` \| `"l"` \| `"xl"`).
|
|
45
|
+
- **`Textarea.CharCounter`** is only recognized as an immediate child of **`Root`**; arbitrary wrappers around it will not land in the footer.
|
|
46
|
+
- Counter overflow (**`current` > `max`**) sets **`data-overflow="true"`** on the counter for styling; it does not block typing by itself (pair with **`maxLength`** if you need a hard cap).
|
|
47
|
+
- The counter uses **`aria-live="polite"`** so count updates do not interrupt typing.
|
|
48
|
+
- There is no **`asChild`** or polymorphic root — structure is fixed.
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### Textarea.Root
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Default | Required | Description |
|
|
55
|
+
|------|------|---------|----------|-------------|
|
|
56
|
+
| variant | `"default" \| "error"` | `"default"` | no | Visual invalid emphasis; combines with `aria-invalid` and `Textarea.Error` registration. |
|
|
57
|
+
| size | `"s" \| "m" \| "l" \| "xl"` | `"m"` | no | Control scale (padding, type, min height). |
|
|
58
|
+
| autoResize | `boolean` | `true` | no | When true, height follows content via wrapper `data-value`; when false, no auto-grow wrapper. |
|
|
59
|
+
| id | `string` | from `useId()` | no | Stable id for the textarea; `label` uses `htmlFor` pointing here. |
|
|
60
|
+
| className | `string` | — | no | Class on the bordered `label` (`control`). |
|
|
61
|
+
| disabled | `boolean` | — | no | Native disabled state. |
|
|
62
|
+
| readOnly | `boolean` | — | no | Native read-only state. |
|
|
63
|
+
| value | `string` | — | no | Controlled value. |
|
|
64
|
+
| defaultValue | `string` | — | no | Uncontrolled initial value. |
|
|
65
|
+
| onInput | `React.FormEventHandler<HTMLTextAreaElement>` | — | no | Fires after internal `data-value` sync when `autoResize` is on. |
|
|
66
|
+
| aria-describedby | `string` | — | no | Merged with hint/error ids when those parts mount. |
|
|
67
|
+
| aria-invalid | `Booleanish` | from variant / error | no | Explicit invalidity over heuristics. |
|
|
68
|
+
| children | `React.ReactNode` | — | no | `CharCounter` in the footer; `Hint` / `Error` after the `label`. |
|
|
69
|
+
| …rest | `Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">` | — | no | Standard textarea attributes (`placeholder`, `rows`, `maxLength`, `required`, `onChange`, `name`, etc.). |
|
|
70
|
+
|
|
71
|
+
### Textarea.CharCounter
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Default | Required | Description |
|
|
74
|
+
|------|------|---------|----------|-------------|
|
|
75
|
+
| current | `number` | — | yes | Current character count. |
|
|
76
|
+
| max | `number` | — | yes | Displayed limit; overflow when `current > max` sets `data-overflow="true"`. |
|
|
77
|
+
|
|
78
|
+
### Textarea.Hint
|
|
79
|
+
|
|
80
|
+
| Prop | Type | Default | Required | Description |
|
|
81
|
+
|------|------|---------|----------|-------------|
|
|
82
|
+
| children | `React.ReactNode` | — | yes | Hint copy. |
|
|
83
|
+
| className | `string` | — | no | Extra class on the underlying `Hint.Root`. |
|
|
84
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLParagraphElement>, "id">` | — | no | Paragraph attributes; `id` comes from context. |
|
|
85
|
+
|
|
86
|
+
### Textarea.Error
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Required | Description |
|
|
89
|
+
|------|------|---------|----------|-------------|
|
|
90
|
+
| children | `React.ReactNode` | — | yes | Error copy. |
|
|
91
|
+
| className | `string` | — | no | Extra class on the underlying `Hint.Root`. |
|
|
92
|
+
| …rest | `Omit<React.HTMLAttributes<HTMLParagraphElement>, "id">` | — | no | Paragraph attributes; `id` comes from context. |
|
|
93
|
+
|
|
94
|
+
## Related
|
|
95
|
+
|
|
96
|
+
- [Input](../input/COMPONENT.md)
|
|
97
|
+
- [Label](../label/COMPONENT.md)
|
|
98
|
+
- [Hint](../hint/COMPONENT.md)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** при проектировании экранов и примеров изначально выбирай **`m`** для `size` (где есть ось размера), если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
A composite tooltip: optional delay provider, root with open state, trigger that wraps a single element, and content rendered in a portal and positioned relative to the trigger.
|
|
8
|
+
|
|
9
|
+
- **Use** to clarify icon-only controls, abbreviated labels, dense table cells, or non-obvious metrics on hover or keyboard focus.
|
|
10
|
+
- **Use** when the extra text is short and supplementary; keep the trigger’s visible label or `aria-label` as the primary affordance where possible.
|
|
11
|
+
- **Do not use** for long explanations or content that should stay visible without hover—prefer inline help, a hint, or a dedicated panel.
|
|
12
|
+
- **Do not use** for interactive content inside the layer (links, buttons, inputs); tooltip content is non-interactive and uses `pointer-events: none` in styles.
|
|
13
|
+
- **Do not use** one root for multiple anchors—each trigger needs its own `Tooltip.Root` (or separate instances).
|
|
14
|
+
- **Do not rely** on tooltips opening for natively `disabled` controls; disabled elements often do not receive hover/focus—wrap or use a different focusable pattern if a tooltip is required.
|
|
15
|
+
|
|
16
|
+
## Composition
|
|
17
|
+
|
|
18
|
+
- **`Tooltip.Provider`** (optional) — wraps a subtree to share **`delayDuration`** (default **400** ms) for nested **`Tooltip.Root`** instances. Omit it when the default delay is fine.
|
|
19
|
+
- **`Tooltip.Root`** — holds open state (controlled or uncontrolled). Children must include **`Tooltip.Trigger`** and **`Tooltip.Content`** (order in the tree is conventional; both participate via context).
|
|
20
|
+
- **`Tooltip.Trigger`** — accepts **exactly one** **`React.ReactElement`** child. The implementation **`cloneElement`s** it: merges **`ref`**, **`className`**, **`aria-describedby`**, and pointer/focus handlers. The child must forward refs and accept standard DOM props.
|
|
21
|
+
- **`Tooltip.Content`** — tooltip body; rendered through **`Portal`** as a **`div`** with **`role="tooltip"`** and **`id`** matching the trigger’s **`aria-describedby`**. Sets **`data-size`** and **`data-side`** for styling (including the arrow). Wraps children in **`ControlSizeProvider`** for the chosen **`size`**.
|
|
22
|
+
|
|
23
|
+
### Minimal example
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Tooltip } from "prime-ui-kit";
|
|
27
|
+
|
|
28
|
+
export function Example() {
|
|
29
|
+
return (
|
|
30
|
+
<Tooltip.Root>
|
|
31
|
+
<Tooltip.Trigger>
|
|
32
|
+
<button type="button">Hover</button>
|
|
33
|
+
</Tooltip.Trigger>
|
|
34
|
+
<Tooltip.Content>Help text</Tooltip.Content>
|
|
35
|
+
</Tooltip.Root>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Rules
|
|
41
|
+
|
|
42
|
+
- **Uncontrolled:** omit **`open`**; optional **`defaultOpen`** (defaults to **`false`**). **Controlled:** pass **`open`** and **`onOpenChange`**; the same open state drives visibility together with hover/focus on the trigger.
|
|
43
|
+
- Opening is **delayed** by **`Tooltip.Provider`**’s **`delayDuration`** after **`mouseenter`** or **`focus`**; leaving or **blur** clears the timer and closes. Cleanup runs on unmount.
|
|
44
|
+
- **Position:** **`side`** is **`top`** \| **`bottom`** \| **`left`** \| **`right`** (default **`top`**). Coordinates are **clamped** to the viewport (**8px** inset); there is **no automatic flip** to the opposite side when space is tight—choose **`side`** explicitly if needed.
|
|
45
|
+
- **Accessibility:** trigger gets **`aria-describedby`** pointing at the content **`id`**; content uses **`role="tooltip"`**. For inline glossary-style terms, prefer **`button type="button"`** as the trigger so keyboard focus is predictable.
|
|
46
|
+
- **Portal:** content does not sit in the trigger’s DOM subtree; it won’t inherit layout/CSS from ancestors of the trigger (only what you pass as children and classes on **`Tooltip.Content`**).
|
|
47
|
+
- **`Tooltip.Content`** defaults **`size`** to **`m`** and **`side`** to **`top`**; visual scale and arrow follow **`data-size`** / **`data-side`** and theme tokens—there is no separate **`variant`** prop.
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
The package exports the **`Tooltip`** namespace object and types **`TooltipSize`**, **`TooltipSide`**, **`TooltipProviderProps`**, **`TooltipRootProps`**, **`TooltipTriggerProps`**, **`TooltipContentProps`**.
|
|
52
|
+
|
|
53
|
+
### Tooltip.Provider
|
|
54
|
+
|
|
55
|
+
| Prop | Type | Default | Required | Description |
|
|
56
|
+
|------|------|---------|----------|-------------|
|
|
57
|
+
| delayDuration | `number` | `400` | No | Milliseconds to wait before opening after pointer enters or the trigger receives focus |
|
|
58
|
+
| children | `React.ReactNode` | — | Yes | Subtree whose tooltips use this delay |
|
|
59
|
+
|
|
60
|
+
### Tooltip.Root
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Required | Description |
|
|
63
|
+
|------|------|---------|----------|-------------|
|
|
64
|
+
| children | `React.ReactNode` | — | Yes | Typically `Tooltip.Trigger` and `Tooltip.Content` |
|
|
65
|
+
| open | `boolean` | — | No | Controlled open state |
|
|
66
|
+
| defaultOpen | `boolean` | `false` | No | Initial open state when uncontrolled |
|
|
67
|
+
| onOpenChange | `(open: boolean) => void` | — | No | Called when open state changes |
|
|
68
|
+
|
|
69
|
+
### Tooltip.Trigger
|
|
70
|
+
|
|
71
|
+
| Prop | Type | Default | Required | Description |
|
|
72
|
+
|------|------|---------|----------|-------------|
|
|
73
|
+
| children | `React.ReactElement` | — | Yes | Single element; receives ref, `aria-describedby`, and open/close handlers |
|
|
74
|
+
| className | `string` | — | No | Merged with the child’s `className` via `cx()` |
|
|
75
|
+
|
|
76
|
+
### Tooltip.Content
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Required | Description |
|
|
79
|
+
|------|------|---------|----------|-------------|
|
|
80
|
+
| children | `React.ReactNode` | — | Yes | Tooltip body; wrapped in `ControlSizeProvider` for nested controls that read control size |
|
|
81
|
+
| size | `TooltipSize` (`"s"` \| `"m"` \| `"l"` \| `"xl"`) | `"m"` | No | Padding, typography, and arrow scale |
|
|
82
|
+
| side | `TooltipSide` (`"top"` \| `"bottom"` \| `"left"` \| `"right"`) | `"top"` | No | Placement relative to the trigger before viewport clamping |
|
|
83
|
+
| className | `string` | — | No | Additional class on the portal root |
|
|
84
|
+
|
|
85
|
+
## Related
|
|
86
|
+
|
|
87
|
+
[Button](../button/COMPONENT.md) — typical focusable trigger; [Label](../label/COMPONENT.md) and [Hint](../hint/COMPONENT.md) — persistent field labeling and helper text; [Popover](../popover/COMPONENT.md) — focusable, interactive overlay content.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
**Проектирование по умолчанию:** для текста страницы выбирайте **`body-default`** в `variant`, если явно не оговорено иное.
|
|
4
|
+
|
|
5
|
+
## About
|
|
6
|
+
|
|
7
|
+
Стилизованный текст с **семантическими ролями чтения** (`variant`), привязанными к `typography.role` в токенах, и опциональными осями: `weight`, `tracking`, курсив и приглушённый `tone`. Рендерится как выбранный HTML-тег (`as`).
|
|
8
|
+
|
|
9
|
+
- **Use** для основного текста, подзаголовков по смыслу ролей, подписей и метрик там, где нужны токены кита, а не произвольный `font-size`.
|
|
10
|
+
- **Use** `tone="muted"` для вторичных пояснений и юридических строк.
|
|
11
|
+
- **Use** вложенные `Typography.Root` с разными `as` и `weight` внутри одного блока.
|
|
12
|
+
- **Use** `as="h1"`–`as="h6"` для визуального уровня заголовка, согласованного с темой; по возможности сохраняйте логичный порядок уровней на странице.
|
|
13
|
+
- **Use** `as` с landmarks (`main`, `article`, `section`, `header`, `footer`, …) при вёрстке шаблонов.
|
|
14
|
+
- **Do not use** для подписи внутри **кнопки** или **поля ввода** как отдельной «типографики»: у этих компонентов свой ритм текста — положитесь на разметку [Button](../button/COMPONENT.md) / [Input](../input/COMPONENT.md) и при необходимости [Label](../label/COMPONENT.md).
|
|
15
|
+
- **Do not use** `as` вместо настоящих `<button>` / `<a>` для действий и навигации.
|
|
16
|
+
- **Do not use** ожидая отдельный контроль `line-height` вне роли — межстрочный интервал связан с `variant` в стилях.
|
|
17
|
+
|
|
18
|
+
Интерактивные компоненты (формы, кнопки и т.д.) настраиваются **своими** пропами и токенами; **`Typography`** к ним не относится и **не** задаёт их внешний вид.
|
|
19
|
+
|
|
20
|
+
## Справочное сопоставление: MD3, Apple (SF), Polaris
|
|
21
|
+
|
|
22
|
+
Ниже — **ориентировочное** соответствие ролей prime-ui-kit стилям из [Material Design 3 — Type scale](https://m3.material.io/styles/typography/type-scale-tokens), уровням текста [Apple — Typography](https://developer.apple.com/design/human-interface-guidelines/typography) (SF Pro) и вариантам [Polaris Text](https://polaris.shopify.com/components/typography/text). У разных систем **разные pt/px**; ориентир — **уровень иерархии**, не побитовое совпадение.
|
|
23
|
+
|
|
24
|
+
**Кегль в теме:** каждая роль ссылается на ступени `typography.sizeScale` / `lineHeightScale` → примитивы `font.size.*` / `font.lineHeight.*`. Ниже — **приблизительный размер шрифта** при `1rem = 16px` на `:root` (округление).
|
|
25
|
+
|
|
26
|
+
| `variant` | Примитив кегля | ≈ px @16 | Близкий стиль MD3 | Близкий уровень Apple (SF) | Polaris `Text` |
|
|
27
|
+
| --------- | ---------------- | -------- | ----------------- | --------------------------- | -------------- |
|
|
28
|
+
| `display` | `9xl` | 57 | Display Large | Large Title | `heading3xl` |
|
|
29
|
+
| `headline` | `6xl` | 32 | Headline Large | Title 1 | `heading2xl` |
|
|
30
|
+
| `heading-page` | `4xl` | 28 | Headline Medium | Title 2 | `headingXl` |
|
|
31
|
+
| `heading-section` | `2xl` | 24 | Headline Small | Title 3 | `headingLg` |
|
|
32
|
+
| `heading-subsection` | `xl` | 22 | Title Large | Headline | `headingMd` |
|
|
33
|
+
| `heading-group` | `xs` | 14 | Title Small | Subheadline / Footnote | `headingSm`, `headingXs` |
|
|
34
|
+
| `body-large` | `s` | 16 | Body Large | Body / Callout | `bodyLg` |
|
|
35
|
+
| `body-default` | `xs` | 14 | Body Medium | Subheadline | `bodyMd` |
|
|
36
|
+
| `body-small` | `2xs` | 12 | Body Small | Footnote | `bodySm` |
|
|
37
|
+
| `body-compact` | кегль `xs`, межстрочный `2xs` | 14, плотнее | Label Large (плотная строка) | — | `bodyXs` |
|
|
38
|
+
| `caption` | `2xs` | 12 | Label Medium | Caption 1 | `bodySm` (по смыслу + `tone`) |
|
|
39
|
+
| `caption-micro` | `labelMicro` | 11 | Label Small | Caption 2 | самый мелкий смысловой уровень |
|
|
40
|
+
|
|
41
|
+
Ступени **`7xl`**, **`8xl`** в шкале есть (как у MD3 Display Medium / Small по размеру), но **в роли `typography.role` не задействованы** — при необходимости используйте их через токены напрямую, не через `Typography`.
|
|
42
|
+
|
|
43
|
+
## Composition
|
|
44
|
+
|
|
45
|
+
- Одна часть: **`Typography.Root`**. Текст или инлайн-разметка в **`children`**.
|
|
46
|
+
- **`as`** задаёт элемент по умолчанию **`p`**; допустимы абзац, инлайн, блок, **заголовки `h1`–`h6`**, **`small`**, **`blockquote`**, а также **landmarks**: `article`, `section`, `header`, `footer`, `aside`, `nav`, `main`.
|
|
47
|
+
|
|
48
|
+
### Minimal example
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { Typography } from "prime-ui-kit";
|
|
52
|
+
|
|
53
|
+
export function Example() {
|
|
54
|
+
return <Typography.Root variant="body-default">Hello</Typography.Root>;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Rules
|
|
59
|
+
|
|
60
|
+
- **`variant` обязателен**; лишние **`data-*`** для значений по умолчанию не выставляются (`weight="regular"`, `tracking="normal"`, `tone="default"`, без курсива).
|
|
61
|
+
- В DOM на корне: **`data-variant`** (кебаб-кейс, например `heading-page`).
|
|
62
|
+
- HTML-атрибуты (`id`, `aria-*`, …) пробрасываются через **`...rest`**.
|
|
63
|
+
- Корень использует **`text-wrap: balance`** для коротких блоков; при необходимости переопределяйте снаружи.
|
|
64
|
+
- Отдельных состояний disabled/loading/error нет — сочетайте с родительским UI.
|
|
65
|
+
|
|
66
|
+
## API
|
|
67
|
+
|
|
68
|
+
### Typography.Root
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Required | Description |
|
|
71
|
+
|------|------|---------|----------|-------------|
|
|
72
|
+
| as | см. `TypographyAs` | `"p"` | No | HTML-элемент-обёртка |
|
|
73
|
+
| variant | см. `TypographyVariant` | — | Yes | Семантическая роль чтения |
|
|
74
|
+
| weight | `"regular"` \| `"medium"` \| `"semibold"` | `"regular"` | No | Начертание |
|
|
75
|
+
| tracking | `"normal"` \| `"tight"` \| `"tighter"` \| `"wide"` | `"normal"` | No | Межбуквенное расстояние |
|
|
76
|
+
| italic | `boolean` | `false` | No | Курсив |
|
|
77
|
+
| tone | `"default"` \| `"muted"` | `"default"` | No | Основной или вторичный цвет текста |
|
|
78
|
+
| children | `React.ReactNode` | — | No | Контент |
|
|
79
|
+
| className | `string` | — | No | Дополнительный класс |
|
|
80
|
+
| ref | `React.Ref<HTMLElement>` | — | No | Ref на узел |
|
|
81
|
+
| …rest | `React.HTMLAttributes<HTMLElement>` | — | No | Прочие атрибуты элемента |
|
|
82
|
+
|
|
83
|
+
## Related
|
|
84
|
+
|
|
85
|
+
- [Label](../label/COMPONENT.md)
|
|
86
|
+
- [Hint](../hint/COMPONENT.md)
|
|
87
|
+
- [LinkButton](../link-button/COMPONENT.md)
|
|
88
|
+
- [Banner](../banner/COMPONENT.md)
|
|
89
|
+
- [Notification](../notification/COMPONENT.md)
|
|
@@ -98,12 +98,23 @@
|
|
|
98
98
|
--prime-sys-elevation-shadow-surface: 0 1px 2px rgba(8, 10, 14, 0.35);
|
|
99
99
|
--prime-sys-elevation-shadow-tooltip: 0 14px 30px rgba(8, 10, 14, 0.5), 0 4px 10px rgba(8, 10, 14, 0.4);
|
|
100
100
|
--prime-sys-elevation-zIndex-base: var(--prime-ref-zIndex-base);
|
|
101
|
+
--prime-sys-elevation-zIndex-drawer: var(--prime-ref-zIndex-drawer);
|
|
102
|
+
--prime-sys-elevation-zIndex-drawerNestedShell: var(--prime-ref-zIndex-drawerNestedShell);
|
|
101
103
|
--prime-sys-elevation-zIndex-dropdown: var(--prime-ref-zIndex-dropdown);
|
|
104
|
+
--prime-sys-elevation-zIndex-dropdownInDrawer: var(--prime-ref-zIndex-dropdownInDrawer);
|
|
105
|
+
--prime-sys-elevation-zIndex-dropdownInDrawerInModal: var(--prime-ref-zIndex-dropdownInDrawerInModal);
|
|
106
|
+
--prime-sys-elevation-zIndex-dropdownInModal: var(--prime-ref-zIndex-dropdownInModal);
|
|
102
107
|
--prime-sys-elevation-zIndex-modal: var(--prime-ref-zIndex-modal);
|
|
103
108
|
--prime-sys-elevation-zIndex-popover: var(--prime-ref-zIndex-popover);
|
|
109
|
+
--prime-sys-elevation-zIndex-popoverInDrawer: var(--prime-ref-zIndex-popoverInDrawer);
|
|
110
|
+
--prime-sys-elevation-zIndex-popoverInDrawerInModal: var(--prime-ref-zIndex-popoverInDrawerInModal);
|
|
111
|
+
--prime-sys-elevation-zIndex-popoverInModal: var(--prime-ref-zIndex-popoverInModal);
|
|
104
112
|
--prime-sys-elevation-zIndex-sticky: var(--prime-ref-zIndex-sticky);
|
|
105
113
|
--prime-sys-elevation-zIndex-toast: var(--prime-ref-zIndex-toast);
|
|
106
114
|
--prime-sys-elevation-zIndex-tooltip: var(--prime-ref-zIndex-tooltip);
|
|
115
|
+
--prime-sys-elevation-zIndex-tooltipInDrawer: var(--prime-ref-zIndex-tooltipInDrawer);
|
|
116
|
+
--prime-sys-elevation-zIndex-tooltipInDrawerInModal: var(--prime-ref-zIndex-tooltipInDrawerInModal);
|
|
117
|
+
--prime-sys-elevation-zIndex-tooltipInModal: var(--prime-ref-zIndex-tooltipInModal);
|
|
107
118
|
--prime-sys-motion-duration-fast: var(--prime-ref-motion-duration-fast);
|
|
108
119
|
--prime-sys-motion-duration-medium: var(--prime-ref-motion-duration-medium);
|
|
109
120
|
--prime-sys-motion-duration-slow: var(--prime-ref-motion-duration-slow);
|
|
@@ -385,11 +396,39 @@
|
|
|
385
396
|
--prime-sys-typography-lineHeightScale-4xl: var(--prime-ref-font-lineHeight-4xl);
|
|
386
397
|
--prime-sys-typography-lineHeightScale-5xl: var(--prime-ref-font-lineHeight-5xl);
|
|
387
398
|
--prime-sys-typography-lineHeightScale-6xl: var(--prime-ref-font-lineHeight-6xl);
|
|
399
|
+
--prime-sys-typography-lineHeightScale-7xl: var(--prime-ref-font-lineHeight-7xl);
|
|
400
|
+
--prime-sys-typography-lineHeightScale-8xl: var(--prime-ref-font-lineHeight-8xl);
|
|
401
|
+
--prime-sys-typography-lineHeightScale-9xl: var(--prime-ref-font-lineHeight-9xl);
|
|
388
402
|
--prime-sys-typography-lineHeightScale-l: var(--prime-ref-font-lineHeight-l);
|
|
403
|
+
--prime-sys-typography-lineHeightScale-labelMicro: var(--prime-ref-font-lineHeight-labelMicro);
|
|
389
404
|
--prime-sys-typography-lineHeightScale-m: var(--prime-ref-font-lineHeight-m);
|
|
390
405
|
--prime-sys-typography-lineHeightScale-s: var(--prime-ref-font-lineHeight-s);
|
|
391
406
|
--prime-sys-typography-lineHeightScale-xl: var(--prime-ref-font-lineHeight-xl);
|
|
392
407
|
--prime-sys-typography-lineHeightScale-xs: var(--prime-ref-font-lineHeight-xs);
|
|
408
|
+
--prime-sys-typography-role-bodyCompact-fontSize: var(--prime-sys-typography-sizeScale-xs);
|
|
409
|
+
--prime-sys-typography-role-bodyCompact-lineHeight: var(--prime-sys-typography-lineHeightScale-2xs);
|
|
410
|
+
--prime-sys-typography-role-bodyDefault-fontSize: var(--prime-sys-typography-sizeScale-xs);
|
|
411
|
+
--prime-sys-typography-role-bodyDefault-lineHeight: var(--prime-sys-typography-lineHeightScale-xs);
|
|
412
|
+
--prime-sys-typography-role-bodyLarge-fontSize: var(--prime-sys-typography-sizeScale-s);
|
|
413
|
+
--prime-sys-typography-role-bodyLarge-lineHeight: var(--prime-sys-typography-lineHeightScale-s);
|
|
414
|
+
--prime-sys-typography-role-bodySmall-fontSize: var(--prime-sys-typography-sizeScale-2xs);
|
|
415
|
+
--prime-sys-typography-role-bodySmall-lineHeight: var(--prime-sys-typography-lineHeightScale-2xs);
|
|
416
|
+
--prime-sys-typography-role-caption-fontSize: var(--prime-sys-typography-sizeScale-2xs);
|
|
417
|
+
--prime-sys-typography-role-caption-lineHeight: var(--prime-sys-typography-lineHeightScale-2xs);
|
|
418
|
+
--prime-sys-typography-role-captionMicro-fontSize: var(--prime-sys-typography-sizeScale-labelMicro);
|
|
419
|
+
--prime-sys-typography-role-captionMicro-lineHeight: var(--prime-sys-typography-lineHeightScale-labelMicro);
|
|
420
|
+
--prime-sys-typography-role-display-fontSize: var(--prime-sys-typography-sizeScale-9xl);
|
|
421
|
+
--prime-sys-typography-role-display-lineHeight: var(--prime-sys-typography-lineHeightScale-9xl);
|
|
422
|
+
--prime-sys-typography-role-headingGroup-fontSize: var(--prime-sys-typography-sizeScale-xs);
|
|
423
|
+
--prime-sys-typography-role-headingGroup-lineHeight: var(--prime-sys-typography-lineHeightScale-xs);
|
|
424
|
+
--prime-sys-typography-role-headingPage-fontSize: var(--prime-sys-typography-sizeScale-4xl);
|
|
425
|
+
--prime-sys-typography-role-headingPage-lineHeight: var(--prime-sys-typography-lineHeightScale-4xl);
|
|
426
|
+
--prime-sys-typography-role-headingSection-fontSize: var(--prime-sys-typography-sizeScale-2xl);
|
|
427
|
+
--prime-sys-typography-role-headingSection-lineHeight: var(--prime-sys-typography-lineHeightScale-2xl);
|
|
428
|
+
--prime-sys-typography-role-headingSubsection-fontSize: var(--prime-sys-typography-sizeScale-xl);
|
|
429
|
+
--prime-sys-typography-role-headingSubsection-lineHeight: var(--prime-sys-typography-lineHeightScale-xl);
|
|
430
|
+
--prime-sys-typography-role-headline-fontSize: var(--prime-sys-typography-sizeScale-6xl);
|
|
431
|
+
--prime-sys-typography-role-headline-lineHeight: var(--prime-sys-typography-lineHeightScale-6xl);
|
|
393
432
|
--prime-sys-typography-sizeScale-2xl: var(--prime-ref-font-size-2xl);
|
|
394
433
|
--prime-sys-typography-sizeScale-2xs: var(--prime-ref-font-size-2xs);
|
|
395
434
|
--prime-sys-typography-sizeScale-3xl: var(--prime-ref-font-size-3xl);
|
|
@@ -397,7 +436,11 @@
|
|
|
397
436
|
--prime-sys-typography-sizeScale-4xl: var(--prime-ref-font-size-4xl);
|
|
398
437
|
--prime-sys-typography-sizeScale-5xl: var(--prime-ref-font-size-5xl);
|
|
399
438
|
--prime-sys-typography-sizeScale-6xl: var(--prime-ref-font-size-6xl);
|
|
439
|
+
--prime-sys-typography-sizeScale-7xl: var(--prime-ref-font-size-7xl);
|
|
440
|
+
--prime-sys-typography-sizeScale-8xl: var(--prime-ref-font-size-8xl);
|
|
441
|
+
--prime-sys-typography-sizeScale-9xl: var(--prime-ref-font-size-9xl);
|
|
400
442
|
--prime-sys-typography-sizeScale-l: var(--prime-ref-font-size-l);
|
|
443
|
+
--prime-sys-typography-sizeScale-labelMicro: var(--prime-ref-font-size-labelMicro);
|
|
401
444
|
--prime-sys-typography-sizeScale-m: var(--prime-ref-font-size-m);
|
|
402
445
|
--prime-sys-typography-sizeScale-s: var(--prime-ref-font-size-s);
|
|
403
446
|
--prime-sys-typography-sizeScale-xl: var(--prime-ref-font-size-xl);
|