@canonical/design-tokens 0.5.2 → 0.6.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/design-tokens",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "description": "Canonical design tokens (DTCG format) with CSS custom property output.",
5
5
  "type": "module",
6
6
  "license": "LGPL-3.0",
@@ -46,11 +46,11 @@
46
46
  "test": "vitest run"
47
47
  },
48
48
  "dependencies": {
49
- "@canonical/terrazzo-lsp": "^0.5.2"
49
+ "@canonical/terrazzo-lsp": "^0.6.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@canonical/terrazzo-plugin-css": "^0.5.2",
53
- "@canonical/webarchitect": "^0.17.1",
52
+ "@canonical/terrazzo-plugin-css": "^0.6.0",
53
+ "@canonical/webarchitect": "^0.20.0",
54
54
  "@terrazzo/cli": "2.0.0",
55
55
  "@terrazzo/parser": "2.0.0",
56
56
  "ajv": "^8.17.0",
@@ -131,6 +131,60 @@
131
131
  ]
132
132
  }
133
133
  },
134
+ "lifecycle": {
135
+ "description": "Lifecycle modifier family. Contexts: planned, inProgress, completed, failed.",
136
+ "default": "none",
137
+ "contexts": {
138
+ "none": [],
139
+ "planned": [
140
+ {
141
+ "$ref": "global/semantic/modifier/lifecycle/planned.tokens.json"
142
+ }
143
+ ],
144
+ "inProgress": [
145
+ {
146
+ "$ref": "global/semantic/modifier/lifecycle/in-progress.tokens.json"
147
+ }
148
+ ],
149
+ "completed": [
150
+ {
151
+ "$ref": "global/semantic/modifier/lifecycle/completed.tokens.json"
152
+ }
153
+ ],
154
+ "failed": [
155
+ {
156
+ "$ref": "global/semantic/modifier/lifecycle/failed.tokens.json"
157
+ }
158
+ ]
159
+ }
160
+ },
161
+ "release": {
162
+ "description": "Release modifier family. Contexts: experimental, alpha, beta, stable.",
163
+ "default": "none",
164
+ "contexts": {
165
+ "none": [],
166
+ "experimental": [
167
+ {
168
+ "$ref": "global/semantic/modifier/release/experimental.tokens.json"
169
+ }
170
+ ],
171
+ "alpha": [
172
+ {
173
+ "$ref": "global/semantic/modifier/release/alpha.tokens.json"
174
+ }
175
+ ],
176
+ "beta": [
177
+ {
178
+ "$ref": "global/semantic/modifier/release/beta.tokens.json"
179
+ }
180
+ ],
181
+ "stable": [
182
+ {
183
+ "$ref": "global/semantic/modifier/release/stable.tokens.json"
184
+ }
185
+ ]
186
+ }
187
+ },
134
188
  "surface": {
135
189
  "description": "Surface modifier for layer-aware token rebinding. Contexts: layer1, layer2, layer3. CSS output uses compound .surface selectors (depth-based compounding).",
136
190
  "default": "none",
@@ -157,6 +211,8 @@
157
211
  { "$ref": "#/modifiers/criticality" },
158
212
  { "$ref": "#/modifiers/emphasis" },
159
213
  { "$ref": "#/modifiers/importance" },
214
+ { "$ref": "#/modifiers/lifecycle" },
215
+ { "$ref": "#/modifiers/release" },
160
216
  { "$ref": "#/modifiers/surface" }
161
217
  ]
162
218
  }
@@ -553,6 +553,14 @@
553
553
  "success": {
554
554
  "$value": "{color.border.success.$root}",
555
555
  "$description": "Focus ring color for elements in a success state"
556
+ },
557
+ "constructive": {
558
+ "$value": "{color.border.constructive.$root}",
559
+ "$description": "Focus ring color for constructive interactive elements"
560
+ },
561
+ "destructive": {
562
+ "$value": "{color.border.destructive.$root}",
563
+ "$description": "Focus ring color for destructive interactive elements"
556
564
  }
557
565
  },
558
566
  "foreground": {
@@ -3052,6 +3060,84 @@
3052
3060
  },
3053
3061
  "$description": "Fill color to use when the element using the branded primary foreground is in a disabled state"
3054
3062
  }
3063
+ },
3064
+ "warning": {
3065
+ "$root": {
3066
+ "$value": {
3067
+ "colorSpace": {
3068
+ "$ref": "#/color/palette/yellow/520/$value/colorSpace"
3069
+ },
3070
+ "components": [
3071
+ {
3072
+ "$ref": "#/color/palette/yellow/520/$value/components/0"
3073
+ },
3074
+ {
3075
+ "$ref": "#/color/palette/yellow/520/$value/components/1"
3076
+ },
3077
+ {
3078
+ "$ref": "#/color/palette/yellow/520/$value/components/2"
3079
+ }
3080
+ ]
3081
+ },
3082
+ "$description": "Fill color for primary interactive elements conveying caution or warning"
3083
+ },
3084
+ "hover": {
3085
+ "$value": {
3086
+ "colorSpace": {
3087
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3088
+ },
3089
+ "components": [
3090
+ {
3091
+ "$ref": "#/number/lightness/foreground/primary/hover/onDark/$value"
3092
+ },
3093
+ {
3094
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/1"
3095
+ },
3096
+ {
3097
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3098
+ }
3099
+ ]
3100
+ },
3101
+ "$description": "Hover state for warning primary foreground"
3102
+ },
3103
+ "active": {
3104
+ "$value": {
3105
+ "colorSpace": {
3106
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3107
+ },
3108
+ "components": [
3109
+ {
3110
+ "$ref": "#/number/lightness/foreground/primary/active/onDark/$value"
3111
+ },
3112
+ {
3113
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/1"
3114
+ },
3115
+ {
3116
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3117
+ }
3118
+ ]
3119
+ },
3120
+ "$description": "Active state for warning primary foreground"
3121
+ },
3122
+ "disabled": {
3123
+ "$value": {
3124
+ "colorSpace": {
3125
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3126
+ },
3127
+ "components": [
3128
+ {
3129
+ "$ref": "#/number/lightness/foreground/primary/disabled/onDark/$value"
3130
+ },
3131
+ {
3132
+ "$ref": "#/number/chroma/disabled/$value"
3133
+ },
3134
+ {
3135
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3136
+ }
3137
+ ]
3138
+ },
3139
+ "$description": "Disabled state for warning primary foreground"
3140
+ }
3055
3141
  }
3056
3142
  },
3057
3143
  "secondary": {
@@ -553,6 +553,14 @@
553
553
  "success": {
554
554
  "$value": "{color.border.success.$root}",
555
555
  "$description": "Focus ring color for elements in a success state"
556
+ },
557
+ "constructive": {
558
+ "$value": "{color.border.constructive.$root}",
559
+ "$description": "Focus ring color for constructive interactive elements"
560
+ },
561
+ "destructive": {
562
+ "$value": "{color.border.destructive.$root}",
563
+ "$description": "Focus ring color for destructive interactive elements"
556
564
  }
557
565
  },
558
566
  "foreground": {
@@ -3052,6 +3060,84 @@
3052
3060
  },
3053
3061
  "$description": "Fill color to use when the element using the branded primary foreground is in a disabled state"
3054
3062
  }
3063
+ },
3064
+ "warning": {
3065
+ "$root": {
3066
+ "$value": {
3067
+ "colorSpace": {
3068
+ "$ref": "#/color/palette/yellow/520/$value/colorSpace"
3069
+ },
3070
+ "components": [
3071
+ {
3072
+ "$ref": "#/color/palette/yellow/520/$value/components/0"
3073
+ },
3074
+ {
3075
+ "$ref": "#/color/palette/yellow/520/$value/components/1"
3076
+ },
3077
+ {
3078
+ "$ref": "#/color/palette/yellow/520/$value/components/2"
3079
+ }
3080
+ ]
3081
+ },
3082
+ "$description": "Fill color for primary interactive elements conveying caution or warning"
3083
+ },
3084
+ "hover": {
3085
+ "$value": {
3086
+ "colorSpace": {
3087
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3088
+ },
3089
+ "components": [
3090
+ {
3091
+ "$ref": "#/number/lightness/foreground/primary/hover/onLight/$value"
3092
+ },
3093
+ {
3094
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/1"
3095
+ },
3096
+ {
3097
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3098
+ }
3099
+ ]
3100
+ },
3101
+ "$description": "Hover state for warning primary foreground"
3102
+ },
3103
+ "active": {
3104
+ "$value": {
3105
+ "colorSpace": {
3106
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3107
+ },
3108
+ "components": [
3109
+ {
3110
+ "$ref": "#/number/lightness/foreground/primary/active/onLight/$value"
3111
+ },
3112
+ {
3113
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/1"
3114
+ },
3115
+ {
3116
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3117
+ }
3118
+ ]
3119
+ },
3120
+ "$description": "Active state for warning primary foreground"
3121
+ },
3122
+ "disabled": {
3123
+ "$value": {
3124
+ "colorSpace": {
3125
+ "$ref": "#/color/foreground/primary/warning/$root/$value/colorSpace"
3126
+ },
3127
+ "components": [
3128
+ {
3129
+ "$ref": "#/number/lightness/foreground/primary/disabled/onLight/$value"
3130
+ },
3131
+ {
3132
+ "$ref": "#/number/chroma/disabled/$value"
3133
+ },
3134
+ {
3135
+ "$ref": "#/color/foreground/primary/warning/$root/$value/components/2"
3136
+ }
3137
+ ]
3138
+ },
3139
+ "$description": "Disabled state for warning primary foreground"
3140
+ }
3055
3141
  }
3056
3142
  },
3057
3143
  "secondary": {
@@ -2,6 +2,10 @@
2
2
  "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
3
  "color": {
4
4
  "foreground": {
5
+ "primary": {
6
+ "$value": "{color.foreground.primary.warning.$root}",
7
+ "$description": "Fill color for primary interactive elements conveying caution or potential issues"
8
+ },
5
9
  "secondary": {
6
10
  "$value": "{color.foreground.secondary.warning.$root}",
7
11
  "$description": "Fill color for secondary interactive elements conveying caution or potential issues"
@@ -17,9 +21,13 @@
17
21
  },
18
22
  "border": {
19
23
  "$value": "{color.border.warning.$root}",
20
- "$description": "Border color for elements conveying caution or potential issues that require attention"
24
+ "$description": "Border color for elements conveying caution or potential issues"
25
+ },
26
+ "focusRing": {
27
+ "$value": "{color.focusRing.warning}",
28
+ "$description": "Focus ring color for caution interactive elements"
21
29
  },
22
30
  "$type": "color"
23
31
  },
24
- "$description": "Anticipation: caution context. Uses .warning variant as closest handover match (placeholder)."
32
+ "$description": "Anticipation: caution context."
25
33
  }
@@ -23,6 +23,10 @@
23
23
  "$value": "{color.border.constructive.$root}",
24
24
  "$description": "Border color for elements indicating constructive or additive actions"
25
25
  },
26
+ "focusRing": {
27
+ "$value": "{color.focusRing.constructive}",
28
+ "$description": "Focus ring color for constructive interactive elements"
29
+ },
26
30
  "$type": "color"
27
31
  },
28
32
  "$description": "Anticipation: constructive context."
@@ -23,6 +23,10 @@
23
23
  "$value": "{color.border.destructive.$root}",
24
24
  "$description": "Border color for elements indicating destructive or irreversible actions"
25
25
  },
26
+ "focusRing": {
27
+ "$value": "{color.focusRing.destructive}",
28
+ "$description": "Focus ring color for destructive interactive elements"
29
+ },
26
30
  "$type": "color"
27
31
  },
28
32
  "$description": "Anticipation: destructive context."
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.success.$root}",
7
+ "$description": "Fill color for secondary elements indicating a completed state"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.success.$root}",
12
+ "$description": "Text color for indicating a completed state"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.success.$root}",
16
+ "$description": "Icon color for indicating a completed state"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.success.$root}",
20
+ "$description": "Border color for elements indicating a completed state"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Lifecycle: completed context. Maps to success (green) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.error.$root}",
7
+ "$description": "Fill color for secondary elements indicating a failed state"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.error.$root}",
12
+ "$description": "Text color for indicating a failed state"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.error.$root}",
16
+ "$description": "Icon color for indicating a failed state"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.error.$root}",
20
+ "$description": "Border color for elements indicating a failed state"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Lifecycle: failed context. Maps to error (red) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.information.$root}",
7
+ "$description": "Fill color for secondary elements indicating an in-progress state"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.information.$root}",
12
+ "$description": "Text color for indicating an in-progress state"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.information.$root}",
16
+ "$description": "Icon color for indicating an in-progress state"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.information.$root}",
20
+ "$description": "Border color for elements indicating an in-progress state"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Lifecycle: in-progress context. Maps to information (blue) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.information.$root}",
7
+ "$description": "Fill color for secondary elements indicating a planned or pending state"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.information.$root}",
12
+ "$description": "Text color for indicating a planned or pending state"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.information.$root}",
16
+ "$description": "Icon color for indicating a planned or pending state"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.information.$root}",
20
+ "$description": "Border color for elements indicating a planned or pending state"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Lifecycle: planned context. Maps to information (blue/neutral) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.warning.$root}",
7
+ "$description": "Fill color for secondary elements indicating an alpha release stage"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.warning.$root}",
12
+ "$description": "Text color for indicating an alpha release stage"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.warning.$root}",
16
+ "$description": "Icon color for indicating an alpha release stage"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.warning.$root}",
20
+ "$description": "Border color for elements indicating an alpha release stage"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Release: alpha context. Maps to warning (amber) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.information.$root}",
7
+ "$description": "Fill color for secondary elements indicating a beta release stage"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.information.$root}",
12
+ "$description": "Text color for indicating a beta release stage"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.information.$root}",
16
+ "$description": "Icon color for indicating a beta release stage"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.information.$root}",
20
+ "$description": "Border color for elements indicating a beta release stage"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Release: beta context. Maps to information (blue) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.warning.$root}",
7
+ "$description": "Fill color for secondary elements indicating an experimental release stage"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.warning.$root}",
12
+ "$description": "Text color for indicating an experimental release stage"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.warning.$root}",
16
+ "$description": "Icon color for indicating an experimental release stage"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.warning.$root}",
20
+ "$description": "Border color for elements indicating an experimental release stage"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Release: experimental context. Maps to warning (orange) colours pending design confirmation."
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://designtokens.org/schemas/2025.10/format.json",
3
+ "color": {
4
+ "foreground": {
5
+ "secondary": {
6
+ "$value": "{color.foreground.secondary.success.$root}",
7
+ "$description": "Fill color for secondary elements indicating a stable release"
8
+ }
9
+ },
10
+ "text": {
11
+ "$value": "{color.text.success.$root}",
12
+ "$description": "Text color for indicating a stable release"
13
+ },
14
+ "icon": {
15
+ "$value": "{color.icon.success.$root}",
16
+ "$description": "Icon color for indicating a stable release"
17
+ },
18
+ "border": {
19
+ "$value": "{color.border.success.$root}",
20
+ "$description": "Border color for elements indicating a stable release"
21
+ },
22
+ "$type": "color"
23
+ },
24
+ "$description": "Release: stable context. Maps to success (green) colours pending design confirmation."
25
+ }