@wordpress/theme 0.2.1-next.16d95556a.0 → 0.3.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/bin/terrazzo-plugin-inline-alias-values/index.ts +43 -14
- package/build/color-ramps/index.js +16 -12
- package/build/color-ramps/index.js.map +2 -2
- package/build/color-ramps/lib/color-utils.js +5 -0
- package/build/color-ramps/lib/color-utils.js.map +2 -2
- package/build/color-ramps/lib/constants.js +1 -1
- package/build/color-ramps/lib/constants.js.map +1 -1
- package/build/color-ramps/lib/default-ramps.js +88 -88
- package/build/color-ramps/lib/default-ramps.js.map +1 -1
- package/build/color-ramps/lib/find-color-with-constraints.js +1 -1
- package/build/color-ramps/lib/find-color-with-constraints.js.map +2 -2
- package/build/color-ramps/lib/index.js +2 -2
- package/build/color-ramps/lib/index.js.map +2 -2
- package/build/color-ramps/lib/ramp-configs.js +2 -2
- package/build/color-ramps/lib/ramp-configs.js.map +1 -1
- package/build/color-ramps/lib/utils.js +4 -8
- package/build/color-ramps/lib/utils.js.map +2 -2
- package/build/prebuilt/js/design-tokens.js +5 -4
- package/build/prebuilt/js/design-tokens.js.map +2 -2
- package/build/prebuilt/json/figma.json +75 -59
- package/build/theme-provider.js +3 -1
- package/build/theme-provider.js.map +2 -2
- package/build/types.js.map +1 -1
- package/build-module/color-ramps/index.js +17 -13
- package/build-module/color-ramps/index.js.map +2 -2
- package/build-module/color-ramps/lib/color-utils.js +7 -1
- package/build-module/color-ramps/lib/color-utils.js.map +2 -2
- package/build-module/color-ramps/lib/constants.js +1 -1
- package/build-module/color-ramps/lib/constants.js.map +1 -1
- package/build-module/color-ramps/lib/default-ramps.js +88 -88
- package/build-module/color-ramps/lib/default-ramps.js.map +1 -1
- package/build-module/color-ramps/lib/find-color-with-constraints.js +2 -2
- package/build-module/color-ramps/lib/find-color-with-constraints.js.map +2 -2
- package/build-module/color-ramps/lib/index.js +1 -2
- package/build-module/color-ramps/lib/index.js.map +2 -2
- package/build-module/color-ramps/lib/ramp-configs.js +2 -2
- package/build-module/color-ramps/lib/ramp-configs.js.map +1 -1
- package/build-module/color-ramps/lib/utils.js +0 -3
- package/build-module/color-ramps/lib/utils.js.map +2 -2
- package/build-module/prebuilt/js/design-tokens.js +5 -4
- package/build-module/prebuilt/js/design-tokens.js.map +2 -2
- package/build-module/prebuilt/json/figma.json +75 -59
- package/build-module/theme-provider.js +3 -1
- package/build-module/theme-provider.js.map +2 -2
- package/build-types/color-ramps/index.d.ts +1 -0
- package/build-types/color-ramps/index.d.ts.map +1 -1
- package/build-types/color-ramps/lib/color-utils.d.ts +5 -0
- package/build-types/color-ramps/lib/color-utils.d.ts.map +1 -1
- package/build-types/color-ramps/lib/constants.d.ts +1 -1
- package/build-types/color-ramps/lib/constants.d.ts.map +1 -1
- package/build-types/color-ramps/lib/index.d.ts.map +1 -1
- package/build-types/color-ramps/lib/utils.d.ts +0 -5
- package/build-types/color-ramps/lib/utils.d.ts.map +1 -1
- package/build-types/color-ramps/stories/index.story.d.ts.map +1 -1
- package/build-types/stories/index.story.d.ts +1 -0
- package/build-types/stories/index.story.d.ts.map +1 -1
- package/build-types/theme-provider.d.ts +1 -1
- package/build-types/theme-provider.d.ts.map +1 -1
- package/build-types/types.d.ts +8 -0
- package/build-types/types.d.ts.map +1 -1
- package/docs/ds-tokens.md +8 -7
- package/package.json +4 -4
- package/src/color-ramps/index.ts +16 -11
- package/src/color-ramps/lib/color-utils.ts +11 -0
- package/src/color-ramps/lib/constants.ts +3 -3
- package/src/color-ramps/lib/default-ramps.ts +88 -88
- package/src/color-ramps/lib/find-color-with-constraints.ts +2 -2
- package/src/color-ramps/lib/index.ts +1 -2
- package/src/color-ramps/lib/ramp-configs.ts +2 -2
- package/src/color-ramps/lib/utils.ts +1 -8
- package/src/color-ramps/stories/index.story.tsx +7 -4
- package/src/prebuilt/css/design-tokens.css +81 -55
- package/src/prebuilt/js/design-tokens.js +5 -4
- package/src/prebuilt/json/figma.json +75 -59
- package/src/stories/index.story.tsx +23 -9
- package/src/theme-provider.tsx +2 -0
- package/src/types.ts +9 -0
- package/terrazzo.config.ts +21 -0
- package/tokens/color.json +88 -88
- package/tokens/dimension.json +44 -10
- package/tsconfig.bin.tsbuildinfo +1 -1
- package/tsconfig.src.tsbuildinfo +1 -1
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
},
|
|
51
51
|
"Color/Semantic/Background/Brand/bgSur-brand": {
|
|
52
52
|
"value": {
|
|
53
|
-
".": "#
|
|
53
|
+
".": "#ecf0f9"
|
|
54
54
|
},
|
|
55
55
|
"description": "Background color for surfaces with brand tone and normal emphasis."
|
|
56
56
|
},
|
|
57
57
|
"Color/Semantic/Background/Success/bgSur-success": {
|
|
58
58
|
"value": {
|
|
59
|
-
".": "#
|
|
59
|
+
".": "#cbf5d1"
|
|
60
60
|
},
|
|
61
61
|
"description": "Background color for surfaces with success tone and normal emphasis."
|
|
62
62
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"Color/Semantic/Background/Info/bgSur-info": {
|
|
70
70
|
"value": {
|
|
71
|
-
".": "#
|
|
71
|
+
".": "#dfebf8"
|
|
72
72
|
},
|
|
73
73
|
"description": "Background color for surfaces with info tone and normal emphasis."
|
|
74
74
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"Color/Semantic/Background/Warning/bgSur-warning": {
|
|
82
82
|
"value": {
|
|
83
|
-
".": "#
|
|
83
|
+
".": "#f8e8cc"
|
|
84
84
|
},
|
|
85
85
|
"description": "Background color for surfaces with warning tone and normal emphasis."
|
|
86
86
|
},
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"Color/Semantic/Background/Caution/bgSur-caution": {
|
|
94
94
|
"value": {
|
|
95
|
-
".": "#
|
|
95
|
+
".": "#f7eab3"
|
|
96
96
|
},
|
|
97
97
|
"description": "Background color for surfaces with caution tone and normal emphasis."
|
|
98
98
|
},
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
},
|
|
105
105
|
"Color/Semantic/Background/Error/bgSur-error": {
|
|
106
106
|
"value": {
|
|
107
|
-
".": "#
|
|
107
|
+
".": "#fae4e1"
|
|
108
108
|
},
|
|
109
109
|
"description": "Background color for surfaces with error tone and normal emphasis."
|
|
110
110
|
},
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"Color/Semantic/Background/Neutral/bgInt-neutral-disabled": {
|
|
130
130
|
"value": {
|
|
131
|
-
".": "#
|
|
131
|
+
".": "#e2e2e2"
|
|
132
132
|
},
|
|
133
133
|
"description": "Background color for interactive elements with neutral tone and normal emphasis, in their disabled state."
|
|
134
134
|
},
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
},
|
|
147
147
|
"Color/Semantic/Background/Neutral/bgInt-neutral-strong-disabled": {
|
|
148
148
|
"value": {
|
|
149
|
-
".": "#
|
|
149
|
+
".": "#d2d2d2"
|
|
150
150
|
},
|
|
151
151
|
"description": "Background color for interactive elements with neutral tone and strong emphasis, in their disabled state."
|
|
152
152
|
},
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
},
|
|
165
165
|
"Color/Semantic/Background/Neutral/bgInt-neutral-weak-disabled": {
|
|
166
166
|
"value": {
|
|
167
|
-
".": "#
|
|
167
|
+
".": "#e2e2e2"
|
|
168
168
|
},
|
|
169
169
|
"description": "Background color for interactive elements with neutral tone and weak emphasis, in their disabled state."
|
|
170
170
|
},
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
},
|
|
183
183
|
"Color/Semantic/Background/Brand/bgInt-brand-disabled": {
|
|
184
184
|
"value": {
|
|
185
|
-
".": "#
|
|
185
|
+
".": "#e2e2e2"
|
|
186
186
|
},
|
|
187
187
|
"description": "Background color for interactive elements with brand tone and normal emphasis, in their disabled state."
|
|
188
188
|
},
|
|
@@ -194,13 +194,13 @@
|
|
|
194
194
|
},
|
|
195
195
|
"Color/Semantic/Background/Brand/bgInt-brand-strong-active": {
|
|
196
196
|
"value": {
|
|
197
|
-
".": "#
|
|
197
|
+
".": "#2e49d9"
|
|
198
198
|
},
|
|
199
199
|
"description": "Background color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active."
|
|
200
200
|
},
|
|
201
201
|
"Color/Semantic/Background/Brand/bgInt-brand-strong-disabled": {
|
|
202
202
|
"value": {
|
|
203
|
-
".": "#
|
|
203
|
+
".": "#d2d2d2"
|
|
204
204
|
},
|
|
205
205
|
"description": "Background color for interactive elements with brand tone and strong emphasis, in their disabled state."
|
|
206
206
|
},
|
|
@@ -212,37 +212,37 @@
|
|
|
212
212
|
},
|
|
213
213
|
"Color/Semantic/Background/Brand/bgInt-brand-weak-active": {
|
|
214
214
|
"value": {
|
|
215
|
-
".": "#
|
|
215
|
+
".": "#e4eaf7"
|
|
216
216
|
},
|
|
217
217
|
"description": "Background color for interactive elements with brand tone and weak emphasis that are hovered, focused, or active."
|
|
218
218
|
},
|
|
219
219
|
"Color/Semantic/Background/Brand/bgInt-brand-weak-disabled": {
|
|
220
220
|
"value": {
|
|
221
|
-
".": "#
|
|
221
|
+
".": "#e2e2e2"
|
|
222
222
|
},
|
|
223
223
|
"description": "Background color for interactive elements with brand tone and weak emphasis, in their disabled state."
|
|
224
224
|
},
|
|
225
225
|
"Color/Semantic/Background/Neutral/bgTra-neutral-weak": {
|
|
226
226
|
"value": {
|
|
227
|
-
".": "#
|
|
227
|
+
".": "#e0e0e0"
|
|
228
228
|
},
|
|
229
229
|
"description": "Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track)."
|
|
230
230
|
},
|
|
231
231
|
"Color/Semantic/Background/Neutral/bgTra-neutral": {
|
|
232
232
|
"value": {
|
|
233
|
-
".": "#
|
|
233
|
+
".": "#d8d8d8"
|
|
234
234
|
},
|
|
235
235
|
"description": "Background color for tracks with a neutral tone and normal emphasis (eg. slider or progressbar track)."
|
|
236
236
|
},
|
|
237
237
|
"Color/Semantic/Background/Neutral/bgThu-neutral-weak": {
|
|
238
238
|
"value": {
|
|
239
|
-
".": "#
|
|
239
|
+
".": "#8a8a8a"
|
|
240
240
|
},
|
|
241
241
|
"description": "Background color for thumbs with a neutral tone and weak emphasis (eg. scrollbar thumb)."
|
|
242
242
|
},
|
|
243
243
|
"Color/Semantic/Background/Neutral/bgThu-neutral-weak-active": {
|
|
244
244
|
"value": {
|
|
245
|
-
".": "#
|
|
245
|
+
".": "#6c6c6c"
|
|
246
246
|
},
|
|
247
247
|
"description": "Background color for thumbs with a neutral tone and weak emphasis (eg. scrollbar thumb) that are hovered, focused, or active."
|
|
248
248
|
},
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
},
|
|
261
261
|
"Color/Semantic/Background/Brand/bgThu-brand-disabled": {
|
|
262
262
|
"value": {
|
|
263
|
-
".": "#
|
|
263
|
+
".": "#d8d8d8"
|
|
264
264
|
},
|
|
265
265
|
"description": "Background color for thumbs with a brand tone and normal emphasis (eg. slider thumb and filled track), in their disabled state."
|
|
266
266
|
},
|
|
@@ -272,61 +272,61 @@
|
|
|
272
272
|
},
|
|
273
273
|
"Color/Semantic/Foreground/Neutral/fgCon-neutral-weak": {
|
|
274
274
|
"value": {
|
|
275
|
-
".": "#
|
|
275
|
+
".": "#6d6d6d"
|
|
276
276
|
},
|
|
277
277
|
"description": "Foreground color for content like text with weak emphasis."
|
|
278
278
|
},
|
|
279
279
|
"Color/Semantic/Foreground/Success/fgCon-success": {
|
|
280
280
|
"value": {
|
|
281
|
-
".": "#
|
|
281
|
+
".": "#002900"
|
|
282
282
|
},
|
|
283
283
|
"description": "Foreground color for content like text with success tone and normal emphasis."
|
|
284
284
|
},
|
|
285
285
|
"Color/Semantic/Foreground/Success/fgCon-success-weak": {
|
|
286
286
|
"value": {
|
|
287
|
-
".": "#
|
|
287
|
+
".": "#007f30"
|
|
288
288
|
},
|
|
289
289
|
"description": "Foreground color for content like text with success tone and weak emphasis."
|
|
290
290
|
},
|
|
291
291
|
"Color/Semantic/Foreground/Info/fgCon-info": {
|
|
292
292
|
"value": {
|
|
293
|
-
".": "#
|
|
293
|
+
".": "#001b4f"
|
|
294
294
|
},
|
|
295
295
|
"description": "Foreground color for content like text with info tone and normal emphasis."
|
|
296
296
|
},
|
|
297
297
|
"Color/Semantic/Foreground/Info/fgCon-info-weak": {
|
|
298
298
|
"value": {
|
|
299
|
-
".": "#
|
|
299
|
+
".": "#006bd7"
|
|
300
300
|
},
|
|
301
301
|
"description": "Foreground color for content like text with info tone and weak emphasis."
|
|
302
302
|
},
|
|
303
303
|
"Color/Semantic/Foreground/Warning/fgCon-warning": {
|
|
304
304
|
"value": {
|
|
305
|
-
".": "#
|
|
305
|
+
".": "#2e1900"
|
|
306
306
|
},
|
|
307
307
|
"description": "Foreground color for content like text with warning tone and normal emphasis."
|
|
308
308
|
},
|
|
309
309
|
"Color/Semantic/Foreground/Warning/fgCon-warning-weak": {
|
|
310
310
|
"value": {
|
|
311
|
-
".": "#
|
|
311
|
+
".": "#936400"
|
|
312
312
|
},
|
|
313
313
|
"description": "Foreground color for content like text with warning tone and weak emphasis."
|
|
314
314
|
},
|
|
315
315
|
"Color/Semantic/Foreground/Caution/fgCon-caution": {
|
|
316
316
|
"value": {
|
|
317
|
-
".": "#
|
|
317
|
+
".": "#281d00"
|
|
318
318
|
},
|
|
319
319
|
"description": "Foreground color for content like text with caution tone and normal emphasis."
|
|
320
320
|
},
|
|
321
321
|
"Color/Semantic/Foreground/Caution/fgCon-caution-weak": {
|
|
322
322
|
"value": {
|
|
323
|
-
".": "#
|
|
323
|
+
".": "#836b00"
|
|
324
324
|
},
|
|
325
325
|
"description": "Foreground color for content like text with caution tone and weak emphasis."
|
|
326
326
|
},
|
|
327
327
|
"Color/Semantic/Foreground/Error/fgCon-error": {
|
|
328
328
|
"value": {
|
|
329
|
-
".": "#
|
|
329
|
+
".": "#470000"
|
|
330
330
|
},
|
|
331
331
|
"description": "Foreground color for content like text with error tone and normal emphasis."
|
|
332
332
|
},
|
|
@@ -350,7 +350,7 @@
|
|
|
350
350
|
},
|
|
351
351
|
"Color/Semantic/Foreground/Neutral/fgInt-neutral-disabled": {
|
|
352
352
|
"value": {
|
|
353
|
-
".": "#
|
|
353
|
+
".": "#8a8a8a"
|
|
354
354
|
},
|
|
355
355
|
"description": "Foreground color for interactive elements with neutral tone and normal emphasis, in their disabled state."
|
|
356
356
|
},
|
|
@@ -368,19 +368,19 @@
|
|
|
368
368
|
},
|
|
369
369
|
"Color/Semantic/Foreground/Neutral/fgInt-neutral-strong-disabled": {
|
|
370
370
|
"value": {
|
|
371
|
-
".": "#
|
|
371
|
+
".": "#6d6d6d"
|
|
372
372
|
},
|
|
373
373
|
"description": "Foreground color for interactive elements with neutral tone and strong emphasis, in their disabled state."
|
|
374
374
|
},
|
|
375
375
|
"Color/Semantic/Foreground/Neutral/fgInt-neutral-weak": {
|
|
376
376
|
"value": {
|
|
377
|
-
".": "#
|
|
377
|
+
".": "#6d6d6d"
|
|
378
378
|
},
|
|
379
379
|
"description": "Foreground color for interactive elements with neutral tone and weak emphasis."
|
|
380
380
|
},
|
|
381
381
|
"Color/Semantic/Foreground/Neutral/fgInt-neutral-weak-disabled": {
|
|
382
382
|
"value": {
|
|
383
|
-
".": "#
|
|
383
|
+
".": "#8a8a8a"
|
|
384
384
|
},
|
|
385
385
|
"description": "Foreground color for interactive elements with neutral tone and weak emphasis, in their disabled state."
|
|
386
386
|
},
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
},
|
|
399
399
|
"Color/Semantic/Foreground/Brand/fgInt-brand-disabled": {
|
|
400
400
|
"value": {
|
|
401
|
-
".": "#
|
|
401
|
+
".": "#8a8a8a"
|
|
402
402
|
},
|
|
403
403
|
"description": "Foreground color for interactive elements with brand tone and normal emphasis, in their disabled state."
|
|
404
404
|
},
|
|
@@ -416,31 +416,31 @@
|
|
|
416
416
|
},
|
|
417
417
|
"Color/Semantic/Foreground/Brand/fgInt-brand-strong-disabled": {
|
|
418
418
|
"value": {
|
|
419
|
-
".": "#
|
|
419
|
+
".": "#6d6d6d"
|
|
420
420
|
},
|
|
421
421
|
"description": "Foreground color for interactive elements with brand tone and strong emphasis, in their disabled state."
|
|
422
422
|
},
|
|
423
423
|
"Color/Semantic/Stroke/Neutral/strokeSur-neutral": {
|
|
424
424
|
"value": {
|
|
425
|
-
".": "#
|
|
425
|
+
".": "#d8d8d8"
|
|
426
426
|
},
|
|
427
427
|
"description": "Decorative stroke color used to define neutrally-toned surface boundaries with normal emphasis."
|
|
428
428
|
},
|
|
429
429
|
"Color/Semantic/Stroke/Neutral/strokeSur-neutral-weak": {
|
|
430
430
|
"value": {
|
|
431
|
-
".": "#
|
|
431
|
+
".": "#e0e0e0"
|
|
432
432
|
},
|
|
433
433
|
"description": "Decorative stroke color used to define neutrally-toned surface boundaries with weak emphasis."
|
|
434
434
|
},
|
|
435
435
|
"Color/Semantic/Stroke/Neutral/strokeSur-neutral-strong": {
|
|
436
436
|
"value": {
|
|
437
|
-
".": "#
|
|
437
|
+
".": "#8a8a8a"
|
|
438
438
|
},
|
|
439
439
|
"description": "Decorative stroke color used to define neutrally-toned surface boundaries with strong emphasis."
|
|
440
440
|
},
|
|
441
441
|
"Color/Semantic/Stroke/Brand/strokeSur-brand": {
|
|
442
442
|
"value": {
|
|
443
|
-
".": "#
|
|
443
|
+
".": "#a2b1d6"
|
|
444
444
|
},
|
|
445
445
|
"description": "Decorative stroke color used to define brand-toned surface boundaries with normal emphasis."
|
|
446
446
|
},
|
|
@@ -452,43 +452,43 @@
|
|
|
452
452
|
},
|
|
453
453
|
"Color/Semantic/Stroke/Success/strokeSur-success": {
|
|
454
454
|
"value": {
|
|
455
|
-
".": "#
|
|
455
|
+
".": "#82c98f"
|
|
456
456
|
},
|
|
457
457
|
"description": "Decorative stroke color used to define success-toned surface boundaries with normal emphasis."
|
|
458
458
|
},
|
|
459
459
|
"Color/Semantic/Stroke/Success/strokeSur-success-strong": {
|
|
460
460
|
"value": {
|
|
461
|
-
".": "#
|
|
461
|
+
".": "#007f30"
|
|
462
462
|
},
|
|
463
463
|
"description": "Decorative stroke color used to define success-toned surface boundaries with strong emphasis."
|
|
464
464
|
},
|
|
465
465
|
"Color/Semantic/Stroke/Info/strokeSur-info": {
|
|
466
466
|
"value": {
|
|
467
|
-
".": "#
|
|
467
|
+
".": "#9fbcdd"
|
|
468
468
|
},
|
|
469
469
|
"description": "Decorative stroke color used to define info-toned surface boundaries with normal emphasis."
|
|
470
470
|
},
|
|
471
471
|
"Color/Semantic/Stroke/Info/strokeSur-info-strong": {
|
|
472
472
|
"value": {
|
|
473
|
-
".": "#
|
|
473
|
+
".": "#006bd7"
|
|
474
474
|
},
|
|
475
475
|
"description": "Decorative stroke color used to define info-toned surface boundaries with strong emphasis."
|
|
476
476
|
},
|
|
477
477
|
"Color/Semantic/Stroke/Warning/strokeSur-warning": {
|
|
478
478
|
"value": {
|
|
479
|
-
".": "#
|
|
479
|
+
".": "#d2b581"
|
|
480
480
|
},
|
|
481
481
|
"description": "Decorative stroke color used to define warning-toned surface boundaries with normal emphasis."
|
|
482
482
|
},
|
|
483
483
|
"Color/Semantic/Stroke/Warning/strokeSur-warning-strong": {
|
|
484
484
|
"value": {
|
|
485
|
-
".": "#
|
|
485
|
+
".": "#936400"
|
|
486
486
|
},
|
|
487
487
|
"description": "Decorative stroke color used to define warning-toned surface boundaries with strong emphasis."
|
|
488
488
|
},
|
|
489
489
|
"Color/Semantic/Stroke/Error/strokeSur-error": {
|
|
490
490
|
"value": {
|
|
491
|
-
".": "#
|
|
491
|
+
".": "#e1a198"
|
|
492
492
|
},
|
|
493
493
|
"description": "Decorative stroke color used to define error-toned surface boundaries with normal emphasis."
|
|
494
494
|
},
|
|
@@ -500,25 +500,25 @@
|
|
|
500
500
|
},
|
|
501
501
|
"Color/Semantic/Stroke/Neutral/strokeInt-neutral": {
|
|
502
502
|
"value": {
|
|
503
|
-
".": "#
|
|
503
|
+
".": "#8a8a8a"
|
|
504
504
|
},
|
|
505
505
|
"description": "Accessible stroke color used for interactive neutrally-toned elements with normal emphasis."
|
|
506
506
|
},
|
|
507
507
|
"Color/Semantic/Stroke/Neutral/strokeInt-neutral-active": {
|
|
508
508
|
"value": {
|
|
509
|
-
".": "#
|
|
509
|
+
".": "#6c6c6c"
|
|
510
510
|
},
|
|
511
511
|
"description": "Accessible stroke color used for interactive neutrally-toned elements with normal emphasis that are hovered, focused, or active."
|
|
512
512
|
},
|
|
513
513
|
"Color/Semantic/Stroke/Neutral/strokeInt-neutral-disabled": {
|
|
514
514
|
"value": {
|
|
515
|
-
".": "#
|
|
515
|
+
".": "#d8d8d8"
|
|
516
516
|
},
|
|
517
517
|
"description": "Accessible stroke color used for interactive neutrally-toned elements with normal emphasis, in their disabled state."
|
|
518
518
|
},
|
|
519
519
|
"Color/Semantic/Stroke/Neutral/strokeInt-neutral-strong": {
|
|
520
520
|
"value": {
|
|
521
|
-
".": "#
|
|
521
|
+
".": "#6c6c6c"
|
|
522
522
|
},
|
|
523
523
|
"description": "Accessible stroke color used for interactive neutrally-toned elements with strong emphasis."
|
|
524
524
|
},
|
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
},
|
|
537
537
|
"Color/Semantic/Stroke/Brand/strokeInt-brand-disabled": {
|
|
538
538
|
"value": {
|
|
539
|
-
".": "#
|
|
539
|
+
".": "#d8d8d8"
|
|
540
540
|
},
|
|
541
541
|
"description": "Accessible stroke color used for interactive brand-toned elements with normal emphasis, in their disabled state."
|
|
542
542
|
},
|
|
@@ -558,27 +558,43 @@
|
|
|
558
558
|
},
|
|
559
559
|
"description": "Base dimension unit"
|
|
560
560
|
},
|
|
561
|
-
"Dimension/Semantic/padding-surface-
|
|
561
|
+
"Dimension/Semantic/padding-surface-2xs": {
|
|
562
562
|
"value": {
|
|
563
|
-
".": "
|
|
563
|
+
".": "4px",
|
|
564
|
+
"compact": "4px",
|
|
565
|
+
"comfortable": "8px"
|
|
566
|
+
},
|
|
567
|
+
"description": "2x extra small spacing for surfaces"
|
|
568
|
+
},
|
|
569
|
+
"Dimension/Semantic/padding-surface-xs": {
|
|
570
|
+
"value": {
|
|
571
|
+
".": "8px",
|
|
572
|
+
"compact": "4px",
|
|
573
|
+
"comfortable": "12px"
|
|
564
574
|
},
|
|
565
575
|
"description": "Extra small spacing for surfaces"
|
|
566
576
|
},
|
|
567
|
-
"Dimension/Semantic/padding-surface-
|
|
577
|
+
"Dimension/Semantic/padding-surface-sm": {
|
|
568
578
|
"value": {
|
|
569
|
-
".": "
|
|
579
|
+
".": "16px",
|
|
580
|
+
"compact": "12px",
|
|
581
|
+
"comfortable": "20px"
|
|
570
582
|
},
|
|
571
583
|
"description": "Small spacing for surfaces"
|
|
572
584
|
},
|
|
573
|
-
"Dimension/Semantic/padding-surface-
|
|
585
|
+
"Dimension/Semantic/padding-surface-md": {
|
|
574
586
|
"value": {
|
|
575
|
-
".": "
|
|
587
|
+
".": "24px",
|
|
588
|
+
"compact": "20px",
|
|
589
|
+
"comfortable": "32px"
|
|
576
590
|
},
|
|
577
591
|
"description": "Medium spacing for surfaces"
|
|
578
592
|
},
|
|
579
|
-
"Dimension/Semantic/padding-surface-
|
|
593
|
+
"Dimension/Semantic/padding-surface-lg": {
|
|
580
594
|
"value": {
|
|
581
|
-
".": "
|
|
595
|
+
".": "32px",
|
|
596
|
+
"compact": "24px",
|
|
597
|
+
"comfortable": "40px"
|
|
582
598
|
},
|
|
583
599
|
"description": "Large spacing for surfaces"
|
|
584
600
|
},
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
20
|
import { ThemeProvider } from '../theme-provider';
|
|
21
|
+
import '../prebuilt/css/design-tokens.css';
|
|
21
22
|
|
|
22
23
|
const meta: Meta< typeof ThemeProvider > = {
|
|
23
24
|
title: 'Design System/Theme Provider',
|
|
@@ -198,10 +199,10 @@ export const WithPicker: StoryObj< typeof ThemeProvider > = {
|
|
|
198
199
|
},
|
|
199
200
|
};
|
|
200
201
|
|
|
201
|
-
const NestingDebug = ( { bg = '', primary = '' } ) => (
|
|
202
|
+
const NestingDebug = ( { bg = '', primary = '', density = '' } ) => (
|
|
202
203
|
<div
|
|
203
204
|
style={ {
|
|
204
|
-
padding: '
|
|
205
|
+
padding: 'var(--wpds-dimension-padding-surface-sm)',
|
|
205
206
|
color: 'var(--wpds-color-fg-content-neutral)',
|
|
206
207
|
backgroundColor: 'var(--wpds-color-bg-surface-neutral)',
|
|
207
208
|
display: 'flex',
|
|
@@ -210,13 +211,13 @@ const NestingDebug = ( { bg = '', primary = '' } ) => (
|
|
|
210
211
|
gap: '1rem',
|
|
211
212
|
} }
|
|
212
213
|
>
|
|
213
|
-
<pre>
|
|
214
|
-
bg: { bg } | primary: { primary }
|
|
214
|
+
<pre style={ { margin: 0 } }>
|
|
215
|
+
bg: { bg } | primary: { primary } | density: { density }
|
|
215
216
|
</pre>
|
|
216
217
|
<span
|
|
217
218
|
style={ {
|
|
218
219
|
display: 'inline-block',
|
|
219
|
-
padding: '
|
|
220
|
+
padding: 'var(--wpds-dimension-padding-surface-xs)',
|
|
220
221
|
borderRadius: '0.25rem',
|
|
221
222
|
backgroundColor:
|
|
222
223
|
'var(--wpds-color-bg-interactive-brand-strong)',
|
|
@@ -229,7 +230,7 @@ const NestingDebug = ( { bg = '', primary = '' } ) => (
|
|
|
229
230
|
style={ {
|
|
230
231
|
display: 'inline-block',
|
|
231
232
|
marginInlineStart: '0.25rem',
|
|
232
|
-
padding: '
|
|
233
|
+
padding: 'var(--wpds-dimension-padding-surface-xs)',
|
|
233
234
|
borderRadius: '0.25rem',
|
|
234
235
|
backgroundColor:
|
|
235
236
|
'var(--wpds-color-bg-interactive-brand-weak-disabled)',
|
|
@@ -245,27 +246,39 @@ export const NestingAndInheriting: StoryObj< typeof ThemeProvider > = {
|
|
|
245
246
|
render: () => {
|
|
246
247
|
return (
|
|
247
248
|
<ThemeProvider>
|
|
248
|
-
<NestingDebug
|
|
249
|
+
<NestingDebug
|
|
250
|
+
bg="inherit (root)"
|
|
251
|
+
primary="inherit (root)"
|
|
252
|
+
density="inherit (root)"
|
|
253
|
+
/>
|
|
249
254
|
<div style={ { paddingInlineStart: '1rem' } }>
|
|
250
255
|
<ThemeProvider
|
|
251
256
|
color={ {
|
|
252
257
|
bg: '#1e1e1e',
|
|
253
258
|
} }
|
|
259
|
+
density="compact"
|
|
254
260
|
>
|
|
255
|
-
<NestingDebug
|
|
261
|
+
<NestingDebug
|
|
262
|
+
bg="#1e1e1e"
|
|
263
|
+
primary="inherit (root)"
|
|
264
|
+
density="compact"
|
|
265
|
+
/>
|
|
256
266
|
<div style={ { paddingInlineStart: '1rem' } }>
|
|
257
267
|
<ThemeProvider>
|
|
258
268
|
<NestingDebug
|
|
259
269
|
bg="inherit (#1e1e1e)"
|
|
260
270
|
primary="inherit (root)"
|
|
271
|
+
density="inherit (compact)"
|
|
261
272
|
/>
|
|
262
273
|
<div style={ { paddingInlineStart: '1rem' } }>
|
|
263
274
|
<ThemeProvider
|
|
264
275
|
color={ { primary: 'hotpink' } }
|
|
276
|
+
density="default"
|
|
265
277
|
>
|
|
266
278
|
<NestingDebug
|
|
267
279
|
bg="inherit (#1e1e1e)"
|
|
268
280
|
primary="hotpink"
|
|
281
|
+
density="default"
|
|
269
282
|
/>
|
|
270
283
|
<div
|
|
271
284
|
style={ {
|
|
@@ -278,6 +291,7 @@ export const NestingAndInheriting: StoryObj< typeof ThemeProvider > = {
|
|
|
278
291
|
<NestingDebug
|
|
279
292
|
bg="#f8f8f8"
|
|
280
293
|
primary="inherit (hotpink)"
|
|
294
|
+
density="inherit (default)"
|
|
281
295
|
/>
|
|
282
296
|
</ThemeProvider>
|
|
283
297
|
</div>
|
|
@@ -397,7 +411,7 @@ export const AcrossIframes: StoryObj< typeof ThemeProvider > = {
|
|
|
397
411
|
<span
|
|
398
412
|
style={ {
|
|
399
413
|
display: 'inline-block',
|
|
400
|
-
padding: '
|
|
414
|
+
padding: 'var(--wpds-dimension-padding-surface-xs)',
|
|
401
415
|
borderRadius: '0.25rem',
|
|
402
416
|
backgroundColor:
|
|
403
417
|
'var(--wpds-color-bg-interactive-brand-strong)',
|
package/src/theme-provider.tsx
CHANGED
|
@@ -49,6 +49,7 @@ export const ThemeProvider = ( {
|
|
|
49
49
|
children,
|
|
50
50
|
color = {},
|
|
51
51
|
isRoot = false,
|
|
52
|
+
density,
|
|
52
53
|
}: ThemeProviderProps ) => {
|
|
53
54
|
const instanceId = useId();
|
|
54
55
|
|
|
@@ -76,6 +77,7 @@ export const ThemeProvider = ( {
|
|
|
76
77
|
<div
|
|
77
78
|
data-wpds-theme-provider-id={ instanceId }
|
|
78
79
|
data-wpds-root-provider={ isRoot }
|
|
80
|
+
data-wpds-density={ density }
|
|
79
81
|
className={ styles.root }
|
|
80
82
|
>
|
|
81
83
|
<ThemeContext.Provider value={ contextValue }>
|
package/src/types.ts
CHANGED
|
@@ -23,6 +23,15 @@ export interface ThemeProviderSettings {
|
|
|
23
23
|
*/
|
|
24
24
|
bg?: string;
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The density of the theme. If left unspecified, the theme inherits from
|
|
29
|
+
* the density of the closest `ThemeProvider`, or uses the default density
|
|
30
|
+
* if there is no inherited density.
|
|
31
|
+
*
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
density?: undefined | 'default' | 'compact' | 'comfortable';
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
export interface ThemeProviderProps extends ThemeProviderSettings {
|
package/terrazzo.config.ts
CHANGED
|
@@ -40,6 +40,27 @@ export default defineConfig( {
|
|
|
40
40
|
makeCSSVar( `wpds.${ publicTokenId( token.id ) }` ),
|
|
41
41
|
baseSelector: ':root',
|
|
42
42
|
modeSelectors: [
|
|
43
|
+
{
|
|
44
|
+
tokens: [ 'dimension.*' ],
|
|
45
|
+
mode: '.',
|
|
46
|
+
selectors: [
|
|
47
|
+
"[data-wpds-theme-provider-id][data-wpds-density='default']",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
tokens: [ 'dimension.*' ],
|
|
52
|
+
mode: 'compact',
|
|
53
|
+
selectors: [
|
|
54
|
+
"[data-wpds-theme-provider-id][data-wpds-density='compact']",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
tokens: [ 'dimension.*' ],
|
|
59
|
+
mode: 'comfortable',
|
|
60
|
+
selectors: [
|
|
61
|
+
"[data-wpds-theme-provider-id][data-wpds-density='comfortable']",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
43
64
|
{
|
|
44
65
|
mode: 'high-dpi',
|
|
45
66
|
selectors: [
|