@kubex/zinc 1.1.102 → 1.1.103
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/dist/custom-elements.json +2 -2
- package/dist/web-types.json +1 -1
- package/dist/zn.d.ts +4 -2
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +394 -395
- package/docs/pages/components/remarkd-editor.md +1 -1
- package/package.json +1 -1
- package/scss/_root.scss +121 -8
- package/scss/shared/_base.scss +10 -4
- package/scss/shared/_button-mixin.scss +29 -0
- package/scss/shared/_button.scss +3 -33
- package/scss/themes/_aura.scss +87 -8
- package/scss/themes/_dark.scss +14 -2
- package/scss/themes/_light.scss +4 -3
- package/scss/themes/_modes.scss +32 -0
- package/src/components/animated-button/animated-button.component.ts +2 -1
- package/src/components/animated-button/animated-button.scss +1 -1
- package/src/components/bulk-actions/bulk-actions.component.ts +2 -1
- package/src/components/bulk-actions/bulk-actions.scss +0 -1
- package/src/components/button/button.component.ts +6 -1
- package/src/components/button/button.scss +1 -1
- package/src/components/chart/chart.component.ts +4 -0
- package/src/components/checkbox/checkbox.component.ts +3 -1
- package/src/components/checkbox/checkbox.scss +0 -2
- package/src/components/checkbox-group/checkbox-group.component.ts +2 -1
- package/src/components/checkbox-group/checkbox-group.scss +0 -1
- package/src/components/data-table/data-table.component.ts +3 -1
- package/src/components/data-table/data-table.scss +0 -1
- package/src/components/datepicker/datepicker.component.ts +2 -1
- package/src/components/datepicker/datepicker.scss +0 -1
- package/src/components/editor/modules/toolbar/toolbar.component.ts +3 -1
- package/src/components/editor/modules/toolbar/toolbar.scss +0 -1
- package/src/components/file/file.component.ts +2 -1
- package/src/components/file/file.scss +0 -1
- package/src/components/form-group/form-group.component.ts +2 -1
- package/src/components/form-group/form-group.scss +0 -1
- package/src/components/icon-picker/icon-picker.component.ts +8 -3
- package/src/components/icon-picker/icon-picker.scss +0 -1
- package/src/components/inline-edit/inline-edit.component.ts +2 -1
- package/src/components/inline-edit/inline-edit.scss +0 -1
- package/src/components/input/input.component.ts +2 -1
- package/src/components/input/input.scss +0 -1
- package/src/components/input-group/input-group.component.ts +2 -1
- package/src/components/input-group/input-group.scss +0 -1
- package/src/components/menu/menu.scss +6 -1
- package/src/components/page/page.scss +19 -5
- package/src/components/priority-list/priority-list.component.ts +2 -1
- package/src/components/priority-list/priority-list.scss +0 -1
- package/src/components/query-builder/query-builder.component.ts +2 -1
- package/src/components/query-builder/query-builder.scss +0 -1
- package/src/components/radio/radio.component.ts +3 -1
- package/src/components/radio/radio.scss +0 -2
- package/src/components/radio-group/radio-group.component.ts +2 -1
- package/src/components/radio-group/radio-group.scss +0 -1
- package/src/components/rating/rating.component.ts +2 -1
- package/src/components/rating/rating.scss +0 -1
- package/src/components/remarkd-editor/actions.ts +0 -4
- package/src/components/remarkd-editor/remarkd-editor.test.ts +5 -3
- package/src/components/schedule-builder/schedule-builder.component.ts +2 -1
- package/src/components/schedule-builder/schedule-builder.scss +0 -1
- package/src/components/select/select.component.ts +2 -1
- package/src/components/select/select.scss +0 -1
- package/src/components/tabs/tabs.component.ts +3 -1
- package/src/components/tabs/tabs.scss +0 -1
- package/src/components/textarea/textarea.component.ts +2 -1
- package/src/components/textarea/textarea.scss +0 -1
- package/src/components/tile/tile.component.ts +33 -20
- package/src/components/tile/tile.scss +2 -0
- package/src/components/tile/tile.test.ts +64 -3
- package/src/components/toggle/toggle.component.ts +2 -1
- package/src/components/toggle/toggle.scss +0 -1
- package/src/components/translations/translations.component.ts +2 -1
- package/src/components/translations/translations.scss +0 -1
- package/src/internal/theme.ts +37 -12
- package/src/internal/zinc-element.ts +7 -5
|
@@ -180,7 +180,7 @@ a folded toolbar group is never actually out of reach.
|
|
|
180
180
|
|
|
181
181
|
### Inline Formatting
|
|
182
182
|
|
|
183
|
-
Inline actions — Strong, Emphasis, Code, Underline, Strikethrough,
|
|
183
|
+
Inline actions — Strong, Emphasis, Code, Underline, Strikethrough, and the
|
|
184
184
|
rest of the Inline group — apply to the current selection inside the block being edited,
|
|
185
185
|
so they only make sense while a block is open: the toolbar disables them until one is
|
|
186
186
|
(the slash menu lists them regardless, since it can only ever open inside a block in the
|
package/package.json
CHANGED
package/scss/_root.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@use "sass:color";
|
|
3
3
|
@use "sass:meta";
|
|
4
4
|
@use "variables";
|
|
5
|
+
@use "themes/modes";
|
|
5
6
|
|
|
6
7
|
:root {
|
|
7
8
|
--zn-base-px: 8px;
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
--zn-font-family-mono: 'Roboto Mono', monospace;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
#{modes.$light} {
|
|
20
21
|
--zn-backdrop-color: rgba(0, 0, 0, 0.5);
|
|
21
22
|
|
|
22
23
|
--zn-color-text: 33, 33, 33;
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
--zn-color-disabled: 181, 181, 181;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
#{modes.$dark} {
|
|
43
44
|
--zn-backdrop-color: rgba(0, 0, 0, 0.85);
|
|
44
45
|
|
|
45
46
|
--zn-color-text: 215, 215, 215;
|
|
@@ -147,7 +148,7 @@
|
|
|
147
148
|
font-size: var(--zn-font-size-x-large);
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
#{modes.$light}, #{modes.$dark} {
|
|
151
152
|
--zn-body: var(--zn-color-body);
|
|
152
153
|
|
|
153
154
|
--zn-text: var(--zn-color-text);
|
|
@@ -160,8 +161,8 @@
|
|
|
160
161
|
--zn-input-bg: var(--zn-color-body);
|
|
161
162
|
}
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
//
|
|
164
|
+
#{modes.$light} {
|
|
165
|
+
// Light mode
|
|
165
166
|
--zn-panel-opacity: 1;
|
|
166
167
|
--zn-shadow: 236, 235, 249;
|
|
167
168
|
|
|
@@ -179,8 +180,8 @@
|
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
//
|
|
183
|
+
#{modes.$dark} {
|
|
184
|
+
// Dark mode
|
|
184
185
|
--zn-shadow: 10, 10, 10;
|
|
185
186
|
--zn-panel-secondary: 27, 27, 30;
|
|
186
187
|
--zn-panel-opacity: 1;
|
|
@@ -328,7 +329,13 @@ ul.square {
|
|
|
328
329
|
// Only the source colour tokens and the theme-specific leaf tokens are set;
|
|
329
330
|
// derived tokens (--zn-body, --zn-text, --zn-panel ...) reference these via
|
|
330
331
|
// var() and follow automatically.
|
|
331
|
-
|
|
332
|
+
//
|
|
333
|
+
// Aura ships both palettes: this block is the light one, and the
|
|
334
|
+
// `html[t="aura"][m="dark"]` block below re-points every token in it for dark. The
|
|
335
|
+
// two must stay token-for-token in step — a token set here and missed there
|
|
336
|
+
// leaks a light value into dark mode, because this block is mode-agnostic and
|
|
337
|
+
// so applies in both.
|
|
338
|
+
html[t="aura"], body[t="aura"], html.theme-aura, body.theme-aura {
|
|
332
339
|
--zn-backdrop-color: rgba(30, 27, 60, 0.45);
|
|
333
340
|
|
|
334
341
|
--zn-color-text: 42, 32, 89;
|
|
@@ -375,7 +382,113 @@ ul.square {
|
|
|
375
382
|
--navbar-page-inactive-tab-background: rgba(255, 255, 255, 0.5);
|
|
376
383
|
--navbar-page-inactive-tab-filter: none;
|
|
377
384
|
|
|
385
|
+
// Aurora gradient behind the zn-page header, plus the weight of the wave
|
|
386
|
+
// artwork layered on top of it (components/page/page.scss). Held still — see
|
|
387
|
+
// the PERF note there before reintroducing any drift.
|
|
388
|
+
--zn-page-header-aurora: linear-gradient(225deg, rgba(233, 227, 255, 1) 0%, rgba(214, 246, 245, 1) 40%, rgba(233, 227, 255, 1) 100%), linear-gradient(180deg, rgba(129, 153, 217, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
389
|
+
--zn-page-header-wave-opacity: 0.04;
|
|
390
|
+
|
|
378
391
|
.zn-primary {
|
|
379
392
|
color: rgb(var(--zn-color-primary));
|
|
380
393
|
}
|
|
381
394
|
}
|
|
395
|
+
|
|
396
|
+
// Aura dark — the same violet identity drawn over the dark primitives, on a
|
|
397
|
+
// deep navy canvas rather than a bespoke hue.
|
|
398
|
+
//
|
|
399
|
+
// The canvas colour is deliberate: `--zn-color-body` is the exact navy the
|
|
400
|
+
// rubix shell chrome paints itself (`--rx-shell-header-bg: 19, 29, 45`, set in
|
|
401
|
+
// the aura-dark block of static/src/scss/shell/_header.scss — deeper than the
|
|
402
|
+
// 40, 55, 80 aura light mode uses), so the top bar, the app navigation and the
|
|
403
|
+
// page body read as one continuous surface with panels lifted above it.
|
|
404
|
+
//
|
|
405
|
+
// Specificity note: the selectors are deliberately `html[…]`/`body[…]` (a type
|
|
406
|
+
// selector plus attributes) rather than `:root[…]`. That keeps the ordering the
|
|
407
|
+
// bare selectors used to have: `html[t="aura"][m="dark"]` (0,2,1) outranks both
|
|
408
|
+
// `:root[m="dark"]` (0,2,0) from `#{modes.$dark}` and the mode-agnostic
|
|
409
|
+
// `html[t="aura"]` (0,1,1), which in turn still loses to `:root[m="dark"]` the
|
|
410
|
+
// way `[t="aura"]` (0,1,0) did. `:root[t="aura"]` would have been (0,2,0) and
|
|
411
|
+
// silently started beating the dark block. This one stays last in the file.
|
|
412
|
+
html[t="aura"][m="dark"], body[t="aura"][m="dark"],
|
|
413
|
+
html.theme-aura.theme-dark, body.theme-aura.theme-dark {
|
|
414
|
+
--zn-backdrop-color: rgba(8, 12, 24, 0.65);
|
|
415
|
+
|
|
416
|
+
--zn-color-text: 226, 228, 242;
|
|
417
|
+
--zn-color-muted-text: 154, 163, 190;
|
|
418
|
+
|
|
419
|
+
--zn-color-base: 30, 41, 61;
|
|
420
|
+
// Matches --rx-shell-header-bg in the rubix shell (its aura-dark block in
|
|
421
|
+
// static/src/scss/shell/_header.scss) — change both together.
|
|
422
|
+
--zn-color-body: 19, 29, 45;
|
|
423
|
+
--zn-color-navigation: var(--zn-color-base);
|
|
424
|
+
--zn-color-navigation-hightlight: 35, 47, 70;
|
|
425
|
+
--zn-color-border: 64, 82, 113;
|
|
426
|
+
--zn-color-border-active: 92, 111, 145;
|
|
427
|
+
--zn-color-tab: 33, 45, 66;
|
|
428
|
+
// A few points of lift reads as an outline rather than a surface, so the
|
|
429
|
+
// panel steps well clear of the body. #223555 — the top of the ladder:
|
|
430
|
+
// body 19,29,45 -> page canvas 31,45,70 -> panel 34,53,85.
|
|
431
|
+
--zn-color-panel: 34, 53, 85;
|
|
432
|
+
|
|
433
|
+
--zn-color-primary: 163, 140, 250;
|
|
434
|
+
--zn-color-info: 96, 148, 232;
|
|
435
|
+
--zn-color-success: 116, 199, 140;
|
|
436
|
+
--zn-color-warning: 245, 183, 105;
|
|
437
|
+
--zn-color-error: 244, 106, 126;
|
|
438
|
+
--zn-color-disabled: 118, 130, 152;
|
|
439
|
+
|
|
440
|
+
// Theme-specific leaf tokens — the mirror of the light block above.
|
|
441
|
+
--zn-panel-opacity: 1;
|
|
442
|
+
--zn-shadow: 12, 18, 32;
|
|
443
|
+
--zn-panel-secondary: 46 61 88;
|
|
444
|
+
--zn-panel-highlight: 66, 86, 120;
|
|
445
|
+
// NOT the classic dark 0.1: on a lifted palette a 10% wash leaves hover and
|
|
446
|
+
// selected rows indistinguishable from the panel they sit on.
|
|
447
|
+
--zn-panel-highlight-opacity: 1;
|
|
448
|
+
--zn-input-bg-accent: 34, 46, 68;
|
|
449
|
+
--zn-bright-bg: 52, 69, 99;
|
|
450
|
+
--zn-light-text: 168, 176, 201;
|
|
451
|
+
--zn-dark-text: 226, 228, 242;
|
|
452
|
+
--zn-purple-text: 178, 158, 252;
|
|
453
|
+
--zn-accent: 96, 196, 220;
|
|
454
|
+
|
|
455
|
+
// #{modes.$dark} hardcodes the base dark theme's own accent here; aura owns
|
|
456
|
+
// its accent in both modes, so re-point both this and .zn-primary below.
|
|
457
|
+
//
|
|
458
|
+
// Deliberately NOT var(--zn-color-primary): aura dark's *interactive* accent is
|
|
459
|
+
// a cyan, while its identity accent stays violet. --zn-primary is what buttons,
|
|
460
|
+
// the navbar, tabs, toggles, radios, progress bars, steppers and pagination
|
|
461
|
+
// read; --zn-color-primary (still violet above) is what inputs, checkboxes,
|
|
462
|
+
// selects, dialogs and the .zn-primary text utility read.
|
|
463
|
+
--zn-primary: 126, 238, 255;
|
|
464
|
+
// A fill this light is unreadable under the default white ink (1.35:1), so the
|
|
465
|
+
// paired ink drops to the shell navy — 12.6:1 on the cyan. zn-button declares
|
|
466
|
+
// the pair as --btn-color / --btn-ink for exactly this case.
|
|
467
|
+
--zn-color-on-primary: 19, 29, 45;
|
|
468
|
+
|
|
469
|
+
--base: 0, 0, 0;
|
|
470
|
+
--inverse-base: 255, 255, 255;
|
|
471
|
+
|
|
472
|
+
// Frosted-glass inactive tabs — see the light block for why there is no
|
|
473
|
+
// backdrop-filter. Inverted against the light block: on the deep aurora an
|
|
474
|
+
// inactive tab recedes by being *darker* than the gradient, not lighter.
|
|
475
|
+
--navbar-page-inactive-tab-background: rgba(0, 0, 0, 0.30);
|
|
476
|
+
--navbar-page-inactive-tab-filter: none;
|
|
477
|
+
|
|
478
|
+
// The page canvas sits a step above the navy shell surface, so the page reads
|
|
479
|
+
// as a sheet laid on the chrome rather than a hole in it (components/page/page.scss).
|
|
480
|
+
--zn-page-canvas: 31, 45, 70;
|
|
481
|
+
|
|
482
|
+
// The dark aurora: the light gradient's violet -> teal -> violet sweep taken
|
|
483
|
+
// down to full-strength indigo/teal so the page title's light ink reads on it.
|
|
484
|
+
--zn-page-header-aurora: linear-gradient(225deg, rgb(76 42 202) 0%, rgb(0 100 150) 40%, rgb(56 40 115) 100%), linear-gradient(180deg, rgb(31 50 103 / 0%) 0%, rgb(0, 0, 0) 100%);
|
|
485
|
+
// The violet wave artwork lifts rather than darkens here, so it can carry
|
|
486
|
+
// more weight than the 0.04 the pale light gradient tolerates.
|
|
487
|
+
--zn-page-header-wave-opacity: 0.10;
|
|
488
|
+
|
|
489
|
+
.zn-primary {
|
|
490
|
+
// !important to beat #{modes.$dark}'s own `.zn-primary { ... !important }`,
|
|
491
|
+
// which ties on specificity.
|
|
492
|
+
color: rgb(var(--zn-color-primary)) !important;
|
|
493
|
+
}
|
|
494
|
+
}
|
package/scss/shared/_base.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../themes/modes";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
Apply default styles to the document, and shadow documents
|
|
3
5
|
*/
|
|
@@ -117,10 +119,14 @@ kbd {
|
|
|
117
119
|
color: rgba(0, 0, 0, 0.5);
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
// Interpolating a comma list into a descendant selector would not distribute,
|
|
123
|
+
// so the mode selector is nested instead.
|
|
124
|
+
#{modes.$dark} {
|
|
125
|
+
kbd {
|
|
126
|
+
background-color: rgb(25, 25, 25);
|
|
127
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 1px 0 0 rgba(110, 110, 110, .5) inset;
|
|
128
|
+
color: #eee;
|
|
129
|
+
}
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
[tab] {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@mixin button {
|
|
2
|
+
// Buttons take their own radius token so a theme can make controls pills
|
|
3
|
+
// without reshaping panels, inputs and dialogs at the same time.
|
|
4
|
+
border-radius: var(--zn-button-border-radius, var(--zn-border-radius));
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: var(--zn-base-px);// calc(var(--zn-base-px) + var(--zn-button-gutter));
|
|
9
|
+
margin: auto;
|
|
10
|
+
width: fit-content;
|
|
11
|
+
background-color: rgb(var(--zn-primary));
|
|
12
|
+
color: rgba(var(--zn-color-on-primary, 255, 255, 255), 0.9);
|
|
13
|
+
font-size: var(--zn-text-button-label-font-size);
|
|
14
|
+
font-weight: var(--zn-text-button-label-font-weight);
|
|
15
|
+
line-height: var(--zn-text-button-label-line-height);
|
|
16
|
+
text-transform: var(--zn-text-button-label-transform);
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
border-color: transparent;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
|
|
22
|
+
max-height: 36px;
|
|
23
|
+
height: 36px;
|
|
24
|
+
min-height: 36px;
|
|
25
|
+
|
|
26
|
+
&:hover:not([disabled]) {
|
|
27
|
+
background-color: rgba(var(--zn-primary), 0.8);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/scss/shared/_button.scss
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
@use '
|
|
2
|
-
@
|
|
3
|
-
|
|
4
|
-
@mixin button {
|
|
5
|
-
// Buttons take their own radius token so a theme can make controls pills
|
|
6
|
-
// without reshaping panels, inputs and dialogs at the same time.
|
|
7
|
-
border-radius: var(--zn-button-border-radius, var(--zn-border-radius));
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
padding: var(--zn-base-px);// calc(var(--zn-base-px) + var(--zn-button-gutter));
|
|
12
|
-
margin: auto;
|
|
13
|
-
width: fit-content;
|
|
14
|
-
background-color: rgb(var(--zn-primary));
|
|
15
|
-
color: rgba(var(--zn-color-on-primary, 255, 255, 255), 0.9);
|
|
16
|
-
font-size: var(--zn-text-button-label-font-size);
|
|
17
|
-
font-weight: var(--zn-text-button-label-font-weight);
|
|
18
|
-
line-height: var(--zn-text-button-label-line-height);
|
|
19
|
-
text-transform: var(--zn-text-button-label-transform);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
vertical-align: middle;
|
|
22
|
-
border-color: transparent;
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
|
|
25
|
-
max-height: 36px;
|
|
26
|
-
height: 36px;
|
|
27
|
-
min-height: 36px;
|
|
28
|
-
|
|
29
|
-
&:hover:not([disabled]) {
|
|
30
|
-
background-color: rgba(var(--zn-primary), 0.8);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
@use 'button-mixin';
|
|
2
|
+
@forward 'button-mixin';
|
|
33
3
|
|
|
34
4
|
button, .zn-button {
|
|
35
|
-
@include button;
|
|
5
|
+
@include button-mixin.button;
|
|
36
6
|
}
|
package/scss/themes/_aura.scss
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
// Aura — a soft
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// Aura — a soft violet identity drawn over either mode's primitives.
|
|
2
|
+
//
|
|
3
|
+
// Light inherits the light primitives (defined on :root) and only re-points the
|
|
4
|
+
// primary ramp to a softer, more pastel violet so the whole UI takes on the
|
|
5
|
+
// "aura" glow without redefining every token. Dark does the same over the dark
|
|
6
|
+
// primitives, with the ramp inverted (50 darkest -> 900 lightest) the way
|
|
7
|
+
// themes/_dark.scss inverts every other ramp.
|
|
8
|
+
//
|
|
9
|
+
// The selectors are root-qualified (`html[t="aura"]` / `body[t="aura"]`) and must
|
|
10
|
+
// stay that way. ZincElement reflects `t`/`m` onto EVERY component, so a bare
|
|
11
|
+
// `[t="aura"]` matched each of them individually and re-declared these tokens
|
|
12
|
+
// with literal values, wiping out contextual overrides from an ancestor — that
|
|
13
|
+
// is what painted the rubix aura header's buttons violet instead of white.
|
|
14
|
+
// Worse, a consumer on an older ZincElement reflects `t` but not `m`: the bare
|
|
15
|
+
// light block then matched it, poured light tokens over its whole subtree, and
|
|
16
|
+
// anything in a shadow tree below could not recover (document stylesheets do not
|
|
17
|
+
// match inside shadow roots), which is what painted shell dropdowns white in
|
|
18
|
+
// aura dark. Root-qualified, non-root elements simply inherit.
|
|
19
|
+
//
|
|
20
|
+
// Only *source* tokens (--zn-color-*) and theme-owned leaf tokens belong here.
|
|
21
|
+
// Never set a derived token (--zn-border-color, --zn-text*, --zn-panel,
|
|
22
|
+
// --zn-body, --zn-input-bg) — those are mapped off the source tokens in
|
|
23
|
+
// scss/_root.scss and will not follow if pinned here.
|
|
24
|
+
html[t="aura"], body[t="aura"],
|
|
25
|
+
html.theme-aura, body.theme-aura {
|
|
7
26
|
color-scheme: light;
|
|
8
27
|
|
|
9
28
|
/**************************************************************
|
|
@@ -28,8 +47,68 @@
|
|
|
28
47
|
--zn-shadow-large: 0 6px 20px rgba(60, 44, 110, 0.14);
|
|
29
48
|
--zn-shadow-x-large: 0 6px 20px rgba(60, 44, 110, 0.22);
|
|
30
49
|
|
|
31
|
-
--zn-border-color: 218, 212, 246;
|
|
32
|
-
|
|
33
50
|
/* Focus ring follows the softer primary */
|
|
34
51
|
--zn-input-focus-ring-color: hsl(255 82% 68% / 40%);
|
|
35
52
|
}
|
|
53
|
+
|
|
54
|
+
// Aura dark — the same violet identity over the dark primitives.
|
|
55
|
+
//
|
|
56
|
+
// html[t="aura"][m="dark"] (0,2,1) outranks themes/_dark.scss's :root[m="dark"]
|
|
57
|
+
// (0,2,0), but this block should still stay AFTER _dark.scss in themes/_index.scss
|
|
58
|
+
// so the ordering reads the way it resolves. See the specificity note in
|
|
59
|
+
// scss/_root.scss for why these are html/body rather than :root.
|
|
60
|
+
html[t="aura"][m="dark"], body[t="aura"][m="dark"],
|
|
61
|
+
html.theme-aura.theme-dark, body.theme-aura.theme-dark {
|
|
62
|
+
color-scheme: dark;
|
|
63
|
+
|
|
64
|
+
/**************************************************************
|
|
65
|
+
* Theme Tokens — soft violet primary, inverted for dark
|
|
66
|
+
*************************************************************/
|
|
67
|
+
|
|
68
|
+
--zn-color-primary-50: hsl(257, 45%, 25%);
|
|
69
|
+
--zn-color-primary-100: hsl(257, 50%, 34%);
|
|
70
|
+
--zn-color-primary-200: hsl(257, 55%, 41%);
|
|
71
|
+
--zn-color-primary-300: hsl(257, 62%, 50%);
|
|
72
|
+
--zn-color-primary-400: hsl(256, 75%, 60%);
|
|
73
|
+
--zn-color-primary-500: hsl(255, 88%, 68%);
|
|
74
|
+
--zn-color-primary-600: hsl(253, 95%, 75%);
|
|
75
|
+
--zn-color-primary-700: hsl(251, 100%, 83%);
|
|
76
|
+
--zn-color-primary-800: hsl(249, 100%, 90%);
|
|
77
|
+
--zn-color-primary-900: hsl(250, 100%, 94%);
|
|
78
|
+
|
|
79
|
+
/* Elevations read as depth against the navy canvas, not violet haze */
|
|
80
|
+
--zn-shadow-x-small: 0 1px 4px rgba(6, 10, 20, 0.30);
|
|
81
|
+
--zn-shadow-small: 0 3px 9px rgba(6, 10, 20, 0.38);
|
|
82
|
+
--zn-shadow-medium: 0 6px 18px rgba(6, 10, 20, 0.38);
|
|
83
|
+
--zn-shadow-large: 0 6px 20px rgba(6, 10, 20, 0.42);
|
|
84
|
+
--zn-shadow-x-large: 0 6px 20px rgba(6, 10, 20, 0.52);
|
|
85
|
+
|
|
86
|
+
--zn-input-focus-ring-color: hsl(255 88% 68% / 45%);
|
|
87
|
+
|
|
88
|
+
/* _dark.scss's gray-100 is a muddy violet-grey (hsl(262, 12%, 35%)) that reads
|
|
89
|
+
brown over aura's navy canvas. It is the hover/secondary surface for a wide
|
|
90
|
+
spread of components — every `--zn-color-neutral-100` consumer aliases it
|
|
91
|
+
(zn-tile hover, zn-button hover, the markdown/remarkd editors,
|
|
92
|
+
schedule-builder, the droparea checker) plus zn-alert directly — so
|
|
93
|
+
re-pointing it here fixes them all at once. */
|
|
94
|
+
--zn-color-gray-100: hsl(221.6, 41.21%, 27.22%);
|
|
95
|
+
|
|
96
|
+
/* The neighbouring steps come along for the ride: _dark.scss aliases
|
|
97
|
+
--zn-color-neutral-50/-200 onto these, so leaving them on the muddy violet
|
|
98
|
+
ramp would put that colour back on `color="secondary"` button fills, input
|
|
99
|
+
surfaces and every panel border. Values chosen to land on aura dark's
|
|
100
|
+
existing navy tokens — 50 meets --zn-input-bg-accent (34,46,68) and 200
|
|
101
|
+
meets --zn-color-border (64,82,113). */
|
|
102
|
+
--zn-color-gray-50: hsl(220, 33%, 20%);
|
|
103
|
+
--zn-color-gray-200: hsl(220, 28%, 35%);
|
|
104
|
+
|
|
105
|
+
/* _dark.scss pins these to near-black literals, which read as holes punched
|
|
106
|
+
in aura's navy canvas — re-point them to the navy family. */
|
|
107
|
+
--zn-input-background-color-focus: rgb(35, 47, 70);
|
|
108
|
+
--zn-input-background-color-disabled: rgb(33, 44, 65);
|
|
109
|
+
|
|
110
|
+
--zn-tooltip-background-color: rgb(24, 33, 50);
|
|
111
|
+
|
|
112
|
+
/* tables */
|
|
113
|
+
--zn-table-header-background-color: 46, 61, 88;
|
|
114
|
+
}
|
package/scss/themes/_dark.scss
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
@use "modes";
|
|
2
|
+
|
|
3
|
+
// Dark mode primitives — see themes/_modes.scss for the `m` / `t` split, and
|
|
4
|
+
// for why light-only themes are excluded from this selector.
|
|
5
|
+
#{modes.$dark} {
|
|
3
6
|
color-scheme: dark;
|
|
4
7
|
|
|
5
8
|
/**************************************************************
|
|
@@ -245,6 +248,15 @@
|
|
|
245
248
|
--zn-color-neutral-0: hsl(0, 0%, 0%);
|
|
246
249
|
--zn-color-neutral-1000: hsl(0, 0%, 100%);
|
|
247
250
|
|
|
251
|
+
/* Neutral 50 and 200 are the two steps _light.scss pins to literal hsl() values
|
|
252
|
+
instead of aliasing to --zn-color-gray-*. Every other step aliases the gray
|
|
253
|
+
ramp and so follows the dark ramp above for free; these two do not, and left
|
|
254
|
+
undefined here they stay near-white in dark mode (L=0.98 / L=0.94).
|
|
255
|
+
That is what paints a white pill for `color="secondary"` buttons and a white
|
|
256
|
+
border on every panel. Alias them so they track the ramp like the rest. */
|
|
257
|
+
--zn-color-neutral-50: var(--zn-color-gray-50);
|
|
258
|
+
--zn-color-neutral-200: var(--zn-color-gray-200);
|
|
259
|
+
|
|
248
260
|
/* Elevations */
|
|
249
261
|
--zn-shadow-x-small: 0 1px 4px rgba(0, 0, 0, 0.18);
|
|
250
262
|
--zn-shadow-small: 0 3px 9px rgba(0, 0, 0, 0.24);
|
package/scss/themes/_light.scss
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Light / dark mode selectors.
|
|
2
|
+
//
|
|
3
|
+
// Theming has two independent dimensions on the root element:
|
|
4
|
+
// `t` — the theme (base, aura, ...), carrying the identity and palette.
|
|
5
|
+
// `m` — the mode ('light' | 'dark') that theme is currently drawn in.
|
|
6
|
+
//
|
|
7
|
+
// **The `m` hooks are deliberately scoped with `:root`.** ZincElement reflects
|
|
8
|
+
// both `t` and `m` onto every component, so a *bare* `[m="dark"]` selector
|
|
9
|
+
// matches every zinc element in the tree — not just the document root. Any token
|
|
10
|
+
// block written that way re-declares itself on each component and so wipes out
|
|
11
|
+
// contextual overrides set by an ancestor: e.g. the rubix shell header sets
|
|
12
|
+
// `--zn-text: 255,255,255` for its dark chrome, and every zn-button inside it
|
|
13
|
+
// would reset `--zn-text` back to the theme default and render dark-on-dark.
|
|
14
|
+
// Never write a bare `[m="..."]` (or `[t="..."]`) rule that sets a token.
|
|
15
|
+
//
|
|
16
|
+
// `[t="light"]` / `[t="dark"]` / `.theme-light` / `.theme-dark` are kept as
|
|
17
|
+
// legacy aliases, so a standalone consumer that sets only `t` still resolves to a
|
|
18
|
+
// full palette. They carry the same hazard, which is why light mode is expressed
|
|
19
|
+
// as plain `:root` — light is the default palette, so it needs no `m` hook.
|
|
20
|
+
//
|
|
21
|
+
// A theme that ships a light palette *only* must be excluded from $dark, or
|
|
22
|
+
// `t="<theme>" m="dark"` layers its tokens over the dark primitives and renders
|
|
23
|
+
// a hybrid. Themes are dark-capable by default; add an exclusion here only while
|
|
24
|
+
// a theme has no dark palette, and drop it when it gains one. Every theme
|
|
25
|
+
// currently ships both palettes, so the list is empty:
|
|
26
|
+
//
|
|
27
|
+
// $light-only: '[t="newtheme"]';
|
|
28
|
+
// $dark: ':root[m="dark"]:not(#{$light-only}), ...';
|
|
29
|
+
$light-only: null;
|
|
30
|
+
|
|
31
|
+
$light: ':root, [t="light"], .theme-light';
|
|
32
|
+
$dark: ':root[m="dark"], [t="dark"], .theme-dark';
|
|
@@ -4,12 +4,13 @@ import {property, state} from 'lit/decorators.js';
|
|
|
4
4
|
import ZincElement from '../../internal/zinc-element';
|
|
5
5
|
import ZnIcon from '../icon/icon.component';
|
|
6
6
|
|
|
7
|
+
import sharedStyles from '../../../scss/shared/index.scss';
|
|
7
8
|
import styles from './animated-button.scss';
|
|
8
9
|
|
|
9
10
|
type AnimatedButtonState = 'idle' | 'processing' | 'success' | 'failure';
|
|
10
11
|
|
|
11
12
|
export default class ZnAnimatedButton extends ZincElement {
|
|
12
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
13
|
+
static styles: CSSResultGroup = [unsafeCSS(sharedStyles), unsafeCSS(styles)];
|
|
13
14
|
|
|
14
15
|
static dependencies = {
|
|
15
16
|
'zn-icon': ZnIcon
|
|
@@ -11,6 +11,7 @@ import ZnSelect from "../select";
|
|
|
11
11
|
import type {ZnChangeEvent} from "../../events/zn-change";
|
|
12
12
|
import type {ZnInputEvent} from "../../events/zn-input";
|
|
13
13
|
|
|
14
|
+
import formElementStyles from '../../../scss/shared/_form-elements.scss';
|
|
14
15
|
import styles from './bulk-actions.scss';
|
|
15
16
|
|
|
16
17
|
export interface CreatedRule {
|
|
@@ -51,7 +52,7 @@ export interface BulkActionItem {
|
|
|
51
52
|
* @cssproperty --example - An example CSS custom property.
|
|
52
53
|
*/
|
|
53
54
|
export default class ZnBulkActions extends ZincElement {
|
|
54
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
55
|
+
static styles: CSSResultGroup = [unsafeCSS(formElementStyles), unsafeCSS(styles)];
|
|
55
56
|
static dependencies = {
|
|
56
57
|
'zn-button': ZnButton,
|
|
57
58
|
'zn-input': ZnInput,
|
|
@@ -14,6 +14,7 @@ import ZnTooltip from "../tooltip";
|
|
|
14
14
|
import type {IconColor, IconLibrary} from "../icon";
|
|
15
15
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
16
16
|
|
|
17
|
+
import sharedStyles from '../../../scss/shared/index.scss';
|
|
17
18
|
import styles from './button.scss';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -42,7 +43,7 @@ import styles from './button.scss';
|
|
|
42
43
|
* @csspart spinner - The spinner that shows when the button is in the loading state.
|
|
43
44
|
*/
|
|
44
45
|
export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
45
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
46
|
+
static styles: CSSResultGroup = [unsafeCSS(sharedStyles), unsafeCSS(styles)];
|
|
46
47
|
static dependencies = {
|
|
47
48
|
'zn-tooltip': ZnTooltip,
|
|
48
49
|
'zn-icon': ZnIcon
|
|
@@ -260,6 +261,10 @@ export default class ZnButton extends ZincElement implements ZincFormControl {
|
|
|
260
261
|
if (this.type === 'submit') {
|
|
261
262
|
this.formControlController.submit();
|
|
262
263
|
}
|
|
264
|
+
|
|
265
|
+
if (this.type === 'reset') {
|
|
266
|
+
this.formControlController.reset();
|
|
267
|
+
}
|
|
263
268
|
}
|
|
264
269
|
|
|
265
270
|
private _isLink() {
|
|
@@ -106,6 +106,10 @@ export default class ZnChart extends ZincElement {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
private getTheme(): 'light' | 'dark' {
|
|
109
|
+
// `m` is the rendered mode; `t` is the theme family. Fall back to `t` for
|
|
110
|
+
// hosts that still only set the legacy `t="dark"`.
|
|
111
|
+
if (this.getAttribute('m') === 'dark') return 'dark';
|
|
112
|
+
if (this.getAttribute('m') === 'light') return 'light';
|
|
109
113
|
return this.getAttribute('t') === 'dark' ? 'dark' : 'light';
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -12,6 +12,8 @@ import ZnIcon from "../icon";
|
|
|
12
12
|
import type {SelectionCardControlPosition, SelectionCardImagePosition} from '../../internal/selection-card';
|
|
13
13
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
14
14
|
|
|
15
|
+
import formControlStyles from '../../form-control.scss';
|
|
16
|
+
import selectionCardStyles from '../../selection-card.scss';
|
|
15
17
|
import styles from './checkbox.scss';
|
|
16
18
|
|
|
17
19
|
type ColorOption = 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' | 'transparent';
|
|
@@ -60,7 +62,7 @@ type ColorOption = 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'suc
|
|
|
60
62
|
* @cssproperty --zn-selection-card-border-radius - Corner radius of a contained container.
|
|
61
63
|
*/
|
|
62
64
|
export default class ZnCheckbox extends ZincElement implements ZincFormControl {
|
|
63
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
65
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(selectionCardStyles), unsafeCSS(styles)];
|
|
64
66
|
static dependencies = {'zn-icon': ZnIcon};
|
|
65
67
|
|
|
66
68
|
private readonly formControlController = new FormControlController(this, {
|
|
@@ -13,6 +13,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
13
13
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
14
14
|
import type ZnCheckbox from "../checkbox";
|
|
15
15
|
|
|
16
|
+
import formControlStyles from '../../form-control.scss';
|
|
16
17
|
import styles from './checkbox-group.scss';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -38,7 +39,7 @@ import styles from './checkbox-group.scss';
|
|
|
38
39
|
* @cssproperty --zn-checkbox-group-column-width - Minimum column width used by the horizontal contained grid, or the card basis when `wrap` is set.
|
|
39
40
|
*/
|
|
40
41
|
export default class ZnCheckboxGroup extends ZincElement implements ZincFormControl {
|
|
41
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
42
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
42
43
|
|
|
43
44
|
protected readonly formControlController = new FormControlController(this);
|
|
44
45
|
private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');
|
|
@@ -29,6 +29,8 @@ import type ZnInput from "../input";
|
|
|
29
29
|
import type ZnQueryBuilder from "../query-builder";
|
|
30
30
|
import type ZnSelect from "../select";
|
|
31
31
|
|
|
32
|
+
// Tables load in such a way that the global sheet has to be re-applied inside the shadow root.
|
|
33
|
+
import bootStyles from '../../../scss/boot.scss';
|
|
32
34
|
import styles from './data-table.scss';
|
|
33
35
|
|
|
34
36
|
const DEFAULT_PAGE = 1;
|
|
@@ -187,7 +189,7 @@ type AllowedInputElement =
|
|
|
187
189
|
* @cssproperty --example - An example CSS custom property.
|
|
188
190
|
*/
|
|
189
191
|
export default class ZnDataTable extends ZincElement {
|
|
190
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
192
|
+
static styles: CSSResultGroup = [unsafeCSS(bootStyles), unsafeCSS(styles)];
|
|
191
193
|
static dependencies = {
|
|
192
194
|
'zn-alert': ZnAlert,
|
|
193
195
|
'zn-button': ZnButton,
|