@kubex/zinc 1.1.28 → 1.1.31

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.
Files changed (52) hide show
  1. package/custom-elements-manifest.config.js +2 -2
  2. package/dist/custom-elements.json +1910 -362
  3. package/dist/vscode.html-custom-data.json +55 -14
  4. package/dist/web-types.json +185 -32
  5. package/dist/zn.d.ts +684 -16
  6. package/dist/zn.min.js +1325 -929
  7. package/docs/pages/components/flow-builder-troubleshooter-demo.njk +106 -78
  8. package/docs/pages/components/flow-builder.md +422 -66
  9. package/docs/pages/components/page-builder.md +167 -0
  10. package/docs/pages/components/settings-container.md +37 -2
  11. package/package.json +1 -1
  12. package/src/components/datepicker/datepicker.scss +0 -10
  13. package/src/components/flow-builder/flow-builder.component.ts +377 -16
  14. package/src/components/flow-builder/flow-builder.scss +398 -250
  15. package/src/components/flow-builder/flow-builder.test.ts +241 -4
  16. package/src/components/flow-builder/flow-layout.ts +42 -17
  17. package/src/components/flow-builder/flow.types.ts +168 -43
  18. package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.component.ts +300 -0
  19. package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.scss +222 -0
  20. package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.test.ts +125 -0
  21. package/src/components/flow-builder/modules/flow-branch-conditions/index.ts +12 -0
  22. package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +184 -26
  23. package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +170 -120
  24. package/src/components/flow-builder/modules/flow-node/flow-node.scss +42 -42
  25. package/src/components/flow-builder/modules/flow-step/flow-step.component.ts +2 -1
  26. package/src/components/flow-builder/modules/flow-step/flow-step.scss +25 -17
  27. package/src/components/header/header.scss +3 -1
  28. package/src/components/icon-picker/icon-picker.component.ts +20 -37
  29. package/src/components/icon-picker/icon-picker.scss +5 -45
  30. package/src/components/page-builder/index.ts +14 -0
  31. package/src/components/page-builder/modules/page-palette-item/index.ts +12 -0
  32. package/src/components/page-builder/modules/page-palette-item/page-palette-item.component.ts +71 -0
  33. package/src/components/page-builder/modules/page-palette-item/page-palette-item.scss +70 -0
  34. package/src/components/page-builder/modules/page-palette-item/page-palette-item.test.ts +20 -0
  35. package/src/components/page-builder/modules/page-section-card/index.ts +12 -0
  36. package/src/components/page-builder/modules/page-section-card/page-section-card.component.ts +93 -0
  37. package/src/components/page-builder/modules/page-section-card/page-section-card.scss +92 -0
  38. package/src/components/page-builder/modules/page-section-card/page-section-card.test.ts +50 -0
  39. package/src/components/page-builder/page-builder.component.ts +1053 -0
  40. package/src/components/page-builder/page-builder.scss +494 -0
  41. package/src/components/page-builder/page-builder.test.ts +464 -0
  42. package/src/components/page-builder/page-registry.ts +48 -0
  43. package/src/components/page-builder/page.types.ts +75 -0
  44. package/src/components/panel/panel.scss +1 -0
  45. package/src/components/settings-container/settings-container.component.ts +74 -9
  46. package/src/components/settings-container/settings-container.scss +75 -0
  47. package/src/components/settings-container/settings-container.test.ts +35 -0
  48. package/src/events/events.ts +2 -0
  49. package/src/events/zn-page-change.ts +9 -0
  50. package/src/events/zn-page-selection-change.ts +7 -0
  51. package/src/zinc.ts +4 -0
  52. package/web-test-runner.config.js +6 -1
@@ -0,0 +1,494 @@
1
+ @use "../../wc";
2
+
3
+ :host {
4
+ @include wc.scrollbars;
5
+ // Canonical canvas card/container width, inherited by the section-card
6
+ // component's shadow styles (whose 560px var() fallback only applies when
7
+ // the card is used outside a builder).
8
+ --pb-card-width: 560px;
9
+
10
+ display: block;
11
+ width: 100%;
12
+ height: 100%;
13
+ min-height: 480px;
14
+ color: rgb(var(--zn-text));
15
+ // Panels adapt to the builder's own width, not the viewport's.
16
+ container-type: inline-size;
17
+ }
18
+
19
+ .builder {
20
+ --palette-col: 343px;
21
+ --inspector-col: 343px;
22
+
23
+ display: grid;
24
+ grid-template-columns: var(--palette-col) minmax(0, 1fr);
25
+ grid-template-rows: auto minmax(0, 1fr);
26
+ width: 100%;
27
+ height: 100%;
28
+ background: rgb(var(--zn-panel));
29
+ border: 1px solid rgb(var(--zn-border-color));
30
+ border-radius: 8px;
31
+ overflow: hidden;
32
+
33
+ &--inspecting {
34
+ grid-template-columns: var(--palette-col) minmax(0, 1fr) var(--inspector-col);
35
+ }
36
+
37
+ transition: grid-template-columns 0.2s ease;
38
+
39
+ // Side panels tuck away via the canvas-edge chevrons (flow-builder pattern).
40
+ // Their border would floor the width above zero, so it collapses too.
41
+ &--palette-collapsed {
42
+ --palette-col: 0px;
43
+
44
+ .palette {
45
+ border-right: none;
46
+ }
47
+ }
48
+
49
+ &--inspector-collapsed {
50
+ --inspector-col: 0px;
51
+
52
+ .inspector {
53
+ padding: 0;
54
+ border-left: none;
55
+ }
56
+ }
57
+ }
58
+
59
+ // :not() keeps these from out-cascading the collapsed modifiers' zero-width state.
60
+ // 768 must match NARROW_WIDTH in page-builder.component.ts (palette auto-collapse).
61
+ @container (max-width: 768px) {
62
+ .builder:not(.builder--palette-collapsed) {
63
+ --palette-col: 240px;
64
+ }
65
+
66
+ .builder:not(.builder--inspector-collapsed) {
67
+ --inspector-col: 280px;
68
+ }
69
+ }
70
+
71
+ // Chevrons straddling the canvas edges — tuck a side panel away / bring it
72
+ // back (copied from flow-builder).
73
+ .panel-toggle {
74
+ position: absolute;
75
+ top: 50%;
76
+ z-index: 6;
77
+ transform: translateY(-50%);
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ width: 24px;
82
+ height: 24px;
83
+ padding: 0;
84
+ border-radius: 50%;
85
+ color: rgb(var(--zn-color-muted-text));
86
+ background: rgb(var(--zn-panel));
87
+ border: 1px solid rgb(var(--zn-border-color));
88
+ box-shadow: 0 1px 3px rgba(var(--zn-shadow), 0.4);
89
+ cursor: pointer;
90
+ transition: left 0.2s ease, right 0.2s ease, color 0.12s ease, border-color 0.12s ease;
91
+
92
+ &:hover {
93
+ color: rgb(var(--zn-text));
94
+ border-color: rgb(var(--zn-color-border-active));
95
+ }
96
+
97
+ &--left {
98
+ left: -12px;
99
+
100
+ // With the panel tucked away, sit fully inside the canvas.
101
+ &.panel-toggle--tucked {
102
+ left: 8px;
103
+ }
104
+ }
105
+
106
+ &--right {
107
+ right: -12px;
108
+
109
+ &.panel-toggle--tucked {
110
+ right: 8px;
111
+ }
112
+ }
113
+ }
114
+
115
+ .header {
116
+ grid-row: 1;
117
+ grid-column: 1 / -1;
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: space-between;
121
+ gap: 8px;
122
+ padding: 10px 14px;
123
+ border-bottom: 1px solid rgb(var(--zn-border-color));
124
+
125
+ &[hidden] {
126
+ display: none;
127
+ }
128
+
129
+ &__group {
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 8px;
133
+ }
134
+ }
135
+
136
+ // The hidden header leaves the grid entirely, so pin the panels to row 2
137
+ // explicitly or auto-placement collapses the builder to content height.
138
+ .palette,
139
+ .canvas-cell,
140
+ .inspector {
141
+ grid-row: 2;
142
+ min-height: 0;
143
+ min-width: 0;
144
+ overflow: hidden;
145
+ }
146
+
147
+ // Non-scrolling wrapper: anchors the edge chevrons, save status and restore
148
+ // banner so they don't scroll with (or get clipped by) the canvas.
149
+ .canvas-cell {
150
+ position: relative;
151
+ overflow: visible; // the edge chevrons straddle the panel borders
152
+ }
153
+
154
+ // Left column — anatomy and metrics copied from flow-builder's steps panel
155
+ // (title block, search, full-bleed categories with dividers); no tabs.
156
+ .palette {
157
+ display: flex;
158
+ flex-direction: column;
159
+ border-right: 1px solid rgb(var(--zn-border-color));
160
+
161
+ &__title {
162
+ display: flex;
163
+ align-items: flex-start;
164
+ justify-content: space-between;
165
+ gap: 8px;
166
+ padding: 16px;
167
+ border-bottom: 1px solid rgb(var(--zn-border-color));
168
+ }
169
+
170
+ &__text {
171
+ min-width: 0;
172
+ }
173
+
174
+ &__heading {
175
+ font-size: 0.9375rem;
176
+ font-weight: 600;
177
+ }
178
+
179
+ &__subheading {
180
+ margin-top: 2px;
181
+ font-size: 0.75rem;
182
+ color: rgb(var(--zn-color-muted-text));
183
+ }
184
+
185
+ &__search {
186
+ padding: 12px 12px 8px;
187
+
188
+ // Placeholder-only look (as flow-builder), but the label stays in the
189
+ // accessibility tree — visually hidden, not display:none.
190
+ &::part(form-control-label) {
191
+ position: absolute;
192
+ width: 1px;
193
+ height: 1px;
194
+ overflow: hidden;
195
+ clip-path: inset(50%);
196
+ white-space: nowrap;
197
+ }
198
+ }
199
+
200
+ &__scroll {
201
+ flex: 1;
202
+ min-height: 0;
203
+ overflow-y: auto;
204
+ padding-bottom: 16px;
205
+ }
206
+
207
+ // Divider above every category; header/caption styling copied from
208
+ // flow-builder's flow-step-group.
209
+ &__category {
210
+ display: block;
211
+ border-top: 1px solid rgb(var(--zn-border-color));
212
+
213
+ // 16px block padding on the header. The !important beats the collapsible's
214
+ // internal `.header` class specificity. align-items centres the caption
215
+ // with the chevron regardless of the header's internal column layout.
216
+ &::part(header) {
217
+ align-items: center !important;
218
+ padding-block: calc(var(--zn-base-px) * 2) !important;
219
+ }
220
+
221
+ // Caption type: Inter SemiBold 14 / 16 (Primary text).
222
+ &::part(caption) {
223
+ font-size: 14px;
224
+ font-weight: 600;
225
+ line-height: 16px;
226
+ color: rgb(var(--zn-text));
227
+ }
228
+ }
229
+
230
+ &__uncategorized {
231
+ padding: 8px var(--zn-base-gap);
232
+ }
233
+ }
234
+
235
+ zn-page-palette-item {
236
+ margin-bottom: 6px;
237
+ }
238
+
239
+ .canvas {
240
+ width: 100%;
241
+ height: 100%;
242
+ display: flex;
243
+ flex-direction: column;
244
+ align-items: stretch;
245
+ padding: 24px;
246
+ overflow-y: auto;
247
+ background:
248
+ radial-gradient(circle, rgba(var(--zn-text), 0.08) 1px, transparent 1px) 0 0 / 20px 20px,
249
+ rgb(var(--zn-body));
250
+ }
251
+
252
+ .inspector {
253
+ display: flex;
254
+ flex-direction: column;
255
+ gap: 12px;
256
+ padding: 14px;
257
+ border-left: 1px solid rgb(var(--zn-border-color));
258
+ overflow-y: auto;
259
+
260
+ }
261
+
262
+ .inspector__body,
263
+ .inspector__form {
264
+ display: flex;
265
+ flex-direction: column;
266
+ gap: 12px;
267
+ }
268
+
269
+ .declarations {
270
+ display: none;
271
+ }
272
+
273
+ .canvas__empty {
274
+ margin: auto auto 8px;
275
+ font-size: 13px;
276
+ opacity: 0.6;
277
+
278
+ &[hidden] {
279
+ display: none;
280
+ }
281
+ }
282
+
283
+ .drop {
284
+ position: relative;
285
+ display: flex;
286
+ align-items: center;
287
+ justify-content: center;
288
+ width: 100%;
289
+ max-width: var(--pb-card-width);
290
+ margin: 0 auto;
291
+ min-height: 28px;
292
+ transition: min-height 0.12s ease;
293
+
294
+ // Drop placeholder: an outlined box the size of a card, so the insertion
295
+ // point reads clearly between two existing sections.
296
+ &--active {
297
+ min-height: 72px;
298
+ }
299
+
300
+ // The empty canvas's only drop zone sits just below the centred hint text;
301
+ // once a drag is over the canvas the hint hides and the placeholder box
302
+ // takes the centre itself.
303
+ &--solo {
304
+ margin: 0 auto auto;
305
+ }
306
+
307
+ &--solo#{&}--active {
308
+ margin: auto;
309
+ min-height: 96px;
310
+ }
311
+
312
+ &--active::before {
313
+ content: '';
314
+ position: absolute;
315
+ inset: 6px 0;
316
+ border: 2px dashed rgb(var(--zn-color-primary));
317
+ border-radius: 8px;
318
+ background: rgba(var(--zn-color-primary), 0.06);
319
+ }
320
+
321
+ &__add {
322
+ display: flex;
323
+ align-items: center;
324
+ justify-content: center;
325
+ width: 22px;
326
+ height: 22px;
327
+ border: 1px solid rgb(var(--zn-border-color));
328
+ border-radius: 50%;
329
+ background: rgb(var(--zn-panel));
330
+ color: rgb(var(--zn-text));
331
+ cursor: pointer;
332
+ opacity: 0;
333
+ transition: opacity 0.12s ease;
334
+ }
335
+
336
+ &:hover &__add,
337
+ &--active &__add {
338
+ opacity: 1;
339
+ }
340
+ }
341
+
342
+ // A container section: its card spans the row with a grid of child slots below.
343
+ .container {
344
+ width: 100%;
345
+ max-width: var(--pb-card-width);
346
+ margin: 0 auto;
347
+ display: flex;
348
+ flex-direction: column;
349
+ gap: 8px;
350
+ }
351
+
352
+ .slots {
353
+ display: grid;
354
+ // minmax(0) lets cells shrink below their content's min width — otherwise a
355
+ // child card's text forces the tracks wider than the parent tile.
356
+ grid-template-columns: repeat(3, minmax(0, 1fr));
357
+ gap: 8px;
358
+ }
359
+
360
+ .slot {
361
+ position: relative;
362
+ min-height: 64px;
363
+
364
+ &--empty {
365
+ display: flex;
366
+ align-items: center;
367
+ justify-content: center;
368
+ border: 1px dashed rgb(var(--zn-border-color));
369
+ border-radius: 8px;
370
+ color: rgba(var(--zn-text), 0.4);
371
+ cursor: pointer;
372
+ transition: border-color 0.12s ease, background 0.12s ease;
373
+
374
+ &:hover {
375
+ border-color: rgb(var(--zn-color-border-active));
376
+ color: rgba(var(--zn-text), 0.7);
377
+ }
378
+ }
379
+
380
+ &--active {
381
+ border-color: rgb(var(--zn-color-primary));
382
+ border-style: dashed;
383
+ background: rgba(var(--zn-color-primary), 0.06);
384
+ }
385
+ }
386
+
387
+ .picker {
388
+ position: absolute;
389
+ top: calc(100% - 2px);
390
+ z-index: 2;
391
+ display: flex;
392
+ flex-direction: column;
393
+ min-width: 220px;
394
+ max-height: 260px;
395
+ overflow-y: auto;
396
+ padding: 6px;
397
+ background: rgb(var(--zn-panel));
398
+ border: 1px solid rgb(var(--zn-border-color));
399
+ border-radius: 8px;
400
+ box-shadow: 0 4px 12px rgba(var(--zn-shadow), 0.4);
401
+
402
+ &__item {
403
+ display: flex;
404
+ align-items: center;
405
+ gap: 8px;
406
+ padding: 7px 8px;
407
+ border: none;
408
+ border-radius: 6px;
409
+ background: transparent;
410
+ color: rgb(var(--zn-text));
411
+ font-size: 13px;
412
+ text-align: left;
413
+ cursor: pointer;
414
+
415
+ &:hover {
416
+ background: rgba(var(--zn-text), 0.08);
417
+ }
418
+ }
419
+ }
420
+
421
+ // Bottom-left status pill: flashes green as a save lands, then keeps a quiet
422
+ // "last saved Xm ago" (copied from flow-builder).
423
+ .save-status {
424
+ position: absolute;
425
+ left: 16px;
426
+ bottom: 16px;
427
+ z-index: 5;
428
+ display: flex;
429
+ align-items: center;
430
+ gap: 6px;
431
+ padding: 5px 10px;
432
+ font-size: 0.75rem;
433
+ color: rgb(var(--zn-color-muted-text));
434
+ background: rgb(var(--zn-panel));
435
+ border: 1px solid rgb(var(--zn-border-color));
436
+ border-radius: 8px;
437
+ box-shadow: 0 1px 3px rgba(var(--zn-shadow), 0.4);
438
+ pointer-events: none;
439
+ transition: color 0.15s ease, border-color 0.15s ease;
440
+
441
+ &--saved {
442
+ color: rgb(var(--zn-color-success));
443
+ border-color: color-mix(in srgb, rgb(var(--zn-color-success)) 45%, transparent);
444
+ }
445
+ }
446
+
447
+ // Offered when a loaded page differs from a fresh auto-saved draft.
448
+ .restore-banner {
449
+ position: absolute;
450
+ top: 16px;
451
+ left: 50%;
452
+ transform: translateX(-50%);
453
+ z-index: 5;
454
+ display: flex;
455
+ align-items: center;
456
+ gap: 8px;
457
+ max-width: calc(100% - 32px);
458
+ padding: 8px 12px;
459
+ font-size: 0.8125rem;
460
+ color: rgb(var(--zn-text));
461
+ background: rgb(var(--zn-panel));
462
+ border: 1px solid rgb(var(--zn-border-color));
463
+ border-radius: 8px;
464
+ box-shadow: 0 2px 8px rgba(var(--zn-shadow), 0.5);
465
+
466
+ button {
467
+ flex: 0 0 auto;
468
+ padding: 3px 10px;
469
+ font-size: 0.75rem;
470
+ font-weight: 600;
471
+ border-radius: 6px;
472
+ cursor: pointer;
473
+ }
474
+
475
+ &__restore {
476
+ color: rgb(var(--zn-panel));
477
+ background: rgb(var(--zn-color-primary));
478
+ border: none;
479
+
480
+ &:hover {
481
+ filter: brightness(1.1);
482
+ }
483
+ }
484
+
485
+ &__dismiss {
486
+ color: rgb(var(--zn-color-muted-text));
487
+ background: transparent;
488
+ border: none;
489
+
490
+ &:hover {
491
+ background: rgb(var(--zn-color-tab));
492
+ }
493
+ }
494
+ }