unholy-design-tokens 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 (111) hide show
  1. package/.github/workflows/lint-format-build.yml +35 -0
  2. package/.github/workflows/publish_release.yml +18 -0
  3. package/.prettierrc +9 -0
  4. package/ANALOGY_HOUSE.md +139 -0
  5. package/ANALOGY_I18NEXT.md +160 -0
  6. package/LICENSE +201 -0
  7. package/README.md +90 -0
  8. package/WHY_THIS_EXISTS.md +74 -0
  9. package/bin/build-tokens.ts +34 -0
  10. package/build/css/bg/bg.css +60 -0
  11. package/build/css/border/border.css +51 -0
  12. package/build/css/colors.css +204 -0
  13. package/build/css/conditional.css +8 -0
  14. package/build/css/cube/cube.block.css +18 -0
  15. package/build/css/cube/cube.composition.css +16 -0
  16. package/build/css/cube/cube.utility.css +185 -0
  17. package/build/css/font/font.css +24 -0
  18. package/build/css/space.css +20 -0
  19. package/build/css/text/text.css +48 -0
  20. package/build/css/themes/private-theme.css +228 -0
  21. package/build/css/themes/public-theme.css +228 -0
  22. package/build/css/variant/variant.css +42 -0
  23. package/build/css/variants.css +167 -0
  24. package/build/types/theme.d.ts +932 -0
  25. package/build/types/tokens.ts +653 -0
  26. package/dist/bin/build-tokens.js +27 -0
  27. package/dist/scripts/build-style-dictionary.js +32 -0
  28. package/dist/scripts/generate-typography-tokens.js +125 -0
  29. package/dist/src/colors/color.config.js +45 -0
  30. package/dist/src/colors/color.filter.js +19 -0
  31. package/dist/src/colors/color.formatter.js +25 -0
  32. package/dist/src/colors/index.js +2 -0
  33. package/dist/src/cube-css/cube.config.js +42 -0
  34. package/dist/src/cube-css/cube.formatter.js +89 -0
  35. package/dist/src/style-dictionary.config.js +143 -0
  36. package/dist/src/type-declarations/type-declarations.config.js +29 -0
  37. package/dist/src/type-declarations/type-declarations.formatter.js +111 -0
  38. package/dist/src/utils/helpers.js +9 -0
  39. package/dist/src/utils/index.js +4 -0
  40. package/dist/src/utils/template.js +83 -0
  41. package/dist/src/utils/tokens.js +80 -0
  42. package/dist/src/utils/utopia.js +19 -0
  43. package/eslint.config.js +67 -0
  44. package/package.json +60 -0
  45. package/scripts/build-style-dictionary.ts +44 -0
  46. package/scripts/generate-typography-tokens.ts +138 -0
  47. package/src/LICENSE +201 -0
  48. package/src/README.md +88 -0
  49. package/src/colors/color.config.ts +48 -0
  50. package/src/colors/color.filter.ts +28 -0
  51. package/src/colors/color.formatter.ts +43 -0
  52. package/src/colors/index.ts +6 -0
  53. package/src/cube-css/cube.config.ts +50 -0
  54. package/src/cube-css/cube.formatter.ts +104 -0
  55. package/src/formatters/spacing.js +95 -0
  56. package/src/style-dictionary.config.ts +151 -0
  57. package/src/theme/README.md +256 -0
  58. package/src/theme/cube-theme-addon.js +44 -0
  59. package/src/theme/helper.js +38 -0
  60. package/src/theme/index.js +6 -0
  61. package/src/theme/theme.config.js +42 -0
  62. package/src/theme/theme.filter.js +42 -0
  63. package/src/theme/theme.formatter.js +71 -0
  64. package/src/tokens/1 - primitives/README.md +58 -0
  65. package/src/tokens/1 - primitives/border.json +54 -0
  66. package/src/tokens/1 - primitives/breakpoint.json +10 -0
  67. package/src/tokens/1 - primitives/color-pool.json +266 -0
  68. package/src/tokens/1 - primitives/color.json +266 -0
  69. package/src/tokens/1 - primitives/font-scale.json +27 -0
  70. package/src/tokens/1 - primitives/font.json +23 -0
  71. package/src/tokens/1 - primitives/shadow.json +26 -0
  72. package/src/tokens/1 - primitives/space.json +27 -0
  73. package/src/tokens/2 - semantic/README.md +49 -0
  74. package/src/tokens/2 - semantic/border.json +27 -0
  75. package/src/tokens/2 - semantic/color.json +263 -0
  76. package/src/tokens/2 - semantic/details.md +1 -0
  77. package/src/tokens/2 - semantic/layout.json +52 -0
  78. package/src/tokens/2 - semantic/radius.json +13 -0
  79. package/src/tokens/2 - semantic/shadow.json +19 -0
  80. package/src/tokens/2 - semantic/spacing.json +25 -0
  81. package/src/tokens/3 - intent/README.md +43 -0
  82. package/src/tokens/3 - intent/background.json +135 -0
  83. package/src/tokens/3 - intent/color.json +265 -0
  84. package/src/tokens/3 - intent/font.json +61 -0
  85. package/src/tokens/3 - intent/text +67 -0
  86. package/src/tokens/README.md +176 -0
  87. package/src/tokens/color/brand.json +316 -0
  88. package/src/tokens/component/theming.json +69 -0
  89. package/src/tokens/conditional.json +40 -0
  90. package/src/tokens/custom/4 - (OPTIONAL) cube css/README.md +38 -0
  91. package/src/tokens/custom/4 - (OPTIONAL) cube css/block.json +24 -0
  92. package/src/tokens/custom/4 - (OPTIONAL) cube css/composition.json +26 -0
  93. package/src/tokens/custom/4 - (OPTIONAL) cube css/global.json +15 -0
  94. package/src/tokens/custom/4 - (OPTIONAL) cube css/utility.json +224 -0
  95. package/src/tokens/custom/OKlch/color.json +61 -0
  96. package/src/tokens/custom/OKlch/state.json +107 -0
  97. package/src/tokens/custom/OKlch/theme-color.json +34 -0
  98. package/src/tokens/custom/OKlch/variant.json +67 -0
  99. package/src/tokens/custom/components/highlighted.json +16 -0
  100. package/src/tokens/state.js +29 -0
  101. package/src/tokens/theme-color.json +34 -0
  102. package/src/type-declarations/type-declarations.config.ts +34 -0
  103. package/src/type-declarations/type-declarations.formatter.ts +122 -0
  104. package/src/utils/helpers.ts +11 -0
  105. package/src/utils/index.ts +4 -0
  106. package/src/utils/template.ts +110 -0
  107. package/src/utils/tokens.ts +95 -0
  108. package/src/utils/utopia.ts +36 -0
  109. package/tailwind.md +720 -0
  110. package/tsconfig.json +19 -0
  111. package/turbowatch.ts +14 -0
@@ -0,0 +1,316 @@
1
+ {
2
+ "color": {
3
+ "bg": {
4
+ "primary": {
5
+ "lightness": {
6
+ "value": "var(--color-primary-lightness, 0)",
7
+ "attribute": {
8
+ "type": "primary-oklch",
9
+ "item": "lightness"
10
+ }
11
+ },
12
+ "chroma": {
13
+ "value": "var(--color-primary-chroma, 0)",
14
+ "attribute": {
15
+ "type": "primary-oklch",
16
+ "item": "chroma"
17
+ }
18
+ },
19
+ "hue": {
20
+ "value": "var(--color-primary-hue, 0)",
21
+ "attribute": {
22
+ "type": "primary-oklch",
23
+ "item": "hue"
24
+ }
25
+ },
26
+ "opacity": {
27
+ "value": "var(--color-primary-opacity, 1)",
28
+ "attribute": {
29
+ "type": "primary-oklch",
30
+ "item": "opacity"
31
+ }
32
+ },
33
+ "_": {
34
+ "value": "oklch(var(--color-bg-primary-lightness) var(--color-bg-primary-chroma) var(--color-bg-primary-hue) / var(--color-bg-primary-opacity))",
35
+ "type": "color"
36
+ }
37
+ },
38
+ "secondary": {
39
+ "lightness": {
40
+ "value": "var(--color-secondary-lightness, 0)",
41
+ "attribute": {
42
+ "type": "secondary-oklch",
43
+ "item": "lightness"
44
+ }
45
+ },
46
+ "chroma": {
47
+ "value": "var(--color-secondary-chroma, 0)",
48
+ "attribute": {
49
+ "type": "secondary-oklch",
50
+ "item": "chroma"
51
+ }
52
+ },
53
+ "hue": {
54
+ "value": "var(--color-secondary-hue, 0)",
55
+ "attribute": {
56
+ "type": "secondary-oklch",
57
+ "item": "hue"
58
+ }
59
+ },
60
+ "opacity": {
61
+ "value": "var(--color-secondary-opacity, 0)",
62
+ "attribute": {
63
+ "type": "secondary-oklch",
64
+ "item": "opacity"
65
+ }
66
+ },
67
+ "_": {
68
+ "value": "oklch(var(--color-bg-secondary-lightness) var(--color-bg-secondary-chroma) var(--color-bg-secondary-hue) / var(--color-bg-secondary-opacity))",
69
+ "type": "color"
70
+ }
71
+ },
72
+ "danger": {
73
+ "lightness": {
74
+ "value": "var(--color-danger-lightness, 0)",
75
+ "attribute": {
76
+ "type": "danger-oklch",
77
+ "item": "lightness"
78
+ }
79
+ },
80
+ "chroma": {
81
+ "value": "var(--color-danger-chroma, 0)",
82
+ "attribute": {
83
+ "type": "danger-oklch",
84
+ "item": "chroma"
85
+ }
86
+ },
87
+ "hue": {
88
+ "value": "var(--color-danger-hue, 0)",
89
+ "attribute": {
90
+ "type": "danger-oklch",
91
+ "item": "hue"
92
+ }
93
+ },
94
+ "opacity": {
95
+ "value": "var(--color-danger-opacity, 1)",
96
+ "attribute": {
97
+ "type": "danger-oklch",
98
+ "item": "opacity"
99
+ }
100
+ },
101
+ "_": {
102
+ "value": "oklch(var(--color-bg-danger-lightness) var(--color-bg-danger-chroma) var(--color-bg-danger-hue) / var(--color-bg-danger-opacity))",
103
+ "type": "color"
104
+ }
105
+ }
106
+ },
107
+ "border": {
108
+ "primary": {
109
+ "lightness": {
110
+ "value": "var(--color-primary-lightness, 0)",
111
+ "attribute": {
112
+ "type": "primary-oklch",
113
+ "item": "lightness"
114
+ }
115
+ },
116
+ "chroma": {
117
+ "value": "var(--color-primary-chroma, 0)",
118
+ "attribute": {
119
+ "type": "primary-oklch",
120
+ "item": "chroma"
121
+ }
122
+ },
123
+ "hue": {
124
+ "value": "var(--color-primary-hue, 0)",
125
+ "attribute": {
126
+ "type": "primary-oklch",
127
+ "item": "hue"
128
+ }
129
+ },
130
+ "opacity": {
131
+ "value": "var(--color-primary-opacity, 1)",
132
+ "attribute": {
133
+ "type": "primary-oklch",
134
+ "item": "opacity"
135
+ }
136
+ },
137
+ "_": {
138
+ "value": "oklch(var(--color-border-primary-lightness) var(--color-border-primary-chroma) var(--color-border-primary-hue) / var(--color-border-primary-opacity))",
139
+ "type": "color"
140
+ }
141
+ },
142
+ "secondary": {
143
+ "lightness": {
144
+ "value": "var(--color-secondary-lightness, 0)",
145
+ "attribute": {
146
+ "type": "secondary-oklch",
147
+ "item": "lightness"
148
+ }
149
+ },
150
+ "chroma": {
151
+ "value": "var(--color-secondary-chroma, 0)",
152
+ "attribute": {
153
+ "type": "secondary-oklch",
154
+ "item": "chroma"
155
+ }
156
+ },
157
+ "hue": {
158
+ "value": "var(--color-secondary-hue, 0)",
159
+ "attribute": {
160
+ "type": "secondary-oklch",
161
+ "item": "hue"
162
+ }
163
+ },
164
+ "opacity": {
165
+ "value": "var(--color-secondary-opacity, 1)",
166
+ "attribute": {
167
+ "type": "secondary-oklch",
168
+ "item": "opacity"
169
+ }
170
+ },
171
+ "_": {
172
+ "value": "oklch(var(--color-border-secondary-lightness) var(--color-border-secondary-chroma) var(--color-border-secondary-hue) / var(--color-border-secondary-opacity))",
173
+ "type": "color"
174
+ }
175
+ },
176
+ "danger": {
177
+ "lightness": {
178
+ "value": "var(--color-danger-lightness, 0)",
179
+ "attribute": {
180
+ "type": "danger-oklch",
181
+ "item": "lightness"
182
+ }
183
+ },
184
+ "chroma": {
185
+ "value": "var(--color-danger-chroma, 0)",
186
+ "attribute": {
187
+ "type": "danger-oklch",
188
+ "item": "chroma"
189
+ }
190
+ },
191
+ "hue": {
192
+ "value": "var(--color-danger-hue, 0)",
193
+ "attribute": {
194
+ "type": "danger-oklch",
195
+ "item": "hue"
196
+ }
197
+ },
198
+ "opacity": {
199
+ "value": "var(--color-danger-opacity, 1)",
200
+ "attribute": {
201
+ "type": "danger-oklch",
202
+ "item": "opacity"
203
+ }
204
+ },
205
+ "_": {
206
+ "value": "oklch(var(--color-border-danger-lightness) var(--color-border-danger-chroma) var(--color-border-danger-hue) / var(--color-border-danger-opacity))",
207
+ "type": "color"
208
+ }
209
+ }
210
+ },
211
+ "text": {
212
+ "primary": {
213
+ "lightness": {
214
+ "value": "var(--color-primary-lightness, 0)",
215
+ "attribute": {
216
+ "type": "primary-oklch",
217
+ "item": "lightness"
218
+ }
219
+ },
220
+ "chroma": {
221
+ "value": "var(--color-primary-chroma, 0)",
222
+ "attribute": {
223
+ "type": "primary-oklch",
224
+ "item": "chroma"
225
+ }
226
+ },
227
+ "hue": {
228
+ "value": "var(--color-primary-hue, 0)",
229
+ "attribute": {
230
+ "type": "primary-oklch",
231
+ "item": "hue"
232
+ }
233
+ },
234
+ "opacity": {
235
+ "value": "var(--color-primary-opacity, 1)",
236
+ "attribute": {
237
+ "type": "primary-oklch",
238
+ "item": "opacity"
239
+ }
240
+ },
241
+ "_": {
242
+ "value": "oklch(var(--color-text-primary-lightness) var(--color-text-primary-chroma) var(--color-text-primary-hue) / var(--color-text-primary-opacity))",
243
+ "type": "color"
244
+ }
245
+ },
246
+ "secondary": {
247
+ "lightness": {
248
+ "value": "var(--color-secondary-lightness, 0)",
249
+ "attribute": {
250
+ "type": "secondary-oklch",
251
+ "item": "lightness"
252
+ }
253
+ },
254
+ "chroma": {
255
+ "value": "var(--color-secondary-chroma, 0)",
256
+ "attribute": {
257
+ "type": "secondary-oklch",
258
+ "item": "chroma"
259
+ }
260
+ },
261
+ "hue": {
262
+ "value": "var(--color-secondary-hue, 0)",
263
+ "attribute": {
264
+ "type": "secondary-oklch",
265
+ "item": "hue"
266
+ }
267
+ },
268
+ "opacity": {
269
+ "value": "var(--color-secondary-opacity, 1)",
270
+ "attribute": {
271
+ "type": "secondary-oklch",
272
+ "item": "opacity"
273
+ }
274
+ },
275
+ "_": {
276
+ "value": "oklch(var(--color-text-secondary-lightness) var(--color-text-secondary-chroma) var(--color-text-secondary-hue) / var(--color-text-secondary-opacity))",
277
+ "type": "color"
278
+ }
279
+ },
280
+ "danger": {
281
+ "lightness": {
282
+ "value": "var(--color-danger-lightness, 0)",
283
+ "attribute": {
284
+ "type": "danger-oklch",
285
+ "item": "lightness"
286
+ }
287
+ },
288
+ "chroma": {
289
+ "value": "var(--color-danger-chroma, 0)",
290
+ "attribute": {
291
+ "type": "danger-oklch",
292
+ "item": "chroma"
293
+ }
294
+ },
295
+ "hue": {
296
+ "value": "var(--color-danger-hue, 0)",
297
+ "attribute": {
298
+ "type": "danger-oklch",
299
+ "item": "hue"
300
+ }
301
+ },
302
+ "opacity": {
303
+ "value": "var(--color-danger-opacity, 1)",
304
+ "attribute": {
305
+ "type": "danger-oklch",
306
+ "item": "opacity"
307
+ }
308
+ },
309
+ "_": {
310
+ "value": "oklch(var(--color-text-danger-lightness) var(--color-text-danger-chroma) var(--color-text-danger-hue) / var(--color-text-danger-opacity))",
311
+ "type": "color"
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "component": {
3
+ "bg": {
4
+ "lightness": {
5
+ "value": "calc(var(--color-bg-lightness) + var(--variant-bg-lightness) + var(--state-bg-lightness))"
6
+ },
7
+ "chroma": {
8
+ "value": "calc(var(--color-bg-chroma) + var(--variant-bg-chroma) + var(--state-bg-chroma))"
9
+ },
10
+ "hue": {
11
+ "value": "calc(var(--color-bg-hue))"
12
+ },
13
+ "opacity": {
14
+ "value": "calc(var(--color-bg-opacity) + var(--variant-bg-opacity) + var(--state-bg-opacity))"
15
+ }
16
+ },
17
+ "border": {
18
+ "lightness": {
19
+ "value": "calc(var(--color-border-lightness) + var(--variant-border-lightness) + var(--state-border-lightness))"
20
+ },
21
+ "chroma": {
22
+ "value": "calc(var(--color-border-chroma) + var(--variant-border-chroma) + var(--state-border-chroma))"
23
+ },
24
+ "hue": {
25
+ "value": "calc(var(--color-border-hue))"
26
+ },
27
+ "opacity": {
28
+ "value": "calc(var(--color-border-opacity) + var(--variant-border-opacity) + var(--state-border-opacity))"
29
+ }
30
+ },
31
+ "text": {
32
+ "lightness": {
33
+ "value": "calc(var(--color-text-lightness) + var(--variant-text-lightness) + var(--state-text-lightness))"
34
+ },
35
+ "chroma": {
36
+ "value": "calc(var(--color-text-chroma) + var(--variant-text-chroma) + var(--state-text-chroma))"
37
+ },
38
+ "hue": {
39
+ "value": "calc(var(--color-text-hue))"
40
+ },
41
+ "opacity": {
42
+ "value": "calc(var(--color-text-opacity) + var(--variant-text-opacity) + var(--state-text-opacity))"
43
+ }
44
+ },
45
+ "opacity": {
46
+ "bg": {
47
+ "value": "var(--component-bg-opacity)",
48
+ "type": "opacity",
49
+ "attribute": {
50
+ "type": "base-component"
51
+ }
52
+ },
53
+ "border": {
54
+ "value": "var(--component-border-opacity)",
55
+ "type": "opacity",
56
+ "attribute": {
57
+ "type": "base-component"
58
+ }
59
+ },
60
+ "text": {
61
+ "value": "var(--component-text-opacity)",
62
+ "type": "opacity",
63
+ "attribute": {
64
+ "type": "base-component"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "conditional": {
3
+ "not-primary": {
4
+ "value": "calc(var(--secondary) + var(--danger))",
5
+ "attribute": {
6
+ "type": "conditional"
7
+ }
8
+ },
9
+ "not-secondary": {
10
+ "value": "calc(var(--primary) + var(--danger))",
11
+ "attribute": {
12
+ "type": "conditional"
13
+ }
14
+ },
15
+ "not-danger": {
16
+ "value": "calc(var(--primary) + var(--secondary))",
17
+ "attribute": {
18
+ "type": "conditional"
19
+ }
20
+ },
21
+ "light": {
22
+ "value": 80,
23
+ "attribute": {
24
+ "type": "conditional"
25
+ }
26
+ },
27
+ "threshold": {
28
+ "value": 10,
29
+ "attribute": {
30
+ "type": "conditional"
31
+ }
32
+ },
33
+ "switch": {
34
+ "value": "calc((var(--light) - var(--threshold)) * 100%)",
35
+ "attribute": {
36
+ "type": "conditional"
37
+ }
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,38 @@
1
+ # Cube CSS Layer (Optional)
2
+
3
+ This folder contains Cube CSS–style abstractions built _on top of_ design tokens.
4
+
5
+ Cube CSS is not a token layer.
6
+ It is a **mapping layer** that consumes tokens to produce:
7
+
8
+ - Blocks (components)
9
+ - Composition patterns (layout primitives)
10
+ - Utility rules (atomic shortcuts)
11
+
12
+ The goal is to make high-level UI glue fully token-driven and consistent.
13
+
14
+ ---
15
+
16
+ ## Layer Position
17
+
18
+ Cube lives _after_ design tokens:
19
+
20
+ ```text
21
+ Design Tokens → Cube CSS → Components
22
+ ```
23
+
24
+ ## Naming Schema
25
+
26
+ Cube CSS tokens follow this pattern:
27
+
28
+ - **Blocks**
29
+
30
+ ```text
31
+ --<component>-<property>-<state?>
32
+ ```
33
+
34
+ - **Composition**
35
+
36
+ ```text
37
+ --<high-level-recipe/component>-<property>-<state?>
38
+ ```
@@ -0,0 +1,24 @@
1
+ {
2
+ "cube": {
3
+ "block": {
4
+ "card": {
5
+ "bg": { "value": "var(--_color-bg-neutral)" },
6
+ "border": { "value": "var(--_color-border-subtle)" },
7
+ "radius": { "value": "var(--_border-radius-medium)" },
8
+ "padding": { "value": "var(--_spacing-md)" }
9
+ },
10
+ "button": {
11
+ "paddingX": { "value": "var(--_spacing-sm)" },
12
+ "paddingY": { "value": "var(--_spacing-xs)" },
13
+ "radius": { "value": "var(--_border-radius-medium)" },
14
+ "text": { "value": "var(--_color-text-primary)" },
15
+ "bg": { "value": "var(--_color-bg-primary)" },
16
+ "bg-hover": { "value": "var(--_color-bg-primary-hover)" }
17
+ },
18
+ "checkbox": {
19
+ "bg": { "value": "var(--_color-bg-primary)" },
20
+ "padding": { "value": "var(--_spacing-xs)" }
21
+ }
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "cube": {
3
+ "composition": {
4
+ "flow": {
5
+ "space": { "value": "var(--gutter)" }
6
+ },
7
+ "stack": {
8
+ "gap": { "value": "var(--gutter)" },
9
+ "align": { "value": "start" },
10
+ "direction": { "value": "var(--layout-direction)" }
11
+ },
12
+ "cluster": {
13
+ "gap": { "value": "var(--gutter)" },
14
+ "align": { "value": "center" }
15
+ },
16
+ "center": {
17
+ "maxWidth": { "value": "72ch" },
18
+ "paddingInline": { "value": "var(--gutter)" }
19
+ },
20
+ "switcher": {
21
+ "modifier": { "value": "var(--layout-break-at)" },
22
+ "gap": { "value": "var(--gutter)" }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "cube": {
3
+ "global": {
4
+ "gutter": {
5
+ "value": "var(--layout-gutter-sm)"
6
+ },
7
+ "on": {
8
+ "value": "initial"
9
+ },
10
+ "off": {
11
+ "value": ""
12
+ }
13
+ }
14
+ }
15
+ }