From b68ef371e75d47c533318b707d982d7a89d94829 Mon Sep 17 00:00:00 2001 From: garthdb Date: Thu, 10 Oct 2024 11:04:07 -0600 Subject: [PATCH] chore: update to the latest token schemas --- .../public/schemas/token-types/color-set.json | 23 ++++------------ .../schemas/token-types/gradient-stop.json | 27 +++++++++++++++++++ .../schemas/token-types/multiplier.json | 2 +- .../public/schemas/token-types/scale-set.json | 14 +++++----- .../schemas/token-types/text-align.json | 27 +++++++++++++++++++ .../public/schemas/token-types/token.json | 9 ++++++- package.json | 6 ++--- .../tokens/schemas/token-types/color-set.json | 23 ++++------------ .../schemas/token-types/gradient-stop.json | 27 +++++++++++++++++++ .../schemas/token-types/multiplier.json | 2 +- .../tokens/schemas/token-types/scale-set.json | 14 +++++----- .../tokens/schemas/token-types/token.json | 9 ++++++- packages/tokens/src/layout-component.json | 14 +++++----- packages/tokens/src/typography.json | 18 ++++++------- pnpm-lock.yaml | 7 +++-- 15 files changed, 146 insertions(+), 76 deletions(-) create mode 100644 docs/site/public/schemas/token-types/gradient-stop.json create mode 100644 docs/site/public/schemas/token-types/text-align.json create mode 100644 packages/tokens/schemas/token-types/gradient-stop.json diff --git a/docs/site/public/schemas/token-types/color-set.json b/docs/site/public/schemas/token-types/color-set.json index e1d44708..cb24904d 100644 --- a/docs/site/public/schemas/token-types/color-set.json +++ b/docs/site/public/schemas/token-types/color-set.json @@ -24,14 +24,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] }, { "properties": { @@ -41,14 +38,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] }, { "properties": { @@ -58,14 +52,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] } ] }, @@ -73,11 +64,7 @@ "private": {}, "deprecated": {}, "deprecated_comment": {}, - "uuid": { - "type": "string", - "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$", - "format": "uuid" - } + "uuid": {} }, - "required": ["sets", "uuid"] + "required": ["sets"] } diff --git a/docs/site/public/schemas/token-types/gradient-stop.json b/docs/site/public/schemas/token-types/gradient-stop.json new file mode 100644 index 00000000..d92481a5 --- /dev/null +++ b/docs/site/public/schemas/token-types/gradient-stop.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/gradient-stop.json", + "title": "Color Stop", + "description": "Gradient stop positions, being a ratio along the gradient's axis. Start is 0, end is 1.", + "type": "object", + "allOf": [ + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/token.json" + } + ], + "properties": { + "$schema": { + "const": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/gradient-stop.json" + }, + "value": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "component": {}, + "private": {}, + "deprecated": {}, + "deprecated_comment": {}, + "uuid": {} + } +} diff --git a/docs/site/public/schemas/token-types/multiplier.json b/docs/site/public/schemas/token-types/multiplier.json index 3986b92c..73ffdc3b 100644 --- a/docs/site/public/schemas/token-types/multiplier.json +++ b/docs/site/public/schemas/token-types/multiplier.json @@ -14,7 +14,7 @@ "const": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" }, "value": { - "type": "string", + "type": "number", "pattern": "^(?:\\d+\\.?\\d*)|(?:\\.?\\d+)$" }, "component": {}, diff --git a/docs/site/public/schemas/token-types/scale-set.json b/docs/site/public/schemas/token-types/scale-set.json index 00efff6a..86c83751 100644 --- a/docs/site/public/schemas/token-types/scale-set.json +++ b/docs/site/public/schemas/token-types/scale-set.json @@ -26,6 +26,9 @@ }, { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" + }, + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" } ] }, @@ -39,6 +42,9 @@ }, { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" + }, + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" } ] } @@ -49,11 +55,7 @@ "private": {}, "deprecated": {}, "deprecated_comment": {}, - "uuid": { - "type": "string", - "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$", - "format": "uuid" - } + "uuid": {} }, - "required": ["sets", "uuid"] + "required": ["sets"] } diff --git a/docs/site/public/schemas/token-types/text-align.json b/docs/site/public/schemas/token-types/text-align.json new file mode 100644 index 00000000..a102159d --- /dev/null +++ b/docs/site/public/schemas/token-types/text-align.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/text-align.json", + "title": "Text align", + "description": "Sets the horizontal alignment of the inline-level content inside a block element", + "type": "object", + "allOf": [ + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/token.json" + } + ], + "properties": { + "$schema": { + "const": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/text-align.json" + }, + "value": { + "type": "string", + "enum": ["start", "center", "end"], + "default": "start" + }, + "component": {}, + "private": {}, + "deprecated": {}, + "deprecated_comment": {}, + "uuid": {} + } +} diff --git a/docs/site/public/schemas/token-types/token.json b/docs/site/public/schemas/token-types/token.json index 08a3fa4c..520b6ac7 100644 --- a/docs/site/public/schemas/token-types/token.json +++ b/docs/site/public/schemas/token-types/token.json @@ -6,7 +6,14 @@ "type": "object", "properties": { "value": { - "type": "string" + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] }, "component": { "type": "string" diff --git a/package.json b/package.json index cceb4740..1e49271c 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/adobe/spectrum-tokens#readme", "devDependencies": { "@action-validator/core": "^0.6.0", + "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.9", "@commitlint/cli": "^19.5.0", "@commitlint/config-conventional": "^19.5.0", @@ -37,8 +38,5 @@ "engines": { "node": "~20.12" }, - "packageManager": "pnpm@9.0.6", - "dependencies": { - "@changesets/changelog-github": "^0.5.0" - } + "packageManager": "pnpm@9.0.6" } diff --git a/packages/tokens/schemas/token-types/color-set.json b/packages/tokens/schemas/token-types/color-set.json index e1d44708..cb24904d 100644 --- a/packages/tokens/schemas/token-types/color-set.json +++ b/packages/tokens/schemas/token-types/color-set.json @@ -24,14 +24,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/color.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] }, { "properties": { @@ -41,14 +38,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] }, { "properties": { @@ -58,14 +52,11 @@ "dark": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" }, - "darkest": { - "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" - }, "wireframe": { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/opacity.json" } }, - "required": ["light", "dark", "darkest", "wireframe"] + "required": ["light", "dark"] } ] }, @@ -73,11 +64,7 @@ "private": {}, "deprecated": {}, "deprecated_comment": {}, - "uuid": { - "type": "string", - "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$", - "format": "uuid" - } + "uuid": {} }, - "required": ["sets", "uuid"] + "required": ["sets"] } diff --git a/packages/tokens/schemas/token-types/gradient-stop.json b/packages/tokens/schemas/token-types/gradient-stop.json new file mode 100644 index 00000000..d92481a5 --- /dev/null +++ b/packages/tokens/schemas/token-types/gradient-stop.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/gradient-stop.json", + "title": "Color Stop", + "description": "Gradient stop positions, being a ratio along the gradient's axis. Start is 0, end is 1.", + "type": "object", + "allOf": [ + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/token.json" + } + ], + "properties": { + "$schema": { + "const": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/gradient-stop.json" + }, + "value": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "component": {}, + "private": {}, + "deprecated": {}, + "deprecated_comment": {}, + "uuid": {} + } +} diff --git a/packages/tokens/schemas/token-types/multiplier.json b/packages/tokens/schemas/token-types/multiplier.json index 3986b92c..73ffdc3b 100644 --- a/packages/tokens/schemas/token-types/multiplier.json +++ b/packages/tokens/schemas/token-types/multiplier.json @@ -14,7 +14,7 @@ "const": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" }, "value": { - "type": "string", + "type": "number", "pattern": "^(?:\\d+\\.?\\d*)|(?:\\.?\\d+)$" }, "component": {}, diff --git a/packages/tokens/schemas/token-types/scale-set.json b/packages/tokens/schemas/token-types/scale-set.json index 00efff6a..86c83751 100644 --- a/packages/tokens/schemas/token-types/scale-set.json +++ b/packages/tokens/schemas/token-types/scale-set.json @@ -26,6 +26,9 @@ }, { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" + }, + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" } ] }, @@ -39,6 +42,9 @@ }, { "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/alias.json" + }, + { + "$ref": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json" } ] } @@ -49,11 +55,7 @@ "private": {}, "deprecated": {}, "deprecated_comment": {}, - "uuid": { - "type": "string", - "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$", - "format": "uuid" - } + "uuid": {} }, - "required": ["sets", "uuid"] + "required": ["sets"] } diff --git a/packages/tokens/schemas/token-types/token.json b/packages/tokens/schemas/token-types/token.json index 08a3fa4c..520b6ac7 100644 --- a/packages/tokens/schemas/token-types/token.json +++ b/packages/tokens/schemas/token-types/token.json @@ -6,7 +6,14 @@ "type": "object", "properties": { "value": { - "type": "string" + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] }, "component": { "type": "string" diff --git a/packages/tokens/src/layout-component.json b/packages/tokens/src/layout-component.json index 84c14019..4857bdb2 100644 --- a/packages/tokens/src/layout-component.json +++ b/packages/tokens/src/layout-component.json @@ -1741,7 +1741,7 @@ "button-minimum-width-multiplier": { "component": "button", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "2.25", + "value": 2.25, "uuid": "68b6ac88-d229-460d-8d59-3f5c141db358" }, "tooltip-tip-width": { @@ -2105,7 +2105,7 @@ "swatch-rectangle-width-multiplier": { "component": "swatch", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "2", + "value": 2, "uuid": "b3157e9d-82a0-429e-b987-8c240a669af7" }, "swatch-slash-thickness-extra-small": { @@ -3449,7 +3449,7 @@ "picker-minimum-width-multiplier": { "component": "picker", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "2", + "value": 2, "uuid": "67b68a30-ae00-4da2-9730-99196a2eaf96" }, "picker-visual-to-disclosure-icon-small": { @@ -3554,7 +3554,7 @@ "text-field-minimum-width-multiplier": { "component": "text-field", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "1.5", + "value": 1.5, "uuid": "875bbeaf-b4b7-41b9-8e6f-d6a57ec03049" }, "text-area-minimum-width": { @@ -3594,13 +3594,13 @@ "combo-box-minimum-width-multiplier": { "component": "combo-box", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "2.5", + "value": 2.5, "uuid": "eabcc77a-f263-43ed-9944-9daa78a56b66" }, "combo-box-quiet-minimum-width-multiplier": { "component": "combo-box", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "2", + "value": 2, "uuid": "4798728b-9a97-4ce1-b703-0182b1513e8b" }, "combo-box-visual-to-field-button-small": { @@ -4809,7 +4809,7 @@ "search-field-minimum-width-multiplier": { "component": "search-field", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "3", + "value": 3, "uuid": "c4b2177d-4468-4180-be27-69d26a51ba0b" }, "color-loupe-height": { diff --git a/packages/tokens/src/typography.json b/packages/tokens/src/typography.json index ec83f6fb..0f63f99a 100644 --- a/packages/tokens/src/typography.json +++ b/packages/tokens/src/typography.json @@ -322,22 +322,22 @@ }, "line-height-100": { "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "1.3", + "value": 1.3, "uuid": "dd125d1d-cf4d-45c8-ab21-52331a9a264b" }, "line-height-200": { "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "1.5", + "value": 1.5, "uuid": "832f2589-0e75-48dd-bbe3-e3f5b98e6c97" }, "cjk-line-height-100": { "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "1.5", + "value": 1.5, "uuid": "8b4ab68d-9060-4e11-9ecc-3b9d3db27fe4" }, "cjk-line-height-200": { "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "1.7", + "value": 1.7, "uuid": "c5a5d186-54b3-44a0-b1c6-e9b102871015" }, "cjk-letter-spacing": { @@ -971,13 +971,13 @@ "heading-margin-top-multiplier": { "component": "heading", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "0.88888889", + "value": 0.88888889, "uuid": "008fa04b-6d74-416b-a6ae-ceec90f08642" }, "heading-margin-bottom-multiplier": { "component": "heading", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "0.25", + "value": 0.25, "uuid": "dd2035b4-506f-41ab-a656-de3668d44e0f" }, "heading-color": { @@ -1205,7 +1205,7 @@ "body-margin-multiplier": { "component": "body", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "0.75", + "value": 0.75, "uuid": "8f2e9283-4cbc-4374-9757-ed8d68542c89" }, "body-color": { @@ -1559,13 +1559,13 @@ "detail-margin-top-multiplier": { "component": "detail", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "0.88888889", + "value": 0.88888889, "uuid": "5d34c3b5-fddd-420b-bfe4-0dee4e07701c" }, "detail-margin-bottom-multiplier": { "component": "detail", "$schema": "https://opensource.adobe.com/spectrum-tokens/schemas/token-types/multiplier.json", - "value": "0.25", + "value": 0.25, "uuid": "35ac24a4-0338-44c6-b780-120a0af0fc51" }, "detail-letter-spacing": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index abc2e9a2..6146f852 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,14 +6,13 @@ settings: importers: .: - dependencies: - "@changesets/changelog-github": - specifier: ^0.5.0 - version: 0.5.0 devDependencies: "@action-validator/core": specifier: ^0.6.0 version: 0.6.0 + "@changesets/changelog-github": + specifier: ^0.5.0 + version: 0.5.0 "@changesets/cli": specifier: ^2.27.9 version: 2.27.9