@filipgutica/design-system 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/language/DESIGN.md +61 -2
- package/language/decisions.md +3 -0
- package/language/ui-sdk.css +223 -0
- package/package.json +20 -17
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Filip's design language for any framework: the spec, the tokens, the component c
|
|
|
10
10
|
|
|
11
11
|
| Path | What it holds |
|
|
12
12
|
| --- | --- |
|
|
13
|
-
| `language/` | The payload: `DESIGN.md`, `components.md`, `decisions.md`, `visualizations.md`, `tokens.css`, the catalogue (`components.html`), example pages, visualization helpers, and the Graphite Indigo editor theme |
|
|
13
|
+
| `language/` | The payload: `DESIGN.md`, `components.md`, `decisions.md`, `visualizations.md`, `tokens.css`, the experimental `ui-sdk.css` component styles for ui-sdk, the catalogue (`components.html`), example pages, visualization helpers, and the Graphite Indigo editor theme |
|
|
14
14
|
| `skills/design-system/`, `.claude-plugin/`, `.codex-plugin/`, `.agents/plugins/` | The agent plugin: the skill that points agents at `language/`, and the Claude and Codex plugin and marketplace manifests. The repository root is the plugin root |
|
|
15
15
|
| `tokens/core.json`, `tokens/themes/*.tokens.json` | The token values, the only place a value lives, and each token's role. Core holds every token; each theme file is a W3C Design Tokens file (2025.10) that holds only its name, a note, its hue pair, and optional fonts and neutrals |
|
|
16
16
|
| `scripts/build-tokens.mjs` | The token generator: writes `language/tokens.css`, `dist/`, and the theme mapper's `core.js`; generates and checks declarations from JSDoc for `theme-mapper/` and `open-vsx/` |
|
|
@@ -34,6 +34,7 @@ npm install @filipgutica/design-system
|
|
|
34
34
|
| Import | What it is |
|
|
35
35
|
| --- | --- |
|
|
36
36
|
| `@filipgutica/design-system/tokens.css` | The tokens. Dark mode follows `prefers-color-scheme`; set `data-theme="light"` or `"dark"` on `<html>` to override it. |
|
|
37
|
+
| `@filipgutica/design-system/ui-sdk.css` | Experimental: draws [ui-sdk](https://ui-sdk.dev)'s headless Button, Field, Input, Textarea, Checkbox, and Radio as the component specs do, checked against `@ui-sdk/*` 0.1.0-beta.5. Load it after `tokens.css`, without ui-sdk's `web.css`; [DESIGN.md](language/DESIGN.md#ui-sdk-experimental) gives the layer order and the supported components. |
|
|
37
38
|
| `@filipgutica/design-system/themes/*.css` | A theme's inputs (hue pair, and any fonts or neutrals): `graphite-indigo` (the default, already in `tokens.css`); the family sites' hues `lagoon` (annoterm), `copper` (devps), `iris` (filip-stack), `lapis` (Workbench), and `fern` (wtree); or the open palettes `catppuccin` and `github`. Load one after `tokens.css`, on `:root`. |
|
|
38
39
|
| `@filipgutica/design-system/themes/*.tokens.json` | Each theme's source as a W3C Design Tokens file (2025.10), for design-token tools such as Style Dictionary and Tokens Studio. |
|
|
39
40
|
| `@filipgutica/design-system/fonts.css` | IBM Plex Sans and Mono. |
|
package/language/DESIGN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Design language
|
|
2
2
|
|
|
3
|
-
A shared visual language for personal products, documentation, tools, mockups, and inline explainers. Claude and Codex follow this file. Take inspiration from the clarity and restraint of [Linear](https://linear.app/), [Codex](https://openai.com/codex/), [Director](https://director.sh/), and [T3 Code](https://t3.codes/): clear hierarchy, a balanced page frame, and real product evidence. Adapt their principles to the task; use original copy and assets.
|
|
3
|
+
A shared visual language for personal products, applications, documentation, tools, mockups, artifacts, dashboards, charts, and inline explainers. Claude and Codex follow this file. Take inspiration from the clarity and restraint of [Linear](https://linear.app/), [Codex](https://openai.com/codex/), [Director](https://director.sh/), and [T3 Code](https://t3.codes/): clear hierarchy, a balanced page frame, and real product evidence. Adapt their principles to the task; use original copy and assets.
|
|
4
4
|
|
|
5
5
|
## Scope and precedence
|
|
6
6
|
|
|
@@ -40,6 +40,7 @@ Center the **container**, not every sentence. Align header, content, images, and
|
|
|
40
40
|
## Files and examples
|
|
41
41
|
|
|
42
42
|
- `tokens.css`: the values of the default theme, Graphite Indigo, generated from the token source (`tokens/core.json` and `tokens/themes/graphite-indigo.tokens.json`) in `@filipgutica/design-system`. Other themes ship as `themes/<id>.css`, which set only a theme's inputs: its hue pair, and any fonts or neutrals it brings; load one after `tokens.css`, on `:root`. To change a value, edit the JSON there and run `pnpm tokens:build`; do not edit `tokens.css` by hand. The identity inputs sit in one block at the top.
|
|
43
|
+
- `ui-sdk.css`: experimental. Draws ui-sdk's headless parts as the component specs do; see [ui-sdk](#ui-sdk-experimental).
|
|
43
44
|
- `components.md`: one spec for each component, with anatomy, states, Do and Don't lines, keyboard and screen-reader behavior, motion, and forced colors. Read it for any component work.
|
|
44
45
|
- `components.html`: every component in each of its states, in plain HTML and CSS on `tokens.css`. Copy component markup and styles from there.
|
|
45
46
|
- `decisions.md`: the choices behind the components, and the options they replaced.
|
|
@@ -63,6 +64,7 @@ Token names depend on where the page runs. This file uses the `tokens.css` names
|
|
|
63
64
|
|
|
64
65
|
Controls use quiet depth and familiar shapes: borderless surfaces with one tight shadow at rest that sink when pressed or filled in.
|
|
65
66
|
|
|
67
|
+
- **Minimal by default.** Start from less: fewer words, boxes, and controls, and larger evidence. See [Minimal by default](#minimal-by-default).
|
|
66
68
|
- **Quiet surfaces, clear hierarchy.** Neutral paper and graphite backgrounds, with color reserved for the project hue, links, and meaningful states. Contrast, type, alignment, and proximity carry the structure.
|
|
67
69
|
- **Purposeful space.** Compact elements within a group, larger gaps between groups. Every gap should help a reader understand a relationship.
|
|
68
70
|
- **Evidence before decoration.** Show the actual product, command, or example. Use restrained framing so the evidence remains the focal point.
|
|
@@ -103,7 +105,7 @@ Controls use quiet depth and familiar shapes: borderless surfaces with one tight
|
|
|
103
105
|
| Phone | `@media (max-width: 640px)` | Side gutters drop from `--space-6` to `--space-4`, and section gaps take their phone step. |
|
|
104
106
|
|
|
105
107
|
Use `@media (min-width: 801px)` only for a rule that applies to desktop alone. One documented exception: the tool-home hero splits at `@media (min-width: 1024px)`, with the title across the top, the lede on the left, and the install block and facts on the right. Below 1024px it stacks in source order. Pages add no viewport breakpoint beyond the table and the hero split. A pane that must collapse at its own width uses a container query, as the detail column in `reference.html` does.
|
|
106
|
-
- Density: an application screen has one size for each place, not a range. Toolbar controls (buttons, segmented filters, and search fields) are `sm`, `--control-sm` tall. Rows in a table or list, such as the console's monitor list, and rail and navigation rows, are `--row` tall. Other controls keep the default `md` (`--control-md`). At tablet width every touch target grows to `--control-lg`. The console in `reference.html` uses these sizes.
|
|
108
|
+
- Density: an application screen has one size for each place, not a range. Toolbar controls (buttons, segmented filters, and search fields) are `sm`, `--control-sm` tall. Rows in a table or list, such as the console's monitor list, and rail and navigation rows, are `--row` tall. Other controls keep the default `md` (`--control-md`). At tablet width every touch target grows to `--control-lg`. The console in `reference.html` uses these sizes. This density is control size; how much a screen shows is [Minimal by default](#minimal-by-default).
|
|
107
109
|
- [Navigation](#navigation) is a strip of 6 links or fewer, or a section rail that moves into a drawer at tablet width. A sticky side rail taller than the window scrolls its link list, not the element that draws its divider, so an overlay scrollbar sits clear of the line. Keep wide code, tables, and charts scrolling inside their containers.
|
|
108
110
|
- Keep main headings, actions, and product evidence visible on load. Scrolling should reveal more content without being required to make existing content appear.
|
|
109
111
|
|
|
@@ -169,6 +171,26 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
169
171
|
- Examples: show a live component on a stage above its code, in one frame, with Copy in the code's corner. The stage sits on the page background. See [code block with a live example](components.md#with-a-live-example).
|
|
170
172
|
- A screenshot opens at full size in a [viewer](components.md#viewer) when clicked; use a native accessible trigger and restore its focus on close.
|
|
171
173
|
|
|
174
|
+
### ui-sdk (experimental)
|
|
175
|
+
|
|
176
|
+
[ui-sdk](https://ui-sdk.dev) gives headless, accessible components that an agent can read and operate through its agent bridge. `ui-sdk.css` draws their parts as this file and [`components.md`](components.md) specify. Use ui-sdk only where no owning library covers the framework or the component, such as a React app or a control that `@filipgutica/ui` lacks; where an owning library has the component, use the library's.
|
|
177
|
+
|
|
178
|
+
- Pin every `@ui-sdk/*` package to the exact version `ui-sdk.css` names, `0.1.0-beta.5`. Do not load `@ui-sdk/core/web.css`, its `--ui-*` variables, or the unversioned `https://ui-sdk.dev/web.js`.
|
|
179
|
+
- Load a stylesheet that starts with `@layer ui-sdk, base, components;` first, then `tokens.css` and `ui-sdk.css`. ui-sdk adds the little CSS its behaviour needs to `@layer ui-sdk` at run time, so the declaration keeps it below the design system, and `ui-sdk.css` sits in `components`, above the base as the [component rule](#components) requires. With Tailwind, put the declaration above `@import "tailwindcss"`, so Tailwind's utilities still outrank the components.
|
|
180
|
+
- Supported components, with each variant, size, and state of its [component spec](components.md). `ui-sdk.css` draws the composition given for each; where ui-sdk's own examples differ, such as a choice card's `data-slot="stack"` and `"hint"` spans or a text `DialogClose`, follow the composition here:
|
|
181
|
+
- [Button](components.md#button): no `data-variant` is primary; `data-variant="secondary"`, `"ghost"`, `"danger"`, or `"text"` picks another, and `data-size="sm"` or `"lg"` a size. A button whose `onClick` returns a promise is busy until it settles: it dims and shows the spinner, so do not add ui-sdk's `data-show="pending"` content. A button rendered as a link (`render={<a href=… />}`) keeps the button's look.
|
|
182
|
+
- [Field wrapper](components.md#field-wrapper) and [Text input and textarea](components.md#text-input-and-textarea): `Field`, `FieldLabel`, `FieldDescription`, `FieldError`, `Input`, and `Textarea`, with `data-size="sm"` or `"lg"` on an `Input`.
|
|
183
|
+
- [Checkbox and radio](components.md#checkbox-and-radio): each `Checkbox` or `Radio` as a direct child of a `<label data-slot="label">` with its text, and radios inside a `RadioGroup`. `data-size="sm"` or `"lg"` goes on the label.
|
|
184
|
+
- [Radio card group](components.md#radio-card-group): a `RadioGroup` of `<label data-slot="card">` cards, each holding a `<strong>` title, an optional `<span>` description, and the `Radio`.
|
|
185
|
+
- [Switch](components.md#switch): a `Switch` with its `SwitchThumb`, as a direct child of a `<label data-slot="label">` with its text, so the whole row toggles it. `data-size="sm"` or `"lg"` goes on the label.
|
|
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
|
+
- [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
|
+
- [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
|
+
- 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
|
+
- 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
|
+
|
|
172
194
|
### Navigation
|
|
173
195
|
|
|
174
196
|
[`components.md`](components.md) specifies each navigation component. These rules decide which one a page uses and how they agree.
|
|
@@ -229,6 +251,36 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
229
251
|
- Label illustrative data and demo outcomes clearly. Credit upstream creators when presenting a derivative product.
|
|
230
252
|
- Use monochrome line icons sparingly; give an icon a purpose beyond filling space.
|
|
231
253
|
|
|
254
|
+
### Minimal by default
|
|
255
|
+
|
|
256
|
+
Every interface built with this language starts minimal: application screens, mockups, artifacts, dashboards, charts, and the interface parts of documentation and product pages. Prose in lessons, documentation, and product pages keeps the [copy rules](#copy-and-density). A word, box, or control stays only when it changes what the reader knows or can do; remove anything that repeats what is already in view. Give the space that frees to the evidence, such as a chart or a key value, not to more items.
|
|
257
|
+
|
|
258
|
+
- **Status in one sentence.** A view's summary sentence carries its status, the numbers behind it, and a status icon. Use an [alert](components.md#alert) only for a caveat or an action the summary cannot carry: one per view at most, and never one that repeats a sentence, badge, or heading in view.
|
|
259
|
+
- **One meta line.** Context, such as who ran it, the scope, the size, and liveness ("still running"), sits on one muted line under the title, joined with " · ". It is the one deliberate run of middle dots. Its details sit behind a disclosure on that line.
|
|
260
|
+
- **One-line rows.** Data rows in a table or list are one line, `--row` tall. Show a direction, trend, or unit as a glyph (↑ or ↓) and put the words in the accessible name. Secondary detail goes in the selected row's detail or a disclosure.
|
|
261
|
+
- **Mark the exceptions.** Status columns, badges, and status icons show only the values that differ from the default. The default has no mark, and one key line names it. Drop an icon that repeats a badge or label in the same row.
|
|
262
|
+
- **Primary action in reach.** A row or card shows its primary next action as a button, plus either one secondary button or, for two or more secondary actions, one overflow menu trigger. A failed or blocked item keeps its recovery action, such as Retry, Resume, or Reconnect, visible.
|
|
263
|
+
- **Forms.** A field takes a description only for a format, limit, or consequence its label does not state. No intro sentence restates the fields. A sticky action bar sits on the page background with a hairline divider, without a panel or shadow.
|
|
264
|
+
- **Containers group.** Never nest a panel, card, or well in another. A component's own parts, as its spec draws them, such as a code block's source panel, and the controls and alerts inside a container or a dialog are fine. Grid cells and stat tiles take a fill or nothing, not a border each.
|
|
265
|
+
- **Explanations on request.** Method notes, "How to read this", and multiple-comparison caveats go in a closed disclosure next to what they explain.
|
|
266
|
+
|
|
267
|
+
Never cut these:
|
|
268
|
+
|
|
269
|
+
- Accessible names that keep the full words: verdict, direction, and status.
|
|
270
|
+
- A second signal beside colour.
|
|
271
|
+
- Safety, cost, and consent text, and the confirmation of a destructive action.
|
|
272
|
+
- Recovery paths, and an error's fix.
|
|
273
|
+
- Uncertainty cues: intervals, provisional and partial marks, sample sizes, and "may be chance". They may be faint; they stay.
|
|
274
|
+
- Labels on illustrative data.
|
|
275
|
+
- Loading, empty, and error states.
|
|
276
|
+
- Keyboard paths, visible focus, and target sizes.
|
|
277
|
+
|
|
278
|
+
Measure each screen you build or revise. Count its words, boxes, and controls with `interface-design`'s `ui-check.mjs --count`, at 1280px wide, for the whole page and the tool's first screen, and report the counts before and after. A count that rises needs a reason. There is no fixed budget.
|
|
279
|
+
|
|
280
|
+
- Words are visible text tokens. The count leaves out screen-reader-only text, so cutting visible words never means cutting accessible names.
|
|
281
|
+
- For the count, a box is any element with three or more visible borders, or any shadow, so raised buttons count too.
|
|
282
|
+
- Controls are buttons, links, fields, selects, and summaries.
|
|
283
|
+
|
|
232
284
|
## Identity layer: terminal folio
|
|
233
285
|
|
|
234
286
|
The personal sites are terminal tools that read Markdown and paths, so their identity comes from that world. A new project replaces this section with its own identity and keeps the core.
|
|
@@ -251,6 +303,10 @@ The personal sites are terminal tools that read Markdown and paths, so their ide
|
|
|
251
303
|
- Large blank gaps that push the action or evidence away from the introduction.
|
|
252
304
|
- Centered long paragraphs, excessively faint text, and horizontal page overflow.
|
|
253
305
|
- Theme controls added automatically to inline charts and explainers.
|
|
306
|
+
- An alert that repeats the summary sentence, or a status icon beside a badge that says the same.
|
|
307
|
+
- A bordered box around each grid cell, or a sticky bar drawn as a panel with a shadow.
|
|
308
|
+
- Helper text that restates its label.
|
|
309
|
+
- A row of secondary buttons on every list row.
|
|
254
310
|
|
|
255
311
|
## Acceptance
|
|
256
312
|
|
|
@@ -262,4 +318,7 @@ The personal sites are terminal tools that read Markdown and paths, so their ide
|
|
|
262
318
|
- [ ] At 390, 720, and 1280 px wide there is no horizontal page scroll, and the page's own viewport media queries use only `max-width: 640px`, `max-width: 800px`, `min-width: 801px`, and the documented `min-width: 1024px` hero split.
|
|
263
319
|
- [ ] Keyboard, focus, touch, deep links, and reduced motion work across relevant states.
|
|
264
320
|
- [ ] Every control is the owning system's component or class, never a local copy built from its tokens; spacing uses its tokens; each panel and visual effect has a purpose.
|
|
321
|
+
- [ ] Each status sits in one sentence or one alert, and nothing in view repeats it.
|
|
322
|
+
- [ ] Rows are one line, and each item shows its primary action plus one secondary button or one menu trigger at most.
|
|
323
|
+
- [ ] Words, boxes, and controls are counted before and after, and nothing on the never-cut list is gone.
|
|
265
324
|
- [ ] Control states match between `components.html`, the example pages, and the owning library: hover, press, focus, disabled, busy, invalid, and forced colors.
|
package/language/decisions.md
CHANGED
|
@@ -13,6 +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, and the project 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
18
|
| 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 |
|
|
17
19
|
| 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` |
|
|
18
20
|
| 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` |
|
|
@@ -25,6 +27,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
25
27
|
| Shape follows role | Core | A pill acts, or sets a value in place with every option shown, on one line (`--radius-control`); a select, which opens a list, is a one-line non-action control. Small state marks are pills (`--radius-pill`). Places and picked rows are 6px (`--radius-inline`). Typed fields, controls whose label wraps, and one-line controls that are not actions are 10px (`--radius-field`). Containers are 16px (`--radius-panel`). A pill never holds text that can wrap, and nested rectangles are concentric. The token names predate the rule: they say inline, control, and field, where the uses are rows, pills, and typed fields. The names stay, because a rename breaks every page that uses them. | One shape for every control. All pills put wrapping labels in pills, which the toggle card, fields, and the raised pill row already rejected; all rectangles lose the shape that marks an action. A list of components for each token with no reason: a new component had no rule to pick from, and a reader took a 6px row beside a pill for an error. | rendered corners by role: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one", "the DESIGN.md shape table names each role token with its value"; slider track and thumb, and select picker: `tests/design-foundations.test.mjs` "the slider track, slider thumb, and select picker take their role’s corners"; no literal radius: `tests/design-foundations.test.mjs` "no page or the report stylesheet writes a literal corner radius" |
|
|
26
28
|
| Themes | Core | A theme sets only its inputs: a hue for light and for dark, and optionally its two fonts, its neutrals (page, surfaces, hover, edges, and text, as a whole set for both modes), and, for a theme imported at runtime through the mapper, any of its 11 syntax colours (`--color-syntax-*`); theme files do not take syntax colours. Shape, spacing, states, and status colours stay core, so actions are pills in every theme. Neutrals are an input so an open palette keeps its own surfaces: Catppuccin and GitHub's Primer ship as themes, each mapped by its palette's own roles and unaltered. Where a hue cannot carry the text on a selected fill at 4.5:1, the build takes the first of the theme's text colour, black, and white that can, as the token roles say. Every theme passes the contrast guards in both modes. Theme files use the W3C Design Tokens format (2025.10) and ship beside the CSS, so design-token tools can read and write them: one file per theme, with a `light` and a `dark` group of sRGB colour tokens. Tools read the two groups as separate tokens (`light.color-bg`, `dark.color-bg`), not as one token with two modes; the Design Tokens Resolver module expresses modes, and it can replace the groups once tools support it. Graphite Indigo is the default. The family sites' own hues ship as themes named for their colour, so a site can load its theme file in place of an inline hue pair: Lagoon (annoterm), Copper (devps), Iris (filip-stack), Lapis (Workbench), and Fern (wtree). Each theme's note names its site. Where a site's light hue falls just short of 4.5:1 as selected-row text, its theme takes the smallest OKLCH lightness step that passes and keeps the hue and chroma, so the selection keeps the hue; the site can adopt the theme's value. A third-party palette is never altered. The theme mapper (`./theme-mapper`, experimental) turns a VS Code colour theme into these inputs for its one mode by selection: each input takes the first of its keys whose colour passes that input's contrast gate, and no colour is changed. What still fails is reported, as a `theme` problem in the theme's colours or a `core` problem in a core link, status, or syntax colour on its fills. Command text and prompts follow the theme’s code text and accent, so their failures belong to the theme’s text and focus checks. The checks are data: every ink on every fill the catalogue draws, hover and pressed states included, so a state axe never renders is still measured. The mapper keeps an imported theme's syntax colours too, from its `tokenColors`: each role takes the rule nearest its scope family. A role the theme leaves out takes its core colour; keyword, string, number, and comment have core colours, and the other 7 follow one of them or the code text. The owner chose this on 2026-11-14 to support open themes as their authors made them: the person who installs a theme owns its contrast, so a failing syntax colour is reported as a `theme` problem, never blocked or replaced. Most imports report one: comments in 5 of 8 popular themes measure 2.4–3.7:1 on their own background. The checks stay at 4.5:1, the WCAG AA minimum for text of this size; 3:1 would clear only 2 of those 5. The build and the mapper share one engine for applying a theme, resolving it, and checking it. | The action shape as a theme input (a pill, the 10px field corner, or the 6px row corner): each rounded choice gives actions another role's shape, a select's at 10px and a tab's or row's at 6px, so shape stops telling an action from a field. Radix Themes and shadcn scale every corner together, and Primer, Carbon, Polaris, and Spectrum keep shape core; revisit it as a whole radius scale when a theme needs one. Linear and OpenAI themes: neither publishes an open palette, and their colours are brand identity. Pine and Mauve, the earlier invented themes: no product used them, and they read as unrelated to the family's sites. A grey-blue quiet theme (Slate): it sat beside the muted text and the info blue, so its selection read as metadata and its primary button looked disabled. Adjusting an imported colour until it passes: the result is no longer the theme, and nothing tells the reader it changed. Syntax colours kept core for imports: an import lost its author's code colours to stay clear of reports. A looser bar for syntax, such as 3:1: it is below AA for code text, and it clears few imports. | Per-theme contrast guards (`tests/design-foundations.test.mjs`), the catalogue's rendered recipes in every theme, the Themes page tests, and the theme mapper's tests (`tests/theme-mapper.test.mjs`, the React smoke test with the mode locked opposite the system's, and the catalogue test that every axe contrast failure is a reported problem) |
|
|
27
29
|
| Open VSX theme imports | Core | `./open-vsx` is an experimental, framework-agnostic export for JSONC theme-file parsing and the Open VSX client. It returns VS Code theme data for `./theme-mapper`, with colours unchanged. Includes overlay colours child last and concatenate syntax rules base first, so later rules win. The client keeps the source client’s response, archive, path, checksum, include-depth, and timeout limits. The client reads ZIP headers and caps output from native `DecompressionStream('deflate-raw')`. `jsonc-parser` 3.3.1 reads comments and trailing commas and reports parse locations. It is the only runtime dependency and is pinned, used only by this export; `./theme-mapper` keeps no runtime dependencies. Component libraries own picker UI, persistence, and applying a theme. | Keeping parsing and fetching in a component library: each framework would need its own implementation and safety checks. JSZip at runtime: its synchronous inflation cannot enforce the output cap within a chunk. Handwritten JSONC parsing: more code to maintain for an established format. Making the mapper depend on the client: mapping an already parsed theme would load unused dependencies. | `tests/open-vsx.test.mjs`: offline client imports, JSONC validation, name normalisation, include merging and safety limits; generated declarations checked by `pnpm tokens:check`; package exports checked by `pnpm verify` |
|
|
30
|
+
| ui-sdk components | Core | Owner decision, 2026-11-16: the design system draws [ui-sdk](https://ui-sdk.dev)'s headless components itself. `ui-sdk.css` styles their `data-slot` and state attributes in `@layer components`, with the values of the `components.html` recipes, for the components DESIGN.md lists; any other ui-sdk component is unsupported until it has a spec and rules. It is experimental and checked against one exact ui-sdk version, because ui-sdk is in beta and renames parts between betas. The design system takes no runtime dependency on ui-sdk; component libraries keep their own components. | ui-sdk's optional `web.css` themed through its `--ui-*` variables: one radius, one spacing unit, and one ring could not draw shape by role, control sizes, depth, or field focus, and its link and focus rules replaced the base's. Shared `:is(.class, [data-slot])` rules: the parts differ in structure from the native recipes, such as a checkbox that is a button with an indicator. | Parity: `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue" compares each part with its `components.html` specimen, state by state, in light and dark; rendered parts: "every part ui-sdk.css draws renders from the installed ui-sdk"; pins and tokens: `tests/ui-sdk-css.test.mjs` |
|
|
28
31
|
| Navigation row corners | Core | Navigation rows, header and strip rows, list-selection rows, collapsible group labels, and tabs take 6px corners (`--radius-inline`), except rows inside a floating menu (see Floating-menu rows). The owner chose the more rectangular rows from the Gate M mockup (2026-11-09). | 10px (`--radius-field`), the previous corners, shared with fields. | 6px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one"; Foundations swatch: `tests/design-foundations.test.mjs` "the Foundations current-row swatch and radius list follow the navigation row radius" |
|
|
29
32
|
| Floating-menu rows | Core | Rows inside a floating menu, such as the project menu, are concentric with the 16px menu: `calc(var(--radius-panel) - var(--space-1))`, 12px, as select picker rows are. The owner approved it from the DS-3b comparison. | 6px like rail rows: a 6px row inside a 16px panel looks pinched. | 12px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
|
|
30
33
|
| One-line non-action controls | Core | A one-line control that is not an action takes the 10px field corner (`--radius-field`), as a select does: the select, the project-menu trigger, the labelled contents trigger and its no-JavaScript summary ("On this page"), and the skip link. The project trigger keeps the quiet-action tint. The owner chose it on 2026-11-10. | The pill (`--radius-control`): a pill means an action, and these controls open a menu or list, pick a value, or move focus. 16px (`--radius-panel`), like the menu and other floating layers: on a one-line control 40 to 44px tall it reads almost as a pill. | 10px corners: `tests/catalogue/catalogue.spec.ts` "each component renders the corner radius of its role, and no other part has one" |
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Experimental: this design language drawn on ui-sdk's headless components (https://ui-sdk.dev),
|
|
3
|
+
* checked against @ui-sdk/* 0.1.0-beta.5. It may change in any release until ui-sdk leaves
|
|
4
|
+
* beta. Pin @ui-sdk/* to that exact version.
|
|
5
|
+
*
|
|
6
|
+
* ui-sdk renders unstyled markup with data-slot and state attributes, such as data-checked,
|
|
7
|
+
* data-disabled, and data-invalid. These rules draw those parts as components.md specifies,
|
|
8
|
+
* with the same values as the components.html recipes; do not load @ui-sdk/core/web.css.
|
|
9
|
+
* DESIGN.md "ui-sdk (experimental)" gives the load order and the supported components. A
|
|
10
|
+
* ui-sdk component this file does not draw is unsupported: it renders unstyled.
|
|
11
|
+
*
|
|
12
|
+
* The rules sit in @layer components, so they outrank the tokens.css base, and a page's
|
|
13
|
+
* utilities layer can adjust size, spacing, and position. ui-sdk adds its behaviour CSS to
|
|
14
|
+
* @layer ui-sdk at run time. In a plain app that loads tokens.css and then this file, the
|
|
15
|
+
* statement below ranks that layer under these rules. A page with Tailwind or another layered
|
|
16
|
+
* stylesheet declares the order first, as DESIGN.md says, because a layer ranks where its name
|
|
17
|
+
* first appears.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
@layer ui-sdk, components;
|
|
21
|
+
|
|
22
|
+
@layer components {
|
|
23
|
+
/* ---------- Button ---------- */
|
|
24
|
+
/* No data-variant is the primary button; data-variant="secondary", "ghost", "danger", or "text"
|
|
25
|
+
picks another, and data-size="sm" or "lg" another size. */
|
|
26
|
+
[data-slot="button"] { --depth: var(--shadow-raise); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--color-accent); color: var(--color-accent-text); box-shadow: var(--depth); font: var(--weight-medium) var(--text-md) / 1.25 var(--font-ui); letter-spacing: -0.01em; text-decoration: none; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out); }
|
|
27
|
+
[data-slot="button"][data-size="sm"] { min-height: var(--control-sm); padding: 0 0.625rem; font-size: var(--text-sm); }
|
|
28
|
+
[data-slot="button"][data-size="lg"] { min-height: var(--control-lg); padding: 0 var(--space-4); font-size: var(--text-lg); }
|
|
29
|
+
[data-slot="button"][data-variant="secondary"] { background: var(--color-control-thumb); color: var(--color-text); }
|
|
30
|
+
[data-slot="button"][data-variant="ghost"] { --depth: none; background: transparent; color: var(--color-muted); }
|
|
31
|
+
/* Danger rises like the other filled variants; its text mixes the hue toward --color-text, as status badges do. */
|
|
32
|
+
[data-slot="button"][data-variant="danger"] { background: var(--color-error-surface); 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))); }
|
|
33
|
+
[data-slot="button"][data-variant="text"] { --depth: none; min-height: auto; padding: var(--space-1); background: transparent; color: var(--color-link); text-decoration: underline; text-underline-offset: 0.2em; }
|
|
34
|
+
@media (hover: hover) {
|
|
35
|
+
[data-slot="button"]:hover:not([data-disabled], [data-pending]) { background: var(--color-button-hover); }
|
|
36
|
+
[data-slot="button"][data-variant="secondary"]:hover:not([data-disabled], [data-pending]) { background: color-mix(in srgb, var(--color-text) 8%, var(--color-control-thumb)); }
|
|
37
|
+
[data-slot="button"][data-variant="ghost"]:hover:not([data-disabled], [data-pending]) { background: var(--color-row-hover); color: var(--color-text); }
|
|
38
|
+
[data-slot="button"][data-variant="danger"]:hover:not([data-disabled], [data-pending]) { background: color-mix(in srgb, var(--color-error) 10%, var(--color-error-surface)); }
|
|
39
|
+
[data-slot="button"][data-variant="text"]:hover:not([data-disabled], [data-pending]) { background: transparent; }
|
|
40
|
+
}
|
|
41
|
+
/* A press sinks the button 1px and changes its fill, so the click reads at a glance. */
|
|
42
|
+
[data-slot="button"]:not([data-variant]):is(:active, [aria-pressed="true"]):not([data-disabled], [data-pending]) { background: var(--color-button-hover); }
|
|
43
|
+
[data-slot="button"]:is([data-variant="secondary"], [data-variant="ghost"]):is(:active, [aria-pressed="true"]):not([data-disabled], [data-pending]) { background: var(--color-well); }
|
|
44
|
+
[data-slot="button"][data-variant="danger"]:is(:active, [aria-pressed="true"]):not([data-disabled], [data-pending]) { background: color-mix(in srgb, var(--color-error) 16%, var(--color-error-surface)); }
|
|
45
|
+
[data-slot="button"]:not([data-variant="text"]):is(:active, [aria-pressed="true"]):not([data-disabled], [data-pending]) { --depth: var(--shadow-sink); transform: translateY(1px); }
|
|
46
|
+
/* ui-sdk marks a pending button, one whose async action is running, with data-pending and aria-busy
|
|
47
|
+
but not data-disabled. Busy is disabled in the spec, so it dims and takes no hover or press too. */
|
|
48
|
+
[data-slot="button"]:is([data-disabled], [data-pending]) { --depth: none; opacity: 0.58; cursor: not-allowed; }
|
|
49
|
+
[data-slot="button"][aria-busy="true"] { cursor: wait; }
|
|
50
|
+
[data-slot="button"][aria-busy="true"]::before { content: ""; flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-sdk-spin 700ms linear infinite; }
|
|
51
|
+
@keyframes ui-sdk-spin { to { transform: rotate(360deg); } }
|
|
52
|
+
|
|
53
|
+
/* ---------- Field wrapper, input, textarea, and select trigger ---------- */
|
|
54
|
+
[data-slot="field"] { display: grid; gap: 0.375rem; justify-items: start; min-width: 0; }
|
|
55
|
+
[data-slot="field-label"] { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
|
|
56
|
+
[data-slot="field-description"] { font-size: var(--text-sm); color: var(--color-muted); }
|
|
57
|
+
[data-slot="field-error"] { font-size: var(--text-sm); color: var(--color-error); }
|
|
58
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"]) { --depth: var(--shadow-field); width: 100%; border: 1px solid var(--color-field-edge); border-radius: var(--radius-field); background: var(--color-field-bg); box-shadow: var(--depth); color: var(--color-text); font: var(--text-md) / 1.35 var(--font-ui); }
|
|
59
|
+
[data-slot="input"] { height: var(--control-md); padding: 0 0.625rem; }
|
|
60
|
+
[data-slot="input"][data-size="sm"] { height: var(--control-sm); padding-inline: 0.5625rem; font-size: var(--text-sm); }
|
|
61
|
+
[data-slot="input"][data-size="lg"] { height: var(--control-lg); padding-inline: 0.6875rem; font-size: var(--text-lg); }
|
|
62
|
+
[data-slot="textarea"] { display: block; min-height: 5.5rem; padding: 0.625rem; resize: vertical; }
|
|
63
|
+
:is([data-slot="input"], [data-slot="textarea"])::placeholder { color: var(--color-muted); opacity: 1; }
|
|
64
|
+
/* A disabled field drops into the grey well (the same fill as rest in dark) and loses its shadow. */
|
|
65
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"]):disabled { background-color: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
66
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"])[aria-invalid="true"] { border-color: var(--color-error); }
|
|
67
|
+
/* Fields draw no ring: the edge turns the accent with a muted accent line inside it, and the fill stays. */
|
|
68
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"]):focus-visible { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-field-focus); }
|
|
69
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"])[aria-invalid="true"]:focus-visible { border-color: var(--color-error); box-shadow: var(--shadow-field-focus-invalid); }
|
|
70
|
+
|
|
71
|
+
/* ---------- Checkbox and radio ---------- */
|
|
72
|
+
/* ui-sdk's checkbox and radio are buttons with role="checkbox" or "radio" inside a data-slot="label" label;
|
|
73
|
+
the indicator exists only while the control is checked. */
|
|
74
|
+
[data-slot="radio-group"] { display: flex; flex-wrap: wrap; gap: var(--space-4); }
|
|
75
|
+
[data-slot="label"]:has(> :is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { display: inline-flex; align-items: center; gap: 0.5625rem; min-height: var(--control-md); cursor: pointer; }
|
|
76
|
+
[data-slot="label"][data-size="sm"]:has(> :is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { min-height: var(--control-sm); font-size: var(--text-sm); }
|
|
77
|
+
[data-slot="label"][data-size="lg"]:has(> :is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { min-height: var(--control-lg); font-size: var(--text-lg); }
|
|
78
|
+
[data-slot="label"]:has(> [data-disabled]:is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { opacity: 0.58; cursor: not-allowed; }
|
|
79
|
+
:is([data-slot="checkbox"], [data-slot="radio"]) { display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-inline); background: var(--color-surface-raised); color: var(--color-accent-text); cursor: inherit; }
|
|
80
|
+
[data-slot="label"][data-size="sm"] > :is([data-slot="checkbox"], [data-slot="radio"]) { width: 16px; height: 16px; }
|
|
81
|
+
[data-slot="label"][data-size="lg"] > :is([data-slot="checkbox"], [data-slot="radio"]) { width: 20px; height: 20px; }
|
|
82
|
+
[data-slot="radio"] { border-radius: 50%; }
|
|
83
|
+
[data-slot="checkbox"][data-checked] { border-color: var(--color-accent); background: var(--color-accent); }
|
|
84
|
+
[data-slot="radio"][data-checked] { border-width: 5px; border-color: var(--color-accent); background: var(--color-surface-raised); }
|
|
85
|
+
[data-slot="checkbox-indicator"] { display: grid; place-items: center; }
|
|
86
|
+
/* The spec has no mixed state, and keepMounted leaves the indicator in an unchecked box: neither shows a mark. */
|
|
87
|
+
[data-slot="checkbox-indicator"]:not([data-checked]) { display: none; }
|
|
88
|
+
[data-slot="checkbox-indicator"]:not(:has(svg))::before { content: ""; width: 5px; height: 9px; margin-top: -2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
|
89
|
+
[data-slot="checkbox-indicator"] > svg { width: 14px; height: 14px; }
|
|
90
|
+
/* The radio's thick accent border is its mark. */
|
|
91
|
+
[data-slot="radio-indicator"] { display: none; }
|
|
92
|
+
|
|
93
|
+
/* ---------- Radio card group ---------- */
|
|
94
|
+
/* A <label data-slot="card"> holds a <strong> title, an optional <span> description, and the radio, which
|
|
95
|
+
sits in the top right corner. Depth and a check badge show the choice, without an accent ring. */
|
|
96
|
+
[data-slot="radio-group"]:has(> [data-slot="card"]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-3); }
|
|
97
|
+
[data-slot="card"]:has(> [data-slot="radio"]) { --depth: var(--shadow-raise); position: relative; display: grid; gap: var(--space-1); min-width: 0; padding: var(--space-3); padding-right: var(--space-8); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); box-shadow: var(--depth); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out); }
|
|
98
|
+
[data-slot="card"]:has(> [data-slot="radio"]) > span:not([data-slot]) { color: var(--color-muted); }
|
|
99
|
+
@media (hover: hover) {
|
|
100
|
+
[data-slot="card"]:has(> [data-slot="radio"]):hover:not(:has(> [data-slot="radio"]:is([data-checked], [data-disabled]))) { background: color-mix(in srgb, var(--color-surface-muted) 45%, var(--color-surface-raised)); }
|
|
101
|
+
}
|
|
102
|
+
[data-slot="card"]:has(> [data-slot="radio"][data-checked]) { --depth: var(--shadow-sink); background: var(--color-well); }
|
|
103
|
+
[data-slot="card"]:has(> [data-slot="radio"][data-disabled]) { opacity: 0.58; cursor: not-allowed; }
|
|
104
|
+
[data-slot="card"] > [data-slot="radio"] { position: absolute; top: var(--space-3); right: var(--space-3); width: 16px; height: 16px; }
|
|
105
|
+
[data-slot="card"] > [data-slot="radio"][data-checked] { border-width: 1px; background: var(--color-accent); }
|
|
106
|
+
[data-slot="card"] > [data-slot="radio"][data-checked]::after { content: ""; position: absolute; inset: 2px 4px 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
|
|
107
|
+
|
|
108
|
+
/* ---------- Switch and toggle button ---------- */
|
|
109
|
+
/* ui-sdk's switch button is the track and its thumb the knob. A data-slot="label" label wraps the switch
|
|
110
|
+
and its text, so the whole row is the hit area. A toggle button is a Toggle whose first child is an
|
|
111
|
+
empty ToggleIcon, drawn as the same track; a Toggle with an icon, or one in a ToggleGroup, is unsupported. */
|
|
112
|
+
[data-slot="label"]:has(> [data-slot="switch"]) { gap: var(--space-2); }
|
|
113
|
+
:is([data-slot="switch"], [data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty)) { --w: 2.75rem; --h: 1.375rem; --inset: 0.125rem; }
|
|
114
|
+
:is([data-slot="label"][data-size="sm"] > [data-slot="switch"], [data-slot="toggle"][data-size="sm"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty)) { --w: 2.2rem; --h: 1.1rem; --inset: 0.1rem; }
|
|
115
|
+
:is([data-slot="label"][data-size="lg"] > [data-slot="switch"], [data-slot="toggle"][data-size="lg"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty)) { --w: 3.3rem; --h: 1.65rem; --inset: 0.15rem; }
|
|
116
|
+
:is([data-slot="switch"], [data-slot="toggle"]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child) { --depth: var(--shadow-sink); position: relative; flex: none; width: var(--w); height: var(--h); margin: 0; padding: 0; border: 1px solid transparent; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--color-border) 90%, var(--color-well)); box-shadow: var(--depth); cursor: inherit; transition: background-color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out); }
|
|
117
|
+
[data-slot="switch-thumb"], [data-slot="toggle"]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child::after { content: ""; position: absolute; top: calc(var(--inset) - 1px); left: calc(var(--inset) - 1px); width: calc(var(--h) - 2 * var(--inset)); height: calc(var(--h) - 2 * var(--inset)); border-radius: var(--radius-pill); background: var(--color-surface-raised); box-shadow: var(--shadow-raise); transition: transform var(--duration) var(--ease-out), background-color var(--duration) var(--ease-out); }
|
|
118
|
+
:is([data-slot="switch"][data-checked], [data-slot="toggle"][data-pressed]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child) { border-color: var(--color-accent); background: var(--color-accent); }
|
|
119
|
+
[data-slot="switch-thumb"][data-checked], [data-slot="toggle"][data-pressed]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child::after { background: var(--color-accent-text); transform: translateX(calc(var(--w) - var(--h))); }
|
|
120
|
+
|
|
121
|
+
/* The toggle button is a labelled card: a visible edge and no raise, a named exception in decisions.md. */
|
|
122
|
+
[data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-md); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-field); background: var(--color-surface-raised); color: var(--color-text); font: var(--text-md) / var(--leading-tight) var(--font-ui); text-align: left; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
|
|
123
|
+
[data-slot="toggle"][data-size="sm"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) { min-height: var(--control-sm); font-size: var(--text-sm); }
|
|
124
|
+
[data-slot="toggle"][data-size="lg"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) { min-height: var(--control-lg); font-size: var(--text-lg); }
|
|
125
|
+
@media (hover: hover) {
|
|
126
|
+
[data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty):hover:not([data-disabled], [data-pressed]) { border-color: var(--color-border); }
|
|
127
|
+
}
|
|
128
|
+
/* The track carries the on state; the card takes a faint 8% accent tint and an accent hairline. */
|
|
129
|
+
[data-slot="toggle"][data-pressed]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) { border-color: color-mix(in srgb, var(--color-accent) 35%, transparent); background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface-raised)); }
|
|
130
|
+
[data-slot="toggle"][data-disabled]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) { opacity: 0.58; cursor: not-allowed; }
|
|
131
|
+
[data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) > span:not([data-slot]) { display: grid; }
|
|
132
|
+
[data-slot="toggle"]:not([data-orientation]):has(> [data-slot="toggle-icon"]:empty) small { color: var(--color-muted); font-size: var(--text-xs); }
|
|
133
|
+
|
|
134
|
+
/* ---------- Select ---------- */
|
|
135
|
+
/* The trigger takes the field recipe with a thin chevron; the list is a floating layer. ui-sdk positions it.
|
|
136
|
+
The list rules draw only data-presentation="popover"; a sheet is unsupported. */
|
|
137
|
+
[data-slot="select-trigger"] { position: relative; display: flex; align-items: center; height: var(--control-md); padding: 0 1.75rem 0 0.625rem; text-align: start; cursor: pointer; }
|
|
138
|
+
[data-slot="select-trigger"][data-size="sm"] { height: var(--control-sm); padding-left: 0.5625rem; font-size: var(--text-sm); }
|
|
139
|
+
[data-slot="select-trigger"][data-size="lg"] { height: var(--control-lg); padding-left: 0.6875rem; font-size: var(--text-lg); }
|
|
140
|
+
[data-slot="select-trigger"]::after { content: ""; position: absolute; right: var(--space-3); width: var(--space-2); height: var(--space-2); border-right: 1.5px solid var(--color-muted); border-bottom: 1.5px solid var(--color-muted); transform: translateY(-2px) rotate(45deg); }
|
|
141
|
+
[data-slot="select-value"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
142
|
+
[data-slot="select-value"][data-placeholder] { color: var(--color-muted); }
|
|
143
|
+
[data-slot="select-content"][data-presentation="popover"] { box-sizing: border-box; min-width: var(--anchor-width); max-height: min(20rem, 50dvh, var(--available-height, 50dvh)); overflow: auto; padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); font: var(--text-md) / var(--leading) var(--font-ui); }
|
|
144
|
+
/* ui-sdk sets the list's margin inline, so a translate leaves the catalogue's gap to the trigger. */
|
|
145
|
+
[data-slot="select-content"][data-presentation="popover"][data-side="bottom"] { translate: 0 var(--space-1); }
|
|
146
|
+
[data-slot="select-content"][data-presentation="popover"][data-side="top"] { translate: 0 calc(var(--space-1) * -1); }
|
|
147
|
+
[data-slot="select-item"] { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-sm); padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius-panel) - var(--space-1)); cursor: pointer; }
|
|
148
|
+
/* The check carries the state, because the selected fill equals the list's. It sits on the item, so a list
|
|
149
|
+
without SelectItemIndicator still shows it. */
|
|
150
|
+
[data-slot="select-item"][data-selected] { background: var(--color-row-selected); }
|
|
151
|
+
[data-slot="select-item"][data-selected]::after { content: "✓"; margin-left: auto; color: var(--color-accent); }
|
|
152
|
+
[data-slot="select-item-indicator"] { display: none; }
|
|
153
|
+
@media (hover: hover) {
|
|
154
|
+
[data-slot="select-item"][data-highlighted]:not([data-disabled]) { background: var(--color-row-hover); }
|
|
155
|
+
}
|
|
156
|
+
/* Keyboard focus is the ring, inset because the list scrolls. ui-sdk focuses the highlighted option, and its
|
|
157
|
+
data-modality can still say pointer after an arrow key, so the browser's :focus-visible decides. */
|
|
158
|
+
[data-slot="select-item"]:focus-visible { background: var(--color-row-hover); outline: var(--focus-width) solid var(--color-focus); outline-offset: calc(var(--focus-width) * -1); }
|
|
159
|
+
[data-slot="select-item"][data-disabled] { opacity: 0.58; cursor: not-allowed; }
|
|
160
|
+
@media (pointer: coarse) { [data-slot="select-item"] { min-height: var(--control-lg); } }
|
|
161
|
+
|
|
162
|
+
/* ---------- Dialog ---------- */
|
|
163
|
+
/* A centred panel on the overlay. ui-sdk's behaviour CSS resets the popover's position, so these set it.
|
|
164
|
+
They draw only data-presentation="dialog"; a sheet is unsupported and keeps ui-sdk's own placement.
|
|
165
|
+
The content holds a <header> (the title and description, then the close button), a body that scrolls,
|
|
166
|
+
and an optional <footer> with the actions at the end. Without a <header>, the content itself pads and scrolls. */
|
|
167
|
+
[data-slot="dialog-backdrop"] { position: fixed; inset: 0; background: var(--color-overlay); }
|
|
168
|
+
[data-slot="dialog-content"][data-presentation="dialog"] { position: fixed; inset: 0; display: flex; flex-direction: column; width: min(512px, calc(100% - var(--space-8))); height: fit-content; max-height: min(672px, calc(100dvh - var(--space-8))); margin: auto; overflow: hidden; padding: 0; border: 1px solid transparent; border-radius: var(--radius-panel); background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
|
|
169
|
+
[data-slot="dialog-content"][data-presentation="dialog"]:not(:has(> header)) { overflow: auto; padding: var(--space-4); }
|
|
170
|
+
[data-slot="dialog-content"][data-presentation="dialog"] > :is(header, footer) { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); }
|
|
171
|
+
[data-slot="dialog-content"][data-presentation="dialog"] > header { border-bottom: 1px solid var(--color-border-subtle); }
|
|
172
|
+
[data-slot="dialog-content"][data-presentation="dialog"]:has(> header) > :not(header, footer) { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--space-4); }
|
|
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
|
+
[data-slot="dialog-title"] { margin: 0; font-size: 1.125rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
|
|
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); }
|
|
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); }
|
|
180
|
+
}
|
|
181
|
+
[data-slot="dialog-content"] > header > [data-slot="dialog-close"]:active { background: color-mix(in srgb, currentColor 12%, transparent); }
|
|
182
|
+
/* Phones: the dialog becomes a bottom sheet with rounded top corners. */
|
|
183
|
+
@media (max-width: 640px) {
|
|
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
|
+
}
|
|
186
|
+
|
|
187
|
+
/* ---------- Focus ---------- */
|
|
188
|
+
/* One ring for every role, over the control's own raise or sink; the base draws the same ring, and this pins it. */
|
|
189
|
+
/* It goes on the visible part of a composite control: the switch track and the radio card. */
|
|
190
|
+
/* A comma list rather than one :is(), so each selector keeps its own specificity and the forced-colours
|
|
191
|
+
outline-color rules below still win. */
|
|
192
|
+
:is([data-slot="button"], [data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"]):focus-visible,
|
|
193
|
+
[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,
|
|
195
|
+
[data-slot="dialog-content"][data-presentation="dialog"]:focus-visible,
|
|
196
|
+
[data-slot="card"]:has(> [data-slot="radio"]:focus-visible) { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
197
|
+
/* The card draws the ring, so the radio inside it does not. */
|
|
198
|
+
[data-slot="card"] > [data-slot="radio"]:focus-visible { outline: none; }
|
|
199
|
+
|
|
200
|
+
/* Touch: at tablet width and below, unsized controls grow to --control-lg, as the catalogue's do. */
|
|
201
|
+
@media (max-width: 800px) {
|
|
202
|
+
[data-slot="button"]:not([data-size]) { min-height: var(--control-lg); }
|
|
203
|
+
[data-slot="input"]:not([data-size]) { height: var(--control-lg); }
|
|
204
|
+
[data-slot="label"]:not([data-size]):has(> :is([data-slot="checkbox"], [data-slot="radio"], [data-slot="switch"])) { min-height: var(--control-lg); }
|
|
205
|
+
[data-slot="toggle"]:not([data-size], [data-orientation]):has(> [data-slot="toggle-icon"]:empty) { min-height: var(--control-lg); }
|
|
206
|
+
[data-slot="select-trigger"]:not([data-size]) { height: var(--control-lg); }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media (forced-colors: active) {
|
|
210
|
+
/* The inset accent line drops, so a focused field draws the system ring just inside its edge. */
|
|
211
|
+
:is([data-slot="input"], [data-slot="textarea"], [data-slot="select-trigger"]):focus-visible { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
212
|
+
[data-slot="checkbox"][data-checked] { forced-color-adjust: none; border-color: Highlight; background: Highlight; color: HighlightText; }
|
|
213
|
+
[data-slot="radio"][data-checked] { forced-color-adjust: none; border-color: Highlight; background: HighlightText; }
|
|
214
|
+
:is([data-slot="checkbox"], [data-slot="radio"]):focus-visible { outline-color: CanvasText; }
|
|
215
|
+
[data-slot="card"] > [data-slot="radio"][data-checked] { background: Highlight; color: HighlightText; }
|
|
216
|
+
/* The tracks opt out of adjustment, so the switch's ring takes the system text colour too. */
|
|
217
|
+
:is([data-slot="switch"], [data-slot="toggle"]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child) { forced-color-adjust: none; border-color: ButtonText; background: Canvas; }
|
|
218
|
+
[data-slot="switch-thumb"], [data-slot="toggle"]:not([data-orientation]) > [data-slot="toggle-icon"]:empty:first-child::after { forced-color-adjust: none; background: ButtonText; }
|
|
219
|
+
: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
|
+
[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
|
+
[data-slot="switch"]:focus-visible { outline-color: CanvasText; }
|
|
222
|
+
}
|
|
223
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filipgutica/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Filip's design language, tokens, and component catalogue for any framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"default": "./dist/tokens.js"
|
|
13
13
|
},
|
|
14
14
|
"./tokens.css": "./language/tokens.css",
|
|
15
|
+
"./ui-sdk.css": "./language/ui-sdk.css",
|
|
15
16
|
"./themes/*.css": "./dist/themes/*.css",
|
|
16
17
|
"./themes/*.tokens.json": "./dist/themes/*.tokens.json",
|
|
17
18
|
"./tokens.json": "./dist/tokens.json",
|
|
@@ -66,24 +67,26 @@
|
|
|
66
67
|
},
|
|
67
68
|
"homepage": "https://github.com/filipgutica/design-system#readme",
|
|
68
69
|
"devDependencies": {
|
|
69
|
-
"@axe-core/playwright": "
|
|
70
|
-
"@commitlint/cli": "
|
|
71
|
-
"@commitlint/config-conventional": "
|
|
72
|
-
"@playwright/test": "
|
|
70
|
+
"@axe-core/playwright": "4.14.0",
|
|
71
|
+
"@commitlint/cli": "21.2.4",
|
|
72
|
+
"@commitlint/config-conventional": "21.2.4",
|
|
73
|
+
"@playwright/test": "1.65.0",
|
|
73
74
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
74
|
-
"@semantic-release/git": "
|
|
75
|
-
"@types/node": "
|
|
76
|
-
"@types/react": "
|
|
77
|
-
"@types/react-dom": "
|
|
78
|
-
"@
|
|
79
|
-
"
|
|
75
|
+
"@semantic-release/git": "10.0.1",
|
|
76
|
+
"@types/node": "24.19.2",
|
|
77
|
+
"@types/react": "19.3.0",
|
|
78
|
+
"@types/react-dom": "19.3.0",
|
|
79
|
+
"@ui-sdk/core": "0.1.0-beta.5",
|
|
80
|
+
"@ui-sdk/react": "0.1.0-beta.5",
|
|
81
|
+
"@vitejs/plugin-react": "6.2.1",
|
|
82
|
+
"conventional-changelog-conventionalcommits": "9.3.1",
|
|
80
83
|
"jszip": "3.10.1",
|
|
81
|
-
"publint": "
|
|
82
|
-
"react": "
|
|
83
|
-
"react-dom": "
|
|
84
|
-
"semantic-release": "
|
|
85
|
-
"typescript": "
|
|
86
|
-
"vite": "
|
|
84
|
+
"publint": "0.3.25",
|
|
85
|
+
"react": "19.3.1",
|
|
86
|
+
"react-dom": "19.3.1",
|
|
87
|
+
"semantic-release": "25.0.9",
|
|
88
|
+
"typescript": "5.9.3",
|
|
89
|
+
"vite": "8.3.6"
|
|
87
90
|
},
|
|
88
91
|
"dependencies": {
|
|
89
92
|
"jsonc-parser": "3.3.1"
|