@filipgutica/design-system 1.0.34 → 1.0.35
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/language/DESIGN.md
CHANGED
|
@@ -196,7 +196,7 @@ Each depth tier has one token. [`tokens.css`](tokens.css) holds every shadow val
|
|
|
196
196
|
- [Drawer](components.md#drawer): `Drawer` with `side="left"` or `"right"`, `DrawerBackdrop`, and `DrawerContent` holding a `<header>` (`DrawerTitle`, then an icon `DrawerClose` with an `aria-label`) and the body in one element.
|
|
197
197
|
- [Overflow menu](components.md#overflow-menu): `Menu`, `MenuTrigger`, `MenuContent`, `MenuItem`, `MenuSeparator`, and `MenuItemIcon`. Supply the More SVG as the trigger's child and an item-specific `aria-label`; use `align="end"` on `MenuContent` (its default 4px offset matches `--space-1`). Render each `MenuItem` as a button with `render={<button type="button" />}`; for disabled items, pass both `disabled` and `render={<button type="button" disabled />}` so the native button and ui-sdk agree. `destructive` on the last item draws the danger text through ui-sdk's `data-destructive`; separate it with `MenuSeparator`. `data-open`, `data-highlighted`, and `data-disabled` come from ui-sdk, not the app. `MenuItemIcon` wraps an app-supplied 16px SVG.
|
|
198
198
|
- Beta.5 keyboard limitation: ui-sdk highlights disabled items instead of skipping them. With a native disabled button, focus stays on the preceding item and Down Arrow stops there; Up Arrow, Home, and End still reach the items after it. Use the plain-HTML recipe when disabled-item skipping is required; this stylesheet cannot correct ui-sdk's navigation.
|
|
199
|
-
- At tablet width and below, the menu trigger and items, buttons, inputs, select triggers, toggle buttons, segmented
|
|
199
|
+
- At tablet width and below, the menu trigger and items, buttons, inputs, select triggers, toggle buttons, segmented tracks, tabs, sliders, and choice and switch rows grow to `--control-touch` (44px) for touch, at every size; segmented options sit inside the track's 2px inset, so they are 40px. The catalogue's size specimens keep their sizes.
|
|
200
200
|
- Where ui-sdk drives a behaviour, it differs from the spec:
|
|
201
201
|
- The segmented thumb and the tab fill glide with both edges together over 260ms, without the stretch, because ui-sdk does not say which way a choice moved before it moves them.
|
|
202
202
|
- A glide runs while the pointer or focus is in the control, so a re-measure then, such as on a resize, glides too.
|
package/language/components.html
CHANGED
|
@@ -959,7 +959,7 @@
|
|
|
959
959
|
.row { grid-template-columns: minmax(0, 1fr); }
|
|
960
960
|
/* Touch: controls of every size grow to --control-touch, the inert state examples included. Only the size
|
|
961
961
|
specimens (data-specimen="size") keep their sizes. */
|
|
962
|
-
.btn:not([data-specimen="size"] *), .navlist a, .tab { min-height: var(--control-touch); }
|
|
962
|
+
.btn:not([data-specimen="size"] *), .navlist a, .rows [role="option"], .tab { min-height: var(--control-touch); }
|
|
963
963
|
/* A segmented control grows its item size too, so icon-only options stay square. */
|
|
964
964
|
.segmented:not([data-specimen="size"] *) { --item: var(--control-touch); }
|
|
965
965
|
.input:not([data-specimen="size"] *), .select:not([data-specimen="size"] *), .range:not([data-specimen="size"] *) { height: var(--control-touch); }
|
package/language/decisions.md
CHANGED
|
@@ -5,7 +5,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
5
5
|
| Decision | Layer | Chosen | Rejected, and why | Guarded by |
|
|
6
6
|
| --- | --- | --- | --- | --- |
|
|
7
7
|
| Units | Core | Type (`--text-*`), spacing (`--space-*`), and control and row heights (`--control-*`, `--row`) are rem, as are the page literals that size text, padding, gaps, and line heights. Each equals its old pixel value at the default 16px root, so the default render does not change. Hairlines, focus rings and their offsets, shadows, fixed icon and box sizes, layout widths, and radii stay px. Media query breakpoints stay px and are out of scope here. | All px: text and controls ignored the reader's browser font-size setting. All rem: 1px hairlines and the 2px focus ring would grow or round to uneven widths. | rem sizes: `tests/design-foundations.test.mjs` "type, spacing, and control sizes are rem on every page, in tokens.css, and in the report stylesheet" |
|
|
8
|
-
| Depth | Core | Quiet lift: borderless controls take one tight shadow at rest (`--shadow-raise`) and sink when pressed. Containers take a fainter edge (`--shadow-surface`). No outer light highlight, and no blur wider than 2px. A transparent 1px border stays for forced colors. | A dual raise (a dark blur below and a light highlight above) on controls and containers alike: cards looked heavy, idle buttons looked too raised, and dark mode showed a fuzzy halo. Before that, a crisp, bordered look. | shadows from tokens: `tests/design-foundations.test.mjs` "pages take depth from tokens.css: no literal shadow outside a focus ring or divider"; raise and sink recipe: no test yet |
|
|
8
|
+
| Depth | Core | Quiet lift: borderless controls take one tight shadow at rest (`--shadow-raise`) and sink when pressed. Containers take a fainter edge (`--shadow-surface`). No outer light highlight, and no blur wider than 2px. A transparent 1px border stays for forced colors. | A dual raise (a dark blur below and a light highlight above) on controls and containers alike: cards looked heavy, idle buttons looked too raised, and dark mode showed a fuzzy halo. Before that, a crisp, bordered look. Astryx-style flat fills (2026-11-23) removed the rest raise and pressed sink, used translucent neutral fills on secondary buttons and segmented controls, and gave panels and cards 1px edges. After comparing the rendered versions, the owner preferred the quiet lift and soft neumorphic details. | shadows from tokens: `tests/design-foundations.test.mjs` "pages take depth from tokens.css: no literal shadow outside a focus ring or divider"; raise and sink recipe: no test yet |
|
|
9
9
|
| Primary button | Core | Filled with the project hue (`--color-accent`), with `--color-accent-text`. | Plain ink (black in light, white in dark) looked too severe. Graphite ink looked disabled. | label contrast in every state: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled primary button label reaches 4.5:1"; hue fill: no test yet |
|
|
10
10
|
| Danger button | Core | A raised `--color-error-surface` button with danger-tinted text, mixed toward `--color-text` as status badges are. Hover and press deepen the tint, and press sinks it. The label must read at 4.5:1 on all three fills; where the mix misses, it falls back to `--color-text`, black, or white. | A flat button with `--color-text` and a hover border read as a pink secondary button, and pressing it showed nothing. | label contrast on all three fills: `tests/catalogue/catalogue.spec.ts` "contrast: every enabled danger button label reaches 4.5:1"; fills, raise, and sink: no test yet |
|
|
11
11
|
| Pressed button | Core | Every variant but text sinks 1px, takes `--shadow-sink`, and changes its fill. Press is a button state: other controls show their latched state, and quiet actions tint without sinking. | The sink shadow alone was too faint to show a click, especially on secondary and ghost. | rule present: `tests/design-foundations.test.mjs` "every state rule the guard requires exists in the catalogue"; 1px move, sink, and fill: no test yet |
|
|
@@ -41,7 +41,7 @@ Each entry records a choice this language made, the options it rejected, and why
|
|
|
41
41
|
| Tab glide | Core | The selected tab's fill is a `::before` layer that glides between tabs like the segmented thumb: `glide-left` and `glide-right`, 260ms leading and 300ms trailing, with CSS `ease`. No glide on first render or under reduced motion, and no layer in forced colors. The owner chose it at Gate M. | The fill jumping from tab to tab, unlike the segmented control beside it. | glide and reduced motion: `tests/catalogue/catalogue.spec.ts` "the tab fill glides to the new tab", "the tab fill moves at once" |
|
|
42
42
|
| Segmented touch size | Core | At tablet width a segmented control of any size sets `--item` to `--control-touch` (unsized only until 2026-11-23). | Growing only the buttons' `min-height`: `--item` stayed at `--control-md`, so icon-only options were 36×44 ovals (found at Gate M). | No test yet |
|
|
43
43
|
| Compact controls | Core | `--control-sm` is 28px (`1.75rem`), Astryx's small element height (`--size-element-sm`). Buttons pad `--space-2` (8px) at `sm` with a 6px icon gap, 10px at `md`, and `--space-3` at `lg`. Badges pad 2px by 6px with a 4px dot gap. A new [chip](components.md#chip) is 24px tall with `--space-2` padding. The owner chose this on 2026-11-22 from a rendered comparison of today's controls, the proposal, and Astryx, after finding the board busy. | Astryx's 12px button padding at every size: the owner asked for narrower controls, and the height cut alone left `sm` buttons as wide as before. Astryx's 12px `sm` label: personal work keeps IBM Plex at `--text-sm` (13px). Astryx's solid status badges: status surfaces are soft tints (DESIGN.md, Theme and color), and solid fills are louder than a busy screen can take. Astryx's semibold pressed option: the thumb and accent text already mark it, and a weight change needs a hidden copy of each label to stop the width from shifting. Astryx's 0.98 press scale: the 1px sink is part of quiet depth. | token value: `tests/token-values.test.mjs` "tokens.css preserves DS-1 values except …"; recipes: `tests/catalogue/catalogue.spec.ts` and the ui-sdk parity test `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue" |
|
|
44
|
-
| Control size scale | Core | `--control-sm`, `--control-md`, and `--control-lg` are 28px, 32px, and 36px (`1.75rem`, `2rem`, `2.25rem`), Astryx's element sizes (`--size-element-sm`, `-md`, `-lg`). A control with no size is `md`. A separate `--control-touch`, 44px (`2.75rem`), is what controls of every size grow to at tablet width, and it sizes the docs-site links and icon actions that were `--control-lg` at every width; only the catalogue's inert size specimens keep their sizes there. The owner chose this on 2026-11-23: 36px `md` felt big beside 28px `sm`. | The 28 / 36 / 44px scale (until 2026-11-23): `md` sat 8px above `sm`, so a medium control stood out in a dense screen, and `lg` doubled as the touch size. Astryx's 32px `md` and 36px `lg` were first rejected on 2026-11-22 because `md` would move every form and `lg` served touch; the owner's feedback on `md`, and a separate touch token, removed both reasons. Making `sm` the default: documentation and product pages would need `md` on every control, and the gap to `md` is now 4px. Growing only unsized controls at tablet width (the rule before): an application screen sets every control at `sm`, so its touch targets would stay 28px, and an explicit `lg` would drop from 44px to 36px. | token values: `tests/token-values.test.mjs` "tokens.css preserves DS-1 values except …"; touch growth: `tests/
|
|
44
|
+
| Control size scale | Core | `--control-sm`, `--control-md`, and `--control-lg` are 28px, 32px, and 36px (`1.75rem`, `2rem`, `2.25rem`), Astryx's element sizes (`--size-element-sm`, `-md`, `-lg`). A control with no size is `md`. A separate `--control-touch`, 44px (`2.75rem`), is what controls of every size grow to at tablet width, and it sizes the docs-site links and icon actions that were `--control-lg` at every width; only the catalogue's inert size specimens keep their sizes there. The owner chose this on 2026-11-23: 36px `md` felt big beside 28px `sm`. | The 28 / 36 / 44px scale (until 2026-11-23): `md` sat 8px above `sm`, so a medium control stood out in a dense screen, and `lg` doubled as the touch size. Astryx's 32px `md` and 36px `lg` were first rejected on 2026-11-22 because `md` would move every form and `lg` served touch; the owner's feedback on `md`, and a separate touch token, removed both reasons. Making `sm` the default: documentation and product pages would need `md` on every control, and the gap to `md` is now 4px. Growing only unsized controls at tablet width (the rule before): an application screen sets every control at `sm`, so its touch targets would stay 28px, and an explicit `lg` would drop from 44px to 36px. | token values: `tests/token-values.test.mjs` "tokens.css preserves DS-1 values except …"; rendered sizes and touch growth at 1280, 800, and 375px: `tests/catalogue/catalogue.spec.ts` "<page> renders control sizes at <width>px", and `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue at 375px" |
|
|
45
45
|
| Segmented track inset | Core | The track is the control height and insets its options 2px from its outer edge (its 1px border and 1px of padding), with 2px between options, as Astryx's segmented control does (`SegmentedControl.tsx`: 2px padding and gap; `SegmentedControlItem.tsx`: item height the element height minus 4px, 8px padding at `sm`, 12px at `md` and `lg`). Each option is its own thumb, with `calc(var(--radius-control) - var(--inset))`, 6px, measured from the outer edge because the border is part of the track's visible curve: the one control corner below 8px, a named exception to the row corner. The owner asked for it on 2026-11-22 after the 28px `sm` filter's thumb looked off centre in its 30px track. Options set `line-height: 1`, so the label sits centred: the inherited 1.6 put IBM Plex 1.8px above centre in a 24px `sm` option (Chromium). | A thumb inset 2px inside each full-height option (the rule until 2026-11-22): the track was 2px taller than the control (34px beside a 32px button at `sm`, then 30px beside 28px), and the thumbs sat 4px apart. The mockups' nested 12px track around 8px rows: at 28px tall, a 4px inset leaves a 20px option, which is cramped. Measuring from the padding edge (7px): the visible curve is the border's, so 7px reads as a corner that does not follow the track. | thumb centred and track height equals the same-size button: `tests/catalogue/catalogue.spec.ts`; ui-sdk parity: `tests/react-smoke/ui-sdk.spec.ts` "ui-sdk parts match the catalogue" |
|
|
46
46
|
| Application density | Core | In an application screen, buttons, fields, and segmented controls are `sm` (28px), the main action included, and chips stay 24px. The main action stands out by its primary fill. The owner dropped the `md` main action on 2026-11-23: `md` felt big beside `sm`. Rows are `--row` tall, with `--text-sm` body text and `--text-xs` metadata. Documentation and product pages keep `md`. At tablet width every touch target grows to `--control-touch`, at every size. The owner chose this on 2026-11-22 from the board mockups. | Toolbar controls alone at `sm`, the rule before: forms and actions inside a pane stayed `md`, so one screen mixed two heights. `md` everywhere: the board read as busy. One `md` main action per screen (the first version of this rule): it felt big next to `sm` controls. | No test yet |
|
|
47
47
|
| Astryx as the reference system | Core | When a value or behaviour is not decided here, start from Astryx's (`meta/astryx`, MIT, read at `7032abf`), and record any departure in this file. Take the idea and the values, never the code. The identity stays this system's: IBM Plex, the theme hues, quiet depth, and the forced-colors rules. The owner chose this on 2026-11-22 so the system stops re-deciding settled questions; the quiet action fill, the focus ring, field focus, the radius scale, and the compact controls already follow Astryx. React apps keep ui-sdk for behaviour: `ui-sdk.css` draws it. | Astryx's React components in React apps, themed with these tokens: it reverses the board's ui-sdk choice, and the Vue library could not use them. Making the design system a wrapper of ui-sdk: `@filipgutica/ui` (Vue) and the static sites use the design system, ui-sdk is React-only here and in beta, and `ui-sdk.css` already draws ui-sdk's parts. Deciding each value from scratch: it re-decided questions Astryx has answered, and the results drifted toward it anyway. | No test: a working rule for authors |
|
package/language/reference.html
CHANGED
|
@@ -418,6 +418,7 @@
|
|
|
418
418
|
.segmented button { min-width: calc(var(--item) - 2 * var(--inset)); }
|
|
419
419
|
.btn:not([data-specimen="size"] *), .navlist a, .tab { min-height: var(--control-touch); }
|
|
420
420
|
.search { height: var(--control-touch); }
|
|
421
|
+
.check:not([data-specimen="size"] *) { min-height: var(--control-touch); }
|
|
421
422
|
.shell { grid-template-columns: minmax(0, 1fr); height: auto; }
|
|
422
423
|
main { overflow: visible; }
|
|
423
424
|
.sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--color-border-subtle); padding: var(--space-2) var(--space-6); gap: var(--space-2); }
|