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