@filipgutica/design-system 1.0.23 → 1.0.24
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 +16 -0
- package/language/decisions.md +1 -0
- package/language/ui-sdk.css +111 -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
|
@@ -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.
|
|
@@ -169,6 +170,21 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
169
170
|
- 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
171
|
- 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
172
|
|
|
173
|
+
### ui-sdk (experimental)
|
|
174
|
+
|
|
175
|
+
[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.
|
|
176
|
+
|
|
177
|
+
- 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`.
|
|
178
|
+
- 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.
|
|
179
|
+
- Supported components, with each variant, size, and state of its [component spec](components.md):
|
|
180
|
+
- [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.
|
|
181
|
+
- [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`.
|
|
182
|
+
- [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.
|
|
183
|
+
- At tablet width and below, unsized buttons, inputs, and choice rows grow to `--control-lg` for touch, as the catalogue's do.
|
|
184
|
+
- Any other ui-sdk component or part is unsupported: it renders unstyled. That includes `InputGroup`, `InputClear`, a mixed (indeterminate) checkbox, and radio cards. 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.
|
|
185
|
+
- 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.
|
|
186
|
+
- 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.
|
|
187
|
+
|
|
172
188
|
### Navigation
|
|
173
189
|
|
|
174
190
|
[`components.md`](components.md) specifies each navigation component. These rules decide which one a page uses and how they agree.
|
package/language/decisions.md
CHANGED
|
@@ -25,6 +25,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
25
25
|
| 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
26
|
| 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
27
|
| 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` |
|
|
28
|
+
| 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
29
|
| 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
30
|
| 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
31
|
| 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,111 @@
|
|
|
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, and textarea ---------- */
|
|
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"]) { --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"]):disabled { background-color: var(--color-well); box-shadow: none; opacity: 0.58; cursor: not-allowed; }
|
|
66
|
+
:is([data-slot="input"], [data-slot="textarea"])[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"]):focus-visible { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-field-focus); }
|
|
69
|
+
:is([data-slot="input"], [data-slot="textarea"])[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"])) { 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"])) { 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"])) { min-height: var(--control-lg); font-size: var(--text-lg); }
|
|
78
|
+
[data-slot="label"]:has(> [data-disabled]:is([data-slot="checkbox"], [data-slot="radio"])) { 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
|
+
/* ---------- Focus ---------- */
|
|
94
|
+
/* One ring for every role, over the control's own raise or sink; the base draws the same ring, and this pins it. */
|
|
95
|
+
:is([data-slot="button"], [data-slot="checkbox"], [data-slot="radio"]):focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
96
|
+
|
|
97
|
+
/* Touch: at tablet width and below, unsized controls grow to --control-lg, as the catalogue's do. */
|
|
98
|
+
@media (max-width: 800px) {
|
|
99
|
+
[data-slot="button"]:not([data-size]) { min-height: var(--control-lg); }
|
|
100
|
+
[data-slot="input"]:not([data-size]) { height: var(--control-lg); }
|
|
101
|
+
[data-slot="label"]:not([data-size]):has(> :is([data-slot="checkbox"], [data-slot="radio"])) { min-height: var(--control-lg); }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (forced-colors: active) {
|
|
105
|
+
/* The inset accent line drops, so a focused field draws the system ring just inside its edge. */
|
|
106
|
+
:is([data-slot="input"], [data-slot="textarea"]):focus-visible { outline: var(--focus-width) solid Highlight; outline-offset: -1px; }
|
|
107
|
+
[data-slot="checkbox"][data-checked] { forced-color-adjust: none; border-color: Highlight; background: Highlight; color: HighlightText; }
|
|
108
|
+
[data-slot="radio"][data-checked] { forced-color-adjust: none; border-color: Highlight; background: HighlightText; }
|
|
109
|
+
:is([data-slot="checkbox"], [data-slot="radio"]):focus-visible { outline-color: CanvasText; }
|
|
110
|
+
}
|
|
111
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filipgutica/design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
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"
|