@filipgutica/design-system 1.0.0 → 2.0.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/README.md +20 -8
- package/dist/class/base.css +188 -0
- package/dist/class/themes/graphite-indigo.css +133 -0
- package/dist/themes/graphite-indigo.css +9 -0
- package/dist/tokens.d.ts +117 -0
- package/dist/tokens.js +222 -0
- package/dist/tokens.json +218 -0
- package/fonts/OFL-IBM-Plex-Mono.txt +93 -0
- package/fonts/OFL-IBM-Plex-Sans.txt +93 -0
- package/fonts/fonts.css +55 -0
- package/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/language/DESIGN.md +29 -29
- package/language/components.html +189 -189
- package/language/components.md +55 -55
- package/language/decisions.md +96 -18
- package/language/docs.html +20 -20
- package/language/product.html +22 -22
- package/language/reference.html +213 -213
- package/language/tokens.css +142 -143
- package/language/visualizations/build-count-report.mjs +4 -2
- package/language/visualizations/report.css +2 -2
- package/package.json +33 -6
- package/scripts/build-tokens.mjs +0 -236
- package/tokens/graphite-indigo.json +0 -298
- /package/language/{themes → editor-themes}/graphite-indigo/LICENSE +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/README.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/SOURCE.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/THIRD_PARTY_NOTICES.md +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/graphite-indigo.t3-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/package.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-dark-color-theme.json +0 -0
- /package/language/{themes → editor-themes}/graphite-indigo/themes/graphite-indigo-light-color-theme.json +0 -0
package/language/tokens.css
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Design language tokens
|
|
3
|
-
*
|
|
4
|
-
* themes/graphite-indigo.json and run `pnpm themes:build`); the control, field, nav,
|
|
5
|
-
* button, and command roles come from its src/theme.css. Values live there.
|
|
2
|
+
* Design language tokens. Generated from tokens/graphite-indigo.json by scripts/build-tokens.mjs in
|
|
3
|
+
* @filipgutica/design-system: edit the JSON and run `pnpm tokens:build`. Do not edit this file.
|
|
6
4
|
* DESIGN.md names these tokens; it never repeats their values.
|
|
7
5
|
*
|
|
8
6
|
* Two layers. The identity block at the top of :root is the project's own: its hue
|
|
9
7
|
* pair and fonts. A new project keeps this file unchanged and sets those lines on
|
|
10
8
|
* :root in its own stylesheet, loaded after this one. The dark blocks switch
|
|
11
|
-
* --project to --project-dark, so the override needs no dark rule. Check
|
|
12
|
-
* --accent-text at 4.5:1 on the new hue and override it too when it falls short.
|
|
9
|
+
* --color-project to --color-project-dark, so the override needs no dark rule. Check
|
|
10
|
+
* --color-accent-text at 4.5:1 on the new hue and override it too when it falls short.
|
|
13
11
|
* The terminal plate tokens also belong to the identity layer; every other line is core.
|
|
14
12
|
*
|
|
15
13
|
* Standalone HTML: import or inline this file.
|
|
16
14
|
* Inline visuals: inherit the host font and theme variables; see DESIGN.md.
|
|
17
15
|
* Repos: map these names onto the repository's own token system.
|
|
18
|
-
* Sites on @filipgutica/ui:
|
|
19
|
-
*
|
|
16
|
+
* Sites on @filipgutica/ui: the names are the same. Each line's "ui:" comment lists the ui
|
|
17
|
+
* variables that carry its value, its own name first; the others are component roles with the same
|
|
18
|
+
* value. A var(…) comment is a fallback ui writes where it reads the role. ui's build reads these comments.
|
|
20
19
|
*
|
|
21
20
|
* Theme states: bare :root is light. prefers-color-scheme picks dark unless
|
|
22
21
|
* data-theme="light" is set. data-theme="dark" forces dark.
|
|
@@ -25,82 +24,83 @@
|
|
|
25
24
|
:root {
|
|
26
25
|
color-scheme: light;
|
|
27
26
|
|
|
28
|
-
/* Identity layer: a project swaps these four lines. --project is the light-theme hue;
|
|
29
|
-
--project-dark is the dark-theme hue, also used on dark plates in both themes. */
|
|
30
|
-
--project: #4b45d1; /* ui: --color-project */
|
|
31
|
-
--project-dark: #a5a1ff; /* ui: --color-project-dark */
|
|
32
|
-
--font-
|
|
27
|
+
/* Identity layer: a project swaps these four lines. --color-project is the light-theme hue;
|
|
28
|
+
--color-project-dark is the dark-theme hue, also used on dark plates in both themes. */
|
|
29
|
+
--color-project: #4b45d1; /* ui: --color-project */
|
|
30
|
+
--color-project-dark: #a5a1ff; /* ui: --color-project-dark */
|
|
31
|
+
--font-ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; /* ui: --font-ui */
|
|
33
32
|
--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; /* ui: --font-mono */
|
|
34
33
|
|
|
35
34
|
/* Core roles: only the identity lines above feed them. Neutral paper and graphite surfaces. */
|
|
36
|
-
--bg: #f4f5f6; /* ui: --color-bg */
|
|
37
|
-
--surface: #e9ebed; /* ui: --color-surface */
|
|
38
|
-
--surface-raised: #fbfbfc; /* ui: --color-surface-raised, --color-input-bg */
|
|
39
|
-
--surface-
|
|
35
|
+
--color-bg: #f4f5f6; /* ui: --color-bg */
|
|
36
|
+
--color-surface: #e9ebed; /* ui: --color-surface */
|
|
37
|
+
--color-surface-raised: #fbfbfc; /* ui: --color-surface-raised, --color-input-bg */
|
|
38
|
+
--color-surface-muted: #e2e5e8; /* ui: --color-surface-muted */
|
|
40
39
|
/* The well: segmented and switch tracks, pressed buttons, selected radio cards, and disabled fields. */
|
|
41
|
-
--
|
|
42
|
-
/* Fields (input, select, textarea, search): a white fill with a faint edge in light, the sunk well in dark.
|
|
43
|
-
|
|
44
|
-
--field-
|
|
45
|
-
--field-
|
|
46
|
-
--
|
|
40
|
+
--color-well: var(--color-surface-muted); /* ui: --color-well */
|
|
41
|
+
/* Fields (input, select, textarea, search): a white fill with a faint edge in light, the sunk well in dark.
|
|
42
|
+
Dark fields stay sunk in the well. It sits within about 1.01:1 of the canvas, so the edge carries the shape. */
|
|
43
|
+
--color-field-bg: var(--color-surface-raised); /* ui: --color-field-bg */
|
|
44
|
+
--color-field-edge: var(--color-border-subtle); /* ui: --color-field-edge */
|
|
45
|
+
--shadow-field: none; /* ui: --shadow-field */
|
|
46
|
+
--color-control-thumb: var(--color-surface-raised); /* ui: --color-control-thumb */
|
|
47
47
|
/* Selected rows lift and take a faint accent tint, so the selection reads on near-white panels too. */
|
|
48
|
-
--nav-current: color-mix(in srgb, var(--accent) 14%, var(--surface-raised)); /* ui: --color-nav-current */
|
|
49
|
-
/* Text on the current nav row, selected tab, and selected list row: the first of --accent, --text, black, and white
|
|
50
|
-
that reaches 4.5:1 over --nav-current, on the page and on a surface. */
|
|
51
|
-
--nav-current-text: var(--accent); /* ui: var(--color-nav-current-text, var(--color-accent)) */
|
|
52
|
-
/* The selected segmented label: the first of --accent, --text, black, and white that reaches
|
|
48
|
+
--color-nav-current: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface-raised)); /* ui: --color-nav-current */
|
|
49
|
+
/* Text on the current nav row, selected tab, and selected list row: the first of --color-accent, --color-text, black, and white
|
|
50
|
+
that reaches 4.5:1 over --color-nav-current, on the page and on a surface. */
|
|
51
|
+
--color-nav-current-text: var(--color-accent); /* ui: var(--color-nav-current-text, var(--color-accent)) */
|
|
52
|
+
/* The selected segmented label: the first of --color-accent, --color-text, black, and white that reaches
|
|
53
53
|
4.5:1 on the thumb. An icon-only option needs 3:1. */
|
|
54
|
-
--segmented-current-text: var(--accent); /* ui: var(--color-segmented-current-text, var(--color-accent)) */
|
|
55
|
-
--row-hover: #e2e5e8; /* ui: --color-row-hover */
|
|
56
|
-
--row-selected: var(--surface-raised); /* ui: --color-row-selected */
|
|
57
|
-
--border-subtle: #d3d8dd; /* ui: --color-border-subtle */
|
|
58
|
-
--border: #6d747b; /* ui: --color-border, --color-input-border */
|
|
59
|
-
--text: #101315; /* ui: --color-text, --color-input-text, --color-row-selected-text, --color-status-text */
|
|
60
|
-
--
|
|
61
|
-
--overlay: rgb(0 0 0 / 42%); /* ui: --color-overlay */
|
|
54
|
+
--color-segmented-current-text: var(--color-accent); /* ui: var(--color-segmented-current-text, var(--color-accent)) */
|
|
55
|
+
--color-row-hover: #e2e5e8; /* ui: --color-row-hover */
|
|
56
|
+
--color-row-selected: var(--color-surface-raised); /* ui: --color-row-selected */
|
|
57
|
+
--color-border-subtle: #d3d8dd; /* ui: --color-border-subtle */
|
|
58
|
+
--color-border: #6d747b; /* ui: --color-border, --color-input-border */
|
|
59
|
+
--color-text: #101315; /* ui: --color-text, --color-input-text, --color-row-selected-text, --color-status-text */
|
|
60
|
+
--color-muted: #50575e; /* ui: --color-muted, --color-input-placeholder, --color-syntax-operator, --color-syntax-punctuation */
|
|
61
|
+
--color-overlay: rgb(0 0 0 / 42%); /* ui: --color-overlay */
|
|
62
62
|
|
|
63
|
-
/* The hue fills primary actions and marks selection; links keep --link. */
|
|
64
|
-
--accent: var(--project); /* ui: --color-accent, --color-button-bg, --color-progress */
|
|
65
|
-
--accent-text: var(--bg); /* ui: --color-accent-text, --color-button-text */
|
|
66
|
-
--accent-hover: var(--text); /* ui: --color-accent-hover */
|
|
67
|
-
--button-hover: color-mix(in srgb, var(--accent) 85%, var(--text)); /* ui: --color-button-hover */
|
|
68
|
-
--link: #0b5f7c; /* ui: --color-link */
|
|
69
|
-
/* One focus ring for every role: the accent, at 3:1 or more on --bg, --surface, and --surface-raised
|
|
63
|
+
/* The hue fills primary actions and marks selection; links keep --color-link. */
|
|
64
|
+
--color-accent: var(--color-project); /* ui: --color-accent, --color-button-bg, --color-progress */
|
|
65
|
+
--color-accent-text: var(--color-bg); /* ui: --color-accent-text, --color-button-text */
|
|
66
|
+
--color-accent-hover: var(--color-text); /* ui: --color-accent-hover */
|
|
67
|
+
--color-button-hover: color-mix(in srgb, var(--color-accent) 85%, var(--color-text)); /* ui: --color-button-hover */
|
|
68
|
+
--color-link: #0b5f7c; /* ui: --color-link */
|
|
69
|
+
/* One focus ring for every role: the accent, at 3:1 or more on --color-bg, --color-surface, and --color-surface-raised
|
|
70
70
|
in both themes. Fields mark focus with their own accent edge instead; see components.md. */
|
|
71
|
-
--focus: var(--accent); /* ui: --color-focus */
|
|
71
|
+
--color-focus: var(--color-accent); /* ui: --color-focus */
|
|
72
72
|
--focus-width: 2px; /* ui: --focus-width */
|
|
73
73
|
--focus-offset: 3px; /* ui: --focus-offset */
|
|
74
74
|
|
|
75
75
|
/* Status: only for state, never for decoration. */
|
|
76
|
-
--success: #157249; /* ui: --color-success */
|
|
77
|
-
--warning: #86532e; /* ui: --color-warning */
|
|
78
|
-
--
|
|
79
|
-
--info: #175cd3; /* ui: --color-info */
|
|
80
|
-
--success-
|
|
81
|
-
--warning-
|
|
82
|
-
--
|
|
83
|
-
--info-
|
|
76
|
+
--color-success: #157249; /* ui: --color-success */
|
|
77
|
+
--color-warning: #86532e; /* ui: --color-warning */
|
|
78
|
+
--color-error: #bd342b; /* ui: --color-error */
|
|
79
|
+
--color-info: #175cd3; /* ui: --color-info */
|
|
80
|
+
--color-success-surface: #d9e5e1; /* ui: --color-success-surface */
|
|
81
|
+
--color-warning-surface: #e7e2de; /* ui: --color-warning-surface */
|
|
82
|
+
--color-error-surface: #efe4e4; /* ui: --color-error-surface */
|
|
83
|
+
--color-info-surface: #d9e3f2; /* ui: --color-info-surface */
|
|
84
84
|
|
|
85
85
|
/* Identity layer, derived: terminal folio plates. Commands take the hue; captures stay neutral.
|
|
86
86
|
A project without terminal plates leaves these unused. */
|
|
87
|
-
--command-bg: color-mix(in srgb, var(--project) 25%, #101010); /* ui: --color-command-bg */
|
|
88
|
-
--command-border: transparent; /* ui: --color-command-border */
|
|
89
|
-
--terminal: #0a0c0e; /* ui: --color-terminal */
|
|
90
|
-
--terminal-text: #e6e9eb; /* ui: --color-terminal-text */
|
|
91
|
-
--terminal-border: #2a3036; /* ui: --color-terminal-border */
|
|
92
|
-
--terminal-caption: #13171a; /* ui: --color-terminal-caption */
|
|
93
|
-
--terminal-caption-text: #c9d0d6; /* ui: --color-terminal-caption-text */
|
|
87
|
+
--color-command-bg: color-mix(in srgb, var(--color-project) 25%, #101010); /* ui: --color-command-bg */
|
|
88
|
+
--color-command-border: transparent; /* ui: --color-command-border */
|
|
89
|
+
--color-terminal: #0a0c0e; /* ui: --color-terminal */
|
|
90
|
+
--color-terminal-text: #e6e9eb; /* ui: --color-terminal-text */
|
|
91
|
+
--color-terminal-border: #2a3036; /* ui: --color-terminal-border */
|
|
92
|
+
--color-terminal-caption: #13171a; /* ui: --color-terminal-caption */
|
|
93
|
+
--color-terminal-caption-text: #c9d0d6; /* ui: --color-terminal-caption-text */
|
|
94
94
|
/* The terminal capture's header stays dark in both appearances, so its selected tab keeps the dark lift. */
|
|
95
|
-
--
|
|
95
|
+
--shadow-nav-current-dark: 0 1px 2px rgb(0 0 0 / 25%); /* ui: --shadow-nav-current-dark */
|
|
96
96
|
|
|
97
97
|
/* Source code wells */
|
|
98
|
-
--code
|
|
99
|
-
--code-text: var(--text); /* ui: --color-code-text, --color-syntax-variable */
|
|
100
|
-
--
|
|
101
|
-
--
|
|
102
|
-
--
|
|
103
|
-
--
|
|
98
|
+
--color-code: var(--color-surface); /* ui: --color-code */
|
|
99
|
+
--color-code-text: var(--color-text); /* ui: --color-code-text, --color-syntax-variable */
|
|
100
|
+
--color-syntax-keyword: #715b42; /* ui: --color-syntax-keyword, --color-syntax-function, --color-syntax-tag */
|
|
101
|
+
--color-syntax-string: #346347; /* ui: --color-syntax-string */
|
|
102
|
+
--color-syntax-number: #86532e; /* ui: --color-syntax-number, --color-syntax-type, --color-syntax-attribute */
|
|
103
|
+
--color-syntax-comment: #626772; /* ui: --color-syntax-comment */
|
|
104
104
|
|
|
105
105
|
/* Type scale. The identity block names the families. */
|
|
106
106
|
--text-xs: 0.75rem; /* ui: --text-xs */
|
|
@@ -145,9 +145,9 @@
|
|
|
145
145
|
--sidebar: 224px; /* ui: --sidebar */
|
|
146
146
|
|
|
147
147
|
/* Shape */
|
|
148
|
-
--radius-
|
|
149
|
-
--radius-
|
|
150
|
-
--radius-
|
|
148
|
+
--radius-inline: 6px; /* ui: --radius-inline */
|
|
149
|
+
--radius-control: 999px; /* ui: --radius-control */
|
|
150
|
+
--radius-panel: 16px; /* ui: --radius-panel */
|
|
151
151
|
--radius-field: 10px; /* ui: --radius-field */
|
|
152
152
|
--radius-pill: 999px; /* ui: --radius-pill */
|
|
153
153
|
|
|
@@ -156,11 +156,11 @@
|
|
|
156
156
|
--shadow-raise: 0 1px 2px rgb(16 24 40 / 12%), 0 0 0 1px rgb(16 24 40 / 6%); /* ui: --shadow-raise */
|
|
157
157
|
--shadow-surface: 0 1px 2px rgb(16 24 40 / 6%), 0 0 0 1px rgb(16 24 40 / 6%); /* ui: --shadow-surface */
|
|
158
158
|
--shadow-sink: inset 1.2px 1.2px 3.6px rgb(130 142 158 / 35%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 80%); /* ui: --shadow-sink */
|
|
159
|
-
--shadow-
|
|
159
|
+
--shadow-dialog: 0 8px 24px rgb(16 16 24 / 12%), 0 0 0 1px var(--color-border-subtle); /* ui: --shadow-dialog */
|
|
160
160
|
--shadow-nav-current: 0 1px 3px rgb(130 142 158 / 40%); /* ui: --shadow-nav-current */
|
|
161
161
|
/* A focused field's inset line inside its accent or danger edge. It takes each theme's accent and danger. */
|
|
162
|
-
--field-
|
|
163
|
-
--field-
|
|
162
|
+
--shadow-field-focus: inset 0 0 0 2px color-mix(in srgb, var(--color-accent) 18%, transparent); /* ui: --shadow-field-focus */
|
|
163
|
+
--shadow-field-focus-invalid: inset 0 0 0 2px color-mix(in srgb, var(--color-error) 18%, transparent); /* ui: --shadow-field-focus-invalid */
|
|
164
164
|
|
|
165
165
|
/* Motion */
|
|
166
166
|
--duration-fast: 120ms; /* ui: --duration-fast */
|
|
@@ -171,84 +171,83 @@
|
|
|
171
171
|
@media (prefers-color-scheme: dark) {
|
|
172
172
|
:root:not([data-theme="light"]) {
|
|
173
173
|
color-scheme: dark;
|
|
174
|
-
--
|
|
175
|
-
--
|
|
176
|
-
--surface
|
|
177
|
-
--surface-
|
|
178
|
-
--
|
|
179
|
-
|
|
180
|
-
--field-bg: var(--
|
|
181
|
-
--field
|
|
182
|
-
--control-thumb: color-mix(in srgb, var(--surface-raised) 88%, white);
|
|
183
|
-
--nav-current: color-mix(in srgb, var(--accent) 20%, transparent);
|
|
184
|
-
--row-hover: #20262b;
|
|
185
|
-
--border-subtle: #262d33;
|
|
186
|
-
--border: #78818a;
|
|
187
|
-
--text: #e6e9eb;
|
|
188
|
-
--
|
|
189
|
-
--
|
|
190
|
-
--
|
|
191
|
-
--
|
|
192
|
-
--
|
|
193
|
-
--
|
|
194
|
-
--
|
|
195
|
-
--
|
|
196
|
-
--
|
|
197
|
-
--
|
|
198
|
-
--
|
|
199
|
-
--
|
|
200
|
-
--
|
|
201
|
-
--
|
|
202
|
-
--
|
|
203
|
-
--
|
|
204
|
-
--
|
|
205
|
-
--code-comment: #a0a6b1;
|
|
174
|
+
--color-project: var(--color-project-dark);
|
|
175
|
+
--color-bg: #0d1012;
|
|
176
|
+
--color-surface: #13171a;
|
|
177
|
+
--color-surface-raised: #181d21;
|
|
178
|
+
--color-surface-muted: #20262b;
|
|
179
|
+
--color-well: color-mix(in srgb, var(--color-bg) 87.5%, black);
|
|
180
|
+
--color-field-bg: var(--color-well);
|
|
181
|
+
--shadow-field: var(--shadow-sink);
|
|
182
|
+
--color-control-thumb: color-mix(in srgb, var(--color-surface-raised) 88%, white);
|
|
183
|
+
--color-nav-current: color-mix(in srgb, var(--color-accent) 20%, transparent);
|
|
184
|
+
--color-row-hover: #20262b;
|
|
185
|
+
--color-border-subtle: #262d33;
|
|
186
|
+
--color-border: #78818a;
|
|
187
|
+
--color-text: #e6e9eb;
|
|
188
|
+
--color-muted: #9aa3ab;
|
|
189
|
+
--color-overlay: rgb(0 0 0 / 62%);
|
|
190
|
+
--color-link: #67c1df;
|
|
191
|
+
--color-success: #4cc38a;
|
|
192
|
+
--color-warning: #e2a54b;
|
|
193
|
+
--color-error: #f0776c;
|
|
194
|
+
--color-info: #84adff;
|
|
195
|
+
--color-success-surface: #172d25;
|
|
196
|
+
--color-warning-surface: #2f281b;
|
|
197
|
+
--color-error-surface: #312020;
|
|
198
|
+
--color-info-surface: #202938;
|
|
199
|
+
--color-command-bg: color-mix(in srgb, var(--color-project) 16%, black);
|
|
200
|
+
--color-command-border: color-mix(in srgb, var(--color-project) 28%, black);
|
|
201
|
+
--color-syntax-keyword: #d8c2a5;
|
|
202
|
+
--color-syntax-string: #a8bd9c;
|
|
203
|
+
--color-syntax-number: #d5b98c;
|
|
204
|
+
--color-syntax-comment: #a0a6b1;
|
|
206
205
|
--shadow-raise: inset 0 1px 0 rgb(255 255 255 / 7%), 0 1px 2px rgb(0 0 0 / 45%);
|
|
207
206
|
--shadow-surface: 0 0 0 1px rgb(255 255 255 / 6%);
|
|
208
207
|
--shadow-sink: inset 1.2px 1.2px 3.6px rgb(0 0 0 / 55%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 5%);
|
|
209
|
-
--shadow-
|
|
210
|
-
--shadow-nav-current:
|
|
208
|
+
--shadow-dialog: 0 8px 24px rgb(0 0 0 / 45%), 0 0 0 1px var(--color-border-subtle);
|
|
209
|
+
--shadow-nav-current: var(--shadow-nav-current-dark);
|
|
211
210
|
}
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
:root[data-theme="dark"] {
|
|
215
214
|
color-scheme: dark;
|
|
216
|
-
--
|
|
217
|
-
--
|
|
218
|
-
--surface
|
|
219
|
-
--surface-
|
|
220
|
-
--
|
|
221
|
-
--
|
|
222
|
-
--field-
|
|
223
|
-
--
|
|
224
|
-
--
|
|
225
|
-
--
|
|
226
|
-
--
|
|
227
|
-
--border: #
|
|
228
|
-
--
|
|
229
|
-
--text
|
|
230
|
-
--
|
|
231
|
-
--overlay: rgb(0 0 0 / 62%);
|
|
232
|
-
--
|
|
233
|
-
--
|
|
234
|
-
--
|
|
235
|
-
--
|
|
236
|
-
--
|
|
237
|
-
--
|
|
238
|
-
--
|
|
239
|
-
--
|
|
240
|
-
--
|
|
241
|
-
--
|
|
242
|
-
--
|
|
243
|
-
--
|
|
244
|
-
--
|
|
245
|
-
--
|
|
246
|
-
--
|
|
215
|
+
--color-project: var(--color-project-dark);
|
|
216
|
+
--color-bg: #0d1012;
|
|
217
|
+
--color-surface: #13171a;
|
|
218
|
+
--color-surface-raised: #181d21;
|
|
219
|
+
--color-surface-muted: #20262b;
|
|
220
|
+
--color-well: color-mix(in srgb, var(--color-bg) 87.5%, black);
|
|
221
|
+
--color-field-bg: var(--color-well);
|
|
222
|
+
--shadow-field: var(--shadow-sink);
|
|
223
|
+
--color-control-thumb: color-mix(in srgb, var(--color-surface-raised) 88%, white);
|
|
224
|
+
--color-nav-current: color-mix(in srgb, var(--color-accent) 20%, transparent);
|
|
225
|
+
--color-row-hover: #20262b;
|
|
226
|
+
--color-border-subtle: #262d33;
|
|
227
|
+
--color-border: #78818a;
|
|
228
|
+
--color-text: #e6e9eb;
|
|
229
|
+
--color-muted: #9aa3ab;
|
|
230
|
+
--color-overlay: rgb(0 0 0 / 62%);
|
|
231
|
+
--color-link: #67c1df;
|
|
232
|
+
--color-success: #4cc38a;
|
|
233
|
+
--color-warning: #e2a54b;
|
|
234
|
+
--color-error: #f0776c;
|
|
235
|
+
--color-info: #84adff;
|
|
236
|
+
--color-success-surface: #172d25;
|
|
237
|
+
--color-warning-surface: #2f281b;
|
|
238
|
+
--color-error-surface: #312020;
|
|
239
|
+
--color-info-surface: #202938;
|
|
240
|
+
--color-command-bg: color-mix(in srgb, var(--color-project) 16%, black);
|
|
241
|
+
--color-command-border: color-mix(in srgb, var(--color-project) 28%, black);
|
|
242
|
+
--color-syntax-keyword: #d8c2a5;
|
|
243
|
+
--color-syntax-string: #a8bd9c;
|
|
244
|
+
--color-syntax-number: #d5b98c;
|
|
245
|
+
--color-syntax-comment: #a0a6b1;
|
|
247
246
|
--shadow-raise: inset 0 1px 0 rgb(255 255 255 / 7%), 0 1px 2px rgb(0 0 0 / 45%);
|
|
248
247
|
--shadow-surface: 0 0 0 1px rgb(255 255 255 / 6%);
|
|
249
248
|
--shadow-sink: inset 1.2px 1.2px 3.6px rgb(0 0 0 / 55%), inset -1.2px -1.2px 3.6px rgb(255 255 255 / 5%);
|
|
250
|
-
--shadow-
|
|
251
|
-
--shadow-nav-current:
|
|
249
|
+
--shadow-dialog: 0 8px 24px rgb(0 0 0 / 45%), 0 0 0 1px var(--color-border-subtle);
|
|
250
|
+
--shadow-nav-current: var(--shadow-nav-current-dark);
|
|
252
251
|
}
|
|
253
252
|
|
|
254
253
|
/* Minimal base. Component styles live in components.html. The base sits in a layer, so any
|
|
@@ -257,23 +256,23 @@
|
|
|
257
256
|
/* The page's own background and text colour stay outside the layer. A host that wraps the page in
|
|
258
257
|
its own unlayered reset, such as an artifact viewer, would otherwise keep its body colours while
|
|
259
258
|
the tokens switch to dark, leaving token-coloured text on the wrong background. */
|
|
260
|
-
body { background: var(--bg); color: var(--text); }
|
|
259
|
+
body { background: var(--color-bg); color: var(--color-text); }
|
|
261
260
|
@layer base {
|
|
262
261
|
*, *::before, *::after { box-sizing: border-box; }
|
|
263
262
|
[hidden] { display: none !important; }
|
|
264
263
|
body {
|
|
265
264
|
margin: 0;
|
|
266
|
-
font: var(--weight-regular) var(--text-md) / var(--leading) var(--font-
|
|
265
|
+
font: var(--weight-regular) var(--text-md) / var(--leading) var(--font-ui);
|
|
267
266
|
-webkit-font-smoothing: antialiased;
|
|
268
267
|
}
|
|
269
268
|
h1, h2, h3, h4, p { margin: 0; }
|
|
270
269
|
h1, h2, h3, h4 { font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); text-wrap: balance; }
|
|
271
270
|
code, kbd, pre { font-family: var(--font-mono); }
|
|
272
271
|
table, .num { font-variant-numeric: tabular-nums; }
|
|
273
|
-
a { color: var(--link); text-decoration: none; }
|
|
272
|
+
a { color: var(--color-link); text-decoration: none; }
|
|
274
273
|
a:hover { text-decoration: underline; }
|
|
275
274
|
p a, dd a { text-decoration: underline; text-underline-offset: 0.18em; }
|
|
276
|
-
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
|
|
275
|
+
:focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
|
|
277
276
|
@media (prefers-reduced-motion: reduce) {
|
|
278
277
|
*, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
|
|
279
278
|
/* A busy spinner slows instead of stopping, so the busy state stays visible. */
|
|
@@ -134,12 +134,14 @@ export async function renderReport(snapshot, { mode = 'inline', tokens = '' } =
|
|
|
134
134
|
// JSON.parse keeps a category key such as __proto__ as data; an object literal would not.
|
|
135
135
|
const data = JSON.stringify(JSON.stringify(snapshot)).replaceAll('<', '\\u003c')
|
|
136
136
|
const script = `(()=>{const snapshot=JSON.parse(${data}),root=document.getElementById('ov-report'),region=root.querySelector('#ov-region'),windowPicker=root.querySelector('#ov-window');const percent=${formatPercent.toString()},escape=${escapeHtml.toString()},build=${buildView.toString()};windowPicker.value=snapshot.defaultWindow;function update(){const view=build({snapshot,windowKey:windowPicker.value,region:region.value,percent,escape});root.querySelector('#ov-summary').innerHTML=view.summary;root.querySelector('#ov-rows').innerHTML=view.table;root.querySelector('#ov-mobile').innerHTML=view.mobile;root.querySelector('#ov-bars').innerHTML=view.bars;root.querySelector('#ov-caption').textContent=view.caption;root.querySelector('#ov-announcement').textContent=view.announcement;root.querySelector('#ov-reference').textContent=view.reference;}region.addEventListener('change',update);windowPicker.addEventListener('change',update);update();})();`
|
|
137
|
+
// report.css reads the host's variables (--foreground, --border, --font-sans, ...), so a standalone page maps
|
|
138
|
+
// the design language's tokens onto them.
|
|
137
139
|
// Standalone pages own their tokens, so the pickers take the design language's field recipe: the field
|
|
138
140
|
// fill and edge, and on keyboard focus an accent edge with a muted accent line inside instead of a ring.
|
|
139
141
|
// Forced colors drop that line, so the system ring returns there. Inline reports keep the host's look.
|
|
140
|
-
const standalone = mode === 'standalone' ? `${tokens}\n:root{--foreground:var(--text);--muted-foreground:var(--
|
|
142
|
+
const standalone = mode === 'standalone' ? `${tokens}\n:root{--foreground:var(--color-text);--muted-foreground:var(--color-muted);--background:var(--color-bg);--card:var(--color-surface-raised);--destructive:var(--color-error);--primary:var(--color-link);--ring:var(--color-focus);--radius:var(--radius-inline);--border:var(--color-border);--success:var(--color-success);--warning:var(--color-warning);--info:var(--color-info);--font-sans:var(--font-ui)}body{background:var(--color-bg);padding:1.5rem}.ov-report{max-width:1100px;margin-inline:auto}` : ''
|
|
141
143
|
// The field recipe follows report.css, whose own picker rule would otherwise win the cascade.
|
|
142
|
-
const standaloneFields = mode === 'standalone' ? '.ov-controls select{background:var(--field-bg);border-color:var(--field-edge);border-radius:var(--radius-field);box-shadow:var(--field
|
|
144
|
+
const standaloneFields = mode === 'standalone' ? '.ov-controls select{background:var(--color-field-bg);border-color:var(--color-field-edge);border-radius:var(--radius-field);box-shadow:var(--shadow-field)}.ov-controls select:focus-visible{outline:none;border-color:var(--color-accent);box-shadow:var(--shadow-field-focus)}@media (forced-colors:active){.ov-controls select:focus-visible{outline:var(--focus-width) solid Highlight;outline-offset:-1px}}' : ''
|
|
143
145
|
const link = snapshot.source.url ? `<a href="${escapeHtml(snapshot.source.url)}">Source</a> · ` : ''
|
|
144
146
|
const other = snapshot.categories.some((c) => c.key === 'other') ? `<p class="ov-muted">Other = categories outside ${snapshot.categories.filter((c) => c.key !== 'other').map((c) => escapeHtml(c.label)).join(', ')}.</p>` : ''
|
|
145
147
|
return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(snapshot.title)}</title><style>${standalone}\n${css}\n${standaloneFields}</style></head><body><main id="ov-report" class="ov-report">
|
|
@@ -15,7 +15,7 @@ body{margin:0;color:var(--foreground);font:0.8125rem var(--font-sans);font-varia
|
|
|
15
15
|
#ov-bars{display:block;width:100%;height:6px;margin-bottom:0.875rem}
|
|
16
16
|
.ov-table-heading{display:flex;justify-content:space-between;gap:0.75rem;margin-bottom:0.3125rem}.ov-table-heading span{font-size:0.75rem}
|
|
17
17
|
.ov-scroll{overflow-x:auto}.ov-report table{width:100%;border-collapse:collapse;font-size:0.75rem}
|
|
18
|
-
.ov-report th,.ov-report td{padding:0.3125rem 0.375rem;text-align:right;white-space:nowrap;border-bottom:1px solid var(--border-subtle,var(--border));font-weight:400;line-height:1rem}
|
|
18
|
+
.ov-report th,.ov-report td{padding:0.3125rem 0.375rem;text-align:right;white-space:nowrap;border-bottom:1px solid var(--color-border-subtle,var(--border));font-weight:400;line-height:1rem}
|
|
19
19
|
.ov-report th{color:var(--muted-foreground)}.ov-report th:first-child{text-align:left;min-width:170px;padding-left:0;white-space:normal}
|
|
20
20
|
.ov-report tbody th{color:var(--foreground)}.ov-report td:last-child,.ov-report thead th:last-child{padding-right:0}
|
|
21
21
|
.ov-report code{font:0.75rem var(--font-mono);overflow-wrap:normal;white-space:normal}
|
|
@@ -31,7 +31,7 @@ body{margin:0;color:var(--foreground);font:0.8125rem var(--font-sans);font-varia
|
|
|
31
31
|
.ov-mobile{display:none}
|
|
32
32
|
@media(max-width:800px){
|
|
33
33
|
.ov-scroll{display:none}.ov-mobile{display:block}
|
|
34
|
-
.ov-entry{padding:0.75rem 0;border-bottom:1px solid var(--border-subtle,var(--border))}
|
|
34
|
+
.ov-entry{padding:0.75rem 0;border-bottom:1px solid var(--color-border-subtle,var(--border))}
|
|
35
35
|
.ov-entry-heading{display:flex;justify-content:space-between;gap:0.75rem;align-items:baseline}
|
|
36
36
|
.ov-entry-heading code{min-width:0;flex:1;overflow-wrap:anywhere}.ov-entry-heading>span{white-space:nowrap;font-size:0.75rem}
|
|
37
37
|
.ov-entry dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:0.5rem;margin:0.625rem 0 0}
|
package/package.json
CHANGED
|
@@ -1,29 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filipgutica/design-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Filip's design language, tokens, and component catalogue for any framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
8
8
|
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/tokens.d.ts",
|
|
12
|
+
"default": "./dist/tokens.js"
|
|
13
|
+
},
|
|
14
|
+
"./tokens.css": "./language/tokens.css",
|
|
15
|
+
"./class/base.css": "./dist/class/base.css",
|
|
16
|
+
"./class/themes/*.css": "./dist/class/themes/*.css",
|
|
17
|
+
"./themes/*.css": "./dist/themes/*.css",
|
|
18
|
+
"./tokens.json": "./dist/tokens.json",
|
|
19
|
+
"./fonts.css": "./fonts/fonts.css",
|
|
20
|
+
"./fonts/*": "./fonts/*",
|
|
21
|
+
"./language/*": "./language/*",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
9
24
|
"files": [
|
|
10
25
|
"language/",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
26
|
+
"dist/",
|
|
27
|
+
"fonts/"
|
|
13
28
|
],
|
|
14
29
|
"scripts": {
|
|
15
30
|
"prepublishOnly": "pnpm verify",
|
|
16
31
|
"release": "semantic-release",
|
|
17
32
|
"release:dry-run": "semantic-release --dry-run --no-ci",
|
|
33
|
+
"tokens:build": "node scripts/build-tokens.mjs",
|
|
34
|
+
"tokens:check": "node scripts/build-tokens.mjs --check",
|
|
18
35
|
"test": "node --test tests/*.test.mjs",
|
|
19
|
-
"
|
|
36
|
+
"test:react": "tsc -p tests/react-smoke && playwright test -c tests/react-smoke",
|
|
37
|
+
"verify": "pnpm tokens:check && pnpm test && pnpm test:react && pnpm pack --dry-run && publint"
|
|
20
38
|
},
|
|
21
39
|
"engines": {
|
|
22
40
|
"node": ">=22.12"
|
|
23
41
|
},
|
|
24
42
|
"packageManager": "pnpm@11.6.0",
|
|
25
43
|
"publishConfig": {
|
|
26
|
-
"access": "public"
|
|
44
|
+
"access": "public",
|
|
45
|
+
"provenance": true
|
|
27
46
|
},
|
|
28
47
|
"license": "MIT",
|
|
29
48
|
"repository": {
|
|
@@ -37,9 +56,17 @@
|
|
|
37
56
|
"devDependencies": {
|
|
38
57
|
"@commitlint/cli": "^21.2.2",
|
|
39
58
|
"@commitlint/config-conventional": "^21.2.2",
|
|
59
|
+
"@playwright/test": "^1.65.0",
|
|
40
60
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
61
|
+
"@types/react": "^19.3.0",
|
|
62
|
+
"@types/react-dom": "^19.3.0",
|
|
63
|
+
"@vitejs/plugin-react": "^6.2.1",
|
|
41
64
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
42
65
|
"publint": "^0.3.24",
|
|
43
|
-
"
|
|
66
|
+
"react": "^19.3.1",
|
|
67
|
+
"react-dom": "^19.3.1",
|
|
68
|
+
"semantic-release": "^25.0.9",
|
|
69
|
+
"typescript": "^5.9.3",
|
|
70
|
+
"vite": "^8.3.6"
|
|
44
71
|
}
|
|
45
72
|
}
|