@aeris-ui/core 22.0.0-alpha.1 → 22.0.0-alpha.11

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 (318) hide show
  1. package/README.md +232 -191
  2. package/THIRD_PARTY_LICENSES.md +48 -0
  3. package/fesm2022/aeris-ui-core-accordion.mjs +666 -273
  4. package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
  5. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +284 -103
  6. package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
  7. package/fesm2022/aeris-ui-core-auto-complete.mjs +1301 -450
  8. package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
  9. package/fesm2022/aeris-ui-core-auto-focus.mjs +111 -61
  10. package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
  11. package/fesm2022/aeris-ui-core-avatar.mjs +383 -101
  12. package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
  13. package/fesm2022/aeris-ui-core-badge.mjs +562 -115
  14. package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
  15. package/fesm2022/aeris-ui-core-block-ui.mjs +221 -101
  16. package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
  17. package/fesm2022/aeris-ui-core-breadcrumb.mjs +609 -199
  18. package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
  19. package/fesm2022/aeris-ui-core-button-forms.mjs +78 -0
  20. package/fesm2022/aeris-ui-core-button-forms.mjs.map +1 -0
  21. package/fesm2022/aeris-ui-core-button-group.mjs +554 -36
  22. package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
  23. package/fesm2022/aeris-ui-core-button.mjs +911 -137
  24. package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
  25. package/fesm2022/aeris-ui-core-card.mjs +371 -101
  26. package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
  27. package/fesm2022/aeris-ui-core-carousel.mjs +835 -369
  28. package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
  29. package/fesm2022/aeris-ui-core-cascade-select.mjs +1294 -525
  30. package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
  31. package/fesm2022/aeris-ui-core-chart.mjs +594 -262
  32. package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
  33. package/fesm2022/aeris-ui-core-checkbox.mjs +619 -150
  34. package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
  35. package/fesm2022/aeris-ui-core-chip.mjs +1109 -121
  36. package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
  37. package/fesm2022/aeris-ui-core-class-names.mjs +87 -65
  38. package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
  39. package/fesm2022/aeris-ui-core-code-block.mjs +687 -0
  40. package/fesm2022/aeris-ui-core-code-block.mjs.map +1 -0
  41. package/fesm2022/aeris-ui-core-color-picker.mjs +2436 -1076
  42. package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
  43. package/fesm2022/aeris-ui-core-command-palette.mjs +996 -0
  44. package/fesm2022/aeris-ui-core-command-palette.mjs.map +1 -0
  45. package/fesm2022/aeris-ui-core-compare.mjs +870 -338
  46. package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
  47. package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1454 -575
  48. package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
  49. package/fesm2022/aeris-ui-core-confirm-popup.mjs +1499 -760
  50. package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
  51. package/fesm2022/aeris-ui-core-context-menu.mjs +975 -449
  52. package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
  53. package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs +946 -0
  54. package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs.map +1 -0
  55. package/fesm2022/aeris-ui-core-date-picker.mjs +2538 -1183
  56. package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
  57. package/fesm2022/aeris-ui-core-dialog.mjs +1187 -368
  58. package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
  59. package/fesm2022/aeris-ui-core-divider.mjs +204 -43
  60. package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
  61. package/fesm2022/aeris-ui-core-drawer.mjs +1712 -345
  62. package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
  63. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +418 -254
  64. package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
  65. package/fesm2022/aeris-ui-core-editor.mjs +1808 -783
  66. package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
  67. package/fesm2022/aeris-ui-core-file-upload.mjs +1529 -536
  68. package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
  69. package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
  70. package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
  71. package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
  72. package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
  73. package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
  74. package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
  75. package/fesm2022/aeris-ui-core-form-field.mjs +688 -0
  76. package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
  77. package/fesm2022/aeris-ui-core-galleria.mjs +2821 -1143
  78. package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
  79. package/fesm2022/aeris-ui-core-glass.mjs +110 -33
  80. package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
  81. package/fesm2022/aeris-ui-core-icon-field.mjs +426 -98
  82. package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
  83. package/fesm2022/aeris-ui-core-inplace.mjs +496 -132
  84. package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
  85. package/fesm2022/aeris-ui-core-input-group.mjs +413 -107
  86. package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
  87. package/fesm2022/aeris-ui-core-input-mask.mjs +713 -257
  88. package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
  89. package/fesm2022/aeris-ui-core-input-number.mjs +1095 -297
  90. package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
  91. package/fesm2022/aeris-ui-core-input-otp.mjs +678 -264
  92. package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
  93. package/fesm2022/aeris-ui-core-input-text.mjs +703 -160
  94. package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
  95. package/fesm2022/aeris-ui-core-kbd.mjs +243 -0
  96. package/fesm2022/aeris-ui-core-kbd.mjs.map +1 -0
  97. package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
  98. package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
  99. package/fesm2022/aeris-ui-core-listbox.mjs +789 -0
  100. package/fesm2022/aeris-ui-core-listbox.mjs.map +1 -0
  101. package/fesm2022/aeris-ui-core-mega-menu.mjs +662 -388
  102. package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
  103. package/fesm2022/aeris-ui-core-menu.mjs +1111 -478
  104. package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
  105. package/fesm2022/aeris-ui-core-menubar.mjs +1081 -411
  106. package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
  107. package/fesm2022/aeris-ui-core-message.mjs +513 -147
  108. package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
  109. package/fesm2022/aeris-ui-core-meter-group.mjs +641 -230
  110. package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
  111. package/fesm2022/aeris-ui-core-multi-select.mjs +1832 -577
  112. package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
  113. package/fesm2022/aeris-ui-core-navbar.mjs +1407 -0
  114. package/fesm2022/aeris-ui-core-navbar.mjs.map +1 -0
  115. package/fesm2022/aeris-ui-core-order-list.mjs +748 -220
  116. package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
  117. package/fesm2022/aeris-ui-core-organization-chart.mjs +521 -201
  118. package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
  119. package/fesm2022/aeris-ui-core-paginator.mjs +671 -127
  120. package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
  121. package/fesm2022/aeris-ui-core-panel.mjs +602 -210
  122. package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
  123. package/fesm2022/aeris-ui-core-password.mjs +1046 -269
  124. package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
  125. package/fesm2022/aeris-ui-core-pick-list.mjs +1796 -703
  126. package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
  127. package/fesm2022/aeris-ui-core-popover.mjs +1354 -385
  128. package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
  129. package/fesm2022/aeris-ui-core-progress-bar.mjs +609 -182
  130. package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
  131. package/fesm2022/aeris-ui-core-progress-spinner.mjs +428 -133
  132. package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
  133. package/fesm2022/aeris-ui-core-radio-button.mjs +502 -132
  134. package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
  135. package/fesm2022/aeris-ui-core-rating.mjs +506 -231
  136. package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
  137. package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
  138. package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
  139. package/fesm2022/aeris-ui-core-scroll-top.mjs +279 -69
  140. package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
  141. package/fesm2022/aeris-ui-core-select-native.mjs +145 -0
  142. package/fesm2022/aeris-ui-core-select-native.mjs.map +1 -0
  143. package/fesm2022/aeris-ui-core-select.mjs +1984 -668
  144. package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
  145. package/fesm2022/aeris-ui-core-sidebar.mjs +1293 -0
  146. package/fesm2022/aeris-ui-core-sidebar.mjs.map +1 -0
  147. package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
  148. package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
  149. package/fesm2022/aeris-ui-core-slider.mjs +884 -430
  150. package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
  151. package/fesm2022/aeris-ui-core-speed-dial.mjs +882 -337
  152. package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
  153. package/fesm2022/aeris-ui-core-split-button.mjs +972 -268
  154. package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
  155. package/fesm2022/aeris-ui-core-splitter.mjs +831 -356
  156. package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
  157. package/fesm2022/aeris-ui-core-stepper.mjs +705 -256
  158. package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
  159. package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
  160. package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
  161. package/fesm2022/aeris-ui-core-table.mjs +2927 -923
  162. package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
  163. package/fesm2022/aeris-ui-core-tabs.mjs +855 -283
  164. package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
  165. package/fesm2022/aeris-ui-core-textarea.mjs +919 -221
  166. package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
  167. package/fesm2022/aeris-ui-core-theme-builder.mjs +1368 -1407
  168. package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
  169. package/fesm2022/aeris-ui-core-theming.mjs +132 -144
  170. package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
  171. package/fesm2022/aeris-ui-core-tiered-menu.mjs +966 -447
  172. package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
  173. package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
  174. package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
  175. package/fesm2022/aeris-ui-core-toast.mjs +1109 -384
  176. package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
  177. package/fesm2022/aeris-ui-core-toggle-switch.mjs +398 -132
  178. package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
  179. package/fesm2022/aeris-ui-core-toolbar.mjs +1340 -131
  180. package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
  181. package/fesm2022/aeris-ui-core-tooltip.mjs +625 -330
  182. package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
  183. package/fesm2022/aeris-ui-core-tree-select.mjs +1650 -627
  184. package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
  185. package/fesm2022/aeris-ui-core-tree-table.mjs +2442 -994
  186. package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
  187. package/fesm2022/aeris-ui-core-tree.mjs +1257 -670
  188. package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
  189. package/fesm2022/aeris-ui-core.mjs +1601 -312
  190. package/fesm2022/aeris-ui-core.mjs.map +1 -1
  191. package/package.json +48 -8
  192. package/schematics/ng-add/schema.json +1 -1
  193. package/schematics/runtime/schematics/ng-add/options.js +4 -4
  194. package/schematics/runtime/schematics/ng-add/options.js.map +1 -1
  195. package/schematics/runtime/schematics/ng-add/workspace.js +1 -1
  196. package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -1
  197. package/schematics/runtime/theme-builder/aeris-color-derivation.js +1 -1
  198. package/schematics/runtime/theme-builder/aeris-contrast.js +38 -17
  199. package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -1
  200. package/schematics/runtime/theme-builder/aeris-foundation.js +13 -8
  201. package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -1
  202. package/schematics/runtime/theme-builder/aeris-semantic-tones.js +33 -23
  203. package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -1
  204. package/schematics/runtime/theme-builder/aeris-theme-generator.js +8 -2
  205. package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -1
  206. package/schematics/runtime/theme-builder/aeris-theme-resolver.js +63 -76
  207. package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -1
  208. package/schematics/runtime/theme-builder/aeris-theme-tokens.js +15 -5
  209. package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -1
  210. package/schematics/runtime/theme-builder/aeris-theme-validation.js +18 -2
  211. package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -1
  212. package/schematics/runtime/theme-builder/aeris-theme.js +121 -34
  213. package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
  214. package/styles/_choice-card.scss +93 -0
  215. package/styles/_fallback-colors.scss +10 -0
  216. package/styles/_icon-artwork.scss +14 -0
  217. package/styles/_icon-template.scss +42 -0
  218. package/styles/_mobile.scss +16 -0
  219. package/styles/_selection-icons.scss +12 -0
  220. package/styles/_table-pinning.scss +119 -0
  221. package/styles/_tokens.scss +5 -5
  222. package/styles/aeris.css +447 -137
  223. package/styles/controls.css +205 -35
  224. package/tools/aeris-theme.mjs +4 -4
  225. package/tools/aeris-theme.schema.json +18 -13
  226. package/types/aeris-ui-core-accordion.d.ts +167 -93
  227. package/types/aeris-ui-core-animate-on-scroll.d.ts +72 -31
  228. package/types/aeris-ui-core-auto-complete.d.ts +339 -140
  229. package/types/aeris-ui-core-auto-focus.d.ts +24 -16
  230. package/types/aeris-ui-core-avatar.d.ts +112 -42
  231. package/types/aeris-ui-core-badge.d.ts +160 -46
  232. package/types/aeris-ui-core-block-ui.d.ts +48 -27
  233. package/types/aeris-ui-core-breadcrumb.d.ts +163 -92
  234. package/types/aeris-ui-core-button-forms.d.ts +18 -0
  235. package/types/aeris-ui-core-button-group.d.ts +150 -16
  236. package/types/aeris-ui-core-button.d.ts +274 -67
  237. package/types/aeris-ui-core-card.d.ts +74 -37
  238. package/types/aeris-ui-core-carousel.d.ts +213 -117
  239. package/types/aeris-ui-core-cascade-select.d.ts +275 -123
  240. package/types/aeris-ui-core-chart.d.ts +150 -84
  241. package/types/aeris-ui-core-checkbox.d.ts +173 -54
  242. package/types/aeris-ui-core-chip.d.ts +316 -56
  243. package/types/aeris-ui-core-class-names.d.ts +22 -20
  244. package/types/aeris-ui-core-code-block.d.ts +201 -0
  245. package/types/aeris-ui-core-color-picker.d.ts +450 -143
  246. package/types/aeris-ui-core-command-palette.d.ts +267 -0
  247. package/types/aeris-ui-core-compare.d.ts +230 -102
  248. package/types/aeris-ui-core-confirm-dialog.d.ts +450 -245
  249. package/types/aeris-ui-core-confirm-popup.d.ts +442 -263
  250. package/types/aeris-ui-core-context-menu.d.ts +270 -146
  251. package/types/aeris-ui-core-date-picker.d.ts +594 -219
  252. package/types/aeris-ui-core-dialog.d.ts +301 -117
  253. package/types/aeris-ui-core-divider.d.ts +58 -20
  254. package/types/aeris-ui-core-drawer.d.ts +380 -112
  255. package/types/aeris-ui-core-dynamic-dialog.d.ts +162 -137
  256. package/types/aeris-ui-core-editor.d.ts +257 -123
  257. package/types/aeris-ui-core-file-upload.d.ts +385 -197
  258. package/types/aeris-ui-core-filter-service.d.ts +48 -52
  259. package/types/aeris-ui-core-fluid.d.ts +12 -9
  260. package/types/aeris-ui-core-focus-trap.d.ts +39 -31
  261. package/types/aeris-ui-core-form-field.d.ts +163 -0
  262. package/types/aeris-ui-core-galleria.d.ts +636 -256
  263. package/types/aeris-ui-core-glass.d.ts +24 -11
  264. package/types/aeris-ui-core-icon-field.d.ts +94 -32
  265. package/types/aeris-ui-core-inplace.d.ts +129 -62
  266. package/types/aeris-ui-core-input-group.d.ts +84 -33
  267. package/types/aeris-ui-core-input-mask.d.ts +201 -69
  268. package/types/aeris-ui-core-input-number.d.ts +291 -87
  269. package/types/aeris-ui-core-input-otp.d.ts +191 -81
  270. package/types/aeris-ui-core-input-text.d.ts +195 -60
  271. package/types/aeris-ui-core-kbd.d.ts +74 -0
  272. package/types/aeris-ui-core-key-filter.d.ts +53 -39
  273. package/types/aeris-ui-core-listbox.d.ts +222 -0
  274. package/types/aeris-ui-core-mega-menu.d.ts +181 -121
  275. package/types/aeris-ui-core-menu.d.ts +283 -168
  276. package/types/aeris-ui-core-menubar.d.ts +289 -135
  277. package/types/aeris-ui-core-message.d.ts +138 -60
  278. package/types/aeris-ui-core-meter-group.d.ts +169 -90
  279. package/types/aeris-ui-core-multi-select.d.ts +469 -180
  280. package/types/aeris-ui-core-navbar.d.ts +208 -0
  281. package/types/aeris-ui-core-order-list.d.ts +168 -66
  282. package/types/aeris-ui-core-organization-chart.d.ts +139 -77
  283. package/types/aeris-ui-core-paginator.d.ts +129 -38
  284. package/types/aeris-ui-core-panel.d.ts +149 -78
  285. package/types/aeris-ui-core-password.d.ts +276 -102
  286. package/types/aeris-ui-core-pick-list.d.ts +428 -179
  287. package/types/aeris-ui-core-popover.d.ts +294 -105
  288. package/types/aeris-ui-core-progress-bar.d.ts +163 -73
  289. package/types/aeris-ui-core-progress-spinner.d.ts +116 -48
  290. package/types/aeris-ui-core-radio-button.d.ts +146 -50
  291. package/types/aeris-ui-core-rating.d.ts +149 -76
  292. package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
  293. package/types/aeris-ui-core-scroll-top.d.ts +73 -29
  294. package/types/aeris-ui-core-select-native.d.ts +40 -0
  295. package/types/aeris-ui-core-select.d.ts +487 -217
  296. package/types/aeris-ui-core-sidebar.d.ts +220 -0
  297. package/types/aeris-ui-core-skeleton.d.ts +39 -17
  298. package/types/aeris-ui-core-slider.d.ts +270 -115
  299. package/types/aeris-ui-core-speed-dial.d.ts +241 -111
  300. package/types/aeris-ui-core-split-button.d.ts +267 -113
  301. package/types/aeris-ui-core-splitter.d.ts +224 -106
  302. package/types/aeris-ui-core-stepper.d.ts +184 -91
  303. package/types/aeris-ui-core-style-class.d.ts +141 -71
  304. package/types/aeris-ui-core-table.d.ts +729 -304
  305. package/types/aeris-ui-core-tabs.d.ts +193 -76
  306. package/types/aeris-ui-core-textarea.d.ts +271 -78
  307. package/types/aeris-ui-core-theme-builder.d.ts +220 -463
  308. package/types/aeris-ui-core-theming.d.ts +42 -45
  309. package/types/aeris-ui-core-tiered-menu.d.ts +257 -142
  310. package/types/aeris-ui-core-timeline.d.ts +109 -71
  311. package/types/aeris-ui-core-toast.d.ts +231 -115
  312. package/types/aeris-ui-core-toggle-switch.d.ts +125 -51
  313. package/types/aeris-ui-core-toolbar.d.ts +314 -47
  314. package/types/aeris-ui-core-tooltip.d.ts +157 -88
  315. package/types/aeris-ui-core-tree-select.d.ts +394 -171
  316. package/types/aeris-ui-core-tree-table.d.ts +629 -288
  317. package/types/aeris-ui-core-tree.d.ts +294 -165
  318. package/types/aeris-ui-core.d.ts +338 -74
@@ -1,1565 +1,1526 @@
1
+ const AERIS_SEMANTIC_TONE_NAMES = [
2
+ "primary",
3
+ "secondary",
4
+ "success",
5
+ "info",
6
+ "warning",
7
+ "danger",
8
+ "contrast"
9
+ ];
1
10
  const AERIS_MONOCHROME_LIGHT_PRIMARY_TONE = {
2
- base: '#111111',
3
- boundary: '#111111',
4
- hover: '#242424',
5
- active: '#050505',
6
- onBase: '#ffffff',
7
- onHover: '#ffffff',
8
- onActive: '#ffffff',
9
- text: '#111111',
10
- soft: '#f1f1f1',
11
- onSoft: '#111111',
11
+ base: "#111111",
12
+ boundary: "#111111",
13
+ hover: "#242424",
14
+ active: "#050505",
15
+ onBase: "#ffffff",
16
+ onHover: "#ffffff",
17
+ onActive: "#ffffff",
18
+ text: "#111111",
19
+ soft: "#f1f1f1",
20
+ onSoft: "#111111"
12
21
  };
13
22
  const AERIS_MONOCHROME_DARK_PRIMARY_TONE = {
14
- base: '#f5f5f5',
15
- boundary: '#f5f5f5',
16
- hover: '#ffffff',
17
- active: '#e7e7e7',
18
- onBase: '#090909',
19
- onHover: '#090909',
20
- onActive: '#090909',
21
- text: '#f5f5f5',
22
- soft: '#1b1b1b',
23
- onSoft: '#ffffff',
23
+ base: "#f5f5f5",
24
+ boundary: "#f5f5f5",
25
+ hover: "#ffffff",
26
+ active: "#e7e7e7",
27
+ onBase: "#090909",
28
+ onHover: "#090909",
29
+ onActive: "#090909",
30
+ text: "#f5f5f5",
31
+ soft: "#1b1b1b",
32
+ onSoft: "#ffffff"
24
33
  };
25
34
  const AERIS_MONOCHROME_LIGHT_SECONDARY_TONE = {
26
- base: '#565656',
27
- boundary: '#565656',
28
- hover: '#464646',
29
- active: '#363636',
30
- onBase: '#ffffff',
31
- onHover: '#ffffff',
32
- onActive: '#ffffff',
33
- text: '#454545',
34
- soft: '#ededed',
35
- onSoft: '#242424',
35
+ base: "#565656",
36
+ boundary: "#565656",
37
+ hover: "#464646",
38
+ active: "#363636",
39
+ onBase: "#ffffff",
40
+ onHover: "#ffffff",
41
+ onActive: "#ffffff",
42
+ text: "#454545",
43
+ soft: "#ededed",
44
+ onSoft: "#242424"
36
45
  };
37
46
  const AERIS_MONOCHROME_DARK_SECONDARY_TONE = {
38
- base: '#b8b8b8',
39
- boundary: '#b8b8b8',
40
- hover: '#c8c8c8',
41
- active: '#a8a8a8',
42
- onBase: '#090909',
43
- onHover: '#090909',
44
- onActive: '#090909',
45
- text: '#d0d0d0',
46
- soft: '#262626',
47
- onSoft: '#f5f5f5',
47
+ base: "#b8b8b8",
48
+ boundary: "#b8b8b8",
49
+ hover: "#c8c8c8",
50
+ active: "#a8a8a8",
51
+ onBase: "#090909",
52
+ onHover: "#090909",
53
+ onActive: "#090909",
54
+ text: "#d0d0d0",
55
+ soft: "#262626",
56
+ onSoft: "#f5f5f5"
48
57
  };
49
58
  const AERIS_MONOCHROME_LIGHT_CONTRAST_TONE = {
50
- base: '#ffffff',
51
- boundary: '#111111',
52
- hover: '#f1f1f1',
53
- active: '#e3e3e3',
54
- onBase: '#111111',
55
- onHover: '#111111',
56
- onActive: '#111111',
57
- text: '#111111',
58
- soft: '#f1f1f1',
59
- onSoft: '#111111',
59
+ base: "#ffffff",
60
+ boundary: "#111111",
61
+ hover: "#f1f1f1",
62
+ active: "#e3e3e3",
63
+ onBase: "#111111",
64
+ onHover: "#111111",
65
+ onActive: "#111111",
66
+ text: "#111111",
67
+ soft: "#f1f1f1",
68
+ onSoft: "#111111"
60
69
  };
61
70
  const AERIS_MONOCHROME_DARK_CONTRAST_TONE = {
62
- base: '#090909',
63
- boundary: '#f5f5f5',
64
- hover: '#181818',
65
- active: '#242424',
66
- onBase: '#ffffff',
67
- onHover: '#ffffff',
68
- onActive: '#ffffff',
69
- text: '#f5f5f5',
70
- soft: '#1b1b1b',
71
- onSoft: '#ffffff',
71
+ base: "#090909",
72
+ boundary: "#f5f5f5",
73
+ hover: "#181818",
74
+ active: "#242424",
75
+ onBase: "#ffffff",
76
+ onHover: "#ffffff",
77
+ onActive: "#ffffff",
78
+ text: "#f5f5f5",
79
+ soft: "#1b1b1b",
80
+ onSoft: "#ffffff"
72
81
  };
73
82
  const AERIS_MONOCHROME_LIGHT_STATUS_TONES = {
74
- success: {
75
- base: '#2f6b46',
76
- hover: '#285c3c',
77
- active: '#214f34',
78
- onBase: '#ffffff',
79
- onHover: '#ffffff',
80
- onActive: '#ffffff',
81
- text: '#24573a',
82
- soft: '#edf5ef',
83
- onSoft: '#214f34',
84
- },
85
- info: {
86
- base: '#2f6178',
87
- hover: '#285368',
88
- active: '#214758',
89
- onBase: '#ffffff',
90
- onHover: '#ffffff',
91
- onActive: '#ffffff',
92
- text: '#264f62',
93
- soft: '#edf4f7',
94
- onSoft: '#214758',
95
- },
96
- warning: {
97
- base: '#c38600',
98
- hover: '#bd8200',
99
- active: '#b87d00',
100
- onBase: '#211600',
101
- onHover: '#211600',
102
- onActive: '#211600',
103
- text: '#8a6100',
104
- soft: '#fff5d6',
105
- onSoft: '#704e00',
106
- },
107
- danger: {
108
- base: '#c81e2a',
109
- hover: '#b51b26',
110
- active: '#a21822',
111
- onBase: '#ffffff',
112
- onHover: '#ffffff',
113
- onActive: '#ffffff',
114
- text: '#a31722',
115
- soft: '#fff0f1',
116
- onSoft: '#81131a',
117
- },
83
+ success: {
84
+ base: "#2f6b46",
85
+ hover: "#285c3c",
86
+ active: "#214f34",
87
+ onBase: "#ffffff",
88
+ onHover: "#ffffff",
89
+ onActive: "#ffffff",
90
+ text: "#24573a",
91
+ soft: "#edf5ef",
92
+ onSoft: "#214f34"
93
+ },
94
+ info: {
95
+ base: "#2f6178",
96
+ hover: "#285368",
97
+ active: "#214758",
98
+ onBase: "#ffffff",
99
+ onHover: "#ffffff",
100
+ onActive: "#ffffff",
101
+ text: "#264f62",
102
+ soft: "#edf4f7",
103
+ onSoft: "#214758"
104
+ },
105
+ warning: {
106
+ base: "#c38600",
107
+ hover: "#bd8200",
108
+ active: "#b87d00",
109
+ onBase: "#211600",
110
+ onHover: "#211600",
111
+ onActive: "#211600",
112
+ text: "#8a6100",
113
+ soft: "#fff5d6",
114
+ onSoft: "#704e00"
115
+ },
116
+ danger: {
117
+ base: "#c81e2a",
118
+ hover: "#b51b26",
119
+ active: "#a21822",
120
+ onBase: "#ffffff",
121
+ onHover: "#ffffff",
122
+ onActive: "#ffffff",
123
+ text: "#a31722",
124
+ soft: "#fff0f1",
125
+ onSoft: "#81131a"
126
+ }
118
127
  };
119
128
  const AERIS_MONOCHROME_DARK_STATUS_TONES = {
120
- success: {
121
- base: '#9fd3ae',
122
- hover: '#b5dfc0',
123
- active: '#8bc69c',
124
- onBase: '#0b1a10',
125
- onHover: '#0b1a10',
126
- onActive: '#0b1a10',
127
- text: '#9fd3ae',
128
- soft: '#17271d',
129
- onSoft: '#b5dfc0',
130
- },
131
- info: {
132
- base: '#9ecbe0',
133
- hover: '#b4d8e8',
134
- active: '#88bdd6',
135
- onBase: '#091923',
136
- onHover: '#091923',
137
- onActive: '#091923',
138
- text: '#9ecbe0',
139
- soft: '#17242a',
140
- onSoft: '#b4d8e8',
141
- },
142
- warning: {
143
- base: '#facc15',
144
- hover: '#ffdb4d',
145
- active: '#e7b900',
146
- onBase: '#211600',
147
- onHover: '#211600',
148
- onActive: '#211600',
149
- text: '#facc15',
150
- soft: '#2c2508',
151
- onSoft: '#ffdb4d',
152
- },
153
- danger: {
154
- base: '#ff5c68',
155
- hover: '#ff7b84',
156
- active: '#e84955',
157
- onBase: '#260609',
158
- onHover: '#260609',
159
- onActive: '#260609',
160
- text: '#ff5c68',
161
- soft: '#301416',
162
- onSoft: '#ff8f97',
163
- },
129
+ success: {
130
+ base: "#9fd3ae",
131
+ hover: "#b5dfc0",
132
+ active: "#8bc69c",
133
+ onBase: "#0b1a10",
134
+ onHover: "#0b1a10",
135
+ onActive: "#0b1a10",
136
+ text: "#9fd3ae",
137
+ soft: "#17271d",
138
+ onSoft: "#b5dfc0"
139
+ },
140
+ info: {
141
+ base: "#9ecbe0",
142
+ hover: "#b4d8e8",
143
+ active: "#88bdd6",
144
+ onBase: "#091923",
145
+ onHover: "#091923",
146
+ onActive: "#091923",
147
+ text: "#9ecbe0",
148
+ soft: "#17242a",
149
+ onSoft: "#b4d8e8"
150
+ },
151
+ warning: {
152
+ base: "#facc15",
153
+ hover: "#ffdb4d",
154
+ active: "#e7b900",
155
+ onBase: "#211600",
156
+ onHover: "#211600",
157
+ onActive: "#211600",
158
+ text: "#facc15",
159
+ soft: "#2c2508",
160
+ onSoft: "#ffdb4d"
161
+ },
162
+ danger: {
163
+ base: "#ff5c68",
164
+ hover: "#ff7b84",
165
+ active: "#e84955",
166
+ onBase: "#260609",
167
+ onHover: "#260609",
168
+ onActive: "#260609",
169
+ text: "#ff5c68",
170
+ soft: "#301416",
171
+ onSoft: "#ff8f97"
172
+ }
173
+ };
174
+ const AERIS_COLORED_DARK_SCHEME = {
175
+ page: "#0c0c0c",
176
+ surface: "#121212",
177
+ surface2: "#191919",
178
+ surface3: "#232323",
179
+ interactiveHover: "#292929",
180
+ border: "#292929",
181
+ borderStrong: "#757575"
182
+ };
183
+ const THEME_DEFINITIONS = {
184
+ earth: {
185
+ palette: {
186
+ surface: "#f1f4f2",
187
+ primary: "#2c694b",
188
+ secondary: "#52685b",
189
+ accent: "#a88245",
190
+ contrast: "#343b37"
191
+ },
192
+ dark: AERIS_COLORED_DARK_SCHEME
193
+ },
194
+ coastal: {
195
+ palette: {
196
+ surface: "#f1f4f8",
197
+ primary: "#2d63a8",
198
+ secondary: "#546b89",
199
+ accent: "#368678",
200
+ contrast: "#39404a"
201
+ },
202
+ dark: AERIS_COLORED_DARK_SCHEME
203
+ },
204
+ orchid: {
205
+ palette: {
206
+ surface: "#f5f2f8",
207
+ primary: "#7551a8",
208
+ secondary: "#6f607f",
209
+ accent: "#a46b82",
210
+ contrast: "#453b4e"
211
+ },
212
+ dark: AERIS_COLORED_DARK_SCHEME
213
+ },
214
+ monochrome: {
215
+ palette: {
216
+ surface: "#f4f4f4",
217
+ primary: "#111111",
218
+ secondary: "#1f1f1f",
219
+ accent: "#f8f8f8",
220
+ contrast: "#050505"
221
+ },
222
+ light: {
223
+ accent: "#111111",
224
+ page: "#f7f7f7",
225
+ surface: "#ffffff",
226
+ surface2: "#f3f3f3",
227
+ surface3: "#e8e8e8",
228
+ interactiveHover: "#e8e8e8",
229
+ text: "#111111",
230
+ text2: "#242424",
231
+ text3: "#454545",
232
+ border: "#efefef",
233
+ borderStrong: "#111111",
234
+ focus: "#111111",
235
+ shadowXs: "0 1px 2px rgb(0 0 0 / 10%)",
236
+ shadowSm: "0 2px 5px rgb(0 0 0 / 14%)",
237
+ shadowMd: "0 8px 24px rgb(0 0 0 / 14%)",
238
+ shadowLg: "0 18px 48px rgb(0 0 0 / 18%)",
239
+ tones: {
240
+ primary: AERIS_MONOCHROME_LIGHT_PRIMARY_TONE,
241
+ secondary: AERIS_MONOCHROME_LIGHT_SECONDARY_TONE,
242
+ ...AERIS_MONOCHROME_LIGHT_STATUS_TONES,
243
+ contrast: AERIS_MONOCHROME_LIGHT_CONTRAST_TONE
244
+ }
245
+ },
246
+ dark: {
247
+ accent: "#f5f5f5",
248
+ page: "#070707",
249
+ surface: "#0c0c0c",
250
+ surface2: "#151515",
251
+ surface3: "#202020",
252
+ interactiveHover: "#292929",
253
+ text: "#f8f8f8",
254
+ text2: "#ededed",
255
+ text3: "#d0d0d0",
256
+ border: "#242424",
257
+ borderStrong: "#ffffff",
258
+ focus: "#ffffff",
259
+ shadowXs: "0 1px 2px rgb(0 0 0 / 48%)",
260
+ shadowSm: "0 2px 6px rgb(0 0 0 / 62%)",
261
+ shadowMd: "0 10px 28px rgb(0 0 0 / 58%)",
262
+ shadowLg: "0 20px 56px rgb(0 0 0 / 68%)",
263
+ tones: {
264
+ primary: AERIS_MONOCHROME_DARK_PRIMARY_TONE,
265
+ secondary: AERIS_MONOCHROME_DARK_SECONDARY_TONE,
266
+ ...AERIS_MONOCHROME_DARK_STATUS_TONES,
267
+ contrast: AERIS_MONOCHROME_DARK_CONTRAST_TONE
268
+ }
269
+ }
270
+ }
164
271
  };
165
- /** Accessible Aeris starter themes that can be passed directly to provideAeris(). */
166
272
  const AERIS_THEME_PRESETS = {
167
- earth: {
168
- palette: {
169
- surface: '#e8dfe0',
170
- primary: '#879566',
171
- secondary: '#80939b',
172
- accent: '#dab692',
173
- contrast: '#8f5b34',
174
- },
175
- },
176
- coastal: {
177
- palette: {
178
- surface: '#dfe8ee',
179
- primary: '#7196b4',
180
- secondary: '#6d9992',
181
- accent: '#d8ad70',
182
- contrast: '#31536a',
183
- },
184
- },
185
- orchid: {
186
- palette: {
187
- surface: '#e9e1ec',
188
- primary: '#9579b2',
189
- secondary: '#b68194',
190
- accent: '#d1a570',
191
- contrast: '#5c4b6b',
192
- },
193
- },
194
- monochrome: {
195
- palette: {
196
- surface: '#f4f4f4',
197
- primary: '#111111',
198
- secondary: '#1f1f1f',
199
- accent: '#f8f8f8',
200
- contrast: '#050505',
201
- },
202
- light: {
203
- accent: '#111111',
204
- page: '#f7f7f7',
205
- surface: '#ffffff',
206
- surface2: '#f3f3f3',
207
- surface3: '#e8e8e8',
208
- interactiveHover: '#e8e8e8',
209
- text: '#111111',
210
- text2: '#242424',
211
- text3: '#454545',
212
- border: '#767676',
213
- borderStrong: '#111111',
214
- focus: '#111111',
215
- shadowXs: '0 1px 2px rgb(0 0 0 / 10%)',
216
- shadowSm: '0 2px 5px rgb(0 0 0 / 14%)',
217
- tones: {
218
- primary: AERIS_MONOCHROME_LIGHT_PRIMARY_TONE,
219
- secondary: AERIS_MONOCHROME_LIGHT_SECONDARY_TONE,
220
- ...AERIS_MONOCHROME_LIGHT_STATUS_TONES,
221
- contrast: AERIS_MONOCHROME_LIGHT_CONTRAST_TONE,
222
- },
223
- },
224
- dark: {
225
- accent: '#f5f5f5',
226
- page: '#070707',
227
- surface: '#0c0c0c',
228
- surface2: '#151515',
229
- surface3: '#202020',
230
- interactiveHover: '#292929',
231
- text: '#f8f8f8',
232
- text2: '#ededed',
233
- text3: '#d0d0d0',
234
- border: '#a3a3a3',
235
- borderStrong: '#ffffff',
236
- focus: '#ffffff',
237
- shadowXs: '0 1px 2px rgb(0 0 0 / 48%)',
238
- shadowSm: '0 2px 6px rgb(0 0 0 / 62%)',
239
- tones: {
240
- primary: AERIS_MONOCHROME_DARK_PRIMARY_TONE,
241
- secondary: AERIS_MONOCHROME_DARK_SECONDARY_TONE,
242
- ...AERIS_MONOCHROME_DARK_STATUS_TONES,
243
- contrast: AERIS_MONOCHROME_DARK_CONTRAST_TONE,
244
- },
245
- },
246
- },
273
+ earth: {
274
+ preset: "earth",
275
+ palette: THEME_DEFINITIONS.earth.palette
276
+ },
277
+ coastal: {
278
+ preset: "coastal",
279
+ palette: THEME_DEFINITIONS.coastal.palette
280
+ },
281
+ orchid: {
282
+ preset: "orchid",
283
+ palette: THEME_DEFINITIONS.orchid.palette
284
+ },
285
+ monochrome: {
286
+ preset: "monochrome",
287
+ palette: THEME_DEFINITIONS.monochrome.palette
288
+ }
247
289
  };
290
+ function resolveAerisThemeScheme(theme, mode) {
291
+ const definition = Object.hasOwn(THEME_DEFINITIONS, theme.preset) ? THEME_DEFINITIONS[theme.preset] : THEME_DEFINITIONS.monochrome;
292
+ const inherited = { ...definition[mode] };
293
+ const overrides = theme[mode];
294
+ const surfaceChanged = theme.palette.surface !== definition.palette.surface;
295
+ if (surfaceChanged) for (const key of [
296
+ "page",
297
+ "surface",
298
+ "surface2",
299
+ "surface3",
300
+ "interactiveHover",
301
+ "border",
302
+ "borderStrong"
303
+ ]) delete inherited[key];
304
+ if (theme.palette.primary !== definition.palette.primary) {
305
+ delete inherited.focus;
306
+ delete inherited.interactiveHover;
307
+ }
308
+ if (theme.palette.secondary !== definition.palette.secondary) {
309
+ delete inherited.border;
310
+ delete inherited.borderStrong;
311
+ }
312
+ if (theme.palette.accent !== definition.palette.accent) delete inherited.accent;
313
+ const tones = {};
314
+ for (const name of AERIS_SEMANTIC_TONE_NAMES) {
315
+ const override = overrides.tones?.[name];
316
+ const seedChanged = (name === "primary" || name === "secondary" || name === "contrast") && theme.palette[name] !== definition.palette[name];
317
+ const defaults = { ...inherited.tones?.[name] };
318
+ const baseChanged = override?.base !== void 0 && override.base !== defaults.base;
319
+ if (surfaceChanged) {
320
+ delete defaults.soft;
321
+ delete defaults.onSoft;
322
+ delete defaults.text;
323
+ }
324
+ if (override?.hover !== void 0) delete defaults.onHover;
325
+ if (override?.active !== void 0) delete defaults.onActive;
326
+ if (override?.soft !== void 0 || override?.text !== void 0) delete defaults.onSoft;
327
+ tones[name] = override === null ? {} : {
328
+ ...!seedChanged && !baseChanged ? defaults : {},
329
+ ...override
330
+ };
331
+ }
332
+ return {
333
+ ...inherited,
334
+ ...overrides,
335
+ tones
336
+ };
337
+ }
248
338
  const AERIS_DENSITY_PRESETS = {
249
- compact: {
250
- controlHeight: '2.125rem',
251
- controlPaddingX: '0.625rem',
252
- itemHeight: '2rem',
253
- itemPaddingY: '0.375rem',
254
- itemPaddingX: '0.625rem',
255
- gap: '0.375rem',
256
- iconSize: '0.9375rem',
257
- },
258
- medium: {
259
- controlHeight: '2.625rem',
260
- controlPaddingX: '0.75rem',
261
- itemHeight: '2.5rem',
262
- itemPaddingY: '0.5rem',
263
- itemPaddingX: '0.75rem',
264
- gap: '0.5rem',
265
- iconSize: '1rem',
266
- },
267
- comfortable: {
268
- controlHeight: '3.125rem',
269
- controlPaddingX: '0.875rem',
270
- itemHeight: '2.875rem',
271
- itemPaddingY: '0.625rem',
272
- itemPaddingX: '0.875rem',
273
- gap: '0.625rem',
274
- iconSize: '1.0625rem',
275
- },
339
+ compact: {
340
+ controlHeight: "2.125rem",
341
+ controlPaddingX: "0.625rem",
342
+ itemHeight: "2rem",
343
+ itemPaddingY: "0.375rem",
344
+ itemPaddingX: "0.625rem",
345
+ gap: "0.375rem",
346
+ iconSize: "0.9375rem"
347
+ },
348
+ medium: {
349
+ controlHeight: "2.625rem",
350
+ controlPaddingX: "0.75rem",
351
+ itemHeight: "2.5rem",
352
+ itemPaddingY: "0.5rem",
353
+ itemPaddingX: "0.75rem",
354
+ gap: "0.5rem",
355
+ iconSize: "1rem"
356
+ },
357
+ comfortable: {
358
+ controlHeight: "3.125rem",
359
+ controlPaddingX: "0.875rem",
360
+ itemHeight: "2.875rem",
361
+ itemPaddingY: "0.625rem",
362
+ itemPaddingX: "0.875rem",
363
+ gap: "0.625rem",
364
+ iconSize: "1.0625rem"
365
+ }
276
366
  };
277
367
  const AERIS_RADIUS_PRESETS = {
278
- soft: {
279
- sm: '0.25rem',
280
- md: '0.375rem',
281
- lg: '0.625rem',
282
- xl: '0.875rem',
283
- control: '0.25rem',
284
- pill: '999px',
285
- },
286
- rounded: {
287
- sm: '0.4375rem',
288
- md: '0.6875rem',
289
- lg: '1.125rem',
290
- xl: '1.5rem',
291
- control: '0.4375rem',
292
- pill: '999px',
293
- },
294
- pill: {
295
- sm: '0.75rem',
296
- md: '1.125rem',
297
- lg: '1.875rem',
298
- xl: '2.25rem',
299
- control: '999px',
300
- pill: '999px',
301
- },
368
+ soft: {
369
+ sm: "0.25rem",
370
+ md: "0.375rem",
371
+ lg: "0.5rem",
372
+ xl: "0.75rem",
373
+ control: "0.25rem",
374
+ pill: "999px"
375
+ },
376
+ rounded: {
377
+ sm: "0.4375rem",
378
+ md: "0.5625rem",
379
+ lg: "0.75rem",
380
+ xl: "1rem",
381
+ control: "0.4375rem",
382
+ pill: "999px"
383
+ },
384
+ pill: {
385
+ sm: "0.75rem",
386
+ md: "1rem",
387
+ lg: "1.25rem",
388
+ xl: "1.5rem",
389
+ control: "999px",
390
+ pill: "999px"
391
+ }
302
392
  };
303
393
  const AERIS_DEFAULT_THEME = {
304
- palette: {
305
- ...AERIS_THEME_PRESETS.earth.palette,
306
- mist: AERIS_THEME_PRESETS.earth.palette.surface,
307
- sage: AERIS_THEME_PRESETS.earth.palette.primary,
308
- cloud: AERIS_THEME_PRESETS.earth.palette.secondary,
309
- sand: AERIS_THEME_PRESETS.earth.palette.accent,
310
- umber: AERIS_THEME_PRESETS.earth.palette.contrast,
311
- },
312
- light: {},
313
- dark: {},
314
- radius: 'rounded',
315
- radii: AERIS_RADIUS_PRESETS,
316
- density: 'medium',
317
- densities: AERIS_DENSITY_PRESETS,
394
+ preset: "monochrome",
395
+ palette: { ...AERIS_THEME_PRESETS.monochrome.palette },
396
+ light: {},
397
+ dark: {},
398
+ radius: "rounded",
399
+ radii: AERIS_RADIUS_PRESETS,
400
+ density: "medium",
401
+ densities: AERIS_DENSITY_PRESETS
318
402
  };
319
-
320
- const ACHROMATIC_CHROMA = 0.01;
403
+ const ACHROMATIC_CHROMA = .01;
321
404
  const GAMUT_SEARCH_STEPS = 24;
322
- const SRGB_GAMUT_TOLERANCE = 0.000_000_1;
323
405
  function parseAerisColor(value) {
324
- const color = value.trim().toLowerCase();
325
- if (color === 'black')
326
- return { red: 0, green: 0, blue: 0 };
327
- if (color === 'white')
328
- return { red: 255, green: 255, blue: 255 };
329
- if (color.startsWith('#'))
330
- return parseHex(color);
331
- if (color.startsWith('rgb(') || color.startsWith('rgba('))
332
- return parseRgb(color);
333
- if (color.startsWith('hsl(') || color.startsWith('hsla('))
334
- return parseHsl(color);
335
- return null;
406
+ const color = value.trim().toLowerCase();
407
+ if (color === "black") return {
408
+ red: 0,
409
+ green: 0,
410
+ blue: 0
411
+ };
412
+ if (color === "white") return {
413
+ red: 255,
414
+ green: 255,
415
+ blue: 255
416
+ };
417
+ if (color.startsWith("#")) return parseHex(color);
418
+ if (color.startsWith("rgb(") || color.startsWith("rgba(")) return parseRgb(color);
419
+ if (color.startsWith("hsl(") || color.startsWith("hsla(")) return parseHsl(color);
420
+ return null;
336
421
  }
337
422
  function mixAerisColor(from, to, amount) {
338
- const weight = clampUnit(amount);
339
- const start = parseAerisColor(from);
340
- const end = parseAerisColor(to);
341
- if (!start || !end) {
342
- const startWeight = formatPercentage((1 - weight) * 100);
343
- return `color-mix(in oklch, ${from} ${startWeight}%, ${to})`;
344
- }
345
- return formatAerisHex(mixAerisRgb(start, end, weight));
423
+ const weight = clampUnit(amount);
424
+ const start = parseAerisColor(from);
425
+ const end = parseAerisColor(to);
426
+ if (!start || !end) return `color-mix(in oklch, ${from} ${formatPercentage((1 - weight) * 100)}%, ${to})`;
427
+ return formatAerisHex(mixAerisRgb(start, end, weight));
346
428
  }
347
429
  function aerisContrastRatio(first, second) {
348
- const firstColor = parseAerisColor(first);
349
- const secondColor = parseAerisColor(second);
350
- if (!firstColor || !secondColor)
351
- return null;
352
- return aerisRgbContrastRatio(firstColor, secondColor);
430
+ const firstColor = parseAerisColor(first);
431
+ const secondColor = parseAerisColor(second);
432
+ if (!firstColor || !secondColor) return null;
433
+ return aerisRgbContrastRatio(firstColor, secondColor);
353
434
  }
354
435
  function aerisRgbContrastRatio(first, second) {
355
- const firstLuminance = relativeLuminance(first);
356
- const secondLuminance = relativeLuminance(second);
357
- const lighter = Math.max(firstLuminance, secondLuminance);
358
- const darker = Math.min(firstLuminance, secondLuminance);
359
- return (lighter + 0.05) / (darker + 0.05);
436
+ const firstLuminance = relativeLuminance(first);
437
+ const secondLuminance = relativeLuminance(second);
438
+ const lighter = Math.max(firstLuminance, secondLuminance);
439
+ const darker = Math.min(firstLuminance, secondLuminance);
440
+ return (lighter + .05) / (darker + .05);
360
441
  }
361
442
  function mixAerisRgb(from, to, amount) {
362
- const weight = clampUnit(amount);
363
- if (weight === 0)
364
- return { ...from };
365
- if (weight === 1)
366
- return { ...to };
367
- const start = oklabToOklch(rgbToOklab(from));
368
- const end = oklabToOklch(rgbToOklab(to));
369
- const mixed = {
370
- lightness: interpolate(start.lightness, end.lightness, weight),
371
- chroma: interpolate(start.chroma, end.chroma, weight),
372
- hue: interpolateHue(start.hue, end.hue, weight),
373
- };
374
- return oklchToGamutMappedRgb(mixed);
443
+ const weight = clampUnit(amount);
444
+ if (weight === 0) return { ...from };
445
+ if (weight === 1) return { ...to };
446
+ const start = oklabToOklch(rgbToOklab(from));
447
+ const end = oklabToOklch(rgbToOklab(to));
448
+ return oklchToGamutMappedRgb({
449
+ lightness: interpolate(start.lightness, end.lightness, weight),
450
+ chroma: interpolate(start.chroma, end.chroma, weight),
451
+ hue: interpolateHue(start.hue, end.hue, weight)
452
+ });
375
453
  }
376
454
  function formatAerisHex(color) {
377
- const channel = (value) => Math.round(clampChannel(value)).toString(16).padStart(2, '0');
378
- return `#${channel(color.red)}${channel(color.green)}${channel(color.blue)}`;
455
+ const channel = (value) => Math.round(clampChannel(value)).toString(16).padStart(2, "0");
456
+ return `#${channel(color.red)}${channel(color.green)}${channel(color.blue)}`;
379
457
  }
380
458
  function relativeLuminance(color) {
381
- const linear = (value) => {
382
- const channel = value / 255;
383
- return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;
384
- };
385
- return 0.2126 * linear(color.red) + 0.7152 * linear(color.green) + 0.0722 * linear(color.blue);
459
+ const linear = (value) => {
460
+ const channel = value / 255;
461
+ return channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4;
462
+ };
463
+ return .2126 * linear(color.red) + .7152 * linear(color.green) + .0722 * linear(color.blue);
386
464
  }
387
465
  function rgbToOklab(color) {
388
- const red = srgbToLinear(clampChannel(color.red) / 255);
389
- const green = srgbToLinear(clampChannel(color.green) / 255);
390
- const blue = srgbToLinear(clampChannel(color.blue) / 255);
391
- const l = 0.4122214708 * red + 0.5363325363 * green + 0.0514459929 * blue;
392
- const m = 0.2119034982 * red + 0.6806995451 * green + 0.1073969566 * blue;
393
- const s = 0.0883024619 * red + 0.2817188376 * green + 0.6299787005 * blue;
394
- const lRoot = Math.cbrt(l);
395
- const mRoot = Math.cbrt(m);
396
- const sRoot = Math.cbrt(s);
397
- return {
398
- lightness: 0.2104542553 * lRoot + 0.793617785 * mRoot - 0.0040720468 * sRoot,
399
- a: 1.9779984951 * lRoot - 2.428592205 * mRoot + 0.4505937099 * sRoot,
400
- b: 0.0259040371 * lRoot + 0.7827717662 * mRoot - 0.808675766 * sRoot,
401
- };
466
+ const red = srgbToLinear(clampChannel(color.red) / 255);
467
+ const green = srgbToLinear(clampChannel(color.green) / 255);
468
+ const blue = srgbToLinear(clampChannel(color.blue) / 255);
469
+ const l = .4122214708 * red + .5363325363 * green + .0514459929 * blue;
470
+ const m = .2119034982 * red + .6806995451 * green + .1073969566 * blue;
471
+ const s = .0883024619 * red + .2817188376 * green + .6299787005 * blue;
472
+ const lRoot = Math.cbrt(l);
473
+ const mRoot = Math.cbrt(m);
474
+ const sRoot = Math.cbrt(s);
475
+ return {
476
+ lightness: .2104542553 * lRoot + .793617785 * mRoot - .0040720468 * sRoot,
477
+ a: 1.9779984951 * lRoot - 2.428592205 * mRoot + .4505937099 * sRoot,
478
+ b: .0259040371 * lRoot + .7827717662 * mRoot - .808675766 * sRoot
479
+ };
402
480
  }
403
481
  function oklabToOklch(color) {
404
- const chroma = Math.hypot(color.a, color.b);
405
- const achromatic = chroma < ACHROMATIC_CHROMA;
406
- return {
407
- lightness: color.lightness,
408
- chroma: achromatic ? 0 : chroma,
409
- hue: achromatic ? null : normalizeHue((Math.atan2(color.b, color.a) * 180) / Math.PI),
410
- };
482
+ const chroma = Math.hypot(color.a, color.b);
483
+ const achromatic = chroma < ACHROMATIC_CHROMA;
484
+ return {
485
+ lightness: color.lightness,
486
+ chroma: achromatic ? 0 : chroma,
487
+ hue: achromatic ? null : normalizeHue(Math.atan2(color.b, color.a) * 180 / Math.PI)
488
+ };
411
489
  }
412
490
  function oklchToGamutMappedRgb(color) {
413
- const direct = oklchToSrgb(color);
414
- if (isInSrgbGamut(direct))
415
- return toRgbChannels(direct);
416
- let minimumChroma = 0;
417
- let maximumChroma = color.chroma;
418
- let mapped = oklchToSrgb({ ...color, chroma: minimumChroma });
419
- for (let step = 0; step < GAMUT_SEARCH_STEPS; step += 1) {
420
- const chroma = (minimumChroma + maximumChroma) / 2;
421
- const candidate = oklchToSrgb({ ...color, chroma });
422
- if (isInSrgbGamut(candidate)) {
423
- minimumChroma = chroma;
424
- mapped = candidate;
425
- }
426
- else {
427
- maximumChroma = chroma;
428
- }
429
- }
430
- return toRgbChannels(mapped);
491
+ const direct = oklchToSrgb(color);
492
+ if (isInSrgbGamut(direct)) return toRgbChannels(direct);
493
+ let minimumChroma = 0;
494
+ let maximumChroma = color.chroma;
495
+ let mapped = oklchToSrgb({
496
+ ...color,
497
+ chroma: minimumChroma
498
+ });
499
+ for (let step = 0; step < GAMUT_SEARCH_STEPS; step += 1) {
500
+ const chroma = (minimumChroma + maximumChroma) / 2;
501
+ const candidate = oklchToSrgb({
502
+ ...color,
503
+ chroma
504
+ });
505
+ if (isInSrgbGamut(candidate)) {
506
+ minimumChroma = chroma;
507
+ mapped = candidate;
508
+ } else maximumChroma = chroma;
509
+ }
510
+ return toRgbChannels(mapped);
431
511
  }
432
512
  function oklchToSrgb(color) {
433
- const hueRadians = ((color.hue ?? 0) * Math.PI) / 180;
434
- const a = color.chroma * Math.cos(hueRadians);
435
- const b = color.chroma * Math.sin(hueRadians);
436
- const lRoot = color.lightness + 0.3963377774 * a + 0.2158037573 * b;
437
- const mRoot = color.lightness - 0.1055613458 * a - 0.0638541728 * b;
438
- const sRoot = color.lightness - 0.0894841775 * a - 1.291485548 * b;
439
- const l = lRoot ** 3;
440
- const m = mRoot ** 3;
441
- const s = sRoot ** 3;
442
- return [
443
- linearToSrgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
444
- linearToSrgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
445
- linearToSrgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
446
- ];
513
+ const hueRadians = (color.hue ?? 0) * Math.PI / 180;
514
+ const a = color.chroma * Math.cos(hueRadians);
515
+ const b = color.chroma * Math.sin(hueRadians);
516
+ const lRoot = color.lightness + .3963377774 * a + .2158037573 * b;
517
+ const mRoot = color.lightness - .1055613458 * a - .0638541728 * b;
518
+ const sRoot = color.lightness - .0894841775 * a - 1.291485548 * b;
519
+ const l = lRoot ** 3;
520
+ const m = mRoot ** 3;
521
+ const s = sRoot ** 3;
522
+ return [
523
+ linearToSrgb(4.0767416621 * l - 3.3077115913 * m + .2309699292 * s),
524
+ linearToSrgb(-1.2684380046 * l + 2.6097574011 * m - .3413193965 * s),
525
+ linearToSrgb(-.0041960863 * l - .7034186147 * m + 1.707614701 * s)
526
+ ];
447
527
  }
448
528
  function interpolateHue(from, to, amount) {
449
- if (from === null)
450
- return to;
451
- if (to === null)
452
- return from;
453
- const difference = ((to - from + 540) % 360) - 180;
454
- return normalizeHue(from + difference * amount);
529
+ if (from === null) return to;
530
+ if (to === null) return from;
531
+ return normalizeHue(from + ((to - from + 540) % 360 - 180) * amount);
455
532
  }
456
533
  function srgbToLinear(channel) {
457
- return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;
534
+ return channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4;
458
535
  }
459
536
  function linearToSrgb(channel) {
460
- return channel <= 0.0031308 ? channel * 12.92 : 1.055 * channel ** (1 / 2.4) - 0.055;
537
+ return channel <= .0031308 ? channel * 12.92 : 1.055 * channel ** (1 / 2.4) - .055;
461
538
  }
462
539
  function isInSrgbGamut(color) {
463
- return color.every((channel) => channel >= -SRGB_GAMUT_TOLERANCE && channel <= 1 + SRGB_GAMUT_TOLERANCE);
540
+ return color.every((channel) => channel >= -1e-7 && channel <= 1.0000001);
464
541
  }
465
542
  function toRgbChannels(color) {
466
- return {
467
- red: clampUnit(color[0]) * 255,
468
- green: clampUnit(color[1]) * 255,
469
- blue: clampUnit(color[2]) * 255,
470
- };
543
+ return {
544
+ red: clampUnit(color[0]) * 255,
545
+ green: clampUnit(color[1]) * 255,
546
+ blue: clampUnit(color[2]) * 255
547
+ };
471
548
  }
472
549
  function interpolate(from, to, amount) {
473
- return from + (to - from) * amount;
550
+ return from + (to - from) * amount;
474
551
  }
475
552
  function normalizeHue(hue) {
476
- return ((hue % 360) + 360) % 360;
553
+ return (hue % 360 + 360) % 360;
477
554
  }
478
555
  function formatPercentage(value) {
479
- return Number(value.toFixed(4)).toString();
556
+ return Number(value.toFixed(4)).toString();
480
557
  }
481
558
  function parseHex(value) {
482
- const hex = value.slice(1);
483
- if (!/^[\da-f]{3}([\da-f]{3})?$/i.test(hex))
484
- return null;
485
- const normalized = hex.length === 3 ? [...hex].map((character) => character.repeat(2)).join('') : hex;
486
- return {
487
- red: Number.parseInt(normalized.slice(0, 2), 16),
488
- green: Number.parseInt(normalized.slice(2, 4), 16),
489
- blue: Number.parseInt(normalized.slice(4, 6), 16),
490
- };
559
+ const hex = value.slice(1);
560
+ if (!/^[\da-f]{3}([\da-f]{3})?$/i.test(hex)) return null;
561
+ const normalized = hex.length === 3 ? [...hex].map((character) => character.repeat(2)).join("") : hex;
562
+ return {
563
+ red: Number.parseInt(normalized.slice(0, 2), 16),
564
+ green: Number.parseInt(normalized.slice(2, 4), 16),
565
+ blue: Number.parseInt(normalized.slice(4, 6), 16)
566
+ };
491
567
  }
492
568
  function parseRgb(value) {
493
- const functionalValue = splitFunctionalColor(value);
494
- if (!functionalValue)
495
- return null;
496
- const body = functionalValue.channels;
497
- if (!body)
498
- return null;
499
- const channels = body.replaceAll(',', ' ').split(/\s+/).filter(Boolean);
500
- if (channels.length !== 3)
501
- return null;
502
- const parsed = channels.map((channel) => {
503
- const numeric = Number.parseFloat(channel);
504
- if (!Number.isFinite(numeric))
505
- return Number.NaN;
506
- return channel.endsWith('%') ? numeric * 2.55 : numeric;
507
- });
508
- if (parsed.some((channel) => !Number.isFinite(channel)))
509
- return null;
510
- return {
511
- red: clampChannel(parsed[0]),
512
- green: clampChannel(parsed[1]),
513
- blue: clampChannel(parsed[2]),
514
- };
569
+ const functionalValue = splitFunctionalColor(value);
570
+ if (!functionalValue) return null;
571
+ const body = functionalValue.channels;
572
+ if (!body) return null;
573
+ const channels = body.replaceAll(",", " ").split(/\s+/).filter(Boolean);
574
+ if (channels.length !== 3) return null;
575
+ const parsed = channels.map((channel) => {
576
+ const numeric = Number.parseFloat(channel);
577
+ if (!Number.isFinite(numeric)) return NaN;
578
+ return channel.endsWith("%") ? numeric * 2.55 : numeric;
579
+ });
580
+ if (parsed.some((channel) => !Number.isFinite(channel))) return null;
581
+ return {
582
+ red: clampChannel(parsed[0]),
583
+ green: clampChannel(parsed[1]),
584
+ blue: clampChannel(parsed[2])
585
+ };
515
586
  }
516
587
  function parseHsl(value) {
517
- const functionalValue = splitFunctionalColor(value);
518
- if (!functionalValue)
519
- return null;
520
- const body = functionalValue.channels;
521
- if (!body)
522
- return null;
523
- const channels = body.replaceAll(',', ' ').split(/\s+/).filter(Boolean);
524
- if (channels.length !== 3 || !channels[1]?.endsWith('%') || !channels[2]?.endsWith('%')) {
525
- return null;
526
- }
527
- const hue = Number.parseFloat(channels[0]);
528
- const saturation = Number.parseFloat(channels[1]) / 100;
529
- const lightness = Number.parseFloat(channels[2]) / 100;
530
- if (![hue, saturation, lightness].every(Number.isFinite))
531
- return null;
532
- const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
533
- const section = (((hue % 360) + 360) % 360) / 60;
534
- const secondary = chroma * (1 - Math.abs((section % 2) - 1));
535
- const [red, green, blue] = section < 1
536
- ? [chroma, secondary, 0]
537
- : section < 2
538
- ? [secondary, chroma, 0]
539
- : section < 3
540
- ? [0, chroma, secondary]
541
- : section < 4
542
- ? [0, secondary, chroma]
543
- : section < 5
544
- ? [secondary, 0, chroma]
545
- : [chroma, 0, secondary];
546
- const match = lightness - chroma / 2;
547
- return {
548
- red: clampChannel((red + match) * 255),
549
- green: clampChannel((green + match) * 255),
550
- blue: clampChannel((blue + match) * 255),
551
- };
588
+ const functionalValue = splitFunctionalColor(value);
589
+ if (!functionalValue) return null;
590
+ const body = functionalValue.channels;
591
+ if (!body) return null;
592
+ const channels = body.replaceAll(",", " ").split(/\s+/).filter(Boolean);
593
+ if (channels.length !== 3 || !channels[1]?.endsWith("%") || !channels[2]?.endsWith("%")) return null;
594
+ const hue = Number.parseFloat(channels[0]);
595
+ const saturation = Number.parseFloat(channels[1]) / 100;
596
+ const lightness = Number.parseFloat(channels[2]) / 100;
597
+ if (![
598
+ hue,
599
+ saturation,
600
+ lightness
601
+ ].every(Number.isFinite)) return null;
602
+ const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
603
+ const section = (hue % 360 + 360) % 360 / 60;
604
+ const secondary = chroma * (1 - Math.abs(section % 2 - 1));
605
+ const [red, green, blue] = section < 1 ? [
606
+ chroma,
607
+ secondary,
608
+ 0
609
+ ] : section < 2 ? [
610
+ secondary,
611
+ chroma,
612
+ 0
613
+ ] : section < 3 ? [
614
+ 0,
615
+ chroma,
616
+ secondary
617
+ ] : section < 4 ? [
618
+ 0,
619
+ secondary,
620
+ chroma
621
+ ] : section < 5 ? [
622
+ secondary,
623
+ 0,
624
+ chroma
625
+ ] : [
626
+ chroma,
627
+ 0,
628
+ secondary
629
+ ];
630
+ const match = lightness - chroma / 2;
631
+ return {
632
+ red: clampChannel((red + match) * 255),
633
+ green: clampChannel((green + match) * 255),
634
+ blue: clampChannel((blue + match) * 255)
635
+ };
552
636
  }
553
637
  function splitFunctionalColor(value) {
554
- const body = value.slice(value.indexOf('(') + 1, -1);
555
- const [channels, alpha, ...remainder] = body.split('/').map((part) => part.trim());
556
- if (!channels || remainder.length > 0)
557
- return null;
558
- if (alpha !== undefined && !isOpaqueAlpha(alpha))
559
- return null;
560
- return { channels };
638
+ const [channels, alpha, ...remainder] = value.slice(value.indexOf("(") + 1, -1).split("/").map((part) => part.trim());
639
+ if (!channels || remainder.length > 0) return null;
640
+ if (alpha !== void 0 && !isOpaqueAlpha(alpha)) return null;
641
+ return { channels };
561
642
  }
562
643
  function isOpaqueAlpha(value) {
563
- const numeric = Number.parseFloat(value);
564
- if (!Number.isFinite(numeric))
565
- return false;
566
- return value.endsWith('%') ? numeric === 100 : numeric === 1;
644
+ const numeric = Number.parseFloat(value);
645
+ if (!Number.isFinite(numeric)) return false;
646
+ return value.endsWith("%") ? numeric === 100 : numeric === 1;
567
647
  }
568
648
  function clampChannel(value) {
569
- return Math.min(255, Math.max(0, value));
649
+ return Math.min(255, Math.max(0, value));
570
650
  }
571
651
  function clampUnit(value) {
572
- return Math.min(1, Math.max(0, value));
652
+ return Math.min(1, Math.max(0, value));
573
653
  }
574
-
575
- /**
576
- * Version of the deterministic algorithm used to derive Aeris color tokens.
577
- *
578
- * A change to an existing derived color for the same complete theme input must
579
- * increment this value. Build-time configurations can pin the version to make
580
- * an intentional regeneration step explicit during upgrades.
581
- */
582
- const AERIS_COLOR_DERIVATION_VERSION = 1;
583
-
584
- const LIGHT_TEXT = '#222222';
585
- const LIGHT_TEXT_SECONDARY = '#555555';
586
- const LIGHT_TEXT_TERTIARY = '#707070';
587
- const DARK_TEXT = '#f4f4f4';
588
- const DARK_TEXT_SECONDARY = '#c5c5c5';
589
- const DARK_TEXT_TERTIARY = '#9d9d9d';
590
- /** Resolves palette-aware surfaces and borders while keeping ordinary text achromatic. */
654
+ const AERIS_COLOR_DERIVATION_VERSION = 2;
655
+ const LIGHT_TEXT = "#222222";
656
+ const LIGHT_TEXT_SECONDARY = "#555555";
657
+ const LIGHT_TEXT_TERTIARY = "#707070";
658
+ const DARK_TEXT = "#f4f4f4";
659
+ const DARK_TEXT_SECONDARY = "#c5c5c5";
660
+ const DARK_TEXT_TERTIARY = "#9d9d9d";
591
661
  function resolveAerisFoundation(theme, mode) {
592
- const scheme = theme[mode];
593
- const surfaceSeed = theme.palette.surface;
594
- const borderSeed = theme.palette.secondary;
595
- if (mode === 'light') {
596
- const surface2 = scheme.surface2 ?? mixAerisColor('#f7f6f2', surfaceSeed, 0.24);
597
- return {
598
- page: scheme.page ?? mixAerisColor('#faf9f7', surfaceSeed, 0.18),
599
- surface: scheme.surface ?? '#ffffff',
600
- surface2,
601
- surface3: scheme.surface3 ?? mixAerisColor('#f1f0eb', surfaceSeed, 0.42),
602
- interactiveHover: scheme.interactiveHover ?? mixAerisColor(surface2, theme.palette.primary, 0.1),
603
- text: scheme.text ?? LIGHT_TEXT,
604
- text2: scheme.text2 ?? LIGHT_TEXT_SECONDARY,
605
- text3: scheme.text3 ?? LIGHT_TEXT_TERTIARY,
606
- border: scheme.border ?? mixAerisColor('#5f625d', borderSeed, 0.42),
607
- borderStrong: scheme.borderStrong ?? mixAerisColor('#444842', borderSeed, 0.3),
608
- focus: scheme.focus ?? mixAerisColor('#1d2119', theme.palette.primary, 0.5),
609
- };
610
- }
611
- const surface2 = scheme.surface2 ?? mixAerisColor('#171b22', surfaceSeed, 0.008);
612
- return {
613
- page: scheme.page ?? mixAerisColor('#090b0f', surfaceSeed, 0.004),
614
- surface: scheme.surface ?? mixAerisColor('#101318', surfaceSeed, 0.006),
615
- surface2,
616
- surface3: scheme.surface3 ?? mixAerisColor('#202632', surfaceSeed, 0.01),
617
- interactiveHover: scheme.interactiveHover ?? mixAerisColor(surface2, theme.palette.primary, 0.12),
618
- text: scheme.text ?? DARK_TEXT,
619
- text2: scheme.text2 ?? DARK_TEXT_SECONDARY,
620
- text3: scheme.text3 ?? DARK_TEXT_TERTIARY,
621
- border: scheme.border ?? mixAerisColor('#70746d', borderSeed, 0.35),
622
- borderStrong: scheme.borderStrong ?? mixAerisColor('#8d9289', borderSeed, 0.3),
623
- focus: scheme.focus ?? mixAerisColor('#ffffff', theme.palette.primary, 0.56),
624
- };
662
+ const scheme = resolveAerisThemeScheme(theme, mode);
663
+ const surfaceSeed = theme.palette.surface;
664
+ const borderSeed = theme.palette.secondary;
665
+ if (mode === "light") {
666
+ const surface2 = scheme.surface2 ?? mixAerisColor("#f7f6f2", surfaceSeed, .24);
667
+ const surface = scheme.surface ?? "#ffffff";
668
+ const border = scheme.border ?? mixAerisColor(surface, mixAerisColor("#5f625d", borderSeed, .42), .12);
669
+ return {
670
+ page: scheme.page ?? mixAerisColor("#faf9f7", surfaceSeed, .18),
671
+ surface,
672
+ surface2,
673
+ surface3: scheme.surface3 ?? mixAerisColor("#f1f0eb", surfaceSeed, .42),
674
+ interactiveHover: scheme.interactiveHover ?? mixAerisColor(surface2, theme.palette.primary, .1),
675
+ text: scheme.text ?? LIGHT_TEXT,
676
+ text2: scheme.text2 ?? LIGHT_TEXT_SECONDARY,
677
+ text3: scheme.text3 ?? LIGHT_TEXT_TERTIARY,
678
+ border,
679
+ borderStrong: scheme.borderStrong ?? mixAerisColor("#444842", borderSeed, .3),
680
+ focus: scheme.focus ?? mixAerisColor("#1d2119", theme.palette.primary, .5)
681
+ };
682
+ }
683
+ const surface2 = scheme.surface2 ?? mixAerisColor("#191919", surfaceSeed, .008);
684
+ const surface = scheme.surface ?? mixAerisColor("#121212", surfaceSeed, .006);
685
+ const border = scheme.border ?? mixAerisColor(surface, mixAerisColor("#70746d", borderSeed, .35), .16);
686
+ return {
687
+ page: scheme.page ?? mixAerisColor("#0c0c0c", surfaceSeed, .004),
688
+ surface,
689
+ surface2,
690
+ surface3: scheme.surface3 ?? mixAerisColor("#232323", surfaceSeed, .01),
691
+ interactiveHover: scheme.interactiveHover ?? mixAerisColor(surface2, theme.palette.primary, .12),
692
+ text: scheme.text ?? DARK_TEXT,
693
+ text2: scheme.text2 ?? DARK_TEXT_SECONDARY,
694
+ text3: scheme.text3 ?? DARK_TEXT_TERTIARY,
695
+ border,
696
+ borderStrong: scheme.borderStrong ?? mixAerisColor("#8d9289", borderSeed, .3),
697
+ focus: scheme.focus ?? mixAerisColor("#ffffff", theme.palette.primary, .56)
698
+ };
625
699
  }
626
-
627
- const AERIS_SEMANTIC_TONE_NAMES = [
628
- 'primary',
629
- 'secondary',
630
- 'success',
631
- 'info',
632
- 'warning',
633
- 'danger',
634
- 'contrast',
635
- ];
636
700
  const LIGHT_BASES = {
637
- success: '#52744d',
638
- info: '#4f7180',
639
- warning: '#c38600',
640
- danger: '#c81e2a',
701
+ success: "#52744d",
702
+ info: "#4f7180",
703
+ warning: "#c38600",
704
+ danger: "#c81e2a"
641
705
  };
642
706
  const DARK_BASES = {
643
- success: '#91b78a',
644
- info: '#91b7c8',
645
- warning: '#facc15',
646
- danger: '#ff5c68',
707
+ success: "#91b78a",
708
+ info: "#91b7c8",
709
+ warning: "#facc15",
710
+ danger: "#ff5c68"
647
711
  };
648
- const DARK_FOREGROUND = '#111411';
649
- const LIGHT_FOREGROUND = '#ffffff';
712
+ const DARK_FOREGROUND = "#111411";
713
+ const LIGHT_FOREGROUND = "#ffffff";
650
714
  const REQUIRED_TEXT_CONTRAST = 4.5;
651
- const LIGHT_HOVER_MIX = 0.04;
652
- const LIGHT_ACTIVE_MIX = 0.05;
653
- const DARK_HOVER_MIX = 0.2;
654
- const DARK_ACTIVE_MIX = 0.28;
715
+ const LIGHT_HOVER_MIX = .04;
716
+ const LIGHT_ACTIVE_MIX = .05;
717
+ const DARK_HOVER_MIX = .2;
718
+ const DARK_ACTIVE_MIX = .28;
655
719
  function resolveAerisSemanticTones(theme, mode) {
656
- const scheme = theme[mode];
657
- const surface = resolveSurface(theme, scheme, mode);
658
- const result = {};
659
- for (const name of AERIS_SEMANTIC_TONE_NAMES) {
660
- const overrides = scheme.tones?.[name] ?? {};
661
- const base = overrides.base ?? defaultBase(theme, mode, name);
662
- const boundary = overrides.boundary ?? base;
663
- const hover = overrides.hover ?? deriveState(base, mode, stateMix(mode, 'hover'));
664
- const active = overrides.active ?? deriveState(base, mode, stateMix(mode, 'active'));
665
- const soft = overrides.soft ?? mixAerisColor(surface, base, mode === 'dark' ? 0.2 : 0.14);
666
- const text = overrides.text ?? ensureTextContrast(base, surface, mode);
667
- const onBase = overrides.onBase ?? contrastingForeground(base);
668
- const onHover = overrides.onHover ?? contrastingForeground(hover, onBase);
669
- const onActive = overrides.onActive ?? contrastingForeground(active, onHover);
670
- const onSoft = overrides.onSoft ?? ensureTextContrast(text, soft, mode);
671
- result[name] = {
672
- base,
673
- boundary,
674
- hover,
675
- active,
676
- onBase,
677
- onHover,
678
- onActive,
679
- text,
680
- soft,
681
- onSoft,
682
- };
683
- }
684
- return result;
720
+ const scheme = resolveAerisThemeScheme(theme, mode);
721
+ const surface = resolveAerisFoundation(theme, mode).surface;
722
+ const result = {};
723
+ for (const name of AERIS_SEMANTIC_TONE_NAMES) {
724
+ const overrides = scheme.tones?.[name] ?? {};
725
+ const base = overrides.base ?? defaultBase(theme, mode, name);
726
+ const boundary = overrides.boundary ?? base;
727
+ const onBase = overrides.onBase ?? contrastingForeground(base);
728
+ const hover = overrides.hover ?? deriveState(base, mode, stateMix(mode, "hover"), onBase);
729
+ const active = overrides.active ?? deriveState(base, mode, stateMix(mode, "active"), onBase);
730
+ const soft = overrides.soft ?? mixAerisColor(surface, base, mode === "dark" ? .2 : .14);
731
+ const text = overrides.text ?? ensureTextContrast(base, surface, mode);
732
+ const onHover = overrides.onHover ?? contrastingForeground(hover, onBase);
733
+ result[name] = {
734
+ base,
735
+ boundary,
736
+ hover,
737
+ active,
738
+ onBase,
739
+ onHover,
740
+ onActive: overrides.onActive ?? contrastingForeground(active, onHover),
741
+ text,
742
+ soft,
743
+ onSoft: overrides.onSoft ?? ensureTextContrast(text, soft, mode)
744
+ };
745
+ }
746
+ return result;
685
747
  }
686
748
  function defaultBase(theme, mode, name) {
687
- const fixed = (mode === 'dark' ? DARK_BASES : LIGHT_BASES)[name];
688
- if (fixed)
689
- return fixed;
690
- const seed = name === 'primary'
691
- ? theme.palette.primary
692
- : name === 'secondary'
693
- ? theme.palette.secondary
694
- : theme.palette.contrast;
695
- if (mode === 'light')
696
- return seed;
697
- return mixAerisColor(seed, LIGHT_FOREGROUND, name === 'contrast' ? 0.29 : 0.22);
749
+ const fixed = (mode === "dark" ? DARK_BASES : LIGHT_BASES)[name];
750
+ if (fixed) return fixed;
751
+ const seed = name === "primary" ? theme.palette.primary : name === "secondary" ? theme.palette.secondary : theme.palette.contrast;
752
+ if (mode === "light") return seed;
753
+ return mixAerisColor(seed, LIGHT_FOREGROUND, name === "contrast" ? .29 : .22);
698
754
  }
699
- function resolveSurface(theme, scheme, mode) {
700
- if (scheme.surface)
701
- return scheme.surface;
702
- return mode === 'light'
703
- ? LIGHT_FOREGROUND
704
- : mixAerisColor('#1f221c', theme.palette.surface, 0.02);
705
- }
706
- function deriveState(base, mode, amount) {
707
- return mixAerisColor(base, mode === 'light' ? DARK_FOREGROUND : LIGHT_FOREGROUND, amount);
755
+ function deriveState(base, mode, amount, foreground) {
756
+ const state = mixAerisColor(base, mode === "light" ? DARK_FOREGROUND : LIGHT_FOREGROUND, amount);
757
+ const stateColor = parseAerisColor(state);
758
+ const foregroundColor = parseAerisColor(foreground);
759
+ if (mode === "dark" || !stateColor || !foregroundColor || aerisRgbContrastRatio(stateColor, foregroundColor) >= REQUIRED_TEXT_CONTRAST) return state;
760
+ const dark = parseAerisColor(DARK_FOREGROUND);
761
+ const target = aerisRgbContrastRatio(foregroundColor, parseAerisColor(LIGHT_FOREGROUND)) > aerisRgbContrastRatio(foregroundColor, dark) ? LIGHT_FOREGROUND : DARK_FOREGROUND;
762
+ for (let mix = amount; mix <= 1; mix += .01) {
763
+ const candidate = mixAerisColor(base, target, mix);
764
+ const candidateColor = parseAerisColor(candidate);
765
+ if (candidateColor && aerisRgbContrastRatio(candidateColor, foregroundColor) >= REQUIRED_TEXT_CONTRAST) return candidate;
766
+ }
767
+ return target;
708
768
  }
709
769
  function stateMix(mode, state) {
710
- if (mode === 'light')
711
- return state === 'hover' ? LIGHT_HOVER_MIX : LIGHT_ACTIVE_MIX;
712
- return state === 'hover' ? DARK_HOVER_MIX : DARK_ACTIVE_MIX;
770
+ if (mode === "light") return state === "hover" ? LIGHT_HOVER_MIX : LIGHT_ACTIVE_MIX;
771
+ return state === "hover" ? DARK_HOVER_MIX : DARK_ACTIVE_MIX;
713
772
  }
714
773
  function contrastingForeground(color, fallback = DARK_FOREGROUND) {
715
- const background = parseAerisColor(color);
716
- if (!background)
717
- return fallback;
718
- const fallbackColor = parseAerisColor(fallback);
719
- if (fallbackColor && aerisRgbContrastRatio(background, fallbackColor) >= REQUIRED_TEXT_CONTRAST) {
720
- return fallback;
721
- }
722
- const darkContrast = aerisRgbContrastRatio(background, parseAerisColor(DARK_FOREGROUND));
723
- const lightContrast = aerisRgbContrastRatio(background, parseAerisColor(LIGHT_FOREGROUND));
724
- return lightContrast > darkContrast ? LIGHT_FOREGROUND : DARK_FOREGROUND;
774
+ const background = parseAerisColor(color);
775
+ if (!background) return fallback;
776
+ const fallbackColor = parseAerisColor(fallback);
777
+ if (fallbackColor && aerisRgbContrastRatio(background, fallbackColor) >= REQUIRED_TEXT_CONTRAST) return fallback;
778
+ const darkContrast = aerisRgbContrastRatio(background, parseAerisColor(DARK_FOREGROUND));
779
+ return aerisRgbContrastRatio(background, parseAerisColor(LIGHT_FOREGROUND)) > darkContrast ? LIGHT_FOREGROUND : DARK_FOREGROUND;
725
780
  }
726
781
  function ensureTextContrast(color, background, mode) {
727
- const foreground = parseAerisColor(color);
728
- const surface = parseAerisColor(background);
729
- if (!foreground || !surface)
730
- return color;
731
- if (aerisRgbContrastRatio(foreground, surface) >= REQUIRED_TEXT_CONTRAST)
732
- return color;
733
- const target = parseAerisColor(mode === 'light' ? DARK_FOREGROUND : LIGHT_FOREGROUND);
734
- for (let amount = 0.05; amount <= 1; amount += 0.05) {
735
- const candidate = mixAerisRgb(foreground, target, amount);
736
- if (aerisRgbContrastRatio(candidate, surface) >= REQUIRED_TEXT_CONTRAST) {
737
- return formatAerisHex(candidate);
738
- }
739
- }
740
- return formatAerisHex(target);
782
+ const foreground = parseAerisColor(color);
783
+ const surface = parseAerisColor(background);
784
+ if (!foreground || !surface) return color;
785
+ if (aerisRgbContrastRatio(foreground, surface) >= REQUIRED_TEXT_CONTRAST) return color;
786
+ const target = parseAerisColor(mode === "light" ? DARK_FOREGROUND : LIGHT_FOREGROUND);
787
+ for (let amount = .05; amount <= 1; amount += .05) {
788
+ const candidate = mixAerisRgb(foreground, target, amount);
789
+ if (aerisRgbContrastRatio(candidate, surface) >= REQUIRED_TEXT_CONTRAST) return formatAerisHex(candidate);
790
+ }
791
+ return formatAerisHex(target);
741
792
  }
742
-
743
793
  const TONE_NAMES = [
744
- 'primary',
745
- 'secondary',
746
- 'success',
747
- 'info',
748
- 'warning',
749
- 'danger',
750
- 'contrast',
794
+ "primary",
795
+ "secondary",
796
+ "success",
797
+ "info",
798
+ "warning",
799
+ "danger",
800
+ "contrast"
751
801
  ];
752
802
  function auditAerisThemeContrast(theme, mode) {
753
- const scheme = resolveSchemeColors(theme, mode);
754
- const tones = resolveAerisSemanticTones(theme, mode);
755
- const checks = [
756
- createCheck({
757
- id: 'text-page',
758
- label: 'Primary text on page',
759
- description: 'Default body content against the application page.',
760
- category: 'text',
761
- kind: 'text',
762
- foreground: scheme.text,
763
- background: scheme.page,
764
- requiredRatio: 4.5,
765
- guidance: 'Increase the difference between the text and page colors.',
766
- }),
767
- createCheck({
768
- id: 'text-surface',
769
- label: 'Primary text on surface',
770
- description: 'Default content inside cards, panels, and overlays.',
771
- category: 'text',
772
- kind: 'text',
773
- foreground: scheme.text,
774
- background: scheme.surface,
775
- requiredRatio: 4.5,
776
- guidance: 'Increase the difference between the text and surface colors.',
777
- }),
778
- createCheck({
779
- id: 'text-secondary-surface',
780
- label: 'Secondary text on surface',
781
- description: 'Supporting descriptions and metadata on a primary surface.',
782
- category: 'text',
783
- kind: 'text',
784
- foreground: scheme.text2,
785
- background: scheme.surface,
786
- requiredRatio: 4.5,
787
- guidance: 'Strengthen the secondary text color without reducing hierarchy.',
788
- }),
789
- createCheck({
790
- id: 'text-tertiary-surface',
791
- label: 'Tertiary text on surface',
792
- description: 'Low-emphasis visible text on a primary surface.',
793
- category: 'text',
794
- kind: 'text',
795
- foreground: scheme.text3,
796
- background: scheme.surface,
797
- requiredRatio: 4.5,
798
- guidance: 'Darken or lighten the tertiary text until it remains readable.',
799
- }),
800
- createCheck({
801
- id: 'text-secondary-raised',
802
- label: 'Secondary text on raised surface',
803
- description: 'Supporting content against the secondary surface layer.',
804
- category: 'text',
805
- kind: 'text',
806
- foreground: scheme.text2,
807
- background: scheme.surface2,
808
- requiredRatio: 4.5,
809
- guidance: 'Increase secondary text contrast against the raised surface.',
810
- }),
811
- createCheck({
812
- id: 'text-interactive-hover',
813
- label: 'Primary text on neutral hover',
814
- description: 'Default item content against the shared neutral interactive hover surface.',
815
- category: 'interaction',
816
- kind: 'text',
817
- foreground: scheme.text,
818
- background: scheme.interactiveHover,
819
- requiredRatio: 4.5,
820
- guidance: 'Adjust interactiveHover until default content remains readable.',
821
- }),
822
- ...TONE_NAMES.flatMap((name) => interactionChecks(name, tones[name], scheme.surface)),
823
- createCheck({
824
- id: 'focus-surface',
825
- label: 'Focus indicator on surface',
826
- description: 'Focus token against cards, controls, and overlay surfaces.',
827
- category: 'focus',
828
- kind: 'non-text',
829
- foreground: scheme.focus,
830
- background: scheme.surface,
831
- requiredRatio: 3,
832
- guidance: 'Strengthen the focus color against the primary surface.',
833
- }),
834
- createCheck({
835
- id: 'focus-page',
836
- label: 'Focus indicator on page',
837
- description: 'Focus token against the application page background.',
838
- category: 'focus',
839
- kind: 'non-text',
840
- foreground: scheme.focus,
841
- background: scheme.page,
842
- requiredRatio: 3,
843
- guidance: 'Strengthen the focus color against the page background.',
844
- }),
845
- createCheck({
846
- id: 'border-surface',
847
- label: 'Standard border on surface',
848
- description: 'Default structural boundary against a primary surface.',
849
- category: 'boundary',
850
- kind: 'non-text',
851
- foreground: scheme.border,
852
- background: scheme.surface,
853
- requiredRatio: 3,
854
- guidance: 'Use the stronger border token when the boundary identifies a control.',
855
- }),
856
- createCheck({
857
- id: 'border-strong-surface',
858
- label: 'Control border on surface',
859
- description: 'Strong border used to identify interactive controls.',
860
- category: 'boundary',
861
- kind: 'non-text',
862
- foreground: scheme.borderStrong,
863
- background: scheme.surface,
864
- requiredRatio: 3,
865
- guidance: 'Increase the strong border contrast against the primary surface.',
866
- }),
867
- createCheck({
868
- id: 'border-strong-raised',
869
- label: 'Control border on raised surface',
870
- description: 'Strong border used on the secondary surface layer.',
871
- category: 'boundary',
872
- kind: 'non-text',
873
- foreground: scheme.borderStrong,
874
- background: scheme.surface2,
875
- requiredRatio: 3,
876
- guidance: 'Increase the strong border contrast against the raised surface.',
877
- }),
878
- ...TONE_NAMES.map((name) => createCheck({
879
- id: `${name}-boundary`,
880
- label: `${titleCase(name)} control boundary`,
881
- description: `Solid ${name} controls against a primary surface.`,
882
- category: 'boundary',
883
- kind: 'non-text',
884
- foreground: tones[name].boundary,
885
- background: scheme.surface,
886
- requiredRatio: 3,
887
- guidance: `Adjust tones.${name}.boundary so solid controls remain identifiable.`,
888
- })),
889
- ];
890
- const passed = checks.filter((check) => check.status === 'pass').length;
891
- const failed = checks.filter((check) => check.status === 'fail').length;
892
- const unresolved = checks.filter((check) => check.status === 'unresolved').length;
893
- const resolvedTotal = passed + failed;
894
- return {
895
- mode,
896
- checks,
897
- passed,
898
- failed,
899
- unresolved,
900
- total: checks.length,
901
- score: resolvedTotal > 0 ? Math.round((passed / resolvedTotal) * 100) : 0,
902
- status: failed > 0 ? 'fail' : unresolved > 0 ? 'unresolved' : 'pass',
903
- };
803
+ const scheme = resolveSchemeColors(theme, mode);
804
+ const tones = resolveAerisSemanticTones(theme, mode);
805
+ const checks = [
806
+ createCheck({
807
+ id: "text-page",
808
+ label: "Primary text on page",
809
+ description: "Default body content against the application page.",
810
+ category: "text",
811
+ kind: "text",
812
+ foreground: scheme.text,
813
+ background: scheme.page,
814
+ foregroundProperty: "text",
815
+ backgroundProperty: "page",
816
+ requiredRatio: 4.5,
817
+ guidance: "Increase the difference between the text and page colors."
818
+ }),
819
+ createCheck({
820
+ id: "text-surface",
821
+ label: "Primary text on surface",
822
+ description: "Default content inside cards, panels, and overlays.",
823
+ category: "text",
824
+ kind: "text",
825
+ foreground: scheme.text,
826
+ background: scheme.surface,
827
+ foregroundProperty: "text",
828
+ backgroundProperty: "surface",
829
+ requiredRatio: 4.5,
830
+ guidance: "Increase the difference between the text and surface colors."
831
+ }),
832
+ createCheck({
833
+ id: "text-secondary-surface",
834
+ label: "Secondary text on surface",
835
+ description: "Supporting descriptions and metadata on a primary surface.",
836
+ category: "text",
837
+ kind: "text",
838
+ foreground: scheme.text2,
839
+ background: scheme.surface,
840
+ foregroundProperty: "text2",
841
+ backgroundProperty: "surface",
842
+ requiredRatio: 4.5,
843
+ guidance: "Strengthen the secondary text color without reducing hierarchy."
844
+ }),
845
+ createCheck({
846
+ id: "text-tertiary-surface",
847
+ label: "Tertiary text on surface",
848
+ description: "Low-emphasis visible text on a primary surface.",
849
+ category: "text",
850
+ kind: "text",
851
+ foreground: scheme.text3,
852
+ background: scheme.surface,
853
+ foregroundProperty: "text3",
854
+ backgroundProperty: "surface",
855
+ requiredRatio: 4.5,
856
+ guidance: "Darken or lighten the tertiary text until it remains readable."
857
+ }),
858
+ createCheck({
859
+ id: "text-secondary-raised",
860
+ label: "Secondary text on raised surface",
861
+ description: "Supporting content against the secondary surface layer.",
862
+ category: "text",
863
+ kind: "text",
864
+ foreground: scheme.text2,
865
+ background: scheme.surface2,
866
+ foregroundProperty: "text2",
867
+ backgroundProperty: "surface2",
868
+ requiredRatio: 4.5,
869
+ guidance: "Increase secondary text contrast against the raised surface."
870
+ }),
871
+ createCheck({
872
+ id: "text-interactive-hover",
873
+ label: "Primary text on neutral hover",
874
+ description: "Default item content against the shared neutral interactive hover surface.",
875
+ category: "interaction",
876
+ kind: "text",
877
+ foreground: scheme.text,
878
+ background: scheme.interactiveHover,
879
+ foregroundProperty: "text",
880
+ backgroundProperty: "interactiveHover",
881
+ requiredRatio: 4.5,
882
+ guidance: "Adjust interactiveHover until default content remains readable."
883
+ }),
884
+ ...TONE_NAMES.flatMap((name) => interactionChecks(name, tones[name], scheme.surface)),
885
+ createCheck({
886
+ id: "focus-surface",
887
+ label: "Focus indicator on surface",
888
+ description: "Focus token against cards, controls, and overlay surfaces.",
889
+ category: "focus",
890
+ kind: "non-text",
891
+ foreground: scheme.focus,
892
+ background: scheme.surface,
893
+ foregroundProperty: "focus",
894
+ backgroundProperty: "surface",
895
+ requiredRatio: 3,
896
+ guidance: "Strengthen the focus color against the primary surface."
897
+ }),
898
+ createCheck({
899
+ id: "focus-page",
900
+ label: "Focus indicator on page",
901
+ description: "Focus token against the application page background.",
902
+ category: "focus",
903
+ kind: "non-text",
904
+ foreground: scheme.focus,
905
+ background: scheme.page,
906
+ foregroundProperty: "focus",
907
+ backgroundProperty: "page",
908
+ requiredRatio: 3,
909
+ guidance: "Strengthen the focus color against the page background."
910
+ }),
911
+ createCheck({
912
+ id: "border-strong-surface",
913
+ label: "Emphasized boundary on surface",
914
+ description: "Optional strong boundary against a primary surface.",
915
+ category: "boundary",
916
+ kind: "non-text",
917
+ foreground: scheme.borderStrong,
918
+ background: scheme.surface,
919
+ foregroundProperty: "borderStrong",
920
+ backgroundProperty: "surface",
921
+ requiredRatio: 3,
922
+ guidance: "Increase the emphasized boundary contrast against the primary surface."
923
+ }),
924
+ createCheck({
925
+ id: "border-strong-raised",
926
+ label: "Emphasized boundary on raised surface",
927
+ description: "Optional strong boundary used on the secondary surface layer.",
928
+ category: "boundary",
929
+ kind: "non-text",
930
+ foreground: scheme.borderStrong,
931
+ background: scheme.surface2,
932
+ foregroundProperty: "borderStrong",
933
+ backgroundProperty: "surface2",
934
+ requiredRatio: 3,
935
+ guidance: "Increase the emphasized boundary contrast against the raised surface."
936
+ }),
937
+ ...TONE_NAMES.map((name) => createCheck({
938
+ id: `${name}-boundary`,
939
+ label: `${titleCase(name)} control boundary`,
940
+ description: `Solid ${name} controls against a primary surface.`,
941
+ category: "boundary",
942
+ kind: "non-text",
943
+ foreground: tones[name].boundary,
944
+ background: scheme.surface,
945
+ foregroundProperty: `tones.${name}.boundary`,
946
+ backgroundProperty: "surface",
947
+ requiredRatio: 3,
948
+ guidance: `Adjust tones.${name}.boundary so solid controls remain identifiable.`
949
+ }))
950
+ ];
951
+ const passed = checks.filter((check) => check.status === "pass").length;
952
+ const failed = checks.filter((check) => check.status === "fail").length;
953
+ const unresolved = checks.filter((check) => check.status === "unresolved").length;
954
+ const resolvedTotal = passed + failed;
955
+ return {
956
+ mode,
957
+ checks,
958
+ passed,
959
+ failed,
960
+ unresolved,
961
+ total: checks.length,
962
+ score: resolvedTotal > 0 ? Math.round(passed / resolvedTotal * 100) : 0,
963
+ status: failed > 0 ? "fail" : unresolved > 0 ? "unresolved" : "pass"
964
+ };
904
965
  }
905
966
  function interactionChecks(name, tone, surface) {
906
- const label = titleCase(name);
907
- return [
908
- createCheck({
909
- id: `${name}-base-content`,
910
- label: `${label} solid content`,
911
- description: 'Text and icons on the default solid background.',
912
- category: 'interaction',
913
- kind: 'text',
914
- foreground: tone.onBase,
915
- background: tone.base,
916
- requiredRatio: 4.5,
917
- guidance: `Set tones.${name}.onBase to a more contrasting foreground.`,
918
- }),
919
- createCheck({
920
- id: `${name}-hover-content`,
921
- label: `${label} hover content`,
922
- description: 'Text and icons on the hover background.',
923
- category: 'interaction',
924
- kind: 'text',
925
- foreground: tone.onHover,
926
- background: tone.hover,
927
- requiredRatio: 4.5,
928
- guidance: `Adjust tones.${name}.hover or tones.${name}.onHover.`,
929
- }),
930
- createCheck({
931
- id: `${name}-active-content`,
932
- label: `${label} pressed content`,
933
- description: 'Text and icons on the pressed background.',
934
- category: 'interaction',
935
- kind: 'text',
936
- foreground: tone.onActive,
937
- background: tone.active,
938
- requiredRatio: 4.5,
939
- guidance: `Adjust tones.${name}.active or tones.${name}.onActive.`,
940
- }),
941
- createCheck({
942
- id: `${name}-text-surface`,
943
- label: `${label} text treatment`,
944
- description: 'Outline, text, and link content on a primary surface.',
945
- category: 'interaction',
946
- kind: 'text',
947
- foreground: tone.text,
948
- background: surface,
949
- requiredRatio: 4.5,
950
- guidance: `Set tones.${name}.text to a readable surface foreground.`,
951
- }),
952
- createCheck({
953
- id: `${name}-soft-content`,
954
- label: `${label} soft content`,
955
- description: 'Text and icons on the low-emphasis semantic background.',
956
- category: 'interaction',
957
- kind: 'text',
958
- foreground: tone.onSoft,
959
- background: tone.soft,
960
- requiredRatio: 4.5,
961
- guidance: `Adjust tones.${name}.soft or tones.${name}.onSoft.`,
962
- }),
963
- ];
967
+ const label = titleCase(name);
968
+ return [
969
+ createCheck({
970
+ id: `${name}-base-content`,
971
+ label: `${label} solid content`,
972
+ description: "Text and icons on the default solid background.",
973
+ category: "interaction",
974
+ kind: "text",
975
+ foreground: tone.onBase,
976
+ background: tone.base,
977
+ foregroundProperty: `tones.${name}.onBase`,
978
+ backgroundProperty: `tones.${name}.base`,
979
+ requiredRatio: 4.5,
980
+ guidance: `Set tones.${name}.onBase to a more contrasting foreground.`
981
+ }),
982
+ createCheck({
983
+ id: `${name}-hover-content`,
984
+ label: `${label} hover content`,
985
+ description: "Text and icons on the hover background.",
986
+ category: "interaction",
987
+ kind: "text",
988
+ foreground: tone.onHover,
989
+ background: tone.hover,
990
+ foregroundProperty: `tones.${name}.onHover`,
991
+ backgroundProperty: `tones.${name}.hover`,
992
+ requiredRatio: 4.5,
993
+ guidance: `Adjust tones.${name}.hover or tones.${name}.onHover.`
994
+ }),
995
+ createCheck({
996
+ id: `${name}-active-content`,
997
+ label: `${label} pressed content`,
998
+ description: "Text and icons on the pressed background.",
999
+ category: "interaction",
1000
+ kind: "text",
1001
+ foreground: tone.onActive,
1002
+ background: tone.active,
1003
+ foregroundProperty: `tones.${name}.onActive`,
1004
+ backgroundProperty: `tones.${name}.active`,
1005
+ requiredRatio: 4.5,
1006
+ guidance: `Adjust tones.${name}.active or tones.${name}.onActive.`
1007
+ }),
1008
+ createCheck({
1009
+ id: `${name}-text-surface`,
1010
+ label: `${label} text treatment`,
1011
+ description: "Outline, text, and link content on a primary surface.",
1012
+ category: "interaction",
1013
+ kind: "text",
1014
+ foreground: tone.text,
1015
+ background: surface,
1016
+ foregroundProperty: `tones.${name}.text`,
1017
+ backgroundProperty: "surface",
1018
+ requiredRatio: 4.5,
1019
+ guidance: `Set tones.${name}.text to a readable surface foreground.`
1020
+ }),
1021
+ createCheck({
1022
+ id: `${name}-soft-content`,
1023
+ label: `${label} soft content`,
1024
+ description: "Text and icons on the low-emphasis semantic background.",
1025
+ category: "interaction",
1026
+ kind: "text",
1027
+ foreground: tone.onSoft,
1028
+ background: tone.soft,
1029
+ foregroundProperty: `tones.${name}.onSoft`,
1030
+ backgroundProperty: `tones.${name}.soft`,
1031
+ requiredRatio: 4.5,
1032
+ guidance: `Adjust tones.${name}.soft or tones.${name}.onSoft.`
1033
+ })
1034
+ ];
964
1035
  }
965
1036
  function createCheck(definition) {
966
- const ratio = aerisContrastRatio(definition.foreground, definition.background);
967
- const status = ratio === null ? 'unresolved' : ratio >= definition.requiredRatio ? 'pass' : 'fail';
968
- return {
969
- ...definition,
970
- criterion: definition.kind === 'text' ? '1.4.3' : '1.4.11',
971
- ratio,
972
- status,
973
- };
1037
+ const ratio = aerisContrastRatio(definition.foreground, definition.background);
1038
+ const status = ratio === null ? "unresolved" : ratio >= definition.requiredRatio ? "pass" : "fail";
1039
+ return {
1040
+ ...definition,
1041
+ criterion: definition.kind === "text" ? "1.4.3" : "1.4.11",
1042
+ ratio,
1043
+ status
1044
+ };
974
1045
  }
975
1046
  function resolveSchemeColors(theme, mode) {
976
- return resolveAerisFoundation(theme, mode);
1047
+ return resolveAerisFoundation(theme, mode);
977
1048
  }
978
1049
  function titleCase(value) {
979
- return value.charAt(0).toUpperCase() + value.slice(1);
1050
+ return value.charAt(0).toUpperCase() + value.slice(1);
980
1051
  }
981
-
982
- /** Resolves an optional theme override against the complete Aeris defaults. */
983
- function resolveAerisTheme(theme) {
984
- return {
985
- ...AERIS_DEFAULT_THEME,
986
- ...theme,
987
- palette: {
988
- ...AERIS_DEFAULT_THEME.palette,
989
- ...normalizeAerisPalette(theme?.palette),
990
- },
991
- light: {
992
- ...AERIS_DEFAULT_THEME.light,
993
- ...theme?.light,
994
- tones: mergeAerisSemanticTones(AERIS_DEFAULT_THEME.light.tones, theme?.light?.tones),
995
- },
996
- dark: {
997
- ...AERIS_DEFAULT_THEME.dark,
998
- ...theme?.dark,
999
- tones: mergeAerisSemanticTones(AERIS_DEFAULT_THEME.dark.tones, theme?.dark?.tones),
1000
- },
1001
- densities: {
1002
- ...AERIS_DEFAULT_THEME.densities,
1003
- ...theme?.densities,
1004
- },
1005
- radii: {
1006
- ...AERIS_DEFAULT_THEME.radii,
1007
- ...theme?.radii,
1008
- },
1009
- };
1052
+ function resolveAerisTheme(theme = {}) {
1053
+ const preset = theme.preset ?? AERIS_DEFAULT_THEME.preset;
1054
+ return {
1055
+ ...AERIS_DEFAULT_THEME,
1056
+ ...theme,
1057
+ preset,
1058
+ palette: mergePalette((Object.hasOwn(AERIS_THEME_PRESETS, preset) ? AERIS_THEME_PRESETS[preset] : AERIS_THEME_PRESETS.monochrome).palette, theme.palette),
1059
+ light: mergeScheme({}, theme.light),
1060
+ dark: mergeScheme({}, theme.dark),
1061
+ densities: {
1062
+ ...AERIS_DEFAULT_THEME.densities,
1063
+ ...theme.densities
1064
+ },
1065
+ radii: {
1066
+ ...AERIS_DEFAULT_THEME.radii,
1067
+ ...theme.radii
1068
+ }
1069
+ };
1010
1070
  }
1011
- /** Deeply merges a runtime update into an already resolved Aeris theme. */
1012
1071
  function mergeAerisTheme(theme, update) {
1013
- return {
1014
- ...theme,
1015
- ...update,
1016
- palette: {
1017
- ...theme.palette,
1018
- ...normalizeAerisPalette(update.palette),
1019
- },
1020
- light: {
1021
- ...theme.light,
1022
- ...update.light,
1023
- tones: mergeAerisSemanticTones(theme.light.tones, update.light?.tones),
1024
- },
1025
- dark: {
1026
- ...theme.dark,
1027
- ...update.dark,
1028
- tones: mergeAerisSemanticTones(theme.dark.tones, update.dark?.tones),
1029
- },
1030
- densities: {
1031
- ...theme.densities,
1032
- ...update.densities,
1033
- },
1034
- radii: {
1035
- ...theme.radii,
1036
- ...update.radii,
1037
- },
1038
- };
1072
+ if (update.preset !== void 0 && update.preset !== theme.preset) return resolveAerisTheme({
1073
+ density: theme.density,
1074
+ densities: theme.densities,
1075
+ radius: theme.radius,
1076
+ radii: theme.radii,
1077
+ direction: theme.direction,
1078
+ ...update
1079
+ });
1080
+ return resolveAerisTheme({
1081
+ ...theme,
1082
+ ...update,
1083
+ palette: {
1084
+ ...theme.palette,
1085
+ ...update.palette
1086
+ },
1087
+ light: mergeScheme(theme.light, update.light),
1088
+ dark: mergeScheme(theme.dark, update.dark),
1089
+ densities: {
1090
+ ...theme.densities,
1091
+ ...update.densities
1092
+ },
1093
+ radii: {
1094
+ ...theme.radii,
1095
+ ...update.radii
1096
+ }
1097
+ });
1039
1098
  }
1040
1099
  function resolveAerisDensity(theme) {
1041
- return theme.densities[theme.density] ?? AERIS_DEFAULT_THEME.densities['medium'];
1100
+ return theme.densities[theme.density] ?? AERIS_DEFAULT_THEME.densities["medium"];
1042
1101
  }
1043
1102
  function resolveAerisRadius(theme) {
1044
- return theme.radii[theme.radius] ?? AERIS_DEFAULT_THEME.radii['rounded'];
1103
+ return theme.radii[theme.radius] ?? AERIS_DEFAULT_THEME.radii["rounded"];
1045
1104
  }
1046
- function mergeAerisSemanticTones(current, updates) {
1047
- if (!current && !updates)
1048
- return undefined;
1049
- return Object.fromEntries(AERIS_SEMANTIC_TONE_NAMES.map((name) => [
1050
- name,
1051
- {
1052
- ...current?.[name],
1053
- ...updates?.[name],
1054
- },
1055
- ]));
1105
+ function mergeScheme(current, update = {}) {
1106
+ const tones = { ...current.tones };
1107
+ for (const name of AERIS_SEMANTIC_TONE_NAMES) {
1108
+ if (!Object.hasOwn(update.tones ?? {}, name)) continue;
1109
+ const tone = update.tones?.[name];
1110
+ if (tone === void 0) delete tones[name];
1111
+ else if (tone === null) tones[name] = null;
1112
+ else {
1113
+ const merged = {
1114
+ ...current.tones?.[name],
1115
+ ...tone
1116
+ };
1117
+ for (const key of Object.keys(merged)) if (merged[key] === void 0) delete merged[key];
1118
+ tones[name] = merged;
1119
+ }
1120
+ }
1121
+ const scheme = {
1122
+ ...current,
1123
+ ...update,
1124
+ tones
1125
+ };
1126
+ for (const key of Object.keys(scheme)) if (scheme[key] === void 0) delete scheme[key];
1127
+ return scheme;
1056
1128
  }
1057
- function normalizeAerisPalette(palette) {
1058
- if (!palette)
1059
- return {};
1060
- const surface = palette.surface ?? palette.mist;
1061
- const primary = palette.primary ?? palette.sage;
1062
- const secondary = palette.secondary ?? palette.cloud;
1063
- const accent = palette.accent ?? palette.sand;
1064
- const contrast = palette.contrast ?? palette.umber;
1065
- return {
1066
- ...palette,
1067
- ...(surface ? { surface, mist: surface } : {}),
1068
- ...(primary ? { primary, sage: primary } : {}),
1069
- ...(secondary ? { secondary, cloud: secondary } : {}),
1070
- ...(accent ? { accent, sand: accent } : {}),
1071
- ...(contrast ? { contrast, umber: contrast } : {}),
1072
- };
1129
+ function mergePalette(current, update) {
1130
+ const palette = { ...current };
1131
+ for (const key of Object.keys(current)) {
1132
+ const value = update?.[key];
1133
+ if (value !== void 0) palette[key] = value;
1134
+ }
1135
+ return palette;
1073
1136
  }
1074
-
1075
1137
  const FOUNDATION_TOKENS = [
1076
- ['page', '--aeris-page'],
1077
- ['surface', '--aeris-surface'],
1078
- ['surface2', '--aeris-surface-2'],
1079
- ['surface3', '--aeris-surface-3'],
1080
- ['interactiveHover', '--aeris-interactive-hover'],
1081
- ['text', '--aeris-text'],
1082
- ['text2', '--aeris-text-2'],
1083
- ['text3', '--aeris-text-3'],
1084
- ['border', '--aeris-border'],
1085
- ['borderStrong', '--aeris-border-strong'],
1086
- ['focus', '--aeris-focus'],
1138
+ ["page", "--aeris-page"],
1139
+ ["surface", "--aeris-surface"],
1140
+ ["surface2", "--aeris-surface-2"],
1141
+ ["surface3", "--aeris-surface-3"],
1142
+ ["interactiveHover", "--aeris-interactive-hover"],
1143
+ ["text", "--aeris-text"],
1144
+ ["text2", "--aeris-text-2"],
1145
+ ["text3", "--aeris-text-3"],
1146
+ ["border", "--aeris-border"],
1147
+ ["borderStrong", "--aeris-border-strong"],
1148
+ ["focus", "--aeris-focus"]
1087
1149
  ];
1088
1150
  const DENSITY_TOKENS = [
1089
- ['controlHeight', '--aeris-control-height'],
1090
- ['controlPaddingX', '--aeris-control-padding-x'],
1091
- ['itemHeight', '--aeris-item-height'],
1092
- ['itemPaddingY', '--aeris-item-padding-y'],
1093
- ['itemPaddingX', '--aeris-item-padding-x'],
1094
- ['gap', '--aeris-density-gap'],
1095
- ['iconSize', '--aeris-icon-size'],
1151
+ ["controlHeight", "--aeris-control-height"],
1152
+ ["controlPaddingX", "--aeris-control-padding-x"],
1153
+ ["itemHeight", "--aeris-item-height"],
1154
+ ["itemPaddingY", "--aeris-item-padding-y"],
1155
+ ["itemPaddingX", "--aeris-item-padding-x"],
1156
+ ["gap", "--aeris-density-gap"],
1157
+ ["iconSize", "--aeris-icon-size"]
1096
1158
  ];
1097
1159
  const RADIUS_TOKENS = [
1098
- ['sm', '--aeris-radius-sm'],
1099
- ['md', '--aeris-radius-md'],
1100
- ['lg', '--aeris-radius-lg'],
1101
- ['xl', '--aeris-radius-xl'],
1102
- ['control', '--aeris-radius-control'],
1103
- ['pill', '--aeris-radius-pill'],
1160
+ ["sm", "--aeris-radius-sm"],
1161
+ ["md", "--aeris-radius-md"],
1162
+ ["lg", "--aeris-radius-lg"],
1163
+ ["xl", "--aeris-radius-xl"],
1164
+ ["control", "--aeris-radius-control"],
1165
+ ["pill", "--aeris-radius-pill"]
1104
1166
  ];
1105
- /** Resolves the ordered CSS custom properties used by runtime and generated Aeris themes. */
1106
1167
  function resolveAerisThemeTokens(theme, mode) {
1107
- const tokens = {};
1108
- for (const [name, value] of Object.entries(theme.palette)) {
1109
- tokens[`--aeris-palette-${name}`] = value;
1110
- }
1111
- const foundation = resolveAerisFoundation(theme, mode);
1112
- for (const [property, token] of FOUNDATION_TOKENS) {
1113
- tokens[token] = foundation[property];
1114
- }
1115
- tokens['--aeris-accent'] = theme[mode].accent ?? theme.palette.accent;
1116
- if (theme[mode].shadowXs)
1117
- tokens['--aeris-shadow-xs'] = theme[mode].shadowXs;
1118
- if (theme[mode].shadowSm)
1119
- tokens['--aeris-shadow-sm'] = theme[mode].shadowSm;
1120
- const tones = resolveAerisSemanticTones(theme, mode);
1121
- for (const name of AERIS_SEMANTIC_TONE_NAMES) {
1122
- const tone = tones[name];
1123
- tokens[`--aeris-${name}`] = tone.base;
1124
- tokens[`--aeris-${name}-boundary`] = tone.boundary;
1125
- tokens[`--aeris-${name}-hover`] = tone.hover;
1126
- tokens[`--aeris-${name}-active`] = tone.active;
1127
- tokens[`--aeris-on-${name}`] = tone.onBase;
1128
- tokens[`--aeris-on-${name}-hover`] = tone.onHover;
1129
- tokens[`--aeris-on-${name}-active`] = tone.onActive;
1130
- tokens[`--aeris-${name}-text`] = tone.text;
1131
- tokens[`--aeris-${name}-soft`] = tone.soft;
1132
- tokens[`--aeris-on-${name}-soft`] = tone.onSoft;
1133
- tokens[`--aeris-${name}-contrast`] = tone.onBase;
1134
- }
1135
- tokens['--aeris-primary-contrast'] = tones.primary.onBase;
1136
- const density = resolveAerisDensity(theme);
1137
- for (const [property, token] of DENSITY_TOKENS) {
1138
- const value = density[property];
1139
- if (value)
1140
- tokens[token] = value;
1141
- }
1142
- const radius = resolveAerisRadius(theme);
1143
- for (const [property, token] of RADIUS_TOKENS) {
1144
- const value = radius[property];
1145
- if (value)
1146
- tokens[token] = value;
1147
- }
1148
- return tokens;
1149
- }
1150
-
1151
- class AerisThemeGenerationError extends Error {
1152
- issues;
1153
- constructor(issues) {
1154
- super(`Aeris theme generation failed with ${issues.length} issue${issues.length === 1 ? '' : 's'}.`);
1155
- this.name = 'AerisThemeGenerationError';
1156
- this.issues = issues;
1157
- }
1168
+ const tokens = {};
1169
+ const scheme = resolveAerisThemeScheme(theme, mode);
1170
+ for (const [name, value] of Object.entries(theme.palette)) tokens[`--aeris-palette-${name}`] = value;
1171
+ const foundation = resolveAerisFoundation(theme, mode);
1172
+ for (const [property, token] of FOUNDATION_TOKENS) tokens[token] = foundation[property];
1173
+ tokens["--aeris-accent"] = scheme.accent ?? theme.palette.accent;
1174
+ tokens["--aeris-shadow-xs"] = scheme.shadowXs ?? (mode === "light" ? "0 1px 2px rgb(0 0 0 / 8%)" : "0 1px 2px rgb(0 0 0 / 40%)");
1175
+ tokens["--aeris-shadow-sm"] = scheme.shadowSm ?? (mode === "light" ? "0 2px 8px rgb(0 0 0 / 10%)" : "0 2px 8px rgb(0 0 0 / 48%)");
1176
+ tokens["--aeris-shadow-md"] = scheme.shadowMd ?? (mode === "light" ? "0 8px 24px rgb(0 0 0 / 12%)" : "0 10px 28px rgb(0 0 0 / 54%)");
1177
+ tokens["--aeris-shadow-lg"] = scheme.shadowLg ?? (mode === "light" ? "0 18px 48px rgb(0 0 0 / 16%)" : "0 20px 56px rgb(0 0 0 / 64%)");
1178
+ const tones = resolveAerisSemanticTones(theme, mode);
1179
+ for (const name of AERIS_SEMANTIC_TONE_NAMES) {
1180
+ const tone = tones[name];
1181
+ tokens[`--aeris-${name}`] = tone.base;
1182
+ tokens[`--aeris-${name}-boundary`] = tone.boundary;
1183
+ tokens[`--aeris-${name}-hover`] = tone.hover;
1184
+ tokens[`--aeris-${name}-active`] = tone.active;
1185
+ tokens[`--aeris-on-${name}`] = tone.onBase;
1186
+ tokens[`--aeris-on-${name}-hover`] = tone.onHover;
1187
+ tokens[`--aeris-on-${name}-active`] = tone.onActive;
1188
+ tokens[`--aeris-${name}-text`] = tone.text;
1189
+ tokens[`--aeris-${name}-soft`] = tone.soft;
1190
+ tokens[`--aeris-on-${name}-soft`] = tone.onSoft;
1191
+ tokens[`--aeris-${name}-contrast`] = tone.onBase;
1192
+ }
1193
+ tokens["--aeris-primary-contrast"] = tones.primary.onBase;
1194
+ const density = resolveAerisDensity(theme);
1195
+ for (const [property, token] of DENSITY_TOKENS) {
1196
+ const value = density[property];
1197
+ if (value) tokens[token] = value;
1198
+ }
1199
+ const radius = resolveAerisRadius(theme);
1200
+ for (const [property, token] of RADIUS_TOKENS) {
1201
+ const value = radius[property];
1202
+ if (value) tokens[token] = value;
1203
+ }
1204
+ return tokens;
1158
1205
  }
1159
- const DEFAULT_SELECTOR = ':root';
1160
- const GENERATED_BANNER = `/*! Generated by Aeris UI; color derivation v${AERIS_COLOR_DERIVATION_VERSION}. Edit the theme source, not this file. */`;
1161
- /** Resolves, validates, and serializes a complete Aeris theme into deterministic CSS. */
1162
- function compileAerisTheme(themeOverride = {}, options = {}) {
1163
- const selector = options.selector?.trim() || DEFAULT_SELECTOR;
1164
- const generation = resolveGenerationOptions(options);
1165
- const theme = resolveAerisTheme(themeOverride);
1166
- const lightTokens = resolveAerisThemeTokens(theme, 'light');
1167
- const darkTokens = resolveAerisThemeTokens(theme, 'dark');
1168
- const contrast = {
1169
- light: auditAerisThemeContrast(theme, 'light'),
1170
- dark: auditAerisThemeContrast(theme, 'dark'),
1171
- };
1172
- const issues = [
1173
- ...validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation),
1174
- ];
1175
- if (options.expectedDerivationVersion !== undefined &&
1176
- options.expectedDerivationVersion !== AERIS_COLOR_DERIVATION_VERSION) {
1177
- issues.unshift({
1178
- code: 'derivation-version-mismatch',
1179
- message: `This configuration expects color derivation v${options.expectedDerivationVersion}, but the installed Aeris package provides v${AERIS_COLOR_DERIVATION_VERSION}. Review the theme changes, then update the configured derivation version before regenerating CSS.`,
1180
- });
1181
- }
1182
- if (issues.length)
1183
- throw new AerisThemeGenerationError(issues);
1184
- return {
1185
- derivationVersion: AERIS_COLOR_DERIVATION_VERSION,
1186
- css: serializeThemeCss(lightTokens, darkTokens, selector, options, generation),
1187
- theme,
1188
- lightTokens,
1189
- darkTokens,
1190
- contrast,
1191
- };
1206
+ var AerisThemeGenerationError = class extends Error {
1207
+ issues;
1208
+ constructor(issues) {
1209
+ super(`Aeris theme generation failed with ${issues.length} issue${issues.length === 1 ? "" : "s"}.`);
1210
+ this.name = "AerisThemeGenerationError";
1211
+ this.issues = issues;
1212
+ }
1213
+ };
1214
+ const DEFAULT_SELECTOR = ":root";
1215
+ const GENERATED_BANNER = `/*! Generated by Aeris UI; color derivation v2. Edit the theme source, not this file. */`;
1216
+ function compileAerisTheme(themeOverride, options = {}) {
1217
+ const selector = options.selector?.trim() || DEFAULT_SELECTOR;
1218
+ const generation = resolveGenerationOptions(options);
1219
+ const theme = resolveAerisTheme(themeOverride);
1220
+ const lightTokens = resolveAerisThemeTokens(theme, "light");
1221
+ const darkTokens = resolveAerisThemeTokens(theme, "dark");
1222
+ const contrast = {
1223
+ light: auditAerisThemeContrast(theme, "light"),
1224
+ dark: auditAerisThemeContrast(theme, "dark")
1225
+ };
1226
+ const issues = [...validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation)];
1227
+ if (options.expectedDerivationVersion !== void 0 && options.expectedDerivationVersion !== 2) issues.unshift({
1228
+ code: "derivation-version-mismatch",
1229
+ message: `This configuration expects color derivation v${options.expectedDerivationVersion}, but the installed Aeris package provides v2. Review the theme changes, then update the configured derivation version before regenerating CSS.`
1230
+ });
1231
+ if (issues.length) throw new AerisThemeGenerationError(issues);
1232
+ return {
1233
+ derivationVersion: 2,
1234
+ css: serializeThemeCss(lightTokens, darkTokens, selector, options, generation),
1235
+ theme,
1236
+ lightTokens,
1237
+ darkTokens,
1238
+ contrast
1239
+ };
1192
1240
  }
1193
- /** Convenience API for callers that only need the generated stylesheet. */
1194
- function generateAerisThemeCss(themeOverride = {}, options = {}) {
1195
- return compileAerisTheme(themeOverride, options).css;
1241
+ function generateAerisThemeCss(themeOverride, options = {}) {
1242
+ return compileAerisTheme(themeOverride, options).css;
1196
1243
  }
1197
1244
  function validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation) {
1198
- const issues = [];
1199
- if (!isSafeSelector(selector)) {
1200
- issues.push({
1201
- code: 'invalid-selector',
1202
- message: 'selector must be one non-empty CSS selector without commas, braces, or semicolons.',
1203
- });
1204
- }
1205
- if (!generation.valid) {
1206
- issues.push({
1207
- code: 'invalid-default-mode',
1208
- message: generation.message,
1209
- });
1210
- }
1211
- if (!theme.densities[theme.density]) {
1212
- issues.push({
1213
- code: 'invalid-density',
1214
- message: `The density preset "${theme.density}" is not defined in theme.densities.`,
1215
- });
1216
- }
1217
- if (!theme.radii[theme.radius]) {
1218
- issues.push({
1219
- code: 'invalid-radius',
1220
- message: `The radius preset "${theme.radius}" is not defined in theme.radii.`,
1221
- });
1222
- }
1223
- const modes = generation.schemes === 'both'
1224
- ? [
1225
- ['light', lightTokens],
1226
- ['dark', darkTokens],
1227
- ]
1228
- : [
1229
- [generation.schemes, generation.schemes === 'light' ? lightTokens : darkTokens],
1230
- ];
1231
- for (const [mode, tokens] of modes) {
1232
- for (const [token, value] of Object.entries(tokens)) {
1233
- if (!isSafeCssValue$1(value)) {
1234
- issues.push({
1235
- code: 'invalid-css-value',
1236
- message: `${token} contains characters that cannot be emitted safely.`,
1237
- mode,
1238
- token,
1239
- });
1240
- }
1241
- }
1242
- if (generation.validateContrast) {
1243
- for (const check of contrast[mode].checks) {
1244
- if (check.status === 'fail') {
1245
- issues.push({
1246
- code: 'contrast-failed',
1247
- message: `${check.label} is ${check.ratio?.toFixed(2)}:1; ${check.requiredRatio}:1 is required.`,
1248
- mode,
1249
- });
1250
- }
1251
- else if (check.status === 'unresolved') {
1252
- issues.push({
1253
- code: 'contrast-unresolved',
1254
- message: `${check.label} could not be evaluated from static colors.`,
1255
- mode,
1256
- });
1257
- }
1258
- }
1259
- }
1260
- }
1261
- return issues;
1245
+ const issues = [];
1246
+ if (![
1247
+ "monochrome",
1248
+ "earth",
1249
+ "coastal",
1250
+ "orchid"
1251
+ ].includes(theme.preset)) issues.push({
1252
+ code: "invalid-preset",
1253
+ message: "Choose monochrome, earth, coastal, or orchid as the theme preset."
1254
+ });
1255
+ if (!isSafeSelector(selector)) issues.push({
1256
+ code: "invalid-selector",
1257
+ message: "selector must be one non-empty CSS selector without commas, braces, or semicolons."
1258
+ });
1259
+ if (!generation.valid) issues.push({
1260
+ code: "invalid-default-mode",
1261
+ message: generation.message
1262
+ });
1263
+ if (!theme.densities[theme.density]) issues.push({
1264
+ code: "invalid-density",
1265
+ message: `The density preset "${theme.density}" is not defined in theme.densities.`
1266
+ });
1267
+ if (!theme.radii[theme.radius]) issues.push({
1268
+ code: "invalid-radius",
1269
+ message: `The radius preset "${theme.radius}" is not defined in theme.radii.`
1270
+ });
1271
+ const modes = generation.schemes === "both" ? [["light", lightTokens], ["dark", darkTokens]] : [[generation.schemes, generation.schemes === "light" ? lightTokens : darkTokens]];
1272
+ for (const [mode, tokens] of modes) {
1273
+ for (const [token, value] of Object.entries(tokens)) if (!isSafeCssValue$1(value)) issues.push({
1274
+ code: "invalid-css-value",
1275
+ message: `${token} contains characters that cannot be emitted safely.`,
1276
+ mode,
1277
+ token
1278
+ });
1279
+ if (generation.validateContrast) {
1280
+ for (const check of contrast[mode].checks) if (check.status === "fail") issues.push({
1281
+ code: "contrast-failed",
1282
+ message: `${check.label} is ${check.ratio?.toFixed(2)}:1; ${check.requiredRatio}:1 is required.`,
1283
+ mode
1284
+ });
1285
+ else if (check.status === "unresolved") issues.push({
1286
+ code: "contrast-unresolved",
1287
+ message: `${check.label} could not be evaluated from static colors.`,
1288
+ mode
1289
+ });
1290
+ }
1291
+ }
1292
+ return issues;
1262
1293
  }
1263
1294
  function serializeThemeCss(lightTokens, darkTokens, selector, options, generation) {
1264
- if (generation.schemes !== 'both') {
1265
- const mode = generation.schemes;
1266
- const tokens = Object.entries(mode === 'light' ? lightTokens : darkTokens);
1267
- const rule = formatRule([selector], tokens, mode, options.minify ?? false);
1268
- return finalizeCss([rule], options);
1269
- }
1270
- const includeSystemMode = generation.includeSystemMode;
1271
- const common = [];
1272
- const light = [];
1273
- const dark = [];
1274
- for (const [token, lightValue] of Object.entries(lightTokens)) {
1275
- const darkValue = darkTokens[token];
1276
- if (darkValue === lightValue)
1277
- common.push([token, lightValue]);
1278
- else
1279
- light.push([token, lightValue]);
1280
- }
1281
- for (const [token, darkValue] of Object.entries(darkTokens)) {
1282
- if (!(token in lightTokens))
1283
- dark.push([token, darkValue]);
1284
- else if (lightTokens[token] !== darkValue) {
1285
- dark.push([token, darkValue]);
1286
- }
1287
- }
1288
- const lightSelectors = [`${selector}[data-aeris-theme='light']`];
1289
- const darkSelectors = [`${selector}[data-aeris-theme='dark']`];
1290
- if (generation.defaultMode === 'light' || generation.defaultMode === 'system') {
1291
- lightSelectors.unshift(selector);
1292
- }
1293
- else {
1294
- darkSelectors.unshift(selector);
1295
- }
1296
- if (includeSystemMode)
1297
- lightSelectors.push(`${selector}[data-aeris-theme='system']`);
1298
- const rules = [
1299
- formatRule([selector], common, undefined, options.minify ?? false),
1300
- formatRule(lightSelectors, light, 'light', options.minify ?? false),
1301
- formatRule(darkSelectors, dark, 'dark', options.minify ?? false),
1302
- ];
1303
- if (includeSystemMode) {
1304
- const systemSelectors = [`${selector}[data-aeris-theme='system']`];
1305
- if (generation.defaultMode === 'system') {
1306
- systemSelectors.unshift(`${selector}:not([data-aeris-theme])`);
1307
- }
1308
- const systemRule = formatRule(systemSelectors, dark, 'dark', options.minify ?? false);
1309
- rules.push(formatMediaRule(systemRule, options.minify ?? false));
1310
- }
1311
- return finalizeCss(rules, options);
1295
+ if (generation.schemes !== "both") {
1296
+ const mode = generation.schemes;
1297
+ const tokens = Object.entries(mode === "light" ? lightTokens : darkTokens);
1298
+ return finalizeCss([formatRule([selector], tokens, mode, options.minify ?? false)], options);
1299
+ }
1300
+ const includeSystemMode = generation.includeSystemMode;
1301
+ const common = [];
1302
+ const light = [];
1303
+ const dark = [];
1304
+ for (const [token, lightValue] of Object.entries(lightTokens)) if (darkTokens[token] === lightValue) common.push([token, lightValue]);
1305
+ else light.push([token, lightValue]);
1306
+ for (const [token, darkValue] of Object.entries(darkTokens)) if (!(token in lightTokens)) dark.push([token, darkValue]);
1307
+ else if (lightTokens[token] !== darkValue) dark.push([token, darkValue]);
1308
+ const lightSelectors = [`${selector}[data-aeris-theme='light']`];
1309
+ const darkSelectors = [`${selector}[data-aeris-theme='dark']`];
1310
+ if (generation.defaultMode === "light" || generation.defaultMode === "system") lightSelectors.unshift(selector);
1311
+ else darkSelectors.unshift(selector);
1312
+ if (includeSystemMode) lightSelectors.push(`${selector}[data-aeris-theme='system']`);
1313
+ const rules = [
1314
+ formatRule([selector], common, void 0, options.minify ?? false),
1315
+ formatRule(lightSelectors, light, "light", options.minify ?? false),
1316
+ formatRule(darkSelectors, dark, "dark", options.minify ?? false)
1317
+ ];
1318
+ if (includeSystemMode) {
1319
+ const systemSelectors = [`${selector}[data-aeris-theme='system']`];
1320
+ if (generation.defaultMode === "system") systemSelectors.unshift(`${selector}:not([data-aeris-theme])`);
1321
+ const systemRule = formatRule(systemSelectors, dark, "dark", options.minify ?? false);
1322
+ rules.push(formatMediaRule(systemRule, options.minify ?? false));
1323
+ }
1324
+ return finalizeCss(rules, options);
1312
1325
  }
1313
1326
  function finalizeCss(rules, options) {
1314
- const minify = options.minify ?? false;
1315
- const banner = options.banner ?? true;
1316
- const output = rules.filter(Boolean).join(minify ? '' : '\n\n');
1317
- if (minify || !banner)
1318
- return `${output}${minify ? '' : '\n'}`;
1319
- return `${GENERATED_BANNER}\n${output}\n`;
1327
+ const minify = options.minify ?? false;
1328
+ const banner = options.banner ?? true;
1329
+ const output = rules.filter(Boolean).join(minify ? "" : "\n\n");
1330
+ if (minify || !banner) return `${output}${minify ? "" : "\n"}`;
1331
+ return `${GENERATED_BANNER}\n${output}\n`;
1320
1332
  }
1321
1333
  function resolveGenerationOptions(options) {
1322
- const schemes = options.schemes ?? 'both';
1323
- const validSchemes = schemes === 'both' || schemes === 'light' || schemes === 'dark';
1324
- const includeSystemMode = schemes === 'both' && (options.includeSystemMode ?? true);
1325
- const validateContrast = options.validateContrast ?? true;
1326
- const defaultMode = options.defaultMode ??
1327
- (schemes === 'both' ? (includeSystemMode ? 'system' : 'light') : schemes);
1328
- const validDefaultMode = defaultMode === 'system' || defaultMode === 'light' || defaultMode === 'dark';
1329
- const valid = validSchemes &&
1330
- validDefaultMode &&
1331
- ((schemes === 'both' && (defaultMode !== 'system' || includeSystemMode)) ||
1332
- schemes === defaultMode);
1333
- return {
1334
- schemes,
1335
- defaultMode,
1336
- includeSystemMode,
1337
- validateContrast,
1338
- valid,
1339
- message: !validSchemes
1340
- ? 'schemes must be "both", "light", or "dark".'
1341
- : !validDefaultMode
1342
- ? 'defaultMode must be "system", "light", or "dark".'
1343
- : schemes === 'both'
1344
- ? 'defaultMode="system" requires system-mode generation to be enabled.'
1345
- : `defaultMode must be "${schemes}" when only the ${schemes} scheme is generated.`,
1346
- };
1334
+ const schemes = options.schemes ?? "both";
1335
+ const validSchemes = schemes === "both" || schemes === "light" || schemes === "dark";
1336
+ const includeSystemMode = schemes === "both" && (options.includeSystemMode ?? true);
1337
+ const validateContrast = options.validateContrast ?? true;
1338
+ const defaultMode = options.defaultMode ?? (schemes === "both" ? includeSystemMode ? "system" : "light" : schemes);
1339
+ const validDefaultMode = defaultMode === "system" || defaultMode === "light" || defaultMode === "dark";
1340
+ return {
1341
+ schemes,
1342
+ defaultMode,
1343
+ includeSystemMode,
1344
+ validateContrast,
1345
+ valid: validSchemes && validDefaultMode && (schemes === "both" && (defaultMode !== "system" || includeSystemMode) || schemes === defaultMode),
1346
+ message: !validSchemes ? "schemes must be \"both\", \"light\", or \"dark\"." : !validDefaultMode ? "defaultMode must be \"system\", \"light\", or \"dark\"." : schemes === "both" ? "defaultMode=\"system\" requires system-mode generation to be enabled." : `defaultMode must be "${schemes}" when only the ${schemes} scheme is generated.`
1347
+ };
1347
1348
  }
1348
1349
  function formatRule(selectors, tokens, colorScheme, minify) {
1349
- if (!tokens.length && !colorScheme)
1350
- return '';
1351
- if (minify) {
1352
- const declarations = [
1353
- ...(colorScheme ? [`color-scheme:${colorScheme}`] : []),
1354
- ...tokens.map(([token, value]) => `${token}:${value}`),
1355
- ];
1356
- return `${selectors.join(',')}{${declarations.join(';')}}`;
1357
- }
1358
- const declarations = [
1359
- ...(colorScheme ? [` color-scheme: ${colorScheme};`] : []),
1360
- ...tokens.map(([token, value]) => ` ${token}: ${value};`),
1361
- ];
1362
- return `${selectors.join(',\n')} {\n${declarations.join('\n')}\n}`;
1350
+ if (!tokens.length && !colorScheme) return "";
1351
+ if (minify) {
1352
+ const declarations = [...colorScheme ? [`color-scheme:${colorScheme}`] : [], ...tokens.map(([token, value]) => `${token}:${value}`)];
1353
+ return `${selectors.join(",")}{${declarations.join(";")}}`;
1354
+ }
1355
+ const declarations = [...colorScheme ? [` color-scheme: ${colorScheme};`] : [], ...tokens.map(([token, value]) => ` ${token}: ${value};`)];
1356
+ return `${selectors.join(",\n")} {\n${declarations.join("\n")}\n}`;
1363
1357
  }
1364
1358
  function formatMediaRule(rule, minify) {
1365
- if (minify)
1366
- return `@media(prefers-color-scheme:dark){${rule}}`;
1367
- return `@media (prefers-color-scheme: dark) {\n${rule
1368
- .split('\n')
1369
- .map((line) => ` ${line}`)
1370
- .join('\n')}\n}`;
1359
+ if (minify) return `@media(prefers-color-scheme:dark){${rule}}`;
1360
+ return `@media (prefers-color-scheme: dark) {\n${rule.split("\n").map((line) => ` ${line}`).join("\n")}\n}`;
1371
1361
  }
1372
1362
  function isSafeSelector(selector) {
1373
- return selector.length > 0 && !/[{},;\r\n]/.test(selector);
1363
+ return selector.length > 0 && !/[{},;\r\n]/.test(selector);
1374
1364
  }
1375
1365
  function isSafeCssValue$1(value) {
1376
- return value.length > 0 && !/[;{}\r\n]/.test(value);
1366
+ return value.length > 0 && !/[;{}\r\n]/.test(value);
1377
1367
  }
1378
-
1379
1368
  const SCHEME_COLOR_PROPERTIES = [
1380
- 'accent',
1381
- 'page',
1382
- 'surface',
1383
- 'surface2',
1384
- 'surface3',
1385
- 'interactiveHover',
1386
- 'text',
1387
- 'text2',
1388
- 'text3',
1389
- 'border',
1390
- 'borderStrong',
1391
- 'focus',
1369
+ "accent",
1370
+ "page",
1371
+ "surface",
1372
+ "surface2",
1373
+ "surface3",
1374
+ "interactiveHover",
1375
+ "text",
1376
+ "text2",
1377
+ "text3",
1378
+ "border",
1379
+ "borderStrong",
1380
+ "focus"
1392
1381
  ];
1393
1382
  const TONE_PROPERTIES = [
1394
- 'base',
1395
- 'boundary',
1396
- 'hover',
1397
- 'active',
1398
- 'onBase',
1399
- 'onHover',
1400
- 'onActive',
1401
- 'text',
1402
- 'soft',
1403
- 'onSoft',
1383
+ "base",
1384
+ "boundary",
1385
+ "hover",
1386
+ "active",
1387
+ "onBase",
1388
+ "onHover",
1389
+ "onActive",
1390
+ "text",
1391
+ "soft",
1392
+ "onSoft"
1404
1393
  ];
1405
- /**
1406
- * Validates a runtime or build-time theme without reading the DOM.
1407
- *
1408
- * Errors identify values Aeris cannot safely apply or accessibility checks
1409
- * known to fail. Warnings identify colors that require rendered/manual review.
1410
- */
1411
- function validateAerisTheme(themeOverride = {}) {
1412
- const theme = resolveAerisTheme(themeOverride);
1413
- const issues = [];
1414
- validateThemeSelection(theme, issues);
1415
- const values = collectThemeCssValues(theme);
1416
- let canAuditColors = true;
1417
- for (const entry of values) {
1418
- if (isSafeCssValue(entry.value))
1419
- continue;
1420
- if (entry.affectsColorResolution)
1421
- canAuditColors = false;
1422
- issues.push({
1423
- code: 'invalid-css-value',
1424
- severity: 'error',
1425
- path: entry.path,
1426
- message: `${entry.path} must be a non-empty CSS value without braces, semicolons, or line breaks.`,
1427
- guidance: 'Replace it with a valid CSS color, length, radius, or shadow value.',
1428
- });
1429
- }
1430
- if (canAuditColors) {
1431
- for (const mode of ['light', 'dark']) {
1432
- const contrast = auditAerisThemeContrast(theme, mode);
1433
- for (const check of contrast.checks) {
1434
- if (check.status === 'pass')
1435
- continue;
1436
- const unresolved = check.status === 'unresolved';
1437
- issues.push({
1438
- code: unresolved ? 'contrast-unresolved' : 'contrast-failed',
1439
- severity: unresolved ? 'warning' : 'error',
1440
- mode,
1441
- path: `contrast.${mode}.${check.id}`,
1442
- ratio: check.ratio,
1443
- requiredRatio: check.requiredRatio,
1444
- message: unresolved
1445
- ? `${check.label} could not be evaluated from static colors.`
1446
- : `${check.label} is ${check.ratio?.toFixed(2)}:1; WCAG ${check.criterion} requires ${check.requiredRatio}:1.`,
1447
- guidance: unresolved
1448
- ? `${check.guidance} Static analysis supports opaque HEX, RGB, and HSL colors; verify CSS variables, named colors, and newer color functions in their rendered context.`
1449
- : check.guidance,
1450
- });
1451
- }
1452
- }
1453
- }
1454
- const errors = issues.filter(({ severity }) => severity === 'error');
1455
- const warnings = issues.filter(({ severity }) => severity === 'warning');
1456
- return {
1457
- status: errors.length ? 'error' : warnings.length ? 'warning' : 'valid',
1458
- valid: errors.length === 0,
1459
- issues,
1460
- errors,
1461
- warnings,
1462
- };
1394
+ function validateAerisTheme(themeOverride) {
1395
+ const theme = resolveAerisTheme(themeOverride);
1396
+ const issues = [];
1397
+ validateThemeSelection(theme, issues);
1398
+ const values = collectThemeCssValues(theme);
1399
+ let canAuditColors = true;
1400
+ for (const entry of values) {
1401
+ if (isSafeCssValue(entry.value)) continue;
1402
+ if (entry.affectsColorResolution) canAuditColors = false;
1403
+ issues.push({
1404
+ code: "invalid-css-value",
1405
+ severity: "error",
1406
+ path: entry.path,
1407
+ message: `${entry.path} must be a non-empty CSS value without braces, semicolons, or line breaks.`,
1408
+ guidance: "Replace it with a valid CSS color, length, radius, or shadow value."
1409
+ });
1410
+ }
1411
+ if (canAuditColors) for (const mode of ["light", "dark"]) {
1412
+ const contrast = auditAerisThemeContrast(theme, mode);
1413
+ for (const check of contrast.checks) {
1414
+ if (check.status === "pass") continue;
1415
+ const unresolved = check.status === "unresolved";
1416
+ issues.push({
1417
+ code: unresolved ? "contrast-unresolved" : "contrast-failed",
1418
+ severity: unresolved ? "warning" : "error",
1419
+ mode,
1420
+ path: `contrast.${mode}.${check.id}`,
1421
+ ratio: check.ratio,
1422
+ requiredRatio: check.requiredRatio,
1423
+ message: unresolved ? `${check.label} could not be evaluated from static colors.` : `${check.label} is ${check.ratio?.toFixed(2)}:1; WCAG ${check.criterion} requires ${check.requiredRatio}:1.`,
1424
+ guidance: unresolved ? `${check.guidance} Static analysis supports opaque HEX, RGB, and HSL colors; verify CSS variables, named colors, and newer color functions in their rendered context.` : check.guidance
1425
+ });
1426
+ }
1427
+ }
1428
+ const errors = issues.filter(({ severity }) => severity === "error");
1429
+ const warnings = issues.filter(({ severity }) => severity === "warning");
1430
+ return {
1431
+ status: errors.length ? "error" : warnings.length ? "warning" : "valid",
1432
+ valid: errors.length === 0,
1433
+ issues,
1434
+ errors,
1435
+ warnings
1436
+ };
1463
1437
  }
1464
1438
  function validateThemeSelection(theme, issues) {
1465
- if (theme.direction !== undefined && theme.direction !== 'ltr' && theme.direction !== 'rtl') {
1466
- issues.push({
1467
- code: 'invalid-direction',
1468
- severity: 'error',
1469
- path: 'direction',
1470
- message: `direction must be "ltr" or "rtl"; received "${String(theme.direction)}".`,
1471
- guidance: 'Use ltr for left-to-right content or rtl for right-to-left content.',
1472
- });
1473
- }
1474
- if (!theme.densities[theme.density]) {
1475
- issues.push({
1476
- code: 'missing-density',
1477
- severity: 'error',
1478
- path: 'density',
1479
- message: `The selected density "${theme.density}" is not registered in theme.densities.`,
1480
- guidance: 'Select a built-in density or register a scale with the same name.',
1481
- });
1482
- }
1483
- if (!theme.radii[theme.radius]) {
1484
- issues.push({
1485
- code: 'missing-radius',
1486
- severity: 'error',
1487
- path: 'radius',
1488
- message: `The selected radius "${theme.radius}" is not registered in theme.radii.`,
1489
- guidance: 'Select a built-in corner style or register a radius scale with the same name.',
1490
- });
1491
- }
1439
+ if (!Object.hasOwn(AERIS_THEME_PRESETS, theme.preset)) issues.push({
1440
+ code: "invalid-preset",
1441
+ severity: "error",
1442
+ path: "preset",
1443
+ message: `Unknown theme preset "${String(theme.preset)}".`,
1444
+ guidance: "Choose monochrome, earth, coastal, or orchid."
1445
+ });
1446
+ if (theme.direction !== void 0 && theme.direction !== "ltr" && theme.direction !== "rtl") issues.push({
1447
+ code: "invalid-direction",
1448
+ severity: "error",
1449
+ path: "direction",
1450
+ message: `direction must be "ltr" or "rtl"; received "${String(theme.direction)}".`,
1451
+ guidance: "Use ltr for left-to-right content or rtl for right-to-left content."
1452
+ });
1453
+ if (!theme.densities[theme.density]) issues.push({
1454
+ code: "missing-density",
1455
+ severity: "error",
1456
+ path: "density",
1457
+ message: `The selected density "${theme.density}" is not registered in theme.densities.`,
1458
+ guidance: "Select a built-in density or register a scale with the same name."
1459
+ });
1460
+ if (!theme.radii[theme.radius]) issues.push({
1461
+ code: "missing-radius",
1462
+ severity: "error",
1463
+ path: "radius",
1464
+ message: `The selected radius "${theme.radius}" is not registered in theme.radii.`,
1465
+ guidance: "Select a built-in corner style or register a radius scale with the same name."
1466
+ });
1492
1467
  }
1493
1468
  function collectThemeCssValues(theme) {
1494
- const values = [
1495
- cssValue('palette.surface', theme.palette.surface, true),
1496
- cssValue('palette.primary', theme.palette.primary, true),
1497
- cssValue('palette.secondary', theme.palette.secondary, true),
1498
- cssValue('palette.accent', theme.palette.accent, true),
1499
- cssValue('palette.contrast', theme.palette.contrast, true),
1500
- ];
1501
- for (const mode of ['light', 'dark']) {
1502
- const scheme = theme[mode];
1503
- for (const property of SCHEME_COLOR_PROPERTIES) {
1504
- const value = scheme[property];
1505
- if (value !== undefined)
1506
- values.push(cssValue(`${mode}.${property}`, value, true));
1507
- }
1508
- if (scheme.shadowXs !== undefined) {
1509
- values.push(cssValue(`${mode}.shadowXs`, scheme.shadowXs, false));
1510
- }
1511
- if (scheme.shadowSm !== undefined) {
1512
- values.push(cssValue(`${mode}.shadowSm`, scheme.shadowSm, false));
1513
- }
1514
- for (const toneName of AERIS_SEMANTIC_TONE_NAMES) {
1515
- const tone = scheme.tones?.[toneName];
1516
- if (!tone)
1517
- continue;
1518
- for (const property of TONE_PROPERTIES) {
1519
- const value = tone[property];
1520
- if (value !== undefined) {
1521
- values.push(cssValue(`${mode}.tones.${toneName}.${property}`, value, true));
1522
- }
1523
- }
1524
- }
1525
- }
1526
- for (const [name, scale] of Object.entries(theme.densities)) {
1527
- if (!isRecord(scale)) {
1528
- values.push(cssValue(`densities.${name}`, scale, false));
1529
- continue;
1530
- }
1531
- for (const [property, value] of Object.entries(scale)) {
1532
- values.push(cssValue(`densities.${name}.${property}`, value, false));
1533
- }
1534
- }
1535
- for (const [name, scale] of Object.entries(theme.radii)) {
1536
- if (!isRecord(scale)) {
1537
- values.push(cssValue(`radii.${name}`, scale, false));
1538
- continue;
1539
- }
1540
- for (const [property, value] of Object.entries(scale)) {
1541
- values.push(cssValue(`radii.${name}.${property}`, value, false));
1542
- }
1543
- }
1544
- return values;
1469
+ const values = [
1470
+ cssValue("palette.surface", theme.palette.surface, true),
1471
+ cssValue("palette.primary", theme.palette.primary, true),
1472
+ cssValue("palette.secondary", theme.palette.secondary, true),
1473
+ cssValue("palette.accent", theme.palette.accent, true),
1474
+ cssValue("palette.contrast", theme.palette.contrast, true)
1475
+ ];
1476
+ for (const mode of ["light", "dark"]) {
1477
+ const scheme = theme[mode];
1478
+ for (const property of SCHEME_COLOR_PROPERTIES) {
1479
+ const value = scheme[property];
1480
+ if (value !== void 0) values.push(cssValue(`${mode}.${property}`, value, true));
1481
+ }
1482
+ if (scheme.shadowXs !== void 0) values.push(cssValue(`${mode}.shadowXs`, scheme.shadowXs, false));
1483
+ if (scheme.shadowSm !== void 0) values.push(cssValue(`${mode}.shadowSm`, scheme.shadowSm, false));
1484
+ if (scheme.shadowMd !== void 0) values.push(cssValue(`${mode}.shadowMd`, scheme.shadowMd, false));
1485
+ if (scheme.shadowLg !== void 0) values.push(cssValue(`${mode}.shadowLg`, scheme.shadowLg, false));
1486
+ for (const toneName of AERIS_SEMANTIC_TONE_NAMES) {
1487
+ const tone = scheme.tones?.[toneName];
1488
+ if (!tone) continue;
1489
+ for (const property of TONE_PROPERTIES) {
1490
+ const value = tone[property];
1491
+ if (value !== void 0 && value !== null) values.push(cssValue(`${mode}.tones.${toneName}.${property}`, value, true));
1492
+ }
1493
+ }
1494
+ }
1495
+ for (const [name, scale] of Object.entries(theme.densities)) {
1496
+ if (!isRecord(scale)) {
1497
+ values.push(cssValue(`densities.${name}`, scale, false));
1498
+ continue;
1499
+ }
1500
+ for (const [property, value] of Object.entries(scale)) values.push(cssValue(`densities.${name}.${property}`, value, false));
1501
+ }
1502
+ for (const [name, scale] of Object.entries(theme.radii)) {
1503
+ if (!isRecord(scale)) {
1504
+ values.push(cssValue(`radii.${name}`, scale, false));
1505
+ continue;
1506
+ }
1507
+ for (const [property, value] of Object.entries(scale)) values.push(cssValue(`radii.${name}.${property}`, value, false));
1508
+ }
1509
+ return values;
1545
1510
  }
1546
1511
  function cssValue(path, value, affectsColorResolution) {
1547
- return { path, value, affectsColorResolution };
1512
+ return {
1513
+ path,
1514
+ value,
1515
+ affectsColorResolution
1516
+ };
1548
1517
  }
1549
1518
  function isSafeCssValue(value) {
1550
- return typeof value === 'string' && value.trim().length > 0 && !/[;{}\r\n]/.test(value);
1519
+ return typeof value === "string" && value.trim().length > 0 && !/[;{}\r\n]/.test(value);
1551
1520
  }
1552
1521
  function isRecord(value) {
1553
- return typeof value === 'object' && value !== null && !Array.isArray(value);
1522
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1554
1523
  }
1524
+ export { AERIS_COLOR_DERIVATION_VERSION, AERIS_DEFAULT_THEME, AERIS_DENSITY_PRESETS, AERIS_RADIUS_PRESETS, AERIS_SEMANTIC_TONE_NAMES, AERIS_THEME_PRESETS, AerisThemeGenerationError, aerisContrastRatio, aerisRgbContrastRatio, auditAerisThemeContrast, compileAerisTheme, formatAerisHex, generateAerisThemeCss, mergeAerisTheme, mixAerisColor, mixAerisRgb, parseAerisColor, resolveAerisDensity, resolveAerisFoundation, resolveAerisRadius, resolveAerisSemanticTones, resolveAerisTheme, resolveAerisThemeScheme, resolveAerisThemeTokens, validateAerisTheme };
1555
1525
 
1556
- /**
1557
- * Framework-independent Aeris theme compiler APIs for Node.js build scripts and browser tooling.
1558
- */
1559
-
1560
- /**
1561
- * Generated bundle index. Do not edit.
1562
- */
1563
-
1564
- export { AERIS_COLOR_DERIVATION_VERSION, AERIS_DEFAULT_THEME, AERIS_DENSITY_PRESETS, AERIS_RADIUS_PRESETS, AERIS_SEMANTIC_TONE_NAMES, AERIS_THEME_PRESETS, AerisThemeGenerationError, aerisContrastRatio, aerisRgbContrastRatio, auditAerisThemeContrast, compileAerisTheme, formatAerisHex, generateAerisThemeCss, mergeAerisTheme, mixAerisColor, mixAerisRgb, parseAerisColor, resolveAerisDensity, resolveAerisFoundation, resolveAerisRadius, resolveAerisSemanticTones, resolveAerisTheme, resolveAerisThemeTokens, validateAerisTheme };
1565
- //# sourceMappingURL=aeris-ui-core-theme-builder.mjs.map
1526
+ //# sourceMappingURL=aeris-ui-core-theme-builder.mjs.map