@kubex/zinc 1.1.83 → 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/dist/custom-elements.json +4 -3
- package/dist/web-types.json +1 -1
- package/dist/zn.d.ts +3 -0
- package/dist/zn.min.js +105 -104
- package/docs/pages/components/theme-editor.md +7 -5
- package/package.json +1 -1
- package/src/components/flow-builder/flow-builder.scss +6 -0
- package/src/components/theme-editor/theme-editor.component.ts +21 -17
- package/src/components/theme-editor/theme-editor.scss +51 -64
|
@@ -294,12 +294,14 @@ no dropdown rendered.
|
|
|
294
294
|
## Collapsing the controls column
|
|
295
295
|
|
|
296
296
|
Set `controls-collapsed` to hide the controls column, or click the chevron
|
|
297
|
-
toggle that
|
|
297
|
+
toggle that straddles the seam between the columns — the same edge chevron
|
|
298
|
+
the flow and page builders use for their side panels. Collapsing is purely a
|
|
298
299
|
layout change — it never affects harvested values or pushes a new theme to
|
|
299
|
-
the preview. Below the 768px stacked breakpoint the
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
the preview. Below the 768px stacked breakpoint the columns stack vertically
|
|
301
|
+
and the chevron attaches to the horizontal seam above the preview instead;
|
|
302
|
+
crossing into that breakpoint also auto-collapses the controls (once —
|
|
303
|
+
re-expanding while narrow is respected), and the toggle stays available to
|
|
304
|
+
bring them back.
|
|
303
305
|
|
|
304
306
|
## Standalone panel
|
|
305
307
|
|
package/package.json
CHANGED
|
@@ -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
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
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
|
-
<
|
|
877
|
+
<zn-button-group class="editor__devices" aria-label="Preview width">
|
|
874
878
|
${DEVICES.map(d => html`
|
|
875
|
-
<button
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
</
|
|
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"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
|
+
@include wc.scrollbars; // styles scrollbars of all descendant scroll areas (controls column), as the other builders do
|
|
4
5
|
display: block;
|
|
5
6
|
// Matches page-builder's --palette-col.
|
|
6
7
|
--zn-theme-editor-controls-width: 343px;
|
|
@@ -65,6 +66,16 @@
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.editor__controls {
|
|
69
|
+
// Colour the tab strip's active tab to match the controls panel surface,
|
|
70
|
+
// rather than the navbar's default body colour (flow-builder pattern).
|
|
71
|
+
--zn-active-nav-background: var(--zn-panel);
|
|
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
|
+
|
|
68
79
|
position: relative;
|
|
69
80
|
display: flex;
|
|
70
81
|
flex-direction: column;
|
|
@@ -192,80 +203,59 @@
|
|
|
192
203
|
flex-direction: column;
|
|
193
204
|
}
|
|
194
205
|
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
// centred on the full-height seam rather than
|
|
198
|
-
//
|
|
206
|
+
// Chevron straddling the controls/main seam — tuck the controls away / bring
|
|
207
|
+
// them back (flow-builder pattern). Positioned against .editor__main (not
|
|
208
|
+
// .editor__preview) so it stays centred on the full-height seam rather than
|
|
209
|
+
// just the preview's portion of it.
|
|
199
210
|
.panel-toggle {
|
|
200
211
|
position: absolute;
|
|
201
212
|
top: 50%;
|
|
202
|
-
left: 0;
|
|
203
213
|
z-index: 6;
|
|
204
214
|
transform: translateY(-50%);
|
|
205
215
|
display: flex;
|
|
206
216
|
align-items: center;
|
|
207
217
|
justify-content: center;
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
218
|
+
width: 24px;
|
|
219
|
+
height: 24px;
|
|
210
220
|
padding: 0;
|
|
211
|
-
border:
|
|
212
|
-
border-left: 0;
|
|
213
|
-
border-radius: 0 6px 6px 0;
|
|
221
|
+
border-radius: 50%;
|
|
214
222
|
color: rgb(var(--zn-color-muted-text));
|
|
215
223
|
background: rgb(var(--zn-panel));
|
|
224
|
+
border: 1px solid rgb(var(--zn-border-color));
|
|
225
|
+
box-shadow: 0 1px 3px rgba(var(--zn-shadow), 0.4);
|
|
216
226
|
cursor: pointer;
|
|
217
|
-
transition: left 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
227
|
+
transition: left 0.2s ease, right 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
218
228
|
|
|
219
229
|
&:hover {
|
|
220
230
|
color: rgb(var(--zn-text));
|
|
221
|
-
|
|
231
|
+
border-color: rgb(var(--zn-color-border-active));
|
|
222
232
|
}
|
|
223
233
|
|
|
224
|
-
&--
|
|
225
|
-
left:
|
|
226
|
-
border-left: 1px solid rgb(var(--zn-border-color));
|
|
227
|
-
border-radius: 6px;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.editor__devices {
|
|
232
|
-
display: flex;
|
|
233
|
-
border: 1px solid rgb(var(--zn-border-color));
|
|
234
|
-
border-radius: 4px;
|
|
235
|
-
overflow: hidden;
|
|
236
|
-
}
|
|
234
|
+
&--left {
|
|
235
|
+
left: -12px;
|
|
237
236
|
|
|
238
|
-
.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
width: 30px;
|
|
244
|
-
height: 28px;
|
|
245
|
-
padding: 0;
|
|
246
|
-
border: 0;
|
|
247
|
-
background: transparent;
|
|
248
|
-
color: rgb(var(--zn-text));
|
|
249
|
-
cursor: pointer;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.editor__device + .editor__device {
|
|
253
|
-
border-left: 1px solid rgb(var(--zn-border-color));
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.editor__device:hover,
|
|
257
|
-
.editor__mode:hover {
|
|
258
|
-
background: rgba(var(--zn-border-color), 0.5);
|
|
237
|
+
// With the panel tucked away, sit fully inside the preview column.
|
|
238
|
+
&.panel-toggle--tucked {
|
|
239
|
+
left: 8px;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
259
242
|
}
|
|
260
243
|
|
|
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.
|
|
261
246
|
.editor__device[aria-pressed="true"] {
|
|
262
|
-
|
|
263
|
-
|
|
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
|
+
}
|
|
264
256
|
}
|
|
265
257
|
|
|
266
258
|
.editor__mode {
|
|
267
|
-
border: 1px solid rgb(var(--zn-border-color));
|
|
268
|
-
border-radius: 4px;
|
|
269
259
|
// Sole occupant of .editor__controls-header's right side, beside the caption.
|
|
270
260
|
margin-left: auto;
|
|
271
261
|
}
|
|
@@ -336,22 +326,19 @@
|
|
|
336
326
|
padding-top: var(--zn-spacing-medium);
|
|
337
327
|
}
|
|
338
328
|
|
|
339
|
-
// Stacked: the seam is horizontal, so the
|
|
329
|
+
// Stacked: the seam is horizontal, so the chevron straddles the top edge instead.
|
|
340
330
|
.panel-toggle {
|
|
341
|
-
top:
|
|
342
|
-
left: 50%;
|
|
343
|
-
width: 44px;
|
|
344
|
-
height: 18px;
|
|
345
|
-
border: 1px solid rgb(var(--zn-border-color));
|
|
346
|
-
border-top: 0;
|
|
347
|
-
border-radius: 0 0 6px 6px;
|
|
331
|
+
top: -12px;
|
|
348
332
|
transform: translateX(-50%);
|
|
349
|
-
|
|
333
|
+
transition: top 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
334
|
+
|
|
335
|
+
&--left {
|
|
336
|
+
left: 50%;
|
|
350
337
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
338
|
+
&.panel-toggle--tucked {
|
|
339
|
+
top: 8px;
|
|
340
|
+
left: 50%;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
356
343
|
}
|
|
357
344
|
}
|