@vokality/design-system 6.0.2 → 6.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +13 -4
  3. package/dist/appearance.d.ts +2 -2
  4. package/dist/components/Menu/Menu.js +1 -1
  5. package/dist/components.css +474 -359
  6. package/dist/tailwind.css +3 -0
  7. package/dist/tokens.css +20 -3
  8. package/dist/tokens.dtcg.json +98 -13
  9. package/dist/tokens.json +99 -14
  10. package/dist/vokality.css +494 -362
  11. package/dist/vokality.iife.js +1 -0
  12. package/docs/brand.md +3 -3
  13. package/docs/components/Button/README.md +16 -15
  14. package/docs/components/Checkbox/README.md +1 -1
  15. package/docs/components/Combobox/README.md +1 -1
  16. package/docs/components/DatePicker/README.md +1 -1
  17. package/docs/components/IconButton/README.md +2 -2
  18. package/docs/components/Input/README.md +3 -3
  19. package/docs/components/Link/README.md +1 -1
  20. package/docs/components/Menu/README.md +1 -1
  21. package/docs/components/MultiSelect/README.md +1 -1
  22. package/docs/components/NumberInput/README.md +1 -1
  23. package/docs/components/OtpInput/README.md +1 -1
  24. package/docs/components/PasswordInput/README.md +1 -1
  25. package/docs/components/Popover/README.md +1 -1
  26. package/docs/components/Radio/README.md +1 -1
  27. package/docs/components/RadioGroup/README.md +1 -1
  28. package/docs/components/SearchInput/README.md +1 -1
  29. package/docs/components/SegmentedControl/README.md +2 -2
  30. package/docs/components/Select/README.md +2 -2
  31. package/docs/components/Switch/README.md +1 -1
  32. package/docs/components/Tag/README.md +1 -1
  33. package/docs/components/Textarea/README.md +2 -2
  34. package/docs/components/TimePicker/README.md +1 -1
  35. package/package.json +1 -1
  36. package/skills/vokality-design-system/SKILL.md +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to `@vokality/design-system`. The package follows [semantic versioning](https://semver.org); see CONTRIBUTING.md for what counts as breaking.
4
4
 
5
+ ## 6.1.0 — 2026-11-22
6
+
7
+ ### Added
8
+ - Encoded 4-step control scale (`ControlSize = "xs" | "sm" | "md" | "lg"`) across all actions, form fields and choices: `24px`, `32px`, `36px` and `44px` on fine pointers, with `44px` targets and `16px` field text preserved on coarse pointers.
9
+ - Typography ramp tokens (`--text-3xs` 10px, `--text-2xs` 11px, `--text-compact` 13px), shared control tokens (`--control-height-lg`, `--control-label-font-size`, `--control-secondary-font-size`, `--control-padding-inline`, `--control-action-padding-inline`, `--control-gap`, `--control-icon-size`, `--control-choice-size`) and density rhythm tokens (`--density-pad-surface*`, `--density-cell-*`, `--density-gap*`) in `tokens/tokens.json`.
10
+ - Consistent typography pairing rule encoded across controls: sentence-case control text scales `12 / 13 / 14 / 16px`, uppercase tracked action labels sit two steps below (`10 / 11 / 12 / 13px`), and secondary control descriptions sit one step below (`11 / 12 / 13 / 14px`).
11
+ - `Link` `ActionSizes` story and updated `lg` size coverage across `Foundations/Sizes`, all sized component stories and component READMEs.
12
+
13
+ ### Changed
14
+ - Unified default desktop control height to `md` (`36px`) across buttons, fields and choices, eliminating the `40px` button vs `44px` field mismatch.
15
+ - `density="compact"` now encodes a single 1-step downshift across controls (`md` 36px → `sm` 32px, identical to explicit `size="sm"`), typography, surfaces, tables, lists, navigation, overlays, charts, rich text and chat components.
16
+ - Replaced hardcoded font-size literals across component stylesheets with ramp and density tokens.
17
+
18
+ ### Fixed
19
+ - `SegmentedControl` at `xs`/`sm` inside compact density no longer inherits oversized `14px` segment labels or padding.
20
+ - `Switch` checked thumb translation now stays symmetrically inset at every control size (`xs`, `sm`, `md`, `lg`), and `Checkbox`/`Radio`/`Switch` no longer jump from `14px` to `16px` when `size="md"` is set explicitly.
21
+ - Portalled `Menu` panels now inherit explicit `size` from their triggers, and trigger icons align cleanly via flex gap.
22
+ - `NumberInput` stepper buttons now scale from `--control-end-size` so digits remain visible in narrow `lg` fields.
23
+
5
24
  ## 6.0.2 — 2026-10-26
6
25
 
7
26
  ### Fixed
package/README.md CHANGED
@@ -85,11 +85,20 @@ const { theme, resolvedTheme, setTheme } = useTheme(); // theme: "system" | "dar
85
85
 
86
86
  Pages not rendered by React can inline `themeScript()` instead. See `docs/components/ThemeProvider/README.md`.
87
87
 
88
- ## Compact applications
88
+ ## Sizes, density and typography
89
89
 
90
- Pass `density="compact"` to `ThemeProvider` for dense operational interfaces. It uses 20px page titles, 16px section titles, 14px body text and 24px statistics, never enlarges smaller text, and tightens table cells, list and navigation rows, menus and cards. Page-header actions align with the title; headers leave section spacing to `Stack` instead of adding another margin. With only a fine pointer, buttons and fields share a 32px height and inputs use 14px text; when a coarse pointer is available they keep 44px targets and 16px input text, which stops iOS zooming on focus. Density redefines the control tokens (`--control-height`, `--control-font-size`, `--control-padding-block`) and the button heights, so components that size from them follow it while component-specific sizes still apply. The provider sets it on `html`, so portalled dialogs and menus inherit it. Without it the defaults apply. Prose follows the compact scale (14px text, headings from 20px), and alert and toast titles use 14px.
90
+ One 4-step control scale governs every action, form field and choice (`size="xs" | "sm" | "md" | "lg"`), pairing height, padding, icon size and typography through shared CSS tokens:
91
91
 
92
- For toolbars, record rows and status lines, `size="xs"` on `Button`, `IconButton`, `Menu`, `Popover` and `SegmentedControl` gives 24px actions with 11px labels, and on `Select` a 24px toolbar picker with 12px text. A status-line `Menu` or `Popover` takes `variant="text"` to read in sentence case, at 12px with `size="xs"`, like compact `Text size="small"`. Omitted field sizes follow the shared control height; explicit sizes also apply to form fields. Extra-small sizes apply with fine pointers only; a coarse pointer keeps the 44px target. The `--control-height-xs` token holds the height.
92
+ | Size | Fine-pointer height | Control text (sentence case) | Action label (UPPERCASE) | Secondary text | Padding (field / button) | Icon / choice box |
93
+ | --- | --- | --- | --- | --- | --- | --- |
94
+ | `xs` | 24px | 12px (`--text-xs`) | 10px (`--text-3xs`, 0.10em) | 11px (`--text-2xs`) | 0×8px / 0×8px | 14px / 14px |
95
+ | `sm` *(compact default)* | 32px | 13px (`--text-compact`) | 11px (`--text-2xs`, 0.12em) | 12px (`--text-xs`) | 4×10px / 4×12px | 16px / 16px |
96
+ | `md` *(default density)* | 36px | 14px (`--text-sm`) | 12px (`--text-xs`, 0.14em) | 13px (`--text-compact`) | 6×12px / 6×16px | 16px / 18px |
97
+ | `lg` *(spacious & touch floor)* | 44px | 16px (`--text-base`) | 13px (`--text-compact`, 0.14em) | 14px (`--text-sm`) | 10×14px / 10×20px | 18px / 20px |
98
+
99
+ - **Typography pairing rule:** Uppercase tracked action labels (`Button`, `Menu`/`Popover` triggers, affix buttons) always sit two steps below sentence-case control text so optical weight matches; secondary control text (option descriptions, choice descriptions, add-ons) sits one step below control text. Every font size comes from the `tokens.json` ramp (`text-3xs` 10px, `text-2xs` 11px, `text-xs` 12px, `text-compact` 13px, `text-sm` 14px, `text-base` 16px…).
100
+ - **Density (`density="compact"` on `ThemeProvider`):** Encodes a single 1-step downshift across the entire system. Controls with omitted `size` shift from `md` (36px / 14px) to `sm` (32px / 13px) — identical to explicit `size="sm"` — and buttons and fields stay flush at the same height. Typography shifts one step down (20px page titles, 16px section/dialog/card titles, 14px body/prose, 13px UI rows/tables/lists, 12px secondary descriptions, 11px field labels, 24px stats, never enlarging smaller text or shrinking below 10px), and surface/cell/gap tokens (`--density-pad-surface*`, `--density-cell-*`, `--density-gap*`) tighten cards, dialogs, fieldsets, alerts, tables, lists, tabs, trees and navigation together. The provider sets `data-density="compact"` on `html` so portalled dialogs, menus and listboxes inherit it.
101
+ - **Explicit sizes & coarse pointers:** Explicit `size` always wins over density on the control and its portalled menu (`Select`, `Combobox`, `MultiSelect`, `TimePicker`, `Menu`). Whenever a coarse pointer is available, every control retains the `lg` 44px touch target and 16px field text (preventing iOS Safari focus zoom).
93
102
 
94
103
  ### Component APIs
95
104
 
@@ -104,7 +113,7 @@ Components preserve their underlying native HTML or Radix props, callbacks and r
104
113
  <Badge color="success" variant="soft">Paid</Badge>
105
114
  ```
106
115
 
107
- - `size` on actions, fields and choices is `xs`, `sm` or `md`: 24px, 32px or 44px single-line control heights with fine pointers. Coarse pointers retain 44px targets and 16px field text. Omitted sizes follow the existing application density; explicit sizes win over row alignment and density.
116
+ - `size` on actions, fields and choices is `xs`, `sm`, `md` or `lg`: 24px, 32px, 36px or 44px single-line control heights with fine pointers. Coarse pointers retain 44px targets and 16px field text. Omitted sizes follow application density (`md` in default density, `sm` in compact density); explicit sizes win over density.
108
117
  - `color` selects `neutral`, `primary`, `info`, `success`, `warning` or `danger` from the active theme. `variant` selects the treatment: `solid`, `soft`, `outline`, `ghost` or `text`, with meaningful subsets per component. Labelled Menu triggers support `text`; icon-only triggers do not.
109
118
  - Text and Heading accept token-backed typography `size` names, semantic `color`, and neutral `emphasis` (`default`, `muted`, `subtle`). Layout `gap` accepts spacing tokens; custom CSS belongs in `style`.
110
119
  - Alert and toast `status` still communicates feedback meaning, including the icon and announcement behavior. Cosmetic color does not set validity or interaction state.
@@ -1,5 +1,5 @@
1
- /** Shared dimensions for actions and form controls. Omit size to use the application density. */
2
- export type ControlSize = "xs" | "sm" | "md";
1
+ /** Shared 4-step control scale across actions, fields and choices (xs 24px, sm 32px, md 36px, lg 44px on fine pointers; coarse pointers retain 44px). Omit size to follow application density (md default, sm compact). */
2
+ export type ControlSize = "xs" | "sm" | "md" | "lg";
3
3
  /** Theme-aware semantic palettes. These describe appearance, independently of component state. */
4
4
  export type SemanticColor = "neutral" | "primary" | "info" | "success" | "warning" | "danger";
5
5
  /** Visual treatment, independently of the chosen semantic palette. */
@@ -13,5 +13,5 @@ export const Menu = forwardRef(function Menu({ items, label, icon, triggerLabel,
13
13
  const iconOnly = label === undefined ? icon : undefined;
14
14
  return (_jsx("div", { className: cx("vk-menu-root", className), children: _jsxs(Primitive.Root, { ...rootProps, children: [_jsx(Primitive.Trigger, { ...triggerProps, ref: ref, disabled: disabled, className: iconOnly ? "vk-icon-btn" : "vk-btn", "data-vk-size": size, "data-vk-color": color, "data-vk-variant": variant ?? (iconOnly ? "ghost" : "outline"), "aria-label": triggerProps?.["aria-label"] ?? (iconOnly ? triggerLabel || messages.moreActions : undefined), title: triggerProps?.title ?? (iconOnly ? triggerLabel || messages.moreActions : undefined), children: iconOnly
15
15
  ? _jsx(Icon, { name: iconOnly })
16
- : _jsxs(_Fragment, { children: [_jsxs("span", { className: "vk-btn-label", children: [icon ? _jsx(Icon, { name: icon, size: 16, className: "vk-menu-trigger-icon" }) : null, label] }), _jsx("span", { className: "vk-btn-glyph", "aria-hidden": "true", children: _jsx(Icon, { name: "chevron-down", size: 14 }) })] }) }), _jsx(Primitive.Portal, { forceMount: contentProps?.forceMount, children: _jsx(Primitive.Content, { sideOffset: 4, collisionPadding: 8, ...contentProps, className: "vk-menu", side: side, align: align, children: _jsx(MenuEntries, { parts: Primitive, items: items }) }) })] }) }));
16
+ : _jsxs(_Fragment, { children: [_jsxs("span", { className: "vk-btn-label", children: [icon ? _jsx(Icon, { name: icon, size: 16, className: "vk-menu-trigger-icon" }) : null, label] }), _jsx("span", { className: "vk-btn-glyph", "aria-hidden": "true", children: _jsx(Icon, { name: "chevron-down", size: 14 }) })] }) }), _jsx(Primitive.Portal, { forceMount: contentProps?.forceMount, children: _jsx(Primitive.Content, { sideOffset: 4, collisionPadding: 8, ...contentProps, className: "vk-menu", "data-vk-size": size, side: side, align: align, children: _jsx(MenuEntries, { parts: Primitive, items: items }) }) })] }) }));
17
17
  });