@kubex/zinc 1.1.84 → 1.1.85

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubex/zinc",
3
- "version": "1.1.84",
3
+ "version": "1.1.85",
4
4
  "description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
5
5
  "keywords": [
6
6
  "web components",
@@ -141,6 +141,12 @@
141
141
  // rather than the navbar's default body colour.
142
142
  --zn-active-nav-background: var(--zn-panel);
143
143
 
144
+ // Themes with a glass page tab bar (e.g. Aura) frost inactive tabs on every
145
+ // navbar under a zn-page — over the panel the translucent white just reads
146
+ // as white. Pin the standard tab tint instead.
147
+ --navbar-page-inactive-tab-background: rgb(var(--zn-color-tab));
148
+ --navbar-page-inactive-tab-filter: none;
149
+
144
150
  border-right: 1px solid rgb(var(--zn-border-color));
145
151
 
146
152
  // The registry-driven steps panel fills the column below the title block.
@@ -5,6 +5,7 @@ import { MutationController } from '@lit-labs/observers/mutation-controller.js';
5
5
  import { property, query, queryAll, state } from 'lit/decorators.js';
6
6
  import ZincElement from '../../internal/zinc-element';
7
7
  import ZnButton from '../button';
8
+ import ZnButtonGroup from '../button-group';
8
9
  import ZnCollapsible from '../collapsible';
9
10
  import ZnIcon from '../icon';
10
11
  import ZnNavbar from '../navbar';
@@ -84,6 +85,7 @@ interface DerivedStructure {
84
85
  * @dependency zn-preview-frame
85
86
  * @dependency zn-icon
86
87
  * @dependency zn-button
88
+ * @dependency zn-button-group
87
89
  * @dependency zn-tabs
88
90
  * @dependency zn-navbar
89
91
  * @dependency zn-select
@@ -135,6 +137,7 @@ export default class ZnThemeEditor extends ZincElement {
135
137
  'zn-preview-frame': ZnPreviewFrame,
136
138
  'zn-icon': ZnIcon,
137
139
  'zn-button': ZnButton,
140
+ 'zn-button-group': ZnButtonGroup,
138
141
  'zn-tabs': ZnTabs,
139
142
  'zn-navbar': ZnNavbar,
140
143
  'zn-select': ZnSelect,
@@ -822,13 +825,14 @@ export default class ZnThemeEditor extends ZincElement {
822
825
  <div class="editor__controls-inner">
823
826
  <div part="controls-header" class="editor__controls-header">
824
827
  ${this.controlsCaption ? html`<span class="editor__caption">${this.controlsCaption}</span>` : nothing}
825
- <button type="button"
826
- class="editor__mode"
827
- data-mode-toggle
828
- aria-label="${this.mode === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}"
829
- @click="${this._toggleMode}">
830
- <zn-icon src="${this.mode === 'dark' ? 'sun' : 'moon'}" library="lucide" size="16"></zn-icon>
831
- </button>
828
+ <zn-button class="editor__mode"
829
+ icon-button="small"
830
+ icon-size="20"
831
+ icon="${this.mode === 'dark' ? 'sun@lu' : 'moon@lu'}"
832
+ data-mode-toggle
833
+ tooltip="${this.mode === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}"
834
+ aria-label="${this.mode === 'dark' ? 'Switch to light mode' : 'Switch to dark mode'}"
835
+ @click="${this._toggleMode}"></zn-button>
832
836
  </div>
833
837
  <div class="editor__controls-body">
834
838
  <div
@@ -870,17 +874,17 @@ export default class ZnThemeEditor extends ZincElement {
870
874
  <div part="toolbar" class="editor__toolbar">
871
875
  ${this.previewCaption ? html`<span class="editor__caption">${this.previewCaption}</span>` : nothing}
872
876
  <div class="editor__toolbar-actions">
873
- <div class="editor__devices" role="group" aria-label="Preview width">
877
+ <zn-button-group class="editor__devices" aria-label="Preview width">
874
878
  ${DEVICES.map(d => html`
875
- <button type="button"
876
- class="editor__device"
877
- data-device="${d.id}"
878
- aria-label="${d.label}"
879
- aria-pressed="${this.device === d.id ? 'true' : 'false'}"
880
- @click="${() => this._setDevice(d.id)}">
881
- <zn-icon src="${d.icon}" library="lucide" size="16"></zn-icon>
882
- </button>`)}
883
- </div>
879
+ <zn-button class="editor__device"
880
+ icon-button="small"
881
+ icon-size="20"
882
+ icon="${d.icon}@lu"
883
+ data-device="${d.id}"
884
+ aria-label="${d.label}"
885
+ aria-pressed="${this.device === d.id ? 'true' : 'false'}"
886
+ @click="${() => this._setDevice(d.id)}"></zn-button>`)}
887
+ </zn-button-group>
884
888
  ${this._sourcesSafe().length > 0 ? html`
885
889
  <zn-select
886
890
  class="editor__sources"
@@ -70,6 +70,12 @@
70
70
  // rather than the navbar's default body colour (flow-builder pattern).
71
71
  --zn-active-nav-background: var(--zn-panel);
72
72
 
73
+ // Themes with a glass page tab bar (e.g. Aura) frost inactive tabs on every
74
+ // navbar under a zn-page — over the editor's opaque panel the translucent
75
+ // white just reads as white. Pin the standard tab tint instead.
76
+ --navbar-page-inactive-tab-background: rgb(var(--zn-color-tab));
77
+ --navbar-page-inactive-tab-filter: none;
78
+
73
79
  position: relative;
74
80
  display: flex;
75
81
  flex-direction: column;
@@ -235,44 +241,21 @@
235
241
  }
236
242
  }
237
243
 
238
- .editor__devices {
239
- display: flex;
240
- border: 1px solid rgb(var(--zn-border-color));
241
- border-radius: 4px;
242
- overflow: hidden;
243
- }
244
-
245
- .editor__device,
246
- .editor__mode {
247
- display: flex;
248
- align-items: center;
249
- justify-content: center;
250
- width: 30px;
251
- height: 28px;
252
- padding: 0;
253
- border: 0;
254
- background: transparent;
255
- color: rgb(var(--zn-text));
256
- cursor: pointer;
257
- }
258
-
259
- .editor__device + .editor__device {
260
- border-left: 1px solid rgb(var(--zn-border-color));
261
- }
262
-
263
- .editor__device:hover,
264
- .editor__mode:hover {
265
- background: rgba(var(--zn-border-color), 0.5);
266
- }
267
-
244
+ // The device switcher is zn-button[icon-button="small"]s joined into a
245
+ // segmented control by zn-button-group; only the active fill is styled here.
268
246
  .editor__device[aria-pressed="true"] {
269
- background: rgb(var(--zn-primary));
270
- color: white;
247
+ // The button's shadow border-color is !important, so it can only be
248
+ // overridden through its own custom property.
249
+ --zn-button-border-color: rgb(var(--zn-primary));
250
+
251
+ // !important so the fill also beats the button's shadow hover background.
252
+ &::part(base) {
253
+ background: rgb(var(--zn-primary)) !important;
254
+ color: white !important;
255
+ }
271
256
  }
272
257
 
273
258
  .editor__mode {
274
- border: 1px solid rgb(var(--zn-border-color));
275
- border-radius: 4px;
276
259
  // Sole occupant of .editor__controls-header's right side, beside the caption.
277
260
  margin-left: auto;
278
261
  }