@wordpress/theme 0.3.1-next.8b30e05b0.0 → 0.4.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.
Files changed (67) hide show
  1. package/README.md +82 -18
  2. package/bin/generate-primitive-tokens/index.ts +26 -33
  3. package/bin/terrazzo-plugin-mode-overrides/index.ts +208 -0
  4. package/build/color-ramps/lib/default-ramps.js +65 -65
  5. package/build/color-ramps/lib/default-ramps.js.map +1 -1
  6. package/build/color-ramps/lib/find-color-with-constraints.js.map +2 -2
  7. package/build/color-ramps/lib/index.js.map +2 -2
  8. package/build/color-ramps/lib/taper-chroma.js +18 -44
  9. package/build/color-ramps/lib/taper-chroma.js.map +2 -2
  10. package/build/prebuilt/js/design-tokens.js +32 -6
  11. package/build/prebuilt/js/design-tokens.js.map +2 -2
  12. package/build/prebuilt/ts/color-tokens.js +35 -13
  13. package/build/prebuilt/ts/color-tokens.js.map +2 -2
  14. package/build-module/color-ramps/lib/default-ramps.js +65 -65
  15. package/build-module/color-ramps/lib/default-ramps.js.map +1 -1
  16. package/build-module/color-ramps/lib/find-color-with-constraints.js.map +2 -2
  17. package/build-module/color-ramps/lib/index.js.map +2 -2
  18. package/build-module/color-ramps/lib/taper-chroma.js +19 -46
  19. package/build-module/color-ramps/lib/taper-chroma.js.map +2 -2
  20. package/build-module/prebuilt/js/design-tokens.js +32 -6
  21. package/build-module/prebuilt/js/design-tokens.js.map +2 -2
  22. package/build-module/prebuilt/ts/color-tokens.js +35 -13
  23. package/build-module/prebuilt/ts/color-tokens.js.map +2 -2
  24. package/build-types/color-ramps/lib/find-color-with-constraints.d.ts +3 -4
  25. package/build-types/color-ramps/lib/find-color-with-constraints.d.ts.map +1 -1
  26. package/build-types/color-ramps/lib/taper-chroma.d.ts +4 -4
  27. package/build-types/color-ramps/lib/taper-chroma.d.ts.map +1 -1
  28. package/build-types/prebuilt/ts/color-tokens.d.ts.map +1 -1
  29. package/docs/ds-tokens.md +35 -9
  30. package/package.json +5 -5
  31. package/src/color-ramps/lib/default-ramps.ts +65 -65
  32. package/src/color-ramps/lib/find-color-with-constraints.ts +11 -7
  33. package/src/color-ramps/lib/index.ts +4 -4
  34. package/src/color-ramps/lib/taper-chroma.ts +32 -63
  35. package/src/prebuilt/css/design-tokens.css +72 -28
  36. package/src/prebuilt/js/design-tokens.js +32 -6
  37. package/src/prebuilt/ts/color-tokens.ts +31 -9
  38. package/terrazzo.config.ts +11 -14
  39. package/tokens/border.json +44 -22
  40. package/tokens/color.json +1160 -630
  41. package/tokens/dimension.json +112 -52
  42. package/tokens/elevation.json +1 -1
  43. package/tokens/modes/border.high-dpi.json +15 -0
  44. package/tokens/modes/dimension.comfortable.json +54 -0
  45. package/tokens/modes/dimension.compact.json +54 -0
  46. package/tokens/typography.json +1 -1
  47. package/tsconfig.bin.tsbuildinfo +1 -1
  48. package/tsconfig.src.json +1 -1
  49. package/tsconfig.src.tsbuildinfo +1 -1
  50. package/bin/terrazzo-plugin-figma-ds-token-manager/index.ts +0 -217
  51. package/bin/terrazzo-plugin-figma-ds-token-manager/lib.ts +0 -1
  52. package/build/prebuilt/json/figma.json +0 -715
  53. package/build/token-id.js +0 -30
  54. package/build/token-id.js.map +0 -7
  55. package/build/types/css-modules.d.js +0 -1
  56. package/build/types/css-modules.d.js.map +0 -7
  57. package/build-module/prebuilt/json/figma.json +0 -715
  58. package/build-module/token-id.js +0 -6
  59. package/build-module/token-id.js.map +0 -7
  60. package/build-module/types/css-modules.d.js +0 -1
  61. package/build-module/types/css-modules.d.js.map +0 -7
  62. package/build-types/token-id.d.ts +0 -9
  63. package/build-types/token-id.d.ts.map +0 -1
  64. package/src/prebuilt/json/figma.json +0 -715
  65. package/src/test/token-id.test.ts +0 -12
  66. package/src/token-id.ts +0 -9
  67. package/src/types/css-modules.d.ts +0 -4
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, OKLCH, type ColorTypes } from 'colorjs.io/fn';
4
+ import { get, OKLCH, type PlainColorObject } from 'colorjs.io/fn';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -28,7 +28,6 @@ function cdiff( c1: number, c2: number ) {
28
28
  * - the L applied to the seed meets the contrast target against the reference
29
29
  * - the search is performed in one direction (ie lighter / darker)
30
30
  * - more constraints can be applied around lightness
31
- * - chroma could be tapered
32
31
  * @param reference
33
32
  * @param seed
34
33
  * @param target
@@ -40,8 +39,8 @@ function cdiff( c1: number, c2: number ) {
40
39
  * @param options.taperChromaOptions
41
40
  */
42
41
  export function findColorMeetingRequirements(
43
- reference: ColorTypes,
44
- seed: ColorTypes,
42
+ reference: PlainColorObject,
43
+ seed: PlainColorObject,
45
44
  target: number,
46
45
  direction: 'lighter' | 'darker',
47
46
  {
@@ -54,7 +53,12 @@ export function findColorMeetingRequirements(
54
53
  };
55
54
  taperChromaOptions?: TaperChromaOptions;
56
55
  } = {}
57
- ): { color: ColorTypes; reached: boolean; achieved: number; deficit?: number } {
56
+ ): {
57
+ color: PlainColorObject;
58
+ reached: boolean;
59
+ achieved: number;
60
+ deficit?: number;
61
+ } {
58
62
  // A target of 1 means same color.
59
63
  // A target lower than 1 doesn't make sense.
60
64
  if ( target <= 1 ) {
@@ -65,7 +69,7 @@ export function findColorMeetingRequirements(
65
69
  };
66
70
  }
67
71
 
68
- function getColorForL( l: number ): ColorTypes {
72
+ function getColorForL( l: number ): PlainColorObject {
69
73
  let newL = l;
70
74
  let newC = get( seed, [ OKLCH, 'c' ] );
71
75
 
@@ -140,7 +144,7 @@ export function findColorMeetingRequirements(
140
144
 
141
145
  const bestColor = solveWithBisect(
142
146
  getColorForL,
143
- ( c: ColorTypes ) => cdiff( getContrast( reference, c ), target ),
147
+ ( c ) => cdiff( getContrast( reference, c ), target ),
144
148
  lowerL,
145
149
  lowerContrast,
146
150
  upperL,
@@ -56,7 +56,7 @@ function calculateRamp( {
56
56
  oppDir,
57
57
  pinLightness,
58
58
  }: {
59
- seed: ColorTypes;
59
+ seed: PlainColorObject;
60
60
  sortedSteps: ( keyof Ramp )[];
61
61
  config: RampConfig;
62
62
  mainDir: RampDirection;
@@ -74,7 +74,7 @@ function calculateRamp( {
74
74
 
75
75
  // Keep track of the calculated colors, as they are going to be useful
76
76
  // when other colors reference them.
77
- const calculatedColors = new Map< keyof Ramp | 'seed', ColorTypes >();
77
+ const calculatedColors = new Map< keyof Ramp | 'seed', PlainColorObject >();
78
78
  calculatedColors.set( 'seed', seed );
79
79
 
80
80
  for ( const stepName of sortedSteps ) {
@@ -267,11 +267,11 @@ export function buildRamp(
267
267
  if ( maxDeficit > CONTRAST_EPSILON && rescaleToFitContrastTargets ) {
268
268
  const iterSteps = stepsForStep( maxDeficitStep!, config );
269
269
 
270
- function getSeedForL( l: number ): ColorTypes {
270
+ function getSeedForL( l: number ): PlainColorObject {
271
271
  return clampToGamut( set( clone( seed ), [ OKLCH, 'l' ], l ) );
272
272
  }
273
273
 
274
- function getDeficitForSeed( s: ColorTypes ): number {
274
+ function getDeficitForSeed( s: PlainColorObject ): number {
275
275
  const iterationResults = calculateRamp( {
276
276
  seed: s,
277
277
  sortedSteps: iterSteps,
@@ -3,12 +3,11 @@
3
3
  */
4
4
  import {
5
5
  get,
6
- inGamut,
6
+ toGamut,
7
7
  OKLCH,
8
- P3,
9
8
  sRGB,
10
- type ColorTypes,
11
- type ColorObject,
9
+ type PlainColorObject,
10
+ type ColorSpace,
12
11
  } from 'colorjs.io/fn';
13
12
 
14
13
  /**
@@ -17,7 +16,7 @@ import {
17
16
  import './register-color-spaces';
18
17
 
19
18
  export interface TaperChromaOptions {
20
- gamut?: 'p3' | 'srgb'; // target gamut (default "p3")
19
+ gamut?: ColorSpace; // target gamut (default `sRGB`)
21
20
  alpha?: number; // base fraction of Cmax at target (default 0.62)
22
21
  carry?: number; // seed vividness carry exponent β in [0..1] (default 0.5)
23
22
  cUpperBound?: number; // hard search cap for C (default 0.45)
@@ -41,12 +40,11 @@ export interface TaperChromaOptions {
41
40
  * @param options
42
41
  */
43
42
  export function taperChroma(
44
- seed: ColorTypes, // already OKLCH
43
+ seed: PlainColorObject, // already OKLCH
45
44
  lTarget: number, // [0..1]
46
45
  options: TaperChromaOptions = {}
47
- ): { l: number; c: number } | ColorObject {
48
- const gamut = options.gamut ?? 'p3';
49
- const gamutSpace = gamut === 'p3' ? P3 : sRGB;
46
+ ): { l: number; c: number } | PlainColorObject {
47
+ const gamut = options.gamut ?? sRGB;
50
48
  const alpha = options.alpha ?? 0.65; // 0.7-0.8 works well for accent surface
51
49
  const carry = options.carry ?? 0.5;
52
50
  const cUpperBound = options.cUpperBound ?? 0.45;
@@ -68,24 +66,20 @@ export function taperChroma(
68
66
  } else {
69
67
  // Respect achromatic intent: grayscale at target L
70
68
  return {
71
- spaceId: 'oklch',
69
+ space: OKLCH,
72
70
  coords: [ clamp01( lTarget ), 0, 0 ],
71
+ alpha: 1,
73
72
  };
74
73
  }
75
74
  }
76
75
 
77
76
  // Capacity at seed and target
78
77
  const lSeed = clamp01( get( seed, [ OKLCH, 'l' ] ) );
79
- const cmaxSeed = getCachedMaxChromaAtLH(
80
- lSeed,
81
- hSeed,
82
- gamutSpace,
83
- cUpperBound
84
- );
78
+ const cmaxSeed = getCachedMaxChromaAtLH( lSeed, hSeed, gamut, cUpperBound );
85
79
  const cmaxTarget = getCachedMaxChromaAtLH(
86
80
  clamp01( lTarget ),
87
81
  hSeed,
88
- gamutSpace,
82
+ gamut,
89
83
  cUpperBound
90
84
  );
91
85
 
@@ -106,20 +100,10 @@ export function taperChroma(
106
100
  kLight,
107
101
  kDark,
108
102
  } );
109
- let cPlanned = cWithCarry * t;
103
+ const cPlanned = cWithCarry * t;
110
104
 
111
105
  // Downward-only clamp (preserve L & H)
112
106
  const lOut = clamp01( lTarget );
113
- const candidate: ColorTypes = {
114
- spaceId: 'oklch',
115
- coords: [ lOut, cPlanned, hSeed ],
116
- };
117
- if ( ! inGamut( candidate, gamutSpace ) ) {
118
- const cap = Math.min( cPlanned, cUpperBound );
119
- cPlanned = getCachedMaxChromaAtLH( lOut, hSeed, gamutSpace, cap );
120
- }
121
-
122
- cPlanned = Math.min( cPlanned, cSeed );
123
107
 
124
108
  return { l: lOut, c: cPlanned };
125
109
  }
@@ -181,19 +165,14 @@ function continuousTaper(
181
165
  /* ---- chroma-capacity queries with small caches ---- */
182
166
 
183
167
  const maxChromaCache = new Map< string, number >();
184
-
185
- function keyMax(
186
- l: number,
187
- h: number,
188
- gamut: 'p3' | 'srgb',
189
- cap: number
190
- ): string {
168
+ function keyMax( l: number, h: number, gamut: string, cap: number ): string {
191
169
  // Quantize to keep cache compact
192
- const lq = quantize( l, 1e-3 );
193
- const hq = quantize( normalizeHue( h ), 1e-1 );
194
- const cq = quantize( cap, 1e-3 );
170
+ const lq = quantize( l, 0.05 );
171
+ const hq = quantize( normalizeHue( h ), 10 );
172
+ const cq = quantize( cap, 0.05 );
195
173
  return `${ gamut }|L:${ lq }|H:${ hq }|cap:${ cq }`;
196
174
  }
175
+
197
176
  function quantize( x: number, step: number ): number {
198
177
  const k = Math.round( x / step );
199
178
  return k * step;
@@ -202,10 +181,10 @@ function quantize( x: number, step: number ): number {
202
181
  function getCachedMaxChromaAtLH(
203
182
  l: number,
204
183
  h: number,
205
- gamutSpace: typeof P3 | typeof sRGB,
184
+ gamutSpace: ColorSpace,
206
185
  cap: number
207
186
  ): number {
208
- const gamut = gamutSpace === P3 ? 'p3' : 'srgb';
187
+ const gamut = gamutSpace.id;
209
188
  const key = keyMax( l, h, gamut, cap );
210
189
  const hit = maxChromaCache.get( key );
211
190
  if ( typeof hit === 'number' ) {
@@ -218,7 +197,7 @@ function getCachedMaxChromaAtLH(
218
197
  }
219
198
 
220
199
  /**
221
- * Binary-search the max in-gamut chroma at fixed (L,H) in the target gamut
200
+ * Find the max in-gamut chroma at fixed (L,H) in the target gamut
222
201
  * @param l
223
202
  * @param h
224
203
  * @param gamutSpace
@@ -227,28 +206,18 @@ function getCachedMaxChromaAtLH(
227
206
  function maxInGamutChromaAtLH(
228
207
  l: number,
229
208
  h: number,
230
- gamutSpace: typeof P3 | typeof sRGB,
209
+ gamutSpace: ColorSpace,
231
210
  cap: number
232
211
  ): number {
233
- let lo = 0;
234
- let hi = cap;
235
- let ok = 0;
236
-
237
- const lFixed = clamp01( l );
238
- const hFixed = normalizeHue( h );
239
-
240
- for ( let i = 0; i < 18; i++ ) {
241
- const mid = ( lo + hi ) / 2;
242
- const probe: ColorTypes = {
243
- spaceId: 'oklch',
244
- coords: [ lFixed, mid, hFixed ],
245
- };
246
- if ( inGamut( probe, gamutSpace ) ) {
247
- ok = mid;
248
- lo = mid;
249
- } else {
250
- hi = mid;
251
- }
252
- }
253
- return ok;
212
+ // Construct a color with maximum chroma.
213
+ const probe: PlainColorObject = {
214
+ space: OKLCH,
215
+ coords: [ l, cap, h ],
216
+ alpha: 1,
217
+ };
218
+
219
+ // Let `toGamut` reduce the chroma to the gamut maximum.
220
+ const clamped = toGamut( probe, { space: gamutSpace, method: 'css' } );
221
+
222
+ return get( clamped, [ OKLCH, 'c' ] );
254
223
  }
@@ -3,20 +3,33 @@
3
3
  * ------------------------------------------- */
4
4
 
5
5
  :root {
6
- --wpds-border-radius-large: 8px; /* Large radius */
7
- --wpds-border-radius-medium: 4px; /* Medium radius */
8
- --wpds-border-radius-small: 2px; /* Small radius */
9
- --wpds-border-radius-x-small: 1px; /* Extra small radius */
10
- --wpds-border-width-focus: 2px; /* Border width for focus ring */
6
+ --wpds-border-radius-surface-lg: 8px; /* Large radius for surfaces */
7
+ --wpds-border-radius-surface-md: 4px; /* Medium radius for surfaces */
8
+ --wpds-border-radius-surface-sm: 2px; /* Small radius for surfaces */
9
+ --wpds-border-radius-surface-xs: 1px; /* Extra small radius for surfaces */
10
+ --wpds-border-width-interactive-focus: 2px; /* Border width for focus ring */
11
+ --wpds-border-width-surface-lg: 8px; /* Large width for surfaces */
12
+ --wpds-border-width-surface-md: 4px; /* Medium width for surfaces */
13
+ --wpds-border-width-surface-sm: 2px; /* Small width for surfaces */
14
+ --wpds-border-width-surface-xs: 1px; /* Extra small width for surfaces */
11
15
  --wpds-color-bg-interactive-brand: #00000000; /* Background color for interactive elements with brand tone and normal emphasis. */
12
- --wpds-color-bg-interactive-brand-active: #f6f8fc; /* Background color for interactive elements with brand tone and normal emphasis that are hovered, focused, or active. */
16
+ --wpds-color-bg-interactive-brand-active: #f6f8fd; /* Background color for interactive elements with brand tone and normal emphasis that are hovered, focused, or active. */
13
17
  --wpds-color-bg-interactive-brand-disabled: #e2e2e2; /* Background color for interactive elements with brand tone and normal emphasis, in their disabled state. */
14
18
  --wpds-color-bg-interactive-brand-strong: #3858e9; /* Background color for interactive elements with brand tone and strong emphasis. */
15
19
  --wpds-color-bg-interactive-brand-strong-active: #2e49d9; /* Background color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. */
16
20
  --wpds-color-bg-interactive-brand-strong-disabled: #d2d2d2; /* Background color for interactive elements with brand tone and strong emphasis, in their disabled state. */
17
21
  --wpds-color-bg-interactive-brand-weak: #00000000; /* Background color for interactive elements with brand tone and weak emphasis. */
18
- --wpds-color-bg-interactive-brand-weak-active: #e4eaf7; /* Background color for interactive elements with brand tone and weak emphasis that are hovered, focused, or active. */
22
+ --wpds-color-bg-interactive-brand-weak-active: #e6eaf4; /* Background color for interactive elements with brand tone and weak emphasis that are hovered, focused, or active. */
19
23
  --wpds-color-bg-interactive-brand-weak-disabled: #e2e2e2; /* Background color for interactive elements with brand tone and weak emphasis, in their disabled state. */
24
+ --wpds-color-bg-interactive-error: #00000000; /* Background color for interactive elements with error tone and normal emphasis. */
25
+ --wpds-color-bg-interactive-error-active: #fff6f4; /* Background color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. */
26
+ --wpds-color-bg-interactive-error-disabled: #e2e2e2; /* Background color for interactive elements with error tone and normal emphasis, in their disabled state. */
27
+ --wpds-color-bg-interactive-error-strong: #cc1818; /* Background color for interactive elements with error tone and strong emphasis. */
28
+ --wpds-color-bg-interactive-error-strong-active: #b90000; /* Background color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. */
29
+ --wpds-color-bg-interactive-error-strong-disabled: #d2d2d2; /* Background color for interactive elements with error tone and strong emphasis, in their disabled state. */
30
+ --wpds-color-bg-interactive-error-weak: #00000000; /* Background color for interactive elements with error tone and weak emphasis. */
31
+ --wpds-color-bg-interactive-error-weak-active: #f6e6e3; /* Background color for interactive elements with error tone and weak emphasis that are hovered, focused, or active. */
32
+ --wpds-color-bg-interactive-error-weak-disabled: #e2e2e2; /* Background color for interactive elements with error tone and weak emphasis, in their disabled state. */
20
33
  --wpds-color-bg-interactive-neutral: #00000000; /* Background color for interactive elements with neutral tone and normal emphasis. */
21
34
  --wpds-color-bg-interactive-neutral-active: #eaeaea; /* Background color for interactive elements with neutral tone and normal emphasis that are hovered, focused, or active. */
22
35
  --wpds-color-bg-interactive-neutral-disabled: #e2e2e2; /* Background color for interactive elements with neutral tone and normal emphasis, in their disabled state. */
@@ -27,19 +40,19 @@
27
40
  --wpds-color-bg-interactive-neutral-weak-active: #eaeaea; /* Background color for interactive elements with neutral tone and weak emphasis that are hovered, focused, or active. */
28
41
  --wpds-color-bg-interactive-neutral-weak-disabled: #e2e2e2; /* Background color for interactive elements with neutral tone and weak emphasis, in their disabled state. */
29
42
  --wpds-color-bg-surface-brand: #ecf0f9; /* Background color for surfaces with brand tone and normal emphasis. */
30
- --wpds-color-bg-surface-caution: #f7eab3; /* Background color for surfaces with caution tone and normal emphasis. */
31
- --wpds-color-bg-surface-caution-weak: #fdf9e7; /* Background color for surfaces with caution tone and weak emphasis. */
32
- --wpds-color-bg-surface-error: #fae4e1; /* Background color for surfaces with error tone and normal emphasis. */
33
- --wpds-color-bg-surface-error-weak: #fdf6f5; /* Background color for surfaces with error tone and weak emphasis. */
34
- --wpds-color-bg-surface-info: #dfebf8; /* Background color for surfaces with info tone and normal emphasis. */
35
- --wpds-color-bg-surface-info-weak: #f5f9fd; /* Background color for surfaces with info tone and weak emphasis. */
43
+ --wpds-color-bg-surface-caution: #fee994; /* Background color for surfaces with caution tone and normal emphasis. */
44
+ --wpds-color-bg-surface-caution-weak: #fff9c9; /* Background color for surfaces with caution tone and weak emphasis. */
45
+ --wpds-color-bg-surface-error: #f6e6e3; /* Background color for surfaces with error tone and normal emphasis. */
46
+ --wpds-color-bg-surface-error-weak: #fff6f4; /* Background color for surfaces with error tone and weak emphasis. */
47
+ --wpds-color-bg-surface-info: #deebfa; /* Background color for surfaces with info tone and normal emphasis. */
48
+ --wpds-color-bg-surface-info-weak: #f3f9ff; /* Background color for surfaces with info tone and weak emphasis. */
36
49
  --wpds-color-bg-surface-neutral: #f8f8f8; /* Background color for surfaces with normal emphasis. */
37
50
  --wpds-color-bg-surface-neutral-strong: #ffffff; /* Background color for surfaces with strong emphasis. */
38
51
  --wpds-color-bg-surface-neutral-weak: #f0f0f0; /* Background color for surfaces with weak emphasis. */
39
- --wpds-color-bg-surface-success: #cbf5d1; /* Background color for surfaces with success tone and normal emphasis. */
40
- --wpds-color-bg-surface-success-weak: #f0fcf2; /* Background color for surfaces with success tone and weak emphasis. */
41
- --wpds-color-bg-surface-warning: #f8e8cc; /* Background color for surfaces with warning tone and normal emphasis. */
42
- --wpds-color-bg-surface-warning-weak: #fdf7ee; /* Background color for surfaces with warning tone and weak emphasis. */
52
+ --wpds-color-bg-surface-success: #c5f7cc; /* Background color for surfaces with success tone and normal emphasis. */
53
+ --wpds-color-bg-surface-success-weak: #eaffed; /* Background color for surfaces with success tone and weak emphasis. */
54
+ --wpds-color-bg-surface-warning: #fde6bd; /* Background color for surfaces with warning tone and normal emphasis. */
55
+ --wpds-color-bg-surface-warning-weak: #fff7e0; /* Background color for surfaces with warning tone and weak emphasis. */
43
56
  --wpds-color-bg-thumb-brand: #3858e9; /* Background color for thumbs with a brand tone and normal emphasis (eg. slider thumb and filled track). */
44
57
  --wpds-color-bg-thumb-brand-active: #3858e9; /* Background color for thumbs with a brand tone and normal emphasis (eg. slider thumb and filled track) that are hovered, focused, or active. */
45
58
  --wpds-color-bg-thumb-brand-disabled: #d8d8d8; /* Background color for thumbs with a brand tone and normal emphasis (eg. slider thumb and filled track), in their disabled state. */
@@ -48,7 +61,7 @@
48
61
  --wpds-color-bg-track-neutral: #d8d8d8; /* Background color for tracks with a neutral tone and normal emphasis (eg. slider or progressbar track). */
49
62
  --wpds-color-bg-track-neutral-weak: #e0e0e0; /* Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track). */
50
63
  --wpds-color-fg-content-caution: #281d00; /* Foreground color for content like text with caution tone and normal emphasis. */
51
- --wpds-color-fg-content-caution-weak: #836b00; /* Foreground color for content like text with caution tone and weak emphasis. */
64
+ --wpds-color-fg-content-caution-weak: #826a00; /* Foreground color for content like text with caution tone and weak emphasis. */
52
65
  --wpds-color-fg-content-error: #470000; /* Foreground color for content like text with error tone and normal emphasis. */
53
66
  --wpds-color-fg-content-error-weak: #cc1818; /* Foreground color for content like text with error tone and weak emphasis. */
54
67
  --wpds-color-fg-content-info: #001b4f; /* Foreground color for content like text with info tone and normal emphasis. */
@@ -58,13 +71,19 @@
58
71
  --wpds-color-fg-content-success: #002900; /* Foreground color for content like text with success tone and normal emphasis. */
59
72
  --wpds-color-fg-content-success-weak: #007f30; /* Foreground color for content like text with success tone and weak emphasis. */
60
73
  --wpds-color-fg-content-warning: #2e1900; /* Foreground color for content like text with warning tone and normal emphasis. */
61
- --wpds-color-fg-content-warning-weak: #936400; /* Foreground color for content like text with warning tone and weak emphasis. */
74
+ --wpds-color-fg-content-warning-weak: #926300; /* Foreground color for content like text with warning tone and weak emphasis. */
62
75
  --wpds-color-fg-interactive-brand: #3858e9; /* Foreground color for interactive elements with brand tone and normal emphasis. */
63
76
  --wpds-color-fg-interactive-brand-active: #3858e9; /* Foreground color for interactive elements with brand tone and normal emphasis that are hovered, focused, or active. */
64
77
  --wpds-color-fg-interactive-brand-disabled: #8a8a8a; /* Foreground color for interactive elements with brand tone and normal emphasis, in their disabled state. */
65
78
  --wpds-color-fg-interactive-brand-strong: #eff0f2; /* Foreground color for interactive elements with brand tone and strong emphasis. */
66
79
  --wpds-color-fg-interactive-brand-strong-active: #eff0f2; /* Foreground color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. */
67
80
  --wpds-color-fg-interactive-brand-strong-disabled: #6d6d6d; /* Foreground color for interactive elements with brand tone and strong emphasis, in their disabled state. */
81
+ --wpds-color-fg-interactive-error: #cc1818; /* Foreground color for interactive elements with error tone and normal emphasis. */
82
+ --wpds-color-fg-interactive-error-active: #cc1818; /* Foreground color for interactive elements with error tone and normal emphasis that are hovered, focused, or active. */
83
+ --wpds-color-fg-interactive-error-disabled: #8a8a8a; /* Foreground color for interactive elements with error tone and normal emphasis, in their disabled state. */
84
+ --wpds-color-fg-interactive-error-strong: #f2efef; /* Foreground color for interactive elements with error tone and strong emphasis. */
85
+ --wpds-color-fg-interactive-error-strong-active: #f2efef; /* Foreground color for interactive elements with error tone and strong emphasis that are hovered, focused, or active. */
86
+ --wpds-color-fg-interactive-error-strong-disabled: #6d6d6d; /* Foreground color for interactive elements with error tone and strong emphasis, in their disabled state. */
68
87
  --wpds-color-fg-interactive-neutral: #1e1e1e; /* Foreground color for interactive elements with neutral tone and normal emphasis. */
69
88
  --wpds-color-fg-interactive-neutral-active: #1e1e1e; /* Foreground color for interactive elements with neutral tone and normal emphasis that are hovered, focused, or active. */
70
89
  --wpds-color-fg-interactive-neutral-disabled: #8a8a8a; /* Foreground color for interactive elements with neutral tone and normal emphasis, in their disabled state. */
@@ -76,26 +95,33 @@
76
95
  --wpds-color-stroke-focus-brand: #3858e9; /* Accessible stroke color applied to focus rings. */
77
96
  --wpds-color-stroke-interactive-brand: #3858e9; /* Accessible stroke color used for interactive brand-toned elements with normal emphasis. */
78
97
  --wpds-color-stroke-interactive-brand-active: #2337c8; /* Accessible stroke color used for interactive brand-toned elements with normal emphasis that are hovered, focused, or active. */
79
- --wpds-color-stroke-interactive-brand-disabled: #d8d8d8; /* Accessible stroke color used for interactive brand-toned elements with normal emphasis, in their disabled state. */
98
+ --wpds-color-stroke-interactive-error: #cc1818; /* Accessible stroke color used for interactive error-toned elements with normal emphasis. */
99
+ --wpds-color-stroke-interactive-error-active: #9d0000; /* Accessible stroke color used for interactive error-toned elements with normal emphasis that are hovered, focused, or active. */
80
100
  --wpds-color-stroke-interactive-error-strong: #cc1818; /* Accessible stroke color used for interactive error-toned elements with strong emphasis. */
81
101
  --wpds-color-stroke-interactive-neutral: #8a8a8a; /* Accessible stroke color used for interactive neutrally-toned elements with normal emphasis. */
82
102
  --wpds-color-stroke-interactive-neutral-active: #6c6c6c; /* Accessible stroke color used for interactive neutrally-toned elements with normal emphasis that are hovered, focused, or active. */
83
103
  --wpds-color-stroke-interactive-neutral-disabled: #d8d8d8; /* Accessible stroke color used for interactive neutrally-toned elements with normal emphasis, in their disabled state. */
84
104
  --wpds-color-stroke-interactive-neutral-strong: #6c6c6c; /* Accessible stroke color used for interactive neutrally-toned elements with strong emphasis. */
85
- --wpds-color-stroke-surface-brand: #a2b1d6; /* Decorative stroke color used to define brand-toned surface boundaries with normal emphasis. */
86
- --wpds-color-stroke-surface-brand-strong: #3858e9; /* Decorative stroke color used to define neutrally-toned surface boundaries with strong emphasis. */
87
- --wpds-color-stroke-surface-error: #e1a198; /* Decorative stroke color used to define error-toned surface boundaries with normal emphasis. */
105
+ --wpds-color-stroke-surface-brand: #a3b1d4; /* Decorative stroke color used to define brand-toned surface boundaries with normal emphasis. */
106
+ --wpds-color-stroke-surface-brand-strong: #3858e9; /* Decorative stroke color used to define brand-toned surface boundaries with strong emphasis. */
107
+ --wpds-color-stroke-surface-error: #daa39b; /* Decorative stroke color used to define error-toned surface boundaries with normal emphasis. */
88
108
  --wpds-color-stroke-surface-error-strong: #cc1818; /* Decorative stroke color used to define error-toned surface boundaries with strong emphasis. */
89
- --wpds-color-stroke-surface-info: #9fbcdd; /* Decorative stroke color used to define info-toned surface boundaries with normal emphasis. */
109
+ --wpds-color-stroke-surface-info: #9fbcdc; /* Decorative stroke color used to define info-toned surface boundaries with normal emphasis. */
90
110
  --wpds-color-stroke-surface-info-strong: #006bd7; /* Decorative stroke color used to define info-toned surface boundaries with strong emphasis. */
91
111
  --wpds-color-stroke-surface-neutral: #d8d8d8; /* Decorative stroke color used to define neutrally-toned surface boundaries with normal emphasis. */
92
112
  --wpds-color-stroke-surface-neutral-strong: #8a8a8a; /* Decorative stroke color used to define neutrally-toned surface boundaries with strong emphasis. */
93
113
  --wpds-color-stroke-surface-neutral-weak: #e0e0e0; /* Decorative stroke color used to define neutrally-toned surface boundaries with weak emphasis. */
94
- --wpds-color-stroke-surface-success: #82c98f; /* Decorative stroke color used to define success-toned surface boundaries with normal emphasis. */
114
+ --wpds-color-stroke-surface-success: #8ac894; /* Decorative stroke color used to define success-toned surface boundaries with normal emphasis. */
95
115
  --wpds-color-stroke-surface-success-strong: #007f30; /* Decorative stroke color used to define success-toned surface boundaries with strong emphasis. */
96
- --wpds-color-stroke-surface-warning: #d2b581; /* Decorative stroke color used to define warning-toned surface boundaries with normal emphasis. */
97
- --wpds-color-stroke-surface-warning-strong: #936400; /* Decorative stroke color used to define warning-toned surface boundaries with strong emphasis. */
116
+ --wpds-color-stroke-surface-warning: #d0b381; /* Decorative stroke color used to define warning-toned surface boundaries with normal emphasis. */
117
+ --wpds-color-stroke-surface-warning-strong: #926300; /* Decorative stroke color used to define warning-toned surface boundaries with strong emphasis. */
98
118
  --wpds-dimension-base: 4px; /* Base dimension unit */
119
+ --wpds-dimension-gap-2xs: 4px; /* 2x extra small gap */
120
+ --wpds-dimension-gap-lg: 24px; /* Large gap */
121
+ --wpds-dimension-gap-md: 16px; /* Medium gap */
122
+ --wpds-dimension-gap-sm: 12px; /* Small gap */
123
+ --wpds-dimension-gap-xl: 40px; /* Extra large gap */
124
+ --wpds-dimension-gap-xs: 8px; /* Extra small gap */
99
125
  --wpds-dimension-padding-surface-2xs: 4px; /* 2x extra small spacing for surfaces */
100
126
  --wpds-dimension-padding-surface-lg: 32px; /* Large spacing for surfaces */
101
127
  --wpds-dimension-padding-surface-md: 24px; /* Medium spacing for surfaces */
@@ -130,6 +156,12 @@
130
156
 
131
157
  [data-wpds-theme-provider-id][data-wpds-density='default'] {
132
158
  --wpds-dimension-base: 4px; /* Base dimension unit */
159
+ --wpds-dimension-gap-2xs: 4px; /* 2x extra small gap */
160
+ --wpds-dimension-gap-lg: 24px; /* Large gap */
161
+ --wpds-dimension-gap-md: 16px; /* Medium gap */
162
+ --wpds-dimension-gap-sm: 12px; /* Small gap */
163
+ --wpds-dimension-gap-xl: 40px; /* Extra large gap */
164
+ --wpds-dimension-gap-xs: 8px; /* Extra small gap */
133
165
  --wpds-dimension-padding-surface-2xs: 4px; /* 2x extra small spacing for surfaces */
134
166
  --wpds-dimension-padding-surface-lg: 32px; /* Large spacing for surfaces */
135
167
  --wpds-dimension-padding-surface-md: 24px; /* Medium spacing for surfaces */
@@ -138,6 +170,12 @@
138
170
  }
139
171
 
140
172
  [data-wpds-theme-provider-id][data-wpds-density='compact'] {
173
+ --wpds-dimension-gap-2xs: 4px; /* 2x extra small gap */
174
+ --wpds-dimension-gap-lg: 20px; /* Large gap */
175
+ --wpds-dimension-gap-md: 12px; /* Medium gap */
176
+ --wpds-dimension-gap-sm: 8px; /* Small gap */
177
+ --wpds-dimension-gap-xl: 32px; /* Extra large gap */
178
+ --wpds-dimension-gap-xs: 4px; /* Extra small gap */
141
179
  --wpds-dimension-padding-surface-2xs: 4px; /* 2x extra small spacing for surfaces */
142
180
  --wpds-dimension-padding-surface-lg: 24px; /* Large spacing for surfaces */
143
181
  --wpds-dimension-padding-surface-md: 20px; /* Medium spacing for surfaces */
@@ -146,6 +184,12 @@
146
184
  }
147
185
 
148
186
  [data-wpds-theme-provider-id][data-wpds-density='comfortable'] {
187
+ --wpds-dimension-gap-2xs: 8px; /* 2x extra small gap */
188
+ --wpds-dimension-gap-lg: 32px; /* Large gap */
189
+ --wpds-dimension-gap-md: 20px; /* Medium gap */
190
+ --wpds-dimension-gap-sm: 16px; /* Small gap */
191
+ --wpds-dimension-gap-xl: 48px; /* Extra large gap */
192
+ --wpds-dimension-gap-xs: 12px; /* Extra small gap */
149
193
  --wpds-dimension-padding-surface-2xs: 8px; /* 2x extra small spacing for surfaces */
150
194
  --wpds-dimension-padding-surface-lg: 40px; /* Large spacing for surfaces */
151
195
  --wpds-dimension-padding-surface-md: 32px; /* Medium spacing for surfaces */
@@ -155,6 +199,6 @@
155
199
 
156
200
  @media ( -webkit-min-device-pixel-ratio: 2 ), ( min-resolution: 192dpi ) {
157
201
  :root {
158
- --wpds-border-width-focus: 1.5px; /* Border width for focus ring */
202
+ --wpds-border-width-interactive-focus: 1.5px; /* Border width for focus ring */
159
203
  }
160
204
  }
@@ -4,11 +4,15 @@
4
4
  */
5
5
 
6
6
  export default [
7
- '--wpds-border-radius-x-small',
8
- '--wpds-border-radius-small',
9
- '--wpds-border-radius-medium',
10
- '--wpds-border-radius-large',
11
- '--wpds-border-width-focus',
7
+ '--wpds-border-radius-surface-xs',
8
+ '--wpds-border-radius-surface-sm',
9
+ '--wpds-border-radius-surface-md',
10
+ '--wpds-border-radius-surface-lg',
11
+ '--wpds-border-width-surface-xs',
12
+ '--wpds-border-width-surface-sm',
13
+ '--wpds-border-width-surface-md',
14
+ '--wpds-border-width-surface-lg',
15
+ '--wpds-border-width-interactive-focus',
12
16
  '--wpds-color-bg-surface-neutral',
13
17
  '--wpds-color-bg-surface-neutral-strong',
14
18
  '--wpds-color-bg-surface-neutral-weak',
@@ -41,6 +45,15 @@ export default [
41
45
  '--wpds-color-bg-interactive-brand-weak',
42
46
  '--wpds-color-bg-interactive-brand-weak-active',
43
47
  '--wpds-color-bg-interactive-brand-weak-disabled',
48
+ '--wpds-color-bg-interactive-error',
49
+ '--wpds-color-bg-interactive-error-active',
50
+ '--wpds-color-bg-interactive-error-disabled',
51
+ '--wpds-color-bg-interactive-error-strong',
52
+ '--wpds-color-bg-interactive-error-strong-active',
53
+ '--wpds-color-bg-interactive-error-strong-disabled',
54
+ '--wpds-color-bg-interactive-error-weak',
55
+ '--wpds-color-bg-interactive-error-weak-active',
56
+ '--wpds-color-bg-interactive-error-weak-disabled',
44
57
  '--wpds-color-bg-track-neutral-weak',
45
58
  '--wpds-color-bg-track-neutral',
46
59
  '--wpds-color-bg-thumb-neutral-weak',
@@ -74,6 +87,12 @@ export default [
74
87
  '--wpds-color-fg-interactive-brand-strong',
75
88
  '--wpds-color-fg-interactive-brand-strong-active',
76
89
  '--wpds-color-fg-interactive-brand-strong-disabled',
90
+ '--wpds-color-fg-interactive-error',
91
+ '--wpds-color-fg-interactive-error-active',
92
+ '--wpds-color-fg-interactive-error-disabled',
93
+ '--wpds-color-fg-interactive-error-strong',
94
+ '--wpds-color-fg-interactive-error-strong-active',
95
+ '--wpds-color-fg-interactive-error-strong-disabled',
77
96
  '--wpds-color-stroke-surface-neutral',
78
97
  '--wpds-color-stroke-surface-neutral-weak',
79
98
  '--wpds-color-stroke-surface-neutral-strong',
@@ -93,7 +112,8 @@ export default [
93
112
  '--wpds-color-stroke-interactive-neutral-strong',
94
113
  '--wpds-color-stroke-interactive-brand',
95
114
  '--wpds-color-stroke-interactive-brand-active',
96
- '--wpds-color-stroke-interactive-brand-disabled',
115
+ '--wpds-color-stroke-interactive-error',
116
+ '--wpds-color-stroke-interactive-error-active',
97
117
  '--wpds-color-stroke-interactive-error-strong',
98
118
  '--wpds-color-stroke-focus-brand',
99
119
  '--wpds-dimension-base',
@@ -102,6 +122,12 @@ export default [
102
122
  '--wpds-dimension-padding-surface-sm',
103
123
  '--wpds-dimension-padding-surface-md',
104
124
  '--wpds-dimension-padding-surface-lg',
125
+ '--wpds-dimension-gap-2xs',
126
+ '--wpds-dimension-gap-xs',
127
+ '--wpds-dimension-gap-sm',
128
+ '--wpds-dimension-gap-md',
129
+ '--wpds-dimension-gap-lg',
130
+ '--wpds-dimension-gap-xl',
105
131
  '--wpds-elevation-x-small',
106
132
  '--wpds-elevation-small',
107
133
  '--wpds-elevation-medium',
@@ -6,19 +6,19 @@
6
6
  export default {
7
7
  'primary-bgFill1': [ 'bg-interactive-brand-strong' ],
8
8
  'primary-fgFill': [
9
- 'fg-interactive-brand-strong-active',
10
9
  'fg-interactive-brand-strong',
10
+ 'fg-interactive-brand-strong-active',
11
11
  ],
12
12
  'primary-bgFill2': [ 'bg-interactive-brand-strong-active' ],
13
13
  'primary-surface2': [ 'bg-interactive-brand-active' ],
14
14
  'primary-surface4': [ 'bg-interactive-brand-weak-active' ],
15
15
  'primary-fgSurface3': [
16
- 'fg-interactive-brand-active',
17
16
  'fg-interactive-brand',
17
+ 'fg-interactive-brand-active',
18
18
  ],
19
19
  'primary-stroke3': [
20
- 'bg-thumb-brand-active',
21
20
  'bg-thumb-brand',
21
+ 'bg-thumb-brand-active',
22
22
  'stroke-focus-brand',
23
23
  'stroke-interactive-brand',
24
24
  'stroke-surface-brand-strong',
@@ -44,23 +44,44 @@ export default {
44
44
  'warning-fgSurface3': [ 'fg-content-warning-weak' ],
45
45
  'warning-stroke3': [ 'stroke-surface-warning-strong' ],
46
46
  'warning-stroke1': [ 'stroke-surface-warning' ],
47
- 'error-surface2': [ 'bg-surface-error-weak' ],
48
- 'error-surface4': [ 'bg-surface-error' ],
47
+ 'error-bgFill1': [ 'bg-interactive-error-strong' ],
48
+ 'error-fgFill': [
49
+ 'fg-interactive-error-strong',
50
+ 'fg-interactive-error-strong-active',
51
+ ],
52
+ 'error-bgFill2': [ 'bg-interactive-error-strong-active' ],
53
+ 'error-surface2': [
54
+ 'bg-interactive-error-active',
55
+ 'bg-surface-error-weak',
56
+ ],
57
+ 'error-surface4': [
58
+ 'bg-interactive-error-weak-active',
59
+ 'bg-surface-error',
60
+ ],
49
61
  'error-fgSurface4': [ 'fg-content-error' ],
50
- 'error-fgSurface3': [ 'fg-content-error-weak' ],
62
+ 'error-fgSurface3': [
63
+ 'fg-content-error-weak',
64
+ 'fg-interactive-error',
65
+ 'fg-interactive-error-active',
66
+ ],
51
67
  'error-stroke3': [
68
+ 'stroke-interactive-error',
52
69
  'stroke-interactive-error-strong',
53
70
  'stroke-surface-error-strong',
54
71
  ],
72
+ 'error-stroke4': [ 'stroke-interactive-error-active' ],
55
73
  'error-stroke1': [ 'stroke-surface-error' ],
56
74
  'bg-surface2': [ 'bg-surface-neutral' ],
57
75
  'bg-surface6': [
58
76
  'bg-interactive-brand-strong-disabled',
77
+ 'bg-interactive-error-strong-disabled',
59
78
  'bg-interactive-neutral-strong-disabled',
60
79
  ],
61
80
  'bg-surface5': [
62
81
  'bg-interactive-brand-disabled',
63
82
  'bg-interactive-brand-weak-disabled',
83
+ 'bg-interactive-error-disabled',
84
+ 'bg-interactive-error-weak-disabled',
64
85
  'bg-interactive-neutral-disabled',
65
86
  'bg-interactive-neutral-weak-disabled',
66
87
  ],
@@ -71,17 +92,19 @@ export default {
71
92
  'bg-surface3': [ 'bg-surface-neutral-strong' ],
72
93
  'bg-fgSurface4': [
73
94
  'fg-content-neutral',
74
- 'fg-interactive-neutral-active',
75
95
  'fg-interactive-neutral',
96
+ 'fg-interactive-neutral-active',
76
97
  ],
77
98
  'bg-fgSurface3': [
78
99
  'fg-content-neutral-weak',
79
100
  'fg-interactive-brand-strong-disabled',
101
+ 'fg-interactive-error-strong-disabled',
80
102
  'fg-interactive-neutral-strong-disabled',
81
103
  'fg-interactive-neutral-weak',
82
104
  ],
83
105
  'bg-fgSurface2': [
84
106
  'fg-interactive-brand-disabled',
107
+ 'fg-interactive-error-disabled',
85
108
  'fg-interactive-neutral-disabled',
86
109
  'fg-interactive-neutral-weak-disabled',
87
110
  ],
@@ -98,7 +121,6 @@ export default {
98
121
  'bg-stroke2': [
99
122
  'bg-thumb-brand-disabled',
100
123
  'bg-track-neutral',
101
- 'stroke-interactive-brand-disabled',
102
124
  'stroke-interactive-neutral-disabled',
103
125
  'stroke-surface-neutral',
104
126
  ],
@@ -106,8 +128,8 @@ export default {
106
128
  'bg-bgFillInverted2': [ 'bg-interactive-neutral-strong-active' ],
107
129
  'bg-bgFillInverted1': [ 'bg-interactive-neutral-strong' ],
108
130
  'bg-fgFillInverted': [
109
- 'fg-interactive-neutral-strong-active',
110
131
  'fg-interactive-neutral-strong',
132
+ 'fg-interactive-neutral-strong-active',
111
133
  ],
112
134
  'bg-surface1': [ 'bg-surface-neutral-weak' ],
113
135
  'caution-surface2': [ 'bg-surface-caution-weak' ],