zyzz 0.0.3 → 0.0.5

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 (247) hide show
  1. package/README.md +34 -19
  2. package/dist/Config.d.ts +16 -167
  3. package/dist/Config.d.ts.map +1 -1
  4. package/dist/Config.js +7 -246
  5. package/dist/Config.js.map +1 -1
  6. package/dist/Style.d.ts +15 -12
  7. package/dist/Style.d.ts.map +1 -1
  8. package/dist/Style.js +51 -26
  9. package/dist/Style.js.map +1 -1
  10. package/dist/Vars.d.ts +114 -0
  11. package/dist/Vars.d.ts.map +1 -0
  12. package/dist/Vars.js +42 -0
  13. package/dist/Vars.js.map +1 -0
  14. package/dist/compiler/Graph.js +11 -8
  15. package/dist/compiler/Graph.js.map +1 -1
  16. package/dist/compiler/Native.d.ts +5 -5
  17. package/dist/compiler/Native.d.ts.map +1 -1
  18. package/dist/compiler/Native.js +21 -21
  19. package/dist/compiler/Native.js.map +1 -1
  20. package/dist/compiler/Source.d.ts +8 -6
  21. package/dist/compiler/Source.d.ts.map +1 -1
  22. package/dist/compiler/Source.js +47 -14
  23. package/dist/compiler/Source.js.map +1 -1
  24. package/dist/compiler/Transform.d.ts +1 -1
  25. package/dist/compiler/Transform.d.ts.map +1 -1
  26. package/dist/compiler/Transform.js +58 -22
  27. package/dist/compiler/Transform.js.map +1 -1
  28. package/dist/compiler/internal/Compositions.d.ts +5 -0
  29. package/dist/compiler/internal/Compositions.d.ts.map +1 -1
  30. package/dist/compiler/internal/Compositions.js +22 -3
  31. package/dist/compiler/internal/Compositions.js.map +1 -1
  32. package/dist/compiler/internal/Configurations.d.ts.map +1 -1
  33. package/dist/compiler/internal/Configurations.js +73 -12
  34. package/dist/compiler/internal/Configurations.js.map +1 -1
  35. package/dist/compiler/internal/Contract.d.ts +1 -1
  36. package/dist/compiler/internal/Contract.d.ts.map +1 -1
  37. package/dist/compiler/internal/Contract.js +155 -13
  38. package/dist/compiler/internal/Contract.js.map +1 -1
  39. package/dist/compiler/internal/Contributions.js +1 -1
  40. package/dist/compiler/internal/Contributions.js.map +1 -1
  41. package/dist/compiler/internal/Dynamic.js +1 -1
  42. package/dist/compiler/internal/Dynamic.js.map +1 -1
  43. package/dist/compiler/internal/Expression.d.ts +3 -0
  44. package/dist/compiler/internal/Expression.d.ts.map +1 -1
  45. package/dist/compiler/internal/Expression.js +21 -0
  46. package/dist/compiler/internal/Expression.js.map +1 -1
  47. package/dist/compiler/internal/Identifiers.d.ts +1 -1
  48. package/dist/compiler/internal/Identifiers.d.ts.map +1 -1
  49. package/dist/compiler/internal/Identifiers.js +2 -2
  50. package/dist/compiler/internal/Identifiers.js.map +1 -1
  51. package/dist/compiler/internal/NativeBindings.d.ts +1 -1
  52. package/dist/compiler/internal/NativeBindings.d.ts.map +1 -1
  53. package/dist/compiler/internal/NativeBindings.js +3 -3
  54. package/dist/compiler/internal/NativeBindings.js.map +1 -1
  55. package/dist/compiler/internal/PackedStyles.d.ts +1 -1
  56. package/dist/compiler/internal/PackedStyles.d.ts.map +1 -1
  57. package/dist/compiler/internal/PackedStyles.js +15 -25
  58. package/dist/compiler/internal/PackedStyles.js.map +1 -1
  59. package/dist/compiler/internal/Recipes.js +1 -1
  60. package/dist/compiler/internal/Recipes.js.map +1 -1
  61. package/dist/compiler/internal/Selectors.js +1 -1
  62. package/dist/compiler/internal/Selectors.js.map +1 -1
  63. package/dist/compiler/internal/Themes.d.ts +12 -3
  64. package/dist/compiler/internal/Themes.d.ts.map +1 -1
  65. package/dist/compiler/internal/Themes.js +192 -52
  66. package/dist/compiler/internal/Themes.js.map +1 -1
  67. package/dist/compiler/internal/{Variables.d.ts → Vars.d.ts} +1 -1
  68. package/dist/compiler/internal/Vars.d.ts.map +1 -0
  69. package/dist/compiler/internal/{Variables.js → Vars.js} +3 -3
  70. package/dist/compiler/internal/Vars.js.map +1 -0
  71. package/dist/default.d.ts +147 -2562
  72. package/dist/default.d.ts.map +1 -1
  73. package/dist/default.js +85 -80
  74. package/dist/default.js.map +2 -2
  75. package/dist/default.js.zyzz.json +1 -1
  76. package/dist/esbuild/index.d.ts +3 -0
  77. package/dist/esbuild/index.d.ts.map +1 -0
  78. package/dist/esbuild/index.js +5 -0
  79. package/dist/esbuild/index.js.map +1 -0
  80. package/dist/index.d.ts +4 -4
  81. package/dist/index.d.ts.map +1 -1
  82. package/dist/index.js +4 -4
  83. package/dist/index.js.map +1 -1
  84. package/dist/internal/Authoring.d.ts +1 -1
  85. package/dist/internal/Authoring.d.ts.map +1 -1
  86. package/dist/internal/Authoring.js +4 -4
  87. package/dist/internal/Authoring.js.map +1 -1
  88. package/dist/internal/Binding.d.ts +1 -1
  89. package/dist/internal/Binding.d.ts.map +1 -1
  90. package/dist/internal/Completion.d.ts +19 -0
  91. package/dist/internal/Completion.d.ts.map +1 -0
  92. package/dist/internal/Completion.js +2 -0
  93. package/dist/internal/Completion.js.map +1 -0
  94. package/dist/internal/Condition.d.ts +3 -1
  95. package/dist/internal/Condition.d.ts.map +1 -1
  96. package/dist/internal/Condition.js.map +1 -1
  97. package/dist/internal/Configuration.d.ts +248 -0
  98. package/dist/internal/Configuration.d.ts.map +1 -0
  99. package/dist/internal/Configuration.js +343 -0
  100. package/dist/internal/Configuration.js.map +1 -0
  101. package/dist/{Theme.d.ts → internal/Theme.d.ts} +15 -13
  102. package/dist/internal/Theme.d.ts.map +1 -0
  103. package/dist/{Theme.js → internal/Theme.js} +39 -12
  104. package/dist/internal/Theme.js.map +1 -0
  105. package/dist/internal/Token.d.ts +46 -16
  106. package/dist/internal/Token.d.ts.map +1 -1
  107. package/dist/internal/Token.js +89 -5
  108. package/dist/internal/Token.js.map +1 -1
  109. package/dist/internal/Typography.d.ts +13 -5
  110. package/dist/internal/Typography.d.ts.map +1 -1
  111. package/dist/internal/Typography.js +42 -6
  112. package/dist/internal/Typography.js.map +1 -1
  113. package/dist/internal/Value.d.ts +6 -1
  114. package/dist/internal/Value.d.ts.map +1 -1
  115. package/dist/internal/Value.js.map +1 -1
  116. package/dist/internal/VariableSets.d.ts +20 -0
  117. package/dist/internal/VariableSets.d.ts.map +1 -0
  118. package/dist/internal/VariableSets.js +317 -0
  119. package/dist/internal/VariableSets.js.map +1 -0
  120. package/dist/next/loader.js +15 -5
  121. package/dist/next/loader.js.map +1 -1
  122. package/dist/node/Host.d.ts.map +1 -1
  123. package/dist/node/Host.js +1 -1
  124. package/dist/node/Host.js.map +1 -1
  125. package/dist/react-native/Host.d.ts +2 -2
  126. package/dist/react-native/Host.d.ts.map +1 -1
  127. package/dist/react-native/Host.js +4 -4
  128. package/dist/react-native/Host.js.map +1 -1
  129. package/dist/react-native/StyleSheet.d.ts +9 -8
  130. package/dist/react-native/StyleSheet.d.ts.map +1 -1
  131. package/dist/react-native/StyleSheet.js +29 -23
  132. package/dist/react-native/StyleSheet.js.map +1 -1
  133. package/dist/react-native/Variants.d.ts +3 -3
  134. package/dist/react-native/Variants.d.ts.map +1 -1
  135. package/dist/react-native/Variants.js +2 -2
  136. package/dist/react-native/react.d.ts +1 -1
  137. package/dist/react-native/react.d.ts.map +1 -1
  138. package/dist/react-native/react.js +5 -5
  139. package/dist/react-native/react.js.map +1 -1
  140. package/dist/rollup/index.d.ts +3 -0
  141. package/dist/rollup/index.d.ts.map +1 -0
  142. package/dist/rollup/index.js +5 -0
  143. package/dist/rollup/index.js.map +1 -0
  144. package/dist/runtime/Appearance.d.ts +7 -7
  145. package/dist/runtime/Appearance.d.ts.map +1 -1
  146. package/dist/runtime/Appearance.js +15 -15
  147. package/dist/runtime/Appearance.js.map +1 -1
  148. package/dist/runtime/Dynamic.d.ts.map +1 -1
  149. package/dist/runtime/Dynamic.js +4 -1
  150. package/dist/runtime/Dynamic.js.map +1 -1
  151. package/dist/runtime/NativeContext.d.ts +4 -4
  152. package/dist/runtime/NativeContext.d.ts.map +1 -1
  153. package/dist/runtime/NativeContext.js +5 -5
  154. package/dist/runtime/NativeContext.js.map +1 -1
  155. package/dist/runtime/NativeDynamic.d.ts +1 -1
  156. package/dist/runtime/NativeDynamic.d.ts.map +1 -1
  157. package/dist/runtime/NativeDynamic.js.map +1 -1
  158. package/dist/runtime/Props.d.ts +1 -1
  159. package/dist/runtime/Props.js +3 -3
  160. package/dist/runtime/Props.js.map +1 -1
  161. package/dist/runtime/Selection.d.ts +14 -10
  162. package/dist/runtime/Selection.d.ts.map +1 -1
  163. package/dist/runtime/Selection.js +19 -18
  164. package/dist/runtime/Selection.js.map +1 -1
  165. package/dist/styleFunction.d.ts +14 -14
  166. package/dist/styleFunction.d.ts.map +1 -1
  167. package/dist/styleFunction.js.map +1 -1
  168. package/dist/unplugin/index.d.ts +20 -0
  169. package/dist/unplugin/index.d.ts.map +1 -0
  170. package/dist/unplugin/index.js +498 -0
  171. package/dist/unplugin/index.js.map +1 -0
  172. package/dist/variants.d.ts +3 -3
  173. package/dist/variants.d.ts.map +1 -1
  174. package/dist/variants.js.map +1 -1
  175. package/dist/vite/index.d.ts.map +1 -1
  176. package/dist/vite/index.js +6 -3
  177. package/dist/vite/index.js.map +1 -1
  178. package/dist/web/Css.d.ts +4 -3
  179. package/dist/web/Css.d.ts.map +1 -1
  180. package/dist/web/Css.js +4 -4
  181. package/dist/web/Css.js.map +1 -1
  182. package/dist/web/internal/Themes.d.ts +3 -2
  183. package/dist/web/internal/Themes.d.ts.map +1 -1
  184. package/dist/web/internal/Themes.js +42 -6
  185. package/dist/web/internal/Themes.js.map +1 -1
  186. package/dist/webpack/index.d.ts +3 -0
  187. package/dist/webpack/index.d.ts.map +1 -0
  188. package/dist/webpack/index.js +5 -0
  189. package/dist/webpack/index.js.map +1 -0
  190. package/package.json +23 -2
  191. package/src/Config.ts +43 -685
  192. package/src/Style.ts +97 -34
  193. package/src/Vars.ts +299 -0
  194. package/src/compiler/Graph.ts +14 -9
  195. package/src/compiler/Native.ts +29 -32
  196. package/src/compiler/Source.ts +59 -21
  197. package/src/compiler/Transform.ts +73 -23
  198. package/src/compiler/internal/Compositions.ts +36 -3
  199. package/src/compiler/internal/Configurations.ts +83 -11
  200. package/src/compiler/internal/Contract.ts +207 -15
  201. package/src/compiler/internal/Contributions.ts +1 -1
  202. package/src/compiler/internal/Dynamic.ts +1 -1
  203. package/src/compiler/internal/Expression.ts +26 -0
  204. package/src/compiler/internal/Identifiers.ts +2 -1
  205. package/src/compiler/internal/NativeBindings.ts +3 -3
  206. package/src/compiler/internal/PackedStyles.ts +22 -26
  207. package/src/compiler/internal/Recipes.ts +1 -1
  208. package/src/compiler/internal/Selectors.ts +1 -1
  209. package/src/compiler/internal/Themes.ts +266 -57
  210. package/src/compiler/internal/{Variables.ts → Vars.ts} +2 -2
  211. package/src/default.ts +173 -154
  212. package/src/esbuild/index.ts +5 -0
  213. package/src/index.ts +4 -4
  214. package/src/internal/Authoring.ts +5 -7
  215. package/src/internal/Binding.ts +1 -1
  216. package/src/internal/Completion.ts +42 -0
  217. package/src/internal/Condition.ts +31 -1
  218. package/src/internal/Configuration.ts +970 -0
  219. package/src/{Theme.ts → internal/Theme.ts} +75 -20
  220. package/src/internal/Token.ts +258 -85
  221. package/src/internal/Typography.ts +71 -16
  222. package/src/internal/Value.ts +45 -26
  223. package/src/internal/VariableSets.ts +458 -0
  224. package/src/next/loader.ts +19 -5
  225. package/src/node/Host.ts +1 -2
  226. package/src/react-native/Host.ts +6 -6
  227. package/src/react-native/StyleSheet.ts +49 -42
  228. package/src/react-native/Variants.ts +3 -3
  229. package/src/react-native/react.ts +6 -6
  230. package/src/rollup/index.ts +5 -0
  231. package/src/runtime/Appearance.ts +20 -20
  232. package/src/runtime/Dynamic.ts +4 -1
  233. package/src/runtime/NativeContext.ts +8 -8
  234. package/src/runtime/NativeDynamic.ts +2 -4
  235. package/src/runtime/Props.ts +3 -3
  236. package/src/runtime/Selection.ts +44 -33
  237. package/src/styleFunction.ts +22 -19
  238. package/src/unplugin/index.ts +600 -0
  239. package/src/variants.ts +7 -5
  240. package/src/vite/index.ts +5 -4
  241. package/src/web/Css.ts +10 -7
  242. package/src/web/internal/Themes.ts +52 -9
  243. package/src/webpack/index.ts +5 -0
  244. package/dist/Theme.d.ts.map +0 -1
  245. package/dist/Theme.js.map +0 -1
  246. package/dist/compiler/internal/Variables.d.ts.map +0 -1
  247. package/dist/compiler/internal/Variables.js.map +0 -1
package/src/default.ts CHANGED
@@ -36,119 +36,119 @@ export const tokens = {
36
36
  },
37
37
  color: {
38
38
  amber: {
39
- 100: { dark: '#291800', light: '#fff6e1' },
40
- 200: { dark: '#331b00', light: '#fff4d4' },
41
- 300: { dark: '#4f2900', light: '#fff1c8' },
42
- 400: { dark: '#573200', light: '#ffdd84' },
43
- 500: { dark: '#6c4100', light: '#ffc85e' },
44
- 600: { dark: '#e99c00', light: '#fa0' },
45
- 700: '#ffb200',
46
- 800: '#f90',
47
- 900: { dark: '#f90', light: '#a64f00' },
48
- 1000: { dark: '#fff3d9', light: '#541c00' },
39
+ 100: { dark: '#291800', light: '#fff6e5' },
40
+ 200: { dark: '#331b00', light: '#fff4d6' },
41
+ 300: { dark: '#4d2a00', light: '#fef0cd' },
42
+ 400: { dark: '#573300', light: '#ffdd8f' },
43
+ 500: { dark: '#6b4105', light: '#ffc96b' },
44
+ 600: { dark: '#e79d13', light: '#f5b047' },
45
+ 700: '#ffb224',
46
+ 800: '#ff990a',
47
+ 900: { dark: '#f2a20d', light: '#a35200' },
48
+ 1000: { dark: '#fef3dc', light: '#4e2009' },
49
49
  },
50
50
  background: {
51
- 100: { dark: '#000', light: '#fff' },
51
+ 100: { dark: '#0a0a0a', light: '#fff' },
52
52
  200: { dark: '#000', light: '#fafafa' },
53
53
  },
54
54
  black: '#000',
55
55
  blue: {
56
- 100: { dark: '#06193a', light: '#f0f7ff' },
57
- 200: { dark: '#022248', light: '#eaf4ff' },
58
- 300: { dark: '#002f62', light: '#e0efff' },
59
- 400: { dark: '#003771', light: '#cce7ff' },
60
- 500: { dark: '#004287', light: '#97ccff' },
61
- 600: { dark: '#0090ff', light: '#51aeff' },
62
- 700: { dark: '#0071f6', light: '#0070f7' },
63
- 800: { dark: '#005fd8', light: '#005edc' },
64
- 900: { dark: '#50a8ff', light: '#0064e2' },
65
- 1000: { dark: '#ebf6ff', light: '#002453' },
56
+ 100: { dark: '#0f1c2e', light: '#f0f7ff' },
57
+ 200: { dark: '#10233d', light: '#ebf5ff' },
58
+ 300: { dark: '#0f2f57', light: '#e0f0ff' },
59
+ 400: { dark: '#0d3868', light: '#cce6ff' },
60
+ 500: { dark: '#0a4380', light: '#99ceff' },
61
+ 600: { dark: '#0091ff', light: '#52aeff' },
62
+ 700: '#0072f5',
63
+ 800: '#0062d1',
64
+ 900: { dark: '#52a8ff', light: '#0068d6' },
65
+ 1000: { dark: '#ebf6ff', light: '#00254d' },
66
66
  },
67
67
  foreground: { dark: '#ededed', light: '#171717' },
68
68
  gray: {
69
69
  100: { dark: '#1a1a1a', light: '#f2f2f2' },
70
70
  200: { dark: '#1f1f1f', light: '#ebebeb' },
71
71
  300: { dark: '#292929', light: '#e6e6e6' },
72
- 400: { dark: '#2e2e2e', light: '#eaeaea' },
72
+ 400: { dark: '#2e2e2e', light: '#ebebeb' },
73
73
  500: { dark: '#454545', light: '#c9c9c9' },
74
74
  600: { dark: '#878787', light: '#a8a8a8' },
75
75
  700: '#8f8f8f',
76
76
  800: '#7d7d7d',
77
- 900: { dark: '#a0a0a0', light: '#4d4d4d' },
77
+ 900: { dark: '#a1a1a1', light: '#4d4d4d' },
78
78
  1000: { dark: '#ededed', light: '#171717' },
79
79
  },
80
80
  grayAlpha: {
81
81
  100: { dark: '#ffffff0f', light: '#0000000d' },
82
- 200: { dark: '#ffffff17', light: '#00000015' },
82
+ 200: { dark: '#ffffff17', light: '#00000014' },
83
83
  300: { dark: '#ffffff21', light: '#0000001a' },
84
84
  400: { dark: '#ffffff24', light: '#00000014' },
85
85
  500: { dark: '#ffffff3d', light: '#00000036' },
86
- 600: { dark: '#ffffff82', light: '#0000003d' },
86
+ 600: { dark: '#ffffff82', light: '#00000057' },
87
87
  700: { dark: '#ffffff8a', light: '#00000070' },
88
88
  800: { dark: '#ffffff78', light: '#00000082' },
89
89
  900: { dark: '#ffffff9c', light: '#000000b3' },
90
90
  1000: { dark: '#ffffffeb', light: '#000000e8' },
91
91
  },
92
92
  green: {
93
- 100: { dark: '#00250a', light: '#ecfdec' },
94
- 200: { dark: '#003110', light: '#e5fce7' },
95
- 300: { dark: '#003814', light: '#d3fad1' },
96
- 400: { dark: '#004616', light: '#b9f5bc' },
97
- 500: { dark: '#00661d', light: '#82eb8d' },
98
- 600: { dark: '#009431', light: '#4ce15e' },
99
- 700: { dark: '#00ab3e', light: '#28a948' },
100
- 800: { dark: '#009335', light: '#279141' },
101
- 900: { dark: '#00ca52', light: '#107d32' },
102
- 1000: { dark: '#daffe5', light: '#00370d' },
93
+ 100: { dark: '#0b2212', light: '#effbef' },
94
+ 200: { dark: '#0f2e18', light: '#ebfaeb' },
95
+ 300: { dark: '#12361b', light: '#daf6da' },
96
+ 400: { dark: '#0c451b', light: '#c6f1c7' },
97
+ 500: { dark: '#126426', light: '#99e69e' },
98
+ 600: { dark: '#1a9338', light: '#6cda75' },
99
+ 700: '#45a557',
100
+ 800: '#398e4a',
101
+ 900: { dark: '#62c073', light: '#297a3a' },
102
+ 1000: { dark: '#e5fbea', light: '#1b311e' },
103
103
  },
104
104
  pink: {
105
- 100: { dark: '#310d1e', light: '#ffeaf5' },
106
- 200: { dark: '#420c25', light: '#ffeaf2' },
107
- 300: { dark: '#571032', light: '#ffe0eb' },
108
- 400: { dark: '#5d0c34', light: '#ffd5e1' },
109
- 500: { dark: '#76063f', light: '#fdb3cc' },
110
- 600: { dark: '#b90056', light: '#f97ea7' },
111
- 700: { dark: '#f12b82', light: '#f22782' },
112
- 800: { dark: '#e6006e', light: '#e4106e' },
113
- 900: { dark: '#ff518d', light: '#c41562' },
114
- 1000: { dark: '#ffeaf4', light: '#460523' },
105
+ 100: { dark: '#28151d', light: '#ffebf5' },
106
+ 200: { dark: '#3a1726', light: '#feecf2' },
107
+ 300: { dark: '#4f1c31', light: '#fce3ec' },
108
+ 400: { dark: '#551b33', light: '#f9d7e2' },
109
+ 500: { dark: '#6c1e3e', light: '#f5b8cc' },
110
+ 600: { dark: '#b31957', light: '#ee87a7' },
111
+ 700: '#ea3e83',
112
+ 800: '#df2670',
113
+ 900: { dark: '#f75f8f', light: '#bd2864' },
114
+ 1000: { dark: '#feecf4', light: '#430a23' },
115
115
  },
116
116
  purple: {
117
- 100: { dark: '#290c33', light: '#f9f0ff' },
118
- 200: { dark: '#341142', light: '#f9f1ff' },
119
- 300: { dark: '#47185e', light: '#f5e8ff' },
120
- 400: { dark: '#541a76', light: '#f1d9ff' },
121
- 500: { dark: '#642290', light: '#dda9ff' },
122
- 600: { dark: '#9440d5', light: '#c77dff' },
123
- 700: { dark: '#9440d5', light: '#9f00f4' },
124
- 800: { dark: '#7d2bba', light: '#8400cd' },
125
- 900: { dark: '#c472fb', light: '#7c00c9' },
126
- 1000: { dark: '#faedff', light: '#2e004d' },
117
+ 100: { dark: '#231528', light: '#f9f0ff' },
118
+ 200: { dark: '#2e1938', light: '#f9f1fe' },
119
+ 300: { dark: '#422154', light: '#f4e8fc' },
120
+ 400: { dark: '#4f2768', light: '#eddcf9' },
121
+ 500: { dark: '#5f2e85', light: '#d5b1f1' },
122
+ 600: { dark: '#8e4ec6', light: '#bf89ec' },
123
+ 700: '#8e4ec6',
124
+ 800: '#763da9',
125
+ 900: { dark: '#bf7af0', light: '#7820bc' },
126
+ 1000: { dark: '#f8edfc', light: '#2e004d' },
127
127
  },
128
128
  red: {
129
- 100: { dark: '#330a11', light: '#ffeef0' },
130
- 200: { dark: '#440d13', light: '#ffe9ea' },
131
- 300: { dark: '#5d0e17', light: '#ffe4e5' },
132
- 400: { dark: '#6f101b', light: '#ffd8d7' },
133
- 500: { dark: '#88151f', light: '#ffb5b6' },
134
- 600: { dark: '#f32e40', light: '#ff6a6e' },
135
- 700: { dark: '#f13242', light: '#fc0035' },
136
- 800: { dark: '#e2162a', light: '#e70022' },
137
- 900: { dark: '#ff5e63', light: '#d60020' },
138
- 1000: { dark: '#ffeaed', light: '#46000c' },
129
+ 100: { dark: '#2a1314', light: '#fff0f0' },
130
+ 200: { dark: '#3c1618', light: '#ffebeb' },
131
+ 300: { dark: '#561a1e', light: '#ffe5e5' },
132
+ 400: { dark: '#671e21', light: '#fdd8d8' },
133
+ 500: { dark: '#832126', light: '#f8b9b9' },
134
+ 600: { dark: '#e5484d', light: '#f87275' },
135
+ 700: '#e5484d',
136
+ 800: { dark: '#d93036', light: '#da2f35' },
137
+ 900: { dark: '#ff6166', light: '#cb2a2f' },
138
+ 1000: { dark: '#feecee', light: '#391417' },
139
139
  },
140
- surface: { dark: '#000', light: '#fff' },
140
+ surface: { dark: '#0a0a0a', light: '#fff' },
141
141
  teal: {
142
- 100: { dark: '#00211b', light: '#dffffb' },
143
- 200: { dark: '#002922', light: '#ddfef6' },
144
- 300: { dark: '#003b33', light: '#ccf9f1' },
145
- 400: { dark: '#003f35', light: '#b1f7ec' },
146
- 500: { dark: '#005f53', light: '#52f0db' },
147
- 600: { dark: '#009885', light: '#00e2c4' },
148
- 700: { dark: '#00a794', light: '#00a694' },
149
- 800: '#008d7d',
150
- 900: { dark: '#00c9b5', light: '#007a6e' },
151
- 1000: { dark: '#cefff5', light: '#003d34' },
142
+ 100: { dark: '#04201b', light: '#eefcf9' },
143
+ 200: { dark: '#062822', light: '#e5faf6' },
144
+ 300: { dark: '#083a33', light: '#d4f7f0' },
145
+ 400: { dark: '#053d35', light: '#bef4eb' },
146
+ 500: { dark: '#085e53', light: '#86ead9' },
147
+ 600: { dark: '#0c9784', light: '#45dec5' },
148
+ 700: '#12a594',
149
+ 800: '#0d8c7d',
150
+ 900: { dark: '#0ac7b4', light: '#067a6e' },
151
+ 1000: { dark: '#e0faf4', light: '#073c34' },
152
152
  },
153
153
  white: '#fff',
154
154
  },
@@ -596,8 +596,8 @@ export const tokens = {
596
596
 
597
597
  /** Default appearance, restoration script, and authoring helpers with bundled light/dark tokens. */
598
598
  // Generated from tokens by scripts/default-theme.ts; edit tokens and regenerate.
599
- export const { appearance, script, style, theme, variants } = Config.create({
600
- theme: {
599
+ const config = Config.create({
600
+ vars: {
601
601
  borderRadius: {
602
602
  xs: '0.125rem',
603
603
  sm: '0.25rem',
@@ -617,119 +617,119 @@ export const { appearance, script, style, theme, variants } = Config.create({
617
617
  },
618
618
  color: {
619
619
  amber: {
620
- 100: { dark: '#291800', light: '#fff6e1' },
621
- 200: { dark: '#331b00', light: '#fff4d4' },
622
- 300: { dark: '#4f2900', light: '#fff1c8' },
623
- 400: { dark: '#573200', light: '#ffdd84' },
624
- 500: { dark: '#6c4100', light: '#ffc85e' },
625
- 600: { dark: '#e99c00', light: '#fa0' },
626
- 700: '#ffb200',
627
- 800: '#f90',
628
- 900: { dark: '#f90', light: '#a64f00' },
629
- 1000: { dark: '#fff3d9', light: '#541c00' },
620
+ 100: { dark: '#291800', light: '#fff6e5' },
621
+ 200: { dark: '#331b00', light: '#fff4d6' },
622
+ 300: { dark: '#4d2a00', light: '#fef0cd' },
623
+ 400: { dark: '#573300', light: '#ffdd8f' },
624
+ 500: { dark: '#6b4105', light: '#ffc96b' },
625
+ 600: { dark: '#e79d13', light: '#f5b047' },
626
+ 700: '#ffb224',
627
+ 800: '#ff990a',
628
+ 900: { dark: '#f2a20d', light: '#a35200' },
629
+ 1000: { dark: '#fef3dc', light: '#4e2009' },
630
630
  },
631
631
  background: {
632
- 100: { dark: '#000', light: '#fff' },
632
+ 100: { dark: '#0a0a0a', light: '#fff' },
633
633
  200: { dark: '#000', light: '#fafafa' },
634
634
  },
635
635
  black: '#000',
636
636
  blue: {
637
- 100: { dark: '#06193a', light: '#f0f7ff' },
638
- 200: { dark: '#022248', light: '#eaf4ff' },
639
- 300: { dark: '#002f62', light: '#e0efff' },
640
- 400: { dark: '#003771', light: '#cce7ff' },
641
- 500: { dark: '#004287', light: '#97ccff' },
642
- 600: { dark: '#0090ff', light: '#51aeff' },
643
- 700: { dark: '#0071f6', light: '#0070f7' },
644
- 800: { dark: '#005fd8', light: '#005edc' },
645
- 900: { dark: '#50a8ff', light: '#0064e2' },
646
- 1000: { dark: '#ebf6ff', light: '#002453' },
637
+ 100: { dark: '#0f1c2e', light: '#f0f7ff' },
638
+ 200: { dark: '#10233d', light: '#ebf5ff' },
639
+ 300: { dark: '#0f2f57', light: '#e0f0ff' },
640
+ 400: { dark: '#0d3868', light: '#cce6ff' },
641
+ 500: { dark: '#0a4380', light: '#99ceff' },
642
+ 600: { dark: '#0091ff', light: '#52aeff' },
643
+ 700: '#0072f5',
644
+ 800: '#0062d1',
645
+ 900: { dark: '#52a8ff', light: '#0068d6' },
646
+ 1000: { dark: '#ebf6ff', light: '#00254d' },
647
647
  },
648
648
  foreground: { dark: '#ededed', light: '#171717' },
649
649
  gray: {
650
650
  100: { dark: '#1a1a1a', light: '#f2f2f2' },
651
651
  200: { dark: '#1f1f1f', light: '#ebebeb' },
652
652
  300: { dark: '#292929', light: '#e6e6e6' },
653
- 400: { dark: '#2e2e2e', light: '#eaeaea' },
653
+ 400: { dark: '#2e2e2e', light: '#ebebeb' },
654
654
  500: { dark: '#454545', light: '#c9c9c9' },
655
655
  600: { dark: '#878787', light: '#a8a8a8' },
656
656
  700: '#8f8f8f',
657
657
  800: '#7d7d7d',
658
- 900: { dark: '#a0a0a0', light: '#4d4d4d' },
658
+ 900: { dark: '#a1a1a1', light: '#4d4d4d' },
659
659
  1000: { dark: '#ededed', light: '#171717' },
660
660
  },
661
661
  grayAlpha: {
662
662
  100: { dark: '#ffffff0f', light: '#0000000d' },
663
- 200: { dark: '#ffffff17', light: '#00000015' },
663
+ 200: { dark: '#ffffff17', light: '#00000014' },
664
664
  300: { dark: '#ffffff21', light: '#0000001a' },
665
665
  400: { dark: '#ffffff24', light: '#00000014' },
666
666
  500: { dark: '#ffffff3d', light: '#00000036' },
667
- 600: { dark: '#ffffff82', light: '#0000003d' },
667
+ 600: { dark: '#ffffff82', light: '#00000057' },
668
668
  700: { dark: '#ffffff8a', light: '#00000070' },
669
669
  800: { dark: '#ffffff78', light: '#00000082' },
670
670
  900: { dark: '#ffffff9c', light: '#000000b3' },
671
671
  1000: { dark: '#ffffffeb', light: '#000000e8' },
672
672
  },
673
673
  green: {
674
- 100: { dark: '#00250a', light: '#ecfdec' },
675
- 200: { dark: '#003110', light: '#e5fce7' },
676
- 300: { dark: '#003814', light: '#d3fad1' },
677
- 400: { dark: '#004616', light: '#b9f5bc' },
678
- 500: { dark: '#00661d', light: '#82eb8d' },
679
- 600: { dark: '#009431', light: '#4ce15e' },
680
- 700: { dark: '#00ab3e', light: '#28a948' },
681
- 800: { dark: '#009335', light: '#279141' },
682
- 900: { dark: '#00ca52', light: '#107d32' },
683
- 1000: { dark: '#daffe5', light: '#00370d' },
674
+ 100: { dark: '#0b2212', light: '#effbef' },
675
+ 200: { dark: '#0f2e18', light: '#ebfaeb' },
676
+ 300: { dark: '#12361b', light: '#daf6da' },
677
+ 400: { dark: '#0c451b', light: '#c6f1c7' },
678
+ 500: { dark: '#126426', light: '#99e69e' },
679
+ 600: { dark: '#1a9338', light: '#6cda75' },
680
+ 700: '#45a557',
681
+ 800: '#398e4a',
682
+ 900: { dark: '#62c073', light: '#297a3a' },
683
+ 1000: { dark: '#e5fbea', light: '#1b311e' },
684
684
  },
685
685
  pink: {
686
- 100: { dark: '#310d1e', light: '#ffeaf5' },
687
- 200: { dark: '#420c25', light: '#ffeaf2' },
688
- 300: { dark: '#571032', light: '#ffe0eb' },
689
- 400: { dark: '#5d0c34', light: '#ffd5e1' },
690
- 500: { dark: '#76063f', light: '#fdb3cc' },
691
- 600: { dark: '#b90056', light: '#f97ea7' },
692
- 700: { dark: '#f12b82', light: '#f22782' },
693
- 800: { dark: '#e6006e', light: '#e4106e' },
694
- 900: { dark: '#ff518d', light: '#c41562' },
695
- 1000: { dark: '#ffeaf4', light: '#460523' },
686
+ 100: { dark: '#28151d', light: '#ffebf5' },
687
+ 200: { dark: '#3a1726', light: '#feecf2' },
688
+ 300: { dark: '#4f1c31', light: '#fce3ec' },
689
+ 400: { dark: '#551b33', light: '#f9d7e2' },
690
+ 500: { dark: '#6c1e3e', light: '#f5b8cc' },
691
+ 600: { dark: '#b31957', light: '#ee87a7' },
692
+ 700: '#ea3e83',
693
+ 800: '#df2670',
694
+ 900: { dark: '#f75f8f', light: '#bd2864' },
695
+ 1000: { dark: '#feecf4', light: '#430a23' },
696
696
  },
697
697
  purple: {
698
- 100: { dark: '#290c33', light: '#f9f0ff' },
699
- 200: { dark: '#341142', light: '#f9f1ff' },
700
- 300: { dark: '#47185e', light: '#f5e8ff' },
701
- 400: { dark: '#541a76', light: '#f1d9ff' },
702
- 500: { dark: '#642290', light: '#dda9ff' },
703
- 600: { dark: '#9440d5', light: '#c77dff' },
704
- 700: { dark: '#9440d5', light: '#9f00f4' },
705
- 800: { dark: '#7d2bba', light: '#8400cd' },
706
- 900: { dark: '#c472fb', light: '#7c00c9' },
707
- 1000: { dark: '#faedff', light: '#2e004d' },
698
+ 100: { dark: '#231528', light: '#f9f0ff' },
699
+ 200: { dark: '#2e1938', light: '#f9f1fe' },
700
+ 300: { dark: '#422154', light: '#f4e8fc' },
701
+ 400: { dark: '#4f2768', light: '#eddcf9' },
702
+ 500: { dark: '#5f2e85', light: '#d5b1f1' },
703
+ 600: { dark: '#8e4ec6', light: '#bf89ec' },
704
+ 700: '#8e4ec6',
705
+ 800: '#763da9',
706
+ 900: { dark: '#bf7af0', light: '#7820bc' },
707
+ 1000: { dark: '#f8edfc', light: '#2e004d' },
708
708
  },
709
709
  red: {
710
- 100: { dark: '#330a11', light: '#ffeef0' },
711
- 200: { dark: '#440d13', light: '#ffe9ea' },
712
- 300: { dark: '#5d0e17', light: '#ffe4e5' },
713
- 400: { dark: '#6f101b', light: '#ffd8d7' },
714
- 500: { dark: '#88151f', light: '#ffb5b6' },
715
- 600: { dark: '#f32e40', light: '#ff6a6e' },
716
- 700: { dark: '#f13242', light: '#fc0035' },
717
- 800: { dark: '#e2162a', light: '#e70022' },
718
- 900: { dark: '#ff5e63', light: '#d60020' },
719
- 1000: { dark: '#ffeaed', light: '#46000c' },
710
+ 100: { dark: '#2a1314', light: '#fff0f0' },
711
+ 200: { dark: '#3c1618', light: '#ffebeb' },
712
+ 300: { dark: '#561a1e', light: '#ffe5e5' },
713
+ 400: { dark: '#671e21', light: '#fdd8d8' },
714
+ 500: { dark: '#832126', light: '#f8b9b9' },
715
+ 600: { dark: '#e5484d', light: '#f87275' },
716
+ 700: '#e5484d',
717
+ 800: { dark: '#d93036', light: '#da2f35' },
718
+ 900: { dark: '#ff6166', light: '#cb2a2f' },
719
+ 1000: { dark: '#feecee', light: '#391417' },
720
720
  },
721
- surface: { dark: '#000', light: '#fff' },
721
+ surface: { dark: '#0a0a0a', light: '#fff' },
722
722
  teal: {
723
- 100: { dark: '#00211b', light: '#dffffb' },
724
- 200: { dark: '#002922', light: '#ddfef6' },
725
- 300: { dark: '#003b33', light: '#ccf9f1' },
726
- 400: { dark: '#003f35', light: '#b1f7ec' },
727
- 500: { dark: '#005f53', light: '#52f0db' },
728
- 600: { dark: '#009885', light: '#00e2c4' },
729
- 700: { dark: '#00a794', light: '#00a694' },
730
- 800: '#008d7d',
731
- 900: { dark: '#00c9b5', light: '#007a6e' },
732
- 1000: { dark: '#cefff5', light: '#003d34' },
723
+ 100: { dark: '#04201b', light: '#eefcf9' },
724
+ 200: { dark: '#062822', light: '#e5faf6' },
725
+ 300: { dark: '#083a33', light: '#d4f7f0' },
726
+ 400: { dark: '#053d35', light: '#bef4eb' },
727
+ 500: { dark: '#085e53', light: '#86ead9' },
728
+ 600: { dark: '#0c9784', light: '#45dec5' },
729
+ 700: '#12a594',
730
+ 800: '#0d8c7d',
731
+ 900: { dark: '#0ac7b4', light: '#067a6e' },
732
+ 1000: { dark: '#e0faf4', light: '#073c34' },
733
733
  },
734
734
  white: '#fff',
735
735
  },
@@ -1175,3 +1175,22 @@ export const { appearance, script, style, theme, variants } = Config.create({
1175
1175
  },
1176
1176
  },
1177
1177
  })
1178
+
1179
+ /** Default appearance helper. */
1180
+ export const appearance: Config.create.ReturnType<{
1181
+ vars: typeof tokens
1182
+ }>['appearance'] = config.appearance
1183
+ /** Default script helper. */
1184
+ export const script: Config.create.ReturnType<{
1185
+ vars: typeof tokens
1186
+ }>['script'] = config.script
1187
+ /** Default style helper. */
1188
+ export const style: Config.create.ReturnType<{ vars: typeof tokens }>['style'] =
1189
+ config.style
1190
+ /** Default vars helper. */
1191
+ export const vars: Config.create.ReturnType<{ vars: typeof tokens }>['vars'] =
1192
+ config.vars
1193
+ /** Default variants helper. */
1194
+ export const variants: Config.create.ReturnType<{
1195
+ vars: typeof tokens
1196
+ }>['variants'] = config.variants
@@ -0,0 +1,5 @@
1
+ /** Exposes the Zyzz esbuild build adapter. @module */
2
+ import { zyzz as unplugin } from '../unplugin/index.js'
3
+
4
+ /** Compiles project sources and emits `zyzz.css` into the bundler output directory. */
5
+ export const zyzz = unplugin.esbuild
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Exposes token-free authoring, ordered style definitions, and theme contracts.
2
+ * Exposes token-free authoring, ordered style definitions, and variable contracts.
3
3
  * @module
4
4
  */
5
- /** Explicit theme and layer authoring contracts. */
5
+ /** Explicit variable and layer authoring contracts. */
6
6
  export * as Config from './Config.js'
7
7
  /** Token-free literal authoring; requires a compile-time source transform. */
8
8
  export { style } from './styleFunction.js'
@@ -12,9 +12,9 @@ export { cx } from './cx.js'
12
12
  export type * as Props from './Props.js'
13
13
  /** Typed literal style definitions and validation diagnostics. */
14
14
  export * as Style from './Style.js'
15
- /** Typed theme contracts and compatible token overrides. */
16
- export * as Theme from './Theme.js'
17
15
  /** Typed CSS variable declarations and inline assignments. */
18
16
  export { variable } from './variable.js'
17
+ /** Immutable shared values, conditions, and compatible variable sets. */
18
+ export * as Vars from './Vars.js'
19
19
  /** Single-element finite recipes compiled ahead of time. */
20
20
  export { variants } from './variants.js'
@@ -4,7 +4,7 @@ import * as Html from '../runtime/CompositionHtml.js'
4
4
  import * as Identity from './Identity.js'
5
5
  import * as Props from '../runtime/Props.js'
6
6
  import * as Style from '../Style.js'
7
- import type * as Theme from '../Theme.js'
7
+ import type * as Theme from './Theme.js'
8
8
 
9
9
  /** Private ownership used by uncompiled composition; never spread onto DOM props. */
10
10
  export const metadata = Symbol.for('zyzz.authoring')
@@ -44,7 +44,7 @@ export function body(input: Record<string, unknown>): Record<string, unknown> {
44
44
  descriptors.web = { ...web, value: body(web.value) }
45
45
  return [[key, Object.create(Object.getPrototypeOf(value), descriptors)]]
46
46
  }
47
- if (key === 'selectors' || key === 'variables')
47
+ if (key === 'selectors' || key === 'vars')
48
48
  return Object.entries(value as Record<string, unknown>).map(
49
49
  ([name, entry]) => [
50
50
  name,
@@ -84,7 +84,7 @@ export function create(
84
84
  ) => Style.Definition
85
85
  )(
86
86
  { style: body(input as Record<string, unknown>) },
87
- { theme: options.theme },
87
+ { vars: options.theme },
88
88
  ).styles[0]!,
89
89
  )
90
90
  const props = Props.create({ className })
@@ -95,7 +95,7 @@ export function create(
95
95
  ...result.style,
96
96
  }
97
97
  for (const [field, value] of Object.entries(values ?? {})) {
98
- if (['className', 'style', 'variables'].includes(field)) continue
98
+ if (['className', 'style', 'vars'].includes(field)) continue
99
99
  style[Identity.slot(id!, field)] =
100
100
  value === '' ? ' ' : (value as string | number)
101
101
  }
@@ -107,9 +107,7 @@ export function create(
107
107
  attributes: [],
108
108
  slots: dynamic
109
109
  ? Object.keys(values ?? {})
110
- .filter(
111
- (key) => !['className', 'style', 'variables'].includes(key),
112
- )
110
+ .filter((key) => !['className', 'style', 'vars'].includes(key))
113
111
  .map((key) => Identity.slot(id!, key))
114
112
  : [],
115
113
  },
@@ -135,7 +135,7 @@ export type Inputs<values> = {
135
135
  | 'key'
136
136
  | 'ref'
137
137
  | 'style'
138
- | 'variables'
138
+ | 'vars'
139
139
  | '__proto__'
140
140
  ? never
141
141
  : Extract<values[key], `${string}!${string}`> extends never
@@ -0,0 +1,42 @@
1
+ /** Supplies editor hints independently of inferred declaration validation. @module */
2
+ import type * as Theme from './Theme.js'
3
+ import type * as Condition from './Condition.js'
4
+ import type * as Literal from './Literal.js'
5
+ import type * as Token from './Token.js'
6
+ import type * as Typography from './Typography.js'
7
+
8
+ /** Recursive hints do not determine which authored declarations are accepted. */
9
+ export type Properties<
10
+ tokens extends Theme.Tokens = {},
11
+ styles = Record<string, unknown>,
12
+ > = {
13
+ readonly [property in keyof Literal.Properties & keyof styles]?:
14
+ | (string extends Literal.Properties[property]
15
+ ? never
16
+ : Literal.Properties[property])
17
+ | Token.Names<tokens, property>
18
+ | (string & {})
19
+ | number
20
+ | object
21
+ } & {
22
+ // Escaped custom-property names can contain nesting characters.
23
+ readonly [key in (`@${string}` | `:${string}` | `${string}&${string}`) &
24
+ keyof styles]?:
25
+ | Nested<tokens>
26
+ | (key extends `${string}&${string}` ? string | number : never)
27
+ } & {
28
+ readonly [key in (
29
+ | Condition.Suggestions
30
+ | Exclude<Condition.Keys<tokens>, Condition.Raw>
31
+ ) &
32
+ keyof styles]?: Nested<tokens>
33
+ } & {
34
+ readonly [property in (Typography.Names<tokens> extends never
35
+ ? never
36
+ : 'typography') &
37
+ keyof styles]?: Typography.Names<tokens> | (string & {})
38
+ }
39
+
40
+ // Inferred validation checks extra fields, including vars and configured shorthands.
41
+ type Nested<tokens extends Theme.Tokens> = Properties<tokens> &
42
+ Readonly<Record<string, unknown>>
@@ -1,5 +1,35 @@
1
1
  /** Typed nested selector and condition keys without a general string index. @module */
2
- import type * as Theme from '../Theme.js'
2
+ import type * as Theme from './Theme.js'
3
+
4
+ /** Concrete suggestions supplement open selector and query patterns. */
5
+ export type Suggestions =
6
+ | '::after'
7
+ | '::backdrop'
8
+ | '::before'
9
+ | '::first-letter'
10
+ | '::first-line'
11
+ | '::marker'
12
+ | '::placeholder'
13
+ | '::selection'
14
+ | ':active'
15
+ | ':checked'
16
+ | ':disabled'
17
+ | ':empty'
18
+ | ':enabled'
19
+ | ':first-child'
20
+ | ':focus'
21
+ | ':focus-visible'
22
+ | ':focus-within'
23
+ | ':hover'
24
+ | ':last-child'
25
+ | ':only-child'
26
+ | ':visited'
27
+ | '@container'
28
+ | '@layer'
29
+ | '@media'
30
+ | '@scope'
31
+ | '@starting-style'
32
+ | '@supports'
3
33
 
4
34
  type Case<text extends string> = text extends `${infer first}${infer rest}`
5
35
  ? `${Lowercase<first> | Uppercase<first>}${Case<rest>}`