@aeris-ui/core 22.0.0-alpha.10 → 22.0.0-alpha.11
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 +35 -3
- package/THIRD_PARTY_LICENSES.md +48 -0
- package/fesm2022/aeris-ui-core-accordion.mjs +34 -32
- package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +3 -3
- package/fesm2022/aeris-ui-core-auto-complete.mjs +119 -50
- package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-auto-focus.mjs +3 -3
- package/fesm2022/aeris-ui-core-avatar.mjs +6 -6
- package/fesm2022/aeris-ui-core-badge.mjs +6 -6
- package/fesm2022/aeris-ui-core-block-ui.mjs +18 -6
- package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-breadcrumb.mjs +42 -24
- package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-button-forms.mjs +78 -0
- package/fesm2022/aeris-ui-core-button-forms.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-button-group.mjs +417 -14
- package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-button.mjs +191 -19
- package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-card.mjs +18 -18
- package/fesm2022/aeris-ui-core-carousel.mjs +81 -19
- package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-cascade-select.mjs +165 -46
- package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-chart.mjs +171 -36
- package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-checkbox.mjs +191 -22
- package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-chip.mjs +702 -27
- package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-class-names.mjs +3 -3
- package/fesm2022/aeris-ui-core-code-block.mjs +57 -7
- package/fesm2022/aeris-ui-core-code-block.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-color-picker.mjs +1223 -503
- package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-command-palette.mjs +996 -0
- package/fesm2022/aeris-ui-core-command-palette.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-compare.mjs +61 -34
- package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs +68 -38
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-confirm-popup.mjs +46 -38
- package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-context-menu.mjs +94 -43
- package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs +946 -0
- package/fesm2022/aeris-ui-core-date-picker-aeris-date-picker-input-jAhzMzLQ.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-date-picker.mjs +1186 -650
- package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dialog.mjs +157 -71
- package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-divider.mjs +3 -3
- package/fesm2022/aeris-ui-core-drawer.mjs +751 -77
- package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +14 -6
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-editor.mjs +847 -202
- package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-file-upload.mjs +204 -68
- package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-filter-service.mjs +3 -3
- package/fesm2022/aeris-ui-core-fluid.mjs +5 -5
- package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-focus-trap.mjs +3 -3
- package/fesm2022/aeris-ui-core-form-field.mjs +15 -15
- package/fesm2022/aeris-ui-core-galleria.mjs +472 -123
- package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-glass.mjs +3 -3
- package/fesm2022/aeris-ui-core-icon-field.mjs +12 -12
- package/fesm2022/aeris-ui-core-inplace.mjs +56 -14
- package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-group.mjs +17 -17
- package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-mask.mjs +61 -8
- package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-number.mjs +191 -28
- package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-otp.mjs +6 -6
- package/fesm2022/aeris-ui-core-input-text.mjs +102 -26
- package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-kbd.mjs +243 -0
- package/fesm2022/aeris-ui-core-kbd.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-key-filter.mjs +3 -3
- package/fesm2022/aeris-ui-core-listbox.mjs +789 -0
- package/fesm2022/aeris-ui-core-listbox.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-mega-menu.mjs +59 -16
- package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menu.mjs +95 -52
- package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menubar.mjs +103 -34
- package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-message.mjs +48 -14
- package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-meter-group.mjs +33 -15
- package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-multi-select.mjs +283 -65
- package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-navbar.mjs +1407 -0
- package/fesm2022/aeris-ui-core-navbar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-order-list.mjs +191 -35
- package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-organization-chart.mjs +48 -14
- package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-paginator.mjs +300 -61
- package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-panel.mjs +21 -29
- package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-password.mjs +166 -65
- package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-pick-list.mjs +528 -56
- package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-popover.mjs +504 -72
- package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-progress-bar.mjs +75 -21
- package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-progress-spinner.mjs +24 -6
- package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-radio-button.mjs +119 -19
- package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-rating.mjs +6 -6
- package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-scroll-panel.mjs +3 -3
- package/fesm2022/aeris-ui-core-scroll-top.mjs +59 -12
- package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-select-native.mjs +145 -0
- package/fesm2022/aeris-ui-core-select-native.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-select.mjs +206 -87
- package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-sidebar.mjs +1293 -0
- package/fesm2022/aeris-ui-core-sidebar.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-skeleton.mjs +3 -3
- package/fesm2022/aeris-ui-core-slider.mjs +3 -3
- package/fesm2022/aeris-ui-core-speed-dial.mjs +34 -13
- package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-split-button.mjs +26 -11
- package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-splitter.mjs +35 -20
- package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-stepper.mjs +23 -17
- package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-style-class.mjs +3 -3
- package/fesm2022/aeris-ui-core-table.mjs +945 -106
- package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tabs.mjs +81 -19
- package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-textarea.mjs +89 -28
- package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-theme-builder.mjs +202 -126
- package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-theming.mjs +8 -8
- package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tiered-menu.mjs +94 -43
- package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-timeline.mjs +17 -17
- package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-toast.mjs +51 -18
- package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-toggle-switch.mjs +3 -3
- package/fesm2022/aeris-ui-core-toolbar.mjs +916 -44
- package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tooltip.mjs +6 -6
- package/fesm2022/aeris-ui-core-tree-select.mjs +252 -61
- package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree-table.mjs +493 -124
- package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree.mjs +165 -27
- package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
- package/fesm2022/aeris-ui-core.mjs +632 -12
- package/fesm2022/aeris-ui-core.mjs.map +1 -1
- package/package.json +29 -1
- package/schematics/runtime/theme-builder/aeris-color-derivation.js +1 -1
- package/schematics/runtime/theme-builder/aeris-contrast.js +32 -0
- package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-foundation.js +8 -9
- package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js +8 -21
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-generator.js +6 -0
- package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js +64 -91
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js +7 -5
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-validation.js +11 -1
- package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme.js +81 -10
- package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
- package/styles/_choice-card.scss +93 -0
- package/styles/_icon-artwork.scss +14 -0
- package/styles/_icon-template.scss +42 -0
- package/styles/_selection-icons.scss +12 -0
- package/styles/_table-pinning.scss +119 -0
- package/styles/aeris.css +35 -12
- package/styles/controls.css +149 -11
- package/tools/aeris-theme.mjs +3 -3
- package/tools/aeris-theme.schema.json +13 -11
- package/types/aeris-ui-core-auto-complete.d.ts +12 -0
- package/types/aeris-ui-core-block-ui.d.ts +1 -0
- package/types/aeris-ui-core-button-forms.d.ts +18 -0
- package/types/aeris-ui-core-button-group.d.ts +116 -3
- package/types/aeris-ui-core-button.d.ts +52 -4
- package/types/aeris-ui-core-carousel.d.ts +12 -0
- package/types/aeris-ui-core-cascade-select.d.ts +18 -0
- package/types/aeris-ui-core-chart.d.ts +26 -10
- package/types/aeris-ui-core-checkbox.d.ts +36 -2
- package/types/aeris-ui-core-chip.d.ts +196 -1
- package/types/aeris-ui-core-code-block.d.ts +13 -0
- package/types/aeris-ui-core-color-picker.d.ts +117 -15
- package/types/aeris-ui-core-command-palette.d.ts +267 -0
- package/types/aeris-ui-core-compare.d.ts +6 -0
- package/types/aeris-ui-core-confirm-dialog.d.ts +9 -1
- package/types/aeris-ui-core-context-menu.d.ts +6 -0
- package/types/aeris-ui-core-date-picker.d.ts +123 -20
- package/types/aeris-ui-core-dialog.d.ts +15 -2
- package/types/aeris-ui-core-drawer.d.ts +111 -4
- package/types/aeris-ui-core-dynamic-dialog.d.ts +6 -2
- package/types/aeris-ui-core-editor.d.ts +8 -1
- package/types/aeris-ui-core-file-upload.d.ts +18 -0
- package/types/aeris-ui-core-galleria.d.ts +48 -0
- package/types/aeris-ui-core-inplace.d.ts +6 -0
- package/types/aeris-ui-core-input-mask.d.ts +8 -1
- package/types/aeris-ui-core-input-number.d.ts +20 -1
- package/types/aeris-ui-core-input-text.d.ts +11 -1
- package/types/aeris-ui-core-kbd.d.ts +74 -0
- package/types/aeris-ui-core-listbox.d.ts +222 -0
- package/types/aeris-ui-core-mega-menu.d.ts +6 -0
- package/types/aeris-ui-core-menu.d.ts +6 -0
- package/types/aeris-ui-core-menubar.d.ts +16 -0
- package/types/aeris-ui-core-message.d.ts +6 -0
- package/types/aeris-ui-core-meter-group.d.ts +6 -0
- package/types/aeris-ui-core-multi-select.d.ts +30 -0
- package/types/aeris-ui-core-navbar.d.ts +208 -0
- package/types/aeris-ui-core-order-list.d.ts +24 -0
- package/types/aeris-ui-core-organization-chart.d.ts +6 -0
- package/types/aeris-ui-core-paginator.d.ts +37 -1
- package/types/aeris-ui-core-password.d.ts +18 -0
- package/types/aeris-ui-core-pick-list.d.ts +54 -0
- package/types/aeris-ui-core-popover.d.ts +80 -5
- package/types/aeris-ui-core-progress-bar.d.ts +6 -0
- package/types/aeris-ui-core-progress-spinner.d.ts +6 -0
- package/types/aeris-ui-core-radio-button.d.ts +24 -2
- package/types/aeris-ui-core-rating.d.ts +1 -1
- package/types/aeris-ui-core-scroll-top.d.ts +7 -0
- package/types/aeris-ui-core-select-native.d.ts +40 -0
- package/types/aeris-ui-core-select.d.ts +12 -0
- package/types/aeris-ui-core-sidebar.d.ts +220 -0
- package/types/aeris-ui-core-splitter.d.ts +3 -4
- package/types/aeris-ui-core-table.d.ts +144 -11
- package/types/aeris-ui-core-tabs.d.ts +12 -0
- package/types/aeris-ui-core-textarea.d.ts +11 -1
- package/types/aeris-ui-core-theme-builder.d.ts +31 -296
- package/types/aeris-ui-core-tiered-menu.d.ts +6 -0
- package/types/aeris-ui-core-toast.d.ts +6 -0
- package/types/aeris-ui-core-toolbar.d.ts +213 -3
- package/types/aeris-ui-core-tree-select.d.ts +30 -0
- package/types/aeris-ui-core-tree-table.d.ts +75 -14
- package/types/aeris-ui-core-tree.d.ts +24 -0
- package/types/aeris-ui-core.d.ts +142 -3
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
const AERIS_SEMANTIC_TONE_NAMES = [
|
|
2
|
+
"primary",
|
|
3
|
+
"secondary",
|
|
4
|
+
"success",
|
|
5
|
+
"info",
|
|
6
|
+
"warning",
|
|
7
|
+
"danger",
|
|
8
|
+
"contrast"
|
|
9
|
+
];
|
|
1
10
|
const AERIS_MONOCHROME_LIGHT_PRIMARY_TONE = {
|
|
2
11
|
base: "#111111",
|
|
3
12
|
boundary: "#111111",
|
|
@@ -171,7 +180,7 @@ const AERIS_COLORED_DARK_SCHEME = {
|
|
|
171
180
|
border: "#292929",
|
|
172
181
|
borderStrong: "#757575"
|
|
173
182
|
};
|
|
174
|
-
const
|
|
183
|
+
const THEME_DEFINITIONS = {
|
|
175
184
|
earth: {
|
|
176
185
|
palette: {
|
|
177
186
|
surface: "#f1f4f2",
|
|
@@ -260,6 +269,72 @@ const AERIS_THEME_PRESETS = {
|
|
|
260
269
|
}
|
|
261
270
|
}
|
|
262
271
|
};
|
|
272
|
+
const AERIS_THEME_PRESETS = {
|
|
273
|
+
earth: {
|
|
274
|
+
preset: "earth",
|
|
275
|
+
palette: THEME_DEFINITIONS.earth.palette
|
|
276
|
+
},
|
|
277
|
+
coastal: {
|
|
278
|
+
preset: "coastal",
|
|
279
|
+
palette: THEME_DEFINITIONS.coastal.palette
|
|
280
|
+
},
|
|
281
|
+
orchid: {
|
|
282
|
+
preset: "orchid",
|
|
283
|
+
palette: THEME_DEFINITIONS.orchid.palette
|
|
284
|
+
},
|
|
285
|
+
monochrome: {
|
|
286
|
+
preset: "monochrome",
|
|
287
|
+
palette: THEME_DEFINITIONS.monochrome.palette
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
function resolveAerisThemeScheme(theme, mode) {
|
|
291
|
+
const definition = Object.hasOwn(THEME_DEFINITIONS, theme.preset) ? THEME_DEFINITIONS[theme.preset] : THEME_DEFINITIONS.monochrome;
|
|
292
|
+
const inherited = { ...definition[mode] };
|
|
293
|
+
const overrides = theme[mode];
|
|
294
|
+
const surfaceChanged = theme.palette.surface !== definition.palette.surface;
|
|
295
|
+
if (surfaceChanged) for (const key of [
|
|
296
|
+
"page",
|
|
297
|
+
"surface",
|
|
298
|
+
"surface2",
|
|
299
|
+
"surface3",
|
|
300
|
+
"interactiveHover",
|
|
301
|
+
"border",
|
|
302
|
+
"borderStrong"
|
|
303
|
+
]) delete inherited[key];
|
|
304
|
+
if (theme.palette.primary !== definition.palette.primary) {
|
|
305
|
+
delete inherited.focus;
|
|
306
|
+
delete inherited.interactiveHover;
|
|
307
|
+
}
|
|
308
|
+
if (theme.palette.secondary !== definition.palette.secondary) {
|
|
309
|
+
delete inherited.border;
|
|
310
|
+
delete inherited.borderStrong;
|
|
311
|
+
}
|
|
312
|
+
if (theme.palette.accent !== definition.palette.accent) delete inherited.accent;
|
|
313
|
+
const tones = {};
|
|
314
|
+
for (const name of AERIS_SEMANTIC_TONE_NAMES) {
|
|
315
|
+
const override = overrides.tones?.[name];
|
|
316
|
+
const seedChanged = (name === "primary" || name === "secondary" || name === "contrast") && theme.palette[name] !== definition.palette[name];
|
|
317
|
+
const defaults = { ...inherited.tones?.[name] };
|
|
318
|
+
const baseChanged = override?.base !== void 0 && override.base !== defaults.base;
|
|
319
|
+
if (surfaceChanged) {
|
|
320
|
+
delete defaults.soft;
|
|
321
|
+
delete defaults.onSoft;
|
|
322
|
+
delete defaults.text;
|
|
323
|
+
}
|
|
324
|
+
if (override?.hover !== void 0) delete defaults.onHover;
|
|
325
|
+
if (override?.active !== void 0) delete defaults.onActive;
|
|
326
|
+
if (override?.soft !== void 0 || override?.text !== void 0) delete defaults.onSoft;
|
|
327
|
+
tones[name] = override === null ? {} : {
|
|
328
|
+
...!seedChanged && !baseChanged ? defaults : {},
|
|
329
|
+
...override
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
...inherited,
|
|
334
|
+
...overrides,
|
|
335
|
+
tones
|
|
336
|
+
};
|
|
337
|
+
}
|
|
263
338
|
const AERIS_DENSITY_PRESETS = {
|
|
264
339
|
compact: {
|
|
265
340
|
controlHeight: "2.125rem",
|
|
@@ -316,16 +391,10 @@ const AERIS_RADIUS_PRESETS = {
|
|
|
316
391
|
}
|
|
317
392
|
};
|
|
318
393
|
const AERIS_DEFAULT_THEME = {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
cloud: AERIS_THEME_PRESETS.monochrome.palette.secondary,
|
|
324
|
-
sand: AERIS_THEME_PRESETS.monochrome.palette.accent,
|
|
325
|
-
umber: AERIS_THEME_PRESETS.monochrome.palette.contrast
|
|
326
|
-
},
|
|
327
|
-
light: { ...AERIS_THEME_PRESETS.monochrome.light },
|
|
328
|
-
dark: { ...AERIS_THEME_PRESETS.monochrome.dark },
|
|
394
|
+
preset: "monochrome",
|
|
395
|
+
palette: { ...AERIS_THEME_PRESETS.monochrome.palette },
|
|
396
|
+
light: {},
|
|
397
|
+
dark: {},
|
|
329
398
|
radius: "rounded",
|
|
330
399
|
radii: AERIS_RADIUS_PRESETS,
|
|
331
400
|
density: "medium",
|
|
@@ -582,7 +651,7 @@ function clampChannel(value) {
|
|
|
582
651
|
function clampUnit(value) {
|
|
583
652
|
return Math.min(1, Math.max(0, value));
|
|
584
653
|
}
|
|
585
|
-
const AERIS_COLOR_DERIVATION_VERSION =
|
|
654
|
+
const AERIS_COLOR_DERIVATION_VERSION = 2;
|
|
586
655
|
const LIGHT_TEXT = "#222222";
|
|
587
656
|
const LIGHT_TEXT_SECONDARY = "#555555";
|
|
588
657
|
const LIGHT_TEXT_TERTIARY = "#707070";
|
|
@@ -590,7 +659,7 @@ const DARK_TEXT = "#f4f4f4";
|
|
|
590
659
|
const DARK_TEXT_SECONDARY = "#c5c5c5";
|
|
591
660
|
const DARK_TEXT_TERTIARY = "#9d9d9d";
|
|
592
661
|
function resolveAerisFoundation(theme, mode) {
|
|
593
|
-
const scheme = theme
|
|
662
|
+
const scheme = resolveAerisThemeScheme(theme, mode);
|
|
594
663
|
const surfaceSeed = theme.palette.surface;
|
|
595
664
|
const borderSeed = theme.palette.secondary;
|
|
596
665
|
if (mode === "light") {
|
|
@@ -611,14 +680,14 @@ function resolveAerisFoundation(theme, mode) {
|
|
|
611
680
|
focus: scheme.focus ?? mixAerisColor("#1d2119", theme.palette.primary, .5)
|
|
612
681
|
};
|
|
613
682
|
}
|
|
614
|
-
const surface2 = scheme.surface2 ?? mixAerisColor("#
|
|
615
|
-
const surface = scheme.surface ?? mixAerisColor("#
|
|
683
|
+
const surface2 = scheme.surface2 ?? mixAerisColor("#191919", surfaceSeed, .008);
|
|
684
|
+
const surface = scheme.surface ?? mixAerisColor("#121212", surfaceSeed, .006);
|
|
616
685
|
const border = scheme.border ?? mixAerisColor(surface, mixAerisColor("#70746d", borderSeed, .35), .16);
|
|
617
686
|
return {
|
|
618
|
-
page: scheme.page ?? mixAerisColor("#
|
|
687
|
+
page: scheme.page ?? mixAerisColor("#0c0c0c", surfaceSeed, .004),
|
|
619
688
|
surface,
|
|
620
689
|
surface2,
|
|
621
|
-
surface3: scheme.surface3 ?? mixAerisColor("#
|
|
690
|
+
surface3: scheme.surface3 ?? mixAerisColor("#232323", surfaceSeed, .01),
|
|
622
691
|
interactiveHover: scheme.interactiveHover ?? mixAerisColor(surface2, theme.palette.primary, .12),
|
|
623
692
|
text: scheme.text ?? DARK_TEXT,
|
|
624
693
|
text2: scheme.text2 ?? DARK_TEXT_SECONDARY,
|
|
@@ -628,15 +697,6 @@ function resolveAerisFoundation(theme, mode) {
|
|
|
628
697
|
focus: scheme.focus ?? mixAerisColor("#ffffff", theme.palette.primary, .56)
|
|
629
698
|
};
|
|
630
699
|
}
|
|
631
|
-
const AERIS_SEMANTIC_TONE_NAMES = [
|
|
632
|
-
"primary",
|
|
633
|
-
"secondary",
|
|
634
|
-
"success",
|
|
635
|
-
"info",
|
|
636
|
-
"warning",
|
|
637
|
-
"danger",
|
|
638
|
-
"contrast"
|
|
639
|
-
];
|
|
640
700
|
const LIGHT_BASES = {
|
|
641
701
|
success: "#52744d",
|
|
642
702
|
info: "#4f7180",
|
|
@@ -657,8 +717,8 @@ const LIGHT_ACTIVE_MIX = .05;
|
|
|
657
717
|
const DARK_HOVER_MIX = .2;
|
|
658
718
|
const DARK_ACTIVE_MIX = .28;
|
|
659
719
|
function resolveAerisSemanticTones(theme, mode) {
|
|
660
|
-
const scheme = theme
|
|
661
|
-
const surface =
|
|
720
|
+
const scheme = resolveAerisThemeScheme(theme, mode);
|
|
721
|
+
const surface = resolveAerisFoundation(theme, mode).surface;
|
|
662
722
|
const result = {};
|
|
663
723
|
for (const name of AERIS_SEMANTIC_TONE_NAMES) {
|
|
664
724
|
const overrides = scheme.tones?.[name] ?? {};
|
|
@@ -692,10 +752,6 @@ function defaultBase(theme, mode, name) {
|
|
|
692
752
|
if (mode === "light") return seed;
|
|
693
753
|
return mixAerisColor(seed, LIGHT_FOREGROUND, name === "contrast" ? .29 : .22);
|
|
694
754
|
}
|
|
695
|
-
function resolveSurface(theme, scheme, mode) {
|
|
696
|
-
if (scheme.surface) return scheme.surface;
|
|
697
|
-
return mode === "light" ? LIGHT_FOREGROUND : mixAerisColor("#1f221c", theme.palette.surface, .02);
|
|
698
|
-
}
|
|
699
755
|
function deriveState(base, mode, amount, foreground) {
|
|
700
756
|
const state = mixAerisColor(base, mode === "light" ? DARK_FOREGROUND : LIGHT_FOREGROUND, amount);
|
|
701
757
|
const stateColor = parseAerisColor(state);
|
|
@@ -755,6 +811,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
755
811
|
kind: "text",
|
|
756
812
|
foreground: scheme.text,
|
|
757
813
|
background: scheme.page,
|
|
814
|
+
foregroundProperty: "text",
|
|
815
|
+
backgroundProperty: "page",
|
|
758
816
|
requiredRatio: 4.5,
|
|
759
817
|
guidance: "Increase the difference between the text and page colors."
|
|
760
818
|
}),
|
|
@@ -766,6 +824,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
766
824
|
kind: "text",
|
|
767
825
|
foreground: scheme.text,
|
|
768
826
|
background: scheme.surface,
|
|
827
|
+
foregroundProperty: "text",
|
|
828
|
+
backgroundProperty: "surface",
|
|
769
829
|
requiredRatio: 4.5,
|
|
770
830
|
guidance: "Increase the difference between the text and surface colors."
|
|
771
831
|
}),
|
|
@@ -777,6 +837,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
777
837
|
kind: "text",
|
|
778
838
|
foreground: scheme.text2,
|
|
779
839
|
background: scheme.surface,
|
|
840
|
+
foregroundProperty: "text2",
|
|
841
|
+
backgroundProperty: "surface",
|
|
780
842
|
requiredRatio: 4.5,
|
|
781
843
|
guidance: "Strengthen the secondary text color without reducing hierarchy."
|
|
782
844
|
}),
|
|
@@ -788,6 +850,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
788
850
|
kind: "text",
|
|
789
851
|
foreground: scheme.text3,
|
|
790
852
|
background: scheme.surface,
|
|
853
|
+
foregroundProperty: "text3",
|
|
854
|
+
backgroundProperty: "surface",
|
|
791
855
|
requiredRatio: 4.5,
|
|
792
856
|
guidance: "Darken or lighten the tertiary text until it remains readable."
|
|
793
857
|
}),
|
|
@@ -799,6 +863,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
799
863
|
kind: "text",
|
|
800
864
|
foreground: scheme.text2,
|
|
801
865
|
background: scheme.surface2,
|
|
866
|
+
foregroundProperty: "text2",
|
|
867
|
+
backgroundProperty: "surface2",
|
|
802
868
|
requiredRatio: 4.5,
|
|
803
869
|
guidance: "Increase secondary text contrast against the raised surface."
|
|
804
870
|
}),
|
|
@@ -810,6 +876,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
810
876
|
kind: "text",
|
|
811
877
|
foreground: scheme.text,
|
|
812
878
|
background: scheme.interactiveHover,
|
|
879
|
+
foregroundProperty: "text",
|
|
880
|
+
backgroundProperty: "interactiveHover",
|
|
813
881
|
requiredRatio: 4.5,
|
|
814
882
|
guidance: "Adjust interactiveHover until default content remains readable."
|
|
815
883
|
}),
|
|
@@ -822,6 +890,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
822
890
|
kind: "non-text",
|
|
823
891
|
foreground: scheme.focus,
|
|
824
892
|
background: scheme.surface,
|
|
893
|
+
foregroundProperty: "focus",
|
|
894
|
+
backgroundProperty: "surface",
|
|
825
895
|
requiredRatio: 3,
|
|
826
896
|
guidance: "Strengthen the focus color against the primary surface."
|
|
827
897
|
}),
|
|
@@ -833,6 +903,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
833
903
|
kind: "non-text",
|
|
834
904
|
foreground: scheme.focus,
|
|
835
905
|
background: scheme.page,
|
|
906
|
+
foregroundProperty: "focus",
|
|
907
|
+
backgroundProperty: "page",
|
|
836
908
|
requiredRatio: 3,
|
|
837
909
|
guidance: "Strengthen the focus color against the page background."
|
|
838
910
|
}),
|
|
@@ -844,6 +916,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
844
916
|
kind: "non-text",
|
|
845
917
|
foreground: scheme.borderStrong,
|
|
846
918
|
background: scheme.surface,
|
|
919
|
+
foregroundProperty: "borderStrong",
|
|
920
|
+
backgroundProperty: "surface",
|
|
847
921
|
requiredRatio: 3,
|
|
848
922
|
guidance: "Increase the emphasized boundary contrast against the primary surface."
|
|
849
923
|
}),
|
|
@@ -855,6 +929,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
855
929
|
kind: "non-text",
|
|
856
930
|
foreground: scheme.borderStrong,
|
|
857
931
|
background: scheme.surface2,
|
|
932
|
+
foregroundProperty: "borderStrong",
|
|
933
|
+
backgroundProperty: "surface2",
|
|
858
934
|
requiredRatio: 3,
|
|
859
935
|
guidance: "Increase the emphasized boundary contrast against the raised surface."
|
|
860
936
|
}),
|
|
@@ -866,6 +942,8 @@ function auditAerisThemeContrast(theme, mode) {
|
|
|
866
942
|
kind: "non-text",
|
|
867
943
|
foreground: tones[name].boundary,
|
|
868
944
|
background: scheme.surface,
|
|
945
|
+
foregroundProperty: `tones.${name}.boundary`,
|
|
946
|
+
backgroundProperty: "surface",
|
|
869
947
|
requiredRatio: 3,
|
|
870
948
|
guidance: `Adjust tones.${name}.boundary so solid controls remain identifiable.`
|
|
871
949
|
}))
|
|
@@ -896,6 +974,8 @@ function interactionChecks(name, tone, surface) {
|
|
|
896
974
|
kind: "text",
|
|
897
975
|
foreground: tone.onBase,
|
|
898
976
|
background: tone.base,
|
|
977
|
+
foregroundProperty: `tones.${name}.onBase`,
|
|
978
|
+
backgroundProperty: `tones.${name}.base`,
|
|
899
979
|
requiredRatio: 4.5,
|
|
900
980
|
guidance: `Set tones.${name}.onBase to a more contrasting foreground.`
|
|
901
981
|
}),
|
|
@@ -907,6 +987,8 @@ function interactionChecks(name, tone, surface) {
|
|
|
907
987
|
kind: "text",
|
|
908
988
|
foreground: tone.onHover,
|
|
909
989
|
background: tone.hover,
|
|
990
|
+
foregroundProperty: `tones.${name}.onHover`,
|
|
991
|
+
backgroundProperty: `tones.${name}.hover`,
|
|
910
992
|
requiredRatio: 4.5,
|
|
911
993
|
guidance: `Adjust tones.${name}.hover or tones.${name}.onHover.`
|
|
912
994
|
}),
|
|
@@ -918,6 +1000,8 @@ function interactionChecks(name, tone, surface) {
|
|
|
918
1000
|
kind: "text",
|
|
919
1001
|
foreground: tone.onActive,
|
|
920
1002
|
background: tone.active,
|
|
1003
|
+
foregroundProperty: `tones.${name}.onActive`,
|
|
1004
|
+
backgroundProperty: `tones.${name}.active`,
|
|
921
1005
|
requiredRatio: 4.5,
|
|
922
1006
|
guidance: `Adjust tones.${name}.active or tones.${name}.onActive.`
|
|
923
1007
|
}),
|
|
@@ -929,6 +1013,8 @@ function interactionChecks(name, tone, surface) {
|
|
|
929
1013
|
kind: "text",
|
|
930
1014
|
foreground: tone.text,
|
|
931
1015
|
background: surface,
|
|
1016
|
+
foregroundProperty: `tones.${name}.text`,
|
|
1017
|
+
backgroundProperty: "surface",
|
|
932
1018
|
requiredRatio: 4.5,
|
|
933
1019
|
guidance: `Set tones.${name}.text to a readable surface foreground.`
|
|
934
1020
|
}),
|
|
@@ -940,6 +1026,8 @@ function interactionChecks(name, tone, surface) {
|
|
|
940
1026
|
kind: "text",
|
|
941
1027
|
foreground: tone.onSoft,
|
|
942
1028
|
background: tone.soft,
|
|
1029
|
+
foregroundProperty: `tones.${name}.onSoft`,
|
|
1030
|
+
backgroundProperty: `tones.${name}.soft`,
|
|
943
1031
|
requiredRatio: 4.5,
|
|
944
1032
|
guidance: `Adjust tones.${name}.soft or tones.${name}.onSoft.`
|
|
945
1033
|
})
|
|
@@ -961,66 +1049,43 @@ function resolveSchemeColors(theme, mode) {
|
|
|
961
1049
|
function titleCase(value) {
|
|
962
1050
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
963
1051
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
palette: {
|
|
967
|
-
...AERIS_THEME_PRESETS.earth.palette,
|
|
968
|
-
mist: AERIS_THEME_PRESETS.earth.palette.surface,
|
|
969
|
-
sage: AERIS_THEME_PRESETS.earth.palette.primary,
|
|
970
|
-
cloud: AERIS_THEME_PRESETS.earth.palette.secondary,
|
|
971
|
-
sand: AERIS_THEME_PRESETS.earth.palette.accent,
|
|
972
|
-
umber: AERIS_THEME_PRESETS.earth.palette.contrast
|
|
973
|
-
},
|
|
974
|
-
light: {},
|
|
975
|
-
dark: { ...AERIS_THEME_PRESETS.earth.dark }
|
|
976
|
-
};
|
|
977
|
-
function resolveAerisTheme(theme) {
|
|
978
|
-
const base = theme === void 0 ? AERIS_DEFAULT_THEME : AERIS_THEME_RESOLUTION_BASE;
|
|
1052
|
+
function resolveAerisTheme(theme = {}) {
|
|
1053
|
+
const preset = theme.preset ?? AERIS_DEFAULT_THEME.preset;
|
|
979
1054
|
return {
|
|
980
|
-
...
|
|
1055
|
+
...AERIS_DEFAULT_THEME,
|
|
981
1056
|
...theme,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
},
|
|
986
|
-
light: {
|
|
987
|
-
...base.light,
|
|
988
|
-
...theme?.light,
|
|
989
|
-
tones: mergeAerisSemanticTones(base.light.tones, theme?.light?.tones)
|
|
990
|
-
},
|
|
991
|
-
dark: {
|
|
992
|
-
...base.dark,
|
|
993
|
-
...theme?.dark,
|
|
994
|
-
tones: mergeAerisSemanticTones(base.dark.tones, theme?.dark?.tones)
|
|
995
|
-
},
|
|
1057
|
+
preset,
|
|
1058
|
+
palette: mergePalette((Object.hasOwn(AERIS_THEME_PRESETS, preset) ? AERIS_THEME_PRESETS[preset] : AERIS_THEME_PRESETS.monochrome).palette, theme.palette),
|
|
1059
|
+
light: mergeScheme({}, theme.light),
|
|
1060
|
+
dark: mergeScheme({}, theme.dark),
|
|
996
1061
|
densities: {
|
|
997
|
-
...
|
|
998
|
-
...theme
|
|
1062
|
+
...AERIS_DEFAULT_THEME.densities,
|
|
1063
|
+
...theme.densities
|
|
999
1064
|
},
|
|
1000
1065
|
radii: {
|
|
1001
|
-
...
|
|
1002
|
-
...theme
|
|
1066
|
+
...AERIS_DEFAULT_THEME.radii,
|
|
1067
|
+
...theme.radii
|
|
1003
1068
|
}
|
|
1004
1069
|
};
|
|
1005
1070
|
}
|
|
1006
1071
|
function mergeAerisTheme(theme, update) {
|
|
1007
|
-
return {
|
|
1072
|
+
if (update.preset !== void 0 && update.preset !== theme.preset) return resolveAerisTheme({
|
|
1073
|
+
density: theme.density,
|
|
1074
|
+
densities: theme.densities,
|
|
1075
|
+
radius: theme.radius,
|
|
1076
|
+
radii: theme.radii,
|
|
1077
|
+
direction: theme.direction,
|
|
1078
|
+
...update
|
|
1079
|
+
});
|
|
1080
|
+
return resolveAerisTheme({
|
|
1008
1081
|
...theme,
|
|
1009
1082
|
...update,
|
|
1010
1083
|
palette: {
|
|
1011
1084
|
...theme.palette,
|
|
1012
|
-
...
|
|
1013
|
-
},
|
|
1014
|
-
light: {
|
|
1015
|
-
...theme.light,
|
|
1016
|
-
...update.light,
|
|
1017
|
-
tones: mergeAerisSemanticTones(theme.light.tones, update.light?.tones)
|
|
1018
|
-
},
|
|
1019
|
-
dark: {
|
|
1020
|
-
...theme.dark,
|
|
1021
|
-
...update.dark,
|
|
1022
|
-
tones: mergeAerisSemanticTones(theme.dark.tones, update.dark?.tones)
|
|
1085
|
+
...update.palette
|
|
1023
1086
|
},
|
|
1087
|
+
light: mergeScheme(theme.light, update.light),
|
|
1088
|
+
dark: mergeScheme(theme.dark, update.dark),
|
|
1024
1089
|
densities: {
|
|
1025
1090
|
...theme.densities,
|
|
1026
1091
|
...update.densities
|
|
@@ -1029,7 +1094,7 @@ function mergeAerisTheme(theme, update) {
|
|
|
1029
1094
|
...theme.radii,
|
|
1030
1095
|
...update.radii
|
|
1031
1096
|
}
|
|
1032
|
-
};
|
|
1097
|
+
});
|
|
1033
1098
|
}
|
|
1034
1099
|
function resolveAerisDensity(theme) {
|
|
1035
1100
|
return theme.densities[theme.density] ?? AERIS_DEFAULT_THEME.densities["medium"];
|
|
@@ -1037,43 +1102,37 @@ function resolveAerisDensity(theme) {
|
|
|
1037
1102
|
function resolveAerisRadius(theme) {
|
|
1038
1103
|
return theme.radii[theme.radius] ?? AERIS_DEFAULT_THEME.radii["rounded"];
|
|
1039
1104
|
}
|
|
1040
|
-
function
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
...primary ? {
|
|
1061
|
-
primary,
|
|
1062
|
-
sage: primary
|
|
1063
|
-
} : {},
|
|
1064
|
-
...secondary ? {
|
|
1065
|
-
secondary,
|
|
1066
|
-
cloud: secondary
|
|
1067
|
-
} : {},
|
|
1068
|
-
...accent ? {
|
|
1069
|
-
accent,
|
|
1070
|
-
sand: accent
|
|
1071
|
-
} : {},
|
|
1072
|
-
...contrast ? {
|
|
1073
|
-
contrast,
|
|
1074
|
-
umber: contrast
|
|
1075
|
-
} : {}
|
|
1105
|
+
function mergeScheme(current, update = {}) {
|
|
1106
|
+
const tones = { ...current.tones };
|
|
1107
|
+
for (const name of AERIS_SEMANTIC_TONE_NAMES) {
|
|
1108
|
+
if (!Object.hasOwn(update.tones ?? {}, name)) continue;
|
|
1109
|
+
const tone = update.tones?.[name];
|
|
1110
|
+
if (tone === void 0) delete tones[name];
|
|
1111
|
+
else if (tone === null) tones[name] = null;
|
|
1112
|
+
else {
|
|
1113
|
+
const merged = {
|
|
1114
|
+
...current.tones?.[name],
|
|
1115
|
+
...tone
|
|
1116
|
+
};
|
|
1117
|
+
for (const key of Object.keys(merged)) if (merged[key] === void 0) delete merged[key];
|
|
1118
|
+
tones[name] = merged;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
const scheme = {
|
|
1122
|
+
...current,
|
|
1123
|
+
...update,
|
|
1124
|
+
tones
|
|
1076
1125
|
};
|
|
1126
|
+
for (const key of Object.keys(scheme)) if (scheme[key] === void 0) delete scheme[key];
|
|
1127
|
+
return scheme;
|
|
1128
|
+
}
|
|
1129
|
+
function mergePalette(current, update) {
|
|
1130
|
+
const palette = { ...current };
|
|
1131
|
+
for (const key of Object.keys(current)) {
|
|
1132
|
+
const value = update?.[key];
|
|
1133
|
+
if (value !== void 0) palette[key] = value;
|
|
1134
|
+
}
|
|
1135
|
+
return palette;
|
|
1077
1136
|
}
|
|
1078
1137
|
const FOUNDATION_TOKENS = [
|
|
1079
1138
|
["page", "--aeris-page"],
|
|
@@ -1107,14 +1166,15 @@ const RADIUS_TOKENS = [
|
|
|
1107
1166
|
];
|
|
1108
1167
|
function resolveAerisThemeTokens(theme, mode) {
|
|
1109
1168
|
const tokens = {};
|
|
1169
|
+
const scheme = resolveAerisThemeScheme(theme, mode);
|
|
1110
1170
|
for (const [name, value] of Object.entries(theme.palette)) tokens[`--aeris-palette-${name}`] = value;
|
|
1111
1171
|
const foundation = resolveAerisFoundation(theme, mode);
|
|
1112
1172
|
for (const [property, token] of FOUNDATION_TOKENS) tokens[token] = foundation[property];
|
|
1113
|
-
tokens["--aeris-accent"] =
|
|
1114
|
-
tokens["--aeris-shadow-xs"] =
|
|
1115
|
-
tokens["--aeris-shadow-sm"] =
|
|
1116
|
-
tokens["--aeris-shadow-md"] =
|
|
1117
|
-
tokens["--aeris-shadow-lg"] =
|
|
1173
|
+
tokens["--aeris-accent"] = scheme.accent ?? theme.palette.accent;
|
|
1174
|
+
tokens["--aeris-shadow-xs"] = scheme.shadowXs ?? (mode === "light" ? "0 1px 2px rgb(0 0 0 / 8%)" : "0 1px 2px rgb(0 0 0 / 40%)");
|
|
1175
|
+
tokens["--aeris-shadow-sm"] = scheme.shadowSm ?? (mode === "light" ? "0 2px 8px rgb(0 0 0 / 10%)" : "0 2px 8px rgb(0 0 0 / 48%)");
|
|
1176
|
+
tokens["--aeris-shadow-md"] = scheme.shadowMd ?? (mode === "light" ? "0 8px 24px rgb(0 0 0 / 12%)" : "0 10px 28px rgb(0 0 0 / 54%)");
|
|
1177
|
+
tokens["--aeris-shadow-lg"] = scheme.shadowLg ?? (mode === "light" ? "0 18px 48px rgb(0 0 0 / 16%)" : "0 20px 56px rgb(0 0 0 / 64%)");
|
|
1118
1178
|
const tones = resolveAerisSemanticTones(theme, mode);
|
|
1119
1179
|
for (const name of AERIS_SEMANTIC_TONE_NAMES) {
|
|
1120
1180
|
const tone = tones[name];
|
|
@@ -1152,7 +1212,7 @@ var AerisThemeGenerationError = class extends Error {
|
|
|
1152
1212
|
}
|
|
1153
1213
|
};
|
|
1154
1214
|
const DEFAULT_SELECTOR = ":root";
|
|
1155
|
-
const GENERATED_BANNER = `/*! Generated by Aeris UI; color derivation
|
|
1215
|
+
const GENERATED_BANNER = `/*! Generated by Aeris UI; color derivation v2. Edit the theme source, not this file. */`;
|
|
1156
1216
|
function compileAerisTheme(themeOverride, options = {}) {
|
|
1157
1217
|
const selector = options.selector?.trim() || DEFAULT_SELECTOR;
|
|
1158
1218
|
const generation = resolveGenerationOptions(options);
|
|
@@ -1164,13 +1224,13 @@ function compileAerisTheme(themeOverride, options = {}) {
|
|
|
1164
1224
|
dark: auditAerisThemeContrast(theme, "dark")
|
|
1165
1225
|
};
|
|
1166
1226
|
const issues = [...validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation)];
|
|
1167
|
-
if (options.expectedDerivationVersion !== void 0 && options.expectedDerivationVersion !==
|
|
1227
|
+
if (options.expectedDerivationVersion !== void 0 && options.expectedDerivationVersion !== 2) issues.unshift({
|
|
1168
1228
|
code: "derivation-version-mismatch",
|
|
1169
|
-
message: `This configuration expects color derivation v${options.expectedDerivationVersion}, but the installed Aeris package provides
|
|
1229
|
+
message: `This configuration expects color derivation v${options.expectedDerivationVersion}, but the installed Aeris package provides v2. Review the theme changes, then update the configured derivation version before regenerating CSS.`
|
|
1170
1230
|
});
|
|
1171
1231
|
if (issues.length) throw new AerisThemeGenerationError(issues);
|
|
1172
1232
|
return {
|
|
1173
|
-
derivationVersion:
|
|
1233
|
+
derivationVersion: 2,
|
|
1174
1234
|
css: serializeThemeCss(lightTokens, darkTokens, selector, options, generation),
|
|
1175
1235
|
theme,
|
|
1176
1236
|
lightTokens,
|
|
@@ -1183,6 +1243,15 @@ function generateAerisThemeCss(themeOverride, options = {}) {
|
|
|
1183
1243
|
}
|
|
1184
1244
|
function validateGeneration(selector, theme, lightTokens, darkTokens, contrast, generation) {
|
|
1185
1245
|
const issues = [];
|
|
1246
|
+
if (![
|
|
1247
|
+
"monochrome",
|
|
1248
|
+
"earth",
|
|
1249
|
+
"coastal",
|
|
1250
|
+
"orchid"
|
|
1251
|
+
].includes(theme.preset)) issues.push({
|
|
1252
|
+
code: "invalid-preset",
|
|
1253
|
+
message: "Choose monochrome, earth, coastal, or orchid as the theme preset."
|
|
1254
|
+
});
|
|
1186
1255
|
if (!isSafeSelector(selector)) issues.push({
|
|
1187
1256
|
code: "invalid-selector",
|
|
1188
1257
|
message: "selector must be one non-empty CSS selector without commas, braces, or semicolons."
|
|
@@ -1367,6 +1436,13 @@ function validateAerisTheme(themeOverride) {
|
|
|
1367
1436
|
};
|
|
1368
1437
|
}
|
|
1369
1438
|
function validateThemeSelection(theme, issues) {
|
|
1439
|
+
if (!Object.hasOwn(AERIS_THEME_PRESETS, theme.preset)) issues.push({
|
|
1440
|
+
code: "invalid-preset",
|
|
1441
|
+
severity: "error",
|
|
1442
|
+
path: "preset",
|
|
1443
|
+
message: `Unknown theme preset "${String(theme.preset)}".`,
|
|
1444
|
+
guidance: "Choose monochrome, earth, coastal, or orchid."
|
|
1445
|
+
});
|
|
1370
1446
|
if (theme.direction !== void 0 && theme.direction !== "ltr" && theme.direction !== "rtl") issues.push({
|
|
1371
1447
|
code: "invalid-direction",
|
|
1372
1448
|
severity: "error",
|
|
@@ -1412,7 +1488,7 @@ function collectThemeCssValues(theme) {
|
|
|
1412
1488
|
if (!tone) continue;
|
|
1413
1489
|
for (const property of TONE_PROPERTIES) {
|
|
1414
1490
|
const value = tone[property];
|
|
1415
|
-
if (value !== void 0) values.push(cssValue(`${mode}.tones.${toneName}.${property}`, value, true));
|
|
1491
|
+
if (value !== void 0 && value !== null) values.push(cssValue(`${mode}.tones.${toneName}.${property}`, value, true));
|
|
1416
1492
|
}
|
|
1417
1493
|
}
|
|
1418
1494
|
}
|
|
@@ -1445,6 +1521,6 @@ function isSafeCssValue(value) {
|
|
|
1445
1521
|
function isRecord(value) {
|
|
1446
1522
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1447
1523
|
}
|
|
1448
|
-
export { AERIS_COLOR_DERIVATION_VERSION, AERIS_DEFAULT_THEME, AERIS_DENSITY_PRESETS, AERIS_RADIUS_PRESETS, AERIS_SEMANTIC_TONE_NAMES, AERIS_THEME_PRESETS, AerisThemeGenerationError, aerisContrastRatio, aerisRgbContrastRatio, auditAerisThemeContrast, compileAerisTheme, formatAerisHex, generateAerisThemeCss, mergeAerisTheme, mixAerisColor, mixAerisRgb, parseAerisColor, resolveAerisDensity, resolveAerisFoundation, resolveAerisRadius, resolveAerisSemanticTones, resolveAerisTheme, resolveAerisThemeTokens, validateAerisTheme };
|
|
1524
|
+
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, resolveAerisThemeScheme, resolveAerisThemeTokens, validateAerisTheme };
|
|
1449
1525
|
|
|
1450
1526
|
//# sourceMappingURL=aeris-ui-core-theme-builder.mjs.map
|