@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.
- package/docs/api/auto-complete.md +67 -0
- package/docs/api/avatar.md +31 -0
- package/docs/api/breadcrumb.md +74 -0
- package/docs/api/button-group.md +71 -0
- package/docs/api/button.md +84 -0
- package/docs/api/calendar.md +123 -0
- package/docs/api/card.md +97 -0
- package/docs/api/chart.md +4380 -0
- package/docs/api/check-box.md +70 -0
- package/docs/api/chip.md +55 -0
- package/docs/api/circular-progress-bar.md +71 -0
- package/docs/api/collapsible.md +71 -0
- package/docs/api/color-gradient.md +54 -0
- package/docs/api/color-palette.md +52 -0
- package/docs/api/color-picker.md +89 -0
- package/docs/api/combo-box.md +69 -0
- package/docs/api/command.md +282 -0
- package/docs/api/common.md +599 -0
- package/docs/api/contextmenu.md +239 -0
- package/docs/api/date-input.md +119 -0
- package/docs/api/date-picker.md +67 -0
- package/docs/api/datetime-picker.md +72 -0
- package/docs/api/dialog.md +291 -0
- package/docs/api/dropdown-button.md +248 -0
- package/docs/api/dropdown-list.md +72 -0
- package/docs/api/dropdowns.md +172 -0
- package/docs/api/editor.md +117 -0
- package/docs/api/expansion-panel.md +85 -0
- package/docs/api/fieldset.md +33 -0
- package/docs/api/filter.md +116 -0
- package/docs/api/grid.md +1445 -0
- package/docs/api/i18n.md +1699 -0
- package/docs/api/label.md +58 -0
- package/docs/api/list-box.md +301 -0
- package/docs/api/list-view.md +294 -0
- package/docs/api/list.md +119 -0
- package/docs/api/locales.md +134 -0
- package/docs/api/menubar.md +275 -0
- package/docs/api/multi-select.md +92 -0
- package/docs/api/notification.md +164 -0
- package/docs/api/numeric-text-box.md +130 -0
- package/docs/api/otp-input.md +100 -0
- package/docs/api/pager.md +371 -0
- package/docs/api/placeholder.md +18 -0
- package/docs/api/popover.md +170 -0
- package/docs/api/popup-menu.md +328 -0
- package/docs/api/popup.md +299 -0
- package/docs/api/progress-bar.md +79 -0
- package/docs/api/query.md +367 -0
- package/docs/api/radio-button.md +113 -0
- package/docs/api/rating.md +187 -0
- package/docs/api/scroll-view.md +93 -0
- package/docs/api/segmented.md +114 -0
- package/docs/api/sheet.md +65 -0
- package/docs/api/sidebar.md +583 -0
- package/docs/api/skeleton.md +26 -0
- package/docs/api/slider.md +173 -0
- package/docs/api/spinner.md +132 -0
- package/docs/api/split-button.md +261 -0
- package/docs/api/splitter.md +57 -0
- package/docs/api/stepper.md +148 -0
- package/docs/api/switch.md +78 -0
- package/docs/api/tabs.md +139 -0
- package/docs/api/text-area.md +20 -0
- package/docs/api/text-box.md +106 -0
- package/docs/api/theme.md +627 -0
- package/docs/api/time-picker.md +69 -0
- package/docs/api/time-selector.md +54 -0
- package/docs/api/tooltip.md +112 -0
- package/docs/api/tree-view.md +631 -0
- package/docs/api/window.md +245 -0
- package/docs/auto-complete.md +28 -329
- package/docs/avatar.md +4 -24
- package/docs/breadcrumb.md +10 -65
- package/docs/button-group.md +7 -60
- package/docs/button.md +8 -67
- package/docs/calendar.md +16 -121
- package/docs/card.md +16 -79
- package/docs/chart-bar.md +16 -234
- package/docs/chart-financial.md +10 -121
- package/docs/chart-funnel.md +13 -176
- package/docs/chart-heatmap.md +15 -131
- package/docs/chart-line-area.md +12 -137
- package/docs/chart-pie.md +17 -221
- package/docs/chart-radar.md +13 -129
- package/docs/chart-radial.md +13 -211
- package/docs/chart-scatter.md +6 -74
- package/docs/chart-treemap.md +14 -196
- package/docs/chart.md +168 -1892
- package/docs/checkbox.md +5 -61
- package/docs/chip.md +7 -42
- package/docs/circular-progress-bar.md +9 -61
- package/docs/collapsible.md +5 -87
- package/docs/color-gradient.md +8 -81
- package/docs/color-palette.md +7 -69
- package/docs/color-picker.md +9 -105
- package/docs/combo-box.md +28 -331
- package/docs/command.md +25 -236
- package/docs/contextmenu.md +15 -140
- package/docs/date-picker.md +7 -110
- package/docs/datetime-picker.md +7 -129
- package/docs/decimal-textbox.md +6 -69
- package/docs/dialog.md +23 -263
- package/docs/dropdown-button.md +15 -146
- package/docs/dropdown-list.md +29 -332
- package/docs/editor.md +10 -164
- package/docs/expansion-panel.md +7 -69
- package/docs/fieldset.md +5 -24
- package/docs/grid-columns.md +12 -92
- package/docs/grid-editing.md +29 -291
- package/docs/grid-grouping.md +11 -50
- package/docs/grid-rows.md +10 -74
- package/docs/grid-selection.md +7 -36
- package/docs/grid-server.md +8 -293
- package/docs/grid-sorting-filtering.md +10 -333
- package/docs/grid-state-export.md +17 -228
- package/docs/grid.md +23 -216
- package/docs/input.md +7 -19
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/label.md +8 -39
- package/docs/list-box.md +21 -253
- package/docs/list-view.md +25 -232
- package/docs/menubar.md +21 -167
- package/docs/multi-select.md +31 -350
- package/docs/notification.md +17 -116
- package/docs/numeric-textbox.md +9 -78
- package/docs/otp-input.md +9 -95
- package/docs/pager.md +19 -239
- package/docs/placeholder.md +5 -18
- package/docs/popover.md +13 -123
- package/docs/popup-menu.md +22 -243
- package/docs/popup.md +24 -248
- package/docs/progress-bar.md +10 -75
- package/docs/radio-button.md +8 -96
- package/docs/range-slider.md +9 -82
- package/docs/rating.md +15 -163
- package/docs/scroll-view.md +9 -86
- package/docs/segmented.md +8 -90
- package/docs/sheet.md +10 -74
- package/docs/sidebar-menus.md +20 -155
- package/docs/sidebar-state.md +16 -134
- package/docs/sidebar.md +18 -218
- package/docs/skeleton.md +5 -26
- package/docs/slider.md +9 -97
- package/docs/spinner.md +15 -95
- package/docs/split-button.md +21 -166
- package/docs/splitter.md +9 -56
- package/docs/stepper.md +13 -127
- package/docs/switch.md +8 -58
- package/docs/tabs.md +13 -111
- package/docs/textarea.md +4 -13
- package/docs/textbox.md +10 -77
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/docs/time-picker.md +7 -112
- package/docs/tooltip-directive.md +12 -96
- package/docs/tooltip.md +12 -96
- package/docs/tree-view.md +42 -495
- package/docs/window.md +19 -230
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -389
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -740
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -254
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -729
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5068
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +80 -2
- package/package.json +62 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +105 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +360 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +97 -97
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +255 -235
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +999 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,1582 +1,1598 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 = [
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
165
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
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
|
-
|
|
226
|
+
return (hue % 360 + 360) % 360;
|
|
194
227
|
}
|
|
195
228
|
function clamp(value, minimum, maximum) {
|
|
196
|
-
|
|
229
|
+
return Math.min(Math.max(value, minimum), maximum);
|
|
197
230
|
}
|
|
198
|
-
|
|
199
231
|
function createDefaultThemeEffects() {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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
|
-
|
|
352
|
-
|
|
448
|
+
"--mona-motion-fast": "150ms",
|
|
449
|
+
"--mona-motion-standard": "150ms"
|
|
353
450
|
});
|
|
354
451
|
const components = Object.freeze({
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
-
|
|
558
|
-
|
|
559
|
-
|
|
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
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
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
|
-
|
|
864
|
-
|
|
865
|
-
|
|
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
|
-
|
|
869
|
-
|
|
870
|
-
|
|
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
|
-
|
|
876
|
-
|
|
979
|
+
"--mona-motion-fast": "200ms",
|
|
980
|
+
"--mona-motion-standard": "300ms"
|
|
877
981
|
});
|
|
878
982
|
function createComponents() {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
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
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
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
|
-
|
|
917
|
-
|
|
918
|
-
|
|
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
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
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
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
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
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
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
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
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
|
-
|
|
1190
|
+
return applyOverrides(profile, {});
|
|
1093
1191
|
}
|
|
1094
1192
|
function validateProfile(name, variant, profile) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
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
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
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
|
-
|
|
1160
|
-
|
|
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
|
-
|
|
1167
|
-
|
|
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
|
-
|
|
1175
|
-
|
|
1249
|
+
providedIn: "root",
|
|
1250
|
+
factory: () => new LocalStorageThemeStorage(inject(PLATFORM_ID))
|
|
1176
1251
|
});
|
|
1177
1252
|
const THEME_STRATEGY = new InjectionToken("Mona UI theme strategy", {
|
|
1178
|
-
|
|
1179
|
-
|
|
1253
|
+
providedIn: "root",
|
|
1254
|
+
factory: () => new DefaultThemeStrategy(inject(THEME_FAMILY_REGISTRATIONS, { optional: true }) ?? [], inject(THEME_OVERRIDE_REGISTRATIONS, { optional: true }) ?? [])
|
|
1180
1255
|
});
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
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
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
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
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
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
|
-
|
|
1499
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1545
|
+
return provideEnvironmentInitializer(() => {
|
|
1546
|
+
inject(ThemeService);
|
|
1547
|
+
});
|
|
1516
1548
|
}
|
|
1517
1549
|
function provideThemeFamily(registration) {
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
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
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
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
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
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
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
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
|
-
|
|
1597
|
+
|
|
1598
|
+
//# sourceMappingURL=nanahoshi-mona-ui-theme.mjs.map
|