@nanahoshi/mona-ui 0.27.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/docs/api/auto-complete.md +67 -0
  2. package/docs/api/avatar.md +31 -0
  3. package/docs/api/breadcrumb.md +74 -0
  4. package/docs/api/button-group.md +71 -0
  5. package/docs/api/button.md +84 -0
  6. package/docs/api/calendar.md +123 -0
  7. package/docs/api/card.md +97 -0
  8. package/docs/api/chart.md +4380 -0
  9. package/docs/api/check-box.md +70 -0
  10. package/docs/api/chip.md +55 -0
  11. package/docs/api/circular-progress-bar.md +71 -0
  12. package/docs/api/collapsible.md +71 -0
  13. package/docs/api/color-gradient.md +54 -0
  14. package/docs/api/color-palette.md +52 -0
  15. package/docs/api/color-picker.md +89 -0
  16. package/docs/api/combo-box.md +69 -0
  17. package/docs/api/command.md +282 -0
  18. package/docs/api/common.md +599 -0
  19. package/docs/api/contextmenu.md +239 -0
  20. package/docs/api/date-input.md +119 -0
  21. package/docs/api/date-picker.md +67 -0
  22. package/docs/api/datetime-picker.md +72 -0
  23. package/docs/api/dialog.md +291 -0
  24. package/docs/api/dropdown-button.md +248 -0
  25. package/docs/api/dropdown-list.md +72 -0
  26. package/docs/api/dropdowns.md +172 -0
  27. package/docs/api/editor.md +117 -0
  28. package/docs/api/expansion-panel.md +85 -0
  29. package/docs/api/fieldset.md +33 -0
  30. package/docs/api/filter.md +116 -0
  31. package/docs/api/grid.md +1445 -0
  32. package/docs/api/i18n.md +1699 -0
  33. package/docs/api/label.md +58 -0
  34. package/docs/api/list-box.md +301 -0
  35. package/docs/api/list-view.md +294 -0
  36. package/docs/api/list.md +119 -0
  37. package/docs/api/locales.md +134 -0
  38. package/docs/api/menubar.md +275 -0
  39. package/docs/api/multi-select.md +92 -0
  40. package/docs/api/notification.md +164 -0
  41. package/docs/api/numeric-text-box.md +130 -0
  42. package/docs/api/otp-input.md +100 -0
  43. package/docs/api/pager.md +371 -0
  44. package/docs/api/placeholder.md +18 -0
  45. package/docs/api/popover.md +170 -0
  46. package/docs/api/popup-menu.md +328 -0
  47. package/docs/api/popup.md +299 -0
  48. package/docs/api/progress-bar.md +79 -0
  49. package/docs/api/query.md +367 -0
  50. package/docs/api/radio-button.md +113 -0
  51. package/docs/api/rating.md +187 -0
  52. package/docs/api/scroll-view.md +93 -0
  53. package/docs/api/segmented.md +114 -0
  54. package/docs/api/sheet.md +65 -0
  55. package/docs/api/sidebar.md +583 -0
  56. package/docs/api/skeleton.md +26 -0
  57. package/docs/api/slider.md +173 -0
  58. package/docs/api/spinner.md +132 -0
  59. package/docs/api/split-button.md +261 -0
  60. package/docs/api/splitter.md +57 -0
  61. package/docs/api/stepper.md +148 -0
  62. package/docs/api/switch.md +78 -0
  63. package/docs/api/tabs.md +139 -0
  64. package/docs/api/text-area.md +20 -0
  65. package/docs/api/text-box.md +106 -0
  66. package/docs/api/theme.md +627 -0
  67. package/docs/api/time-picker.md +69 -0
  68. package/docs/api/time-selector.md +54 -0
  69. package/docs/api/tooltip.md +112 -0
  70. package/docs/api/tree-view.md +631 -0
  71. package/docs/api/window.md +245 -0
  72. package/docs/auto-complete.md +28 -329
  73. package/docs/avatar.md +4 -24
  74. package/docs/breadcrumb.md +10 -65
  75. package/docs/button-group.md +7 -60
  76. package/docs/button.md +8 -67
  77. package/docs/calendar.md +16 -121
  78. package/docs/card.md +16 -79
  79. package/docs/chart-bar.md +16 -234
  80. package/docs/chart-financial.md +10 -121
  81. package/docs/chart-funnel.md +13 -176
  82. package/docs/chart-heatmap.md +15 -131
  83. package/docs/chart-line-area.md +12 -137
  84. package/docs/chart-pie.md +17 -221
  85. package/docs/chart-radar.md +13 -129
  86. package/docs/chart-radial.md +13 -211
  87. package/docs/chart-scatter.md +6 -74
  88. package/docs/chart-treemap.md +14 -196
  89. package/docs/chart.md +168 -1892
  90. package/docs/checkbox.md +5 -61
  91. package/docs/chip.md +7 -42
  92. package/docs/circular-progress-bar.md +9 -61
  93. package/docs/collapsible.md +5 -87
  94. package/docs/color-gradient.md +8 -81
  95. package/docs/color-palette.md +7 -69
  96. package/docs/color-picker.md +9 -105
  97. package/docs/combo-box.md +28 -331
  98. package/docs/command.md +25 -236
  99. package/docs/contextmenu.md +15 -140
  100. package/docs/date-picker.md +7 -110
  101. package/docs/datetime-picker.md +7 -129
  102. package/docs/decimal-textbox.md +6 -69
  103. package/docs/dialog.md +23 -263
  104. package/docs/dropdown-button.md +15 -146
  105. package/docs/dropdown-list.md +29 -332
  106. package/docs/editor.md +10 -164
  107. package/docs/expansion-panel.md +7 -69
  108. package/docs/fieldset.md +5 -24
  109. package/docs/grid-columns.md +12 -92
  110. package/docs/grid-editing.md +29 -291
  111. package/docs/grid-grouping.md +11 -50
  112. package/docs/grid-rows.md +10 -74
  113. package/docs/grid-selection.md +7 -36
  114. package/docs/grid-server.md +8 -293
  115. package/docs/grid-sorting-filtering.md +10 -333
  116. package/docs/grid-state-export.md +17 -228
  117. package/docs/grid.md +23 -216
  118. package/docs/input.md +7 -19
  119. package/docs/installation.md +147 -15
  120. package/docs/introduction.md +37 -15
  121. package/docs/label.md +8 -39
  122. package/docs/list-box.md +21 -253
  123. package/docs/list-view.md +25 -232
  124. package/docs/menubar.md +21 -167
  125. package/docs/multi-select.md +31 -350
  126. package/docs/notification.md +17 -116
  127. package/docs/numeric-textbox.md +9 -78
  128. package/docs/otp-input.md +9 -95
  129. package/docs/pager.md +19 -239
  130. package/docs/placeholder.md +5 -18
  131. package/docs/popover.md +13 -123
  132. package/docs/popup-menu.md +22 -243
  133. package/docs/popup.md +24 -248
  134. package/docs/progress-bar.md +10 -75
  135. package/docs/radio-button.md +8 -96
  136. package/docs/range-slider.md +9 -82
  137. package/docs/rating.md +15 -163
  138. package/docs/scroll-view.md +9 -86
  139. package/docs/segmented.md +8 -90
  140. package/docs/sheet.md +10 -74
  141. package/docs/sidebar-menus.md +20 -155
  142. package/docs/sidebar-state.md +16 -134
  143. package/docs/sidebar.md +18 -218
  144. package/docs/skeleton.md +5 -26
  145. package/docs/slider.md +9 -97
  146. package/docs/spinner.md +15 -95
  147. package/docs/split-button.md +21 -166
  148. package/docs/splitter.md +9 -56
  149. package/docs/stepper.md +13 -127
  150. package/docs/switch.md +8 -58
  151. package/docs/tabs.md +13 -111
  152. package/docs/textarea.md +4 -13
  153. package/docs/textbox.md +10 -77
  154. package/docs/theming-built-in-themes.md +67 -0
  155. package/docs/theming-custom-colors.md +274 -0
  156. package/docs/theming-custom-themes.md +168 -0
  157. package/docs/theming.md +164 -248
  158. package/docs/time-picker.md +7 -112
  159. package/docs/tooltip-directive.md +12 -96
  160. package/docs/tooltip.md +12 -96
  161. package/docs/tree-view.md +42 -495
  162. package/docs/window.md +19 -230
  163. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
  164. package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
  165. package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
  166. package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
  167. package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
  168. package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
  169. package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
  170. package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
  171. package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
  172. package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
  173. package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
  174. package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
  175. package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
  176. package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
  177. package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
  178. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
  179. package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
  180. package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
  181. package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
  182. package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
  183. package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
  184. package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
  185. package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
  186. package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
  187. package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
  188. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
  189. package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
  190. package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
  191. package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
  192. package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
  193. package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
  194. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
  195. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
  196. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
  197. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
  198. package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
  199. package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
  200. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
  201. package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
  202. package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
  203. package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
  204. package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
  205. package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
  206. package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
  207. package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
  208. package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
  209. package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
  210. package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
  211. package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
  212. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
  213. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
  214. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
  215. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
  216. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
  217. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
  218. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
  219. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
  220. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
  221. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
  222. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
  223. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
  224. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
  225. package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
  226. package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
  227. package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
  228. package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
  229. package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
  230. package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
  231. package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
  232. package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
  233. package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
  234. package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
  235. package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
  236. package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
  237. package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
  238. package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
  239. package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
  240. package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
  241. package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
  242. package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
  243. package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
  244. package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
  245. package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
  246. package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
  247. package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
  248. package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
  249. package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
  250. package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
  251. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
  252. package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
  253. package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
  254. package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
  255. package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
  256. package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
  257. package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
  258. package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
  259. package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
  260. package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
  261. package/llms.txt +80 -2
  262. package/package.json +62 -23
  263. package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
  264. package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
  265. package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
  266. package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
  267. package/types/nanahoshi-mona-ui-button.d.ts +227 -166
  268. package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
  269. package/types/nanahoshi-mona-ui-card.d.ts +125 -111
  270. package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
  271. package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
  272. package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
  273. package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
  274. package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
  275. package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
  276. package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
  277. package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
  278. package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
  279. package/types/nanahoshi-mona-ui-command.d.ts +279 -191
  280. package/types/nanahoshi-mona-ui-common.d.ts +360 -385
  281. package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
  282. package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
  283. package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
  284. package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
  285. package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
  286. package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
  287. package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
  288. package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
  289. package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
  290. package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
  291. package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
  292. package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
  293. package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
  294. package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
  295. package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
  296. package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
  297. package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
  298. package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
  299. package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
  300. package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
  301. package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
  302. package/types/nanahoshi-mona-ui-label.d.ts +108 -78
  303. package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
  304. package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
  305. package/types/nanahoshi-mona-ui-list.d.ts +2 -1
  306. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
  307. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
  308. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
  309. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
  310. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
  311. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
  312. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
  313. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
  314. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
  315. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
  316. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
  317. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
  318. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
  319. package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
  320. package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
  321. package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
  322. package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
  323. package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
  324. package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
  325. package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
  326. package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
  327. package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
  328. package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
  329. package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
  330. package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
  331. package/types/nanahoshi-mona-ui-query.d.ts +82 -88
  332. package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
  333. package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
  334. package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
  335. package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
  336. package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
  337. package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
  338. package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
  339. package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
  340. package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
  341. package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
  342. package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
  343. package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
  344. package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
  345. package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
  346. package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
  347. package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
  348. package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
  349. package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
  350. package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
  351. package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
  352. package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
  353. package/types/nanahoshi-mona-ui-window.d.ts +494 -399
  354. package/types/nanahoshi-mona-ui.d.ts +1 -2
  355. package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
  356. package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
  357. package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
  358. package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
  359. package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
@@ -1,1582 +1,1598 @@
1
- import * as i0 from '@angular/core';
2
- import { isDevMode, InjectionToken, inject, DOCUMENT, PLATFORM_ID, signal, DestroyRef, Injector, computed, Injectable, provideEnvironmentInitializer, makeEnvironmentProviders } from '@angular/core';
3
- import { converter, parse, wcagContrast, clampChroma } from 'culori';
4
- import { isPlatformBrowser } from '@angular/common';
5
-
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Injectable, InjectionToken, Injector, PLATFORM_ID, computed, inject, isDevMode, makeEnvironmentProviders, provideEnvironmentInitializer, signal } from "@angular/core";
3
+ import "culori/css";
4
+ import { clampChroma, converter, parse, wcagContrast } from "culori/fn";
5
+ import { isPlatformBrowser } from "@angular/common";
6
6
  function flattenThemeProfile(profile) {
7
- return {
8
- ...profile.colors,
9
- ...profile.shadows,
10
- ...profile.motion,
11
- ...profile.effects,
12
- ...profile.shape,
13
- ...profile.components,
14
- ...profile.custom
15
- };
7
+ return {
8
+ ...profile.colors,
9
+ ...profile.shadows,
10
+ ...profile.motion,
11
+ ...profile.effects,
12
+ ...profile.shape,
13
+ ...profile.components,
14
+ ...profile.custom
15
+ };
16
16
  }
17
-
18
17
  const toOklch = converter("oklch");
19
- const roles = ["primary", "secondary", "success", "error", "warning", "info"];
18
+ const roles = [
19
+ "primary",
20
+ "secondary",
21
+ "success",
22
+ "error",
23
+ "warning",
24
+ "info"
25
+ ];
20
26
  const minimumTextContrast = 4.5;
21
27
  const minimumBoundaryContrast = 3;
22
28
  const lightSettings = {
23
- activeDelta: -0.07,
24
- baseLightness: 0.48,
25
- borderLightness: 0.64,
26
- contrastDirection: -1,
27
- hoverDelta: -0.035,
28
- subtleForegroundLightness: 0.34,
29
- subtleLightness: 0.945,
30
- surface: { mode: "oklch", l: 0.99, c: 0.003, h: 270 }
29
+ activeDelta: -.07,
30
+ baseLightness: .48,
31
+ borderLightness: .64,
32
+ contrastDirection: -1,
33
+ hoverDelta: -.035,
34
+ subtleForegroundLightness: .34,
35
+ subtleLightness: .945,
36
+ surface: {
37
+ mode: "oklch",
38
+ l: .99,
39
+ c: .003,
40
+ h: 270
41
+ }
31
42
  };
32
43
  const darkSettings = {
33
- activeDelta: 0.07,
34
- baseLightness: 0.72,
35
- borderLightness: 0.58,
36
- contrastDirection: 1,
37
- hoverDelta: 0.035,
38
- subtleForegroundLightness: 0.82,
39
- subtleLightness: 0.285,
40
- surface: { mode: "oklch", l: 0.19, c: 0.012, h: 270 }
44
+ activeDelta: .07,
45
+ baseLightness: .72,
46
+ borderLightness: .58,
47
+ contrastDirection: 1,
48
+ hoverDelta: .035,
49
+ subtleForegroundLightness: .82,
50
+ subtleLightness: .285,
51
+ surface: {
52
+ mode: "oklch",
53
+ l: .19,
54
+ c: .012,
55
+ h: 270
56
+ }
41
57
  };
42
- /**
43
- * Generates accessible light and dark color-role overrides from consumer-provided CSS colors.
44
- * Seed lightness is treated as source identity; the generated variants use fixed tonal anchors.
45
- */
46
58
  function generateThemeColorPalette(seeds) {
47
- const light = {};
48
- const dark = {};
49
- for (const role of roles) {
50
- const value = seeds[role];
51
- if (value === undefined) {
52
- continue;
53
- }
54
- const seed = parseSeed(role, value);
55
- Object.assign(light, createRolePalette(role, seed, lightSettings));
56
- Object.assign(dark, createRolePalette(role, seed, darkSettings));
57
- if (role === "primary") {
58
- Object.assign(light, createPrimaryEmphasisPalette(seed, lightSettings));
59
- Object.assign(dark, createPrimaryEmphasisPalette(seed, darkSettings));
60
- }
61
- }
62
- return Object.freeze({
63
- light: Object.freeze(light),
64
- dark: Object.freeze(dark)
65
- });
59
+ const light = {};
60
+ const dark = {};
61
+ for (const role of roles) {
62
+ const value = seeds[role];
63
+ if (value === void 0) continue;
64
+ const seed = parseSeed(role, value);
65
+ Object.assign(light, createRolePalette(role, seed, lightSettings));
66
+ Object.assign(dark, createRolePalette(role, seed, darkSettings));
67
+ if (role === "primary") {
68
+ Object.assign(light, createPrimaryEmphasisPalette(seed, lightSettings));
69
+ Object.assign(dark, createPrimaryEmphasisPalette(seed, darkSettings));
70
+ }
71
+ }
72
+ return Object.freeze({
73
+ light: Object.freeze(light),
74
+ dark: Object.freeze(dark)
75
+ });
66
76
  }
67
77
  function parseSeed(role, value) {
68
- const parsed = parse(value);
69
- const converted = parsed ? toOklch(parsed) : undefined;
70
- if (!converted) {
71
- throw new Error(`Invalid ${role} theme color seed: "${value}". Expected an opaque CSS color.`);
72
- }
73
- if ((converted.alpha ?? 1) < 1) {
74
- throw new Error(`Invalid ${role} theme color seed: translucent colors are not supported.`);
75
- }
76
- return mapToSrgb({
77
- mode: "oklch",
78
- l: clamp(converted.l, 0, 1),
79
- c: Math.max(converted.c, 0),
80
- h: normalizeHue(converted.h ?? 0)
81
- });
78
+ const parsed = parse(value);
79
+ const converted = parsed ? toOklch(parsed) : void 0;
80
+ if (!converted) throw new Error(`Invalid ${role} theme color seed: "${value}". Expected an opaque CSS color.`);
81
+ if ((converted.alpha ?? 1) < 1) throw new Error(`Invalid ${role} theme color seed: translucent colors are not supported.`);
82
+ return mapToSrgb({
83
+ mode: "oklch",
84
+ l: clamp(converted.l, 0, 1),
85
+ c: Math.max(converted.c, 0),
86
+ h: normalizeHue(converted.h ?? 0)
87
+ });
82
88
  }
83
89
  function createRolePalette(role, seed, settings) {
84
- const chroma = Math.min(seed.c, 0.16);
85
- const hue = seed.h ?? 0;
86
- const base = fitContrast(mapToSrgb({ mode: "oklch", l: settings.baseLightness, c: chroma, h: hue }), settings.surface, minimumBoundaryContrast, settings.contrastDirection);
87
- const foreground = chooseForeground(base, hue);
88
- const hover = ensureForegroundContrast(mapToSrgb({ ...base, l: clamp(base.l + settings.hoverDelta, 0, 1) }), foreground, settings.contrastDirection);
89
- const active = ensureForegroundContrast(mapToSrgb({ ...base, l: clamp(base.l + settings.activeDelta, 0, 1) }), foreground, settings.contrastDirection);
90
- const subtle = mapToSrgb({
91
- mode: "oklch",
92
- l: settings.subtleLightness,
93
- c: Math.min(chroma * 0.22, 0.04),
94
- h: hue
95
- });
96
- const subtleForeground = fitContrast(mapToSrgb({
97
- mode: "oklch",
98
- l: settings.subtleForegroundLightness,
99
- c: Math.min(chroma * 0.8, 0.12),
100
- h: hue
101
- }), subtle, minimumTextContrast, settings.contrastDirection);
102
- const border = fitContrast(mapToSrgb({
103
- mode: "oklch",
104
- l: settings.borderLightness,
105
- c: Math.min(chroma * 0.55, 0.09),
106
- h: hue
107
- }), subtle, minimumBoundaryContrast, settings.contrastDirection);
108
- const prefix = `--color-${role}`;
109
- return {
110
- [prefix]: formatOklch(base),
111
- [`${prefix}-foreground`]: formatOklch(foreground),
112
- [`${prefix}-hover`]: formatOklch(hover),
113
- [`${prefix}-active`]: formatOklch(active),
114
- [`${prefix}-selected`]: formatOklch(active),
115
- [`${prefix}-subtle`]: formatOklch(subtle),
116
- [`${prefix}-subtle-foreground`]: formatOklch(subtleForeground),
117
- [`${prefix}-border`]: formatOklch(border)
118
- };
90
+ const chroma = Math.min(seed.c, .16);
91
+ const hue = seed.h ?? 0;
92
+ const base = fitContrast(mapToSrgb({
93
+ mode: "oklch",
94
+ l: settings.baseLightness,
95
+ c: chroma,
96
+ h: hue
97
+ }), settings.surface, minimumBoundaryContrast, settings.contrastDirection);
98
+ const foreground = chooseForeground(base, hue);
99
+ const hover = ensureForegroundContrast(mapToSrgb({
100
+ ...base,
101
+ l: clamp(base.l + settings.hoverDelta, 0, 1)
102
+ }), foreground, settings.contrastDirection);
103
+ const active = ensureForegroundContrast(mapToSrgb({
104
+ ...base,
105
+ l: clamp(base.l + settings.activeDelta, 0, 1)
106
+ }), foreground, settings.contrastDirection);
107
+ const subtle = mapToSrgb({
108
+ mode: "oklch",
109
+ l: settings.subtleLightness,
110
+ c: Math.min(chroma * .22, .04),
111
+ h: hue
112
+ });
113
+ const subtleForeground = fitContrast(mapToSrgb({
114
+ mode: "oklch",
115
+ l: settings.subtleForegroundLightness,
116
+ c: Math.min(chroma * .8, .12),
117
+ h: hue
118
+ }), subtle, minimumTextContrast, settings.contrastDirection);
119
+ const border = fitContrast(mapToSrgb({
120
+ mode: "oklch",
121
+ l: settings.borderLightness,
122
+ c: Math.min(chroma * .55, .09),
123
+ h: hue
124
+ }), subtle, minimumBoundaryContrast, settings.contrastDirection);
125
+ const prefix = `--color-${role}`;
126
+ return {
127
+ [prefix]: formatOklch(base),
128
+ [`${prefix}-foreground`]: formatOklch(foreground),
129
+ [`${prefix}-hover`]: formatOklch(hover),
130
+ [`${prefix}-active`]: formatOklch(active),
131
+ [`${prefix}-selected`]: formatOklch(active),
132
+ [`${prefix}-subtle`]: formatOklch(subtle),
133
+ [`${prefix}-subtle-foreground`]: formatOklch(subtleForeground),
134
+ [`${prefix}-border`]: formatOklch(border)
135
+ };
119
136
  }
120
137
  function createPrimaryEmphasisPalette(seed, settings) {
121
- const isLight = settings.contrastDirection === -1;
122
- const hue = seed.h ?? 0;
123
- const chroma = Math.min(seed.c * 0.32, 0.05);
124
- const accent = mapToSrgb({
125
- mode: "oklch",
126
- l: isLight ? 0.925 : 0.31,
127
- c: chroma,
128
- h: hue
129
- });
130
- const foreground = fitContrast(mapToSrgb({
131
- mode: "oklch",
132
- l: isLight ? 0.3 : 0.88,
133
- c: Math.min(seed.c * 0.75, 0.11),
134
- h: hue
135
- }), accent, minimumTextContrast, settings.contrastDirection);
136
- const hover = mapToSrgb({ ...accent, l: clamp(accent.l + (isLight ? -0.025 : 0.035), 0, 1) });
137
- const active = mapToSrgb({ ...accent, l: clamp(accent.l + (isLight ? -0.055 : 0.07), 0, 1) });
138
- return {
139
- "--color-accent": formatOklch(accent),
140
- "--color-accent-foreground": formatOklch(foreground),
141
- "--color-accent-hover": formatOklch(hover),
142
- "--color-accent-active": formatOklch(active),
143
- "--color-accent-dark": "var(--color-accent-active)",
144
- "--color-focus-indicator": "var(--color-primary)",
145
- "--color-selected": "var(--color-accent)",
146
- "--color-selected-foreground": "var(--color-accent-foreground)",
147
- "--color-selected-hover": "var(--color-accent-hover)",
148
- "--color-selected-hover-foreground": "var(--color-accent-foreground)",
149
- "--color-selected-active": "var(--color-accent-active)",
150
- "--color-selected-active-foreground": "var(--color-accent-foreground)",
151
- "--color-selected-focus": "var(--color-accent-hover)",
152
- "--color-selected-focus-foreground": "var(--color-accent-foreground)",
153
- "--color-selected-border": "var(--color-primary)"
154
- };
138
+ const isLight = settings.contrastDirection === -1;
139
+ const hue = seed.h ?? 0;
140
+ const chroma = Math.min(seed.c * .32, .05);
141
+ const accent = mapToSrgb({
142
+ mode: "oklch",
143
+ l: isLight ? .925 : .31,
144
+ c: chroma,
145
+ h: hue
146
+ });
147
+ const foreground = fitContrast(mapToSrgb({
148
+ mode: "oklch",
149
+ l: isLight ? .3 : .88,
150
+ c: Math.min(seed.c * .75, .11),
151
+ h: hue
152
+ }), accent, minimumTextContrast, settings.contrastDirection);
153
+ const hover = mapToSrgb({
154
+ ...accent,
155
+ l: clamp(accent.l + (isLight ? -.025 : .035), 0, 1)
156
+ });
157
+ const active = mapToSrgb({
158
+ ...accent,
159
+ l: clamp(accent.l + (isLight ? -.055 : .07), 0, 1)
160
+ });
161
+ return {
162
+ "--color-accent": formatOklch(accent),
163
+ "--color-accent-foreground": formatOklch(foreground),
164
+ "--color-accent-hover": formatOklch(hover),
165
+ "--color-accent-active": formatOklch(active),
166
+ "--color-accent-dark": "var(--color-accent-active)",
167
+ "--color-focus-indicator": "var(--color-primary)",
168
+ "--color-selected": "var(--color-accent)",
169
+ "--color-selected-foreground": "var(--color-accent-foreground)",
170
+ "--color-selected-hover": "var(--color-accent-hover)",
171
+ "--color-selected-hover-foreground": "var(--color-accent-foreground)",
172
+ "--color-selected-active": "var(--color-accent-active)",
173
+ "--color-selected-active-foreground": "var(--color-accent-foreground)",
174
+ "--color-selected-focus": "var(--color-accent-hover)",
175
+ "--color-selected-focus-foreground": "var(--color-accent-foreground)",
176
+ "--color-selected-border": "var(--color-primary)"
177
+ };
155
178
  }
156
179
  function chooseForeground(background, hue) {
157
- const light = mapToSrgb({ mode: "oklch", l: 0.98, c: 0.004, h: hue });
158
- const dark = mapToSrgb({ mode: "oklch", l: 0.16, c: 0.012, h: hue });
159
- const preferred = wcagContrast(light, background) >= wcagContrast(dark, background) ? light : dark;
160
- const direction = preferred === light ? 1 : -1;
161
- return fitContrast(preferred, background, minimumTextContrast, direction);
180
+ const light = mapToSrgb({
181
+ mode: "oklch",
182
+ l: .98,
183
+ c: .004,
184
+ h: hue
185
+ });
186
+ const dark = mapToSrgb({
187
+ mode: "oklch",
188
+ l: .16,
189
+ c: .012,
190
+ h: hue
191
+ });
192
+ const preferred = wcagContrast(light, background) >= wcagContrast(dark, background) ? light : dark;
193
+ return fitContrast(preferred, background, minimumTextContrast, preferred === light ? 1 : -1);
162
194
  }
163
195
  function ensureForegroundContrast(background, foreground, direction) {
164
- if (wcagContrast(background, foreground) >= minimumTextContrast) {
165
- return background;
166
- }
167
- return fitContrast(background, foreground, minimumTextContrast, direction);
196
+ if (wcagContrast(background, foreground) >= minimumTextContrast) return background;
197
+ return fitContrast(background, foreground, minimumTextContrast, direction);
168
198
  }
169
199
  function fitContrast(color, background, minimum, direction) {
170
- let candidate = color;
171
- for (let index = 0; index < 400 && wcagContrast(candidate, background) < minimum; index++) {
172
- const lightness = clamp(candidate.l + direction * 0.0025, 0, 1);
173
- if (lightness === candidate.l) {
174
- break;
175
- }
176
- candidate = mapToSrgb({ ...candidate, l: lightness });
177
- }
178
- return candidate;
200
+ let candidate = color;
201
+ for (let index = 0; index < 400 && wcagContrast(candidate, background) < minimum; index++) {
202
+ const lightness = clamp(candidate.l + direction * .0025, 0, 1);
203
+ if (lightness === candidate.l) break;
204
+ candidate = mapToSrgb({
205
+ ...candidate,
206
+ l: lightness
207
+ });
208
+ }
209
+ return candidate;
179
210
  }
180
211
  function mapToSrgb(color) {
181
- const mapped = clampChroma({
182
- mode: "oklch",
183
- l: clamp(color.l, 0, 1),
184
- c: Math.max(color.c, 0),
185
- h: normalizeHue(color.h ?? 0)
186
- }, "oklch", "rgb");
187
- return { ...mapped, alpha: undefined };
212
+ return {
213
+ ...clampChroma({
214
+ mode: "oklch",
215
+ l: clamp(color.l, 0, 1),
216
+ c: Math.max(color.c, 0),
217
+ h: normalizeHue(color.h ?? 0)
218
+ }, "oklch", "rgb"),
219
+ alpha: void 0
220
+ };
188
221
  }
189
222
  function formatOklch(color) {
190
- return `oklch(${(color.l * 100).toFixed(2)}% ${color.c.toFixed(4)} ${normalizeHue(color.h ?? 0).toFixed(2)})`;
223
+ return `oklch(${(color.l * 100).toFixed(2)}% ${color.c.toFixed(4)} ${normalizeHue(color.h ?? 0).toFixed(2)})`;
191
224
  }
192
225
  function normalizeHue(hue) {
193
- return ((hue % 360) + 360) % 360;
226
+ return (hue % 360 + 360) % 360;
194
227
  }
195
228
  function clamp(value, minimum, maximum) {
196
- return Math.min(Math.max(value, minimum), maximum);
229
+ return Math.min(Math.max(value, minimum), maximum);
197
230
  }
198
-
199
231
  function createDefaultThemeEffects() {
200
- return Object.freeze({
201
- "--mona-effect-control-background-color": "var(--color-input-background)",
202
- "--mona-effect-control-fallback-background-color": "var(--color-input-background)",
203
- "--mona-effect-control-background-image": "none",
204
- "--mona-effect-control-backdrop-filter": "none",
205
- "--mona-effect-raised-background-color": "var(--color-surface-raised)",
206
- "--mona-effect-raised-fallback-background-color": "var(--color-surface-raised)",
207
- "--mona-effect-raised-background-image": "none",
208
- "--mona-effect-raised-backdrop-filter": "none",
209
- "--mona-effect-overlay-background-color": "var(--color-surface-overlay)",
210
- "--mona-effect-overlay-fallback-background-color": "var(--color-surface-overlay)",
211
- "--mona-effect-overlay-background-image": "none",
212
- "--mona-effect-overlay-backdrop-filter": "none"
213
- });
232
+ return Object.freeze({
233
+ "--mona-effect-control-background-color": "var(--color-input-background)",
234
+ "--mona-effect-control-fallback-background-color": "var(--color-input-background)",
235
+ "--mona-effect-control-background-image": "none",
236
+ "--mona-effect-control-backdrop-filter": "none",
237
+ "--mona-effect-raised-background-color": "var(--color-surface-raised)",
238
+ "--mona-effect-raised-fallback-background-color": "var(--color-surface-raised)",
239
+ "--mona-effect-raised-background-image": "none",
240
+ "--mona-effect-raised-backdrop-filter": "none",
241
+ "--mona-effect-overlay-background-color": "var(--color-surface-overlay)",
242
+ "--mona-effect-overlay-fallback-background-color": "var(--color-surface-overlay)",
243
+ "--mona-effect-overlay-background-image": "none",
244
+ "--mona-effect-overlay-backdrop-filter": "none"
245
+ });
214
246
  }
215
247
  function createDefaultThemeShape() {
216
- return Object.freeze({
217
- "--radius-sm": "0.25rem",
218
- "--radius-md": "0.375rem",
219
- "--radius-lg": "0.5rem"
220
- });
248
+ return Object.freeze({
249
+ "--radius-sm": "0.25rem",
250
+ "--radius-md": "0.375rem",
251
+ "--radius-lg": "0.5rem"
252
+ });
221
253
  }
222
- /**
223
- * Builds the sidebar's own colour roles. The sidebar is a persistent chrome region rather than page
224
- * content, so it is given a surface of its own instead of borrowing the page's — which is what lets a
225
- * theme sit it slightly apart from the content beside it without every consumer restyling it.
226
- *
227
- * Only `background` has to be chosen per theme. Hover defaults to the neutral interaction roles, while
228
- * the sidebar's primary pair follows the selected-state roles. This keeps ordinary navigation quiet,
229
- * reserves identity colour for the current item, and makes runtime primary-palette changes flow through
230
- * without rebuilding the sidebar recipe.
231
- */
232
254
  function createSidebarColorRoles(seeds) {
233
- return Object.freeze({
234
- "--color-sidebar": seeds.background,
235
- "--color-sidebar-foreground": seeds.foreground ?? "var(--color-foreground)",
236
- "--color-sidebar-primary": seeds.primary ?? "var(--color-selected)",
237
- "--color-sidebar-primary-foreground": seeds.primaryForeground ?? "var(--color-selected-foreground)",
238
- "--color-sidebar-accent": seeds.accent ?? "var(--color-hover)",
239
- "--color-sidebar-accent-foreground": seeds.accentForeground ?? "var(--color-foreground)",
240
- "--color-sidebar-border": seeds.border ?? "var(--color-border)",
241
- "--color-sidebar-ring": seeds.ring ?? "var(--color-focus-indicator)"
242
- });
255
+ return Object.freeze({
256
+ "--color-sidebar": seeds.background,
257
+ "--color-sidebar-foreground": seeds.foreground ?? "var(--color-foreground)",
258
+ "--color-sidebar-primary": seeds.primary ?? "var(--color-selected)",
259
+ "--color-sidebar-primary-foreground": seeds.primaryForeground ?? "var(--color-selected-foreground)",
260
+ "--color-sidebar-accent": seeds.accent ?? "var(--color-hover)",
261
+ "--color-sidebar-accent-foreground": seeds.accentForeground ?? "var(--color-foreground)",
262
+ "--color-sidebar-border": seeds.border ?? "var(--color-border)",
263
+ "--color-sidebar-ring": seeds.ring ?? "var(--color-focus-indicator)"
264
+ });
243
265
  }
244
-
245
266
  const generatedRoles$2 = generateThemeColorPalette({
246
- primary: "#583573",
247
- secondary: "#3A3B40",
248
- success: "#32BEA6",
249
- error: "#FF3055",
250
- warning: "#FFDA6B",
251
- info: "#4DA3FF"
267
+ primary: "#583573",
268
+ secondary: "#3A3B40",
269
+ success: "#32BEA6",
270
+ error: "#FF3055",
271
+ warning: "#FFDA6B",
272
+ info: "#4DA3FF"
273
+ });
274
+ const sharedRoles = Object.freeze({
275
+ "--color-card": "var(--color-surface-raised)",
276
+ "--color-card-foreground": "var(--color-foreground)",
277
+ "--color-input-foreground": "var(--color-foreground)",
278
+ "--color-accent-dark": "var(--color-accent-active)",
279
+ "--color-focus-surface": "var(--color-surface)",
280
+ "--color-background": "var(--color-surface)",
281
+ "--color-background-dark": "var(--color-surface-muted)",
282
+ "--color-header-background": "var(--color-surface-muted)",
283
+ "--color-header-foreground": "var(--color-foreground)",
284
+ "--color-input-border": "var(--color-border-control)",
285
+ "--color-input-hover": "var(--color-hover)",
286
+ "--color-input-active": "var(--color-surface-raised)",
287
+ "--color-popover": "var(--color-surface-overlay)",
288
+ "--color-popover-foreground": "var(--color-foreground)",
289
+ "--color-muted": "var(--color-surface-muted)",
290
+ "--color-destructive": "var(--color-error)",
291
+ "--color-destructive-foreground": "var(--color-error-foreground)",
292
+ "--color-input": "var(--color-border-control)",
293
+ "--color-disabled": "var(--color-disabled-foreground)",
294
+ ...createSidebarColorRoles({ background: "var(--color-surface-muted)" }),
295
+ "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)"
296
+ });
297
+ const light$5 = Object.freeze({
298
+ "--color-canvas": "#E9E9EC",
299
+ "--color-surface": "#EFEFF1",
300
+ "--color-surface-muted": "#E4E4E7",
301
+ "--color-surface-raised": "#F3F3F5",
302
+ "--color-surface-overlay": "#F3F3F5",
303
+ "--color-foreground": "#1E1F22",
304
+ "--color-muted-foreground": "#53545A",
305
+ "--color-input-background": "#F7F7F9",
306
+ "--color-border-subtle": "#DFDFE3",
307
+ "--color-border": "#D5D5DA",
308
+ "--color-border-control": "#C4C5CA",
309
+ "--color-border-control-hover": "#A9AAB0",
310
+ "--color-border-control-contrast": "#7A7B82",
311
+ "--color-border-control-contrast-hover": "#68696F",
312
+ "--color-hover": "#EAEAED",
313
+ "--color-active": "#E2E2E6",
314
+ "--color-disabled-foreground": "#5A5B61",
315
+ "--color-disabled-background": "#E6E6E9",
316
+ "--color-disabled-border": "#D5D5DA",
317
+ ...generatedRoles$2.light,
318
+ "--color-primary": "#583573",
319
+ "--color-primary-foreground": "#FFFFFF",
320
+ "--color-primary-hover": "#4A2B61",
321
+ "--color-primary-active": "#3D2350",
322
+ "--color-primary-selected": "#3D2350",
323
+ "--color-primary-subtle": "#EFE7F6",
324
+ "--color-primary-subtle-foreground": "#4A2B61",
325
+ "--color-primary-border": "#76489C",
326
+ "--color-secondary": "#DCDCE0",
327
+ "--color-secondary-foreground": "#1E1F22",
328
+ "--color-secondary-hover": "#CFCFD4",
329
+ "--color-secondary-active": "#C3C3C9",
330
+ "--color-secondary-selected": "#C3C3C9",
331
+ "--color-secondary-subtle": "#E9E9EC",
332
+ "--color-secondary-subtle-foreground": "#2E2F33",
333
+ "--color-secondary-border": "#7A7B82",
334
+ "--color-accent": "#EFE7F6",
335
+ "--color-accent-foreground": "#4A2B61",
336
+ "--color-accent-hover": "#E6DAF1",
337
+ "--color-accent-active": "#DCCCEB",
338
+ "--color-selected": "#E9DDF2",
339
+ "--color-selected-foreground": "#40245A",
340
+ "--color-selected-hover": "#E1D2EE",
341
+ "--color-selected-hover-foreground": "#40245A",
342
+ "--color-selected-active": "#D7C4E8",
343
+ "--color-selected-active-foreground": "#40245A",
344
+ "--color-selected-focus": "#E1D2EE",
345
+ "--color-selected-focus-foreground": "#40245A",
346
+ "--color-selected-border": "var(--color-primary)",
347
+ "--color-focus-indicator": "#76489C",
348
+ ...sharedRoles,
349
+ "--color-chart-1": "#6B3F8E",
350
+ "--color-chart-2": "#9B66C2",
351
+ "--color-chart-3": "#2F6DB5",
352
+ "--color-chart-4": "#13806F",
353
+ "--color-chart-5": "#9A6500",
354
+ "--color-scrollbar-thumb": "#7A7B82",
355
+ "--color-scrollbar-thumb-hover": "#68696F",
356
+ "--color-scrollbar-thumb-active": "#55565C",
357
+ "--color-scrollbar-track": "#E4E4E7",
358
+ "--color-scrollbar-track-hover": "#DCDCE0",
359
+ "--color-scrollbar-track-active": "#D3D3D8",
360
+ "--color-scrollbar-track-focus": "#EFE7F6",
361
+ "--color-scrollbar-corner": "#E4E4E7"
252
362
  });
253
363
  const dark$5 = Object.freeze({
254
- "--color-canvas": "#202123",
255
- "--color-surface": "#1D1E20",
256
- "--color-surface-muted": "#161718",
257
- "--color-surface-raised": "#242528",
258
- "--color-surface-overlay": "#161718",
259
- "--color-card": "var(--color-surface-raised)",
260
- "--color-card-foreground": "var(--color-foreground)",
261
- "--color-foreground": "#D6D6D8",
262
- "--color-muted-foreground": "#B4B4B9",
263
- "--color-input-background": "#1D1E20",
264
- "--color-input-foreground": "var(--color-foreground)",
265
- "--color-border-subtle": "#0F0F10",
266
- "--color-border": "#131416",
267
- "--color-border-control": "#0F0F10",
268
- "--color-border-control-hover": "#17181A",
269
- "--color-border-control-contrast": "#6F7077",
270
- "--color-border-control-contrast-hover": "#818289",
271
- "--color-hover": "#242528",
272
- "--color-active": "#2A2B2E",
273
- "--color-disabled-foreground": "#9A9AA0",
274
- "--color-disabled-background": "#1A1B1D",
275
- "--color-disabled-border": "#111214",
276
- ...generatedRoles$2.dark,
277
- "--color-primary": "#583573",
278
- "--color-primary-foreground": "#F5EFF8",
279
- "--color-primary-hover": "#684484",
280
- "--color-primary-active": "#472A5E",
281
- "--color-primary-selected": "#583573",
282
- "--color-primary-subtle": "#2B2131",
283
- "--color-primary-subtle-foreground": "#DABFEA",
284
- "--color-primary-border": "#A174C2",
285
- "--color-secondary": "#34353A",
286
- "--color-secondary-foreground": "#F0F0F2",
287
- "--color-secondary-hover": "#414247",
288
- "--color-secondary-active": "#292A2E",
289
- "--color-secondary-selected": "#414247",
290
- "--color-secondary-subtle": "#232428",
291
- "--color-secondary-subtle-foreground": "#D6D6D8",
292
- "--color-secondary-border": "#777880",
293
- "--color-accent": "#583573",
294
- "--color-accent-foreground": "#F5EFF8",
295
- "--color-accent-hover": "#684484",
296
- "--color-accent-active": "#472A5E",
297
- "--color-accent-dark": "var(--color-accent-active)",
298
- "--color-selected": "var(--color-primary)",
299
- "--color-selected-foreground": "var(--color-primary-foreground)",
300
- "--color-selected-hover": "var(--color-primary-hover)",
301
- "--color-selected-hover-foreground": "var(--color-primary-foreground)",
302
- "--color-selected-active": "var(--color-active)",
303
- "--color-selected-active-foreground": "var(--color-foreground)",
304
- "--color-selected-focus": "var(--color-primary)",
305
- "--color-selected-focus-foreground": "var(--color-primary-foreground)",
306
- "--color-selected-border": "var(--color-focus-indicator)",
307
- "--color-focus-surface": "var(--color-surface)",
308
- "--color-focus-indicator": "#BC94DB",
309
- "--color-background": "var(--color-surface)",
310
- "--color-background-dark": "var(--color-surface-muted)",
311
- "--color-header-background": "var(--color-surface-muted)",
312
- "--color-header-foreground": "var(--color-foreground)",
313
- "--color-input-border": "var(--color-border-control)",
314
- "--color-input-hover": "var(--color-hover)",
315
- "--color-input-active": "var(--color-surface-raised)",
316
- "--color-popover": "var(--color-surface-overlay)",
317
- "--color-popover-foreground": "var(--color-foreground)",
318
- "--color-muted": "var(--color-surface-muted)",
319
- "--color-destructive": "var(--color-error)",
320
- "--color-destructive-foreground": "var(--color-error-foreground)",
321
- "--color-input": "var(--color-border-control)",
322
- "--color-disabled": "var(--color-disabled-foreground)",
323
- // Anna's canvas is already dark, so the sidebar recedes below it rather than lifting off it —
324
- // the same relationship its scrollbar track and popovers use.
325
- ...createSidebarColorRoles({ background: "var(--color-surface-muted)" }),
326
- "--color-chart-1": "#A174C2",
327
- "--color-chart-2": "#C39BDF",
328
- "--color-chart-3": "#4DA3FF",
329
- "--color-chart-4": "#32BEA6",
330
- "--color-chart-5": "#FFDA6B",
331
- "--color-scrollbar-thumb": "#686970",
332
- "--color-scrollbar-thumb-hover": "#7B7C83",
333
- "--color-scrollbar-thumb-active": "#94959C",
334
- "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)",
335
- "--color-scrollbar-track": "#161718",
336
- "--color-scrollbar-track-hover": "#1D1E20",
337
- "--color-scrollbar-track-active": "#242528",
338
- "--color-scrollbar-track-focus": "#2B2131",
339
- "--color-scrollbar-corner": "#161718"
364
+ "--color-canvas": "#202123",
365
+ "--color-surface": "#1D1E20",
366
+ "--color-surface-muted": "#161718",
367
+ "--color-surface-raised": "#242528",
368
+ "--color-surface-overlay": "#161718",
369
+ "--color-foreground": "#D6D6D8",
370
+ "--color-muted-foreground": "#B4B4B9",
371
+ "--color-input-background": "#2A2B2E",
372
+ "--color-border-subtle": "#0F0F10",
373
+ "--color-border": "#131416",
374
+ "--color-border-control": "#0F0F10",
375
+ "--color-border-control-hover": "#17181A",
376
+ "--color-border-control-contrast": "#74757B",
377
+ "--color-border-control-contrast-hover": "#818289",
378
+ "--color-hover": "#313236",
379
+ "--color-active": "#38393D",
380
+ "--color-disabled-foreground": "#9A9AA0",
381
+ "--color-disabled-background": "#1A1B1D",
382
+ "--color-disabled-border": "#111214",
383
+ ...generatedRoles$2.dark,
384
+ "--color-primary": "#583573",
385
+ "--color-primary-foreground": "#F5EFF8",
386
+ "--color-primary-hover": "#684484",
387
+ "--color-primary-active": "#472A5E",
388
+ "--color-primary-selected": "#583573",
389
+ "--color-primary-subtle": "#2B2131",
390
+ "--color-primary-subtle-foreground": "#DABFEA",
391
+ "--color-primary-border": "#A174C2",
392
+ "--color-secondary": "#34353A",
393
+ "--color-secondary-foreground": "#F0F0F2",
394
+ "--color-secondary-hover": "#414247",
395
+ "--color-secondary-active": "#292A2E",
396
+ "--color-secondary-selected": "#414247",
397
+ "--color-secondary-subtle": "#232428",
398
+ "--color-secondary-subtle-foreground": "#D6D6D8",
399
+ "--color-secondary-border": "#777880",
400
+ "--color-accent": "#583573",
401
+ "--color-accent-foreground": "#F5EFF8",
402
+ "--color-accent-hover": "#684484",
403
+ "--color-accent-active": "#472A5E",
404
+ "--color-selected": "var(--color-primary)",
405
+ "--color-selected-foreground": "var(--color-primary-foreground)",
406
+ "--color-selected-hover": "var(--color-primary-hover)",
407
+ "--color-selected-hover-foreground": "var(--color-primary-foreground)",
408
+ "--color-selected-active": "var(--color-active)",
409
+ "--color-selected-active-foreground": "var(--color-foreground)",
410
+ "--color-selected-focus": "var(--color-primary)",
411
+ "--color-selected-focus-foreground": "var(--color-primary-foreground)",
412
+ "--color-selected-border": "var(--color-focus-indicator)",
413
+ "--color-focus-indicator": "#BC94DB",
414
+ ...sharedRoles,
415
+ "--color-chart-1": "#A174C2",
416
+ "--color-chart-2": "#C39BDF",
417
+ "--color-chart-3": "#4DA3FF",
418
+ "--color-chart-4": "#32BEA6",
419
+ "--color-chart-5": "#FFDA6B",
420
+ "--color-scrollbar-thumb": "#686970",
421
+ "--color-scrollbar-thumb-hover": "#7B7C83",
422
+ "--color-scrollbar-thumb-active": "#94959C",
423
+ "--color-scrollbar-track": "#161718",
424
+ "--color-scrollbar-track-hover": "#1D1E20",
425
+ "--color-scrollbar-track-active": "#242528",
426
+ "--color-scrollbar-track-focus": "#2B2131",
427
+ "--color-scrollbar-corner": "#161718"
428
+ });
429
+ const annaThemeColors = Object.freeze({
430
+ light: light$5,
431
+ dark: dark$5
432
+ });
433
+ const light$4 = Object.freeze({
434
+ "--shadow-control": "none",
435
+ "--shadow-raised": "0 2px 6px -2px rgb(17 17 20 / 0.14)",
436
+ "--shadow-overlay": "0 8px 20px -6px rgb(17 17 20 / 0.22)"
340
437
  });
341
- const annaThemeColors = Object.freeze({ dark: dark$5 });
342
-
343
438
  const dark$4 = Object.freeze({
344
- "--shadow-control": "none",
345
- "--shadow-raised": "0 4px 10px -4px rgb(0 0 0 / 0.6)",
346
- "--shadow-overlay": "0 6px 14px -4px rgb(0 0 0 / 0.65)"
439
+ "--shadow-control": "none",
440
+ "--shadow-raised": "0 4px 10px -4px rgb(0 0 0 / 0.6)",
441
+ "--shadow-overlay": "0 6px 14px -4px rgb(0 0 0 / 0.65)"
442
+ });
443
+ const annaThemeShadows = Object.freeze({
444
+ light: light$4,
445
+ dark: dark$4
347
446
  });
348
- const annaThemeShadows = Object.freeze({ dark: dark$4 });
349
-
350
447
  const motion$1 = Object.freeze({
351
- "--mona-motion-fast": "150ms",
352
- "--mona-motion-standard": "150ms"
448
+ "--mona-motion-fast": "150ms",
449
+ "--mona-motion-standard": "150ms"
353
450
  });
354
451
  const components = Object.freeze({
355
- "--mona-calendar-background": "var(--color-input-background)",
356
- "--mona-calendar-shadow": "none",
357
- "--mona-list-background": "var(--color-surface)",
358
- "--mona-list-disabled-background": "var(--color-disabled-background)",
359
- "--mona-list-group-background": "var(--color-surface-muted)",
360
- "--mona-list-group-border-width": "1px",
361
- "--mona-list-group-font-weight": "600",
362
- "--mona-menubar-background": "var(--color-surface-muted)",
363
- "--mona-menubar-shadow": "none",
364
- "--mona-pager-background": "var(--color-surface-muted)",
365
- "--mona-slider-handle-border-color": "var(--color-focus-indicator)"
452
+ "--mona-calendar-background": "var(--color-surface)",
453
+ "--mona-calendar-shadow": "none",
454
+ "--mona-list-background": "var(--color-surface)",
455
+ "--mona-list-disabled-background": "var(--color-disabled-background)",
456
+ "--mona-list-group-background": "var(--color-surface-muted)",
457
+ "--mona-list-group-border-width": "1px",
458
+ "--mona-list-group-font-weight": "600",
459
+ "--mona-menubar-background": "var(--color-surface-muted)",
460
+ "--mona-menubar-shadow": "none",
461
+ "--mona-pager-background": "var(--color-surface-muted)",
462
+ "--mona-slider-handle-border-color": "var(--color-focus-indicator)"
366
463
  });
367
464
  const annaTheme = Object.freeze({
368
- name: "anna",
369
- variants: {
370
- dark: Object.freeze({
371
- colors: annaThemeColors.dark,
372
- components,
373
- // The violet fill is 1.73:1 on Anna's surface, which is fine under a label and not as the only thing
374
- // showing a value. What's drawn by a fill alone takes the lighter violet instead.
375
- custom: Object.freeze({
376
- "--mona-indicator-color": "var(--color-primary-border)",
377
- "--mona-indicator-foreground": "#161718"
378
- }),
379
- effects: createDefaultThemeEffects(),
380
- motion: motion$1,
381
- shape: createDefaultThemeShape(),
382
- shadows: annaThemeShadows.dark
383
- })
384
- }
465
+ name: "anna",
466
+ variants: {
467
+ light: Object.freeze({
468
+ colors: annaThemeColors.light,
469
+ components,
470
+ custom: Object.freeze({
471
+ "--mona-indicator-color": "var(--color-primary)",
472
+ "--mona-indicator-foreground": "var(--color-primary-foreground)"
473
+ }),
474
+ effects: createDefaultThemeEffects(),
475
+ motion: motion$1,
476
+ shape: createDefaultThemeShape(),
477
+ shadows: annaThemeShadows.light
478
+ }),
479
+ dark: Object.freeze({
480
+ colors: annaThemeColors.dark,
481
+ components,
482
+ custom: Object.freeze({
483
+ "--mona-indicator-color": "var(--color-primary-border)",
484
+ "--mona-indicator-foreground": "#161718"
485
+ }),
486
+ effects: createDefaultThemeEffects(),
487
+ motion: motion$1,
488
+ shape: createDefaultThemeShape(),
489
+ shadows: annaThemeShadows.dark
490
+ })
491
+ }
385
492
  });
386
-
387
493
  const generatedRoles$1 = generateThemeColorPalette({
388
- primary: "#3f6be2",
389
- secondary: "#667085",
390
- success: "#3f8665",
391
- error: "#d64b4b",
392
- warning: "#a86c18",
393
- info: "#3978c6"
494
+ primary: "#3f6be2",
495
+ secondary: "#667085",
496
+ success: "#3f8665",
497
+ error: "#d64b4b",
498
+ warning: "#a86c18",
499
+ info: "#3978c6"
394
500
  });
395
501
  const light$3 = Object.freeze({
396
- "--color-canvas": "#fcfcfc",
397
- "--color-surface": "#ffffff",
398
- "--color-surface-muted": "#f3f4f5",
399
- "--color-surface-raised": "#fbfbfb",
400
- "--color-surface-overlay": "#f9f9fa",
401
- "--color-card": "var(--mona-effect-raised-background-color)",
402
- "--color-card-foreground": "var(--color-foreground)",
403
- "--color-foreground": "#252525",
404
- "--color-muted-foreground": "#626367",
405
- "--color-input-background": "#f3f4f5",
406
- "--color-input-foreground": "var(--color-foreground)",
407
- "--color-border-subtle": "#eeeeef",
408
- "--color-border": "#e4e4e6",
409
- "--color-border-control": "#d5d6d9",
410
- "--color-border-control-hover": "#c5c6ca",
411
- "--color-border-control-contrast": "#8a8b90",
412
- "--color-border-control-contrast-hover": "#76777c",
413
- "--color-hover": "#ecedef",
414
- "--color-active": "#e2e3e6",
415
- "--color-disabled-foreground": "#68696d",
416
- "--color-disabled-background": "#f0f0f1",
417
- "--color-disabled-border": "#e4e4e6",
418
- ...generatedRoles$1.light,
419
- "--color-primary": "#3f6be2",
420
- "--color-primary-foreground": "#ffffff",
421
- "--color-primary-hover": "#365fce",
422
- "--color-primary-active": "#2f54b8",
423
- "--color-primary-selected": "#2f54b8",
424
- "--color-primary-subtle": "#e5ebfb",
425
- "--color-primary-subtle-foreground": "#29478f",
426
- "--color-primary-border": "#3f6be2",
427
- "--color-accent": "#e5ebfb",
428
- "--color-accent-foreground": "#29478f",
429
- "--color-accent-hover": "#dce5fa",
430
- "--color-accent-active": "#d1dcf7",
431
- "--color-accent-dark": "var(--color-accent-active)",
432
- "--color-focus-indicator": "#3f6be2",
433
- "--color-selected": "#e5ebfb",
434
- "--color-selected-foreground": "#29478f",
435
- "--color-selected-hover": "#dce5fa",
436
- "--color-selected-hover-foreground": "#29478f",
437
- "--color-selected-active": "#d1dcf7",
438
- "--color-selected-active-foreground": "#29478f",
439
- "--color-selected-focus": "#dce5fa",
440
- "--color-selected-focus-foreground": "#29478f",
441
- "--color-selected-border": "#3f6be2",
442
- "--color-focus-surface": "#eef2ff",
443
- "--color-background": "var(--color-surface)",
444
- "--color-background-dark": "var(--color-surface-muted)",
445
- "--color-header-background": "var(--color-surface-muted)",
446
- "--color-header-foreground": "var(--color-foreground)",
447
- "--color-input-border": "var(--color-border-control)",
448
- "--color-input-hover": "var(--color-hover)",
449
- "--color-input-active": "var(--color-surface-raised)",
450
- "--color-popover": "var(--color-surface-overlay)",
451
- "--color-popover-foreground": "var(--color-foreground)",
452
- "--color-muted": "var(--color-surface-muted)",
453
- "--color-destructive": "var(--color-error)",
454
- "--color-destructive-foreground": "var(--color-error-foreground)",
455
- "--color-input": "var(--color-border-control)",
456
- "--color-disabled": "var(--color-disabled-foreground)",
457
- // Navigation is part of Luna's raised glass layer. Reduced-transparency mode replaces this with
458
- // the exact opaque raised fallback during runtime profile resolution.
459
- ...createSidebarColorRoles({ background: "var(--mona-effect-raised-background-color)" }),
460
- "--color-chart-1": "#3f6be2",
461
- "--color-chart-2": "#667085",
462
- "--color-chart-3": "#4f8a70",
463
- "--color-chart-4": "#b37a2b",
464
- "--color-chart-5": "#c55d5d",
465
- "--color-scrollbar-thumb": "#8a8b90",
466
- "--color-scrollbar-thumb-hover": "#76777c",
467
- "--color-scrollbar-thumb-active": "#626367",
468
- "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)",
469
- "--color-scrollbar-track": "var(--color-canvas)",
470
- "--color-scrollbar-track-hover": "var(--color-surface-muted)",
471
- "--color-scrollbar-track-active": "var(--color-hover)",
472
- "--color-scrollbar-track-focus": "var(--color-accent)",
473
- "--color-scrollbar-corner": "var(--color-canvas)"
502
+ "--color-canvas": "#fcfcfc",
503
+ "--color-surface": "#ffffff",
504
+ "--color-surface-muted": "#f3f4f5",
505
+ "--color-surface-raised": "#fbfbfb",
506
+ "--color-surface-overlay": "#f9f9fa",
507
+ "--color-card": "var(--mona-effect-raised-background-color)",
508
+ "--color-card-foreground": "var(--color-foreground)",
509
+ "--color-foreground": "#252525",
510
+ "--color-muted-foreground": "#626367",
511
+ "--color-input-background": "#f3f4f5",
512
+ "--color-input-foreground": "var(--color-foreground)",
513
+ "--color-border-subtle": "#eeeeef",
514
+ "--color-border": "#e4e4e6",
515
+ "--color-border-control": "#d5d6d9",
516
+ "--color-border-control-hover": "#c5c6ca",
517
+ "--color-border-control-contrast": "#8a8b90",
518
+ "--color-border-control-contrast-hover": "#76777c",
519
+ "--color-hover": "#ecedef",
520
+ "--color-active": "#e2e3e6",
521
+ "--color-disabled-foreground": "#68696d",
522
+ "--color-disabled-background": "#f0f0f1",
523
+ "--color-disabled-border": "#e4e4e6",
524
+ ...generatedRoles$1.light,
525
+ "--color-primary": "#3f6be2",
526
+ "--color-primary-foreground": "#ffffff",
527
+ "--color-primary-hover": "#365fce",
528
+ "--color-primary-active": "#2f54b8",
529
+ "--color-primary-selected": "#2f54b8",
530
+ "--color-primary-subtle": "#e5ebfb",
531
+ "--color-primary-subtle-foreground": "#29478f",
532
+ "--color-primary-border": "#3f6be2",
533
+ "--color-accent": "#e5ebfb",
534
+ "--color-accent-foreground": "#29478f",
535
+ "--color-accent-hover": "#dce5fa",
536
+ "--color-accent-active": "#d1dcf7",
537
+ "--color-accent-dark": "var(--color-accent-active)",
538
+ "--color-focus-indicator": "#3f6be2",
539
+ "--color-selected": "#e5ebfb",
540
+ "--color-selected-foreground": "#29478f",
541
+ "--color-selected-hover": "#dce5fa",
542
+ "--color-selected-hover-foreground": "#29478f",
543
+ "--color-selected-active": "#d1dcf7",
544
+ "--color-selected-active-foreground": "#29478f",
545
+ "--color-selected-focus": "#dce5fa",
546
+ "--color-selected-focus-foreground": "#29478f",
547
+ "--color-selected-border": "#3f6be2",
548
+ "--color-focus-surface": "#eef2ff",
549
+ "--color-background": "var(--color-surface)",
550
+ "--color-background-dark": "var(--color-surface-muted)",
551
+ "--color-header-background": "var(--color-surface-muted)",
552
+ "--color-header-foreground": "var(--color-foreground)",
553
+ "--color-input-border": "var(--color-border-control)",
554
+ "--color-input-hover": "var(--color-hover)",
555
+ "--color-input-active": "var(--color-surface-raised)",
556
+ "--color-popover": "var(--color-surface-overlay)",
557
+ "--color-popover-foreground": "var(--color-foreground)",
558
+ "--color-muted": "var(--color-surface-muted)",
559
+ "--color-destructive": "var(--color-error)",
560
+ "--color-destructive-foreground": "var(--color-error-foreground)",
561
+ "--color-input": "var(--color-border-control)",
562
+ "--color-disabled": "var(--color-disabled-foreground)",
563
+ ...createSidebarColorRoles({ background: "var(--mona-effect-raised-background-color)" }),
564
+ "--color-chart-1": "#3f6be2",
565
+ "--color-chart-2": "#667085",
566
+ "--color-chart-3": "#4f8a70",
567
+ "--color-chart-4": "#b37a2b",
568
+ "--color-chart-5": "#c55d5d",
569
+ "--color-scrollbar-thumb": "#8a8b90",
570
+ "--color-scrollbar-thumb-hover": "#76777c",
571
+ "--color-scrollbar-thumb-active": "#626367",
572
+ "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)",
573
+ "--color-scrollbar-track": "var(--color-canvas)",
574
+ "--color-scrollbar-track-hover": "var(--color-surface-muted)",
575
+ "--color-scrollbar-track-active": "var(--color-hover)",
576
+ "--color-scrollbar-track-focus": "var(--color-accent)",
577
+ "--color-scrollbar-corner": "var(--color-canvas)"
474
578
  });
475
579
  const dark$3 = Object.freeze({
476
- "--color-canvas": "#151515",
477
- "--color-surface": "#1b1b1c",
478
- "--color-surface-muted": "#252527",
479
- "--color-surface-raised": "#202022",
480
- "--color-surface-overlay": "#262628",
481
- "--color-card": "var(--mona-effect-raised-background-color)",
482
- "--color-card-foreground": "var(--color-foreground)",
483
- "--color-foreground": "#f5f5f6",
484
- "--color-muted-foreground": "#a9aaae",
485
- "--color-input-background": "#252527",
486
- "--color-input-foreground": "var(--color-foreground)",
487
- "--color-border-subtle": "#303033",
488
- "--color-border": "#39393d",
489
- "--color-border-control": "#494a4f",
490
- "--color-border-control-hover": "#5a5b61",
491
- "--color-border-control-contrast": "#74757a",
492
- "--color-border-control-contrast-hover": "#85868c",
493
- "--color-hover": "#2f2f32",
494
- "--color-active": "#3a3a3e",
495
- "--color-disabled-foreground": "#8f9095",
496
- "--color-disabled-background": "#222224",
497
- "--color-disabled-border": "#36363a",
498
- ...generatedRoles$1.dark,
499
- "--color-primary": "#6f8de8",
500
- "--color-primary-foreground": "#111522",
501
- "--color-primary-hover": "#7d99f0",
502
- "--color-primary-active": "#8ba6f8",
503
- "--color-primary-selected": "#8ba6f8",
504
- "--color-primary-subtle": "#293656",
505
- "--color-primary-subtle-foreground": "#e7ecff",
506
- "--color-primary-border": "#6f8de8",
507
- "--color-accent": "#293656",
508
- "--color-accent-foreground": "#e7ecff",
509
- "--color-accent-hover": "#32436c",
510
- "--color-accent-active": "#3b4e7c",
511
- "--color-accent-dark": "var(--color-accent-active)",
512
- "--color-focus-indicator": "#88a2f4",
513
- "--color-selected": "#293656",
514
- "--color-selected-foreground": "#e7ecff",
515
- "--color-selected-hover": "#32436c",
516
- "--color-selected-hover-foreground": "#eef2ff",
517
- "--color-selected-active": "#3b4e7c",
518
- "--color-selected-active-foreground": "#ffffff",
519
- "--color-selected-focus": "#344872",
520
- "--color-selected-focus-foreground": "#ffffff",
521
- "--color-selected-border": "#6f8de8",
522
- "--color-focus-surface": "#293656",
523
- "--color-background": "var(--color-surface)",
524
- "--color-background-dark": "var(--color-surface-muted)",
525
- "--color-header-background": "var(--color-surface-muted)",
526
- "--color-header-foreground": "var(--color-foreground)",
527
- "--color-input-border": "var(--color-border-control)",
528
- "--color-input-hover": "var(--color-hover)",
529
- "--color-input-active": "var(--color-surface-raised)",
530
- "--color-popover": "var(--color-surface-overlay)",
531
- "--color-popover-foreground": "var(--color-foreground)",
532
- "--color-muted": "var(--color-surface-muted)",
533
- "--color-destructive": "var(--color-error)",
534
- "--color-destructive-foreground": "var(--color-error-foreground)",
535
- "--color-input": "var(--color-border-control)",
536
- "--color-disabled": "var(--color-disabled-foreground)",
537
- // Keep navigation on the same independent raised-glass material as the light profile.
538
- ...createSidebarColorRoles({ background: "var(--mona-effect-raised-background-color)" }),
539
- "--color-chart-1": "#7f9bf0",
540
- "--color-chart-2": "#9ba3b2",
541
- "--color-chart-3": "#70aa8e",
542
- "--color-chart-4": "#d09a4c",
543
- "--color-chart-5": "#de7c7c",
544
- "--color-scrollbar-thumb": "#707176",
545
- "--color-scrollbar-thumb-hover": "#85868c",
546
- "--color-scrollbar-thumb-active": "#9a9ba1",
547
- "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)",
548
- "--color-scrollbar-track": "var(--color-canvas)",
549
- "--color-scrollbar-track-hover": "var(--color-surface-muted)",
550
- "--color-scrollbar-track-active": "var(--color-hover)",
551
- "--color-scrollbar-track-focus": "var(--color-accent)",
552
- "--color-scrollbar-corner": "var(--color-canvas)"
580
+ "--color-canvas": "#151515",
581
+ "--color-surface": "#1b1b1c",
582
+ "--color-surface-muted": "#252527",
583
+ "--color-surface-raised": "#202022",
584
+ "--color-surface-overlay": "#262628",
585
+ "--color-card": "var(--mona-effect-raised-background-color)",
586
+ "--color-card-foreground": "var(--color-foreground)",
587
+ "--color-foreground": "#f5f5f6",
588
+ "--color-muted-foreground": "#a9aaae",
589
+ "--color-input-background": "#252527",
590
+ "--color-input-foreground": "var(--color-foreground)",
591
+ "--color-border-subtle": "#303033",
592
+ "--color-border": "#39393d",
593
+ "--color-border-control": "#494a4f",
594
+ "--color-border-control-hover": "#5a5b61",
595
+ "--color-border-control-contrast": "#74757a",
596
+ "--color-border-control-contrast-hover": "#85868c",
597
+ "--color-hover": "#2f2f32",
598
+ "--color-active": "#3a3a3e",
599
+ "--color-disabled-foreground": "#8f9095",
600
+ "--color-disabled-background": "#222224",
601
+ "--color-disabled-border": "#36363a",
602
+ ...generatedRoles$1.dark,
603
+ "--color-primary": "#6f8de8",
604
+ "--color-primary-foreground": "#111522",
605
+ "--color-primary-hover": "#7d99f0",
606
+ "--color-primary-active": "#8ba6f8",
607
+ "--color-primary-selected": "#8ba6f8",
608
+ "--color-primary-subtle": "#293656",
609
+ "--color-primary-subtle-foreground": "#e7ecff",
610
+ "--color-primary-border": "#6f8de8",
611
+ "--color-accent": "#293656",
612
+ "--color-accent-foreground": "#e7ecff",
613
+ "--color-accent-hover": "#32436c",
614
+ "--color-accent-active": "#3b4e7c",
615
+ "--color-accent-dark": "var(--color-accent-active)",
616
+ "--color-focus-indicator": "#88a2f4",
617
+ "--color-selected": "#293656",
618
+ "--color-selected-foreground": "#e7ecff",
619
+ "--color-selected-hover": "#32436c",
620
+ "--color-selected-hover-foreground": "#eef2ff",
621
+ "--color-selected-active": "#3b4e7c",
622
+ "--color-selected-active-foreground": "#ffffff",
623
+ "--color-selected-focus": "#344872",
624
+ "--color-selected-focus-foreground": "#ffffff",
625
+ "--color-selected-border": "#6f8de8",
626
+ "--color-focus-surface": "#293656",
627
+ "--color-background": "var(--color-surface)",
628
+ "--color-background-dark": "var(--color-surface-muted)",
629
+ "--color-header-background": "var(--color-surface-muted)",
630
+ "--color-header-foreground": "var(--color-foreground)",
631
+ "--color-input-border": "var(--color-border-control)",
632
+ "--color-input-hover": "var(--color-hover)",
633
+ "--color-input-active": "var(--color-surface-raised)",
634
+ "--color-popover": "var(--color-surface-overlay)",
635
+ "--color-popover-foreground": "var(--color-foreground)",
636
+ "--color-muted": "var(--color-surface-muted)",
637
+ "--color-destructive": "var(--color-error)",
638
+ "--color-destructive-foreground": "var(--color-error-foreground)",
639
+ "--color-input": "var(--color-border-control)",
640
+ "--color-disabled": "var(--color-disabled-foreground)",
641
+ ...createSidebarColorRoles({ background: "var(--mona-effect-raised-background-color)" }),
642
+ "--color-chart-1": "#7f9bf0",
643
+ "--color-chart-2": "#9ba3b2",
644
+ "--color-chart-3": "#70aa8e",
645
+ "--color-chart-4": "#d09a4c",
646
+ "--color-chart-5": "#de7c7c",
647
+ "--color-scrollbar-thumb": "#707176",
648
+ "--color-scrollbar-thumb-hover": "#85868c",
649
+ "--color-scrollbar-thumb-active": "#9a9ba1",
650
+ "--color-scrollbar-thumb-focus": "var(--color-focus-indicator)",
651
+ "--color-scrollbar-track": "var(--color-canvas)",
652
+ "--color-scrollbar-track-hover": "var(--color-surface-muted)",
653
+ "--color-scrollbar-track-active": "var(--color-hover)",
654
+ "--color-scrollbar-track-focus": "var(--color-accent)",
655
+ "--color-scrollbar-corner": "var(--color-canvas)"
656
+ });
657
+ const lunaThemeColors = Object.freeze({
658
+ light: light$3,
659
+ dark: dark$3
553
660
  });
554
- const lunaThemeColors = Object.freeze({ light: light$3, dark: dark$3 });
555
-
556
661
  const light$2 = Object.freeze({
557
- "--shadow-control": "0 1px 2px rgb(20 20 20 / 0.04)",
558
- "--shadow-raised": "0 8px 24px -14px rgb(20 20 20 / 0.14), 0 2px 6px -3px rgb(20 20 20 / 0.06)",
559
- "--shadow-overlay": "0 18px 42px -20px rgb(20 20 20 / 0.22), 0 6px 16px -10px rgb(20 20 20 / 0.1)"
662
+ "--shadow-control": "0 1px 2px rgb(20 20 20 / 0.04)",
663
+ "--shadow-raised": "0 8px 24px -14px rgb(20 20 20 / 0.14), 0 2px 6px -3px rgb(20 20 20 / 0.06)",
664
+ "--shadow-overlay": "0 18px 42px -20px rgb(20 20 20 / 0.22), 0 6px 16px -10px rgb(20 20 20 / 0.1)"
560
665
  });
561
666
  const dark$2 = Object.freeze({
562
- "--shadow-control": "0 1px 2px rgb(0 0 0 / 0.28)",
563
- "--shadow-raised": "0 10px 26px -14px rgb(0 0 0 / 0.5), 0 2px 7px -4px rgb(0 0 0 / 0.34)",
564
- "--shadow-overlay": "0 20px 46px -20px rgb(0 0 0 / 0.62), 0 7px 18px -11px rgb(0 0 0 / 0.46)"
667
+ "--shadow-control": "0 1px 2px rgb(0 0 0 / 0.28)",
668
+ "--shadow-raised": "0 10px 26px -14px rgb(0 0 0 / 0.5), 0 2px 7px -4px rgb(0 0 0 / 0.34)",
669
+ "--shadow-overlay": "0 20px 46px -20px rgb(0 0 0 / 0.62), 0 7px 18px -11px rgb(0 0 0 / 0.46)"
670
+ });
671
+ const lunaThemeShadows = Object.freeze({
672
+ light: light$2,
673
+ dark: dark$2
565
674
  });
566
- const lunaThemeShadows = Object.freeze({ light: light$2, dark: dark$2 });
567
-
568
675
  const lunaTheme = Object.freeze({
569
- name: "luna",
570
- variants: {
571
- light: Object.freeze({
572
- colors: lunaThemeColors.light,
573
- shadows: lunaThemeShadows.light,
574
- motion: Object.freeze({
575
- "--mona-motion-fast": "180ms",
576
- "--mona-motion-standard": "320ms"
577
- }),
578
- effects: Object.freeze({
579
- "--mona-effect-control-background-color": "rgb(243 244 245 / 0.78)",
580
- "--mona-effect-control-fallback-background-color": "#f3f4f5",
581
- "--mona-effect-control-background-image": "none",
582
- "--mona-effect-control-backdrop-filter": "blur(16px) saturate(110%)",
583
- "--mona-effect-raised-background-color": "rgb(252 252 252 / 0.76)",
584
- "--mona-effect-raised-fallback-background-color": "#fbfbfb",
585
- "--mona-effect-raised-background-image": "none",
586
- "--mona-effect-raised-backdrop-filter": "blur(22px) saturate(112%)",
587
- "--mona-effect-overlay-background-color": "rgb(249 249 250 / 0.72)",
588
- "--mona-effect-overlay-fallback-background-color": "#f9f9fa",
589
- "--mona-effect-overlay-background-image": "none",
590
- "--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)"
591
- }),
592
- shape: createDefaultThemeShape(),
593
- custom: Object.freeze({
594
- "--mona-date-popup-calendar-backdrop-filter": "none",
595
- "--mona-date-popup-calendar-background": "transparent",
596
- "--mona-date-popup-calendar-background-image": "none",
597
- "--mona-dropdown-popup-list-background": "transparent",
598
- "--mona-input-addon-background": "color-mix(in srgb, var(--color-input-background), var(--color-foreground) 8%)",
599
- "--mona-menu-item-hover-background": "rgb(37 37 37 / 0.06)",
600
- "--mona-menu-item-hover-foreground": "var(--color-foreground)",
601
- "--mona-menubar-backdrop-filter": "var(--mona-effect-control-backdrop-filter)",
602
- "--mona-menubar-background-image": "var(--mona-effect-control-background-image)"
603
- }),
604
- components: Object.freeze({
605
- "--mona-calendar-background": "var(--mona-effect-raised-background-color)",
606
- "--mona-calendar-shadow": "var(--shadow-raised)",
607
- "--mona-list-background": "var(--color-surface)",
608
- "--mona-list-disabled-background": "var(--color-disabled-background)",
609
- "--mona-list-group-background": "rgb(37 37 37 / 0.05)",
610
- "--mona-list-group-border-width": "1px",
611
- "--mona-list-group-font-weight": "650",
612
- "--mona-menubar-background": "var(--mona-effect-control-background-color)",
613
- "--mona-menubar-shadow": "var(--shadow-control)",
614
- "--mona-pager-background": "var(--mona-effect-raised-background-color)",
615
- "--mona-slider-handle-border-color": "var(--color-border-control)"
616
- })
617
- }),
618
- dark: Object.freeze({
619
- colors: lunaThemeColors.dark,
620
- shadows: lunaThemeShadows.dark,
621
- motion: Object.freeze({
622
- "--mona-motion-fast": "180ms",
623
- "--mona-motion-standard": "320ms"
624
- }),
625
- effects: Object.freeze({
626
- "--mona-effect-control-background-color": "rgb(37 37 39 / 0.74)",
627
- "--mona-effect-control-fallback-background-color": "#252527",
628
- "--mona-effect-control-background-image": "none",
629
- "--mona-effect-control-backdrop-filter": "blur(16px) saturate(110%)",
630
- "--mona-effect-raised-background-color": "rgb(32 32 34 / 0.78)",
631
- "--mona-effect-raised-fallback-background-color": "#202022",
632
- "--mona-effect-raised-background-image": "none",
633
- "--mona-effect-raised-backdrop-filter": "blur(22px) saturate(112%)",
634
- "--mona-effect-overlay-background-color": "rgb(38 38 40 / 0.74)",
635
- "--mona-effect-overlay-fallback-background-color": "#262628",
636
- "--mona-effect-overlay-background-image": "none",
637
- "--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)"
638
- }),
639
- shape: createDefaultThemeShape(),
640
- custom: Object.freeze({
641
- "--mona-date-popup-calendar-backdrop-filter": "none",
642
- "--mona-date-popup-calendar-background": "transparent",
643
- "--mona-date-popup-calendar-background-image": "none",
644
- "--mona-dropdown-popup-list-background": "transparent",
645
- "--mona-input-addon-background": "color-mix(in srgb, var(--color-input-background), var(--color-foreground) 8%)",
646
- "--mona-menubar-backdrop-filter": "var(--mona-effect-control-backdrop-filter)",
647
- "--mona-menubar-background-image": "var(--mona-effect-control-background-image)"
648
- }),
649
- components: Object.freeze({
650
- "--mona-calendar-background": "var(--mona-effect-raised-background-color)",
651
- "--mona-calendar-shadow": "var(--shadow-raised)",
652
- "--mona-list-background": "var(--color-surface)",
653
- "--mona-list-disabled-background": "var(--color-disabled-background)",
654
- "--mona-list-group-background": "rgb(255 255 255 / 0.04)",
655
- "--mona-list-group-border-width": "1px",
656
- "--mona-list-group-font-weight": "650",
657
- "--mona-menubar-background": "var(--mona-effect-control-background-color)",
658
- "--mona-menubar-shadow": "var(--shadow-control)",
659
- "--mona-pager-background": "var(--mona-effect-raised-background-color)",
660
- "--mona-slider-handle-border-color": "var(--color-border-control)"
661
- })
662
- })
663
- }
676
+ name: "luna",
677
+ variants: {
678
+ light: Object.freeze({
679
+ colors: lunaThemeColors.light,
680
+ shadows: lunaThemeShadows.light,
681
+ motion: Object.freeze({
682
+ "--mona-motion-fast": "180ms",
683
+ "--mona-motion-standard": "320ms"
684
+ }),
685
+ effects: Object.freeze({
686
+ "--mona-effect-control-background-color": "rgb(243 244 245 / 0.78)",
687
+ "--mona-effect-control-fallback-background-color": "#f3f4f5",
688
+ "--mona-effect-control-background-image": "none",
689
+ "--mona-effect-control-backdrop-filter": "blur(16px) saturate(110%)",
690
+ "--mona-effect-raised-background-color": "rgb(252 252 252 / 0.76)",
691
+ "--mona-effect-raised-fallback-background-color": "#fbfbfb",
692
+ "--mona-effect-raised-background-image": "none",
693
+ "--mona-effect-raised-backdrop-filter": "blur(22px) saturate(112%)",
694
+ "--mona-effect-overlay-background-color": "rgb(249 249 250 / 0.72)",
695
+ "--mona-effect-overlay-fallback-background-color": "#f9f9fa",
696
+ "--mona-effect-overlay-background-image": "none",
697
+ "--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)"
698
+ }),
699
+ shape: createDefaultThemeShape(),
700
+ custom: Object.freeze({
701
+ "--mona-date-popup-calendar-backdrop-filter": "none",
702
+ "--mona-date-popup-calendar-background": "transparent",
703
+ "--mona-date-popup-calendar-background-image": "none",
704
+ "--mona-dropdown-popup-list-background": "transparent",
705
+ "--mona-input-addon-background": "color-mix(in srgb, var(--color-input-background), var(--color-foreground) 8%)",
706
+ "--mona-menu-item-hover-background": "rgb(37 37 37 / 0.06)",
707
+ "--mona-menu-item-hover-foreground": "var(--color-foreground)",
708
+ "--mona-menubar-backdrop-filter": "var(--mona-effect-control-backdrop-filter)",
709
+ "--mona-menubar-background-image": "var(--mona-effect-control-background-image)"
710
+ }),
711
+ components: Object.freeze({
712
+ "--mona-calendar-background": "var(--mona-effect-raised-background-color)",
713
+ "--mona-calendar-shadow": "var(--shadow-raised)",
714
+ "--mona-list-background": "var(--color-surface)",
715
+ "--mona-list-disabled-background": "var(--color-disabled-background)",
716
+ "--mona-list-group-background": "rgb(37 37 37 / 0.05)",
717
+ "--mona-list-group-border-width": "1px",
718
+ "--mona-list-group-font-weight": "650",
719
+ "--mona-menubar-background": "var(--mona-effect-control-background-color)",
720
+ "--mona-menubar-shadow": "var(--shadow-control)",
721
+ "--mona-pager-background": "var(--mona-effect-raised-background-color)",
722
+ "--mona-slider-handle-border-color": "var(--color-border-control)"
723
+ })
724
+ }),
725
+ dark: Object.freeze({
726
+ colors: lunaThemeColors.dark,
727
+ shadows: lunaThemeShadows.dark,
728
+ motion: Object.freeze({
729
+ "--mona-motion-fast": "180ms",
730
+ "--mona-motion-standard": "320ms"
731
+ }),
732
+ effects: Object.freeze({
733
+ "--mona-effect-control-background-color": "rgb(37 37 39 / 0.74)",
734
+ "--mona-effect-control-fallback-background-color": "#252527",
735
+ "--mona-effect-control-background-image": "none",
736
+ "--mona-effect-control-backdrop-filter": "blur(16px) saturate(110%)",
737
+ "--mona-effect-raised-background-color": "rgb(32 32 34 / 0.78)",
738
+ "--mona-effect-raised-fallback-background-color": "#202022",
739
+ "--mona-effect-raised-background-image": "none",
740
+ "--mona-effect-raised-backdrop-filter": "blur(22px) saturate(112%)",
741
+ "--mona-effect-overlay-background-color": "rgb(38 38 40 / 0.74)",
742
+ "--mona-effect-overlay-fallback-background-color": "#262628",
743
+ "--mona-effect-overlay-background-image": "none",
744
+ "--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)"
745
+ }),
746
+ shape: createDefaultThemeShape(),
747
+ custom: Object.freeze({
748
+ "--mona-date-popup-calendar-backdrop-filter": "none",
749
+ "--mona-date-popup-calendar-background": "transparent",
750
+ "--mona-date-popup-calendar-background-image": "none",
751
+ "--mona-dropdown-popup-list-background": "transparent",
752
+ "--mona-input-addon-background": "color-mix(in srgb, var(--color-input-background), var(--color-foreground) 8%)",
753
+ "--mona-menubar-backdrop-filter": "var(--mona-effect-control-backdrop-filter)",
754
+ "--mona-menubar-background-image": "var(--mona-effect-control-background-image)"
755
+ }),
756
+ components: Object.freeze({
757
+ "--mona-calendar-background": "var(--mona-effect-raised-background-color)",
758
+ "--mona-calendar-shadow": "var(--shadow-raised)",
759
+ "--mona-list-background": "var(--color-surface)",
760
+ "--mona-list-disabled-background": "var(--color-disabled-background)",
761
+ "--mona-list-group-background": "rgb(255 255 255 / 0.04)",
762
+ "--mona-list-group-border-width": "1px",
763
+ "--mona-list-group-font-weight": "650",
764
+ "--mona-menubar-background": "var(--mona-effect-control-background-color)",
765
+ "--mona-menubar-shadow": "var(--shadow-control)",
766
+ "--mona-pager-background": "var(--mona-effect-raised-background-color)",
767
+ "--mona-slider-handle-border-color": "var(--color-border-control)"
768
+ })
769
+ })
770
+ }
664
771
  });
665
-
666
- // The public seed API requires a primary color. Mona replaces the generated identity roles with
667
- // the neutral definitions below and keeps the generated output only for chromatic status roles.
668
772
  const generatedRoles = generateThemeColorPalette({
669
- primary: "oklch(20.5% 0.006 285.885)",
670
- secondary: "oklch(55.2% 0.010 285.938)",
671
- success: "oklch(62% 0.14 150)",
672
- error: "oklch(58% 0.19 25)",
673
- warning: "oklch(72% 0.14 75)",
674
- info: "oklch(60% 0.15 255)"
773
+ primary: "oklch(20.5% 0.006 285.885)",
774
+ secondary: "oklch(55.2% 0.010 285.938)",
775
+ success: "oklch(62% 0.14 150)",
776
+ error: "oklch(58% 0.19 25)",
777
+ warning: "oklch(72% 0.14 75)",
778
+ info: "oklch(60% 0.15 255)"
675
779
  });
676
780
  const lightNeutralRoles = Object.freeze({
677
- "--color-primary": "oklch(20.5% 0.006 285.885)",
678
- "--color-primary-foreground": "oklch(98.5% 0 0)",
679
- "--color-primary-hover": "oklch(26.9% 0.006 285.885)",
680
- "--color-primary-active": "oklch(14.1% 0.005 285.823)",
681
- "--color-primary-selected": "oklch(14.1% 0.005 285.823)",
682
- "--color-primary-subtle": "oklch(96.7% 0.001 286.375)",
683
- "--color-primary-subtle-foreground": "oklch(26.9% 0.006 285.885)",
684
- "--color-primary-border": "oklch(55.2% 0.010 285.938)",
685
- "--color-secondary": "oklch(92.2% 0.004 286.320)",
686
- "--color-secondary-foreground": "oklch(20.5% 0.006 285.885)",
687
- "--color-secondary-hover": "oklch(87.1% 0.006 286.286)",
688
- "--color-secondary-active": "oklch(80.5% 0.008 286.067)",
689
- "--color-secondary-selected": "oklch(80.5% 0.008 286.067)",
690
- "--color-secondary-subtle": "oklch(96.7% 0.001 286.375)",
691
- "--color-secondary-subtle-foreground": "oklch(26.9% 0.006 285.885)",
692
- "--color-secondary-border": "oklch(55.2% 0.010 285.938)",
693
- "--color-accent": "oklch(96.7% 0.001 286.375)",
694
- "--color-accent-foreground": "oklch(20.5% 0.006 285.885)",
695
- "--color-accent-hover": "oklch(92.2% 0.004 286.320)",
696
- "--color-accent-active": "oklch(87.1% 0.006 286.286)",
697
- "--color-accent-dark": "var(--color-accent-active)",
698
- "--color-selected": "var(--color-accent)",
699
- "--color-focus-indicator": "var(--color-primary)"
781
+ "--color-primary": "oklch(20.5% 0.006 285.885)",
782
+ "--color-primary-foreground": "oklch(98.5% 0 0)",
783
+ "--color-primary-hover": "oklch(26.9% 0.006 285.885)",
784
+ "--color-primary-active": "oklch(14.1% 0.005 285.823)",
785
+ "--color-primary-selected": "oklch(14.1% 0.005 285.823)",
786
+ "--color-primary-subtle": "oklch(96.7% 0.001 286.375)",
787
+ "--color-primary-subtle-foreground": "oklch(26.9% 0.006 285.885)",
788
+ "--color-primary-border": "oklch(55.2% 0.010 285.938)",
789
+ "--color-secondary": "oklch(92.2% 0.004 286.320)",
790
+ "--color-secondary-foreground": "oklch(20.5% 0.006 285.885)",
791
+ "--color-secondary-hover": "oklch(87.1% 0.006 286.286)",
792
+ "--color-secondary-active": "oklch(80.5% 0.008 286.067)",
793
+ "--color-secondary-selected": "oklch(80.5% 0.008 286.067)",
794
+ "--color-secondary-subtle": "oklch(96.7% 0.001 286.375)",
795
+ "--color-secondary-subtle-foreground": "oklch(26.9% 0.006 285.885)",
796
+ "--color-secondary-border": "oklch(55.2% 0.010 285.938)",
797
+ "--color-accent": "oklch(96.7% 0.001 286.375)",
798
+ "--color-accent-foreground": "oklch(20.5% 0.006 285.885)",
799
+ "--color-accent-hover": "oklch(92.2% 0.004 286.320)",
800
+ "--color-accent-active": "oklch(87.1% 0.006 286.286)",
801
+ "--color-accent-dark": "var(--color-accent-active)",
802
+ "--color-selected": "var(--color-accent)",
803
+ "--color-focus-indicator": "var(--color-primary)"
700
804
  });
701
805
  const darkNeutralRoles = Object.freeze({
702
- "--color-primary": "oklch(92.2% 0.004 286.320)",
703
- "--color-primary-foreground": "oklch(20.5% 0.006 285.885)",
704
- "--color-primary-hover": "oklch(87.1% 0.006 286.286)",
705
- "--color-primary-active": "oklch(80.5% 0.008 286.067)",
706
- "--color-primary-selected": "oklch(80.5% 0.008 286.067)",
707
- "--color-primary-subtle": "oklch(27.4% 0.006 286.033)",
708
- "--color-primary-subtle-foreground": "oklch(92.2% 0.004 286.320)",
709
- "--color-primary-border": "oklch(65% 0.010 286.067)",
710
- "--color-secondary": "oklch(27.4% 0.006 286.033)",
711
- "--color-secondary-foreground": "oklch(98.5% 0 0)",
712
- "--color-secondary-hover": "oklch(37.1% 0.008 285.805)",
713
- "--color-secondary-active": "oklch(43.9% 0.010 285.938)",
714
- "--color-secondary-selected": "oklch(43.9% 0.010 285.938)",
715
- "--color-secondary-subtle": "oklch(27.4% 0.006 286.033)",
716
- "--color-secondary-subtle-foreground": "oklch(92.2% 0.004 286.320)",
717
- "--color-secondary-border": "oklch(65% 0.010 286.067)",
718
- "--color-accent": "oklch(27.4% 0.006 286.033)",
719
- "--color-accent-foreground": "oklch(98.5% 0 0)",
720
- "--color-accent-hover": "oklch(37.1% 0.008 285.805)",
721
- "--color-accent-active": "oklch(43.9% 0.010 285.938)",
722
- "--color-accent-dark": "var(--color-accent-active)",
723
- "--color-selected": "var(--color-accent)",
724
- "--color-focus-indicator": "var(--color-primary)"
806
+ "--color-primary": "oklch(92.2% 0.004 286.320)",
807
+ "--color-primary-foreground": "oklch(20.5% 0.006 285.885)",
808
+ "--color-primary-hover": "oklch(87.1% 0.006 286.286)",
809
+ "--color-primary-active": "oklch(80.5% 0.008 286.067)",
810
+ "--color-primary-selected": "oklch(80.5% 0.008 286.067)",
811
+ "--color-primary-subtle": "oklch(27.4% 0.006 286.033)",
812
+ "--color-primary-subtle-foreground": "oklch(92.2% 0.004 286.320)",
813
+ "--color-primary-border": "oklch(65% 0.010 286.067)",
814
+ "--color-secondary": "oklch(27.4% 0.006 286.033)",
815
+ "--color-secondary-foreground": "oklch(98.5% 0 0)",
816
+ "--color-secondary-hover": "oklch(37.1% 0.008 285.805)",
817
+ "--color-secondary-active": "oklch(43.9% 0.010 285.938)",
818
+ "--color-secondary-selected": "oklch(43.9% 0.010 285.938)",
819
+ "--color-secondary-subtle": "oklch(27.4% 0.006 286.033)",
820
+ "--color-secondary-subtle-foreground": "oklch(92.2% 0.004 286.320)",
821
+ "--color-secondary-border": "oklch(65% 0.010 286.067)",
822
+ "--color-accent": "oklch(27.4% 0.006 286.033)",
823
+ "--color-accent-foreground": "oklch(98.5% 0 0)",
824
+ "--color-accent-hover": "oklch(37.1% 0.008 285.805)",
825
+ "--color-accent-active": "oklch(43.9% 0.010 285.938)",
826
+ "--color-accent-dark": "var(--color-accent-active)",
827
+ "--color-selected": "var(--color-accent)",
828
+ "--color-focus-indicator": "var(--color-primary)"
725
829
  });
726
830
  const light$1 = Object.freeze({
727
- "--color-canvas": "oklch(98.5% 0 0)",
728
- "--color-surface": "oklch(100% 0 0)",
729
- "--color-surface-muted": "oklch(96.7% 0.001 286.375)",
730
- "--color-surface-raised": "oklch(100% 0 0)",
731
- "--color-surface-overlay": "oklch(100% 0 0)",
732
- "--color-card": "var(--color-surface-raised)",
733
- "--color-card-foreground": "var(--color-foreground)",
734
- "--color-foreground": "oklch(14.1% 0.005 285.823)",
735
- "--color-muted-foreground": "oklch(50% 0.016 285.938)",
736
- "--color-input-background": "oklch(100% 0 0)",
737
- "--color-input-foreground": "var(--color-foreground)",
738
- "--color-border-subtle": "oklch(94% 0.002 286.320)",
739
- "--color-border": "oklch(92.2% 0.004 286.320)",
740
- "--color-border-control": "oklch(87.1% 0.006 286.286)",
741
- "--color-border-control-hover": "oklch(80.5% 0.008 286.067)",
742
- "--color-border-control-contrast": "oklch(64% 0.010 286.067)",
743
- "--color-border-control-contrast-hover": "oklch(55.2% 0.010 285.938)",
744
- "--color-hover": "oklch(96.7% 0.001 286.375)",
745
- "--color-active": "oklch(92.2% 0.004 286.320)",
746
- "--color-disabled-foreground": "oklch(46% 0.010 285.938)",
747
- "--color-disabled-background": "oklch(96.7% 0.001 286.375)",
748
- "--color-disabled-border": "oklch(92.2% 0.004 286.320)",
749
- ...generatedRoles.light,
750
- ...lightNeutralRoles,
751
- "--color-selected": "var(--color-active)",
752
- "--color-selected-foreground": "var(--color-foreground)",
753
- "--color-selected-hover": "var(--color-active)",
754
- "--color-selected-hover-foreground": "var(--color-foreground)",
755
- "--color-selected-active": "var(--color-active)",
756
- "--color-selected-active-foreground": "var(--color-foreground)",
757
- "--color-selected-focus": "var(--color-active)",
758
- "--color-selected-focus-foreground": "var(--color-foreground)",
759
- "--color-selected-border": "var(--color-primary)",
760
- "--color-focus-surface": "var(--color-surface-muted)",
761
- "--color-background": "var(--color-surface)",
762
- "--color-background-dark": "var(--color-surface-muted)",
763
- "--color-header-background": "var(--color-surface-muted)",
764
- "--color-header-foreground": "var(--color-foreground)",
765
- "--color-input-border": "var(--color-border-control)",
766
- "--color-input-hover": "var(--color-hover)",
767
- "--color-input-active": "var(--color-surface-raised)",
768
- "--color-popover": "var(--color-surface-overlay)",
769
- "--color-popover-foreground": "var(--color-foreground)",
770
- "--color-muted": "var(--color-surface-muted)",
771
- "--color-destructive": "var(--color-error)",
772
- "--color-destructive-foreground": "var(--color-error-foreground)",
773
- "--color-input": "var(--color-border-control)",
774
- "--color-disabled": "var(--color-disabled-foreground)",
775
- // Mona's content sits on pure white, so the sidebar takes the canvas tone to read as chrome
776
- // rather than as another card.
777
- ...createSidebarColorRoles({ background: "var(--color-canvas)" }),
778
- "--color-chart-1": "oklch(20.5% 0.006 285.885)",
779
- "--color-chart-2": "oklch(34% 0.008 285.805)",
780
- "--color-chart-3": "oklch(46% 0.010 285.938)",
781
- "--color-chart-4": "oklch(55.2% 0.010 285.938)",
782
- "--color-chart-5": "oklch(63% 0.010 286.067)",
783
- "--color-scrollbar-thumb": "oklch(64% 0.010 286.067)",
784
- "--color-scrollbar-thumb-hover": "oklch(55.2% 0.010 285.938)",
785
- "--color-scrollbar-thumb-active": "oklch(46% 0.010 285.938)",
786
- "--color-scrollbar-thumb-focus": "var(--color-primary)",
787
- "--color-scrollbar-track": "var(--color-canvas)",
788
- "--color-scrollbar-track-hover": "var(--color-surface-muted)",
789
- "--color-scrollbar-track-active": "var(--color-hover)",
790
- "--color-scrollbar-track-focus": "var(--color-accent)",
791
- "--color-scrollbar-corner": "var(--color-canvas)"
831
+ "--color-canvas": "oklch(98.5% 0 0)",
832
+ "--color-surface": "oklch(100% 0 0)",
833
+ "--color-surface-muted": "oklch(96.7% 0.001 286.375)",
834
+ "--color-surface-raised": "oklch(100% 0 0)",
835
+ "--color-surface-overlay": "oklch(100% 0 0)",
836
+ "--color-card": "var(--color-surface-raised)",
837
+ "--color-card-foreground": "var(--color-foreground)",
838
+ "--color-foreground": "oklch(14.1% 0.005 285.823)",
839
+ "--color-muted-foreground": "oklch(50% 0.016 285.938)",
840
+ "--color-input-background": "oklch(100% 0 0)",
841
+ "--color-input-foreground": "var(--color-foreground)",
842
+ "--color-border-subtle": "oklch(94% 0.002 286.320)",
843
+ "--color-border": "oklch(92.2% 0.004 286.320)",
844
+ "--color-border-control": "oklch(87.1% 0.006 286.286)",
845
+ "--color-border-control-hover": "oklch(80.5% 0.008 286.067)",
846
+ "--color-border-control-contrast": "oklch(64% 0.010 286.067)",
847
+ "--color-border-control-contrast-hover": "oklch(55.2% 0.010 285.938)",
848
+ "--color-hover": "oklch(96.7% 0.001 286.375)",
849
+ "--color-active": "oklch(92.2% 0.004 286.320)",
850
+ "--color-disabled-foreground": "oklch(46% 0.010 285.938)",
851
+ "--color-disabled-background": "oklch(96.7% 0.001 286.375)",
852
+ "--color-disabled-border": "oklch(92.2% 0.004 286.320)",
853
+ ...generatedRoles.light,
854
+ ...lightNeutralRoles,
855
+ "--color-selected": "var(--color-active)",
856
+ "--color-selected-foreground": "var(--color-foreground)",
857
+ "--color-selected-hover": "var(--color-active)",
858
+ "--color-selected-hover-foreground": "var(--color-foreground)",
859
+ "--color-selected-active": "var(--color-active)",
860
+ "--color-selected-active-foreground": "var(--color-foreground)",
861
+ "--color-selected-focus": "var(--color-active)",
862
+ "--color-selected-focus-foreground": "var(--color-foreground)",
863
+ "--color-selected-border": "var(--color-primary)",
864
+ "--color-focus-surface": "var(--color-surface-muted)",
865
+ "--color-background": "var(--color-surface)",
866
+ "--color-background-dark": "var(--color-surface-muted)",
867
+ "--color-header-background": "var(--color-surface-muted)",
868
+ "--color-header-foreground": "var(--color-foreground)",
869
+ "--color-input-border": "var(--color-border-control)",
870
+ "--color-input-hover": "var(--color-hover)",
871
+ "--color-input-active": "var(--color-surface-raised)",
872
+ "--color-popover": "var(--color-surface-overlay)",
873
+ "--color-popover-foreground": "var(--color-foreground)",
874
+ "--color-muted": "var(--color-surface-muted)",
875
+ "--color-destructive": "var(--color-error)",
876
+ "--color-destructive-foreground": "var(--color-error-foreground)",
877
+ "--color-input": "var(--color-border-control)",
878
+ "--color-disabled": "var(--color-disabled-foreground)",
879
+ ...createSidebarColorRoles({ background: "var(--color-canvas)" }),
880
+ "--color-chart-1": "oklch(20.5% 0.006 285.885)",
881
+ "--color-chart-2": "oklch(34% 0.008 285.805)",
882
+ "--color-chart-3": "oklch(46% 0.010 285.938)",
883
+ "--color-chart-4": "oklch(55.2% 0.010 285.938)",
884
+ "--color-chart-5": "oklch(63% 0.010 286.067)",
885
+ "--color-scrollbar-thumb": "oklch(64% 0.010 286.067)",
886
+ "--color-scrollbar-thumb-hover": "oklch(55.2% 0.010 285.938)",
887
+ "--color-scrollbar-thumb-active": "oklch(46% 0.010 285.938)",
888
+ "--color-scrollbar-thumb-focus": "var(--color-primary)",
889
+ "--color-scrollbar-track": "var(--color-canvas)",
890
+ "--color-scrollbar-track-hover": "var(--color-surface-muted)",
891
+ "--color-scrollbar-track-active": "var(--color-hover)",
892
+ "--color-scrollbar-track-focus": "var(--color-accent)",
893
+ "--color-scrollbar-corner": "var(--color-canvas)"
792
894
  });
793
895
  const dark$1 = Object.freeze({
794
- "--color-canvas": "oklch(14.1% 0.005 285.823)",
795
- "--color-surface": "oklch(18% 0.006 285.885)",
796
- "--color-surface-muted": "oklch(20.5% 0.006 285.885)",
797
- "--color-surface-raised": "oklch(24% 0.006 286.033)",
798
- "--color-surface-overlay": "oklch(27.4% 0.006 286.033)",
799
- "--color-card": "var(--color-surface-raised)",
800
- "--color-card-foreground": "var(--color-foreground)",
801
- "--color-foreground": "oklch(98.5% 0 0)",
802
- "--color-muted-foreground": "oklch(75% 0.015 286.067)",
803
- "--color-input-background": "oklch(20.5% 0.006 285.885)",
804
- "--color-input-foreground": "var(--color-foreground)",
805
- "--color-border-subtle": "oklch(24% 0.006 286.033)",
806
- "--color-border": "oklch(30% 0.007 286.033)",
807
- "--color-border-control": "oklch(32% 0.008 285.938)",
808
- "--color-border-control-hover": "oklch(37.1% 0.008 285.805)",
809
- "--color-border-control-contrast": "oklch(56% 0.010 286.067)",
810
- "--color-border-control-contrast-hover": "oklch(65% 0.010 286.067)",
811
- "--color-hover": "oklch(32% 0.007 286.033)",
812
- "--color-active": "oklch(37.1% 0.008 285.805)",
813
- "--color-disabled-foreground": "oklch(70.5% 0.010 286.067)",
814
- "--color-disabled-background": "oklch(27.4% 0.006 286.033)",
815
- "--color-disabled-border": "oklch(30% 0.007 286.033)",
816
- ...generatedRoles.dark,
817
- ...darkNeutralRoles,
818
- "--color-selected": "var(--color-active)",
819
- "--color-selected-foreground": "var(--color-foreground)",
820
- "--color-selected-hover": "var(--color-active)",
821
- "--color-selected-hover-foreground": "var(--color-foreground)",
822
- "--color-selected-active": "var(--color-active)",
823
- "--color-selected-active-foreground": "var(--color-foreground)",
824
- "--color-selected-focus": "var(--color-active)",
825
- "--color-selected-focus-foreground": "var(--color-foreground)",
826
- "--color-selected-border": "var(--color-primary)",
827
- "--color-focus-surface": "var(--color-surface-muted)",
828
- "--color-background": "var(--color-surface)",
829
- "--color-background-dark": "var(--color-surface-muted)",
830
- "--color-header-background": "var(--color-surface-muted)",
831
- "--color-header-foreground": "var(--color-foreground)",
832
- "--color-input-border": "var(--color-border-control)",
833
- "--color-input-hover": "var(--color-hover)",
834
- "--color-input-active": "var(--color-surface-raised)",
835
- "--color-popover": "var(--color-surface-overlay)",
836
- "--color-popover-foreground": "var(--color-foreground)",
837
- "--color-muted": "var(--color-surface-muted)",
838
- "--color-destructive": "var(--color-error)",
839
- "--color-destructive-foreground": "var(--color-error-foreground)",
840
- "--color-input": "var(--color-border-control)",
841
- "--color-disabled": "var(--color-disabled-foreground)",
842
- // Dark mode inverts the relationship: the canvas is the darkest tone, so the sidebar lifts off it
843
- // instead of sinking into it.
844
- ...createSidebarColorRoles({ background: "var(--color-surface-muted)" }),
845
- "--color-chart-1": "oklch(92.2% 0.004 286.320)",
846
- "--color-chart-2": "oklch(80.5% 0.008 286.067)",
847
- "--color-chart-3": "oklch(70.5% 0.010 286.067)",
848
- "--color-chart-4": "oklch(62% 0.010 286.067)",
849
- "--color-chart-5": "oklch(54% 0.010 285.938)",
850
- "--color-scrollbar-thumb": "oklch(54% 0.010 285.938)",
851
- "--color-scrollbar-thumb-hover": "oklch(62% 0.010 286.067)",
852
- "--color-scrollbar-thumb-active": "oklch(70.5% 0.010 286.067)",
853
- "--color-scrollbar-thumb-focus": "var(--color-primary)",
854
- "--color-scrollbar-track": "var(--color-canvas)",
855
- "--color-scrollbar-track-hover": "var(--color-surface-muted)",
856
- "--color-scrollbar-track-active": "var(--color-hover)",
857
- "--color-scrollbar-track-focus": "var(--color-accent)",
858
- "--color-scrollbar-corner": "var(--color-canvas)"
896
+ "--color-canvas": "oklch(14.1% 0.005 285.823)",
897
+ "--color-surface": "oklch(18% 0.006 285.885)",
898
+ "--color-surface-muted": "oklch(20.5% 0.006 285.885)",
899
+ "--color-surface-raised": "oklch(24% 0.006 286.033)",
900
+ "--color-surface-overlay": "oklch(27.4% 0.006 286.033)",
901
+ "--color-card": "var(--color-surface-raised)",
902
+ "--color-card-foreground": "var(--color-foreground)",
903
+ "--color-foreground": "oklch(98.5% 0 0)",
904
+ "--color-muted-foreground": "oklch(75% 0.015 286.067)",
905
+ "--color-input-background": "oklch(20.5% 0.006 285.885)",
906
+ "--color-input-foreground": "var(--color-foreground)",
907
+ "--color-border-subtle": "oklch(24% 0.006 286.033)",
908
+ "--color-border": "oklch(30% 0.007 286.033)",
909
+ "--color-border-control": "oklch(32% 0.008 285.938)",
910
+ "--color-border-control-hover": "oklch(37.1% 0.008 285.805)",
911
+ "--color-border-control-contrast": "oklch(56% 0.010 286.067)",
912
+ "--color-border-control-contrast-hover": "oklch(65% 0.010 286.067)",
913
+ "--color-hover": "oklch(32% 0.007 286.033)",
914
+ "--color-active": "oklch(37.1% 0.008 285.805)",
915
+ "--color-disabled-foreground": "oklch(70.5% 0.010 286.067)",
916
+ "--color-disabled-background": "oklch(27.4% 0.006 286.033)",
917
+ "--color-disabled-border": "oklch(30% 0.007 286.033)",
918
+ ...generatedRoles.dark,
919
+ ...darkNeutralRoles,
920
+ "--color-selected": "var(--color-active)",
921
+ "--color-selected-foreground": "var(--color-foreground)",
922
+ "--color-selected-hover": "var(--color-active)",
923
+ "--color-selected-hover-foreground": "var(--color-foreground)",
924
+ "--color-selected-active": "var(--color-active)",
925
+ "--color-selected-active-foreground": "var(--color-foreground)",
926
+ "--color-selected-focus": "var(--color-active)",
927
+ "--color-selected-focus-foreground": "var(--color-foreground)",
928
+ "--color-selected-border": "var(--color-primary)",
929
+ "--color-focus-surface": "var(--color-surface-muted)",
930
+ "--color-background": "var(--color-surface)",
931
+ "--color-background-dark": "var(--color-surface-muted)",
932
+ "--color-header-background": "var(--color-surface-muted)",
933
+ "--color-header-foreground": "var(--color-foreground)",
934
+ "--color-input-border": "var(--color-border-control)",
935
+ "--color-input-hover": "var(--color-hover)",
936
+ "--color-input-active": "var(--color-surface-raised)",
937
+ "--color-popover": "var(--color-surface-overlay)",
938
+ "--color-popover-foreground": "var(--color-foreground)",
939
+ "--color-muted": "var(--color-surface-muted)",
940
+ "--color-destructive": "var(--color-error)",
941
+ "--color-destructive-foreground": "var(--color-error-foreground)",
942
+ "--color-input": "var(--color-border-control)",
943
+ "--color-disabled": "var(--color-disabled-foreground)",
944
+ ...createSidebarColorRoles({ background: "var(--color-surface-muted)" }),
945
+ "--color-chart-1": "oklch(92.2% 0.004 286.320)",
946
+ "--color-chart-2": "oklch(80.5% 0.008 286.067)",
947
+ "--color-chart-3": "oklch(70.5% 0.010 286.067)",
948
+ "--color-chart-4": "oklch(62% 0.010 286.067)",
949
+ "--color-chart-5": "oklch(54% 0.010 285.938)",
950
+ "--color-scrollbar-thumb": "oklch(54% 0.010 285.938)",
951
+ "--color-scrollbar-thumb-hover": "oklch(62% 0.010 286.067)",
952
+ "--color-scrollbar-thumb-active": "oklch(70.5% 0.010 286.067)",
953
+ "--color-scrollbar-thumb-focus": "var(--color-primary)",
954
+ "--color-scrollbar-track": "var(--color-canvas)",
955
+ "--color-scrollbar-track-hover": "var(--color-surface-muted)",
956
+ "--color-scrollbar-track-active": "var(--color-hover)",
957
+ "--color-scrollbar-track-focus": "var(--color-accent)",
958
+ "--color-scrollbar-corner": "var(--color-canvas)"
959
+ });
960
+ const monaThemeColors = Object.freeze({
961
+ light: light$1,
962
+ dark: dark$1
859
963
  });
860
- const monaThemeColors = Object.freeze({ light: light$1, dark: dark$1 });
861
-
862
964
  const light = Object.freeze({
863
- "--shadow-control": "0 1px 2px rgb(9 9 11 / 0.03)",
864
- "--shadow-raised": "0 2px 6px rgb(9 9 11 / 0.1)",
865
- "--shadow-overlay": "0 8px 24px rgb(9 9 11 / 0.14)"
965
+ "--shadow-control": "0 1px 2px rgb(9 9 11 / 0.03)",
966
+ "--shadow-raised": "0 2px 6px rgb(9 9 11 / 0.1)",
967
+ "--shadow-overlay": "0 8px 24px rgb(9 9 11 / 0.14)"
866
968
  });
867
969
  const dark = Object.freeze({
868
- "--shadow-control": "0 1px 2px rgb(0 0 0 / 0.28)",
869
- "--shadow-raised": "0 4px 10px -4px rgb(0 0 0 / 0.55)",
870
- "--shadow-overlay": "0 8px 24px -6px rgb(0 0 0 / 0.72)"
970
+ "--shadow-control": "0 1px 2px rgb(0 0 0 / 0.28)",
971
+ "--shadow-raised": "0 4px 10px -4px rgb(0 0 0 / 0.55)",
972
+ "--shadow-overlay": "0 8px 24px -6px rgb(0 0 0 / 0.72)"
973
+ });
974
+ const monaThemeShadows = Object.freeze({
975
+ light,
976
+ dark
871
977
  });
872
- const monaThemeShadows = Object.freeze({ light, dark });
873
-
874
978
  const motion = Object.freeze({
875
- "--mona-motion-fast": "200ms",
876
- "--mona-motion-standard": "300ms"
979
+ "--mona-motion-fast": "200ms",
980
+ "--mona-motion-standard": "300ms"
877
981
  });
878
982
  function createComponents() {
879
- return Object.freeze({
880
- "--mona-calendar-background": "var(--color-input-background)",
881
- "--mona-calendar-shadow": "var(--shadow-raised)",
882
- "--mona-list-background": "transparent",
883
- "--mona-list-disabled-background": "transparent",
884
- "--mona-list-group-background": "transparent",
885
- "--mona-list-group-border-width": "0px",
886
- "--mona-list-group-font-weight": "700",
887
- "--mona-menubar-background": "var(--color-surface-muted)",
888
- "--mona-menubar-shadow": "var(--shadow-raised)",
889
- "--mona-pager-background": "var(--color-surface-muted)",
890
- "--mona-slider-handle-border-color": "color-mix(in srgb, var(--color-focus-indicator) 50%, transparent)"
891
- });
983
+ return Object.freeze({
984
+ "--mona-calendar-background": "var(--color-input-background)",
985
+ "--mona-calendar-shadow": "var(--shadow-raised)",
986
+ "--mona-list-background": "transparent",
987
+ "--mona-list-disabled-background": "transparent",
988
+ "--mona-list-group-background": "transparent",
989
+ "--mona-list-group-border-width": "0px",
990
+ "--mona-list-group-font-weight": "700",
991
+ "--mona-menubar-background": "var(--color-surface-muted)",
992
+ "--mona-menubar-shadow": "var(--shadow-raised)",
993
+ "--mona-pager-background": "var(--color-surface-muted)",
994
+ "--mona-slider-handle-border-color": "color-mix(in srgb, var(--color-focus-indicator) 50%, transparent)"
995
+ });
892
996
  }
893
997
  const monaTheme = Object.freeze({
894
- name: "mona",
895
- variants: {
896
- light: Object.freeze({
897
- colors: monaThemeColors.light,
898
- components: createComponents(),
899
- effects: createDefaultThemeEffects(),
900
- motion,
901
- shape: createDefaultThemeShape(),
902
- shadows: monaThemeShadows.light
903
- }),
904
- dark: Object.freeze({
905
- colors: monaThemeColors.dark,
906
- components: createComponents(),
907
- effects: createDefaultThemeEffects(),
908
- motion,
909
- shape: createDefaultThemeShape(),
910
- shadows: monaThemeShadows.dark
911
- })
912
- }
998
+ name: "mona",
999
+ variants: {
1000
+ light: Object.freeze({
1001
+ colors: monaThemeColors.light,
1002
+ components: createComponents(),
1003
+ effects: createDefaultThemeEffects(),
1004
+ motion,
1005
+ shape: createDefaultThemeShape(),
1006
+ shadows: monaThemeShadows.light
1007
+ }),
1008
+ dark: Object.freeze({
1009
+ colors: monaThemeColors.dark,
1010
+ components: createComponents(),
1011
+ effects: createDefaultThemeEffects(),
1012
+ motion,
1013
+ shape: createDefaultThemeShape(),
1014
+ shadows: monaThemeShadows.dark
1015
+ })
1016
+ }
913
1017
  });
914
-
915
1018
  const builtInThemes = Object.freeze({
916
- anna: annaTheme,
917
- luna: lunaTheme,
918
- mona: monaTheme
1019
+ anna: annaTheme,
1020
+ luna: lunaTheme,
1021
+ mona: monaTheme
919
1022
  });
920
-
921
- /** The pairs a theme has to get right for the library to meet WCAG AA, and the contrast each needs. */
922
1023
  const contrastPairs = [
923
- ["--color-foreground", "--color-surface", 4.5],
924
- ["--color-muted-foreground", "--color-surface", 4.5],
925
- ["--color-input-foreground", "--color-input-background", 4.5],
926
- ["--color-primary-foreground", "--color-primary", 4.5],
927
- ["--color-border-control-contrast", "--color-input-background", 3],
928
- ["--color-border-control-contrast-hover", "--color-input-background", 3],
929
- ["--color-focus-indicator", "--color-surface", 3],
930
- ["--color-selected-border", "--color-surface", 3]
1024
+ [
1025
+ "--color-foreground",
1026
+ "--color-surface",
1027
+ 4.5
1028
+ ],
1029
+ [
1030
+ "--color-muted-foreground",
1031
+ "--color-surface",
1032
+ 4.5
1033
+ ],
1034
+ [
1035
+ "--color-input-foreground",
1036
+ "--color-input-background",
1037
+ 4.5
1038
+ ],
1039
+ [
1040
+ "--color-primary-foreground",
1041
+ "--color-primary",
1042
+ 4.5
1043
+ ],
1044
+ [
1045
+ "--color-border-control-contrast",
1046
+ "--color-input-background",
1047
+ 3
1048
+ ],
1049
+ [
1050
+ "--color-border-control-contrast-hover",
1051
+ "--color-input-background",
1052
+ 3
1053
+ ],
1054
+ [
1055
+ "--color-focus-indicator",
1056
+ "--color-surface",
1057
+ 3
1058
+ ],
1059
+ [
1060
+ "--color-selected-border",
1061
+ "--color-surface",
1062
+ 3
1063
+ ]
931
1064
  ];
932
- /**
933
- * What's wrong with a theme's colors, as sentences. Only for development: an invalid value fails silently where
934
- * it's used, far from where it was written. Values this can't read, such as `color-mix()` or a variable from
935
- * outside the color tokens, aren't reported, because they may well be right.
936
- */
937
1065
  function findThemeProblems(name, variant, profile) {
938
- const colors = profile.colors;
939
- const problems = [];
940
- const unreadable = Object.entries(colors)
941
- .filter(([, value]) => !value.includes("(") && value.toLowerCase() !== "currentcolor" && !parse(value))
942
- .map(([token, value]) => `${token}: "${value}"`);
943
- if (unreadable.length > 0) {
944
- problems.push(`Theme "${name}" (${variant}) has values that aren't colors: ${unreadable.join(", ")}.`);
945
- }
946
- for (const [foreground, background, minimum] of contrastPairs) {
947
- const first = resolveColor(colors, foreground);
948
- const second = resolveColor(colors, background);
949
- if (first && second && parse(first) && parse(second)) {
950
- const contrast = wcagContrast(first, second);
951
- if (contrast < minimum) {
952
- problems.push(`Theme "${name}" (${variant}): ${foreground} on ${background} is ${contrast.toFixed(2)}:1, and WCAG AA needs ${minimum}:1.`);
953
- }
954
- }
955
- }
956
- const custom = Object.keys(profile.custom ?? {}).filter(key => !key.startsWith("--"));
957
- if (custom.length > 0) {
958
- problems.push(`Theme "${name}" (${variant}) has custom variables without "--": ${custom.join(", ")}.`);
959
- }
960
- return problems;
1066
+ const colors = profile.colors;
1067
+ const problems = [];
1068
+ const unreadable = Object.entries(colors).filter(([, value]) => !value.includes("(") && value.toLowerCase() !== "currentcolor" && !parse(value)).map(([token, value]) => `${token}: "${value}"`);
1069
+ if (unreadable.length > 0) problems.push(`Theme "${name}" (${variant}) has values that aren't colors: ${unreadable.join(", ")}.`);
1070
+ for (const [foreground, background, minimum] of contrastPairs) {
1071
+ const first = resolveColor(colors, foreground);
1072
+ const second = resolveColor(colors, background);
1073
+ if (first && second && parse(first) && parse(second)) {
1074
+ const contrast = wcagContrast(first, second);
1075
+ if (contrast < minimum) problems.push(`Theme "${name}" (${variant}): ${foreground} on ${background} is ${contrast.toFixed(2)}:1, and WCAG AA needs ${minimum}:1.`);
1076
+ }
1077
+ }
1078
+ const custom = Object.keys(profile.custom ?? {}).filter((key) => !key.startsWith("--"));
1079
+ if (custom.length > 0) problems.push(`Theme "${name}" (${variant}) has custom variables without "--": ${custom.join(", ")}.`);
1080
+ return problems;
961
1081
  }
962
1082
  function resolveColor(colors, token) {
963
- const seen = new Set();
964
- let value = colors[token];
965
- while (value !== undefined && !seen.has(value)) {
966
- seen.add(value);
967
- const alias = /^var\((--[^),]+)\)$/.exec(value.trim());
968
- if (!alias) {
969
- return value;
970
- }
971
- value = colors[alias[1]];
972
- }
973
- return undefined;
974
- }
975
-
976
- /** A theme without these keeps its own border when the user asks for more contrast. */
977
- const optionalTokens = new Set([
978
- "--color-border-control-contrast",
979
- "--color-border-control-contrast-hover"
980
- ]);
981
- class DefaultThemeStrategy {
982
- #overrides;
983
- #themes = new Map();
984
- constructor(registrations, overrides) {
985
- for (const theme of Object.values(builtInThemes)) {
986
- for (const [variant, profile] of getDefinedVariants(theme)) {
987
- validateProfile(theme.name, variant, profile);
988
- }
989
- this.#themes.set(theme.name, theme);
990
- }
991
- for (const registration of registrations) {
992
- this.#register(registration);
993
- }
994
- for (const override of overrides) {
995
- const family = this.#themes.get(override.theme);
996
- if (!family) {
997
- throw new Error(`Cannot override unknown Mona UI theme "${override.theme}".`);
998
- }
999
- for (const variant of ["light", "dark"]) {
1000
- if (override[variant] && !family.variants[variant] && !override.generated) {
1001
- throw new Error(`Cannot override undeclared "${variant}" variant of Mona UI theme "${override.theme}".`);
1002
- }
1003
- }
1004
- validateCustomVariables(override.theme, override.common?.custom);
1005
- validateCustomVariables(override.theme, override.light?.custom);
1006
- validateCustomVariables(override.theme, override.dark?.custom);
1007
- }
1008
- this.#overrides = overrides;
1009
- if (isDevMode()) {
1010
- this.#reportProblems(registrations, overrides);
1011
- }
1012
- }
1013
- availableThemes() {
1014
- return [...this.#themes.values()].map(theme => Object.freeze({
1015
- name: theme.name,
1016
- variants: Object.freeze(getDefinedVariants(theme).map(([variant]) => variant))
1017
- }));
1018
- }
1019
- resolve(selection) {
1020
- const family = this.#themes.get(selection.name);
1021
- if (!family) {
1022
- throw new Error(`Unknown Mona UI theme "${selection.name}".`);
1023
- }
1024
- const profile = family.variants[selection.variant];
1025
- if (!profile) {
1026
- throw new Error(`Mona UI theme "${selection.name}" does not support the "${selection.variant}" variant.`);
1027
- }
1028
- let resolved = cloneProfile(profile);
1029
- for (const override of this.#overrides) {
1030
- if (override.theme === selection.name) {
1031
- resolved = applyOverrides(resolved, override.common);
1032
- resolved = applyOverrides(resolved, override[selection.variant]);
1033
- }
1034
- }
1035
- return resolved;
1036
- }
1037
- #register(registration) {
1038
- if (!registration.name.trim()) {
1039
- throw new Error("Mona UI theme names cannot be empty.");
1040
- }
1041
- if (/\s/.test(registration.name)) {
1042
- throw new Error(`Mona UI theme name "${registration.name}" cannot contain whitespace.`);
1043
- }
1044
- if (this.#themes.has(registration.name)) {
1045
- throw new Error(`Mona UI theme "${registration.name}" is already registered.`);
1046
- }
1047
- const variants = getDefinedVariants(registration);
1048
- if (variants.length === 0) {
1049
- throw new Error(`Mona UI theme "${registration.name}" must define at least one variant.`);
1050
- }
1051
- for (const [variant, profile] of variants) {
1052
- validateProfile(registration.name, variant, profile);
1053
- }
1054
- this.#themes.set(registration.name, registration);
1055
- }
1056
- /** Custom themes, and built-in ones as overridden. The built-in ones as written have specs of their own. */
1057
- #reportProblems(registrations, overrides) {
1058
- const names = new Set([...registrations.map(({ name }) => name), ...overrides.map(({ theme }) => theme)]);
1059
- for (const name of names) {
1060
- for (const [variant] of getDefinedVariants(this.#themes.get(name))) {
1061
- for (const problem of findThemeProblems(name, variant, this.resolve({ name, variant }))) {
1062
- console.warn(`Mona UI: ${problem}`);
1063
- }
1064
- }
1065
- }
1066
- }
1083
+ const seen = /* @__PURE__ */ new Set();
1084
+ let value = colors[token];
1085
+ while (value !== void 0 && !seen.has(value)) {
1086
+ seen.add(value);
1087
+ const alias = /^var\((--[^),]+)\)$/.exec(value.trim());
1088
+ if (!alias) return value;
1089
+ value = colors[alias[1]];
1090
+ }
1067
1091
  }
1092
+ const optionalTokens = /* @__PURE__ */ new Set(["--color-border-control-contrast", "--color-border-control-contrast-hover"]);
1093
+ var DefaultThemeStrategy = class {
1094
+ #overrides;
1095
+ #themes = /* @__PURE__ */ new Map();
1096
+ constructor(registrations, overrides) {
1097
+ for (const theme of Object.values(builtInThemes)) {
1098
+ for (const [variant, profile] of getDefinedVariants(theme)) validateProfile(theme.name, variant, profile);
1099
+ this.#themes.set(theme.name, theme);
1100
+ }
1101
+ for (const registration of registrations) this.#register(registration);
1102
+ for (const override of overrides) {
1103
+ const family = this.#themes.get(override.theme);
1104
+ if (!family) throw new Error(`Cannot override unknown Mona UI theme "${override.theme}".`);
1105
+ for (const variant of ["light", "dark"]) if (override[variant] && !family.variants[variant] && !override.generated) throw new Error(`Cannot override undeclared "${variant}" variant of Mona UI theme "${override.theme}".`);
1106
+ validateCustomVariables(override.theme, override.common?.custom);
1107
+ validateCustomVariables(override.theme, override.light?.custom);
1108
+ validateCustomVariables(override.theme, override.dark?.custom);
1109
+ }
1110
+ this.#overrides = overrides;
1111
+ if (typeof ngDevMode === "undefined" || ngDevMode) reportThemeProblems(this, registrations, overrides);
1112
+ }
1113
+ availableThemes() {
1114
+ return [...this.#themes.values()].map((theme) => Object.freeze({
1115
+ name: theme.name,
1116
+ variants: Object.freeze(getDefinedVariants(theme).map(([variant]) => variant))
1117
+ }));
1118
+ }
1119
+ resolve(selection) {
1120
+ const family = this.#themes.get(selection.name);
1121
+ if (!family) throw new Error(`Unknown Mona UI theme "${selection.name}".`);
1122
+ const profile = family.variants[selection.variant];
1123
+ if (!profile) throw new Error(`Mona UI theme "${selection.name}" does not support the "${selection.variant}" variant.`);
1124
+ let resolved = cloneProfile(profile);
1125
+ for (const override of this.#overrides) if (override.theme === selection.name) {
1126
+ resolved = applyOverrides(resolved, override.common);
1127
+ resolved = applyOverrides(resolved, override[selection.variant]);
1128
+ }
1129
+ return resolved;
1130
+ }
1131
+ #register(registration) {
1132
+ if (!registration.name.trim()) throw new Error("Mona UI theme names cannot be empty.");
1133
+ if (/\s/.test(registration.name)) throw new Error(`Mona UI theme name "${registration.name}" cannot contain whitespace.`);
1134
+ if (this.#themes.has(registration.name)) throw new Error(`Mona UI theme "${registration.name}" is already registered.`);
1135
+ const variants = getDefinedVariants(registration);
1136
+ if (variants.length === 0) throw new Error(`Mona UI theme "${registration.name}" must define at least one variant.`);
1137
+ for (const [variant, profile] of variants) validateProfile(registration.name, variant, profile);
1138
+ this.#themes.set(registration.name, registration);
1139
+ }
1140
+ };
1068
1141
  function getDefinedVariants(registration) {
1069
- const entries = Object.entries(registration.variants);
1070
- const unknownVariants = entries.filter(([variant]) => variant !== "light" && variant !== "dark");
1071
- if (unknownVariants.length > 0) {
1072
- throw new Error(`Mona UI theme "${registration.name}" declares unsupported variants: ${unknownVariants.map(([variant]) => variant).join(", ")}.`);
1073
- }
1074
- return entries.filter((entry) => entry[1] !== undefined);
1142
+ const entries = Object.entries(registration.variants);
1143
+ const unknownVariants = entries.filter(([variant]) => variant !== "light" && variant !== "dark");
1144
+ if (unknownVariants.length > 0) throw new Error(`Mona UI theme "${registration.name}" declares unsupported variants: ${unknownVariants.map(([variant]) => variant).join(", ")}.`);
1145
+ return entries.filter((entry) => entry[1] !== void 0);
1146
+ }
1147
+ function reportThemeProblems(strategy, registrations, overrides) {
1148
+ const variants = new Map(strategy.availableThemes().map((theme) => [theme.name, theme.variants]));
1149
+ const names = /* @__PURE__ */ new Set([...registrations.map(({ name }) => name), ...overrides.map(({ theme }) => theme)]);
1150
+ for (const name of names) for (const variant of variants.get(name) ?? []) for (const problem of findThemeProblems(name, variant, strategy.resolve({
1151
+ name,
1152
+ variant
1153
+ }))) console.warn(`Mona UI: ${problem}`);
1075
1154
  }
1076
1155
  function applyOverrides(profile, overrides) {
1077
- if (!overrides) {
1078
- return profile;
1079
- }
1080
- const custom = profile.custom || overrides.custom ? Object.freeze({ ...profile.custom, ...overrides.custom }) : undefined;
1081
- return {
1082
- colors: Object.freeze({ ...profile.colors, ...overrides.colors }),
1083
- components: Object.freeze({ ...profile.components, ...overrides.components }),
1084
- custom,
1085
- effects: Object.freeze({ ...profile.effects, ...overrides.effects }),
1086
- motion: Object.freeze({ ...profile.motion, ...overrides.motion }),
1087
- shape: Object.freeze({ ...profile.shape, ...overrides.shape }),
1088
- shadows: Object.freeze({ ...profile.shadows, ...overrides.shadows })
1089
- };
1156
+ if (!overrides) return profile;
1157
+ const custom = profile.custom || overrides.custom ? Object.freeze({
1158
+ ...profile.custom,
1159
+ ...overrides.custom
1160
+ }) : void 0;
1161
+ return {
1162
+ colors: Object.freeze({
1163
+ ...profile.colors,
1164
+ ...overrides.colors
1165
+ }),
1166
+ components: Object.freeze({
1167
+ ...profile.components,
1168
+ ...overrides.components
1169
+ }),
1170
+ custom,
1171
+ effects: Object.freeze({
1172
+ ...profile.effects,
1173
+ ...overrides.effects
1174
+ }),
1175
+ motion: Object.freeze({
1176
+ ...profile.motion,
1177
+ ...overrides.motion
1178
+ }),
1179
+ shape: Object.freeze({
1180
+ ...profile.shape,
1181
+ ...overrides.shape
1182
+ }),
1183
+ shadows: Object.freeze({
1184
+ ...profile.shadows,
1185
+ ...overrides.shadows
1186
+ })
1187
+ };
1090
1188
  }
1091
1189
  function cloneProfile(profile) {
1092
- return applyOverrides(profile, {});
1190
+ return applyOverrides(profile, {});
1093
1191
  }
1094
1192
  function validateProfile(name, variant, profile) {
1095
- const reference = builtInThemes.mona.variants.light;
1096
- for (const section of ["colors", "shadows", "motion", "effects", "shape", "components"]) {
1097
- const values = profile[section];
1098
- const required = Object.keys(reference[section]).filter(key => !optionalTokens.has(key));
1099
- const missing = values ? required.filter(key => !(key in values)) : required;
1100
- if (missing.length > 0) {
1101
- throw new Error(`Mona UI theme "${name}" is missing ${section} tokens for the "${variant}" variant: ${missing.join(", ")}.`);
1102
- }
1103
- }
1104
- validateCustomVariables(name, profile.custom);
1193
+ const reference = builtInThemes.mona.variants.light;
1194
+ for (const section of [
1195
+ "colors",
1196
+ "shadows",
1197
+ "motion",
1198
+ "effects",
1199
+ "shape",
1200
+ "components"
1201
+ ]) {
1202
+ const values = profile[section];
1203
+ const required = Object.keys(reference[section]).filter((key) => !optionalTokens.has(key));
1204
+ const missing = values ? required.filter((key) => !(key in values)) : required;
1205
+ if (missing.length > 0) throw new Error(`Mona UI theme "${name}" is missing ${section} tokens for the "${variant}" variant: ${missing.join(", ")}.`);
1206
+ }
1207
+ validateCustomVariables(name, profile.custom);
1105
1208
  }
1106
1209
  function validateCustomVariables(name, custom) {
1107
- const requiredVariables = new Set(Object.keys(flattenThemeProfile(builtInThemes.mona.variants.light)));
1108
- const collisions = Object.keys(custom ?? {}).filter(key => requiredVariables.has(key));
1109
- if (collisions.length > 0) {
1110
- throw new Error(`Mona UI theme "${name}" custom variables collide with required tokens: ${collisions.join(", ")}.`);
1111
- }
1112
- }
1113
-
1114
- /**
1115
- * The default `ThemeStorage`: `localStorage`, as JSON, under the `persistKey`.
1116
- *
1117
- * Reads report `null` anywhere `localStorage` can't answer, and writes are dropped there. That covers the
1118
- * server, a browser that refuses it, and a full quota. `ThemeService` checks what comes back, so a value that
1119
- * isn't a preference, or names a theme that's gone, counts as nothing stored.
1120
- *
1121
- * A server-rendered application gets `initialTheme` in its markup and the remembered theme on hydration, which
1122
- * shows as a flash. Storage that the server can read too, such as a cookie, avoids it; supply it through
1123
- * `provideThemeStorage()`.
1124
- */
1125
- class LocalStorageThemeStorage {
1126
- #browser;
1127
- /** Takes the value of `PLATFORM_ID`, which is a string in practice though typed loosely. */
1128
- constructor(platformId) {
1129
- this.#browser = isPlatformBrowser(platformId);
1130
- }
1131
- read(key) {
1132
- if (!this.#browser) {
1133
- return null;
1134
- }
1135
- try {
1136
- const stored = localStorage.getItem(key);
1137
- return stored === null ? null : JSON.parse(stored);
1138
- }
1139
- catch {
1140
- return null;
1141
- }
1142
- }
1143
- write(key, preference) {
1144
- if (!this.#browser) {
1145
- return;
1146
- }
1147
- try {
1148
- localStorage.setItem(key, JSON.stringify(preference));
1149
- }
1150
- catch {
1151
- // Nothing to recover: the theme still applies, it just won't be remembered.
1152
- }
1153
- }
1210
+ const requiredVariables = new Set(Object.keys(flattenThemeProfile(builtInThemes.mona.variants.light)));
1211
+ const collisions = Object.keys(custom ?? {}).filter((key) => requiredVariables.has(key));
1212
+ if (collisions.length > 0) throw new Error(`Mona UI theme "${name}" custom variables collide with required tokens: ${collisions.join(", ")}.`);
1154
1213
  }
1155
-
1214
+ var LocalStorageThemeStorage = class {
1215
+ #browser;
1216
+ constructor(platformId) {
1217
+ this.#browser = isPlatformBrowser(platformId);
1218
+ }
1219
+ read(key) {
1220
+ if (!this.#browser) return null;
1221
+ try {
1222
+ const stored = localStorage.getItem(key);
1223
+ return stored === null ? null : JSON.parse(stored);
1224
+ } catch {
1225
+ return null;
1226
+ }
1227
+ }
1228
+ write(key, preference) {
1229
+ if (!this.#browser) return;
1230
+ try {
1231
+ localStorage.setItem(key, JSON.stringify(preference));
1232
+ } catch {}
1233
+ }
1234
+ };
1156
1235
  const THEME_FAMILY_REGISTRATIONS = new InjectionToken("Mona UI theme family registrations");
1157
1236
  const THEME_OVERRIDE_REGISTRATIONS = new InjectionToken("Mona UI theme override registrations");
1158
1237
  const THEME_OPTIONS = new InjectionToken("Mona UI theme options", {
1159
- providedIn: "root",
1160
- factory: () => ({ initialTheme: { name: "mona", variant: "light" } })
1238
+ providedIn: "root",
1239
+ factory: () => ({ initialTheme: {
1240
+ name: "mona",
1241
+ variant: "light"
1242
+ } })
1161
1243
  });
1162
- /**
1163
- * The element the theme is written to. Defaults to `<html>`. Replace it with `provideThemeRoot()`.
1164
- */
1165
1244
  const THEME_ROOT = new InjectionToken("Mona UI theme root", {
1166
- providedIn: "root",
1167
- factory: () => inject(DOCUMENT).documentElement ?? null
1245
+ providedIn: "root",
1246
+ factory: () => inject(DOCUMENT).documentElement ?? null
1168
1247
  });
1169
- /**
1170
- * Where the theme is remembered when `provideThemeOptions()` has a `persistKey`. Defaults to `localStorage`.
1171
- * Replace it with `provideThemeStorage()`.
1172
- */
1173
1248
  const THEME_STORAGE = new InjectionToken("Mona UI theme storage", {
1174
- providedIn: "root",
1175
- factory: () => new LocalStorageThemeStorage(inject(PLATFORM_ID))
1249
+ providedIn: "root",
1250
+ factory: () => new LocalStorageThemeStorage(inject(PLATFORM_ID))
1176
1251
  });
1177
1252
  const THEME_STRATEGY = new InjectionToken("Mona UI theme strategy", {
1178
- providedIn: "root",
1179
- factory: () => new DefaultThemeStrategy(inject(THEME_FAMILY_REGISTRATIONS, { optional: true }) ?? [], inject(THEME_OVERRIDE_REGISTRATIONS, { optional: true }) ?? [])
1253
+ providedIn: "root",
1254
+ factory: () => new DefaultThemeStrategy(inject(THEME_FAMILY_REGISTRATIONS, { optional: true }) ?? [], inject(THEME_OVERRIDE_REGISTRATIONS, { optional: true }) ?? [])
1180
1255
  });
1181
-
1182
- /** Which service last wrote to an element, so that a second one can be reported and neither clears the other. */
1183
- const themeWriters = new WeakMap();
1184
- class ThemeService {
1185
- #activeColorPaletteSeeds;
1186
- #activePreference;
1187
- #activeProfile;
1188
- #activeSelection;
1189
- #appliedVariables;
1190
- #colorSchemeQuery;
1191
- #contrastQuery;
1192
- #destroyRef;
1193
- #document;
1194
- #injector;
1195
- #options;
1196
- #root;
1197
- #storage;
1198
- #strategy;
1199
- #transparencyQuery;
1200
- #knownStored;
1201
- #runtimeColorPalette;
1202
- /** The root, and the overlay container for a root inside the page, since overlays render outside it. */
1203
- #targets;
1204
- constructor() {
1205
- this.#activeColorPaletteSeeds = signal(null, /* @ts-ignore */
1206
- ...(ngDevMode ? [{ debugName: "#activeColorPaletteSeeds" }] : /* istanbul ignore next */ []));
1207
- this.#appliedVariables = new Set();
1208
- this.#destroyRef = inject(DestroyRef);
1209
- this.#document = inject(DOCUMENT);
1210
- this.#injector = inject(Injector);
1211
- this.#options = inject(THEME_OPTIONS);
1212
- this.#root = inject(THEME_ROOT);
1213
- this.#strategy = inject(THEME_STRATEGY);
1214
- this.#knownStored = null;
1215
- this.#runtimeColorPalette = null;
1216
- /** The root, and the overlay container for a root inside the page, since overlays render outside it. */
1217
- this.#targets = [];
1218
- /** The consumer-provided seeds for the active runtime color palette, or `null` when provider defaults are active. */
1219
- this.colorPaletteSeeds = this.#activeColorPaletteSeeds.asReadonly();
1220
- this.themeName = computed(() => this.#activeSelection().name, /* @ts-ignore */
1221
- ...(ngDevMode ? [{ debugName: "themeName" }] : /* istanbul ignore next */ []));
1222
- this.themeVariant = computed(() => this.#activeSelection().variant, /* @ts-ignore */
1223
- ...(ngDevMode ? [{ debugName: "themeVariant" }] : /* istanbul ignore next */ []));
1224
- const view = this.#document.defaultView;
1225
- this.#colorSchemeQuery = view?.matchMedia?.("(prefers-color-scheme: dark)");
1226
- this.#contrastQuery = view?.matchMedia?.("(prefers-contrast: more)");
1227
- this.#transparencyQuery = view?.matchMedia?.("(prefers-reduced-transparency: reduce)");
1228
- this.#storage = this.#options.persistKey ? inject(THEME_STORAGE) : null;
1229
- this.#targets = this.#root ? [this.#root] : [];
1230
- const preference = this.#readStoredPreference() ?? normalizePreference(this.#options.initialTheme);
1231
- const selection = this.#resolveSelection(preference);
1232
- this.#activePreference = signal(preference, /* @ts-ignore */
1233
- ...(ngDevMode ? [{ debugName: "#activePreference" }] : /* istanbul ignore next */ []));
1234
- this.#activeSelection = signal(selection, /* @ts-ignore */
1235
- ...(ngDevMode ? [{ debugName: "#activeSelection" }] : /* istanbul ignore next */ []));
1236
- this.#activeProfile = signal(this.#strategy.resolve(selection), /* @ts-ignore */
1237
- ...(ngDevMode ? [{ debugName: "#activeProfile" }] : /* istanbul ignore next */ []));
1238
- this.preference = this.#activePreference.asReadonly();
1239
- this.profile = this.#activeProfile.asReadonly();
1240
- this.selection = this.#activeSelection.asReadonly();
1241
- this.#claimRoot();
1242
- this.#applyTheme(selection, this.#activeProfile());
1243
- this.#destroyRef.onDestroy(() => this.#releaseRoot());
1244
- if (this.#root && this.#root !== this.#document.documentElement) {
1245
- this.#themeOverlayContainer();
1246
- }
1247
- const onPreferenceChange = () => this.#applyTheme(this.#activeSelection(), this.#activeProfile());
1248
- for (const query of [this.#transparencyQuery, this.#contrastQuery]) {
1249
- if (query) {
1250
- query.addEventListener("change", onPreferenceChange);
1251
- this.#destroyRef.onDestroy(() => query.removeEventListener("change", onPreferenceChange));
1252
- }
1253
- }
1254
- const colorSchemeQuery = this.#colorSchemeQuery;
1255
- if (colorSchemeQuery) {
1256
- const onColorSchemeChange = () => {
1257
- if (this.#activePreference().variant === "system") {
1258
- this.#select(this.#activePreference());
1259
- }
1260
- };
1261
- colorSchemeQuery.addEventListener("change", onColorSchemeChange);
1262
- this.#destroyRef.onDestroy(() => colorSchemeQuery.removeEventListener("change", onColorSchemeChange));
1263
- }
1264
- }
1265
- /**
1266
- * The registered themes and the variants each one has. A custom `ThemeStrategy` reports them through its
1267
- * optional `availableThemes()`, and this is empty for one that doesn't.
1268
- */
1269
- availableThemes() {
1270
- return this.#strategy.availableThemes?.() ?? [];
1271
- }
1272
- /** Removes the runtime color palette and restores the registered profile and provider overrides. */
1273
- clearColorPalette() {
1274
- const selection = this.#activeSelection();
1275
- const profile = this.#strategy.resolve(selection);
1276
- this.#applyTheme(selection, profile);
1277
- this.#runtimeColorPalette = null;
1278
- this.#activeProfile.set(profile);
1279
- this.#activeColorPaletteSeeds.set(null);
1280
- }
1281
- /**
1282
- * Applies a runtime-generated semantic color palette after all registered profile overrides.
1283
- * The palette remains active across theme and light/dark switches until cleared.
1284
- */
1285
- setColorPalette(seeds) {
1286
- const normalizedSeeds = Object.freeze({ ...seeds });
1287
- const palette = generateThemeColorPalette(normalizedSeeds);
1288
- const selection = this.#activeSelection();
1289
- const baseProfile = this.#strategy.resolve(selection);
1290
- const profile = applyColorPalette(baseProfile, palette[selection.variant]);
1291
- this.#applyTheme(selection, profile);
1292
- this.#runtimeColorPalette = palette;
1293
- this.#activeProfile.set(profile);
1294
- this.#activeColorPaletteSeeds.set(normalizedSeeds);
1295
- }
1296
- /** Updates only the runtime primary seed while retaining any other active runtime seeds. */
1297
- setPrimaryColor(primary) {
1298
- this.setColorPalette({ ...(this.#activeColorPaletteSeeds() ?? {}), primary });
1299
- }
1300
- /**
1301
- * Switches the theme, and remembers it if a `persistKey` was given. `"system"` follows the operating system's
1302
- * setting from then on, and takes the variant a theme has when it only has one.
1303
- * @throws if the theme isn't registered, or doesn't have the variant asked for
1304
- */
1305
- setTheme(preference) {
1306
- const normalized = normalizePreference(preference);
1307
- this.#select(normalized);
1308
- this.#activePreference.set(normalized);
1309
- this.#writeStoredPreference(normalized);
1310
- }
1311
- /** Whether `setTheme` would accept this. A saved choice can be checked with it before it's restored. */
1312
- supportsVariant(name, variant) {
1313
- try {
1314
- this.#strategy.resolve({ name, variant });
1315
- return true;
1316
- }
1317
- catch {
1318
- return false;
1319
- }
1320
- }
1321
- #applyTheme(selection, profile) {
1322
- const transparency = this.#getTransparencyMode();
1323
- const variables = getEffectiveVariables(profile, transparency, this.#contrastQuery?.matches === true);
1324
- for (const target of this.#targets) {
1325
- for (const previousName of this.#appliedVariables) {
1326
- if (!(previousName in variables)) {
1327
- target.style.removeProperty(previousName);
1328
- }
1329
- }
1330
- for (const [name, value] of Object.entries(variables)) {
1331
- target.style.setProperty(name, value);
1332
- }
1333
- target.style.setProperty("color-scheme", selection.variant);
1334
- target.setAttribute("data-mona-theme", selection.name);
1335
- target.setAttribute("data-mona-variant", selection.variant);
1336
- target.setAttribute("data-mona-transparency", transparency);
1337
- }
1338
- this.#appliedVariables.clear();
1339
- for (const name of Object.keys(variables)) {
1340
- this.#appliedVariables.add(name);
1341
- }
1342
- }
1343
- #claimRoot() {
1344
- const root = this.#root;
1345
- if (!root) {
1346
- return;
1347
- }
1348
- if (isDevMode() && themeWriters.has(root)) {
1349
- console.warn("Mona UI: two applications are writing a theme to the same element, so each overwrites the other. Give one of them its own element with provideThemeRoot().");
1350
- }
1351
- themeWriters.set(root, this);
1352
- }
1353
- #getTransparencyMode() {
1354
- const css = this.#document.defaultView?.CSS;
1355
- const supportsBackdropFilter = css?.supports("backdrop-filter", "blur(1px)") === true ||
1356
- css?.supports("-webkit-backdrop-filter", "blur(1px)") === true;
1357
- return supportsBackdropFilter && this.#transparencyQuery?.matches !== true ? "full" : "reduced";
1358
- }
1359
- /** What's stored, if this service could apply it. Anything else counts as nothing stored, and stays there. */
1360
- #readStoredPreference() {
1361
- const key = this.#options.persistKey;
1362
- if (!key || !this.#storage) {
1363
- return null;
1364
- }
1365
- let stored;
1366
- try {
1367
- stored = this.#storage.read(key);
1368
- }
1369
- catch (error) {
1370
- this.#reportStorageError(error);
1371
- return null;
1372
- }
1373
- if (!isThemePreference(stored) || !this.#canApply(stored)) {
1374
- return null;
1375
- }
1376
- this.#knownStored = normalizePreference(stored);
1377
- return this.#knownStored;
1378
- }
1379
- #canApply(preference) {
1380
- return preference.variant === "system"
1381
- ? this.supportsVariant(preference.name, "light") || this.supportsVariant(preference.name, "dark")
1382
- : this.supportsVariant(preference.name, preference.variant);
1383
- }
1384
- #releaseRoot() {
1385
- const root = this.#root;
1386
- if (!root || themeWriters.get(root) !== this) {
1387
- return;
1388
- }
1389
- themeWriters.delete(root);
1390
- for (const target of this.#targets) {
1391
- for (const name of this.#appliedVariables) {
1392
- target.style.removeProperty(name);
1393
- }
1394
- target.style.removeProperty("color-scheme");
1395
- target.removeAttribute("data-mona-theme");
1396
- target.removeAttribute("data-mona-variant");
1397
- target.removeAttribute("data-mona-transparency");
1398
- }
1399
- this.#targets = [];
1400
- }
1401
- #reportStorageError(error) {
1402
- if (isDevMode()) {
1403
- console.error("Mona UI: the theme storage threw.", error);
1404
- }
1405
- }
1406
- #resolveProfile(selection) {
1407
- const profile = this.#strategy.resolve(selection);
1408
- const palette = this.#runtimeColorPalette;
1409
- return palette ? applyColorPalette(profile, palette[selection.variant]) : profile;
1410
- }
1411
- #resolveSelection(preference) {
1412
- if (preference.variant !== "system") {
1413
- return Object.freeze({ name: preference.name, variant: preference.variant });
1414
- }
1415
- const wanted = this.#colorSchemeQuery?.matches === true ? "dark" : "light";
1416
- const other = wanted === "dark" ? "light" : "dark";
1417
- const onlyOther = !this.supportsVariant(preference.name, wanted) && this.supportsVariant(preference.name, other);
1418
- return Object.freeze({ name: preference.name, variant: onlyOther ? other : wanted });
1419
- }
1420
- #select(preference) {
1421
- const selection = this.#resolveSelection(preference);
1422
- const profile = this.#resolveProfile(selection);
1423
- this.#applyTheme(selection, profile);
1424
- this.#activeProfile.set(profile);
1425
- this.#activeSelection.set(selection);
1426
- }
1427
- /**
1428
- * Loaded on demand, so an application themed at `<html>` doesn't take on the overlay module for this. An overlay
1429
- * opened before it arrives gets its colors when it does.
1430
- */
1431
- #themeOverlayContainer() {
1432
- void import('@angular/cdk/overlay').then(overlay => {
1433
- if (this.#targets.length > 0) {
1434
- this.#targets = [...this.#targets, this.#injector.get(overlay.OverlayContainer).getContainerElement()];
1435
- this.#applyTheme(this.#activeSelection(), this.#activeProfile());
1436
- }
1437
- });
1438
- }
1439
- #writeStoredPreference(preference) {
1440
- const key = this.#options.persistKey;
1441
- const known = this.#knownStored;
1442
- if (!key ||
1443
- !this.#storage ||
1444
- (known && known.name === preference.name && known.variant === preference.variant)) {
1445
- return;
1446
- }
1447
- this.#knownStored = preference;
1448
- try {
1449
- this.#storage.write(key, preference);
1450
- }
1451
- catch (error) {
1452
- this.#reportStorageError(error);
1453
- }
1454
- }
1455
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1456
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ThemeService, providedIn: "root" }); }
1457
- }
1458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ThemeService, decorators: [{
1459
- type: Injectable,
1460
- args: [{ providedIn: "root" }]
1461
- }], ctorParameters: () => [] });
1462
- /** A field's border is quiet by default. Each pair is the variable and what replaces it for more contrast. */
1463
- const contrastBorders = [
1464
- ["--color-border-control", "--color-border-control-contrast"],
1465
- ["--color-border-control-hover", "--color-border-control-contrast-hover"]
1256
+ const themeWriters = /* @__PURE__ */ new WeakMap();
1257
+ var ThemeService = class ThemeService {
1258
+ #activeColorPaletteSeeds;
1259
+ #activePreference;
1260
+ #activeProfile;
1261
+ #activeSelection;
1262
+ #appliedVariables;
1263
+ #colorSchemeQuery;
1264
+ #contrastQuery;
1265
+ #destroyRef;
1266
+ #document;
1267
+ #injector;
1268
+ #options;
1269
+ #root;
1270
+ #storage;
1271
+ #strategy;
1272
+ #transparencyQuery;
1273
+ #knownStored;
1274
+ #runtimeColorPalette;
1275
+ #targets;
1276
+ constructor() {
1277
+ this.#activeColorPaletteSeeds = signal(null, ...ngDevMode ? [{ debugName: "#activeColorPaletteSeeds" }] : /* istanbul ignore next */ []);
1278
+ this.#appliedVariables = /* @__PURE__ */ new Set();
1279
+ this.#destroyRef = inject(DestroyRef);
1280
+ this.#document = inject(DOCUMENT);
1281
+ this.#injector = inject(Injector);
1282
+ this.#options = inject(THEME_OPTIONS);
1283
+ this.#root = inject(THEME_ROOT);
1284
+ this.#strategy = inject(THEME_STRATEGY);
1285
+ this.#knownStored = null;
1286
+ this.#runtimeColorPalette = null;
1287
+ this.#targets = [];
1288
+ this.colorPaletteSeeds = this.#activeColorPaletteSeeds.asReadonly();
1289
+ this.themeName = computed(() => this.#activeSelection().name, ...ngDevMode ? [{ debugName: "themeName" }] : /* istanbul ignore next */ []);
1290
+ this.themeVariant = computed(() => this.#activeSelection().variant, ...ngDevMode ? [{ debugName: "themeVariant" }] : /* istanbul ignore next */ []);
1291
+ const view = this.#document.defaultView;
1292
+ this.#colorSchemeQuery = view?.matchMedia?.("(prefers-color-scheme: dark)");
1293
+ this.#contrastQuery = view?.matchMedia?.("(prefers-contrast: more)");
1294
+ this.#transparencyQuery = view?.matchMedia?.("(prefers-reduced-transparency: reduce)");
1295
+ this.#storage = this.#options.persistKey ? inject(THEME_STORAGE) : null;
1296
+ this.#targets = this.#root ? [this.#root] : [];
1297
+ const preference = this.#readStoredPreference() ?? normalizePreference(this.#options.initialTheme);
1298
+ const selection = this.#resolveSelection(preference);
1299
+ this.#activePreference = signal(preference, ...ngDevMode ? [{ debugName: "#activePreference" }] : /* istanbul ignore next */ []);
1300
+ this.#activeSelection = signal(selection, ...ngDevMode ? [{ debugName: "#activeSelection" }] : /* istanbul ignore next */ []);
1301
+ this.#activeProfile = signal(this.#strategy.resolve(selection), ...ngDevMode ? [{ debugName: "#activeProfile" }] : /* istanbul ignore next */ []);
1302
+ this.preference = this.#activePreference.asReadonly();
1303
+ this.profile = this.#activeProfile.asReadonly();
1304
+ this.selection = this.#activeSelection.asReadonly();
1305
+ this.#claimRoot();
1306
+ this.#applyTheme(selection, this.#activeProfile());
1307
+ this.#destroyRef.onDestroy(() => this.#releaseRoot());
1308
+ if (this.#root && this.#root !== this.#document.documentElement) this.#themeOverlayContainer();
1309
+ const onPreferenceChange = () => this.#applyTheme(this.#activeSelection(), this.#activeProfile());
1310
+ for (const query of [this.#transparencyQuery, this.#contrastQuery]) if (query) {
1311
+ query.addEventListener("change", onPreferenceChange);
1312
+ this.#destroyRef.onDestroy(() => query.removeEventListener("change", onPreferenceChange));
1313
+ }
1314
+ const colorSchemeQuery = this.#colorSchemeQuery;
1315
+ if (colorSchemeQuery) {
1316
+ const onColorSchemeChange = () => {
1317
+ if (this.#activePreference().variant === "system") this.#select(this.#activePreference());
1318
+ };
1319
+ colorSchemeQuery.addEventListener("change", onColorSchemeChange);
1320
+ this.#destroyRef.onDestroy(() => colorSchemeQuery.removeEventListener("change", onColorSchemeChange));
1321
+ }
1322
+ }
1323
+ availableThemes() {
1324
+ return this.#strategy.availableThemes?.() ?? [];
1325
+ }
1326
+ clearColorPalette() {
1327
+ const selection = this.#activeSelection();
1328
+ const profile = this.#strategy.resolve(selection);
1329
+ this.#applyTheme(selection, profile);
1330
+ this.#runtimeColorPalette = null;
1331
+ this.#activeProfile.set(profile);
1332
+ this.#activeColorPaletteSeeds.set(null);
1333
+ }
1334
+ setColorPalette(seeds) {
1335
+ const normalizedSeeds = Object.freeze({ ...seeds });
1336
+ const palette = generateThemeColorPalette(normalizedSeeds);
1337
+ const selection = this.#activeSelection();
1338
+ const profile = applyColorPalette(this.#strategy.resolve(selection), palette[selection.variant]);
1339
+ this.#applyTheme(selection, profile);
1340
+ this.#runtimeColorPalette = palette;
1341
+ this.#activeProfile.set(profile);
1342
+ this.#activeColorPaletteSeeds.set(normalizedSeeds);
1343
+ }
1344
+ setPrimaryColor(primary) {
1345
+ this.setColorPalette({
1346
+ ...this.#activeColorPaletteSeeds() ?? {},
1347
+ primary
1348
+ });
1349
+ }
1350
+ setTheme(preference) {
1351
+ const normalized = normalizePreference(preference);
1352
+ this.#select(normalized);
1353
+ this.#activePreference.set(normalized);
1354
+ this.#writeStoredPreference(normalized);
1355
+ }
1356
+ supportsVariant(name, variant) {
1357
+ try {
1358
+ this.#strategy.resolve({
1359
+ name,
1360
+ variant
1361
+ });
1362
+ return true;
1363
+ } catch {
1364
+ return false;
1365
+ }
1366
+ }
1367
+ #applyTheme(selection, profile) {
1368
+ const transparency = this.#getTransparencyMode();
1369
+ const variables = getEffectiveVariables(profile, transparency, this.#contrastQuery?.matches === true);
1370
+ for (const target of this.#targets) {
1371
+ for (const previousName of this.#appliedVariables) if (!(previousName in variables)) target.style.removeProperty(previousName);
1372
+ for (const [name, value] of Object.entries(variables)) target.style.setProperty(name, value);
1373
+ target.style.setProperty("color-scheme", selection.variant);
1374
+ target.setAttribute("data-mona-theme", selection.name);
1375
+ target.setAttribute("data-mona-variant", selection.variant);
1376
+ target.setAttribute("data-mona-transparency", transparency);
1377
+ }
1378
+ this.#appliedVariables.clear();
1379
+ for (const name of Object.keys(variables)) this.#appliedVariables.add(name);
1380
+ }
1381
+ #claimRoot() {
1382
+ const root = this.#root;
1383
+ if (!root) return;
1384
+ if (isDevMode() && themeWriters.has(root)) console.warn("Mona UI: two applications are writing a theme to the same element, so each overwrites the other. Give one of them its own element with provideThemeRoot().");
1385
+ themeWriters.set(root, this);
1386
+ }
1387
+ #getTransparencyMode() {
1388
+ const css = this.#document.defaultView?.CSS;
1389
+ return (css?.supports("backdrop-filter", "blur(1px)") === true || css?.supports("-webkit-backdrop-filter", "blur(1px)") === true) && this.#transparencyQuery?.matches !== true ? "full" : "reduced";
1390
+ }
1391
+ #readStoredPreference() {
1392
+ const key = this.#options.persistKey;
1393
+ if (!key || !this.#storage) return null;
1394
+ let stored;
1395
+ try {
1396
+ stored = this.#storage.read(key);
1397
+ } catch (error) {
1398
+ this.#reportStorageError(error);
1399
+ return null;
1400
+ }
1401
+ if (!isThemePreference(stored) || !this.#canApply(stored)) return null;
1402
+ this.#knownStored = normalizePreference(stored);
1403
+ return this.#knownStored;
1404
+ }
1405
+ #canApply(preference) {
1406
+ return preference.variant === "system" ? this.supportsVariant(preference.name, "light") || this.supportsVariant(preference.name, "dark") : this.supportsVariant(preference.name, preference.variant);
1407
+ }
1408
+ #releaseRoot() {
1409
+ const root = this.#root;
1410
+ if (!root || themeWriters.get(root) !== this) return;
1411
+ themeWriters.delete(root);
1412
+ for (const target of this.#targets) {
1413
+ for (const name of this.#appliedVariables) target.style.removeProperty(name);
1414
+ target.style.removeProperty("color-scheme");
1415
+ target.removeAttribute("data-mona-theme");
1416
+ target.removeAttribute("data-mona-variant");
1417
+ target.removeAttribute("data-mona-transparency");
1418
+ }
1419
+ this.#targets = [];
1420
+ }
1421
+ #reportStorageError(error) {
1422
+ if (isDevMode()) console.error("Mona UI: the theme storage threw.", error);
1423
+ }
1424
+ #resolveProfile(selection) {
1425
+ const profile = this.#strategy.resolve(selection);
1426
+ const palette = this.#runtimeColorPalette;
1427
+ return palette ? applyColorPalette(profile, palette[selection.variant]) : profile;
1428
+ }
1429
+ #resolveSelection(preference) {
1430
+ if (preference.variant !== "system") return Object.freeze({
1431
+ name: preference.name,
1432
+ variant: preference.variant
1433
+ });
1434
+ const wanted = this.#colorSchemeQuery?.matches === true ? "dark" : "light";
1435
+ const other = wanted === "dark" ? "light" : "dark";
1436
+ const onlyOther = !this.supportsVariant(preference.name, wanted) && this.supportsVariant(preference.name, other);
1437
+ return Object.freeze({
1438
+ name: preference.name,
1439
+ variant: onlyOther ? other : wanted
1440
+ });
1441
+ }
1442
+ #select(preference) {
1443
+ const selection = this.#resolveSelection(preference);
1444
+ const profile = this.#resolveProfile(selection);
1445
+ this.#applyTheme(selection, profile);
1446
+ this.#activeProfile.set(profile);
1447
+ this.#activeSelection.set(selection);
1448
+ }
1449
+ #themeOverlayContainer() {
1450
+ import("@angular/cdk/overlay").then((overlay) => {
1451
+ if (this.#targets.length > 0) {
1452
+ this.#targets = [...this.#targets, this.#injector.get(overlay.OverlayContainer).getContainerElement()];
1453
+ this.#applyTheme(this.#activeSelection(), this.#activeProfile());
1454
+ }
1455
+ });
1456
+ }
1457
+ #writeStoredPreference(preference) {
1458
+ const key = this.#options.persistKey;
1459
+ const known = this.#knownStored;
1460
+ if (!key || !this.#storage || known && known.name === preference.name && known.variant === preference.variant) return;
1461
+ this.#knownStored = preference;
1462
+ try {
1463
+ this.#storage.write(key, preference);
1464
+ } catch (error) {
1465
+ this.#reportStorageError(error);
1466
+ }
1467
+ }
1468
+ static {
1469
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1470
+ minVersion: "12.0.0",
1471
+ version: "22.2.6",
1472
+ ngImport: i0,
1473
+ type: ThemeService,
1474
+ deps: [],
1475
+ target: i0.ɵɵFactoryTarget.Injectable
1476
+ });
1477
+ }
1478
+ static {
1479
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1480
+ minVersion: "12.0.0",
1481
+ version: "22.2.6",
1482
+ ngImport: i0,
1483
+ type: ThemeService,
1484
+ providedIn: "root"
1485
+ });
1486
+ }
1487
+ };
1488
+ i0.ɵɵngDeclareClassMetadata({
1489
+ minVersion: "12.0.0",
1490
+ version: "22.2.6",
1491
+ ngImport: i0,
1492
+ type: ThemeService,
1493
+ decorators: [{
1494
+ type: Injectable,
1495
+ args: [{ providedIn: "root" }]
1496
+ }],
1497
+ ctorParameters: () => []
1498
+ });
1499
+ const contrastBorders = [["--color-border-control", "--color-border-control-contrast"], ["--color-border-control-hover", "--color-border-control-contrast-hover"]];
1500
+ const effectLevels = [
1501
+ "control",
1502
+ "raised",
1503
+ "overlay"
1504
+ ];
1505
+ const preferenceVariants = [
1506
+ "light",
1507
+ "dark",
1508
+ "system"
1466
1509
  ];
1467
- const effectLevels = ["control", "raised", "overlay"];
1468
- const preferenceVariants = ["light", "dark", "system"];
1469
1510
  function applyColorPalette(profile, colors) {
1470
- return Object.freeze({
1471
- ...profile,
1472
- colors: Object.freeze({ ...profile.colors, ...colors })
1473
- });
1511
+ return Object.freeze({
1512
+ ...profile,
1513
+ colors: Object.freeze({
1514
+ ...profile.colors,
1515
+ ...colors
1516
+ })
1517
+ });
1474
1518
  }
1475
1519
  function getEffectiveVariables(profile, transparency, moreContrast) {
1476
- const variables = { ...flattenThemeProfile(profile) };
1477
- if (moreContrast) {
1478
- for (const [name, replacement] of contrastBorders) {
1479
- // A custom theme may not have one, and then keeps what it has.
1480
- const value = profile.colors[replacement];
1481
- if (value !== undefined) {
1482
- variables[name] = value;
1483
- }
1484
- }
1485
- }
1486
- if (transparency === "full") {
1487
- return variables;
1488
- }
1489
- for (const level of effectLevels) {
1490
- variables[`--mona-effect-${level}-background-color`] =
1491
- profile.effects[`--mona-effect-${level}-fallback-background-color`];
1492
- variables[`--mona-effect-${level}-background-image`] = "none";
1493
- variables[`--mona-effect-${level}-backdrop-filter`] = "none";
1494
- }
1495
- return variables;
1520
+ const variables = { ...flattenThemeProfile(profile) };
1521
+ if (moreContrast) for (const [name, replacement] of contrastBorders) {
1522
+ const value = profile.colors[replacement];
1523
+ if (value !== void 0) variables[name] = value;
1524
+ }
1525
+ if (transparency === "full") return variables;
1526
+ for (const level of effectLevels) {
1527
+ variables[`--mona-effect-${level}-background-color`] = profile.effects[`--mona-effect-${level}-fallback-background-color`];
1528
+ variables[`--mona-effect-${level}-background-image`] = "none";
1529
+ variables[`--mona-effect-${level}-backdrop-filter`] = "none";
1530
+ }
1531
+ return variables;
1496
1532
  }
1497
1533
  function isThemePreference(value) {
1498
- if (typeof value !== "object" || value === null) {
1499
- return false;
1500
- }
1501
- const { name, variant } = value;
1502
- return typeof name === "string" && preferenceVariants.includes(variant);
1534
+ if (typeof value !== "object" || value === null) return false;
1535
+ const { name, variant } = value;
1536
+ return typeof name === "string" && preferenceVariants.includes(variant);
1503
1537
  }
1504
1538
  function normalizePreference(preference) {
1505
- return Object.freeze({ name: preference.name, variant: preference.variant });
1539
+ return Object.freeze({
1540
+ name: preference.name,
1541
+ variant: preference.variant
1542
+ });
1506
1543
  }
1507
-
1508
- /**
1509
- * Every theme provider applies the theme at startup, so it doesn't depend on something injecting `ThemeService`,
1510
- * and a configuration that can't be applied fails at bootstrap rather than in whichever component came first.
1511
- */
1512
1544
  function applyThemeAtStartup() {
1513
- return provideEnvironmentInitializer(() => {
1514
- inject(ThemeService);
1515
- });
1545
+ return provideEnvironmentInitializer(() => {
1546
+ inject(ThemeService);
1547
+ });
1516
1548
  }
1517
1549
  function provideThemeFamily(registration) {
1518
- return makeEnvironmentProviders([
1519
- { provide: THEME_FAMILY_REGISTRATIONS, multi: true, useValue: registration },
1520
- applyThemeAtStartup()
1521
- ]);
1550
+ return makeEnvironmentProviders([{
1551
+ provide: THEME_FAMILY_REGISTRATIONS,
1552
+ multi: true,
1553
+ useValue: registration
1554
+ }, applyThemeAtStartup()]);
1522
1555
  }
1523
1556
  function provideThemeOverrides(registration) {
1524
- return makeEnvironmentProviders([
1525
- { provide: THEME_OVERRIDE_REGISTRATIONS, multi: true, useValue: registration },
1526
- applyThemeAtStartup()
1527
- ]);
1557
+ return makeEnvironmentProviders([{
1558
+ provide: THEME_OVERRIDE_REGISTRATIONS,
1559
+ multi: true,
1560
+ useValue: registration
1561
+ }, applyThemeAtStartup()]);
1528
1562
  }
1529
1563
  function provideThemeOptions(options) {
1530
- return makeEnvironmentProviders([{ provide: THEME_OPTIONS, useValue: options }, applyThemeAtStartup()]);
1564
+ return makeEnvironmentProviders([{
1565
+ provide: THEME_OPTIONS,
1566
+ useValue: options
1567
+ }, applyThemeAtStartup()]);
1531
1568
  }
1532
- /**
1533
- * Generates a light and a dark palette from the seeds, and applies whichever the theme has.
1534
- */
1535
1569
  function provideThemeColorPalette(registration) {
1536
- const colors = generateThemeColorPalette(registration.seeds);
1537
- return provideThemeOverrides({
1538
- generated: true,
1539
- theme: registration.theme,
1540
- light: { colors: colors.light },
1541
- dark: { colors: colors.dark }
1542
- });
1570
+ const colors = generateThemeColorPalette(registration.seeds);
1571
+ return provideThemeOverrides({
1572
+ generated: true,
1573
+ theme: registration.theme,
1574
+ light: { colors: colors.light },
1575
+ dark: { colors: colors.dark }
1576
+ });
1543
1577
  }
1544
- /**
1545
- * Applies the theme to an element in place of `<html>`, for an application embedded in part of a page. Overlays
1546
- * render outside any such element, so the overlay container gets the theme too. Each application has its own
1547
- * overlay container, so two embedded applications can have two themes.
1548
- * @param root the element, or a factory for it that runs in an injection context. It has to exist at startup.
1549
- */
1550
1578
  function provideThemeRoot(root) {
1551
- return makeEnvironmentProviders([
1552
- typeof root === "function"
1553
- ? { provide: THEME_ROOT, useFactory: root }
1554
- : { provide: THEME_ROOT, useValue: root },
1555
- applyThemeAtStartup()
1556
- ]);
1579
+ return makeEnvironmentProviders([typeof root === "function" ? {
1580
+ provide: THEME_ROOT,
1581
+ useFactory: root
1582
+ } : {
1583
+ provide: THEME_ROOT,
1584
+ useValue: root
1585
+ }, applyThemeAtStartup()]);
1557
1586
  }
1558
- /**
1559
- * Replaces where the theme is remembered, which is `localStorage` by default. Only used when
1560
- * `provideThemeOptions()` has a `persistKey`. Supply something the server can read too, such as a cookie, to have a
1561
- * server-rendered application render the remembered theme rather than correcting it on hydration.
1562
- * @param storage the storage, or a factory for it that runs in an injection context
1563
- */
1564
1587
  function provideThemeStorage(storage) {
1565
- return makeEnvironmentProviders([
1566
- typeof storage === "function"
1567
- ? { provide: THEME_STORAGE, useFactory: storage }
1568
- : { provide: THEME_STORAGE, useValue: storage },
1569
- applyThemeAtStartup()
1570
- ]);
1588
+ return makeEnvironmentProviders([typeof storage === "function" ? {
1589
+ provide: THEME_STORAGE,
1590
+ useFactory: storage
1591
+ } : {
1592
+ provide: THEME_STORAGE,
1593
+ useValue: storage
1594
+ }, applyThemeAtStartup()]);
1571
1595
  }
1572
-
1573
- /*
1574
- * Public API Surface of @nanahoshi/mona-ui/theme
1575
- */
1576
-
1577
- /**
1578
- * Generated bundle index. Do not edit.
1579
- */
1580
-
1581
1596
  export { DefaultThemeStrategy, LocalStorageThemeStorage, THEME_ROOT, THEME_STORAGE, THEME_STRATEGY, ThemeService, annaTheme, builtInThemes, createSidebarColorRoles, flattenThemeProfile, generateThemeColorPalette, lunaTheme, monaTheme, provideThemeColorPalette, provideThemeFamily, provideThemeOptions, provideThemeOverrides, provideThemeRoot, provideThemeStorage };
1582
- //# sourceMappingURL=nanahoshi-mona-ui-theme.mjs.map
1597
+
1598
+ //# sourceMappingURL=nanahoshi-mona-ui-theme.mjs.map