@newtone-dev/ui-react-web 0.44.0 → 0.46.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.
Files changed (300) hide show
  1. package/README.md +5 -3
  2. package/dist/app-frame/app-frame.css +77 -25
  3. package/dist/app-frame/app-frame.d.ts +2 -1
  4. package/dist/app-frame/app-frame.d.ts.map +1 -1
  5. package/dist/app-frame/app-frame.js +2 -1
  6. package/dist/app-frame/app-frame.js.map +1 -1
  7. package/dist/app-frame/index.d.ts +1 -1
  8. package/dist/app-frame/index.d.ts.map +1 -1
  9. package/dist/app-frame/launcher/launcher.d.ts.map +1 -1
  10. package/dist/app-frame/launcher/launcher.js +5 -3
  11. package/dist/app-frame/launcher/launcher.js.map +1 -1
  12. package/dist/app-frame/main-menu/main-menu.js +5 -1
  13. package/dist/app-frame/main-menu/main-menu.js.map +1 -1
  14. package/dist/app-frame/parts.d.ts +26 -1
  15. package/dist/app-frame/parts.d.ts.map +1 -1
  16. package/dist/app-frame/parts.js +17 -3
  17. package/dist/app-frame/parts.js.map +1 -1
  18. package/dist/ask-button/ask-button.css +7 -1
  19. package/dist/beside/beside.css +4 -0
  20. package/dist/button/button.css +14 -4
  21. package/dist/button/button.d.ts +12 -1
  22. package/dist/button/button.d.ts.map +1 -1
  23. package/dist/button/button.js +49 -3
  24. package/dist/button/button.js.map +1 -1
  25. package/dist/canvas/canvas.css +20 -5
  26. package/dist/canvas/cells/cells.d.ts +12 -1
  27. package/dist/canvas/cells/cells.d.ts.map +1 -1
  28. package/dist/canvas/cells/cells.js +16 -2
  29. package/dist/canvas/cells/cells.js.map +1 -1
  30. package/dist/canvas/cells/grid.d.ts +8 -2
  31. package/dist/canvas/cells/grid.d.ts.map +1 -1
  32. package/dist/canvas/cells/grid.js +8 -5
  33. package/dist/canvas/cells/grid.js.map +1 -1
  34. package/dist/canvas/dock/dock.d.ts +2 -2
  35. package/dist/canvas/dock/dock.js +2 -2
  36. package/dist/canvas/dock/dock.js.map +1 -1
  37. package/dist/card-box/card-box.css +8 -2
  38. package/dist/card-box/card-box.d.ts.map +1 -1
  39. package/dist/card-box/card-box.js +1 -1
  40. package/dist/card-box/card-box.js.map +1 -1
  41. package/dist/color/index.d.ts +4 -4
  42. package/dist/color/index.d.ts.map +1 -1
  43. package/dist/color/index.js +17 -15
  44. package/dist/color/index.js.map +1 -1
  45. package/dist/color/oklch.d.ts +6 -27
  46. package/dist/color/oklch.d.ts.map +1 -1
  47. package/dist/color/oklch.js +23 -61
  48. package/dist/color/oklch.js.map +1 -1
  49. package/dist/color/scale.d.ts +3 -18
  50. package/dist/color/scale.d.ts.map +1 -1
  51. package/dist/color/scale.js +13 -70
  52. package/dist/color/scale.js.map +1 -1
  53. package/dist/color/seeds.d.ts +51 -11
  54. package/dist/color/seeds.d.ts.map +1 -1
  55. package/dist/color/seeds.js +127 -41
  56. package/dist/color/seeds.js.map +1 -1
  57. package/dist/curve-field/curve-field.css +280 -0
  58. package/dist/curve-field/curve-field.d.ts +105 -0
  59. package/dist/curve-field/curve-field.d.ts.map +1 -0
  60. package/dist/curve-field/curve-field.js +532 -0
  61. package/dist/curve-field/curve-field.js.map +1 -0
  62. package/dist/curve-field/index.d.ts +3 -0
  63. package/dist/curve-field/index.d.ts.map +1 -0
  64. package/dist/curve-field/index.js +2 -0
  65. package/dist/curve-field/index.js.map +1 -0
  66. package/dist/diagram/diagram.css +63 -0
  67. package/dist/diagram/diagram.d.ts +63 -0
  68. package/dist/diagram/diagram.d.ts.map +1 -0
  69. package/dist/diagram/diagram.js +73 -0
  70. package/dist/diagram/diagram.js.map +1 -0
  71. package/dist/diagram/geometry.d.ts +60 -0
  72. package/dist/diagram/geometry.d.ts.map +1 -0
  73. package/dist/diagram/geometry.js +93 -0
  74. package/dist/diagram/geometry.js.map +1 -0
  75. package/dist/diagram/index.d.ts +7 -0
  76. package/dist/diagram/index.d.ts.map +1 -0
  77. package/dist/diagram/index.js +4 -0
  78. package/dist/diagram/index.js.map +1 -0
  79. package/dist/diagram/layout.d.ts +41 -0
  80. package/dist/diagram/layout.d.ts.map +1 -0
  81. package/dist/diagram/layout.js +157 -0
  82. package/dist/diagram/layout.js.map +1 -0
  83. package/dist/document/document.d.ts +7 -2
  84. package/dist/document/document.d.ts.map +1 -1
  85. package/dist/document/document.js +22 -4
  86. package/dist/document/document.js.map +1 -1
  87. package/dist/dynamic-range/dynamic-range.css +100 -0
  88. package/dist/dynamic-range/dynamic-range.d.ts +27 -0
  89. package/dist/dynamic-range/dynamic-range.d.ts.map +1 -0
  90. package/dist/dynamic-range/dynamic-range.js +20 -0
  91. package/dist/dynamic-range/dynamic-range.js.map +1 -0
  92. package/dist/dynamic-range/index.d.ts +3 -0
  93. package/dist/dynamic-range/index.d.ts.map +1 -0
  94. package/dist/dynamic-range/index.js +2 -0
  95. package/dist/dynamic-range/index.js.map +1 -0
  96. package/dist/file-grid/file-grid.css +65 -0
  97. package/dist/file-grid/file-grid.d.ts +35 -2
  98. package/dist/file-grid/file-grid.d.ts.map +1 -1
  99. package/dist/file-grid/file-grid.js +64 -3
  100. package/dist/file-grid/file-grid.js.map +1 -1
  101. package/dist/file-grid/index.d.ts +2 -2
  102. package/dist/file-grid/index.d.ts.map +1 -1
  103. package/dist/file-grid/index.js +1 -1
  104. package/dist/file-grid/index.js.map +1 -1
  105. package/dist/floating-bar/floating-bar.css +122 -32
  106. package/dist/floating-bar/floating-bar.d.ts +21 -2
  107. package/dist/floating-bar/floating-bar.d.ts.map +1 -1
  108. package/dist/floating-bar/floating-bar.js +64 -20
  109. package/dist/floating-bar/floating-bar.js.map +1 -1
  110. package/dist/floating-bar/index.d.ts +1 -1
  111. package/dist/floating-bar/index.d.ts.map +1 -1
  112. package/dist/font-picker/font-picker.css +4 -2
  113. package/dist/font-picker/font-picker.d.ts +34 -4
  114. package/dist/font-picker/font-picker.d.ts.map +1 -1
  115. package/dist/font-picker/font-picker.js +45 -9
  116. package/dist/font-picker/font-picker.js.map +1 -1
  117. package/dist/font-picker/index.d.ts +2 -2
  118. package/dist/font-picker/index.d.ts.map +1 -1
  119. package/dist/font-picker/index.js +1 -1
  120. package/dist/font-picker/index.js.map +1 -1
  121. package/dist/hint/hint.css +2 -6
  122. package/dist/icon/glyphs.d.ts +18 -0
  123. package/dist/icon/glyphs.d.ts.map +1 -0
  124. package/dist/icon/glyphs.js +17 -0
  125. package/dist/icon/glyphs.js.map +1 -0
  126. package/dist/icon/index.d.ts +2 -0
  127. package/dist/icon/index.d.ts.map +1 -1
  128. package/dist/icon/index.js +1 -0
  129. package/dist/icon/index.js.map +1 -1
  130. package/dist/identity/identity.d.ts +11 -3
  131. package/dist/identity/identity.d.ts.map +1 -1
  132. package/dist/identity/identity.js +8 -4
  133. package/dist/identity/identity.js.map +1 -1
  134. package/dist/index.d.ts +33 -17
  135. package/dist/index.d.ts.map +1 -1
  136. package/dist/index.js +11 -3
  137. package/dist/index.js.map +1 -1
  138. package/dist/inspector/index.d.ts +1 -1
  139. package/dist/inspector/index.d.ts.map +1 -1
  140. package/dist/inspector/inspector.css +368 -7
  141. package/dist/inspector/inspector.d.ts +182 -5
  142. package/dist/inspector/inspector.d.ts.map +1 -1
  143. package/dist/inspector/inspector.js +85 -7
  144. package/dist/inspector/inspector.js.map +1 -1
  145. package/dist/look-picker/look-picker.css +62 -2
  146. package/dist/look-picker/look-picker.d.ts +34 -2
  147. package/dist/look-picker/look-picker.d.ts.map +1 -1
  148. package/dist/look-picker/look-picker.js +51 -42
  149. package/dist/look-picker/look-picker.js.map +1 -1
  150. package/dist/material/material.css +128 -57
  151. package/dist/number-field/number-field.css +34 -0
  152. package/dist/number-field/number-field.d.ts +29 -3
  153. package/dist/number-field/number-field.d.ts.map +1 -1
  154. package/dist/number-field/number-field.js +61 -10
  155. package/dist/number-field/number-field.js.map +1 -1
  156. package/dist/page-editor/page-editor.css +2 -6
  157. package/dist/picker/picker.css +42 -0
  158. package/dist/picker/picker.d.ts +10 -1
  159. package/dist/picker/picker.d.ts.map +1 -1
  160. package/dist/picker/picker.js +40 -5
  161. package/dist/picker/picker.js.map +1 -1
  162. package/dist/pop-menu/index.d.ts +7 -0
  163. package/dist/pop-menu/index.d.ts.map +1 -0
  164. package/dist/pop-menu/index.js +6 -0
  165. package/dist/pop-menu/index.js.map +1 -0
  166. package/dist/{floating-bar/menu.d.ts → pop-menu/pop-menu.d.ts} +10 -2
  167. package/dist/pop-menu/pop-menu.d.ts.map +1 -0
  168. package/dist/{floating-bar/menu.js → pop-menu/pop-menu.js} +35 -12
  169. package/dist/pop-menu/pop-menu.js.map +1 -0
  170. package/dist/prompt-field/prompt-field.css +3 -3
  171. package/dist/prompt-field/prompt-field.d.ts +3 -3
  172. package/dist/prompt-field/prompt-field.d.ts.map +1 -1
  173. package/dist/prompt-field/prompt-field.js +10 -4
  174. package/dist/prompt-field/prompt-field.js.map +1 -1
  175. package/dist/quick-action/quick-action.css +1 -1
  176. package/dist/seed-color-field/seed-color-field.css +8 -10
  177. package/dist/seed-color-field/seed-color-field.d.ts +9 -0
  178. package/dist/seed-color-field/seed-color-field.d.ts.map +1 -1
  179. package/dist/seed-color-field/seed-color-field.js +37 -10
  180. package/dist/seed-color-field/seed-color-field.js.map +1 -1
  181. package/dist/seed-contrast-field/index.d.ts +5 -0
  182. package/dist/seed-contrast-field/index.d.ts.map +1 -0
  183. package/dist/seed-contrast-field/index.js +3 -0
  184. package/dist/seed-contrast-field/index.js.map +1 -0
  185. package/dist/seed-contrast-field/seed-contrast-field.css +11 -0
  186. package/dist/seed-contrast-field/seed-contrast-field.d.ts +36 -0
  187. package/dist/seed-contrast-field/seed-contrast-field.d.ts.map +1 -0
  188. package/dist/seed-contrast-field/seed-contrast-field.js +18 -0
  189. package/dist/seed-contrast-field/seed-contrast-field.js.map +1 -0
  190. package/dist/seed-contrast-field/seed-contrast-slider.css +112 -0
  191. package/dist/seed-contrast-field/seed-contrast-slider.d.ts +22 -0
  192. package/dist/seed-contrast-field/seed-contrast-slider.d.ts.map +1 -0
  193. package/dist/seed-contrast-field/seed-contrast-slider.js +75 -0
  194. package/dist/seed-contrast-field/seed-contrast-slider.js.map +1 -0
  195. package/dist/seed-roundness-field/index.d.ts +3 -0
  196. package/dist/seed-roundness-field/index.d.ts.map +1 -0
  197. package/dist/seed-roundness-field/index.js +2 -0
  198. package/dist/seed-roundness-field/index.js.map +1 -0
  199. package/dist/seed-roundness-field/seed-roundness-field.css +23 -0
  200. package/dist/seed-roundness-field/seed-roundness-field.d.ts +39 -0
  201. package/dist/seed-roundness-field/seed-roundness-field.d.ts.map +1 -0
  202. package/dist/seed-roundness-field/seed-roundness-field.js +15 -0
  203. package/dist/seed-roundness-field/seed-roundness-field.js.map +1 -0
  204. package/dist/seed-steps/index.d.ts +8 -0
  205. package/dist/seed-steps/index.d.ts.map +1 -0
  206. package/dist/seed-steps/index.js +7 -0
  207. package/dist/seed-steps/index.js.map +1 -0
  208. package/dist/seed-steps/reset-focus.d.ts +16 -0
  209. package/dist/seed-steps/reset-focus.d.ts.map +1 -0
  210. package/dist/seed-steps/reset-focus.js +53 -0
  211. package/dist/seed-steps/reset-focus.js.map +1 -0
  212. package/dist/seed-steps/seed-steps.css +83 -0
  213. package/dist/seed-steps/seed-steps.d.ts +47 -0
  214. package/dist/seed-steps/seed-steps.d.ts.map +1 -0
  215. package/dist/seed-steps/seed-steps.js +95 -0
  216. package/dist/seed-steps/seed-steps.js.map +1 -0
  217. package/dist/shell/shell.css +31 -33
  218. package/dist/slide-list/slide-list.css +23 -2
  219. package/dist/slide-list/slide-list.d.ts +11 -2
  220. package/dist/slide-list/slide-list.d.ts.map +1 -1
  221. package/dist/slide-list/slide-list.js +6 -6
  222. package/dist/slide-list/slide-list.js.map +1 -1
  223. package/dist/split/split.css +11 -8
  224. package/dist/split/split.d.ts +2 -0
  225. package/dist/split/split.d.ts.map +1 -1
  226. package/dist/split/split.js +21 -3
  227. package/dist/split/split.js.map +1 -1
  228. package/dist/stage/stage.d.ts +11 -4
  229. package/dist/stage/stage.d.ts.map +1 -1
  230. package/dist/stage/stage.js +30 -9
  231. package/dist/stage/stage.js.map +1 -1
  232. package/dist/step-list/index.d.ts +3 -0
  233. package/dist/step-list/index.d.ts.map +1 -0
  234. package/dist/step-list/index.js +2 -0
  235. package/dist/step-list/index.js.map +1 -0
  236. package/dist/step-list/step-list.css +224 -0
  237. package/dist/step-list/step-list.d.ts +211 -0
  238. package/dist/step-list/step-list.d.ts.map +1 -0
  239. package/dist/step-list/step-list.js +242 -0
  240. package/dist/step-list/step-list.js.map +1 -0
  241. package/dist/step-strip/index.d.ts +3 -0
  242. package/dist/step-strip/index.d.ts.map +1 -0
  243. package/dist/step-strip/index.js +2 -0
  244. package/dist/step-strip/index.js.map +1 -0
  245. package/dist/step-strip/step-strip.css +118 -0
  246. package/dist/step-strip/step-strip.d.ts +52 -0
  247. package/dist/step-strip/step-strip.d.ts.map +1 -0
  248. package/dist/step-strip/step-strip.js +47 -0
  249. package/dist/step-strip/step-strip.js.map +1 -0
  250. package/dist/suggestion/index.d.ts +3 -0
  251. package/dist/suggestion/index.d.ts.map +1 -0
  252. package/dist/suggestion/index.js +2 -0
  253. package/dist/suggestion/index.js.map +1 -0
  254. package/dist/suggestion/suggestion.css +45 -0
  255. package/dist/suggestion/suggestion.d.ts +23 -0
  256. package/dist/suggestion/suggestion.d.ts.map +1 -0
  257. package/dist/suggestion/suggestion.js +45 -0
  258. package/dist/suggestion/suggestion.js.map +1 -0
  259. package/dist/surface/surface.css +112 -0
  260. package/dist/switch/switch.css +1 -6
  261. package/dist/text-field/text-field.css +11 -2
  262. package/dist/thread/thread.css +2 -10
  263. package/dist/thread/thread.js +1 -1
  264. package/dist/thread/thread.js.map +1 -1
  265. package/dist/tile-picker/index.d.ts +1 -1
  266. package/dist/tile-picker/index.d.ts.map +1 -1
  267. package/dist/tile-picker/tile-picker.css +56 -10
  268. package/dist/tile-picker/tile-picker.d.ts +64 -7
  269. package/dist/tile-picker/tile-picker.d.ts.map +1 -1
  270. package/dist/tile-picker/tile-picker.js +79 -47
  271. package/dist/tile-picker/tile-picker.js.map +1 -1
  272. package/dist/tile-search/index.d.ts +7 -0
  273. package/dist/tile-search/index.d.ts.map +1 -0
  274. package/dist/tile-search/index.js +7 -0
  275. package/dist/tile-search/index.js.map +1 -0
  276. package/dist/tile-search/narrow.d.ts +22 -0
  277. package/dist/tile-search/narrow.d.ts.map +1 -0
  278. package/dist/tile-search/narrow.js +62 -0
  279. package/dist/tile-search/narrow.js.map +1 -0
  280. package/dist/tile-search/search-box.d.ts +19 -0
  281. package/dist/tile-search/search-box.d.ts.map +1 -0
  282. package/dist/tile-search/search-box.js +47 -0
  283. package/dist/tile-search/search-box.js.map +1 -0
  284. package/dist/tooltip/tooltip.css +13 -20
  285. package/dist/tooltip/tooltip.d.ts +2 -2
  286. package/dist/tooltip/tooltip.d.ts.map +1 -1
  287. package/dist/tooltip/tooltip.js +15 -2
  288. package/dist/tooltip/tooltip.js.map +1 -1
  289. package/dist/workbench/workbench.css +128 -4
  290. package/dist/workbench/workbench.d.ts +28 -1
  291. package/dist/workbench/workbench.d.ts.map +1 -1
  292. package/dist/workbench/workbench.js +13 -4
  293. package/dist/workbench/workbench.js.map +1 -1
  294. package/package.json +43 -1
  295. package/dist/color/gamut.d.ts +0 -20
  296. package/dist/color/gamut.d.ts.map +0 -1
  297. package/dist/color/gamut.js +0 -72
  298. package/dist/color/gamut.js.map +0 -1
  299. package/dist/floating-bar/menu.d.ts.map +0 -1
  300. package/dist/floating-bar/menu.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,uFAAuF;AACvF,sFAAsF;AACtF,wFAAwF;AACxF,qEAAqE;AACrE,EAAE;AACF,yFAAyF;AACzF,sFAAsF;AACtF,2FAA2F;AAC3F,EAAE;AACF,yFAAyF;AACzF,oFAAoF;AACpF,2DAA2D;AAC3D,iEAAiE;AACjE,+CAA+C;AAE/C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,EAAE;AACF,2GAA2G;AAC3G,6GAA6G;AAC7G,oHAAoH;AACpH,sHAAsH;AACtH,EAAE;AACF,qHAAqH;AACrH,kHAAkH;AAClH,oHAAoH;AACpH,oHAAoH;AACpH,wGAAwG;AACxG,EAAE;AACF,iGAAiG;AACjG,gHAAgH;AAChH,uEAAuE;AACvE,qFAAqF;AACrF,6EAA6E;AAE7E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEtE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
@@ -1,35 +1,14 @@
1
+ import type { Oklch } from '@newtone-dev/ui-tokens/engine';
2
+ export type { Oklch } from '@newtone-dev/ui-tokens/engine';
3
+ export type { Gamut } from '@newtone-dev/ui-tokens/engine/vector';
1
4
  export declare const LMS_FROM_LRGB: readonly [readonly [0.4122214708, 0.5363325363, 0.0514459929], readonly [0.2119034982, 0.6806995451, 0.1073969566], readonly [0.0883024619, 0.2817188376, 0.6299787005]];
2
5
  export declare const LAB_FROM_LMSP: readonly [readonly [0.2104542553, 0.793617785, -0.0040720468], readonly [1.9779984951, -2.428592205, 0.4505937099], readonly [0.0259040371, 0.7827717662, -0.808675766]];
3
- export declare const SRGB_R: readonly [4.0765379686154635, -3.3070962248908753, 0.2308224615351424];
4
- export declare const SRGB_G: readonly [-1.2686058016641382, 2.60974741090216, -0.3411636310115355];
5
- export declare const SRGB_B: readonly [-0.004199535952631, -0.7035140435404212, 1.7072021573980527];
6
- export declare const P3_R: readonly [3.128110529032312, -2.257075018354871, 0.1293047884378317];
7
- export declare const P3_G: readonly [-1.0911281609083134, 2.4132667617599557, -0.3221681708589348];
8
- export declare const P3_B: readonly [-0.0260136497064853, -0.5080276489512767, 1.5333166822296191];
9
- export declare const EPSILON = 0.000001;
10
- export declare const DEG_TO_RAD: number;
11
6
  export type M = readonly (readonly number[])[];
12
7
  export type V = readonly [number, number, number];
13
- export declare const clamp01: (x: number) => number;
14
- export interface Oklch {
15
- l: number;
16
- c: number;
17
- h: number;
18
- }
19
- export type Gamut = 'srgb' | 'p3';
20
8
  /** Measure a colour picked by eye. Its `c` is an ABSOLUTE chroma, not a seed's ratio. */
21
9
  export declare function hexToOklch(hex: string): Oklch;
10
+ /** OKLCH to linear sRGB, unclamped: the engine's three channels, as the `[r, g, b]` tuple this library returns. */
22
11
  export declare function oklchToLinearSrgb(l: number, c: number, h: number): V;
23
- /** Section 6.7, the sRGB half. Uppercase, to match everything the tokens repo emits. */
24
- export declare function oklchToHex({ l, c, h }: Oklch): string;
25
- /**
26
- * A number as CSS, rounded to 6 places and NEVER in exponent notation.
27
- *
28
- * The second half is load-bearing and is a workaround for somebody else's bug. esbuild --
29
- * what Vite runs over a production stylesheet -- strips trailing zeros from a number token
30
- * without first separating the mantissa from the exponent, so `4.656612873077393e-10`
31
- * comes out of a minified build as `4.656612873077393e-1`. That is the difference between
32
- * black and a mid grey, it happens only in a production build, and nothing warns.
33
- */
34
- export declare function cssNumber(value: number): string;
12
+ /** Section 6.7, the sRGB half: the engine's hex, uppercase, to match everything the tokens repo emits. */
13
+ export declare function oklchToHex(color: Oklch): string;
35
14
  //# sourceMappingURL=oklch.d.ts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EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAgBjD,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAW7C;AAED,mHAAmH;AACnH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAGpE;AAED,0GAA0G;AAC1G,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAE/C"}
@@ -1,14 +1,22 @@
1
- // The OKLCH colour space itself: the matrices, the transfer functions, and the two
2
- // conversions that are not on the derivation path.
1
+ // The OKLCH colour space where it is not the engine's: a hex measured in, and the two conversions this library has
2
+ // always published, kept to their call shapes over the engine's own.
3
3
  //
4
- // Split out of one 349-line file on 2026-09-02 so that the invariant in the blueprint's
5
- // section 5 -- "the forward matrices match contract 6.1 exactly" -- and its single
6
- // deliberate exception are checkable by reading forty lines instead of scanning three
7
- // hundred. That is the pain the split answers; the tidiness is a side effect.
4
+ // **The forward matrices, the transfer function and the gamut live in one place since 2026-11-14**: Newtone's palette
5
+ // engine, `@newtone-dev/ui-tokens/engine/vector` (newtone_ui_tokens/compute/vector.mjs), which this library imports
6
+ // live -- Joshua's decision, the HuevOS Core, page palette-engine. Until then this file carried its own full-precision
7
+ // copy of them (contract section 6.1's product, not Ottosson's rounding), held to the engine's bytes by a conformance
8
+ // runner. What is left here is what the engine does not do, and two adapters whose shapes differ from the engine's:
9
+ //
10
+ // hexToOklch section 6.3, the tooling path, with the OTHER matrix pair (below). Not the engine's.
11
+ // oklchToLinearSrgb the engine's channels, as the `[r, g, b]` tuple this library returned; the engine returns
12
+ // `{ r, g, b }`. The same three numbers, checked over 26,775 colours on 2026-11-14.
13
+ // oklchToHex the engine's hex, uppercase, as section 6.7 and everything the tokens repo emits are. The
14
+ // engine's own `oklchToHex` is lowercase and its `createScale` uppercases it, as this does.
8
15
  //
9
16
  // Private to `color/`. What leaves the folder is decided by index.ts.
17
+ import { oklchToHex as engineHex, oklchToLinearSrgb as engineLinearSrgb, } from '@newtone-dev/ui-tokens/engine/vector';
10
18
  // Linear sRGB -> LMS, and LMS' -> OKLab. Section 6.3 only, OFF the derivation path.
11
- // These are Ottosson's published values and are deliberately not the forward pair below:
19
+ // These are Ottosson's published values and are deliberately not the engine's forward pair:
12
20
  // they serve `hexToOklch`, which measures a colour someone picked by eye.
13
21
  export const LMS_FROM_LRGB = [
14
22
  [0.4122214708, 0.5363325363, 0.0514459929],
@@ -20,28 +28,14 @@ export const LAB_FROM_LMSP = [
20
28
  [1.9779984951, -2.428592205, 0.4505937099],
21
29
  [0.0259040371, 0.7827717662, -0.808675766],
22
30
  ];
23
- // ON the derivation path. The two forward matrices are the products of
24
- // (XYZ -> RGB) x (LMS -> XYZ) carried at full double precision, NOT Ottosson's pre-rounded
25
- // publication. About 4% of hexes move by one unit in one channel between the two; nothing
26
- // is visible, and every byte is nonetheless different. Using the published rounding here
27
- // breaks CHARTER.md non-negotiable 4 the moment this is compared with the tokens build.
28
- export const SRGB_R = [4.0765379686154635, -3.3070962248908753, 0.2308224615351424];
29
- export const SRGB_G = [-1.2686058016641382, 2.6097474109021599, -0.3411636310115355];
30
- export const SRGB_B = [-0.004199535952631, -0.7035140435404212, 1.7072021573980527];
31
- export const P3_R = [3.1281105290323121, -2.2570750183548709, 0.1293047884378317];
32
- export const P3_G = [-1.0911281609083134, 2.4132667617599557, -0.3221681708589348];
33
- export const P3_B = [-0.0260136497064853, -0.5080276489512767, 1.5333166822296191];
34
- export const EPSILON = 1e-6;
35
- export const DEG_TO_RAD = Math.PI / 180;
36
31
  const mul = (m, v) => [
37
32
  m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2],
38
33
  m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2],
39
34
  m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2],
40
35
  ];
41
- // Section 6.2. Two different thresholds. Using one for both is the classic bug.
36
+ // Section 6.2's decode, for a hex coming in. Its encode, for a hex going out, is the engine's (inside oklchToHex).
37
+ // Two different thresholds; using one for both is the classic bug.
42
38
  const decode = (x) => (x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4));
43
- const encode = (x) => (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
44
- export const clamp01 = (x) => Math.max(0, Math.min(1, x));
45
39
  // ---------------------------------------------------------------------------
46
40
  // Section 6.3 -- hex to OKLCH. Tooling only; a seed no longer carries a hex.
47
41
  // ---------------------------------------------------------------------------
@@ -59,45 +53,13 @@ export function hexToOklch(hex) {
59
53
  h += 360;
60
54
  return { l, c: Math.hypot(a, b), h };
61
55
  }
56
+ /** OKLCH to linear sRGB, unclamped: the engine's three channels, as the `[r, g, b]` tuple this library returns. */
62
57
  export function oklchToLinearSrgb(l, c, h) {
63
- const rad = h * DEG_TO_RAD;
64
- const a = c * Math.cos(rad);
65
- const b = c * Math.sin(rad);
66
- const l_ = l + 0.3963377774 * a + 0.2158037573 * b;
67
- const m_ = l - 0.1055613458 * a - 0.0638541728 * b;
68
- const s_ = l - 0.0894841775 * a - 1.291485548 * b;
69
- const lc = l_ * l_ * l_;
70
- const mc = m_ * m_ * m_;
71
- const sc = s_ * s_ * s_;
72
- return [
73
- SRGB_R[0] * lc + SRGB_R[1] * mc + SRGB_R[2] * sc,
74
- SRGB_G[0] * lc + SRGB_G[1] * mc + SRGB_G[2] * sc,
75
- SRGB_B[0] * lc + SRGB_B[1] * mc + SRGB_B[2] * sc,
76
- ];
77
- }
78
- /** Section 6.7, the sRGB half. Uppercase, to match everything the tokens repo emits. */
79
- export function oklchToHex({ l, c, h }) {
80
- return ('#' +
81
- oklchToLinearSrgb(l, c, h)
82
- .map((x) => Math.round(encode(clamp01(x)) * 255))
83
- .map((x) => x.toString(16).padStart(2, '0'))
84
- .join('')
85
- .toUpperCase());
58
+ const { r, g, b } = engineLinearSrgb(l, c, h);
59
+ return [r, g, b];
86
60
  }
87
- // ---------------------------------------------------------------------------
88
- // Section 6.8 -- serialization
89
- // ---------------------------------------------------------------------------
90
- /**
91
- * A number as CSS, rounded to 6 places and NEVER in exponent notation.
92
- *
93
- * The second half is load-bearing and is a workaround for somebody else's bug. esbuild --
94
- * what Vite runs over a production stylesheet -- strips trailing zeros from a number token
95
- * without first separating the mantissa from the exponent, so `4.656612873077393e-10`
96
- * comes out of a minified build as `4.656612873077393e-1`. That is the difference between
97
- * black and a mid grey, it happens only in a production build, and nothing warns.
98
- */
99
- export function cssNumber(value) {
100
- const trimmed = value.toFixed(6).replace(/\.?0+$/, '');
101
- return trimmed === '-0' || trimmed === '' ? '0' : trimmed;
61
+ /** Section 6.7, the sRGB half: the engine's hex, uppercase, to match everything the tokens repo emits. */
62
+ export function oklchToHex(color) {
63
+ return engineHex(color).toUpperCase();
102
64
  }
103
65
  //# sourceMappingURL=oklch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oklch.js","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,mDAAmD;AACnD,EAAE;AACF,wFAAwF;AACxF,mFAAmF;AACnF,sFAAsF;AACtF,8EAA8E;AAC9E,EAAE;AACF,sEAAsE;AAEtE,oFAAoF;AACpF,yFAAyF;AACzF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;CACpC,CAAA;AACV,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,WAAW,CAAC;C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,GAAG,GAAG,CAAC;QAC/B,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC9B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;KAC1B,CAAC,CAAA;IACF,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAiB,CAAC,CAAA;IACxE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;IAC1C,IAAI,CAAC,GAAG,CAAC;QAAE,CAAC,IAAI,GAAG,CAAA;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxC,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IAC7D,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AACpB,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,UAAU,CAAC,KAAY;IACnC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;AACzC,CAAC"}
@@ -1,20 +1,5 @@
1
- import type { Oklch } from './oklch.js';
2
- /** Fifty-one steps, index 0 to 50. Fixed by section 5.1, not by the colour maths. */
1
+ export { createScale as deriveScale } from '@newtone-dev/ui-tokens/engine';
2
+ export type { PaletteStep, SeedValue } from '@newtone-dev/ui-tokens/engine';
3
+ /** Fifty-one steps, index 0 to 50, at every Contrast: the HuevOS Core, newtone-color rule 2. */
3
4
  export declare const STEPS = 51;
4
- export interface PaletteStep {
5
- oklch: Oklch;
6
- srgb: string;
7
- }
8
- /**
9
- * One palette's fifty-one steps, from a hue and a saturation ratio.
10
- *
11
- * Derived TWICE, not encoded twice: the hex comes off a vector clamped to the sRGB
12
- * ceiling and the OKLCH channels off one at the P3 ceiling. Where a colour fits inside
13
- * sRGB the two agree; where it does not they do not round-trip, and that is section 6.7
14
- * rather than a rounding artefact.
15
- *
16
- * Quantised at 6 places for `l` and `c` -- which is what makes the L* = 0 endpoint round
17
- * to exactly 0 rather than to 4.66e-10 -- and 2 for `h`, a seed input never searched for.
18
- */
19
- export declare function deriveScale(hue: number, chroma: number): PaletteStep[];
20
5
  //# sourceMappingURL=scale.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/color/scale.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,YAAY,CAAA;AA0C9C,qFAAqF;AACrF,eAAO,MAAM,KAAK,KAAK,CAAA;AAEvB,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAgBtE"}
1
+ {"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/color/scale.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC1E,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAE3E,gGAAgG;AAChG,eAAO,MAAM,KAAK,KAAK,CAAA"}
@@ -1,75 +1,18 @@
1
- // CIE L*, the lightness search, and the fifty-one steps.
1
+ // The fifty-one steps: Newtone's palette engine itself, not a copy of it.
2
2
  //
3
- // Contract sections 6.5 and 3. The shape is `L* = 100 - 2 x step`, computed rather than
4
- // tabulated -- see the blueprint's section 5: "the derivation is computed, never tabulated".
3
+ // `deriveScale` IS `createScale` from `@newtone-dev/ui-tokens/engine` (newtone_ui_tokens/compute/scale.mjs), the
4
+ // module the tokens build runs, imported live since 2026-11-14 -- Joshua's decision, the HuevOS Core, page
5
+ // palette-engine. So what a seed may be here is what it may be there: a hue and a chroma, each one number or a curve
6
+ // `{ start, end, curve? }` across the steps (the HuevOS Core, page newtone-color), and `floor` and `ceiling` the two
7
+ // L* ends a seed's Contrast sets (newtone-color rule 4). Left out, they are 0 and 100: the absolute ladder.
8
+ //
9
+ // **This file held the port's lightness search until 2026-11-14, and `gamut.ts` its gamut maths.** Both were deleted
10
+ // that day, after the old `deriveScale(h, c)` and the engine's `createScale(h, c)` gave the same `{ oklch, srgb }`,
11
+ // byte for byte, at every step of 525 seeds (hues every 15 degrees, c from 0 to 1 by 0.05); the hex was uppercase on
12
+ // both sides. The engine changes only when Joshua asks (palette-engine rule 1), and never from here.
5
13
  //
6
14
  // Private to `color/`. What leaves the folder is decided by index.ts.
7
- import { clamp01, oklchToLinearSrgb, oklchToHex } from './oklch.js';
8
- import { colorAt } from './gamut.js';
9
- // ---------------------------------------------------------------------------
10
- // Section 6.5 -- CIE L*, and the lightness search
11
- // ---------------------------------------------------------------------------
12
- const DELTA = 6 / 29;
13
- const DELTA_SQ = DELTA * DELTA;
14
- const DELTA_CU = DELTA * DELTA * DELTA;
15
- function cieLstar({ l, c, h }) {
16
- const [r, g, b] = oklchToLinearSrgb(l, c, h);
17
- const y = 0.2126 * clamp01(r) + 0.7152 * clamp01(g) + 0.0722 * clamp01(b);
18
- // The linear branch is not decoration: without it the curve has infinite slope at zero
19
- // and the search below cannot converge on the last step.
20
- const f = y > DELTA_CU ? Math.cbrt(y) : y / (3 * DELTA_SQ) + 4 / 29;
21
- return 116 * f - 16;
22
- }
23
- /**
24
- * The colour whose CIE L* is `target`, found by bisection on OKLCH lightness.
25
- *
26
- * The colour is rebuilt at every probe, CHROMA INCLUDED: chroma depends on lightness
27
- * through the ceiling, and luminance depends on chroma. Searching on lightness while
28
- * holding chroma fixed converges on the wrong L.
29
- */
30
- function atLstar(hue, chroma, gamut, target) {
31
- let lo = 0;
32
- let hi = 1;
33
- for (let i = 0; i < 30; i++) {
34
- const mid = (lo + hi) / 2;
35
- if (cieLstar(colorAt(hue, chroma, gamut, mid)) < target)
36
- lo = mid;
37
- else
38
- hi = mid;
39
- }
40
- return colorAt(hue, chroma, gamut, (lo + hi) / 2);
41
- }
42
- // ---------------------------------------------------------------------------
43
- // Section 3 -- the palette
44
- // ---------------------------------------------------------------------------
45
- /** Fifty-one steps, index 0 to 50. Fixed by section 5.1, not by the colour maths. */
15
+ export { createScale as deriveScale } from '@newtone-dev/ui-tokens/engine';
16
+ /** Fifty-one steps, index 0 to 50, at every Contrast: the HuevOS Core, newtone-color rule 2. */
46
17
  export const STEPS = 51;
47
- /**
48
- * One palette's fifty-one steps, from a hue and a saturation ratio.
49
- *
50
- * Derived TWICE, not encoded twice: the hex comes off a vector clamped to the sRGB
51
- * ceiling and the OKLCH channels off one at the P3 ceiling. Where a colour fits inside
52
- * sRGB the two agree; where it does not they do not round-trip, and that is section 6.7
53
- * rather than a rounding artefact.
54
- *
55
- * Quantised at 6 places for `l` and `c` -- which is what makes the L* = 0 endpoint round
56
- * to exactly 0 rather than to 4.66e-10 -- and 2 for `h`, a seed input never searched for.
57
- */
58
- export function deriveScale(hue, chroma) {
59
- const out = [];
60
- for (let step = 0; step < STEPS; step++) {
61
- const target = Math.max(0, 100 - step * 2);
62
- const p3 = atLstar(hue, chroma, 'p3', target);
63
- const srgb = atLstar(hue, chroma, 'srgb', target);
64
- out.push({
65
- oklch: {
66
- l: Number(p3.l.toFixed(6)),
67
- c: Number(p3.c.toFixed(6)),
68
- h: Number(p3.h.toFixed(2)),
69
- },
70
- srgb: oklchToHex(srgb),
71
- });
72
- }
73
- return out;
74
- }
75
18
  //# sourceMappingURL=scale.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.js","sourceRoot":"","sources":["../../src/color/scale.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,wFAAwF;AACxF,6FAA6F;AAC7F,EAAE;AACF,sEAAsE;AAEtE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,8EAA8E;AAC9E,kDAAkD;AAClD,8EAA8E;AAE9E,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,CAAA;AACpB,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAA;AAC9B,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;AAEtC,SAAS,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAS;IAChC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAC5C,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACzE,uFAAuF;IACvF,yDAAyD;IACzD,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;IACnE,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,CAAA;AACvB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,GAAW,E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AM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC1B,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC1B,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;aAC7B;YACD,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;SACzB,CAAC,CAAA;IACN,CAAC;IACD,OAAO,GAAG,CAAA;AACd,CAAC"}
1
+ {"version":3,"file":"scale.js","sourceRoot":"","sources":["../../src/color/scale.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,iHAAiH;AACjH,2GAA2G;AAC3G,qHAAqH;AACrH,qHAAqH;AACrH,4GAA4G;AAC5G,EAAE;AACF,qHAAqH;AACrH,oHAAoH;AACpH,qHAAqH;AACrH,qGAAqG;AACrG,EAAE;AACF,sEAAsE;AAEtE,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAG1E,gGAAgG;AAChG,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAA"}
@@ -1,3 +1,4 @@
1
+ import type { SeedValue } from './scale.js';
1
2
  /**
2
3
  * One palette's seed: a hue and a saturation. Shaped exactly like `seed.json`.
3
4
  *
@@ -5,36 +6,75 @@
5
6
  * hue -- not an amount of chroma. It is therefore comparable across palettes, and `c = 1`
6
7
  * is the gamut boundary rather than an error. See contracts/seeds.md section 1.
7
8
  *
9
+ * **Each is one number, the same at every step, or a curve across the steps** (since 2026-11-14; the HuevOS Core,
10
+ * page newtone-color): `{ start, end, curve? }`, the value at step 0 and at step 50, travelling between them in a
11
+ * straight line, or with `curve: [x1, x2]` along the Bézier whose handles sit on its two caps. The type is the
12
+ * engine's own, `SeedValue`, because the engine is what reads it.
13
+ *
8
14
  * There is no lightness, because lightness is a property of the job a colour is doing and
9
15
  * the job is not known until a role asks for it. There is no `key` either: a key selects
10
16
  * which step a role reads, and roles are references resolved at build time.
11
17
  *
12
- * **`h` and `c` are both narrower than `number`, and the narrowing is not here.** contracts/seeds.md
13
- * section 1.1: a hue is a whole number of degrees and a saturation carries at most two decimal
14
- * places. TypeScript cannot say either of those about a `number`, and anything it could say would
15
- * be erased the moment a seed arrives through `JSON.parse` or an identity API -- which is how every
18
+ * **`h` and `c` are both narrower than their types, and the narrowing is not here.** contracts/seeds.md
19
+ * section 1.1: a hue is a whole number of degrees and a saturation carries at most two decimal places, and a curve's
20
+ * `start` and `end` are held to the same. TypeScript cannot say either of those about a `number`, and anything it
21
+ * could say would be erased the moment a seed arrives through `JSON.parse` or an identity API -- which is how every
16
22
  * seed in this house arrives. **So `validateSeeds` below is the type**, and asked to "fix the type"
17
23
  * this is the honest answer: the interface names the fields, the validator names the values.
18
24
  */
19
25
  export interface Seed {
20
- h: number;
21
- c: number;
26
+ h: SeedValue;
27
+ c: SeedValue;
22
28
  }
23
29
  export type SeedGroup = 'system' | 'custom';
24
30
  /** Group, then palette, then the seed. Any subset; what is absent is inherited. */
25
31
  export type Seeds = Partial<Record<SeedGroup, Record<string, Seed>>>;
32
+ /**
33
+ * A seed's Contrast, `contrast: { light, dark }` in seed.json: how far each end of the ladder pulls in from pure white and
34
+ * pure black, each a level from -2 to +2, 0 where left out (the HuevOS Core, newtone-color rule 4). Both read the
35
+ * same way (Joshua 2026-11-14): +2 brighter, -2 darker. The light end's L* is 96 + 2 x light and the dark end's
36
+ * 8 + 4 x dark, so 0 and 0 run from L* 96 to L* 8, and light +2 with dark -2 is the absolute ladder itself, L* 100 to 0.
37
+ */
38
+ export interface SeedContrast {
39
+ light?: number;
40
+ dark?: number;
41
+ }
26
42
  /**
27
43
  * Every way this seed set breaks the contract, as the build's own message strings.
28
44
  *
29
45
  * **Every violation, not the first.** Somebody who has just edited six numbers should not have
30
46
  * to run six times to find six mistakes -- contracts/seeds.md section 7.
31
47
  *
32
- * Two differences from the build, both deliberate. A palette may be ABSENT here: a runtime seed
48
+ * **A curve is checked as the build checks it** (since 2026-11-14): a system palette's `h` and `c`, and a custom
49
+ * palette's `h`, may each be one, and its refusals are the build's seven curve messages, word for word.
50
+ *
51
+ * Four differences from the build, all deliberate. A palette may be ABSENT here: a runtime seed
33
52
  * is a partial override and what it does not name inherits, where seed.json must name
34
- * everything. And a `custom` saturation is REJECTED here: section 7 delegates that one rule to
35
- * whatever accepts runtime seeds, because seed.json is the authored default where the
36
- * saturation is ours and belongs.
53
+ * everything. A `custom` saturation is REJECTED here, a curve as much as a number: section 7
54
+ * delegates that one rule to whatever accepts runtime seeds, because seed.json is the authored
55
+ * default where the saturation is ours and belongs. A `custom` hue is held to its palette's
56
+ * range here and to the circle in the build: section 7 says so, and issue 184 is where the
57
+ * runtime catches up. And a `custom` palette is refused BY NAME when it comes without its
58
+ * saturation, so that no custom palette is ever accepted (since 2026-11-14): the saturation it
59
+ * needs is seed.json's, which no runtime seed carries, so there is nothing to derive it from.
60
+ * Until then the engine itself threw a TypeError on the missing `c`, past a validator that had
61
+ * said yes -- and this function is the type (`Seed` above), so what it accepts must derive.
37
62
  */
38
63
  export declare function validateSeeds(seeds: Seeds): string[];
39
- export declare function seedProperties(seeds: Seeds, wide?: boolean): Record<string, string>;
64
+ /**
65
+ * Turn a set of seeds into the custom properties that re-derive those palettes.
66
+ *
67
+ * Derivation is atomic: a palette named here has all fifty-one steps recomputed, and one
68
+ * not named is untouched, so it inherits from the enclosing scope. That inheritance is
69
+ * CSS's, not ours -- which is why nesting works to any depth for free.
70
+ *
71
+ * **Two ladders per palette, as the build emits them** (since 2026-11-14): the absolute one, L* 100 to 0, as
72
+ * `--newtone-color-<group>-<name>-<step>`, which `fixed()` and ink() reads; and the one `contrast` sets, from its
73
+ * light end down to its dark end, as `--newtone-color-contrast-<group>-<name>-<step>`, which every role reads. `contrast` is
74
+ * the seed's Contrast, 0 and 0 where left out (L* 96 to 8). With light +2 and dark -2 the pulled-in ladder IS the absolute
75
+ * one, the build emits no second group and its roles read the absolute ladder, so nothing more is written here
76
+ * either. Until 2026-11-14 a preview wrote the absolute ladder alone, which the roles no longer read since Range (now Contrast)
77
+ * arrived, so a Style Book or Appearance preview moved a button's ink and not the roles around it.
78
+ */
79
+ export declare function seedProperties(seeds: Seeds, wide?: boolean, contrast?: SeedContrast): Record<string, string>;
40
80
  //# sourceMappingURL=seeds.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../src/color/seeds.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,IAAI;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3C,mFAAmF;AACnF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AA+FpE;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CA0CpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,UAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB1F"}
1
+ {"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../src/color/seeds.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,YAAY,CAAA;AAMxD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,IAAI;IACjB,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;CACf;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3C,mFAAmF;AACnF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,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