@filipgutica/design-system 1.0.29 → 1.0.31

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.
@@ -21,6 +21,8 @@ The language has a reusable core and a replaceable identity layer.
21
21
 
22
22
  A new project keeps `tokens.css` unchanged and sets the identity inputs (`--color-project`, `--color-project-dark`, `--font-ui`, `--font-mono`, and `--color-accent-text`, `--color-nav-current-text`, and `--color-segmented-current-text` when the hue cannot carry them at 4.5:1) on `:root` in its own stylesheet, or loads a theme file. A theme file sets the last two for it; its hue must carry `--color-accent-text` itself, which the contrast tests check for every shipped theme. [Component specs](components.md) mark each component Core or Identity, and [decisions](decisions.md) record why each choice was made and which options were rejected. Read both before you build or change a component.
23
23
 
24
+ Choose the identity once per project, from its subject: the materials, vernacular, and audience of its world, as the [terminal folio](#identity-layer-terminal-folio) takes its marks from the terminal and Markdown tools it presents. When the subject is unclear, propose one and confirm it with the owner. Two limits come first. An identity the owner already set for a family of projects, such as the folio for the personal sites, stays as it is. Personal work keeps the shared type family and neutrals ([Scope and precedence](#scope-and-precedence)), so its subject sets only the hue and the identity marks. Within those limits, check the choice against what you would pick for any similar project, and revise any part you would pick whatever the subject. A palette from the Signs of a templated interface in `interface-design`'s craft rules fits only when the subject itself calls for it, and in personal work only as the hue. A page never picks its own identity.
25
+
24
26
  ## Apply the right format
25
27
 
26
28
  Choose the format before styling. A public product page and an application screen need different density.
@@ -186,8 +188,22 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
186
188
  - [Toggle button](components.md#toggle-button): a `Toggle` whose first child is an empty `ToggleIcon`, drawn as the switch track, then a `<span>` with the label and an optional `<small>` description. `data-size="sm"` or `"lg"` goes on the `Toggle`.
187
189
  - [Select](components.md#select): `Select`, `SelectTrigger` with `SelectValue`, `SelectContent`, and `SelectItem`, inside a `Field` for the label and error. `data-size="sm"` or `"lg"` goes on the trigger. The item draws the check, so `SelectItemIndicator` is optional.
188
190
  - [Dialog](components.md#dialog): `DialogBackdrop` and `DialogContent`. The content holds a `<header>` (a `<div>` with `DialogTitle` and `DialogDescription`, then an icon `DialogClose` with an `aria-label`), the body in one element, and an optional `<footer>` whose actions are `Button`s, such as `<DialogClose render={<Button data-variant="secondary" />}>`. On phones it is a bottom sheet.
189
- - At tablet width and below, unsized buttons, inputs, select triggers, toggle buttons, and choice and switch rows grow to `--control-lg` for touch, as the catalogue's do.
190
- - Any other ui-sdk component or part is unsupported: it renders unstyled. That includes `InputGroup`, `InputClear`, a mixed (indeterminate) checkbox, a `Toggle` with an icon, `ToggleGroup`, the switch choice card, the select's search, groups, and clear button, `presentation="sheet"` on a select or dialog (ui-sdk places the sheet, and its panel is not drawn), a `DialogClose` outside the dialog's `<header>` that is not rendered as a `Button`, `AlertDialog`, and the dialog [viewer](components.md#viewer). Use the owning library's component or the [`components.html`](components.html) recipe, or add a spec and its `ui-sdk.css` rules first. Do not style an unsupported part on a page.
191
+ - [Segmented control](components.md#segmented-control): a horizontal `SegmentedControl` with its `SegmentedControlIndicator` first, then the `SegmentedControlItem`s. `data-size="sm"` or `"lg"` and `data-icon-only` go on the control. ui-sdk owns the keyboard model: a radio group with arrow keys between options.
192
+ - [Tabs](components.md#tabs): `Tabs` with a horizontal `TabsList` (its `TabsIndicator` first, then the `TabsTab`s) and a `TabsPanel` for each tab. The list scrolls when it overflows.
193
+ - [Slider](components.md#slider): a horizontal `Slider` with `SliderValue` and `SliderControl` > `SliderTrack` > `SliderIndicator` and `SliderThumb`, inside a `Field` for its label. `data-size="sm"` or `"lg"` goes on the `Slider`.
194
+ - [Progress](components.md#progress): `Progress` with a value, `ProgressLabel`, `ProgressValue`, and `ProgressTrack` > `ProgressIndicator`.
195
+ - [Drawer](components.md#drawer): `Drawer` with `side="left"` or `"right"`, `DrawerBackdrop`, and `DrawerContent` holding a `<header>` (`DrawerTitle`, then an icon `DrawerClose` with an `aria-label`) and the body in one element.
196
+ - [Overflow menu](components.md#overflow-menu): `Menu`, `MenuTrigger`, `MenuContent`, `MenuItem`, `MenuSeparator`, and `MenuItemIcon`. Supply the More SVG as the trigger's child and an item-specific `aria-label`; use `align="end"` on `MenuContent` (its default 4px offset matches `--space-1`). Render each `MenuItem` as a button with `render={<button type="button" />}`; for disabled items, pass both `disabled` and `render={<button type="button" disabled />}` so the native button and ui-sdk agree. `destructive` on the last item draws the danger text through ui-sdk's `data-destructive`; separate it with `MenuSeparator`. `data-open`, `data-highlighted`, and `data-disabled` come from ui-sdk, not the app. `MenuItemIcon` wraps an app-supplied 16px SVG.
197
+ - Beta.5 keyboard limitation: ui-sdk highlights disabled items instead of skipping them. With a native disabled button, focus stays on the preceding item and Down Arrow stops there; Up Arrow, Home, and End still reach the items after it. Use the plain-HTML recipe when disabled-item skipping is required; this stylesheet cannot correct ui-sdk's navigation.
198
+ - At tablet width and below, the menu trigger and items, unsized buttons, inputs, select triggers, toggle buttons, segmented options, tabs, sliders, and choice and switch rows grow to `--control-lg` for touch, as the catalogue's do.
199
+ - Where ui-sdk drives a behaviour, it differs from the spec:
200
+ - The segmented thumb and the tab fill glide with both edges together over 260ms, without the stretch, because ui-sdk does not say which way a choice moved before it moves them.
201
+ - A glide runs while the pointer or focus is in the control, so a re-measure then, such as on a resize, glides too.
202
+ - While focus is in a segmented control or tab list, its labels fade over 260ms, hover included, so a choice's labels cross-fade with the glide.
203
+ - ui-sdk times the drawer's slide, and under reduced motion it fades the drawer over 150ms instead of showing it at once.
204
+ - The progress indicator animates its width, not a transform.
205
+ - Under reduced motion, a scrolling tab list's clipped edges do not fade: a scroll-driven animation draws the fade, and the `tokens.css` base stops every animation.
206
+ - Any other ui-sdk component or part is unsupported: it renders unstyled. That includes `InputGroup`, `InputClear`, a mixed (indeterminate) checkbox, a `Toggle` with an icon, `ToggleGroup`, the switch choice card, the select's search, groups, and clear button, `presentation="sheet"` or `"auto"` on a select, dialog, or menu (ui-sdk places the sheet, and its panel is not drawn), a `DialogClose` outside the dialog's `<header>` that is not rendered as a `Button`, `AlertDialog`, the dialog [viewer](components.md#viewer), vertical segmented controls, tabs, and sliders, an indeterminate progress, and a drawer from the top or bottom (ui-sdk places it, and its panel is not drawn). Unsupported menu parts include `MenuGroup` and group labels, checkbox/radio items and their indicators and groups, submenus (triggers and content), shortcuts, context triggers, and the pending state of an item, which ui-sdk marks with `data-pending` and `aria-disabled` but not `data-disabled`. Use the owning library's component or the [`components.html`](components.html) recipe, or add a spec and its `ui-sdk.css` rules first. Do not style an unsupported part on a page.
191
207
  - This file owns the look and the load order. The ui-sdk skill and the docs in the installed `@ui-sdk/*` package own which component to use, composition, `render`, ARIA, and the agent bridge. `interface-design` owns states and copy. The repository's own testing rules apply, not the ui-sdk skill's `test.fails` advice.
192
208
  - To let an agent operate the page, create the bridge with `createAgent()` before the app renders; the agent reads with `snapshot()` and acts with `act()`. The app decides whether to expose it, through `createAgent` or WebMCP, and which actions to allow.
193
209
 
@@ -17,6 +17,9 @@ Each entry records a choice this language made, the options it rejected, and why
17
17
  | Status in one sentence | Core | A view's summary sentence carries the status, its numbers, and a status icon. An alert holds only a caveat or action the summary cannot carry, one per view at most. | A banner above the summary that repeats it: PluginBench's Results had both, and the banner added a box and a second reading of the same fact. | `tests/catalogue/minimal.spec.ts` "the No data monitor states its status in one sentence, with no badge or alert"; "the console keeps the minimal rules with the … filter" |
18
18
  | Overflow menu | Core | Two or more secondary actions sit behind an icon-only quiet action with an SVG "more" icon, in a floating menu with concentric rows: the WAI-ARIA menu button pattern, which reka-ui's DropdownMenu and ui-sdk's Menu both follow. A destructive item comes last, after a separator, and confirms in a dialog. The primary action and a recovery action stay visible. | A `<details>` disclosure, as the project menu uses for links: an action menu built that way would behave differently from both headless libraries an implementation builds on. A `⋯` text glyph, as the PluginBench mockup used: a font draws its ink off the centre of its box (see Quiet actions). A menu for a single secondary action: it hides one action behind two presses. | keyboard path: `tests/catalogue/catalogue.spec.ts` "the overflow menu follows the menu button pattern"; corners: "each component renders the corner radius of its role, and no other part has one"; danger item contrast: "contrast: every danger menu item reaches 4.5:1" |
19
19
  | Faint uncertainty | Core | In a chart, every point, line, and label stays at full strength; the intervals of the points that are not selected fade to about 20% opacity, and the selected point keeps strong intervals and an accent ring. Matrix cells show a value and an icon, with the verdict word only on cells with a clear result and the full words in every accessible name, and one key line under the chart. Taken from the PluginBench Results scatter and overview grid. | Strong intervals on every point: with three efforts and two packages, six pairs of intervals crossed and hid the selected one. Fading whole points: the data the reader compares would drop below non-text contrast. Hiding unselected intervals: it removes the uncertainty a reader needs to judge any point. A verdict word and a border on every cell: six boxes and six repeated words where only the clear results needed a word. | No test yet |
20
+ | Deliberate generated-page signs | Core | Two choices match the Signs of a templated interface in `interface-design`'s craft rules, and they stay. The one meta line joined with " · " comes from [Minimal by default](DESIGN.md#minimal-by-default): one muted line replaces a row of labelled fields or badges. The default theme's graphite neutrals, its tinted near-black text and dark background included, come from [Character](DESIGN.md#character), which asks for neutral paper and graphite backgrounds. The text belongs to the same neutral set, which a theme replaces as a whole (see Themes), so the exemption covers every theme that keeps the default neutrals, and not Catppuccin or GitHub. A review treats both as deliberate. | Dropping them because Anthropic's [frontend-design](https://github.com/anthropics/skills/tree/main/skills/frontend-design) skill lists them as signs: that skill lets a direction its brief pins down win, and this language is that brief. | No direct test. The `interface-design` scenario `deliberate-sign-not-finding` in filip-stack covers the general rule that a recorded deliberate use is not a finding. |
21
+ | Identity from the subject | Core | A project chooses its identity inputs once, from its subject: the materials, vernacular, and audience of its world. When the subject is unclear, the agent proposes one and the owner confirms it. An identity the owner set for a family of projects, such as the folio, stays as it is, and personal work keeps the shared type family and neutrals ([Scope and precedence](DESIGN.md#scope-and-precedence)), so its subject sets only the hue and the identity marks. Within those limits, the choice is checked against what any similar project would get, and any part picked whatever the subject is revised. Adapted from Anthropic's [frontend-design](https://github.com/anthropics/skills/tree/main/skills/frontend-design) skill. | A palette, typefaces, and layout for each page or brief, as frontend-design directs: pages of one project would stop reading as one product, and the core already carries hierarchy and states. A generated default palette chosen because it looks current rather than because the subject calls for it: it appears whatever the subject. | No test yet |
22
+ | Folio signs | Identity | The terminal folio takes its `~/`, `##`, and `$` marks, its mono face, and its near-black capture plate (`--color-terminal`) from the terminal and Markdown tools its sites present, so its mono metadata, mono captions, and that plate are deliberate, not Signs of a templated interface. A project that replaces the identity does not inherit them. | Flagging them as signs to remove: the folio's [Mono identity](DESIGN.md#identity-layer-terminal-folio) rule assigns mono to metadata and captions because its sites present terminal tools. | `interface-design` scenarios in filip-stack: `deliberate-sign-not-finding`, modelled on the folio's mono captions, and `replaced-identity-mono` for a project that replaced the identity |
20
23
  | Section mark | Identity | The `##` mark goes only on the page-level section headings (h2) of documentation, CLI tool, article, and product pages, which are mono with a `--color-border-subtle` rule above. Application and inline-visualization section headings are plain `--font-ui` semibold at `--text-xl` or smaller, with no mark and no rule. h3 and lower never take it. | The mark on every section heading: on a dense screen, such as a metrics dashboard with six sections, it repeated down the page and competed with the data. The mark on h2 and h3: deeper levels repeat more often. A per-page opt-out class: every application page would need to remember it. Dropping the mark: reading pages lose the folio identity that ties them to the `~/name` header. Mono application section headings without the mark: the mono face alone still reads as a document heading among compact sans rows. | No test yet |
21
24
  | Command plate | Identity | Owner decision, 2026-11-15: a shell command uses the normal code block and its source well in light and dark, with a CSS-drawn `$ ` prompt in `--color-accent`. Header, Copy, compact layout, and focus follow the code block. Keep `--color-command-bg` and `--color-command-border` as compatibility aliases for `--color-code` and `--color-border-subtle`. Terminal captures stay unchanged. | A: the dark, hue-tinted plate in both modes. On a light page it was the darkest element and looked mismatched beside light source blocks; the owner noticed it on every site. B: a pale hue-tinted plate in light mode. It followed the mode but added a second tinted surface and still differed from source code; the owner preferred one consistent code surface (option C). | `tests/catalogue/catalogue.spec.ts`: "contrast: shell command text on the code well reaches 4.5:1", "contrast: the accent shell prompt on the code well reaches 3:1"; compatibility aliases and DS-1 exceptions: `tests/token-values.test.mjs`; shared code recipes: `tests/design-foundations.test.mjs`; imported-theme failures: `tests/theme-mapper.test.mjs` |
22
25
  | Terminal colours | Identity | Owner decision, 2026-11-14: the 16 ANSI colours that terminal captures use are design-system tokens, `--color-terminal-ansi-0` to `-15`, plus `--color-terminal-ansi-4-bg` for a blue background that terminal text reads on. They keep the values `@filipgutica/ui` drew before, so no capture changes. Colours 1 to 15 reach 4.5:1 on `--color-terminal`; black (colour 0) is a background only, and dim text reads colour 8. | Literal defaults in `@filipgutica/ui`: colour data outside the design system, which breaks the rule that the design system owns colours and component libraries only apply them. One token per colour role, such as a success green: terminal programs choose the slot, so the palette must name slots. | contrast: the core `ansi` check in `theme-mapper/engine.js`, which `tests/site/site.spec.ts` "Themes: every contrast check passes" runs for every theme; parity with the 1.x token set: `tests/token-values.test.mjs` |
@@ -173,17 +173,145 @@
173
173
  [data-slot="dialog-content"][data-presentation="dialog"] > footer { justify-content: flex-end; gap: var(--space-2); border-top: 1px solid var(--color-border-subtle); background: var(--color-surface); }
174
174
  [data-slot="dialog-title"] { margin: 0; font-size: 1.125rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
175
175
  [data-slot="dialog-description"] { margin: var(--space-1) 0 0; color: var(--color-muted); }
176
- /* The header's close button is a quiet action. A Close rendered as a Button is drawn as that button. */
177
- [data-slot="dialog-content"] > header > [data-slot="dialog-close"] { display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--control-lg); min-height: var(--control-lg); padding: 0; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--color-muted); font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
176
+ /* The header's close button, in a dialog or a drawer, is a quiet action. A Close rendered as a Button is drawn as that button. */
177
+ :is([data-slot="dialog-content"], [data-slot="drawer-content"]) > header > :is([data-slot="dialog-close"], [data-slot="drawer-close"]) { display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--control-lg); min-height: var(--control-lg); padding: 0; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--color-muted); font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
178
178
  @media (hover: hover) {
179
- [data-slot="dialog-content"] > header > [data-slot="dialog-close"]:hover { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
179
+ :is([data-slot="dialog-content"], [data-slot="drawer-content"]) > header > :is([data-slot="dialog-close"], [data-slot="drawer-close"]):hover { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
180
180
  }
181
- [data-slot="dialog-content"] > header > [data-slot="dialog-close"]:active { background: color-mix(in srgb, currentColor 12%, transparent); }
181
+ :is([data-slot="dialog-content"], [data-slot="drawer-content"]) > header > :is([data-slot="dialog-close"], [data-slot="drawer-close"]):active { background: color-mix(in srgb, currentColor 12%, transparent); }
182
182
  /* Phones: the dialog becomes a bottom sheet with rounded top corners. */
183
183
  @media (max-width: 640px) {
184
184
  [data-slot="dialog-content"][data-presentation="dialog"] { width: 100%; margin: auto 0 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
185
185
  }
186
186
 
187
+ /* ---------- Segmented control ---------- */
188
+ /* An undivided sunk track; the indicator is the raised thumb, inset 2px inside the checked item, from the
189
+ position ui-sdk measures. Horizontal only. */
190
+ [data-slot="segmented-control"][data-orientation="horizontal"] { --item: var(--control-md); position: relative; display: inline-flex; flex: none; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-well); box-shadow: var(--shadow-sink); isolation: isolate; }
191
+ [data-slot="segmented-control"][data-orientation="horizontal"][data-size="sm"] { --item: var(--control-sm); font-size: var(--text-sm); }
192
+ [data-slot="segmented-control"][data-orientation="horizontal"][data-size="lg"] { --item: var(--control-lg); font-size: var(--text-lg); }
193
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"] { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--item); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--color-muted); font: inherit; cursor: pointer; }
194
+ [data-slot="segmented-control"][data-orientation="horizontal"][data-icon-only] > [data-slot="segmented-control-item"] { width: var(--item); padding: 0; }
195
+ /* The hover thumb sits behind the label and under the indicator, inside the control's stacking context. */
196
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"]::before { content: ""; position: absolute; inset: 2px; z-index: -2; border-radius: var(--radius-control); pointer-events: none; }
197
+ @media (hover: hover) {
198
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"]:hover:not([data-disabled], [data-checked]) { color: var(--color-text); }
199
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"]:hover:not([data-disabled], [data-checked])::before { background: color-mix(in srgb, var(--color-control-thumb) 45%, transparent); }
200
+ }
201
+ /* The checked label reads at 4.5:1 on its thumb, and an icon at 3:1 (--color-segmented-current-text). */
202
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"][data-checked] { color: var(--color-segmented-current-text); }
203
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"][data-disabled] { opacity: 0.58; cursor: not-allowed; }
204
+ /* The thumb is the option's sibling, so a disabled checked option dims it too. */
205
+ [data-slot="segmented-control"][data-orientation="horizontal"]:has(> [data-slot="segmented-control-item"][data-checked][data-disabled]) > [data-slot="segmented-control-indicator"] { opacity: 0.58; }
206
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-indicator"] { position: absolute; z-index: -1; top: calc(var(--segmented-control-indicator-top) + 2px); left: calc(var(--segmented-control-indicator-left) + 2px); width: calc(var(--segmented-control-indicator-width) - 4px); height: calc(var(--segmented-control-indicator-height) - 4px); border-radius: var(--radius-control); background: var(--color-control-thumb); box-shadow: var(--shadow-raise); pointer-events: none; }
207
+
208
+ /* ---------- Tabs ---------- */
209
+ /* The list scrolls, so it clips on every side: the padding keeps the selected tab's shadow whole. The indicator
210
+ is the selected tab's lifted fill, from the position ui-sdk measures. Horizontal only. */
211
+ /* The fill takes its left edge and width: ui-sdk measures --active-tab-right from the end of the scrolled content. */
212
+ [data-slot="tabs-list"][data-orientation="horizontal"] { position: relative; display: flex; width: max-content; max-width: 100%; overflow-x: auto; padding: var(--space-1); isolation: isolate; }
213
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"] { position: relative; flex: none; min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-inline); background: transparent; color: var(--color-muted); font: var(--weight-medium) var(--text-md) / var(--leading) var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
214
+ @media (hover: hover) {
215
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"]:hover:not([data-disabled], [data-selected]) { background: var(--color-row-hover); color: var(--color-text); }
216
+ }
217
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"][data-selected] { color: var(--color-nav-current-text); }
218
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"][data-disabled] { opacity: 0.58; cursor: not-allowed; }
219
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-indicator"] { position: absolute; z-index: -1; top: var(--active-tab-top); left: var(--active-tab-left); width: var(--active-tab-width); height: var(--active-tab-height); border-radius: var(--radius-inline); background: var(--color-nav-current); box-shadow: var(--shadow-nav-current); pointer-events: none; }
220
+ [data-slot="tabs"][data-orientation="horizontal"] > [data-slot="tabs-panel"] { padding-top: var(--space-3); }
221
+ /* A clipped edge fades over 24px. The list's own scroll position drives the two fade widths, so a list that
222
+ does not scroll has no fade. The tokens.css base stops every animation under reduced motion, which would
223
+ pin the fade at its end, so a reduced-motion reader sees clipped edges without the fade. */
224
+ @supports (animation-timeline: scroll()) { @media (prefers-reduced-motion: no-preference) {
225
+ [data-slot="tabs-list"][data-orientation="horizontal"] { mask-image: linear-gradient(to right, transparent, #000 var(--tab-fade-start), #000 calc(100% - var(--tab-fade-end)), transparent); animation: ui-sdk-tab-fade auto linear both; animation-timeline: scroll(self inline); }
226
+ } }
227
+ @keyframes ui-sdk-tab-fade { 0% { --tab-fade-start: 0px; --tab-fade-end: 24px; } 1%, 99% { --tab-fade-start: 24px; --tab-fade-end: 24px; } 100% { --tab-fade-start: 24px; --tab-fade-end: 0px; } }
228
+
229
+ /* ---------- Slider ---------- */
230
+ /* A 6px track with the accent range and a ringed round thumb; the value follows the track. Horizontal only. */
231
+ [data-slot="slider"][data-orientation="horizontal"] { --thumb: 18px; display: flex; align-items: center; gap: var(--space-3); width: 100%; min-width: 0; }
232
+ [data-slot="slider"][data-orientation="horizontal"][data-size="sm"] { --thumb: 16px; }
233
+ [data-slot="slider"][data-orientation="horizontal"][data-size="lg"] { --thumb: 20px; }
234
+ [data-slot="slider"][data-orientation="horizontal"] > [data-slot="slider-value"] { order: 1; min-width: 4ch; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
235
+ /* ui-sdk centres the thumb on the value's point of the track, so the control's inline padding keeps the thumb
236
+ inside it at both ends, as a native range does. */
237
+ [data-slot="slider"][data-orientation="horizontal"] > [data-slot="slider-control"] { display: flex; flex: 1; align-items: center; min-width: 0; height: var(--control-md); padding-inline: calc(var(--thumb) / 2); cursor: pointer; }
238
+ [data-slot="slider"][data-orientation="horizontal"][data-size="sm"] > [data-slot="slider-control"] { height: var(--control-sm); }
239
+ [data-slot="slider"][data-orientation="horizontal"][data-size="lg"] > [data-slot="slider-control"] { height: var(--control-lg); }
240
+ [data-slot="slider"][data-orientation="horizontal"] [data-slot="slider-track"] { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--color-surface-muted); }
241
+ [data-slot="slider"][data-orientation="horizontal"] [data-slot="slider-indicator"] { border-radius: inherit; background: var(--color-accent); }
242
+ [data-slot="slider"][data-orientation="horizontal"] [data-slot="slider-thumb"] { box-sizing: border-box; width: var(--thumb); height: var(--thumb); border: 2px solid var(--color-accent); border-radius: 50%; background: var(--color-surface-raised); }
243
+ [data-slot="slider"][data-orientation="horizontal"][data-dragging] :is([data-slot="slider-control"], [data-slot="slider-thumb"]) { cursor: grabbing; }
244
+ [data-slot="slider"][data-orientation="horizontal"][data-disabled] { opacity: 0.58; }
245
+ [data-slot="slider"][data-orientation="horizontal"][data-disabled] :is([data-slot="slider-control"], [data-slot="slider-thumb"]) { cursor: not-allowed; }
246
+
247
+ /* ---------- Progress ---------- */
248
+ /* A 9px track with a hairline edge holding the accent indicator. ui-sdk sizes the indicator with an inline
249
+ width. An indeterminate progress (no value) is unsupported. */
250
+ [data-slot="progress"]:not([data-indeterminate]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); }
251
+ [data-slot="progress"]:not([data-indeterminate]) > [data-slot="progress-value"] { color: var(--color-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
252
+ [data-slot="progress"]:not([data-indeterminate]) > [data-slot="progress-track"] { grid-column: 1 / -1; height: 9px; overflow: hidden; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-pill); background: var(--color-surface-muted); }
253
+ [data-slot="progress"]:not([data-indeterminate]) [data-slot="progress-indicator"] { height: 100%; border-radius: inherit; background: var(--color-accent); transition: width var(--duration-fast) var(--ease-out); }
254
+
255
+ /* ---------- Drawer ---------- */
256
+ /* A full-height floating layer with square corners on the left or right edge; ui-sdk places and slides it.
257
+ The content holds a <header> (the title, then the close button) and a body that scrolls on its own.
258
+ A top or bottom sheet is unsupported. */
259
+ [data-slot="drawer-backdrop"] { position: fixed; inset: 0; background: var(--color-overlay); }
260
+ [data-slot="drawer-content"]:is([data-side="left"], [data-side="right"]) { display: flex; flex-direction: column; width: min(calc(var(--sidebar) + var(--space-12)), calc(100vw - var(--space-12))); height: 100%; overflow: hidden; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
261
+ [data-slot="drawer-content"]:is([data-side="left"], [data-side="right"]) > header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border-subtle); }
262
+ [data-slot="drawer-content"]:is([data-side="left"], [data-side="right"]) > :not(header) { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--space-4); }
263
+ [data-slot="drawer-content"]:is([data-side="left"], [data-side="right"]) > header > [data-slot="drawer-title"] { margin: 0; font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; }
264
+
265
+ @media (prefers-reduced-motion: no-preference) {
266
+ /* Motion answers the reader: a glide runs only while the pointer or focus is in the control, so ui-sdk's
267
+ first measurement after mount places the thumb at once. A re-measure while the pointer or focus is in
268
+ the control, such as on a resize, glides too; nothing in the markup tells it from a change of choice.
269
+ ui-sdk does not say which way a choice moved before it moves the thumb (a tab's direction attribute
270
+ arrives a frame late), so both edges glide together over 260ms, without the spec's stretch. */
271
+ [data-slot="segmented-control"][data-orientation="horizontal"]:is(:hover, :focus-within) > [data-slot="segmented-control-indicator"] { transition: left 260ms ease, width 260ms ease; }
272
+ [data-slot="tabs-list"][data-orientation="horizontal"]:is(:hover, :focus-within) > [data-slot="tabs-indicator"] { transition: left 260ms ease, width 260ms ease; }
273
+ /* Hover fades a label over --duration-fast. While focus is in the control, the labels cross-fade over 260ms
274
+ with the glide, hover included. A click focuses the option in Chromium and Firefox; where a click does not
275
+ focus a button (Safari on macOS), a clicked choice's labels fade over --duration-fast. */
276
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"] { transition: color var(--duration-fast) var(--ease-out); }
277
+ [data-slot="segmented-control"][data-orientation="horizontal"]:focus-within > [data-slot="segmented-control-item"] { transition: color 260ms ease; }
278
+ [data-slot="tabs-list"][data-orientation="horizontal"]:focus-within > [data-slot="tabs-tab"] { transition: background-color var(--duration-fast) var(--ease-out), color 260ms ease; }
279
+ }
280
+
281
+ /* ---------- Menu ---------- */
282
+ /* MenuTrigger is the overflow quiet action; the app supplies the More SVG. Submenu triggers
283
+ share its slot but have role="menuitem", and nested content shares MenuContent's slot. */
284
+ [data-slot="menu-trigger"]:not([role="menuitem"]) { display: inline-flex; align-items: center; justify-content: center; width: var(--control-sm); height: var(--control-sm); border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--color-muted); font: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
285
+ [data-slot="menu-trigger"]:not([role="menuitem"])[data-open] { background: color-mix(in srgb, currentColor 6%, transparent); }
286
+ [data-slot="menu-trigger"]:not([role="menuitem"]) > svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
287
+ @media (hover: hover) {
288
+ [data-slot="menu-trigger"]:not([role="menuitem"]):hover:not([data-disabled]) { color: var(--color-text); background: color-mix(in srgb, currentColor 6%, transparent); }
289
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"]:hover:not([data-disabled]) { background: var(--color-row-hover); }
290
+ }
291
+ [data-slot="menu-trigger"]:not([role="menuitem"]):active:not([data-disabled]) { background: color-mix(in srgb, currentColor 12%, transparent); }
292
+ [data-slot="menu-trigger"]:not([role="menuitem"])[data-disabled] { opacity: 0.58; cursor: not-allowed; }
293
+ /* ui-sdk positions the layer and supplies its 4px gap; align="end" matches the recipe.
294
+ No animation: the menu opens and closes at once. The rules draw only data-presentation="popover";
295
+ a sheet is unsupported. */
296
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) { z-index: 3; display: grid; min-width: 180px; padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--shadow-dialog); color: var(--color-text); font: inherit; }
297
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"] { display: flex; align-items: center; gap: var(--space-2); min-height: var(--row); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: calc(var(--radius-panel) - var(--space-1)); background: transparent; color: var(--color-text); font: inherit; text-align: start; cursor: pointer; }
298
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"][data-destructive] { color: light-dark(color-mix(in srgb, var(--color-error) 75%, var(--color-status-ink)), color-mix(in srgb, var(--color-error) 85%, var(--color-status-ink))); }
299
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"]:is(:focus-visible, [data-highlighted]):not([data-disabled]) { background: var(--color-row-hover); }
300
+ /* An inset ring, as the catalogue's menu rows draw, so it stays inside the menu. */
301
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"]:focus-visible { outline-offset: calc(var(--focus-width) * -1); }
302
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"][data-disabled] { opacity: 0.58; cursor: not-allowed; }
303
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-separator"] { margin: var(--space-1) calc(var(--space-1) * -1); border-top: 1px solid var(--color-border-subtle); }
304
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"] > [data-slot="menu-item-icon"] { display: inline-flex; flex: none; }
305
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"] > [data-slot="menu-item-icon"] > svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
306
+ @media (max-width: 800px) {
307
+ [data-slot="menu-trigger"]:not([role="menuitem"]) { width: var(--control-lg); height: var(--control-lg); }
308
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"] { min-height: var(--control-lg); }
309
+ }
310
+ @media (forced-colors: active) {
311
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-item"]:is(:focus-visible, [data-highlighted]):not([data-disabled]) { forced-color-adjust: none; background: Highlight; color: HighlightText; }
312
+ [data-slot="menu-content"][data-presentation="popover"]:not([data-nested]) > [data-slot="menu-separator"] { border-top-color: CanvasText; }
313
+ }
314
+
187
315
  /* ---------- Focus ---------- */
188
316
  /* One ring for every role, over the control's own raise or sink; the base draws the same ring, and this pins it. */
189
317
  /* It goes on the visible part of a composite control: the switch track and the radio card. */
@@ -191,9 +319,14 @@
191
319
  outline-color rules below still win. */
192
320
  :is([data-slot="button"], [data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"]):focus-visible,
193
321
  [data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty):focus-visible,
194
- [data-slot="dialog-content"] > header > [data-slot="dialog-close"]:focus-visible,
322
+ :is([data-slot="dialog-content"], [data-slot="drawer-content"]) > header > :is([data-slot="dialog-close"], [data-slot="drawer-close"]):focus-visible,
195
323
  [data-slot="dialog-content"][data-presentation="dialog"]:focus-visible,
196
324
  [data-slot="card"]:has(> [data-slot="radio"]:focus-visible) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
325
+ /* The slider's hidden range input takes focus, so the ring goes on the thumb around it. */
326
+ [data-slot="slider"][data-orientation="horizontal"] [data-slot="slider-thumb"]:has(:focus-visible) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
327
+ /* Inset: a segmented option's ring hugs its thumb instead of crossing into the next option, and the tab list
328
+ scrolls, which would clip an outer ring. */
329
+ :is([data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"], [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"]):focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
197
330
  /* The card draws the ring, so the radio inside it does not. */
198
331
  [data-slot="card"] > [data-slot="radio"]:focus-visible { outline: none; }
199
332
 
@@ -204,6 +337,9 @@
204
337
  [data-slot="label"]:not([data-size]):has(> :is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { min-height: var(--control-lg); }
205
338
  [data-slot="toggle"]:not([data-size], [data-orientation]):has(> [data-slot="toggle-icon"]:empty) { min-height: var(--control-lg); }
206
339
  [data-slot="select-trigger"]:not([data-size]) { height: var(--control-lg); }
340
+ [data-slot="segmented-control"][data-orientation="horizontal"]:not([data-size]) { --item: var(--control-lg); }
341
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"] { min-height: var(--control-lg); }
342
+ [data-slot="slider"][data-orientation="horizontal"]:not([data-size]) > [data-slot="slider-control"] { height: var(--control-lg); }
207
343
  }
208
344
 
209
345
  @media (forced-colors: active) {
@@ -219,5 +355,14 @@
219
355
  :is([data-slot="switch"][data-checked], [data-slot="toggle"][data-pressed]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child) { border-color: Highlight; background: Highlight; }
220
356
  [data-slot="switch-thumb"][data-checked], [data-slot="toggle"][data-pressed]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child::after { background: HighlightText; }
221
357
  [data-slot="switch"]:focus-visible { outline-color: CanvasText; }
358
+ /* The checked segmented option draws Highlight behind HighlightText; both opt out, so its ring takes CanvasText. */
359
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-indicator"] { forced-color-adjust: none; background: Highlight; }
360
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"][data-checked] { forced-color-adjust: none; color: HighlightText; }
361
+ [data-slot="segmented-control"][data-orientation="horizontal"] > [data-slot="segmented-control-item"][data-checked]:focus-visible { outline-color: CanvasText; }
362
+ /* The fill drops, so the selected tab takes a system border; the padding absorbs it. */
363
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-indicator"] { display: none; }
364
+ [data-slot="tabs-list"][data-orientation="horizontal"] > [data-slot="tabs-tab"][data-selected] { border: 2px solid Highlight; padding: calc(var(--space-2) - 2px) calc(var(--space-3) - 2px); }
365
+ /* Value marks: only the mark opts out of adjustment and redraws in the system highlight. */
366
+ :is([data-slot="slider"][data-orientation="horizontal"] [data-slot="slider-indicator"], [data-slot="progress"]:not([data-indeterminate]) [data-slot="progress-indicator"]) { forced-color-adjust: none; background: Highlight; }
222
367
  }
223
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [