@vokality/design-system 1.3.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
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
+ ## 2.0.0 — 2026-10-14
6
+
7
+ ### Changed (breaking)
8
+ - With a coarse pointer, buttons and icon buttons of both sizes, form controls, menu, navigation and tree rows, choices, tabs, calendar days, segmented controls and pagination are 44px in every density (WCAG 2.5.5, Apple HIG). Fine-pointer sizes are unchanged; touch layouts grow, so check dense touch screens.
9
+ - In an `Inline` row that contains a field, buttons, icon buttons and segmented controls take the field height (`--control-height`) so they sit flush.
10
+ - Compact density: `--button-height`, `--button-height-sm` and the new control tokens are redefined instead of overriding component classes, so component-specific sizes (alert and toast close buttons, calendar navigation) win again. Compact also tightens table cells, list, navigation and menu rows, and cards; scales body-sm, small, lead, section lead and card, empty-state and media-card titles; keeps `sm` buttons smaller than default ones; and no longer enlarges metadata (11px in both densities).
11
+ - `Text wrap` is renamed `overflowWrap`, so it no longer shares a name with `Inline`'s boolean `wrap`.
12
+ - Compact page headers and section headers still add no trailing space; the AppShell, Dashboard, ListDetail, FormPage and SettingsPage templates now compose their header and content with `Stack`.
13
+
14
+ ### Added
15
+ - `--control-font-size` and `--control-padding-block` tokens. Compact sets 14px input text and tighter padding for fine pointers only; inputs keep 16px text whenever a coarse pointer is available, which stops iOS zooming on focus.
16
+ - `data-density="compact"` works on any element, not only `html`.
17
+ - `Stack`, `Inline`, `Grid` and `Text` type their attributes and events for the element they render `as` (for example `Inline as="form"` gives `onSubmit` a form event).
18
+ - Small controls (tag remove, sortable headers, alert close, slider thumb) extend their hit area to at least 24px (WCAG 2.5.8), and to 44px on touch where neighbours allow, without changing their look.
19
+ - A scrolling tab list fades the edge that has more tabs behind it.
20
+
21
+ ### Fixed
22
+ - Single-line fields are exactly `--control-height` (44px) tall; they inherited the body line-height and rendered at 46.8px.
23
+ - Compact: the CommandPalette and shell search keep their own heights and icon positions; a compact PageHeader fills start-aligned stacks and moves its actions below the title in narrow headers with an eyebrow; badges with `tabIndex={-1}` are not sized as targets; described checkboxes, radios and switches keep their box on the first line; textareas keep their padding.
24
+ - Date range triggers and MultiSelect fields follow the control height and font size; select options follow the control font size.
25
+ - `Fieldset` shares `Field`'s hint and error styles.
26
+ - Under 40rem, chart table toggles and date-picker footer buttons keep their width instead of filling the row.
27
+ - Bordered lists pad trailing content like the main cell, and a selected row tints the whole row.
28
+ - CodeBlock uses the mono font for its code; a selected day that is also unavailable stays readable.
29
+ - AvatarGroup's overflow count uses the initials' font, and slider values share a width so stacked sliders line up.
30
+
5
31
  ## 1.3.0 — 2026-10-14
6
32
 
7
33
  ### Added
package/README.md CHANGED
@@ -88,9 +88,9 @@ Pages not rendered by React can inline `themeScript()` instead. See `docs/compon
88
88
 
89
89
  ## Compact applications
90
90
 
91
- Set `<html data-density="compact">` for dense operational interfaces. It uses 20px page titles, 16px section titles, 14px body and input text, 12px metadata and 24px statistics. Page-header actions align with the title; headers leave section spacing to `Stack` instead of adding another margin. Buttons and fields share a 32px height with a fine pointer and retain 44px targets when a coarse pointer is available. Apply density to `html` so portalled dialogs and menus inherit it. Omitting the attribute preserves the existing defaults.
91
+ Set `<html data-density="compact">` 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. Apply density to `html` so portalled dialogs and menus inherit it; a subtree with the attribute also works. Omitting the attribute preserves the existing defaults.
92
92
 
93
- Compose pages with `Stack`, `Inline` and `Grid`; these forward standard attributes and events, including `Inline as="form" onSubmit={...}`. Use `Fieldset` for related controls, `Button variant="text"` for record names, and `Text numeric wrap="anywhere"` for long identifiers.
93
+ Compose pages with `Stack`, `Inline` and `Grid`; these forward standard attributes and events typed for the element they render, including `Inline as="form" onSubmit={...}`. Use `Fieldset` for related controls, `Button variant="text"` for record names, and `Text numeric overflowWrap="anywhere"` for long identifiers.
94
94
 
95
95
  ## Starting a new project
96
96
 
@@ -2,16 +2,16 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cloneElement, isValidElement } from "react";
4
4
  import { Label } from "radix-ui";
5
+ import { describedBy } from "../../internal/describedBy.js";
5
6
  import { useUid } from "../../internal/useUid.js";
6
7
  import { cx } from "../../lib/cx.js";
7
8
  /** Label (Radix Label), hint and error around one control; wires id, aria-describedby and aria-invalid onto the child. */
8
9
  export function Field(props) {
9
10
  const uid = useUid("vk-field");
10
11
  const id = props.id || uid;
11
- const describedBy = [props.hint ? id + "-hint" : null, props.error ? id + "-error" : null].filter(Boolean).join(" ") || undefined;
12
12
  const labelId = id + "-label";
13
13
  const control = isValidElement(props.children)
14
- ? cloneElement(props.children, { id, "aria-labelledby": labelId, "aria-describedby": describedBy, "aria-invalid": props.error ? true : undefined })
14
+ ? cloneElement(props.children, { id, "aria-labelledby": labelId, "aria-describedby": describedBy(id, props.hint, props.error), "aria-invalid": props.error ? true : undefined })
15
15
  : props.children;
16
16
  // A custom combobox only takes focus from its label; the click is not forwarded to it.
17
17
  const focusControl = (e) => {
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef } from "react";
4
+ import { describedBy } from "../../internal/describedBy.js";
4
5
  import { useUid } from "../../internal/useUid.js";
5
6
  import { cx } from "../../lib/cx.js";
6
7
  /** Groups related controls with a native legend and shared instructions. */
7
- export const Fieldset = forwardRef(function Fieldset({ legend, hint, error, children, className, id, "aria-describedby": describedBy, ...rest }, ref) {
8
+ export const Fieldset = forwardRef(function Fieldset({ legend, hint, error, children, className, id, "aria-describedby": existing, ...rest }, ref) {
8
9
  const uid = useUid("vk-fieldset");
9
10
  const groupId = id || uid;
10
- const descriptions = [describedBy, hint ? groupId + "-hint" : null, error ? groupId + "-error" : null].filter(Boolean).join(" ") || undefined;
11
- return (_jsxs("fieldset", { ref: ref, id: groupId, className: cx("vk-fieldset", className), "aria-describedby": descriptions, "aria-invalid": error ? true : undefined, ...rest, children: [_jsx("legend", { className: "vk-fieldset-legend", children: legend }), hint ? _jsx("p", { className: "vk-fieldset-hint", id: groupId + "-hint", children: hint }) : null, _jsx("div", { className: "vk-fieldset-controls", children: children }), error ? _jsx("p", { className: "vk-fieldset-error", id: groupId + "-error", children: error }) : null] }));
11
+ return (_jsxs("fieldset", { ref: ref, id: groupId, className: cx("vk-fieldset", className), "aria-describedby": describedBy(groupId, hint, error, existing), "aria-invalid": error ? true : undefined, ...rest, children: [_jsx("legend", { className: "vk-fieldset-legend", children: legend }), hint ? _jsx("p", { className: "vk-field-hint vk-fieldset-hint", id: groupId + "-hint", children: hint }) : null, _jsx("div", { className: "vk-fieldset-controls", children: children }), error ? _jsx("p", { className: "vk-field-error vk-fieldset-error", id: groupId + "-error", children: error }) : null] }));
12
12
  });