@graftwork/tokens 0.0.0-stage → 1.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/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/dist/css/tailwind-theme.css +83 -0
- package/dist/css/tokens.css +285 -0
- package/dist/js/tokens.d.ts +93 -0
- package/dist/js/tokens.js +273 -0
- package/package.json +53 -3
- package/tokens/primitives/color.tokens.json +654 -0
- package/tokens/primitives/scale.tokens.json +273 -0
- package/tokens/semantic/base.tokens.json +214 -0
- package/tokens/semantic/color.dark.tokens.json +502 -0
- package/tokens/semantic/color.high-contrast.tokens.json +502 -0
- package/tokens/semantic/color.light.tokens.json +502 -0
- package/README.md +0 -3
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
// Generated by @graftwork/tokens. Do not edit.
|
|
2
|
+
|
|
3
|
+
export const themes = ["light","dark","high-contrast"];
|
|
4
|
+
export const tokens = {
|
|
5
|
+
"light": {
|
|
6
|
+
"color.surface.default": "#ffffff",
|
|
7
|
+
"color.surface.raised": "#ffffff",
|
|
8
|
+
"color.surface.subtle": "#f4f4f4",
|
|
9
|
+
"color.surface.overlay": "#ffffff",
|
|
10
|
+
"color.action.primary.bg": "#0458a1",
|
|
11
|
+
"color.action.primary.bg-hover": "#034580",
|
|
12
|
+
"color.action.secondary.bg": "#ffffff",
|
|
13
|
+
"color.action.secondary.bg-hover": "#f4f4f4",
|
|
14
|
+
"color.action.ghost.bg-hover": "#f4f4f4",
|
|
15
|
+
"color.action.destructive.bg": "#a21a1e",
|
|
16
|
+
"color.action.destructive.bg-hover": "#811316",
|
|
17
|
+
"color.status.success.bg": "#eefbf1",
|
|
18
|
+
"color.status.warning.bg": "#fff5ea",
|
|
19
|
+
"color.status.error.bg": "#fff4f2",
|
|
20
|
+
"color.status.info.bg": "#f1f7ff",
|
|
21
|
+
"color.text.default": "#0a0a0a",
|
|
22
|
+
"color.text.secondary": "#525252",
|
|
23
|
+
"color.text.placeholder": "#525252",
|
|
24
|
+
"color.text.link": "#034580",
|
|
25
|
+
"color.text.on-primary": "#ffffff",
|
|
26
|
+
"color.text.on-destructive": "#ffffff",
|
|
27
|
+
"color.text.success": "#005428",
|
|
28
|
+
"color.text.warning": "#613c00",
|
|
29
|
+
"color.text.error": "#811316",
|
|
30
|
+
"color.text.info": "#034580",
|
|
31
|
+
"color.border.input": "#737373",
|
|
32
|
+
"color.border.input-invalid": "#a21a1e",
|
|
33
|
+
"color.border.default": "#e5e5e5",
|
|
34
|
+
"color.border.status.success": "#8bd5a0",
|
|
35
|
+
"color.border.status.warning": "#ecb573",
|
|
36
|
+
"color.border.status.error": "#ffa69d",
|
|
37
|
+
"color.border.status.info": "#93c5ff",
|
|
38
|
+
"color.icon.default": "#525252",
|
|
39
|
+
"color.icon.brand": "#2883de",
|
|
40
|
+
"color.focus.ring": "#2883de",
|
|
41
|
+
"color.chart.series-1": "#2883de",
|
|
42
|
+
"color.chart.series-2": "#b87600",
|
|
43
|
+
"color.chart.series-3": "#525252",
|
|
44
|
+
"color.chart.series-4": "#008241",
|
|
45
|
+
"color.chart.grid": "#e5e5e5",
|
|
46
|
+
"radius.sm": "4px",
|
|
47
|
+
"radius.md": "6px",
|
|
48
|
+
"radius.lg": "10px",
|
|
49
|
+
"radius.xl": "14px",
|
|
50
|
+
"radius.full": "9999px",
|
|
51
|
+
"space.3xs": "0.125rem",
|
|
52
|
+
"space.2xs": "0.25rem",
|
|
53
|
+
"space.xs": "0.5rem",
|
|
54
|
+
"space.sm": "0.75rem",
|
|
55
|
+
"space.md": "1rem",
|
|
56
|
+
"space.lg": "1.5rem",
|
|
57
|
+
"space.xl": "2rem",
|
|
58
|
+
"space.2xl": "3rem",
|
|
59
|
+
"space.3xl": "4rem",
|
|
60
|
+
"font.family.sans": "\"Noto Sans Variable\", \"Noto Sans\", system-ui, sans-serif",
|
|
61
|
+
"font.family.mono": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
62
|
+
"font.size.xs": "0.75rem",
|
|
63
|
+
"font.size.sm": "0.875rem",
|
|
64
|
+
"font.size.md": "1rem",
|
|
65
|
+
"font.size.lg": "1.125rem",
|
|
66
|
+
"font.size.xl": "1.25rem",
|
|
67
|
+
"font.size.2xl": "1.5rem",
|
|
68
|
+
"font.size.3xl": "1.875rem",
|
|
69
|
+
"font.size.4xl": "2.25rem",
|
|
70
|
+
"font.weight.regular": "400",
|
|
71
|
+
"font.weight.medium": "500",
|
|
72
|
+
"font.weight.semibold": "600",
|
|
73
|
+
"font.weight.bold": "700",
|
|
74
|
+
"font.line-height.body": "1.5",
|
|
75
|
+
"font.line-height.heading": "1.25",
|
|
76
|
+
"font.line-height.ui": "1.35",
|
|
77
|
+
"paragraph-spacing.body": "2.25rem",
|
|
78
|
+
"focus.ring-width": "2px",
|
|
79
|
+
"focus.ring-offset": "2px",
|
|
80
|
+
"target.min": "2.75rem",
|
|
81
|
+
"target.compact": "1.5rem",
|
|
82
|
+
"scroll-padding.top": "4.5rem",
|
|
83
|
+
"scroll-padding.bottom": "4rem",
|
|
84
|
+
"motion.duration.fast": "100ms",
|
|
85
|
+
"motion.duration.normal": "200ms",
|
|
86
|
+
"motion.duration.slow": "300ms",
|
|
87
|
+
"motion.duration.fade": "150ms",
|
|
88
|
+
"breakpoint.sm": "40rem",
|
|
89
|
+
"breakpoint.md": "48rem",
|
|
90
|
+
"breakpoint.lg": "64rem",
|
|
91
|
+
"breakpoint.xl": "80rem"
|
|
92
|
+
},
|
|
93
|
+
"dark": {
|
|
94
|
+
"color.surface.default": "#0a0a0a",
|
|
95
|
+
"color.surface.raised": "#171717",
|
|
96
|
+
"color.surface.subtle": "#1e1e1e",
|
|
97
|
+
"color.surface.overlay": "#171717",
|
|
98
|
+
"color.action.primary.bg": "#5ca8fc",
|
|
99
|
+
"color.action.primary.bg-hover": "#93c5ff",
|
|
100
|
+
"color.action.secondary.bg": "#171717",
|
|
101
|
+
"color.action.secondary.bg-hover": "#1e1e1e",
|
|
102
|
+
"color.action.ghost.bg-hover": "#1e1e1e",
|
|
103
|
+
"color.action.destructive.bg": "#ff7269",
|
|
104
|
+
"color.action.destructive.bg-hover": "#ffa69d",
|
|
105
|
+
"color.status.success.bg": "#002a11",
|
|
106
|
+
"color.status.warning.bg": "#311c00",
|
|
107
|
+
"color.status.error.bg": "#460104",
|
|
108
|
+
"color.status.info.bg": "#002244",
|
|
109
|
+
"color.text.default": "#fafafa",
|
|
110
|
+
"color.text.secondary": "#d4d4d4",
|
|
111
|
+
"color.text.placeholder": "#d4d4d4",
|
|
112
|
+
"color.text.link": "#93c5ff",
|
|
113
|
+
"color.text.on-primary": "#0a0a0a",
|
|
114
|
+
"color.text.on-destructive": "#0a0a0a",
|
|
115
|
+
"color.text.success": "#8bd5a0",
|
|
116
|
+
"color.text.warning": "#ecb573",
|
|
117
|
+
"color.text.error": "#ffa69d",
|
|
118
|
+
"color.text.info": "#93c5ff",
|
|
119
|
+
"color.border.input": "#737373",
|
|
120
|
+
"color.border.input-invalid": "#ff7269",
|
|
121
|
+
"color.border.default": "#262626",
|
|
122
|
+
"color.border.status.success": "#006a34",
|
|
123
|
+
"color.border.status.warning": "#7a4d00",
|
|
124
|
+
"color.border.status.error": "#a21a1e",
|
|
125
|
+
"color.border.status.info": "#0458a1",
|
|
126
|
+
"color.icon.default": "#a1a1a1",
|
|
127
|
+
"color.icon.brand": "#2883de",
|
|
128
|
+
"color.focus.ring": "#5ca8fc",
|
|
129
|
+
"color.chart.series-1": "#5ca8fc",
|
|
130
|
+
"color.chart.series-2": "#d99435",
|
|
131
|
+
"color.chart.series-3": "#a1a1a1",
|
|
132
|
+
"color.chart.series-4": "#59bd7a",
|
|
133
|
+
"color.chart.grid": "#262626",
|
|
134
|
+
"radius.sm": "4px",
|
|
135
|
+
"radius.md": "6px",
|
|
136
|
+
"radius.lg": "10px",
|
|
137
|
+
"radius.xl": "14px",
|
|
138
|
+
"radius.full": "9999px",
|
|
139
|
+
"space.3xs": "0.125rem",
|
|
140
|
+
"space.2xs": "0.25rem",
|
|
141
|
+
"space.xs": "0.5rem",
|
|
142
|
+
"space.sm": "0.75rem",
|
|
143
|
+
"space.md": "1rem",
|
|
144
|
+
"space.lg": "1.5rem",
|
|
145
|
+
"space.xl": "2rem",
|
|
146
|
+
"space.2xl": "3rem",
|
|
147
|
+
"space.3xl": "4rem",
|
|
148
|
+
"font.family.sans": "\"Noto Sans Variable\", \"Noto Sans\", system-ui, sans-serif",
|
|
149
|
+
"font.family.mono": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
150
|
+
"font.size.xs": "0.75rem",
|
|
151
|
+
"font.size.sm": "0.875rem",
|
|
152
|
+
"font.size.md": "1rem",
|
|
153
|
+
"font.size.lg": "1.125rem",
|
|
154
|
+
"font.size.xl": "1.25rem",
|
|
155
|
+
"font.size.2xl": "1.5rem",
|
|
156
|
+
"font.size.3xl": "1.875rem",
|
|
157
|
+
"font.size.4xl": "2.25rem",
|
|
158
|
+
"font.weight.regular": "400",
|
|
159
|
+
"font.weight.medium": "500",
|
|
160
|
+
"font.weight.semibold": "600",
|
|
161
|
+
"font.weight.bold": "700",
|
|
162
|
+
"font.line-height.body": "1.5",
|
|
163
|
+
"font.line-height.heading": "1.25",
|
|
164
|
+
"font.line-height.ui": "1.35",
|
|
165
|
+
"paragraph-spacing.body": "2.25rem",
|
|
166
|
+
"focus.ring-width": "2px",
|
|
167
|
+
"focus.ring-offset": "2px",
|
|
168
|
+
"target.min": "2.75rem",
|
|
169
|
+
"target.compact": "1.5rem",
|
|
170
|
+
"scroll-padding.top": "4.5rem",
|
|
171
|
+
"scroll-padding.bottom": "4rem",
|
|
172
|
+
"motion.duration.fast": "100ms",
|
|
173
|
+
"motion.duration.normal": "200ms",
|
|
174
|
+
"motion.duration.slow": "300ms",
|
|
175
|
+
"motion.duration.fade": "150ms",
|
|
176
|
+
"breakpoint.sm": "40rem",
|
|
177
|
+
"breakpoint.md": "48rem",
|
|
178
|
+
"breakpoint.lg": "64rem",
|
|
179
|
+
"breakpoint.xl": "80rem"
|
|
180
|
+
},
|
|
181
|
+
"high-contrast": {
|
|
182
|
+
"color.surface.default": "#ffffff",
|
|
183
|
+
"color.surface.raised": "#ffffff",
|
|
184
|
+
"color.surface.subtle": "#fafafa",
|
|
185
|
+
"color.surface.overlay": "#ffffff",
|
|
186
|
+
"color.action.primary.bg": "#003362",
|
|
187
|
+
"color.action.primary.bg-hover": "#002244",
|
|
188
|
+
"color.action.secondary.bg": "#ffffff",
|
|
189
|
+
"color.action.secondary.bg-hover": "#f4f4f4",
|
|
190
|
+
"color.action.ghost.bg-hover": "#f4f4f4",
|
|
191
|
+
"color.action.destructive.bg": "#811316",
|
|
192
|
+
"color.action.destructive.bg-hover": "#620a0d",
|
|
193
|
+
"color.status.success.bg": "#eefbf1",
|
|
194
|
+
"color.status.warning.bg": "#fff5ea",
|
|
195
|
+
"color.status.error.bg": "#fff4f2",
|
|
196
|
+
"color.status.info.bg": "#f1f7ff",
|
|
197
|
+
"color.text.default": "#000000",
|
|
198
|
+
"color.text.secondary": "#262626",
|
|
199
|
+
"color.text.placeholder": "#262626",
|
|
200
|
+
"color.text.link": "#003362",
|
|
201
|
+
"color.text.on-primary": "#ffffff",
|
|
202
|
+
"color.text.on-destructive": "#ffffff",
|
|
203
|
+
"color.text.success": "#003e1c",
|
|
204
|
+
"color.text.warning": "#482c00",
|
|
205
|
+
"color.text.error": "#620a0d",
|
|
206
|
+
"color.text.info": "#003362",
|
|
207
|
+
"color.border.input": "#0a0a0a",
|
|
208
|
+
"color.border.input-invalid": "#620a0d",
|
|
209
|
+
"color.border.default": "#404040",
|
|
210
|
+
"color.border.status.success": "#005428",
|
|
211
|
+
"color.border.status.warning": "#613c00",
|
|
212
|
+
"color.border.status.error": "#811316",
|
|
213
|
+
"color.border.status.info": "#034580",
|
|
214
|
+
"color.icon.default": "#171717",
|
|
215
|
+
"color.icon.brand": "#0458a1",
|
|
216
|
+
"color.focus.ring": "#000000",
|
|
217
|
+
"color.chart.series-1": "#0458a1",
|
|
218
|
+
"color.chart.series-2": "#7a4d00",
|
|
219
|
+
"color.chart.series-3": "#262626",
|
|
220
|
+
"color.chart.series-4": "#005428",
|
|
221
|
+
"color.chart.grid": "#d4d4d4",
|
|
222
|
+
"radius.sm": "4px",
|
|
223
|
+
"radius.md": "6px",
|
|
224
|
+
"radius.lg": "10px",
|
|
225
|
+
"radius.xl": "14px",
|
|
226
|
+
"radius.full": "9999px",
|
|
227
|
+
"space.3xs": "0.125rem",
|
|
228
|
+
"space.2xs": "0.25rem",
|
|
229
|
+
"space.xs": "0.5rem",
|
|
230
|
+
"space.sm": "0.75rem",
|
|
231
|
+
"space.md": "1rem",
|
|
232
|
+
"space.lg": "1.5rem",
|
|
233
|
+
"space.xl": "2rem",
|
|
234
|
+
"space.2xl": "3rem",
|
|
235
|
+
"space.3xl": "4rem",
|
|
236
|
+
"font.family.sans": "\"Noto Sans Variable\", \"Noto Sans\", system-ui, sans-serif",
|
|
237
|
+
"font.family.mono": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
238
|
+
"font.size.xs": "0.75rem",
|
|
239
|
+
"font.size.sm": "0.875rem",
|
|
240
|
+
"font.size.md": "1rem",
|
|
241
|
+
"font.size.lg": "1.125rem",
|
|
242
|
+
"font.size.xl": "1.25rem",
|
|
243
|
+
"font.size.2xl": "1.5rem",
|
|
244
|
+
"font.size.3xl": "1.875rem",
|
|
245
|
+
"font.size.4xl": "2.25rem",
|
|
246
|
+
"font.weight.regular": "400",
|
|
247
|
+
"font.weight.medium": "500",
|
|
248
|
+
"font.weight.semibold": "600",
|
|
249
|
+
"font.weight.bold": "700",
|
|
250
|
+
"font.line-height.body": "1.5",
|
|
251
|
+
"font.line-height.heading": "1.25",
|
|
252
|
+
"font.line-height.ui": "1.35",
|
|
253
|
+
"paragraph-spacing.body": "2.25rem",
|
|
254
|
+
"focus.ring-width": "2px",
|
|
255
|
+
"focus.ring-offset": "2px",
|
|
256
|
+
"target.min": "2.75rem",
|
|
257
|
+
"target.compact": "1.5rem",
|
|
258
|
+
"scroll-padding.top": "4.5rem",
|
|
259
|
+
"scroll-padding.bottom": "4rem",
|
|
260
|
+
"motion.duration.fast": "100ms",
|
|
261
|
+
"motion.duration.normal": "200ms",
|
|
262
|
+
"motion.duration.slow": "300ms",
|
|
263
|
+
"motion.duration.fade": "150ms",
|
|
264
|
+
"breakpoint.sm": "40rem",
|
|
265
|
+
"breakpoint.md": "48rem",
|
|
266
|
+
"breakpoint.lg": "64rem",
|
|
267
|
+
"breakpoint.xl": "80rem"
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
/** The CSS custom property for a token path, e.g. cssVar("color.text.default"). */
|
|
271
|
+
export function cssVar(path) {
|
|
272
|
+
return `var(--gw-${path.replaceAll(".", "-")})`;
|
|
273
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graftwork/tokens",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Graftwork design tokens: CSS variables, a Tailwind v4 theme and JS constants",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://graftwork-studio.github.io/design-system/",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/graftwork-studio/design-system/issues"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"design-tokens",
|
|
12
|
+
"dtcg",
|
|
13
|
+
"tailwindcss",
|
|
14
|
+
"accessibility"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/graftwork-studio/design-system.git",
|
|
20
|
+
"directory": "packages/tokens"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"dist",
|
|
26
|
+
"tokens"
|
|
27
|
+
],
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/js/tokens.d.ts",
|
|
31
|
+
"default": "./dist/js/tokens.js"
|
|
32
|
+
},
|
|
33
|
+
"./css": "./dist/css/tokens.css",
|
|
34
|
+
"./tailwind.css": "./dist/css/tailwind-theme.css",
|
|
35
|
+
"./tokens/*": "./tokens/*"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/culori": "4.0.1",
|
|
39
|
+
"@types/node": "26.6.6",
|
|
40
|
+
"culori": "4.0.2",
|
|
41
|
+
"style-dictionary": "5.8.0",
|
|
42
|
+
"typescript": "6.0.3",
|
|
43
|
+
"vitest": "5.1.1"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"provenance": true
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"palette": "node scripts/generate-palette.ts",
|
|
51
|
+
"build": "node scripts/build.ts",
|
|
52
|
+
"validate": "node scripts/validate-contrast.ts",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
55
|
+
}
|
|
6
56
|
}
|