@aeris-ui/core 22.0.0-alpha.0 → 22.0.0-alpha.10

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