Skip to content

Commit

Permalink
chore: update to the latest token schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
GarthDB committed Oct 14, 2024
1 parent d652a44 commit b68ef37
Show file tree
Hide file tree
Showing 15 changed files with 146 additions and 76 deletions.
23 changes: 5 additions & 18 deletions docs/site/public/schemas/token-types/color-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -58,26 +52,19 @@
"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"]
}
]
},
"component": {},
"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"]
}
27 changes: 27 additions & 0 deletions docs/site/public/schemas/token-types/gradient-stop.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
2 changes: 1 addition & 1 deletion docs/site/public/schemas/token-types/multiplier.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
14 changes: 8 additions & 6 deletions docs/site/public/schemas/token-types/scale-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand All @@ -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"
}
]
}
Expand All @@ -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"]
}
27 changes: 27 additions & 0 deletions docs/site/public/schemas/token-types/text-align.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
9 changes: 8 additions & 1 deletion docs/site/public/schemas/token-types/token.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"type": "object",
"properties": {
"value": {
"type": "string"
"anyOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"component": {
"type": "string"
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
23 changes: 5 additions & 18 deletions packages/tokens/schemas/token-types/color-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -58,26 +52,19 @@
"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"]
}
]
},
"component": {},
"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"]
}
27 changes: 27 additions & 0 deletions packages/tokens/schemas/token-types/gradient-stop.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
2 changes: 1 addition & 1 deletion packages/tokens/schemas/token-types/multiplier.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
14 changes: 8 additions & 6 deletions packages/tokens/schemas/token-types/scale-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand All @@ -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"
}
]
}
Expand All @@ -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"]
}
9 changes: 8 additions & 1 deletion packages/tokens/schemas/token-types/token.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"type": "object",
"properties": {
"value": {
"type": "string"
"anyOf": [
{
"type": "number"
},
{
"type": "string"
}
]
},
"component": {
"type": "string"
Expand Down
Loading

0 comments on commit b68ef37

Please sign in to comment.