@adobe/design-data-spec 0.15.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/components/accordion.json +27 -4
  2. package/components/action-button.json +27 -4
  3. package/components/action-group.json +51 -10
  4. package/components/alert-banner.json +15 -2
  5. package/components/alert-dialog.json +18 -8
  6. package/components/avatar-group.json +24 -2
  7. package/components/avatar.json +72 -13
  8. package/components/badge.json +120 -31
  9. package/components/body.json +24 -2
  10. package/components/bottom-navigation-android.json +18 -4
  11. package/components/breadcrumbs.json +34 -7
  12. package/components/button-group.json +32 -5
  13. package/components/button.json +50 -10
  14. package/components/calendar.json +9 -2
  15. package/components/cards.json +21 -9
  16. package/components/checkbox-group.json +27 -6
  17. package/components/checkbox.json +15 -2
  18. package/components/close-button.json +24 -4
  19. package/components/coach-indicator.json +40 -14
  20. package/components/code.json +18 -2
  21. package/components/color-handle.json +24 -10
  22. package/components/color-slider.json +33 -12
  23. package/components/combo-box.json +48 -8
  24. package/components/contextual-help.json +78 -27
  25. package/components/date-picker.json +12 -2
  26. package/components/detail.json +24 -4
  27. package/components/divider.json +21 -4
  28. package/components/drop-zone.json +12 -2
  29. package/components/field-label.json +33 -6
  30. package/components/heading.json +36 -4
  31. package/components/help-text.json +25 -5
  32. package/components/illustrated-message.json +21 -4
  33. package/components/in-field-progress-button.json +29 -3
  34. package/components/in-field-progress-circle.json +23 -3
  35. package/components/in-line-alert.json +33 -11
  36. package/components/link.json +18 -4
  37. package/components/list-view.json +12 -2
  38. package/components/menu.json +42 -5
  39. package/components/meter.json +30 -4
  40. package/components/number-field.json +32 -5
  41. package/components/opacity-checkerboard.json +25 -2
  42. package/components/picker.json +41 -7
  43. package/components/popover.json +69 -25
  44. package/components/progress-bar.json +39 -8
  45. package/components/progress-circle.json +21 -4
  46. package/components/radio-group.json +42 -8
  47. package/components/scroll-zoom-bar.json +21 -4
  48. package/components/search-field.json +15 -2
  49. package/components/segmented-control.json +27 -6
  50. package/components/select-box.json +9 -2
  51. package/components/side-navigation.json +12 -2
  52. package/components/slider.json +17 -3
  53. package/components/standard-dialog.json +12 -2
  54. package/components/standard-panel.json +33 -6
  55. package/components/status-light.json +87 -28
  56. package/components/steplist.json +9 -2
  57. package/components/swatch-group.json +48 -8
  58. package/components/swatch.json +39 -9
  59. package/components/switch.json +15 -2
  60. package/components/tab-bar-ios.json +18 -4
  61. package/components/table.json +24 -4
  62. package/components/tabs.json +9 -2
  63. package/components/tag-field.json +27 -4
  64. package/components/tag-group.json +21 -4
  65. package/components/takeover-dialog.json +9 -2
  66. package/components/text-area.json +50 -7
  67. package/components/text-field.json +32 -5
  68. package/components/thumbnail.json +38 -1
  69. package/components/title.json +24 -2
  70. package/components/toast.json +15 -2
  71. package/components/tooltip.json +27 -4
  72. package/components/tree-view.json +42 -8
  73. package/conformance/invalid/SPEC-019/dataset.json +14 -1
  74. package/conformance/invalid/SPEC-037/dataset.json +14 -6
  75. package/conformance/invalid/SPEC-038/dataset.json +20 -0
  76. package/conformance/invalid/SPEC-038/expected-errors.json +10 -0
  77. package/conformance/valid/SPEC-037/dataset.json +20 -8
  78. package/conformance/valid/SPEC-038/dataset.json +29 -0
  79. package/conformance/valid/component-refs/dataset.json +41 -7
  80. package/package.json +1 -1
  81. package/rules/rules.yaml +17 -4
  82. package/schemas/component.schema.json +25 -11
  83. package/spec/agent-surface.md +1 -1
  84. package/spec/component-format.md +67 -33
@@ -88,35 +88,48 @@ The `options` block declares the component's API surface — the configurable pr
88
88
 
89
89
  An option descriptor is a JSON object with the following fields:
90
90
 
91
- | Field | Type | Required | Description |
92
- | ---------------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
93
- | `type` | string or array | OPTIONAL | JSON Schema primitive type(s): `"string"`, `"boolean"`, `"number"`, `"integer"`. |
94
- | `enum` | array | OPTIONAL | Exhaustive list of permitted values. |
95
- | `default` | any | OPTIONAL | Default value when the option is not specified. |
96
- | `description` | string | OPTIONAL | Plain-text description of what the option controls. |
97
- | `$ref` | URI string | OPTIONAL | Reference to a shared type schema (e.g. `workflow-icon.json`). |
98
- | `deprecatedEnumValues` | object | OPTIONAL | Per-enum-value lifecycle metadata. Keys are enum value strings; values are lifecycle objects. Values absent from this map are not deprecated. |
91
+ | Field | Type | Required | Description |
92
+ | ------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
93
+ | `type` | string or array | OPTIONAL | JSON Schema primitive type(s): `"string"`, `"boolean"`, `"number"`, `"integer"`. |
94
+ | `values` | array | OPTIONAL | Exhaustive list of permitted values, each an [`optionValue`](#optionvalue) object. Use this instead of JSON Schema's `enum` keyword so per-value lifecycle metadata can be expressed without a separate sidecar map. |
95
+ | `default` | any | OPTIONAL | Default value when the option is not specified. |
96
+ | `description` | string | OPTIONAL | Plain-text description of what the option controls. |
97
+ | `$ref` | URI string | OPTIONAL | Reference to a shared type schema (e.g. `workflow-icon.json`). |
98
+
99
+ ### optionValue
100
+
101
+ Each entry in `values` is an object:
102
+
103
+ | Field | Type | Required | Description |
104
+ | ------------- | ------ | -------- | ---------------------------------------------------------------------------------------- |
105
+ | `value` | any | REQUIRED | The permitted option value. |
106
+ | `description` | string | OPTIONAL | Plain-text description of what this value means. |
107
+ | `lifecycle` | object | OPTIONAL | Version lifecycle metadata. Set `lifecycle.deprecated` to signal migration via SPEC-037. |
99
108
 
100
109
  **NORMATIVE:** Each key in `options` **MUST** be camelCase.
101
110
 
102
111
  **NORMATIVE:** Boolean option names **MUST** begin with `is` or `has` (e.g. `isDisabled`, `hasIcon`).
103
112
 
104
- **NORMATIVE:** When `enum` is present, token name-object `variant` field values referencing this component **MUST** be drawn from the declared `variant` option enum (rule SPEC-019). Other option enums are informative for tooling but do not currently drive SPEC rules.
113
+ **NORMATIVE:** When `values` is present, token name-object `variant` field values referencing this component **MUST** be drawn from the declared `variant` option `values` list (rule SPEC-019). Other option `values` lists are informative for tooling but do not currently drive SPEC rules.
105
114
 
106
- **ADVISORY:** When a `deprecatedEnumValues` entry exists for a value that a non-deprecated token references via its `name` object field for that option, SPEC-037 fires an advisory warning. Keys in `deprecatedEnumValues` are not independently validated against `enum` — entries for values absent from `enum` are silently ignored by validators (a future rule may close this gap).
115
+ **ADVISORY:** When a value in `values` carries a `lifecycle.deprecated` string and a non-deprecated token references that value via its `name` object field, SPEC-037 fires an advisory warning prompting migration or token deprecation.
107
116
 
108
- Example with a deprecated enum value:
117
+ Example with a deprecated option value:
109
118
 
110
119
  ```json
111
120
  "variant": {
112
121
  "type": "string",
113
- "enum": ["primary", "secondary", "cta"],
114
- "deprecatedEnumValues": {
115
- "cta": {
116
- "deprecated": "1.0.0-draft",
117
- "deprecatedComment": "Use primary instead."
122
+ "values": [
123
+ { "value": "primary" },
124
+ { "value": "secondary" },
125
+ {
126
+ "value": "cta",
127
+ "lifecycle": {
128
+ "deprecated": "1.0.0-draft",
129
+ "deprecatedComment": "Use primary instead."
130
+ }
118
131
  }
119
- }
132
+ ]
120
133
  }
121
134
  ```
122
135
 
@@ -124,13 +137,23 @@ Example with a deprecated enum value:
124
137
  "options": {
125
138
  "variant": {
126
139
  "type": "string",
127
- "enum": ["accent", "negative", "primary", "secondary"],
140
+ "values": [
141
+ { "value": "accent" },
142
+ { "value": "negative" },
143
+ { "value": "primary" },
144
+ { "value": "secondary" }
145
+ ],
128
146
  "default": "accent",
129
147
  "description": "Visual emphasis level."
130
148
  },
131
149
  "size": {
132
150
  "type": "string",
133
- "enum": ["s", "m", "l", "xl"],
151
+ "values": [
152
+ { "value": "s" },
153
+ { "value": "m" },
154
+ { "value": "l" },
155
+ { "value": "xl" }
156
+ ],
134
157
  "default": "m"
135
158
  },
136
159
  "isDisabled": {
@@ -291,16 +314,17 @@ The `context` field is informative. It is used by `describe_component` (Phase 8
291
314
 
292
315
  The following rules are added to the Layer 2 rule catalog (`rules/rules.yaml`) by this chapter. New component cross-reference rules start at SPEC-018 to avoid collision with existing token rules (SPEC-001–SPEC-017).
293
316
 
294
- | Rule ID | Name | Severity | Assert |
295
- | -------- | -------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
296
- | SPEC-018 | `component-name-exists` | error | Token `component` field value **MUST** match the `name` of a declared component in the dataset. |
297
- | SPEC-019 | `component-variant-valid` | error | Token `variant` field value **MUST** match a value in the declared `variant` option enum for the referenced component (when that enum exists). |
298
- | SPEC-020 | `component-anatomy-valid` | error | Token `anatomy` field value **MUST** match the `name` of a declared anatomy part on the referenced component. |
299
- | SPEC-021 | `component-slot-vocabulary` | warning | Component `slots` entries with a `name` outside the canonical vocabulary **SHOULD** include a `description`. Custom slot names without descriptions are surfaced as warnings. |
300
- | SPEC-022 | `component-state-valid` | error | Token `state` field value **MUST** match the `name` of a declared state on the referenced component (when state declarations are present). |
301
- | SPEC-027 | `token-binding-token-exists` | error | Each `tokenBindings[].token` value **MUST** match the name of a declared token in the dataset (Phase 6.7). |
302
- | SPEC-036 | `component-deprecation-cascade` | warning | A non-deprecated token **SHOULD NOT** reference a deprecated component via `name.component`. Advisory warning prompts updating the component reference or marking the token deprecated. |
303
- | SPEC-037 | `sub-entity-deprecation-cascade` | warning | A non-deprecated token **SHOULD NOT** reference a deprecated anatomy part, state, or option-enum value via `name.*`. Advisory warning prompts migration. Requires `lifecycle` on anatomy/state or `deprecatedEnumValues` on option descriptor. |
317
+ | Rule ID | Name | Severity | Assert |
318
+ | -------- | -------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
319
+ | SPEC-018 | `component-name-exists` | error | Token `component` field value **MUST** match the `name` of a declared component in the dataset. |
320
+ | SPEC-019 | `component-variant-valid` | error | Token `variant` field value **MUST** match a value in the declared `variant` option `values` list for the referenced component (when that list exists). |
321
+ | SPEC-020 | `component-anatomy-valid` | error | Token `anatomy` field value **MUST** match the `name` of a declared anatomy part on the referenced component. |
322
+ | SPEC-021 | `component-slot-vocabulary` | warning | Component `slots` entries with a `name` outside the canonical vocabulary **SHOULD** include a `description`. Custom slot names without descriptions are surfaced as warnings. |
323
+ | SPEC-022 | `component-state-valid` | error | Token `state` field value **MUST** match the `name` of a declared state on the referenced component (when state declarations are present). |
324
+ | SPEC-027 | `token-binding-token-exists` | error | Each `tokenBindings[].token` value **MUST** match the name of a declared token in the dataset (Phase 6.7). |
325
+ | SPEC-036 | `component-deprecation-cascade` | warning | A non-deprecated token **SHOULD NOT** reference a deprecated component via `name.component`. Advisory warning prompts updating the component reference or marking the token deprecated. |
326
+ | SPEC-037 | `sub-entity-deprecation-cascade` | warning | A non-deprecated token **SHOULD NOT** reference a deprecated anatomy part, state, or option value via `name.*`. Advisory warning prompts migration. Requires `lifecycle` on anatomy/state or `lifecycle` on the matching `values` entry on the option descriptor. |
327
+ | SPEC-038 | `option-enum-obsolete` | warning | An option descriptor **SHOULD NOT** use the JSON Schema `enum` keyword. `additionalProperties: true` silently accepts `enum` at Layer 1; SPEC-038 flags it at Layer 2 so authors replace it with the `values` array. |
304
328
 
305
329
  ## Full example
306
330
 
@@ -321,18 +345,28 @@ A complete button component declaration:
321
345
  "options": {
322
346
  "variant": {
323
347
  "type": "string",
324
- "enum": ["accent", "negative", "primary", "secondary"],
348
+ "values": [
349
+ { "value": "accent" },
350
+ { "value": "negative" },
351
+ { "value": "primary" },
352
+ { "value": "secondary" }
353
+ ],
325
354
  "default": "accent",
326
355
  "description": "Visual emphasis level."
327
356
  },
328
357
  "style": {
329
358
  "type": "string",
330
- "enum": ["fill", "outline"],
359
+ "values": [{ "value": "fill" }, { "value": "outline" }],
331
360
  "default": "fill"
332
361
  },
333
362
  "size": {
334
363
  "type": "string",
335
- "enum": ["s", "m", "l", "xl"],
364
+ "values": [
365
+ { "value": "s" },
366
+ { "value": "m" },
367
+ { "value": "l" },
368
+ { "value": "xl" }
369
+ ],
336
370
  "default": "m"
337
371
  },
338
372
  "isDisabled": { "type": "boolean", "default": false },
@@ -344,7 +378,7 @@ A complete button component declaration:
344
378
  },
345
379
  "staticColor": {
346
380
  "type": "string",
347
- "enum": ["white", "black"],
381
+ "values": [{ "value": "white" }, { "value": "black" }],
348
382
  "description": "Static color for use on colored backgrounds. Must not be set for the default variant."
349
383
  }
350
384
  },