@aeris-ui/core 22.0.0-alpha.8 → 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 +1313 -511
- 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 -106
- 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 -114
- 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 +545 -177
- 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 +880 -270
- 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 +1256 -1423
- 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/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 -74
- 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 +264 -121
- 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 +463 -475
- 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,1595 +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
164
|
};
|
|
165
165
|
const AERIS_COLORED_DARK_SCHEME = {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
166
|
+
page: "#0c0c0c",
|
|
167
|
+
surface: "#121212",
|
|
168
|
+
surface2: "#191919",
|
|
169
|
+
surface3: "#232323",
|
|
170
|
+
interactiveHover: "#292929",
|
|
171
|
+
border: "#292929",
|
|
172
|
+
borderStrong: "#757575"
|
|
173
173
|
};
|
|
174
|
-
/** Accessible Aeris starter themes that can be passed directly to provideAeris(). */
|
|
175
174
|
const AERIS_THEME_PRESETS = {
|
|
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
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
+
}
|
|
259
258
|
};
|
|
260
259
|
const AERIS_DENSITY_PRESETS = {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
+
}
|
|
288
287
|
};
|
|
289
288
|
const AERIS_RADIUS_PRESETS = {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
+
}
|
|
314
313
|
};
|
|
315
314
|
const AERIS_DEFAULT_THEME = {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
|
330
329
|
};
|
|
331
|
-
|
|
332
|
-
const ACHROMATIC_CHROMA = 0.01;
|
|
330
|
+
const ACHROMATIC_CHROMA = .01;
|
|
333
331
|
const GAMUT_SEARCH_STEPS = 24;
|
|
334
|
-
const SRGB_GAMUT_TOLERANCE = 0.000_000_1;
|
|
335
332
|
function parseAerisColor(value) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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;
|
|
348
348
|
}
|
|
349
349
|
function mixAerisColor(from, to, amount) {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return `color-mix(in oklch, ${from} ${startWeight}%, ${to})`;
|
|
356
|
-
}
|
|
357
|
-
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));
|
|
358
355
|
}
|
|
359
356
|
function aerisContrastRatio(first, second) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
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);
|
|
365
361
|
}
|
|
366
362
|
function aerisRgbContrastRatio(first, second) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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);
|
|
372
368
|
}
|
|
373
369
|
function mixAerisRgb(from, to, amount) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
hue: interpolateHue(start.hue, end.hue, weight),
|
|
385
|
-
};
|
|
386
|
-
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
|
+
});
|
|
387
380
|
}
|
|
388
381
|
function formatAerisHex(color) {
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
const channel = (value) => Math.round(clampChannel(value)).toString(16).padStart(2, "0");
|
|
383
|
+
return `#${channel(color.red)}${channel(color.green)}${channel(color.blue)}`;
|
|
391
384
|
}
|
|
392
385
|
function relativeLuminance(color) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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);
|
|
398
391
|
}
|
|
399
392
|
function rgbToOklab(color) {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
+
};
|
|
414
407
|
}
|
|
415
408
|
function oklabToOklch(color) {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
+
};
|
|
423
416
|
}
|
|
424
417
|
function oklchToGamutMappedRgb(color) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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);
|
|
443
438
|
}
|
|
444
439
|
function oklchToSrgb(color) {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
+
];
|
|
459
454
|
}
|
|
460
455
|
function interpolateHue(from, to, amount) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return from;
|
|
465
|
-
const difference = ((to - from + 540) % 360) - 180;
|
|
466
|
-
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);
|
|
467
459
|
}
|
|
468
460
|
function srgbToLinear(channel) {
|
|
469
|
-
|
|
461
|
+
return channel <= .04045 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4;
|
|
470
462
|
}
|
|
471
463
|
function linearToSrgb(channel) {
|
|
472
|
-
|
|
464
|
+
return channel <= .0031308 ? channel * 12.92 : 1.055 * channel ** (1 / 2.4) - .055;
|
|
473
465
|
}
|
|
474
466
|
function isInSrgbGamut(color) {
|
|
475
|
-
|
|
467
|
+
return color.every((channel) => channel >= -1e-7 && channel <= 1.0000001);
|
|
476
468
|
}
|
|
477
469
|
function toRgbChannels(color) {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
470
|
+
return {
|
|
471
|
+
red: clampUnit(color[0]) * 255,
|
|
472
|
+
green: clampUnit(color[1]) * 255,
|
|
473
|
+
blue: clampUnit(color[2]) * 255
|
|
474
|
+
};
|
|
483
475
|
}
|
|
484
476
|
function interpolate(from, to, amount) {
|
|
485
|
-
|
|
477
|
+
return from + (to - from) * amount;
|
|
486
478
|
}
|
|
487
479
|
function normalizeHue(hue) {
|
|
488
|
-
|
|
480
|
+
return (hue % 360 + 360) % 360;
|
|
489
481
|
}
|
|
490
482
|
function formatPercentage(value) {
|
|
491
|
-
|
|
483
|
+
return Number(value.toFixed(4)).toString();
|
|
492
484
|
}
|
|
493
485
|
function parseHex(value) {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
};
|
|
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
|
+
};
|
|
503
494
|
}
|
|
504
495
|
function parseRgb(value) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
return {
|
|
523
|
-
red: clampChannel(parsed[0]),
|
|
524
|
-
green: clampChannel(parsed[1]),
|
|
525
|
-
blue: clampChannel(parsed[2]),
|
|
526
|
-
};
|
|
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
|
+
};
|
|
527
513
|
}
|
|
528
514
|
function parseHsl(value) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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
|
+
};
|
|
564
563
|
}
|
|
565
564
|
function splitFunctionalColor(value) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (alpha !== undefined && !isOpaqueAlpha(alpha))
|
|
571
|
-
return null;
|
|
572
|
-
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 };
|
|
573
569
|
}
|
|
574
570
|
function isOpaqueAlpha(value) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
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;
|
|
579
574
|
}
|
|
580
575
|
function clampChannel(value) {
|
|
581
|
-
|
|
576
|
+
return Math.min(255, Math.max(0, value));
|
|
582
577
|
}
|
|
583
578
|
function clampUnit(value) {
|
|
584
|
-
|
|
579
|
+
return Math.min(1, Math.max(0, value));
|
|
585
580
|
}
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Version of the deterministic algorithm used to derive Aeris color tokens.
|
|
589
|
-
*
|
|
590
|
-
* A change to an existing derived color for the same complete theme input must
|
|
591
|
-
* increment this value. Build-time configurations can pin the version to make
|
|
592
|
-
* an intentional regeneration step explicit during upgrades.
|
|
593
|
-
*/
|
|
594
581
|
const AERIS_COLOR_DERIVATION_VERSION = 1;
|
|
595
|
-
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
const
|
|
601
|
-
const DARK_TEXT_TERTIARY = '#9d9d9d';
|
|
602
|
-
/** 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";
|
|
603
588
|
function resolveAerisFoundation(theme, mode) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
focus: scheme.focus ?? mixAerisColor('#ffffff', theme.palette.primary, 0.56),
|
|
642
|
-
};
|
|
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
|
+
};
|
|
643
626
|
}
|
|
644
|
-
|
|
645
627
|
const AERIS_SEMANTIC_TONE_NAMES = [
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
628
|
+
"primary",
|
|
629
|
+
"secondary",
|
|
630
|
+
"success",
|
|
631
|
+
"info",
|
|
632
|
+
"warning",
|
|
633
|
+
"danger",
|
|
634
|
+
"contrast"
|
|
653
635
|
];
|
|
654
636
|
const LIGHT_BASES = {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
637
|
+
success: "#52744d",
|
|
638
|
+
info: "#4f7180",
|
|
639
|
+
warning: "#c38600",
|
|
640
|
+
danger: "#c81e2a"
|
|
659
641
|
};
|
|
660
642
|
const DARK_BASES = {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
643
|
+
success: "#91b78a",
|
|
644
|
+
info: "#91b7c8",
|
|
645
|
+
warning: "#facc15",
|
|
646
|
+
danger: "#ff5c68"
|
|
665
647
|
};
|
|
666
|
-
const DARK_FOREGROUND =
|
|
667
|
-
const LIGHT_FOREGROUND =
|
|
648
|
+
const DARK_FOREGROUND = "#111411";
|
|
649
|
+
const LIGHT_FOREGROUND = "#ffffff";
|
|
668
650
|
const REQUIRED_TEXT_CONTRAST = 4.5;
|
|
669
|
-
const LIGHT_HOVER_MIX =
|
|
670
|
-
const LIGHT_ACTIVE_MIX =
|
|
671
|
-
const DARK_HOVER_MIX =
|
|
672
|
-
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;
|
|
673
655
|
function resolveAerisSemanticTones(theme, mode) {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}
|
|
702
|
-
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;
|
|
703
683
|
}
|
|
704
684
|
function defaultBase(theme, mode, name) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
: name === 'secondary'
|
|
711
|
-
? theme.palette.secondary
|
|
712
|
-
: theme.palette.contrast;
|
|
713
|
-
if (mode === 'light')
|
|
714
|
-
return seed;
|
|
715
|
-
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);
|
|
716
690
|
}
|
|
717
691
|
function resolveSurface(theme, scheme, mode) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
return mode === 'light'
|
|
721
|
-
? LIGHT_FOREGROUND
|
|
722
|
-
: 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);
|
|
723
694
|
}
|
|
724
695
|
function deriveState(base, mode, amount, foreground) {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
aerisRgbContrastRatio(foregroundColor, dark)
|
|
738
|
-
? LIGHT_FOREGROUND
|
|
739
|
-
: DARK_FOREGROUND;
|
|
740
|
-
for (let mix = amount; mix <= 1; mix += 0.01) {
|
|
741
|
-
const candidate = mixAerisColor(base, target, mix);
|
|
742
|
-
const candidateColor = parseAerisColor(candidate);
|
|
743
|
-
if (candidateColor &&
|
|
744
|
-
aerisRgbContrastRatio(candidateColor, foregroundColor) >= REQUIRED_TEXT_CONTRAST) {
|
|
745
|
-
return candidate;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
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;
|
|
749
708
|
}
|
|
750
709
|
function stateMix(mode, state) {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
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;
|
|
754
712
|
}
|
|
755
713
|
function contrastingForeground(color, fallback = DARK_FOREGROUND) {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
const darkContrast = aerisRgbContrastRatio(background, parseAerisColor(DARK_FOREGROUND));
|
|
764
|
-
const lightContrast = aerisRgbContrastRatio(background, parseAerisColor(LIGHT_FOREGROUND));
|
|
765
|
-
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;
|
|
766
720
|
}
|
|
767
721
|
function ensureTextContrast(color, background, mode) {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
return formatAerisHex(candidate);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
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);
|
|
782
732
|
}
|
|
783
|
-
|
|
784
733
|
const TONE_NAMES = [
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
734
|
+
"primary",
|
|
735
|
+
"secondary",
|
|
736
|
+
"success",
|
|
737
|
+
"info",
|
|
738
|
+
"warning",
|
|
739
|
+
"danger",
|
|
740
|
+
"contrast"
|
|
792
741
|
];
|
|
793
742
|
function auditAerisThemeContrast(theme, mode) {
|
|
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
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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
|
+
};
|
|
934
883
|
}
|
|
935
884
|
function interactionChecks(name, tone, surface) {
|
|
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
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
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
|
+
];
|
|
994
943
|
}
|
|
995
944
|
function createCheck(definition) {
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
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
|
+
};
|
|
1004
953
|
}
|
|
1005
954
|
function resolveSchemeColors(theme, mode) {
|
|
1006
|
-
|
|
955
|
+
return resolveAerisFoundation(theme, mode);
|
|
1007
956
|
}
|
|
1008
957
|
function titleCase(value) {
|
|
1009
|
-
|
|
958
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
1010
959
|
}
|
|
1011
|
-
|
|
1012
|
-
/** Resolves an optional theme override against the complete Aeris defaults. */
|
|
1013
960
|
function resolveAerisTheme(theme) {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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
|
+
};
|
|
1040
987
|
}
|
|
1041
|
-
/** Deeply merges a runtime update into an already resolved Aeris theme. */
|
|
1042
988
|
function mergeAerisTheme(theme, update) {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
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
|
+
};
|
|
1069
1015
|
}
|
|
1070
1016
|
function resolveAerisDensity(theme) {
|
|
1071
|
-
|
|
1017
|
+
return theme.densities[theme.density] ?? AERIS_DEFAULT_THEME.densities["medium"];
|
|
1072
1018
|
}
|
|
1073
1019
|
function resolveAerisRadius(theme) {
|
|
1074
|
-
|
|
1020
|
+
return theme.radii[theme.radius] ?? AERIS_DEFAULT_THEME.radii["rounded"];
|
|
1075
1021
|
}
|
|
1076
1022
|
function mergeAerisSemanticTones(current, updates) {
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
...current?.[name],
|
|
1083
|
-
...updates?.[name],
|
|
1084
|
-
},
|
|
1085
|
-
]));
|
|
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
|
+
}]));
|
|
1086
1028
|
}
|
|
1087
1029
|
function normalizeAerisPalette(palette) {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
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
|
+
};
|
|
1103
1059
|
}
|
|
1104
|
-
|
|
1105
1060
|
const FOUNDATION_TOKENS = [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
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"]
|
|
1117
1072
|
];
|
|
1118
1073
|
const DENSITY_TOKENS = [
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
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"]
|
|
1126
1081
|
];
|
|
1127
1082
|
const RADIUS_TOKENS = [
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
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"]
|
|
1134
1089
|
];
|
|
1135
|
-
/** Resolves the ordered CSS custom properties used by runtime and generated Aeris themes. */
|
|
1136
1090
|
function resolveAerisThemeTokens(theme, mode) {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
const radius = resolveAerisRadius(theme);
|
|
1173
|
-
for (const [property, token] of RADIUS_TOKENS) {
|
|
1174
|
-
const value = radius[property];
|
|
1175
|
-
if (value)
|
|
1176
|
-
tokens[token] = value;
|
|
1177
|
-
}
|
|
1178
|
-
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;
|
|
1179
1125
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
const
|
|
1190
|
-
const GENERATED_BANNER = `/*! Generated by Aeris UI; color derivation v${AERIS_COLOR_DERIVATION_VERSION}. Edit the theme source, not this file. */`;
|
|
1191
|
-
/** 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. */`;
|
|
1192
1136
|
function compileAerisTheme(themeOverride = {}, options = {}) {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
css: serializeThemeCss(lightTokens, darkTokens, selector, options, generation),
|
|
1217
|
-
theme,
|
|
1218
|
-
lightTokens,
|
|
1219
|
-
darkTokens,
|
|
1220
|
-
contrast,
|
|
1221
|
-
};
|
|
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
|
+
};
|
|
1222
1160
|
}
|
|
1223
|
-
/** Convenience API for callers that only need the generated stylesheet. */
|
|
1224
1161
|
function generateAerisThemeCss(themeOverride = {}, options = {}) {
|
|
1225
|
-
|
|
1162
|
+
return compileAerisTheme(themeOverride, options).css;
|
|
1226
1163
|
}
|
|
1227
1164
|
function validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
mode,
|
|
1268
|
-
token,
|
|
1269
|
-
});
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
if (generation.validateContrast) {
|
|
1273
|
-
for (const check of contrast[mode].checks) {
|
|
1274
|
-
if (check.status === 'fail') {
|
|
1275
|
-
issues.push({
|
|
1276
|
-
code: 'contrast-failed',
|
|
1277
|
-
message: `${check.label} is ${check.ratio?.toFixed(2)}:1; ${check.requiredRatio}:1 is required.`,
|
|
1278
|
-
mode,
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
else if (check.status === 'unresolved') {
|
|
1282
|
-
issues.push({
|
|
1283
|
-
code: 'contrast-unresolved',
|
|
1284
|
-
message: `${check.label} could not be evaluated from static colors.`,
|
|
1285
|
-
mode,
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
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;
|
|
1292
1204
|
}
|
|
1293
1205
|
function serializeThemeCss(lightTokens, darkTokens, selector, options, generation) {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
darkSelectors.unshift(selector);
|
|
1325
|
-
}
|
|
1326
|
-
if (includeSystemMode)
|
|
1327
|
-
lightSelectors.push(`${selector}[data-aeris-theme='system']`);
|
|
1328
|
-
const rules = [
|
|
1329
|
-
formatRule([selector], common, undefined, options.minify ?? false),
|
|
1330
|
-
formatRule(lightSelectors, light, 'light', options.minify ?? false),
|
|
1331
|
-
formatRule(darkSelectors, dark, 'dark', options.minify ?? false),
|
|
1332
|
-
];
|
|
1333
|
-
if (includeSystemMode) {
|
|
1334
|
-
const systemSelectors = [`${selector}[data-aeris-theme='system']`];
|
|
1335
|
-
if (generation.defaultMode === 'system') {
|
|
1336
|
-
systemSelectors.unshift(`${selector}:not([data-aeris-theme])`);
|
|
1337
|
-
}
|
|
1338
|
-
const systemRule = formatRule(systemSelectors, dark, 'dark', options.minify ?? false);
|
|
1339
|
-
rules.push(formatMediaRule(systemRule, options.minify ?? false));
|
|
1340
|
-
}
|
|
1341
|
-
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);
|
|
1342
1236
|
}
|
|
1343
1237
|
function finalizeCss(rules, options) {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
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`;
|
|
1350
1243
|
}
|
|
1351
1244
|
function resolveGenerationOptions(options) {
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
includeSystemMode,
|
|
1367
|
-
validateContrast,
|
|
1368
|
-
valid,
|
|
1369
|
-
message: !validSchemes
|
|
1370
|
-
? 'schemes must be "both", "light", or "dark".'
|
|
1371
|
-
: !validDefaultMode
|
|
1372
|
-
? 'defaultMode must be "system", "light", or "dark".'
|
|
1373
|
-
: schemes === 'both'
|
|
1374
|
-
? 'defaultMode="system" requires system-mode generation to be enabled.'
|
|
1375
|
-
: `defaultMode must be "${schemes}" when only the ${schemes} scheme is generated.`,
|
|
1376
|
-
};
|
|
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
|
+
};
|
|
1377
1259
|
}
|
|
1378
1260
|
function formatRule(selectors, tokens, colorScheme, minify) {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
return `${selectors.join(',')}{${declarations.join(';')}}`;
|
|
1387
|
-
}
|
|
1388
|
-
const declarations = [
|
|
1389
|
-
...(colorScheme ? [` color-scheme: ${colorScheme};`] : []),
|
|
1390
|
-
...tokens.map(([token, value]) => ` ${token}: ${value};`),
|
|
1391
|
-
];
|
|
1392
|
-
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}`;
|
|
1393
1268
|
}
|
|
1394
1269
|
function formatMediaRule(rule, minify) {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
return `@media (prefers-color-scheme: dark) {\n${rule
|
|
1398
|
-
.split('\n')
|
|
1399
|
-
.map((line) => ` ${line}`)
|
|
1400
|
-
.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}`;
|
|
1401
1272
|
}
|
|
1402
1273
|
function isSafeSelector(selector) {
|
|
1403
|
-
|
|
1274
|
+
return selector.length > 0 && !/[{},;\r\n]/.test(selector);
|
|
1404
1275
|
}
|
|
1405
1276
|
function isSafeCssValue$1(value) {
|
|
1406
|
-
|
|
1277
|
+
return value.length > 0 && !/[;{}\r\n]/.test(value);
|
|
1407
1278
|
}
|
|
1408
|
-
|
|
1409
1279
|
const SCHEME_COLOR_PROPERTIES = [
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1280
|
+
"accent",
|
|
1281
|
+
"page",
|
|
1282
|
+
"surface",
|
|
1283
|
+
"surface2",
|
|
1284
|
+
"surface3",
|
|
1285
|
+
"interactiveHover",
|
|
1286
|
+
"text",
|
|
1287
|
+
"text2",
|
|
1288
|
+
"text3",
|
|
1289
|
+
"border",
|
|
1290
|
+
"borderStrong",
|
|
1291
|
+
"focus"
|
|
1422
1292
|
];
|
|
1423
1293
|
const TONE_PROPERTIES = [
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1294
|
+
"base",
|
|
1295
|
+
"boundary",
|
|
1296
|
+
"hover",
|
|
1297
|
+
"active",
|
|
1298
|
+
"onBase",
|
|
1299
|
+
"onHover",
|
|
1300
|
+
"onActive",
|
|
1301
|
+
"text",
|
|
1302
|
+
"soft",
|
|
1303
|
+
"onSoft"
|
|
1434
1304
|
];
|
|
1435
|
-
/**
|
|
1436
|
-
* Validates a runtime or build-time theme without reading the DOM.
|
|
1437
|
-
*
|
|
1438
|
-
* Errors identify values Aeris cannot safely apply or accessibility checks
|
|
1439
|
-
* known to fail. Warnings identify colors that require rendered/manual review.
|
|
1440
|
-
*/
|
|
1441
1305
|
function validateAerisTheme(themeOverride = {}) {
|
|
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
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
const errors = issues.filter(({ severity }) => severity === 'error');
|
|
1485
|
-
const warnings = issues.filter(({ severity }) => severity === 'warning');
|
|
1486
|
-
return {
|
|
1487
|
-
status: errors.length ? 'error' : warnings.length ? 'warning' : 'valid',
|
|
1488
|
-
valid: errors.length === 0,
|
|
1489
|
-
issues,
|
|
1490
|
-
errors,
|
|
1491
|
-
warnings,
|
|
1492
|
-
};
|
|
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
|
+
};
|
|
1493
1348
|
}
|
|
1494
1349
|
function validateThemeSelection(theme, issues) {
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
severity: 'error',
|
|
1517
|
-
path: 'radius',
|
|
1518
|
-
message: `The selected radius "${theme.radius}" is not registered in theme.radii.`,
|
|
1519
|
-
guidance: 'Select a built-in corner style or register a radius scale with the same name.',
|
|
1520
|
-
});
|
|
1521
|
-
}
|
|
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
|
+
});
|
|
1522
1371
|
}
|
|
1523
1372
|
function collectThemeCssValues(theme) {
|
|
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
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
}
|
|
1564
|
-
}
|
|
1565
|
-
for (const [name, scale] of Object.entries(theme.radii)) {
|
|
1566
|
-
if (!isRecord(scale)) {
|
|
1567
|
-
values.push(cssValue(`radii.${name}`, scale, false));
|
|
1568
|
-
continue;
|
|
1569
|
-
}
|
|
1570
|
-
for (const [property, value] of Object.entries(scale)) {
|
|
1571
|
-
values.push(cssValue(`radii.${name}.${property}`, value, false));
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
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;
|
|
1575
1412
|
}
|
|
1576
1413
|
function cssValue(path, value, affectsColorResolution) {
|
|
1577
|
-
|
|
1414
|
+
return {
|
|
1415
|
+
path,
|
|
1416
|
+
value,
|
|
1417
|
+
affectsColorResolution
|
|
1418
|
+
};
|
|
1578
1419
|
}
|
|
1579
1420
|
function isSafeCssValue(value) {
|
|
1580
|
-
|
|
1421
|
+
return typeof value === "string" && value.trim().length > 0 && !/[;{}\r\n]/.test(value);
|
|
1581
1422
|
}
|
|
1582
1423
|
function isRecord(value) {
|
|
1583
|
-
|
|
1424
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1584
1425
|
}
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* Framework-independent Aeris theme compiler APIs for Node.js build scripts and browser tooling.
|
|
1588
|
-
*/
|
|
1589
|
-
|
|
1590
|
-
/**
|
|
1591
|
-
* Generated bundle index. Do not edit.
|
|
1592
|
-
*/
|
|
1593
|
-
|
|
1594
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 };
|
|
1595
|
-
|
|
1427
|
+
|
|
1428
|
+
//# sourceMappingURL=aeris-ui-core-theme-builder.mjs.map
|