@adobe/spectrum-component-api-schemas 5.0.1 → 6.1.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 (96) hide show
  1. package/CHANGELOG.md +187 -184
  2. package/index.js +28 -12
  3. package/moon.yml +1 -4
  4. package/package.json +6 -5
  5. package/scripts/convert-to-spec-format.mjs +136 -0
  6. package/test/index.test.js +64 -34
  7. package/test/integration.test.js +4 -6
  8. package/test/performance.test.js +10 -10
  9. package/test/schema-validation.test.js +64 -105
  10. package/test/snapshots/index.test.js.md +36 -34
  11. package/schemas/component.json +0 -29
  12. package/schemas/components/accordion.json +0 -74
  13. package/schemas/components/action-bar.json +0 -18
  14. package/schemas/components/action-button.json +0 -62
  15. package/schemas/components/action-group.json +0 -69
  16. package/schemas/components/alert-banner.json +0 -29
  17. package/schemas/components/alert-dialog.json +0 -42
  18. package/schemas/components/avatar-group.json +0 -22
  19. package/schemas/components/avatar.json +0 -45
  20. package/schemas/components/badge.json +0 -69
  21. package/schemas/components/body.json +0 -25
  22. package/schemas/components/bottom-navigation-android.json +0 -37
  23. package/schemas/components/breadcrumbs.json +0 -72
  24. package/schemas/components/button-group.json +0 -33
  25. package/schemas/components/button.json +0 -61
  26. package/schemas/components/calendar.json +0 -109
  27. package/schemas/components/cards.json +0 -238
  28. package/schemas/components/checkbox-group.json +0 -49
  29. package/schemas/components/checkbox.json +0 -49
  30. package/schemas/components/close-button.json +0 -35
  31. package/schemas/components/coach-indicator.json +0 -34
  32. package/schemas/components/coach-mark.json +0 -51
  33. package/schemas/components/code.json +0 -21
  34. package/schemas/components/color-area.json +0 -64
  35. package/schemas/components/color-handle.json +0 -31
  36. package/schemas/components/color-loupe.json +0 -21
  37. package/schemas/components/color-slider.json +0 -66
  38. package/schemas/components/color-wheel.json +0 -47
  39. package/schemas/components/combo-box.json +0 -80
  40. package/schemas/components/contextual-help.json +0 -67
  41. package/schemas/components/date-picker.json +0 -157
  42. package/schemas/components/detail.json +0 -26
  43. package/schemas/components/divider.json +0 -23
  44. package/schemas/components/drop-zone.json +0 -41
  45. package/schemas/components/field-label.json +0 -39
  46. package/schemas/components/heading.json +0 -29
  47. package/schemas/components/help-text.json +0 -36
  48. package/schemas/components/illustrated-message.json +0 -52
  49. package/schemas/components/in-field-progress-button.json +0 -31
  50. package/schemas/components/in-field-progress-circle.json +0 -22
  51. package/schemas/components/in-line-alert.json +0 -43
  52. package/schemas/components/link.json +0 -32
  53. package/schemas/components/list-view.json +0 -106
  54. package/schemas/components/menu.json +0 -63
  55. package/schemas/components/meter.json +0 -44
  56. package/schemas/components/number-field.json +0 -57
  57. package/schemas/components/opacity-checkerboard.json +0 -21
  58. package/schemas/components/picker.json +0 -95
  59. package/schemas/components/popover.json +0 -65
  60. package/schemas/components/progress-bar.json +0 -64
  61. package/schemas/components/progress-circle.json +0 -41
  62. package/schemas/components/radio-button.json +0 -30
  63. package/schemas/components/radio-group.json +0 -58
  64. package/schemas/components/rating.json +0 -34
  65. package/schemas/components/scroll-zoom-bar.json +0 -44
  66. package/schemas/components/search-field.json +0 -58
  67. package/schemas/components/segmented-control.json +0 -72
  68. package/schemas/components/select-box.json +0 -50
  69. package/schemas/components/side-navigation.json +0 -77
  70. package/schemas/components/slider.json +0 -79
  71. package/schemas/components/standard-dialog.json +0 -53
  72. package/schemas/components/standard-panel.json +0 -49
  73. package/schemas/components/status-light.json +0 -51
  74. package/schemas/components/steplist.json +0 -52
  75. package/schemas/components/swatch-group.json +0 -44
  76. package/schemas/components/swatch.json +0 -46
  77. package/schemas/components/switch.json +0 -42
  78. package/schemas/components/tab-bar-ios.json +0 -37
  79. package/schemas/components/table.json +0 -144
  80. package/schemas/components/tabs.json +0 -75
  81. package/schemas/components/tag-field.json +0 -42
  82. package/schemas/components/tag-group.json +0 -31
  83. package/schemas/components/tag.json +0 -41
  84. package/schemas/components/takeover-dialog.json +0 -60
  85. package/schemas/components/text-area.json +0 -92
  86. package/schemas/components/text-field.json +0 -80
  87. package/schemas/components/thumbnail.json +0 -22
  88. package/schemas/components/toast.json +0 -29
  89. package/schemas/components/tooltip.json +0 -50
  90. package/schemas/components/tray.json +0 -17
  91. package/schemas/components/tree-view.json +0 -50
  92. package/schemas/types/hex-color.json +0 -8
  93. package/schemas/types/typography-classification.json +0 -9
  94. package/schemas/types/typography-script.json +0 -9
  95. package/schemas/types/workflow-icon.json +0 -901
  96. package/test/componentSchemaValidator.test.js +0 -74
package/CHANGELOG.md CHANGED
@@ -1,10 +1,53 @@
1
1
  # [**@adobe/spectrum-component-api-schemas**](https://github.com/adobe/spectrum-component-api-schemas)
2
2
 
3
+ ## 6.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#855](https://github.com/adobe/spectrum-design-data/pull/855) [`c9002db`](https://github.com/adobe/spectrum-design-data/commit/c9002db2da1d1bb40446b4991648dc7809a55f33) Thanks [@GarthDB](https://github.com/GarthDB)! - feat(component-schemas): migrate source of truth to design-data-spec components
8
+
9
+ `@adobe/spectrum-component-api-schemas` is now a thin adapter over
10
+ `@adobe/design-data-spec/components/`. All 80 component declarations have been
11
+ converted to the new format and live in `packages/design-data-spec/components/`.
12
+
13
+ The API surface is unchanged: `getAllSchemas()`, `getAllSlugs()`,
14
+ `getSchemaBySlug()`, `getSchemaFile()`, and `schemaFileNames` all behave
15
+ identically. Returned objects now include new fields (`name`, `displayName`,
16
+ `options`, `states`, `lifecycle`) alongside the existing aliases (`title`,
17
+ `properties`, `slug`) — no consumer breakage.
18
+
19
+ `@adobe/design-data-spec` minor: 79 component declarations added to
20
+ `components/`. `optionDescriptor` in `component.schema.json` now allows
21
+ additional JSON Schema keywords (`pattern`, `minimum`, `items`, etc.)
22
+ to accommodate real-world component option descriptors.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [[`c9002db`](https://github.com/adobe/spectrum-design-data/commit/c9002db2da1d1bb40446b4991648dc7809a55f33)]:
27
+ - @adobe/design-data-spec@0.4.0
28
+
29
+ ## 6.0.0
30
+
31
+ ### Major Changes
32
+
33
+ - [#632](https://github.com/adobe/spectrum-design-data/pull/632) [`fa28b11`](https://github.com/adobe/spectrum-design-data/commit/fa28b117c6b84776f4ebe9bb281c29e14e0d64b6) Thanks [@GarthDB](https://github.com/GarthDB)! - BREAKING CHANGE: Repository renamed from spectrum-tokens to
34
+ spectrum-design-data
35
+
36
+ **Breaking Changes:**
37
+ - JSON Schema `$id` URIs changed (spectrum-tokens → spectrum-design-data)
38
+ - External tools referencing schemas by `$id` must update references
39
+
40
+ **Changes:**
41
+ - Updated all GitHub repository and Pages URLs
42
+ - Updated schema base URIs to maintain consistency
43
+
44
+ **Note:** NPM package names unchanged. GitHub redirects are in place.
45
+
3
46
  ## 5.0.1
4
47
 
5
48
  ### Patch Changes
6
49
 
7
- * [#621](https://github.com/adobe/spectrum-tokens/pull/621) [`ee2ceb5`](https://github.com/adobe/spectrum-tokens/commit/ee2ceb541dea5eb9b5267c861e44bfd804fd33a7) Thanks [@GarthDB](https://github.com/GarthDB)! - refactor(component-schemas): rename step-list to steplist
50
+ - [#621](https://github.com/adobe/spectrum-design-data/pull/621) [`ee2ceb5`](https://github.com/adobe/spectrum-design-data/commit/ee2ceb541dea5eb9b5267c861e44bfd804fd33a7) Thanks [@GarthDB](https://github.com/GarthDB)! - refactor(component-schemas): rename step-list to steplist
8
51
 
9
52
  Renamed the `step-list` component schema to `steplist` for consistency with other single-word component names.
10
53
 
@@ -15,14 +58,12 @@
15
58
  **New Branch:** `refactor/rename-step-list-to-steplist`
16
59
 
17
60
  ### 📦 Renamed Component
18
-
19
- * `step-list` → `steplist` - Component schema renamed
61
+ - `step-list` → `steplist` - Component schema renamed
20
62
 
21
63
  ### Changes to steplist schema
22
-
23
- * **$id**: Changed from `https://opensource.adobe.com/spectrum-tokens/schemas/components/step-list.json` to `https://opensource.adobe.com/spectrum-tokens/schemas/components/steplist.json`
24
- * **title**: Changed from "Step list" to "Steplist"
25
- * **documentationUrl**: Changed from `https://spectrum.adobe.com/page/step-list/` to `https://spectrum.adobe.com/page/steplist/`
64
+ - **$id**: Changed from `https://opensource.adobe.com/spectrum-design-data/schemas/components/step-list.json` to `https://opensource.adobe.com/spectrum-design-data/schemas/components/steplist.json`
65
+ - **title**: Changed from "Step list" to "Steplist"
66
+ - **documentationUrl**: Changed from `https://spectrum.adobe.com/page/step-list/` to `https://spectrum.adobe.com/page/steplist/`
26
67
 
27
68
  All other properties remain unchanged. This is a non-breaking rename at the schema level, though consumers referencing the old filename will need to update their imports.
28
69
 
@@ -30,7 +71,7 @@
30
71
 
31
72
  ### Major Changes
32
73
 
33
- * [#614](https://github.com/adobe/spectrum-tokens/pull/614) [`a772572`](https://github.com/adobe/spectrum-tokens/commit/a772572de88c54d279c20d7148f6ac91eb941d2a) Thanks [@AmunMRa](https://github.com/AmunMRa)! - # Component Schemas Changed (9 added, 0 deleted, 3 updated)
74
+ - [#614](https://github.com/adobe/spectrum-design-data/pull/614) [`a772572`](https://github.com/adobe/spectrum-design-data/commit/a772572de88c54d279c20d7148f6ac91eb941d2a) Thanks [@AmunMRa](https://github.com/AmunMRa)! - # Component Schemas Changed (9 added, 0 deleted, 3 updated)
34
75
 
35
76
  **Original Branch:** `main`
36
77
 
@@ -41,40 +82,36 @@
41
82
  This PR introduces **2 breaking change(s)** to component schemas. Please review carefully and ensure proper versioning.
42
83
 
43
84
  ### 📦 Added Components (9)
44
-
45
- * `calendar` - New component schema
46
- * `cards` - New component schema
47
- * `coach-mark` - New component schema
48
- * `illustrated-message` - New component schema
49
- * `list-view` - New component schema
50
- * `standard-dialog` - New component schema
51
- * `standard-panel` - New component schema
52
- * `table` - New component schema
53
- * `takeover-dialog` - New component schema
85
+ - `calendar` - New component schema
86
+ - `cards` - New component schema
87
+ - `coach-mark` - New component schema
88
+ - `illustrated-message` - New component schema
89
+ - `list-view` - New component schema
90
+ - `standard-dialog` - New component schema
91
+ - `standard-panel` - New component schema
92
+ - `table` - New component schema
93
+ - `takeover-dialog` - New component schema
54
94
 
55
95
  ### 💥 Breaking Updates ⚠️ BREAKING
56
96
 
57
97
  **picker**
58
-
59
- * Removed: `isReadOnly` property
98
+ - Removed: `isReadOnly` property
60
99
 
61
100
  **side-navigation**
62
-
63
- * Added: `items` (array) - "The list of navigation items."
64
- * Added: `selectionMode` (string, default: single) - "How selection is handled for items."
65
- * Added: `required` - \["items"]
101
+ - Added: `items` (array) - "The list of navigation items."
102
+ - Added: `selectionMode` (string, default: single) - "How selection is handled for items."
103
+ - Added: `required` - \["items"]
66
104
 
67
105
  ### 🔄 Non-Breaking Updates
68
106
 
69
107
  **alert-banner**
70
-
71
- * Added: `variant`
108
+ - Added: `variant`
72
109
 
73
110
  ## 4.0.0
74
111
 
75
112
  ### Major Changes
76
113
 
77
- * [#613](https://github.com/adobe/spectrum-tokens/pull/613) [`433efdd`](https://github.com/adobe/spectrum-tokens/commit/433efdd18f9b0842ae55acac3cd0fbc1e5e5db58) Thanks [@AmunMRa](https://github.com/AmunMRa)! - feat(component-schemas): add 10 new components with breaking changes to existing schemas
114
+ - [#613](https://github.com/adobe/spectrum-design-data/pull/613) [`433efdd`](https://github.com/adobe/spectrum-design-data/commit/433efdd18f9b0842ae55acac3cd0fbc1e5e5db58) Thanks [@AmunMRa](https://github.com/AmunMRa)! - feat(component-schemas): add 10 new components with breaking changes to existing schemas
78
115
 
79
116
  ## Component Schemas Changed (10 added, 0 deleted, 17 updated)
80
117
 
@@ -103,103 +140,86 @@
103
140
  <details open><summary><strong>💥 Breaking Updates ⚠️ BREAKING</strong></summary>
104
141
 
105
142
  **checkbox-group**
106
-
107
- * Removed: `isReadOnly` property
143
+ - Removed: `isReadOnly` property
108
144
 
109
145
  **combo-box**
110
-
111
- * Added: `labelPosition`
112
- * Removed: `isQuiet` property
146
+ - Added: `labelPosition`
147
+ - Removed: `isQuiet` property
113
148
 
114
149
  **contextual-help**
115
-
116
- * Added: `href` (string) - "Optional URL within contextual help content like a 'Learn more' link."
117
- * Removed: `popoverOffset` property
118
- * Updated: `popoverOffset` - default changed to "8"
150
+ - Added: `href` (string) - "Optional URL within contextual help content like a 'Learn more' link."
151
+ - Removed: `popoverOffset` property
152
+ - Updated: `popoverOffset` - default changed to "8"
119
153
 
120
154
  **radio-button**
121
-
122
- * Added: `label` - "The text displayed next to a radio button."
123
- * Removed: `label` property
124
- * Updated: `label`
155
+ - Added: `label` - "The text displayed next to a radio button."
156
+ - Removed: `label` property
157
+ - Updated: `label`
125
158
 
126
159
  **radio-group**
127
-
128
- * Removed: `isReadOnly` property
160
+ - Removed: `isReadOnly` property
129
161
 
130
162
  **tabs**
131
-
132
- * Added: `items` (array) - "An array of tab items."
133
- * Removed: `size` property
134
- * Removed: `density` property
135
- * Removed: `isFluid` property
136
- * Removed: `isQuiet` property
137
- * Removed: `isEmphasized` property
138
- * Removed: `alignment` property
139
- * Removed: `selectedItem` property
140
- * Removed: `keyboardActivation` property
141
- * Updated: `orientation` - default changed to "horizontal"
163
+ - Added: `items` (array) - "An array of tab items."
164
+ - Removed: `size` property
165
+ - Removed: `density` property
166
+ - Removed: `isFluid` property
167
+ - Removed: `isQuiet` property
168
+ - Removed: `isEmphasized` property
169
+ - Removed: `alignment` property
170
+ - Removed: `selectedItem` property
171
+ - Removed: `keyboardActivation` property
172
+ - Updated: `orientation` - default changed to "horizontal"
142
173
 
143
174
  **tree-view**
144
-
145
- * Added: `isEmphasized` (boolean)
146
- * Removed: `emphasized` property
175
+ - Added: `isEmphasized` (boolean)
176
+ - Removed: `emphasized` property
147
177
 
148
178
  </details>
149
179
 
150
180
  <details><summary><strong>🔄 Non-Breaking Updates</strong></summary>
151
181
 
152
182
  **breadcrumbs**
153
-
154
- * Added: `isMultiline` (boolean) - "If true, the breadcrumb items will wrap to multiple lines."
155
- * Added: `size` (string, default: m) - "Controls the overall size of the breadcrumb component."
156
- * Added: `items` (array) - "An array of breadcrumb items."
157
- * Added: `separator` (string, default: chevron) - "The separator icon used between breadcrumb items."
158
- * Added: `isTruncated` (boolean) - "If true, the breadcrumb item is truncated and displayed as icon only."
159
- * Added: `sizeOverride` (string) - "Overrides the size of the breadcrumb items when isMultiline is true."
183
+ - Added: `isMultiline` (boolean) - "If true, the breadcrumb items will wrap to multiple lines."
184
+ - Added: `size` (string, default: m) - "Controls the overall size of the breadcrumb component."
185
+ - Added: `items` (array) - "An array of breadcrumb items."
186
+ - Added: `separator` (string, default: chevron) - "The separator icon used between breadcrumb items."
187
+ - Added: `isTruncated` (boolean) - "If true, the breadcrumb item is truncated and displayed as icon only."
188
+ - Added: `sizeOverride` (string) - "Overrides the size of the breadcrumb items when isMultiline is true."
160
189
 
161
190
  **menu**
162
-
163
- * Updated: `container` - removed `default: null`
164
- * Updated: `selectionMode` - removed `default: null` and added `"no selection"` to enum
191
+ - Updated: `container` - removed `default: null`
192
+ - Updated: `selectionMode` - removed `default: null` and added `"no selection"` to enum
165
193
 
166
194
  **button-group**
167
-
168
- * Added: `overflowMode` (string, default: wrap)
195
+ - Added: `overflowMode` (string, default: wrap)
169
196
 
170
197
  **color-slider**
171
-
172
- * Added: `channel` (string, default: hue) - "Which channel of the color this slider controls. Use 'alpha' for opacity."
173
- * Updated: `value` - "Number (from minValue to maxValue)."
198
+ - Added: `channel` (string, default: hue) - "Which channel of the color this slider controls. Use 'alpha' for opacity."
199
+ - Updated: `value` - "Number (from minValue to maxValue)."
174
200
 
175
201
  **divider**
176
-
177
- * Updated: `size` - default changed to "s"
202
+ - Updated: `size` - default changed to "s"
178
203
 
179
204
  **in-line-alert**
180
-
181
- * Added: `style` (string, default: outline) - "The visual style of the alert."
182
- * Added: `href` (string) - "Optional URL within in-line alert content like a 'Learn more' link."
183
- * Added: `heading` (string) - "Optional heading text displayed at the top of the alert."
184
- * Added: `actionLabel` (string) - "If undefined, this button does not appear."
185
- * Updated: `variant`
205
+ - Added: `style` (string, default: outline) - "The visual style of the alert."
206
+ - Added: `href` (string) - "Optional URL within in-line alert content like a 'Learn more' link."
207
+ - Added: `heading` (string) - "Optional heading text displayed at the top of the alert."
208
+ - Added: `actionLabel` (string) - "If undefined, this button does not appear."
209
+ - Updated: `variant`
186
210
 
187
211
  **slider**
188
-
189
- * Added: `isRange` (boolean) - "If true, the slider will allow selection of a range of values by displaying two handles."
212
+ - Added: `isRange` (boolean) - "If true, the slider will allow selection of a range of values by displaying two handles."
190
213
 
191
214
  **swatch-group**
192
-
193
- * Added: `cornerRadius` (string, default: none) - "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75."
215
+ - Added: `cornerRadius` (string, default: none) - "Determines the corner radius of each swatch in the group. Partial refers to corner-radius-75."
194
216
 
195
217
  **swatch**
196
-
197
- * Added: `cornerRounding` - "Determines the corner radius of the swatch. Partial refers to corner-radius-75."
198
- * Updated: `cornerRounding` - default changed to "none"
218
+ - Added: `cornerRounding` - "Determines the corner radius of the swatch. Partial refers to corner-radius-75."
219
+ - Updated: `cornerRounding` - default changed to "none"
199
220
 
200
221
  **text-field**
201
-
202
- * Updated: `isError` - "If there is an error, this property overrides show valid icon."
222
+ - Updated: `isError` - "If there is an error, this property overrides show valid icon."
203
223
 
204
224
  </details>
205
225
 
@@ -207,7 +227,7 @@
207
227
 
208
228
  ### Major Changes
209
229
 
210
- * [#610](https://github.com/adobe/spectrum-tokens/pull/610) [`13d9202`](https://github.com/adobe/spectrum-tokens/commit/13d920273c02c78d3748522de6a7c7ee39b39814) Thanks [@GarthDB](https://github.com/GarthDB)! - Component schema improvements for Batch 1 components
230
+ - [#610](https://github.com/adobe/spectrum-design-data/pull/610) [`13d9202`](https://github.com/adobe/spectrum-design-data/commit/13d920273c02c78d3748522de6a7c7ee39b39814) Thanks [@GarthDB](https://github.com/GarthDB)! - Component schema improvements for Batch 1 components
211
231
 
212
232
  Quality control pass on the Design API table for v0, ensuring schema consistency and completeness across S2 components.
213
233
 
@@ -223,31 +243,26 @@
223
243
  <details open><summary><strong>💥 Breaking Updates</strong></summary>
224
244
 
225
245
  **popover**
226
-
227
- * Added: `hideTip` (boolean, default: false) - replaces removed `showTip`
246
+ - Added: `hideTip` (boolean, default: false) - replaces removed `showTip`
228
247
 
229
248
  **rating**
230
-
231
- * Added: `value.minimum` (0), `value.maximum` (5), `value.multipleOf` (0.5)
232
- * Updated: `value.description` - "From 0 to 5, can be a decimal to represent half stars"
249
+ - Added: `value.minimum` (0), `value.maximum` (5), `value.multipleOf` (0.5)
250
+ - Updated: `value.description` - "From 0 to 5, can be a decimal to represent half stars"
233
251
 
234
252
  **select-box**
235
-
236
- * Added: `hideIllustration` (boolean, default: false) - replaces removed `showIllustration`
237
- * Added: `isDisabled` (boolean, default: false)
238
- * Added: `multiple` (boolean, default: false) - "Set to true to allow multiple selections"
239
- * Updated: `orientation.default` changed to "vertical"
253
+ - Added: `hideIllustration` (boolean, default: false) - replaces removed `showIllustration`
254
+ - Added: `isDisabled` (boolean, default: false)
255
+ - Added: `multiple` (boolean, default: false) - "Set to true to allow multiple selections"
256
+ - Updated: `orientation.default` changed to "vertical"
240
257
 
241
258
  **status-light**
242
-
243
- * Added: Colors to `variant.enum`: "gray", "red", "orange", "green", "cyan"
244
- * Added: `required` - \["label"] - label is now required
245
- * Removed: `isDisabled` property
259
+ - Added: Colors to `variant.enum`: "gray", "red", "orange", "green", "cyan"
260
+ - Added: `required` - \["label"] - label is now required
261
+ - Removed: `isDisabled` property
246
262
 
247
263
  **tooltip**
248
-
249
- * Removed: "positive" from `variant.enum`
250
- * Updated: `hasIcon.description` - "If the neutral variant, there is never an icon"
264
+ - Removed: "positive" from `variant.enum`
265
+ - Updated: `hasIcon.description` - "If the neutral variant, there is never an icon"
251
266
 
252
267
  </details>
253
268
 
@@ -256,32 +271,26 @@
256
271
  <details><summary><strong>🔄 Compatible Changes</strong></summary>
257
272
 
258
273
  **help-text**
259
-
260
- * Added: "negative" to `variant.enum`
261
- * Added: `isDisabled.description` - "Help text cannot be both disabled and negative variant"
274
+ - Added: "negative" to `variant.enum`
275
+ - Added: `isDisabled.description` - "Help text cannot be both disabled and negative variant"
262
276
 
263
277
  **meter**
264
-
265
- * Added: `hideLabel` (boolean, default: false)
278
+ - Added: `hideLabel` (boolean, default: false)
266
279
 
267
280
  **progress-bar**
268
-
269
- * Added: `staticColor` (string, enum: \["white"]) - "Static color can only be white, otherwise it is default"
270
- * Added: `labelPosition` (string, enum: \["top", "side"], default: "top")
271
- * Added: `hideLabel` (boolean, default: false)
281
+ - Added: `staticColor` (string, enum: \["white"]) - "Static color can only be white, otherwise it is default"
282
+ - Added: `labelPosition` (string, enum: \["top", "side"], default: "top")
283
+ - Added: `hideLabel` (boolean, default: false)
272
284
 
273
285
  **search-field**
274
-
275
- * Added: `hideLabel` (boolean, default: false)
276
- * Added: `icon` ($ref: workflow-icon.json) - "Icon must be present if the label is not defined"
286
+ - Added: `hideLabel` (boolean, default: false)
287
+ - Added: `icon` ($ref: workflow-icon.json) - "Icon must be present if the label is not defined"
277
288
 
278
289
  **text-area**
279
-
280
- * Added: `hideLabel` (boolean, default: false)
290
+ - Added: `hideLabel` (boolean, default: false)
281
291
 
282
292
  **text-field**
283
-
284
- * Added: `hideLabel` (boolean, default: false)
293
+ - Added: `hideLabel` (boolean, default: false)
285
294
 
286
295
  </details>
287
296
 
@@ -289,126 +298,120 @@
289
298
 
290
299
  ### Major Changes
291
300
 
292
- * [#581](https://github.com/adobe/spectrum-tokens/pull/581) [`163fe7c`](https://github.com/adobe/spectrum-tokens/commit/163fe7c13bb00c639d202195a398126b6c25b58f) Thanks [@GarthDB](https://github.com/GarthDB)! - feat(component-schemas): add S2 Batch 2 components with breaking changes
293
- * Add 6 new component schemas (coach-indicator, in-field-progress-button, etc.)
294
- * Update avatar, badge, and checkbox components with breaking changes
295
- * Expand size options and add new interaction states
296
- * Major version bump required due to breaking schema changes
301
+ - [#581](https://github.com/adobe/spectrum-design-data/pull/581) [`163fe7c`](https://github.com/adobe/spectrum-design-data/commit/163fe7c13bb00c639d202195a398126b6c25b58f) Thanks [@GarthDB](https://github.com/GarthDB)! - feat(component-schemas): add S2 Batch 2 components with breaking changes
302
+ - Add 6 new component schemas (coach-indicator, in-field-progress-button, etc.)
303
+ - Update avatar, badge, and checkbox components with breaking changes
304
+ - Expand size options and add new interaction states
305
+ - Major version bump required due to breaking schema changes
297
306
 
298
307
  ## 1.0.2
299
308
 
300
309
  ### Patch Changes
301
310
 
302
- * [#545](https://github.com/adobe/spectrum-tokens/pull/545) [`ebc79f6`](https://github.com/adobe/spectrum-tokens/commit/ebc79f6f91bce28a64cddfc2cc5548ddcf30389d) Thanks [@GarthDB](https://github.com/GarthDB)! - Fixed a typo where meter had `valueLable` instead of `valueLabel`.
311
+ - [#545](https://github.com/adobe/spectrum-design-data/pull/545) [`ebc79f6`](https://github.com/adobe/spectrum-design-data/commit/ebc79f6f91bce28a64cddfc2cc5548ddcf30389d) Thanks [@GarthDB](https://github.com/GarthDB)! - Fixed a typo where meter had `valueLable` instead of `valueLabel`.
303
312
 
304
313
  ## 1.0.1
305
314
 
306
315
  ### Patch Changes
307
316
 
308
- * [#523](https://github.com/adobe/spectrum-tokens/pull/523) [`9c5a2ac`](https://github.com/adobe/spectrum-tokens/commit/9c5a2ac5fccb29b6f106396b21d91aab949043d4) Thanks [@GarthDB](https://github.com/GarthDB)! - S2 components batch 1 (part 2)
317
+ - [#523](https://github.com/adobe/spectrum-design-data/pull/523) [`9c5a2ac`](https://github.com/adobe/spectrum-design-data/commit/9c5a2ac5fccb29b6f106396b21d91aab949043d4) Thanks [@GarthDB](https://github.com/GarthDB)! - S2 components batch 1 (part 2)
309
318
 
310
319
  ## Changes
311
320
 
312
321
  ### Properties added
313
-
314
- * component: select-box
315
- * `body`
322
+ - component: select-box
323
+ - `body`
316
324
 
317
325
  ### Properties updated
318
-
319
- * component: text-area
320
- * `errorMessage`
321
- * removed: `"default": null`
326
+ - component: text-area
327
+ - `errorMessage`
328
+ - removed: `"default": null`
322
329
 
323
330
  ## 1.0.0
324
331
 
325
332
  ### Major Changes
326
333
 
327
- * [#520](https://github.com/adobe/spectrum-tokens/pull/520) [`2964807`](https://github.com/adobe/spectrum-tokens/commit/2964807641908e40820bea0556b3b0542503223b) Thanks [@GarthDB](https://github.com/GarthDB) and [@AmunMRa](https://github.com/AmunMRa)! - S2 components batch 1
334
+ - [#520](https://github.com/adobe/spectrum-design-data/pull/520) [`2964807`](https://github.com/adobe/spectrum-design-data/commit/2964807641908e40820bea0556b3b0542503223b) Thanks [@GarthDB](https://github.com/GarthDB) and [@AmunMRa](https://github.com/AmunMRa)! - S2 components batch 1
328
335
 
329
336
  ## Changes
330
337
 
331
338
  ### Properties Added
332
-
333
- * component: search-field
334
- * `helpText`
335
- * `placeholder`
336
- * `state`:
337
- * `down`
338
- * component: status-light
339
- * `variant`
340
- * `seafoam`
341
- * `pink`
342
- * `turquoise`
343
- * `cinnamon`
344
- * `brown`
345
- * `silver`
346
- * component: text-area
347
- * `helpText`
348
- * component: text-field
349
- * `helpText`
339
+ - component: search-field
340
+ - `helpText`
341
+ - `placeholder`
342
+ - `state`:
343
+ - `down`
344
+ - component: status-light
345
+ - `variant`
346
+ - `seafoam`
347
+ - `pink`
348
+ - `turquoise`
349
+ - `cinnamon`
350
+ - `brown`
351
+ - `silver`
352
+ - component: text-area
353
+ - `helpText`
354
+ - component: text-field
355
+ - `helpText`
350
356
 
351
357
  ### Properties removed
352
-
353
- * component: search-field
354
- * `isQuiet`
355
- * component: text-area
356
- * `isQuiet`
357
- * `isReadOnly`
358
- * component: text-field
359
- * `isQuiet`
360
- * `isReadOnly`
358
+ - component: search-field
359
+ - `isQuiet`
360
+ - component: text-area
361
+ - `isQuiet`
362
+ - `isReadOnly`
363
+ - component: text-field
364
+ - `isQuiet`
365
+ - `isReadOnly`
361
366
 
362
367
  ### Properties updated
363
-
364
- * component: meter
365
- * `size`:
366
- * `enum`: `["small", "large"]` -> `["s", "m", "l", "xl"]`
367
- * `default`: `large` -> `m`
368
- * component: popover
369
- * `showTip`:
370
- * `default`: `false` -> `true`
371
- * `placement`:
372
- * `default`: `bottom` -> `top`
373
- * `offset`:
374
- * `default`: `6` -> `8`
368
+ - component: meter
369
+ - `size`:
370
+ - `enum`: `["small", "large"]` -> `["s", "m", "l", "xl"]`
371
+ - `default`: `large` -> `m`
372
+ - component: popover
373
+ - `showTip`:
374
+ - `default`: `false` -> `true`
375
+ - `placement`:
376
+ - `default`: `bottom` -> `top`
377
+ - `offset`:
378
+ - `default`: `6` -> `8`
375
379
 
376
380
  ### New Component
377
-
378
- * select-box
381
+ - select-box
379
382
 
380
383
  ## 0.0.0
381
384
 
382
385
  ### Minor Changes
383
386
 
384
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`71e674a`](https://github.com/adobe/spectrum-tokens/commit/71e674ad6baa630a900785ae21c9dcae93233b21) Thanks [@karstens](https://github.com/karstens)! - Release to latest branch
387
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`71e674a`](https://github.com/adobe/spectrum-design-data/commit/71e674ad6baa630a900785ae21c9dcae93233b21) Thanks [@karstens](https://github.com/karstens)! - Release to latest branch
385
388
 
386
389
  ## 0.0.0-schema-20240821152525
387
390
 
388
391
  ### Patch Changes
389
392
 
390
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`dc2d6c6`](https://github.com/adobe/spectrum-tokens/commit/dc2d6c6e12c1ea4fdc0d891b3fd50ea0b1697dd7) Thanks [@karstens](https://github.com/karstens)! - Making adjustments to bring the schema more in line with what was on the spectrum website.
393
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`dc2d6c6`](https://github.com/adobe/spectrum-design-data/commit/dc2d6c6e12c1ea4fdc0d891b3fd50ea0b1697dd7) Thanks [@karstens](https://github.com/karstens)! - Making adjustments to bring the schema more in line with what was on the spectrum website.
391
394
 
392
395
  ## 0.0.0-schema-20240620220450
393
396
 
394
397
  ### Minor Changes
395
398
 
396
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`64379eb`](https://github.com/adobe/spectrum-tokens/commit/64379ebeaf9402fe77ca1adfd020f42df60c60d9) Thanks [@karstens](https://github.com/karstens)! - Added schema for search-field and fixed some path bugs in testing
399
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`64379eb`](https://github.com/adobe/spectrum-design-data/commit/64379ebeaf9402fe77ca1adfd020f42df60c60d9) Thanks [@karstens](https://github.com/karstens)! - Added schema for search-field and fixed some path bugs in testing
397
400
 
398
401
  ## 0.0.0-schema-20240618053842
399
402
 
400
403
  ### Minor Changes
401
404
 
402
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`b5c1579`](https://github.com/adobe/spectrum-tokens/commit/b5c15792ec5f5e5c269bfa7bf58af3df42e648c1) Thanks [@karstens](https://github.com/karstens)! - Initial release
405
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`b5c1579`](https://github.com/adobe/spectrum-design-data/commit/b5c15792ec5f5e5c269bfa7bf58af3df42e648c1) Thanks [@karstens](https://github.com/karstens)! - Initial release
403
406
 
404
407
  ## 0.0.0-schema-20240614194147
405
408
 
406
409
  ### Patch Changes
407
410
 
408
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`9805167`](https://github.com/adobe/spectrum-tokens/commit/980516791c0bef9e2f0bbeffe6515f103f3ad7a2) Thanks [@karstens](https://github.com/karstens)! - fixed some bugs
411
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`9805167`](https://github.com/adobe/spectrum-design-data/commit/980516791c0bef9e2f0bbeffe6515f103f3ad7a2) Thanks [@karstens](https://github.com/karstens)! - fixed some bugs
409
412
 
410
413
  ## 0.0.0-schema-20240613154750
411
414
 
412
415
  ### Patch Changes
413
416
 
414
- * [#353](https://github.com/adobe/spectrum-tokens/pull/353) [`6ff5ad7`](https://github.com/adobe/spectrum-tokens/commit/6ff5ad7a75356f4b93d07a2818b357da19ce5b4b) Thanks [@karstens](https://github.com/karstens)! - Initial release
417
+ - [#353](https://github.com/adobe/spectrum-design-data/pull/353) [`6ff5ad7`](https://github.com/adobe/spectrum-design-data/commit/6ff5ad7a75356f4b93d07a2818b357da19ce5b4b) Thanks [@karstens](https://github.com/karstens)! - Initial release
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2024 Adobe. All rights reserved.
2
+ Copyright 2026 Adobe. All rights reserved.
3
3
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License. You may obtain a copy
5
5
  of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -13,6 +13,7 @@ import { glob } from "glob";
13
13
  import { isAbsolute, resolve } from "path";
14
14
  import { readFile } from "fs/promises";
15
15
  import * as url from "url";
16
+ import { createRequire } from "module";
16
17
 
17
18
  export const getSlugFromDocumentationUrl = (documentationUrl) =>
18
19
  documentationUrl
@@ -25,22 +26,37 @@ export const readJson = async (fileName) =>
25
26
 
26
27
  export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
27
28
 
28
- export const schemaFileNames = await glob(
29
- `${resolve(__dirname, "./schemas")}/**/*.json`,
29
+ // Locate the design-data-spec package's components directory
30
+ const specPkgPath = createRequire(import.meta.url).resolve(
31
+ "@adobe/design-data-spec/package.json",
30
32
  );
33
+ export const componentsDir = resolve(specPkgPath, "..", "components");
34
+
35
+ export const schemaFileNames = await glob(`${componentsDir}/*.json`);
36
+
37
+ // Add backward-compat aliases (title, properties) to a new-format component object.
38
+ // Slug is NOT added here — only getAllSchemas adds it, matching original behavior.
39
+ function withAliases(data) {
40
+ if (!Object.hasOwn(data, "meta")) return data;
41
+ return {
42
+ ...data,
43
+ title: data.displayName,
44
+ properties: data.options,
45
+ };
46
+ }
31
47
 
32
48
  /**
33
- * Accepts either a schema name or an absolute path
49
+ * Accepts either a component filename (relative to componentsDir) or an absolute path.
34
50
  *
35
51
  * @param schemaFileName
36
52
  * @return {Promise<any>}
37
53
  */
38
54
  export const getSchemaFile = async (schemaFileName) => {
39
- let filePath = resolve(__dirname, "schemas", schemaFileName);
40
- if (isAbsolute(schemaFileName)) {
41
- filePath = schemaFileName;
42
- }
43
- return await readJson(resolve(filePath));
55
+ const filePath = isAbsolute(schemaFileName)
56
+ ? schemaFileName
57
+ : resolve(componentsDir, schemaFileName);
58
+ const data = await readJson(filePath);
59
+ return withAliases(data);
44
60
  };
45
61
 
46
62
  export const getAllSlugs = async () => {
@@ -74,7 +90,7 @@ export const getAllSchemas = async () => {
74
90
  ) {
75
91
  return {
76
92
  ...data,
77
- ...{ slug: getSlugFromDocumentationUrl(data.meta.documentationUrl) },
93
+ slug: getSlugFromDocumentationUrl(data.meta.documentationUrl),
78
94
  };
79
95
  } else return data;
80
96
  }),
@@ -90,6 +106,6 @@ export const getSchemaBySlug = async (slug) => {
90
106
  if (schema === undefined) {
91
107
  throw new Error(`Schema not found for slug: ${slug}`);
92
108
  }
93
- delete schema.slug;
94
- return schema;
109
+ const { slug: _, ...rest } = schema;
110
+ return rest;
95
111
  };