@filipgutica/design-system 1.0.28 → 1.0.30

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.
@@ -186,8 +186,22 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
186
186
  - [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
187
  - [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
188
  - [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.
189
+ - [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.
190
+ - [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.
191
+ - [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`.
192
+ - [Progress](components.md#progress): `Progress` with a value, `ProgressLabel`, `ProgressValue`, and `ProgressTrack` > `ProgressIndicator`.
193
+ - [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.
194
+ - [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.
195
+ - 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.
196
+ - 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.
197
+ - Where ui-sdk drives a behaviour, it differs from the spec:
198
+ - 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.
199
+ - A glide runs while the pointer or focus is in the control, so a re-measure then, such as on a resize, glides too.
200
+ - 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.
201
+ - ui-sdk times the drawer's slide, and under reduced motion it fades the drawer over 150ms instead of showing it at once.
202
+ - The progress indicator animates its width, not a transform.
203
+ - 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.
204
+ - 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
205
  - 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
206
  - 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
207
 
@@ -13,8 +13,8 @@ Each entry records a choice this language made, the options it rejected, and why
13
13
  | Quiet actions | Core | One recipe for Copy, Full size, dialog and drawer close, the project trigger, and the overflow menu trigger: transparent, `currentColor` at 6% on hover and 12% pressed (see Quiet action fill), no sink, and the control ring. The project trigger keeps the tint but takes the field corner (see One-line non-action controls). | Each had its own hover (`--color-row-hover`, a colour change only, or a 12% tint), so the same kind of action behaved differently. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; tint recipe: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%" |
14
14
  | Quiet action fill | Core | `currentColor` at 6% under a hovering pointer and 12% pressed, a faint overlay after Astryx's ghost button overlay (the idea only; no code copied). The user approved it from rendered demos. | 12% hover and 18% pressed, the previous values, replaced by the fainter overlay the user chose. No fill on hover, with only the icon brightening: it hides the hit target, so the reader cannot see what a click will reach. | hover and press alpha: `tests/catalogue/catalogue.spec.ts` "a hovering pointer adds a 6% fill, and a press 12%"; no fill after a tap: "a tap leaves no fill behind" |
15
15
  | One source per control | Core | Each control comes from the owning library's component or class, including a link styled as a button. | Local copies built from the same tokens drifted: a docs button had no raise and only faded when pressed. | copied rules unchanged: `tests/design-foundations.test.mjs` "example pages copy the catalogue rules for the shared controls and components they use unchanged" |
16
- | Minimal by default | Core | Every interface starts minimal: the subtraction rules in [Minimal by default](DESIGN.md#minimal-by-default) for status, meta lines, rows, marks, actions, forms, boxes, and explanations, with a never-cut list, and words, boxes, and controls counted before and after each change. Prose keeps the copy rules. Taken from the PluginBench redesign, where cutting to these rules took Results from 412 to 306 words and 12 to 7 boxes, Queue from 34 to 28 controls, and New eval from 221 to 148 words (whole-page counts at 1280px). | A minimal pass per project: PluginBench needed two rounds of "less" before it got there. A fixed word or box budget: the right count depends on the task, and a budget would punish real data. Counting screen-reader-only text: it would reward cutting accessible names. The same rules for lessons and product prose: they need their explanation. | No test yet |
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. | No test yet |
16
+ | Minimal by default | Core | Every interface starts minimal: the subtraction rules in [Minimal by default](DESIGN.md#minimal-by-default) for status, meta lines, rows, marks, actions, forms, boxes, and explanations, with a never-cut list, and words, boxes, and controls counted before and after each change. Prose keeps the copy rules. Taken from the PluginBench redesign, where cutting to these rules took Results from 412 to 306 words and 12 to 7 boxes, Queue from 34 to 28 controls, and New eval from 221 to 148 words (whole-page counts at 1280px). | A minimal pass per project: PluginBench needed two rounds of "less" before it got there. A fixed word or box budget: the right count depends on the task, and a budget would punish real data. Counting screen-reader-only text: it would reward cutting accessible names. The same rules for lessons and product prose: they need their explanation. | `tests/catalogue/minimal.spec.ts` "the console keeps the minimal rules with the … filter": one alert per view and none that repeats a badge, one-line rows, two visible actions per row at most, no shadow on a sticky bar, and no box in a box, on the application example |
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
20
  | 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 |
@@ -243,6 +243,10 @@
243
243
  .detail > * { padding: var(--space-4); }
244
244
  .detail > * + * { border-top: 1px solid var(--color-border-subtle); }
245
245
  .detail h2 { font-size: var(--text-md); }
246
+ /* A status the badge cannot carry is one sentence under the title, with the status's own icon and colour from
247
+ the list, instead of a badge and an alert. */
248
+ .status-line { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }
249
+ .status-line .icon { margin-top: 0.125rem; }
246
250
  /* A code block inside a panel becomes a flush section, not a nested box. */
247
251
  .detail > .code { padding: 0; border: 0; border-radius: 0; border-top: 1px solid var(--color-border-subtle); box-shadow: none; }
248
252
  /* Its source spans the section, under one hairline, as a live example's does. */
@@ -904,12 +908,13 @@
904
908
  <div style="display:grid;gap:var(--space-2)">
905
909
  <span class="caption mono">${m.id}</span>
906
910
  <h2>${esc(m.name)}</h2>
907
- <div><span class="badge ${st.badge}">${st.label}</span></div>
911
+ ${m.status === 'nodata'
912
+ ? `<p class="status-line"><span class="st-${m.status}" aria-hidden="true">${icon(st.icon)}</span><span>No data for 42 minutes. Check ingestion before you trust this monitor.</span></p>`
913
+ : `<div><span class="badge ${st.badge}">${st.label}</span></div>`}
908
914
  </div>
909
915
  <figure class="chart-wrap">${chart(m)}
910
916
  <figcaption class="caption">Last 24 hours. The dashed line is the threshold.</figcaption>
911
917
  </figure>
912
- ${m.status === 'nodata' ? `<div class="alert warning">${icon('i-alert')}<p>No data for 42 minutes. Check ingestion before you trust this monitor.</p></div>` : ''}
913
918
  <dl class="props">
914
919
  <dt>Current</dt><dd class="mono num">${m.value}</dd>
915
920
  <dt>Condition</dt><dd class="mono">${m.op} ${m.threshold} ${m.unit} for 10m</dd>
@@ -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.28",
3
+ "version": "1.0.30",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [