@quieto/design-tokens 0.0.0-stage → 0.2.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # @quieto/design-tokens
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 35c897a: Add `qds-accordion` and `qds-accordion-item`: collapsible sections following the ARIA accordion pattern, with a configurable heading level, an exclusive mode, arrow-key movement between headings, and closed panels that find-in-page can still search. Styled by the new `component/accordion` token set.
8
+ - 99ce48f: Add `qds-card`: a container with media, header, body, and footer regions in outlined, elevated, and filled variants. Empty regions are hidden in CSS, so server-rendered cards lay out correctly before hydration. Styled by the new `component/card` token set.
9
+ - db92c5e: Add `qds-checkbox`: a form-associated checkbox with checked, indeterminate, disabled, and required states, styled by the new `component/checkbox` token set.
10
+ - b7d1206: Add `qds-chip`: a compact status or category label in five variants, with an optional remove button that fires `qds-remove`. Styled by the new `component/chip` token set.
11
+ - ad84c23: Add `qds-input`: a form-associated single-line text input with sizes, start and end slots, and native constraint validation, styled by the new `component/input` token set.
12
+ - a8ac72b: Add `qds-modal`: a modal dialog built on the native `<dialog>` and `showModal()`, with three sizes, opt-in light dismiss, and support for slotted `<form method="dialog">`. Styled by the new `component/modal` token set.
13
+ - 6cb64b1: Add `qds-progress-bar`: determinate and indeterminate progress in four variants, announced with the progressbar role and pulsing instead of sliding under reduced motion. Styled by the new `component/progress-bar` token set.
14
+ - ae223c6: Add `qds-radio-group` and `qds-radio`: a form-associated radio group with roving-tabindex arrow-key navigation, required validation, and block or inline layout, styled by the new `component/radio` token set.
15
+ - afc271a: Add `qds-tabs`, `qds-tab`, and `qds-tab-panel`: tabs following the ARIA tabs pattern with automatic activation, roving tabindex, RTL-aware arrow keys, and disabled tabs. Styled by the new `component/tabs` token set.
16
+ - 06555a5: Add `qds-text-field`: a complete form-associated text field with a visible label, hint, and error message wired to the input, showing native validation messages once the user leaves the field. Styled by the new `component/text-field` token set.
17
+ - cc1def3: Add `qds-toggle`: a form-associated on/off switch, announced with the switch role, styled by the new `component/toggle` token set.
18
+ - 7e3368b: Add a selectable mode to `qds-chip` for filter chips: the chip becomes a toggle button with `aria-pressed`, shows a check mark while `selected`, fires `qds-change`, and supports `disabled`. Styled by new `chip.selectable` and `chip.selected` tokens.
19
+ - 5027635: Add `color.black.5` through `color.black.60`, black at those opacity percentages, and use them for `elevation.subtle` and `elevation.default` in both modes. Shadows are now translucent rather than solid gray, so they soften in light mode and stay visible in dark mode.
20
+ - f99af90: Add `size` and `opacity` primitive categories: `size.sm` through `size.xl` for container widths, which outgrow the spacing scale, and `opacity.0` through `opacity.100`. The modal's widths and backdrop opacity now reference them instead of holding raw values.
21
+ - 6c5499c: Add `color.content.inverse` for content on a filled surface: button labels on primary and danger buttons, checkbox check marks, radio dots, and toggle thumbs. It is light in light mode and dark in dark mode. Previously these used `neutral.50` in both modes, which fell to 3.5:1 on the lighter filled colors of dark mode; they now reach at least 4.6:1 in both modes.
22
+ - 822aa9e: Add three semantic roles and status border colors.
23
+
24
+ - `error` is a status role alongside `info`, `success`, and `warning`: `color.background.error` (a tint), `color.content.error`, and `color.border.error`. `danger` stays the action role for destructive buttons.
25
+ - `color.border.control` is the boundary of an interactive control and reaches 3:1 against the page. Inputs, text fields, unchecked checkboxes and radios, and the off toggle track use it.
26
+ - `color.background.raised` is the surface of something elevated. It lightens in dark mode, where a shadow cannot be seen; elevated cards and the modal use it.
27
+ - `color.border.info`, `success`, `warning`, and `error` reach 3:1 against the page, and also color progress bar fills — so the warning bar is amber rather than brown.
28
+
29
+ **Breaking:** the `danger` variant of `qds-chip` and `qds-progress-bar` is renamed `error`, since both show a status rather than a destructive action. The error chip is now tinted like the other statuses instead of outlined.
30
+
31
+ ## 0.1.0
32
+
33
+ ### Minor Changes
34
+
35
+ - First publishable release.
36
+
37
+ - Ships no runtime dependencies. Style Dictionary and the Tokens Studio transforms were declared as dependencies, so installing the package pulled in 114 packages; they are build tools and now install only for development.
38
+ - `require()` works on Node versions that support requiring ES modules, via a `default` export condition.
39
+ - TypeScript types resolve with `moduleResolution: "node"` as well as `bundler` and `node16`.
40
+ - `@quieto/design-tokens/nomenclature` now has type declarations.
41
+ - Removed the `engines` constraint; the published files do not need Node 22.
42
+ - Added a README covering setup, light and dark mode, and which tier to use.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dillon Schultz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,139 @@
1
- # Temporary Holding Version
1
+ # @quieto/design-tokens
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Design tokens for the Quieto Design System, shipped as CSS custom properties and a typed
4
+ JavaScript manifest. Light and dark modes are included.
5
+
6
+ ```bash
7
+ npm install @quieto/design-tokens
8
+ ```
9
+
10
+ ## Use the CSS
11
+
12
+ Load the stylesheet **once**, at the top of your app:
13
+
14
+ ```js
15
+ // From JavaScript, in any bundler (Vite, webpack, Next.js, …)
16
+ import '@quieto/design-tokens/css';
17
+ ```
18
+
19
+ ```css
20
+ /* Or from a stylesheet, if your bundler resolves @import from node_modules */
21
+ @import '@quieto/design-tokens/css';
22
+ ```
23
+
24
+ Then use the variables:
25
+
26
+ ```css
27
+ .card {
28
+ color: var(--qds-semantic-color-content-default);
29
+ background: var(--qds-semantic-color-background-subtle);
30
+ border-radius: var(--qds-semantic-radius-primary);
31
+ padding: var(--qds-spacing-400);
32
+ box-shadow: var(--qds-semantic-elevation-default);
33
+ }
34
+ ```
35
+
36
+ Custom properties inherit, including into shadow DOM, so one stylesheet on the document styles
37
+ everything below it.
38
+
39
+ ## Light and dark mode
40
+
41
+ `@quieto/design-tokens/css` contains both modes. With no attribute set, it follows the operating
42
+ system's `prefers-color-scheme`. Set `data-theme` on `<html>` to override it:
43
+
44
+ | Markup | Result |
45
+ | --- | --- |
46
+ | `<html>` | Follows the OS setting |
47
+ | `<html data-theme="dark">` | Dark, whatever the OS says |
48
+ | `<html data-theme="light">` | Light, whatever the OS says |
49
+
50
+ > **Set `data-theme` on `<html>` only.** A nested element such as `<section data-theme="dark">`
51
+ > gets dark *semantic* tokens but light *component* tokens, so its components render in the wrong
52
+ > mode. Component tokens reference semantic tokens, and a reference is resolved on the element
53
+ > where the variable is declared — `:root` — not where it is used. Scoped theming for a section of
54
+ > a page is not supported yet.
55
+
56
+ If your product ships only one mode, import that file instead. Each one is complete on its own:
57
+
58
+ ```js
59
+ import '@quieto/design-tokens/css/light';
60
+ // or
61
+ import '@quieto/design-tokens/css/dark';
62
+ ```
63
+
64
+ ## Which tokens to use
65
+
66
+ Every variable belongs to one of three tiers, and each tier references only the tier below it.
67
+
68
+ | Tier | Example | Use it for |
69
+ | --- | --- | --- |
70
+ | Primitive | `--qds-color-blue-600` | Raw values. Rarely used directly — they do not change with the theme. |
71
+ | Semantic | `--qds-semantic-color-background-primary-rest` | **Product code.** These carry meaning and switch with the theme. |
72
+ | Component | `--qds-component-button-primary-color-background-rest` | Restyling a QDS component. Override the variable instead of writing new CSS. |
73
+
74
+ Reach for a **semantic** token first. A primitive like `--qds-color-blue-600` stays blue in dark
75
+ mode; `--qds-semantic-color-background-primary-rest` switches correctly.
76
+
77
+ Names follow a grammar — `{prefix}-{tier}-{category}-{property}-{role}-{state}` for semantic
78
+ tokens — which is checked at build time. The full specification, with every allowed category,
79
+ role and state, is in
80
+ [`docs/nomenclature.md`](https://github.com/dillonschultz93/qds/blob/main/packages/design-tokens/docs/nomenclature.md).
81
+
82
+ ## Use the tokens from JavaScript
83
+
84
+ ```js
85
+ import { tokens, byName, cssVar } from '@quieto/design-tokens';
86
+
87
+ const primary = byName['qds-semantic-color-background-primary-rest'];
88
+ primary.modes.light; // '#2563eb'
89
+ primary.modes.dark; // '#3b82f6'
90
+ primary.referenceNames.light; // ['qds-color-blue-600']
91
+
92
+ cssVar(primary.name); // 'var(--qds-semantic-color-background-primary-rest)'
93
+ ```
94
+
95
+ Each token has `name`, `path`, `type`, `tier`, `set`, `description`, its resolved value in each
96
+ mode (`modes`), what it references (`references`, `referenceNames`), and `modeInvariant`. Types
97
+ are included.
98
+
99
+ The manifest is a single 294 kB module, and importing anything from it includes all of it. If you
100
+ only need the CSS variables, you don't need to import JavaScript at all.
101
+
102
+ ## Everything the package exports
103
+
104
+ | Import | Contents |
105
+ | --- | --- |
106
+ | `@quieto/design-tokens` | Typed token manifest: `tokens`, `byName`, `cssVar` |
107
+ | `@quieto/design-tokens/css` | All tokens, light and dark |
108
+ | `@quieto/design-tokens/css/light` | All tokens, light only |
109
+ | `@quieto/design-tokens/css/dark` | All tokens, dark only |
110
+ | `@quieto/design-tokens/nomenclature` | The naming grammar's vocabularies, as data |
111
+ | `@quieto/design-tokens/tokens.json` | The Tokens Studio source file. References are **unresolved** (`{color.blue.600}`); for tooling, not runtime use. |
112
+
113
+ ## Fonts are not included
114
+
115
+ The type tokens name these families but do not load them:
116
+
117
+ - `--qds-typography-font-family-sans`: Inter, then `system-ui`
118
+ - `--qds-typography-font-family-mono`: JetBrains Mono, then `ui-monospace`
119
+
120
+ Load Inter and JetBrains Mono yourself, or accept the system fallbacks.
121
+
122
+ ## Compatibility
123
+
124
+ - **Modules:** ES modules. `require()` also works on Node versions that can require ES modules
125
+ (20.19 and later, 22.12 and later).
126
+ - **TypeScript:** types resolve with `moduleResolution` set to `bundler`, `node16`, or `node`.
127
+ - **No runtime dependencies.**
128
+
129
+ ## Versioning
130
+
131
+ This package is pre-1.0, so **token names can change in any minor release.** On `0.x`, npm's
132
+ caret range does not cross a minor version: `^0.1.0` installs `0.1.x` but never `0.2.0`, so a
133
+ rename will not reach you without an explicit upgrade. The
134
+ [changelog](https://github.com/dillonschultz93/qds/blob/main/packages/design-tokens/CHANGELOG.md)
135
+ lists every rename.
136
+
137
+ ## License
138
+
139
+ MIT