@wordpress/theme 0.4.0 → 0.4.1-next.8fd3f8831.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 (87) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +43 -33
  3. package/build/color-ramps/{index.js → index.cjs} +8 -8
  4. package/build/color-ramps/lib/{color-utils.js → color-utils.cjs} +2 -2
  5. package/build/color-ramps/lib/{constants.js → constants.cjs} +2 -2
  6. package/build/color-ramps/lib/{default-ramps.js → default-ramps.cjs} +1 -1
  7. package/build/color-ramps/lib/{find-color-with-constraints.js → find-color-with-constraints.cjs} +6 -6
  8. package/build/color-ramps/lib/{index.js → index.cjs} +6 -6
  9. package/build/color-ramps/lib/{ramp-configs.js → ramp-configs.cjs} +1 -1
  10. package/build/color-ramps/lib/{register-color-spaces.js → register-color-spaces.cjs} +1 -1
  11. package/build/color-ramps/lib/{taper-chroma.js → taper-chroma.cjs} +2 -2
  12. package/build/color-ramps/lib/{types.js → types.cjs} +1 -1
  13. package/build/color-ramps/lib/{utils.js → utils.cjs} +4 -4
  14. package/build/{context.js → context.cjs} +1 -1
  15. package/build/{index.js → index.cjs} +2 -2
  16. package/build/index.cjs.map +7 -0
  17. package/build/{lock-unlock.js → lock-unlock.cjs} +1 -1
  18. package/build/prebuilt/js/{design-tokens.js → design-tokens.cjs} +1 -1
  19. package/build/prebuilt/ts/{color-tokens.js → color-tokens.cjs} +1 -1
  20. package/build/prebuilt/ts/token-types.cjs +18 -0
  21. package/build/prebuilt/ts/token-types.cjs.map +7 -0
  22. package/build/{private-apis.js → private-apis.cjs} +4 -4
  23. package/build/{theme-provider.js → theme-provider.cjs} +3 -3
  24. package/build/{types.js → types.cjs} +1 -1
  25. package/build/{use-theme-provider-styles.js → use-theme-provider-styles.cjs} +6 -6
  26. package/build-module/color-ramps/index.js +7 -7
  27. package/build-module/color-ramps/lib/color-utils.js +1 -1
  28. package/build-module/color-ramps/lib/constants.js +1 -1
  29. package/build-module/color-ramps/lib/find-color-with-constraints.js +5 -5
  30. package/build-module/color-ramps/lib/index.js +5 -5
  31. package/build-module/color-ramps/lib/taper-chroma.js +1 -1
  32. package/build-module/color-ramps/lib/utils.js +3 -3
  33. package/build-module/index.js +1 -1
  34. package/build-module/index.js.map +2 -2
  35. package/build-module/prebuilt/ts/token-types.js +1 -0
  36. package/build-module/prebuilt/ts/token-types.js.map +7 -0
  37. package/build-module/private-apis.js +3 -3
  38. package/build-module/theme-provider.js +2 -2
  39. package/build-module/use-theme-provider-styles.js +4 -4
  40. package/build-types/index.d.ts +2 -0
  41. package/build-types/index.d.ts.map +1 -1
  42. package/build-types/prebuilt/ts/token-types.d.ts +49 -0
  43. package/build-types/prebuilt/ts/token-types.d.ts.map +1 -0
  44. package/package.json +14 -6
  45. package/src/index.ts +2 -1
  46. package/src/prebuilt/ts/token-types.ts +125 -0
  47. package/bin/generate-default-ramps/index.ts +0 -49
  48. package/bin/generate-primitive-tokens/index.ts +0 -113
  49. package/bin/terrazzo-plugin-ds-tokens-docs/index.ts +0 -84
  50. package/bin/terrazzo-plugin-inline-alias-values/index.ts +0 -113
  51. package/bin/terrazzo-plugin-known-wpds-css-variables/index.ts +0 -52
  52. package/bin/terrazzo-plugin-mode-overrides/index.ts +0 -208
  53. package/build/index.js.map +0 -7
  54. package/docs/ds-tokens.md +0 -176
  55. package/terrazzo.config.ts +0 -123
  56. package/tokens/border.json +0 -56
  57. package/tokens/color.json +0 -1559
  58. package/tokens/dimension.json +0 -169
  59. package/tokens/elevation.json +0 -201
  60. package/tokens/modes/border.high-dpi.json +0 -15
  61. package/tokens/modes/dimension.comfortable.json +0 -54
  62. package/tokens/modes/dimension.compact.json +0 -54
  63. package/tokens/typography.json +0 -93
  64. package/tsconfig.bin.json +0 -13
  65. package/tsconfig.bin.tsbuildinfo +0 -1
  66. package/tsconfig.json +0 -11
  67. package/tsconfig.src.json +0 -9
  68. package/tsconfig.src.tsbuildinfo +0 -1
  69. /package/build/color-ramps/{index.js.map → index.cjs.map} +0 -0
  70. /package/build/color-ramps/lib/{color-utils.js.map → color-utils.cjs.map} +0 -0
  71. /package/build/color-ramps/lib/{constants.js.map → constants.cjs.map} +0 -0
  72. /package/build/color-ramps/lib/{default-ramps.js.map → default-ramps.cjs.map} +0 -0
  73. /package/build/color-ramps/lib/{find-color-with-constraints.js.map → find-color-with-constraints.cjs.map} +0 -0
  74. /package/build/color-ramps/lib/{index.js.map → index.cjs.map} +0 -0
  75. /package/build/color-ramps/lib/{ramp-configs.js.map → ramp-configs.cjs.map} +0 -0
  76. /package/build/color-ramps/lib/{register-color-spaces.js.map → register-color-spaces.cjs.map} +0 -0
  77. /package/build/color-ramps/lib/{taper-chroma.js.map → taper-chroma.cjs.map} +0 -0
  78. /package/build/color-ramps/lib/{types.js.map → types.cjs.map} +0 -0
  79. /package/build/color-ramps/lib/{utils.js.map → utils.cjs.map} +0 -0
  80. /package/build/{context.js.map → context.cjs.map} +0 -0
  81. /package/build/{lock-unlock.js.map → lock-unlock.cjs.map} +0 -0
  82. /package/build/prebuilt/js/{design-tokens.js.map → design-tokens.cjs.map} +0 -0
  83. /package/build/prebuilt/ts/{color-tokens.js.map → color-tokens.cjs.map} +0 -0
  84. /package/build/{private-apis.js.map → private-apis.cjs.map} +0 -0
  85. /package/build/{theme-provider.js.map → theme-provider.cjs.map} +0 -0
  86. /package/build/{types.js.map → types.cjs.map} +0 -0
  87. /package/build/{use-theme-provider-styles.js.map → use-theme-provider-styles.cjs.map} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.4.0-next.0 (2025-12-24)
6
+
7
+ ### New Features
8
+
9
+ - Expose `ThemeProvider` TypeScript type from package. While the component is still experimental, this makes it easier to use TypeScript typings in your code, which would otherwise be inaccessible. ([#74011](https://github.com/WordPress/gutenberg/pull/74011))
package/README.md CHANGED
@@ -6,8 +6,8 @@ This package is still experimental. “Experimental” means this is an early im
6
6
 
7
7
  A theming package that's part of the WordPress Design System. It has two parts:
8
8
 
9
- - **Design Tokens**: A comprehensive system of design tokens for colors, spacing, typography, and more
10
- - **Theme System**: A flexible theming provider for consistent theming across applications
9
+ - **Design Tokens**: A comprehensive system of design tokens for colors, spacing, typography, and more.
10
+ - **Theme System**: A flexible theming provider for consistent theming across applications.
11
11
 
12
12
  ## Design Tokens
13
13
 
@@ -76,14 +76,14 @@ Semantic tokens follow a consistent naming pattern:
76
76
 
77
77
  **Target** is the component or element type the token applies to.
78
78
 
79
- | Value | Description |
80
- | ------------- | ------------------------------------------------------------ |
81
- | `surface` | Container or layout backgrounds and borders |
82
- | `interactive` | Interactive elements like buttons, inputs, and controls |
83
- | `content` | Static content like text and icons |
84
- | `track` | Track components like scrollbars and slider tracks |
85
- | `thumb` | Thumb components like scrollbar thumbs and slider handles |
86
- | `focus` | Focus indicators and rings |
79
+ | Value | Description |
80
+ | ------------- | --------------------------------------------------------- |
81
+ | `surface` | Container or layout backgrounds and borders |
82
+ | `interactive` | Interactive elements like buttons, inputs, and controls |
83
+ | `content` | Static content like text and icons |
84
+ | `track` | Track components like scrollbars and slider tracks |
85
+ | `thumb` | Thumb components like scrollbar thumbs and slider handles |
86
+ | `focus` | Focus indicators and rings |
87
87
 
88
88
  **Modifier** is an optional size or intensity modifier.
89
89
 
@@ -101,15 +101,15 @@ Color tokens extend the base pattern with additional modifiers for tone, emphasi
101
101
 
102
102
  **Tone** defines the semantic intent of the color.
103
103
 
104
- | Value | Description |
105
- | --------- | ---------------------------------------------------------------------------------------- |
106
- | `neutral` | Neutrally toned UI elements. |
107
- | `brand` | Brand-accented or primary action colors. |
108
- | `success` | Positive or completed states. |
109
- | `info` | Informational or system-generated context. |
110
- | `caution` | Heads-up or low-severity issues; “proceed carefully.” |
111
- | `warning` | Higher-severity or time-sensitive issues that require user attention but are not errors. |
112
- | `error` | Blocking issues, validation failures, or destructive actions. |
104
+ | Value | Description |
105
+ | --------- | --------------------------------------------------------------------------------------- |
106
+ | `neutral` | Neutrally toned UI elements |
107
+ | `brand` | Brand-accented or primary action colors |
108
+ | `success` | Positive or completed states |
109
+ | `info` | Informational or system-generated context |
110
+ | `caution` | Heads-up or low-severity issues; “proceed carefully |
111
+ | `warning` | Higher-severity or time-sensitive issues that require user attention but are not errors |
112
+ | `error` | Blocking issues, validation failures, or destructive actions |
113
113
 
114
114
  > [!NOTE]
115
115
  > `caution` and `warning` represent two escalation levels of non-error severity.
@@ -117,17 +117,17 @@ Color tokens extend the base pattern with additional modifiers for tone, emphasi
117
117
 
118
118
  **Emphasis** adjusts color strength relative to the base tone, if specified. The default is a normal emphasis.
119
119
 
120
- | Value | Description |
121
- | -------------------- | ----------------------------------------------- |
122
- | `strong` | Higher contrast and/or elevated emphasis. |
123
- | `weak` | Subtle variant for secondary or muted elements. |
120
+ | Value | Description |
121
+ | -------------------- | ---------------------------------------------- |
122
+ | `strong` | Higher contrast and/or elevated emphasis |
123
+ | `weak` | Subtle variant for secondary or muted elements |
124
124
 
125
125
  **State** represents the interactive state of the element, if specified. The default is an idle state.
126
126
 
127
- | Value | Description |
128
- | ---------- | ---------------------------------------- |
129
- | `active` | Hovered, pressed, or selected state. |
130
- | `disabled` | Unavailable or inoperable state. |
127
+ | Value | Description |
128
+ | ---------- | ----------------------------------- |
129
+ | `active` | Hovered, pressed, or selected state |
130
+ | `disabled` | Unavailable or inoperable state |
131
131
 
132
132
  ## Theme Provider
133
133
 
@@ -138,7 +138,7 @@ import { ThemeProvider } from '@wordpress/theme';
138
138
 
139
139
  function App() {
140
140
  return (
141
- <ThemeProvider color={ { primary: 'blue' } }>
141
+ <ThemeProvider color={ { primary: 'blue' } } density="compact">
142
142
  { /* Your app content */ }
143
143
  </ThemeProvider>
144
144
  );
@@ -147,11 +147,21 @@ function App() {
147
147
 
148
148
  The `color` prop accepts an object with the following optional properties:
149
149
 
150
- - `primary`: The primary/accent seed color (default: `'#3858e9'`)
151
- - `bg`: The background seed color (default: `'#f8f8f8'`)
150
+ - `primary`: The primary/accent seed color (default: `'#3858e9'`).
151
+ - `bg`: The background seed color (default: `'#f8f8f8'`).
152
152
 
153
153
  Both properties accept any valid CSS color value. The theme system automatically generates appropriate color ramps and determines light/dark mode based on these seed colors.
154
154
 
155
+ The `density` prop controls the spacing scale throughout the UI:
156
+
157
+ - `'default'`: Standard spacing for general use.
158
+ - `'compact'`: Reduced spacing for information-dense interfaces like data tables or dashboards.
159
+ - `'comfortable'`: Increased spacing for focused experiences like modals, dialogs, or full-screen settings panels.
160
+
161
+ The density setting adjusts dimension tokens like gaps and paddings to maintain consistent spacing throughout the UI. Changing the density automatically updates spacing of all components that use these tokens.
162
+
163
+ When the `color` or `density` prop is omitted, the theme inherits the value from the closest parent `ThemeProvider`, or uses the default value if none is inherited.
164
+
155
165
  ### Nesting Providers
156
166
 
157
167
  The provider can be used recursively to override or modify the theme for a specific subtree.
@@ -159,10 +169,10 @@ The provider can be used recursively to override or modify the theme for a speci
159
169
  ```tsx
160
170
  <ThemeProvider color={ { bg: 'white' } }>
161
171
  { /* light-themed UI components */ }
162
- <ThemeProvider color={ { bg: '#1e1e1e' } }>
163
- { /* dark-themed UI components */ }
172
+ <ThemeProvider color={ { bg: '#1e1e1e' } } density="compact">
173
+ { /* dark-themed UI components with compact spacing */ }
164
174
  <ThemeProvider color={ { primary: 'red' } }>
165
- { /* dark-themed with red accent */ }
175
+ { /* dark-themed with red accent, inheriting compact density */ }
166
176
  </ThemeProvider>
167
177
  </ThemeProvider>
168
178
  { /* light-themed UI components */ }
@@ -26,13 +26,13 @@ __export(color_ramps_exports, {
26
26
  });
27
27
  module.exports = __toCommonJS(color_ramps_exports);
28
28
  var import_fn = require("colorjs.io/fn");
29
- var import_register_color_spaces = require("./lib/register-color-spaces");
30
- var import_lib = require("./lib/index");
31
- var import_utils = require("./lib/utils");
32
- var import_ramp_configs = require("./lib/ramp-configs");
33
- var import_color_utils = require("./lib/color-utils");
34
- var import_constants = require("./lib/constants");
35
- var import_constants2 = require("./lib/constants");
29
+ var import_register_color_spaces = require("./lib/register-color-spaces.cjs");
30
+ var import_lib = require("./lib/index.cjs");
31
+ var import_utils = require("./lib/utils.cjs");
32
+ var import_ramp_configs = require("./lib/ramp-configs.cjs");
33
+ var import_color_utils = require("./lib/color-utils.cjs");
34
+ var import_constants = require("./lib/constants.cjs");
35
+ var import_constants2 = require("./lib/constants.cjs");
36
36
  function buildBgRamp(seed) {
37
37
  if (typeof seed !== "string" || seed.trim() === "") {
38
38
  throw new Error("Seed color must be a non-empty string");
@@ -115,4 +115,4 @@ function checkAccessibleCombinations({
115
115
  buildBgRamp,
116
116
  checkAccessibleCombinations
117
117
  });
118
- //# sourceMappingURL=index.js.map
118
+ //# sourceMappingURL=index.cjs.map
@@ -25,7 +25,7 @@ __export(color_utils_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(color_utils_exports);
27
27
  var import_fn = require("colorjs.io/fn");
28
- var import_register_color_spaces = require("./register-color-spaces");
28
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
29
29
  function getColorString(color) {
30
30
  return (0, import_fn.serialize)((0, import_fn.to)(color, import_fn.sRGB), { format: "hex", inGamut: true });
31
31
  }
@@ -41,4 +41,4 @@ function clampToGamut(c) {
41
41
  getColorString,
42
42
  getContrast
43
43
  });
44
- //# sourceMappingURL=color-utils.js.map
44
+ //# sourceMappingURL=color-utils.cjs.map
@@ -31,7 +31,7 @@ __export(constants_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(constants_exports);
33
33
  var import_fn = require("colorjs.io/fn");
34
- var import_register_color_spaces = require("./register-color-spaces");
34
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
35
35
  var WHITE = (0, import_fn.to)("white", import_fn.OKLCH);
36
36
  var BLACK = (0, import_fn.to)("black", import_fn.OKLCH);
37
37
  var UNIVERSAL_CONTRAST_TOPUP = 0.02;
@@ -95,4 +95,4 @@ var DEFAULT_SEED_COLORS = {
95
95
  WHITE,
96
96
  WHITE_TEXT_CONTRAST_MARGIN
97
97
  });
98
- //# sourceMappingURL=constants.js.map
98
+ //# sourceMappingURL=constants.cjs.map
@@ -217,4 +217,4 @@ var DEFAULT_RAMPS = {
217
217
  0 && (module.exports = {
218
218
  DEFAULT_RAMPS
219
219
  });
220
- //# sourceMappingURL=default-ramps.js.map
220
+ //# sourceMappingURL=default-ramps.cjs.map
@@ -23,11 +23,11 @@ __export(find_color_with_constraints_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(find_color_with_constraints_exports);
25
25
  var import_fn = require("colorjs.io/fn");
26
- var import_register_color_spaces = require("./register-color-spaces");
27
- var import_utils = require("./utils");
28
- var import_constants = require("./constants");
29
- var import_color_utils = require("./color-utils");
30
- var import_taper_chroma = require("./taper-chroma");
26
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
27
+ var import_utils = require("./utils.cjs");
28
+ var import_constants = require("./constants.cjs");
29
+ var import_color_utils = require("./color-utils.cjs");
30
+ var import_taper_chroma = require("./taper-chroma.cjs");
31
31
  function cdiff(c1, c2) {
32
32
  return Math.log(c1 / c2);
33
33
  }
@@ -107,4 +107,4 @@ function findColorMeetingRequirements(reference, seed, target, direction, {
107
107
  0 && (module.exports = {
108
108
  findColorMeetingRequirements
109
109
  });
110
- //# sourceMappingURL=find-color-with-constraints.js.map
110
+ //# sourceMappingURL=find-color-with-constraints.cjs.map
@@ -23,11 +23,11 @@ __export(lib_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(lib_exports);
25
25
  var import_fn = require("colorjs.io/fn");
26
- var import_register_color_spaces = require("./register-color-spaces");
27
- var import_color_utils = require("./color-utils");
28
- var import_find_color_with_constraints = require("./find-color-with-constraints");
29
- var import_utils = require("./utils");
30
- var import_constants = require("./constants");
26
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
27
+ var import_color_utils = require("./color-utils.cjs");
28
+ var import_find_color_with_constraints = require("./find-color-with-constraints.cjs");
29
+ var import_utils = require("./utils.cjs");
30
+ var import_constants = require("./constants.cjs");
31
31
  function calculateRamp({
32
32
  seed,
33
33
  sortedSteps,
@@ -226,4 +226,4 @@ function buildRamp(seedArg, config, {
226
226
  0 && (module.exports = {
227
227
  buildRamp
228
228
  });
229
- //# sourceMappingURL=index.js.map
229
+ //# sourceMappingURL=index.cjs.map
@@ -313,4 +313,4 @@ var ACCENT_RAMP_CONFIG = {
313
313
  ACCENT_RAMP_CONFIG,
314
314
  BG_RAMP_CONFIG
315
315
  });
316
- //# sourceMappingURL=ramp-configs.js.map
316
+ //# sourceMappingURL=ramp-configs.cjs.map
@@ -4,4 +4,4 @@ import_fn.ColorSpace.register(import_fn.sRGB);
4
4
  import_fn.ColorSpace.register(import_fn.OKLCH);
5
5
  import_fn.ColorSpace.register(import_fn.P3);
6
6
  import_fn.ColorSpace.register(import_fn.HSL);
7
- //# sourceMappingURL=register-color-spaces.js.map
7
+ //# sourceMappingURL=register-color-spaces.cjs.map
@@ -23,7 +23,7 @@ __export(taper_chroma_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(taper_chroma_exports);
25
25
  var import_fn = require("colorjs.io/fn");
26
- var import_register_color_spaces = require("./register-color-spaces");
26
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
27
27
  function taperChroma(seed, lTarget, options = {}) {
28
28
  const gamut = options.gamut ?? import_fn.sRGB;
29
29
  const alpha = options.alpha ?? 0.65;
@@ -138,4 +138,4 @@ function maxInGamutChromaAtLH(l, h, gamutSpace, cap) {
138
138
  0 && (module.exports = {
139
139
  taperChroma
140
140
  });
141
- //# sourceMappingURL=taper-chroma.js.map
141
+ //# sourceMappingURL=taper-chroma.cjs.map
@@ -15,4 +15,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
15
  // packages/theme/src/color-ramps/lib/types.ts
16
16
  var types_exports = {};
17
17
  module.exports = __toCommonJS(types_exports);
18
- //# sourceMappingURL=types.js.map
18
+ //# sourceMappingURL=types.cjs.map
@@ -27,9 +27,9 @@ __export(utils_exports, {
27
27
  stepsForStep: () => stepsForStep
28
28
  });
29
29
  module.exports = __toCommonJS(utils_exports);
30
- var import_register_color_spaces = require("./register-color-spaces");
31
- var import_constants = require("./constants");
32
- var import_color_utils = require("./color-utils");
30
+ var import_register_color_spaces = require("./register-color-spaces.cjs");
31
+ var import_constants = require("./constants.cjs");
32
+ var import_color_utils = require("./color-utils.cjs");
33
33
  function buildDependencyGraph(config) {
34
34
  const dependencies = /* @__PURE__ */ new Map();
35
35
  const dependents = /* @__PURE__ */ new Map();
@@ -163,4 +163,4 @@ function solveWithBisect(calculateC, calculateValue, initLowerL, initLowerValue,
163
163
  sortByDependency,
164
164
  stepsForStep
165
165
  });
166
- //# sourceMappingURL=utils.js.map
166
+ //# sourceMappingURL=utils.cjs.map
@@ -32,4 +32,4 @@ var ThemeContext = (0, import_element.createContext)({
32
32
  0 && (module.exports = {
33
33
  ThemeContext
34
34
  });
35
- //# sourceMappingURL=context.js.map
35
+ //# sourceMappingURL=context.cjs.map
@@ -22,9 +22,9 @@ __export(index_exports, {
22
22
  privateApis: () => import_private_apis.privateApis
23
23
  });
24
24
  module.exports = __toCommonJS(index_exports);
25
- var import_private_apis = require("./private-apis");
25
+ var import_private_apis = require("./private-apis.cjs");
26
26
  // Annotate the CommonJS export names for ESM import in node:
27
27
  0 && (module.exports = {
28
28
  privateApis
29
29
  });
30
- //# sourceMappingURL=index.js.map
30
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export { privateApis } from './private-apis';\nexport type * from './prebuilt/ts/token-types';\nexport { type ThemeProvider } from './theme-provider';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B;",
6
+ "names": []
7
+ }
@@ -33,4 +33,4 @@ var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnl
33
33
  lock,
34
34
  unlock
35
35
  });
36
- //# sourceMappingURL=lock-unlock.js.map
36
+ //# sourceMappingURL=lock-unlock.cjs.map
@@ -167,4 +167,4 @@ var design_tokens_default = [
167
167
  "--wpds-font-line-height-x-large",
168
168
  "--wpds-font-line-height-2x-large"
169
169
  ];
170
- //# sourceMappingURL=design-tokens.js.map
170
+ //# sourceMappingURL=design-tokens.cjs.map
@@ -156,4 +156,4 @@ var color_tokens_default = {
156
156
  "caution-fgSurface4": ["fg-content-caution"],
157
157
  "caution-fgSurface3": ["fg-content-caution-weak"]
158
158
  };
159
- //# sourceMappingURL=color-tokens.js.map
159
+ //# sourceMappingURL=color-tokens.cjs.map
@@ -0,0 +1,18 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // packages/theme/src/prebuilt/ts/token-types.ts
16
+ var token_types_exports = {};
17
+ module.exports = __toCommonJS(token_types_exports);
18
+ //# sourceMappingURL=token-types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/prebuilt/ts/token-types.ts"],
4
+ "sourcesContent": ["/**\n * This file is generated by the @wordpress/terrazzo-plugin-typescript-types plugin.\n * Do not edit this file directly.\n */\n\n/**\n * Size scale for padding tokens.\n */\nexport type PaddingSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for gap tokens.\n */\nexport type GapSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Size scale for border radius tokens.\n */\nexport type BorderRadiusSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for border width tokens.\n */\nexport type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Target elements that tokens can be applied to.\n */\nexport type Target =\n\t| 'surface'\n\t| 'interactive'\n\t| 'track'\n\t| 'thumb'\n\t| 'content'\n\t| 'focus';\n\n/**\n * Background color variants for surface elements.\n */\nexport type SurfaceBackgroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Background color variants for interactive elements.\n */\nexport type InteractiveBackgroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'brand-weak'\n\t| 'error'\n\t| 'error-strong'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for content text and icons.\n */\nexport type ContentForegroundColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for interactive element text and icons.\n */\nexport type InteractiveForegroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for surface borders.\n */\nexport type SurfaceStrokeColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'success'\n\t| 'success-strong'\n\t| 'info'\n\t| 'info-strong'\n\t| 'warning'\n\t| 'warning-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for interactive element borders.\n */\nexport type InteractiveStrokeColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'error'\n\t| 'error-strong';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -22,9 +22,9 @@ __export(private_apis_exports, {
22
22
  privateApis: () => privateApis
23
23
  });
24
24
  module.exports = __toCommonJS(private_apis_exports);
25
- var import_lock_unlock = require("./lock-unlock");
26
- var import_theme_provider = require("./theme-provider");
27
- var import_use_theme_provider_styles = require("./use-theme-provider-styles");
25
+ var import_lock_unlock = require("./lock-unlock.cjs");
26
+ var import_theme_provider = require("./theme-provider.cjs");
27
+ var import_use_theme_provider_styles = require("./use-theme-provider-styles.cjs");
28
28
  var privateApis = {};
29
29
  (0, import_lock_unlock.lock)(privateApis, {
30
30
  ThemeProvider: import_theme_provider.ThemeProvider,
@@ -34,4 +34,4 @@ var privateApis = {};
34
34
  0 && (module.exports = {
35
35
  privateApis
36
36
  });
37
- //# sourceMappingURL=private-apis.js.map
37
+ //# sourceMappingURL=private-apis.cjs.map
@@ -23,8 +23,8 @@ __export(theme_provider_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(theme_provider_exports);
25
25
  var import_element = require("@wordpress/element");
26
- var import_context = require("./context");
27
- var import_use_theme_provider_styles = require("./use-theme-provider-styles");
26
+ var import_context = require("./context.cjs");
27
+ var import_use_theme_provider_styles = require("./use-theme-provider-styles.cjs");
28
28
 
29
29
  // packages/theme/src/style.module.css
30
30
  var css = `.style-module__root__26kw6 {
@@ -93,4 +93,4 @@ var ThemeProvider = ({
93
93
  0 && (module.exports = {
94
94
  ThemeProvider
95
95
  });
96
- //# sourceMappingURL=theme-provider.js.map
96
+ //# sourceMappingURL=theme-provider.cjs.map
@@ -15,4 +15,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
15
  // packages/theme/src/types.ts
16
16
  var types_exports = {};
17
17
  module.exports = __toCommonJS(types_exports);
18
- //# sourceMappingURL=types.js.map
18
+ //# sourceMappingURL=types.cjs.map
@@ -33,12 +33,12 @@ __export(use_theme_provider_styles_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(use_theme_provider_styles_exports);
35
35
  var import_fn = require("colorjs.io/fn");
36
- var import_memize = __toESM(require("memize"));
36
+ var import_memize = __toESM(require("memize"), 1);
37
37
  var import_element = require("@wordpress/element");
38
- var import_register_color_spaces = require("./color-ramps/lib/register-color-spaces");
39
- var import_context = require("./context");
40
- var import_color_tokens = __toESM(require("./prebuilt/ts/color-tokens"));
41
- var import_color_ramps = require("./color-ramps");
38
+ var import_register_color_spaces = require("./color-ramps/lib/register-color-spaces.cjs");
39
+ var import_context = require("./context.cjs");
40
+ var import_color_tokens = __toESM(require("./prebuilt/ts/color-tokens.cjs"), 1);
41
+ var import_color_ramps = require("./color-ramps/index.cjs");
42
42
  var getCachedBgRamp = (0, import_memize.default)(import_color_ramps.buildBgRamp, { maxSize: 10 });
43
43
  var getCachedAccentRamp = (0, import_memize.default)(import_color_ramps.buildAccentRamp, { maxSize: 10 });
44
44
  var legacyWpComponentsOverridesCSS = [
@@ -229,4 +229,4 @@ function useThemeProviderStyles({
229
229
  0 && (module.exports = {
230
230
  useThemeProviderStyles
231
231
  });
232
- //# sourceMappingURL=use-theme-provider-styles.js.map
232
+ //# sourceMappingURL=use-theme-provider-styles.cjs.map
@@ -1,12 +1,12 @@
1
1
  // packages/theme/src/color-ramps/index.ts
2
2
  import { get, OKLCH, parse } from "colorjs.io/fn";
3
- import "./lib/register-color-spaces";
4
- import { buildRamp } from "./lib/index";
5
- import { clampAccentScaleReferenceLightness } from "./lib/utils";
6
- import { BG_RAMP_CONFIG, ACCENT_RAMP_CONFIG } from "./lib/ramp-configs";
7
- import { getContrast } from "./lib/color-utils";
8
- import { CONTRAST_COMBINATIONS } from "./lib/constants";
9
- import { DEFAULT_SEED_COLORS } from "./lib/constants";
3
+ import "./lib/register-color-spaces.js";
4
+ import { buildRamp } from "./lib/index.js";
5
+ import { clampAccentScaleReferenceLightness } from "./lib/utils.js";
6
+ import { BG_RAMP_CONFIG, ACCENT_RAMP_CONFIG } from "./lib/ramp-configs.js";
7
+ import { getContrast } from "./lib/color-utils.js";
8
+ import { CONTRAST_COMBINATIONS } from "./lib/constants.js";
9
+ import { DEFAULT_SEED_COLORS } from "./lib/constants.js";
10
10
  function buildBgRamp(seed) {
11
11
  if (typeof seed !== "string" || seed.trim() === "") {
12
12
  throw new Error("Seed color must be a non-empty string");
@@ -7,7 +7,7 @@ import {
7
7
  sRGB,
8
8
  OKLCH
9
9
  } from "colorjs.io/fn";
10
- import "./register-color-spaces";
10
+ import "./register-color-spaces.js";
11
11
  function getColorString(color) {
12
12
  return serialize(to(color, sRGB), { format: "hex", inGamut: true });
13
13
  }
@@ -1,6 +1,6 @@
1
1
  // packages/theme/src/color-ramps/lib/constants.ts
2
2
  import { to, OKLCH } from "colorjs.io/fn";
3
- import "./register-color-spaces";
3
+ import "./register-color-spaces.js";
4
4
  var WHITE = to("white", OKLCH);
5
5
  var BLACK = to("black", OKLCH);
6
6
  var UNIVERSAL_CONTRAST_TOPUP = 0.02;
@@ -1,10 +1,10 @@
1
1
  // packages/theme/src/color-ramps/lib/find-color-with-constraints.ts
2
2
  import { get, OKLCH } from "colorjs.io/fn";
3
- import "./register-color-spaces";
4
- import { solveWithBisect } from "./utils";
5
- import { WHITE, BLACK, CONTRAST_EPSILON } from "./constants";
6
- import { clampToGamut, getContrast } from "./color-utils";
7
- import { taperChroma } from "./taper-chroma";
3
+ import "./register-color-spaces.js";
4
+ import { solveWithBisect } from "./utils.js";
5
+ import { WHITE, BLACK, CONTRAST_EPSILON } from "./constants.js";
6
+ import { clampToGamut, getContrast } from "./color-utils.js";
7
+ import { taperChroma } from "./taper-chroma.js";
8
8
  function cdiff(c1, c2) {
9
9
  return Math.log(c1 / c2);
10
10
  }
@@ -6,17 +6,17 @@ import {
6
6
  parse,
7
7
  set
8
8
  } from "colorjs.io/fn";
9
- import "./register-color-spaces";
10
- import { clampToGamut, getContrast, getColorString } from "./color-utils";
11
- import { findColorMeetingRequirements } from "./find-color-with-constraints";
9
+ import "./register-color-spaces.js";
10
+ import { clampToGamut, getContrast, getColorString } from "./color-utils.js";
11
+ import { findColorMeetingRequirements } from "./find-color-with-constraints.js";
12
12
  import {
13
13
  sortByDependency,
14
14
  computeBetterFgColorDirection,
15
15
  adjustContrastTarget,
16
16
  stepsForStep,
17
17
  solveWithBisect
18
- } from "./utils";
19
- import { CONTRAST_EPSILON } from "./constants";
18
+ } from "./utils.js";
19
+ import { CONTRAST_EPSILON } from "./constants.js";
20
20
  function calculateRamp({
21
21
  seed,
22
22
  sortedSteps,
@@ -5,7 +5,7 @@ import {
5
5
  OKLCH,
6
6
  sRGB
7
7
  } from "colorjs.io/fn";
8
- import "./register-color-spaces";
8
+ import "./register-color-spaces.js";
9
9
  function taperChroma(seed, lTarget, options = {}) {
10
10
  const gamut = options.gamut ?? sRGB;
11
11
  const alpha = options.alpha ?? 0.65;
@@ -1,5 +1,5 @@
1
1
  // packages/theme/src/color-ramps/lib/utils.ts
2
- import "./register-color-spaces";
2
+ import "./register-color-spaces.js";
3
3
  import {
4
4
  WHITE,
5
5
  BLACK,
@@ -8,8 +8,8 @@ import {
8
8
  ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS,
9
9
  MAX_BISECTION_ITERATIONS,
10
10
  CONTRAST_EPSILON
11
- } from "./constants";
12
- import { getContrast } from "./color-utils";
11
+ } from "./constants.js";
12
+ import { getContrast } from "./color-utils.js";
13
13
  function buildDependencyGraph(config) {
14
14
  const dependencies = /* @__PURE__ */ new Map();
15
15
  const dependents = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
1
  // packages/theme/src/index.ts
2
- import { privateApis } from "./private-apis";
2
+ import { privateApis } from "./private-apis.js";
3
3
  export {
4
4
  privateApis
5
5
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["// Private APIs.\nexport { privateApis } from './private-apis';\n"],
5
- "mappings": ";AACA,SAAS,mBAAmB;",
4
+ "sourcesContent": ["export { privateApis } from './private-apis';\nexport type * from './prebuilt/ts/token-types';\nexport { type ThemeProvider } from './theme-provider';\n"],
5
+ "mappings": ";AAAA,SAAS,mBAAmB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=token-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  // packages/theme/src/private-apis.ts
2
- import { lock } from "./lock-unlock";
3
- import { ThemeProvider } from "./theme-provider";
4
- import { useThemeProviderStyles } from "./use-theme-provider-styles";
2
+ import { lock } from "./lock-unlock.js";
3
+ import { ThemeProvider } from "./theme-provider.js";
4
+ import { useThemeProviderStyles } from "./use-theme-provider-styles.js";
5
5
  var privateApis = {};
6
6
  lock(privateApis, {
7
7
  ThemeProvider,