@threadlabs/looma 0.1.2 → 0.1.4
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/{chunk-YK4MTZGJ.js → chunk-3PASQ7DE.js} +26 -26
- package/dist/cjs/ui-button.cjs.entry.js +3 -4
- package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-popover.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/collection/components/ui-button/ui-button.css +22 -12
- package/dist/collection/components/ui-button/ui-button.js +7 -7
- package/dist/collection/components/ui-dialog/ui-dialog.css +10 -4
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +4 -1
- package/dist/collection/components/ui-menu/ui-menu.css +4 -1
- package/dist/collection/components/ui-popover/ui-popover.css +7 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.css +3 -1
- package/dist/collection/components/ui-tabs/ui-tabs.css +3 -0
- package/dist/collection/components/ui-toast-region/ui-toast-region.css +3 -2
- package/dist/collection/components/ui-top-bar/ui-top-bar.css +10 -2
- package/dist/components/p-gHC_Ei92.js +1 -0
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/esm/ui-button.entry.js +3 -4
- package/dist/esm/ui-dialog.entry.js +1 -1
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-menu.entry.js +1 -1
- package/dist/esm/ui-popover.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-tabs.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +1 -1
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/index.cjs +11 -12
- package/dist/index.js +1 -1
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-01425a37.entry.js +1 -0
- package/dist/looma/p-07167650.entry.js +1 -0
- package/dist/looma/{p-341ba64a.entry.js → p-3ecd7120.entry.js} +1 -1
- package/dist/looma/p-5717a4c4.entry.js +1 -0
- package/dist/looma/p-940a931a.entry.js +1 -0
- package/dist/looma/p-941221ad.entry.js +1 -0
- package/dist/looma/p-a7be33fd.entry.js +1 -0
- package/dist/looma/{p-4742e6b4.entry.js → p-cb15e8e3.entry.js} +1 -1
- package/dist/looma/p-d39905f9.entry.js +1 -0
- package/dist/types/components/ui-button/ui-button.d.ts +1 -1
- package/dist/types/components.d.ts +9 -3
- package/dist/{ui-avatar-group.entry-BZGXBOSE.js → ui-avatar-group.entry-DBVLQ4KB.js} +1 -1
- package/dist/{ui-avatar.entry-S2O2W5SA.js → ui-avatar.entry-2WTBM2EC.js} +1 -1
- package/dist/{ui-badge.entry-CVJDISCR.js → ui-badge.entry-XKIGBK5V.js} +1 -1
- package/dist/ui-button.entry-PWT56MPD.js +71 -0
- package/dist/{ui-checkbox.entry-5RA2CB43.js → ui-checkbox.entry-QT5S7EEL.js} +1 -1
- package/dist/{ui-context-menu.entry-UUOCT75F.js → ui-context-menu.entry-NGWR3LOZ.js} +1 -1
- package/dist/{ui-dialog.entry-OEPJTEES.js → ui-dialog.entry-PEDDIALQ.js} +2 -2
- package/dist/{ui-disclosure.entry-LRRISGUD.js → ui-disclosure.entry-UKO7MAZM.js} +1 -1
- package/dist/ui-floating-action-button.entry-SSGHRMCO.js +23 -0
- package/dist/{ui-form-field.entry-73YOVICF.js → ui-form-field.entry-6TZCWPYL.js} +1 -1
- package/dist/{ui-icon-button.entry-MNXGPG36.js → ui-icon-button.entry-WMCYMK2H.js} +1 -1
- package/dist/{ui-input.entry-UWRVAOSW.js → ui-input.entry-AZ5BGQNA.js} +1 -1
- package/dist/{ui-menu-item.entry-5AOJO5MP.js → ui-menu-item.entry-L4NJDBKF.js} +1 -1
- package/dist/{ui-menu.entry-YDS6UMB5.js → ui-menu.entry-DGUYAE3Q.js} +2 -2
- package/dist/{ui-popover.entry-PGWDCQIX.js → ui-popover.entry-A54EKVZG.js} +2 -2
- package/dist/{ui-radio-group.entry-RHP5GNWU.js → ui-radio-group.entry-6YP4LY4N.js} +1 -1
- package/dist/{ui-radio.entry-5WRWPSTK.js → ui-radio.entry-CGYNK7PN.js} +1 -1
- package/dist/{ui-search-result-row.entry-IKJB2SJJ.js → ui-search-result-row.entry-DGKSI2QM.js} +1 -1
- package/dist/{ui-search-shell.entry-ZIWF4ZHH.js → ui-search-shell.entry-3F5ASGTW.js} +2 -2
- package/dist/{ui-select.entry-N5TIKHR7.js → ui-select.entry-SXSZPVXA.js} +1 -1
- package/dist/{ui-switch.entry-WUSZTXIR.js → ui-switch.entry-AD4EVUWM.js} +1 -1
- package/dist/{ui-tabs.entry-UFAVAQIF.js → ui-tabs.entry-WLKO5G5N.js} +2 -2
- package/dist/{ui-textarea.entry-BYT47RAQ.js → ui-textarea.entry-IHPC7Q4R.js} +1 -1
- package/dist/{ui-toast-region.entry-6UYR3ZU2.js → ui-toast-region.entry-GCW2LJAC.js} +2 -2
- package/dist/{ui-tooltip.entry-YS7UX4FS.js → ui-tooltip.entry-EU2G6BH5.js} +1 -1
- package/dist/{ui-top-bar.entry-V27H6NFO.js → ui-top-bar.entry-NMAFXVET.js} +2 -2
- package/editor/{chunk-PQAV4KXC.js → chunk-CWCXYQMT.js} +4 -4
- package/editor/index.js +1 -1
- package/editor/ui.js +1 -1
- package/editor.css +68 -24
- package/layout/index.cjs +82 -0
- package/layout/index.css +165 -8
- package/layout/index.js +82 -0
- package/layout.css +113 -9
- package/package.json +1 -1
- package/styles.css +23 -17
- package/theme-dark.css +6 -6
- package/theme-light.css +3 -3
- package/tokens.css +16 -16
- package/vue/{chunk-J4UBEIIL.js → chunk-P72L3GWE.js} +1 -0
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +13 -1
- package/vue/index.js +10 -1
- package/dist/components/p-WvL4iAhX.js +0 -1
- package/dist/looma/p-52c537fa.entry.js +0 -1
- package/dist/looma/p-649dad92.entry.js +0 -1
- package/dist/looma/p-ab4151d5.entry.js +0 -1
- package/dist/looma/p-dff144bd.entry.js +0 -1
- package/dist/looma/p-ebb74106.entry.js +0 -1
- package/dist/looma/p-ecb5739b.entry.js +0 -1
- package/dist/looma/p-fa4659c4.entry.js +0 -1
- package/dist/ui-button.entry-LNJBEJFE.js +0 -72
- package/dist/ui-floating-action-button.entry-7TSAZRXP.js +0 -23
package/editor.css
CHANGED
|
@@ -37,6 +37,21 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
37
37
|
display: none;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
ui-editor-toolbar[floating] {
|
|
41
|
+
position: static;
|
|
42
|
+
top: auto;
|
|
43
|
+
width: max-content;
|
|
44
|
+
max-width: min(calc(100vw - 24px), 100%);
|
|
45
|
+
min-height: auto;
|
|
46
|
+
padding: var(--ui-editor-toolbar-floating-padding, 4px);
|
|
47
|
+
overflow-x: visible;
|
|
48
|
+
background: color-mix(in srgb, var(--ui-editor-toolbar-bg, var(--ui-surface, #fff)) 96%, transparent);
|
|
49
|
+
border: 1px solid var(--ui-editor-toolbar-border, var(--ui-border, #e5e7eb));
|
|
50
|
+
border-radius: var(--ui-editor-toolbar-floating-radius, var(--ui-radius-lg, 10px));
|
|
51
|
+
box-shadow: var(--ui-editor-toolbar-floating-shadow, var(--ui-shadow-lg, 0 10px 24px rgb(0 0 0 / 0.12)));
|
|
52
|
+
backdrop-filter: blur(10px);
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
@media (max-width: 767px) {
|
|
41
56
|
ui-editor-toolbar {
|
|
42
57
|
position: fixed;
|
|
@@ -49,6 +64,15 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
49
64
|
border-bottom: none;
|
|
50
65
|
box-shadow: var(--ui-editor-toolbar-mobile-shadow, 0 -2px 8px rgb(0 0 0 / 0.06));
|
|
51
66
|
}
|
|
67
|
+
|
|
68
|
+
ui-editor-toolbar[floating] {
|
|
69
|
+
position: static;
|
|
70
|
+
inset: auto;
|
|
71
|
+
min-height: auto;
|
|
72
|
+
border: 1px solid var(--ui-editor-toolbar-border, var(--ui-border, #e5e7eb));
|
|
73
|
+
border-radius: var(--ui-editor-toolbar-floating-radius, var(--ui-radius-lg, 10px));
|
|
74
|
+
box-shadow: var(--ui-editor-toolbar-floating-shadow, var(--ui-shadow-lg, 0 10px 24px rgb(0 0 0 / 0.12)));
|
|
75
|
+
}
|
|
52
76
|
}
|
|
53
77
|
|
|
54
78
|
.ui-editor-toolbar__divider {
|
|
@@ -212,12 +236,13 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
212
236
|
|
|
213
237
|
/* Table context menu */
|
|
214
238
|
.ui-editor-table-context-menu {
|
|
215
|
-
min-width:
|
|
239
|
+
min-width: 14rem;
|
|
240
|
+
max-width: min(17rem, calc(100vw - 24px));
|
|
216
241
|
max-height: min(28rem, calc(100vh - 24px));
|
|
217
|
-
padding: var(--ui-space-1,
|
|
242
|
+
padding: var(--ui-space-1-5, 6px);
|
|
218
243
|
background: var(--ui-surface, #fff);
|
|
219
244
|
border: 1px solid var(--ui-border, #e5e7eb);
|
|
220
|
-
border-radius: var(--ui-radius-
|
|
245
|
+
border-radius: var(--ui-radius-lg, 10px);
|
|
221
246
|
box-shadow: var(--ui-shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
|
|
222
247
|
display: flex;
|
|
223
248
|
flex-direction: column;
|
|
@@ -230,18 +255,19 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
230
255
|
.ui-editor-table-context-menu__section {
|
|
231
256
|
display: flex;
|
|
232
257
|
flex-direction: column;
|
|
233
|
-
gap:
|
|
258
|
+
gap: 3px;
|
|
234
259
|
}
|
|
235
260
|
|
|
236
261
|
.ui-editor-table-context-menu button {
|
|
237
262
|
display: block;
|
|
238
263
|
width: 100%;
|
|
239
264
|
text-align: left;
|
|
240
|
-
|
|
265
|
+
min-height: 32px;
|
|
266
|
+
padding: var(--ui-space-1-5, 6px) var(--ui-space-2, 8px);
|
|
241
267
|
border: none;
|
|
242
268
|
border-radius: var(--ui-radius-sm, 4px);
|
|
243
269
|
background: none;
|
|
244
|
-
font-size: var(--ui-
|
|
270
|
+
font-size: var(--ui-font-size-sm, 0.875rem);
|
|
245
271
|
cursor: pointer;
|
|
246
272
|
color: var(--ui-text, #111);
|
|
247
273
|
}
|
|
@@ -261,7 +287,7 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
261
287
|
.ui-editor-table-context-menu__swatches {
|
|
262
288
|
display: grid;
|
|
263
289
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
264
|
-
gap:
|
|
290
|
+
gap: 3px;
|
|
265
291
|
}
|
|
266
292
|
|
|
267
293
|
.ui-editor-table-context-menu__swatch-button {
|
|
@@ -300,7 +326,7 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
300
326
|
}
|
|
301
327
|
|
|
302
328
|
.ui-editor-table-context-menu__heading {
|
|
303
|
-
padding: var(--ui-space-1, 4px) var(--ui-space-
|
|
329
|
+
padding: var(--ui-space-1, 4px) var(--ui-space-2, 8px);
|
|
304
330
|
font-size: 0.6875rem;
|
|
305
331
|
font-weight: 700;
|
|
306
332
|
letter-spacing: 0.05em;
|
|
@@ -330,7 +356,10 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
330
356
|
.ui-editor-table-toolbar__group {
|
|
331
357
|
display: inline-flex;
|
|
332
358
|
align-items: center;
|
|
333
|
-
gap:
|
|
359
|
+
gap: 0;
|
|
360
|
+
overflow: hidden;
|
|
361
|
+
border: 1px solid var(--ui-border, #e5e7eb);
|
|
362
|
+
border-radius: var(--ui-radius-md, 6px);
|
|
334
363
|
}
|
|
335
364
|
|
|
336
365
|
.ui-editor-table-toolbar__sep {
|
|
@@ -348,7 +377,7 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
348
377
|
align-items: center;
|
|
349
378
|
justify-content: center;
|
|
350
379
|
min-height: 32px;
|
|
351
|
-
border:
|
|
380
|
+
border: 0;
|
|
352
381
|
border-radius: var(--ui-radius-sm, 4px);
|
|
353
382
|
background: transparent;
|
|
354
383
|
color: var(--ui-text-primary, #111827);
|
|
@@ -366,10 +395,22 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
366
395
|
|
|
367
396
|
.ui-editor-table-toolbar button[data-active="true"] {
|
|
368
397
|
background: var(--ui-accent-soft, var(--ui-accent-subtle, #e8f0fb));
|
|
369
|
-
border-color: var(--ui-accent-solid, #0066cc);
|
|
370
398
|
color: var(--ui-accent-active, #003d7a);
|
|
371
399
|
}
|
|
372
400
|
|
|
401
|
+
.ui-editor-table-toolbar__group button {
|
|
402
|
+
border-radius: 0;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.ui-editor-table-toolbar__group button + button {
|
|
406
|
+
border-left: 1px solid var(--ui-border, #e5e7eb);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.ui-editor-table-toolbar__more {
|
|
410
|
+
border: 1px solid var(--ui-border, #e5e7eb) !important;
|
|
411
|
+
border-radius: var(--ui-radius-md, 6px) !important;
|
|
412
|
+
}
|
|
413
|
+
|
|
373
414
|
.ui-editor-table-toolbar button[data-tone="danger"] {
|
|
374
415
|
color: var(--ui-danger, #dc2626);
|
|
375
416
|
}
|
|
@@ -489,25 +530,21 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
489
530
|
.ui-editor-table-overlay__cols {
|
|
490
531
|
pointer-events: none;
|
|
491
532
|
position: absolute;
|
|
492
|
-
display: grid;
|
|
493
|
-
gap: 0;
|
|
494
533
|
}
|
|
495
534
|
|
|
496
535
|
.ui-editor-table-overlay__rows {
|
|
497
536
|
inset: 0;
|
|
498
537
|
width: 100%;
|
|
499
|
-
grid-template-rows: repeat(var(--ui-editor-table-overlay-row-boundaries, 1), 1fr);
|
|
500
538
|
}
|
|
501
539
|
|
|
502
540
|
.ui-editor-table-overlay__cols {
|
|
503
541
|
inset: 0;
|
|
504
542
|
height: 100%;
|
|
505
|
-
grid-template-columns: repeat(var(--ui-editor-table-overlay-col-boundaries, 1), 1fr);
|
|
506
543
|
}
|
|
507
544
|
|
|
508
545
|
.ui-editor-table-overlay__control {
|
|
509
|
-
pointer-events:
|
|
510
|
-
position:
|
|
546
|
+
pointer-events: none;
|
|
547
|
+
position: absolute;
|
|
511
548
|
border: none;
|
|
512
549
|
background: none;
|
|
513
550
|
cursor: pointer;
|
|
@@ -537,7 +574,7 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
537
574
|
opacity var(--ui-motion-fast, 120ms) ease,
|
|
538
575
|
transform var(--ui-motion-fast, 120ms) ease,
|
|
539
576
|
color var(--ui-motion-fast, 120ms) ease;
|
|
540
|
-
pointer-events:
|
|
577
|
+
pointer-events: auto;
|
|
541
578
|
}
|
|
542
579
|
|
|
543
580
|
.ui-editor-table-overlay__control:is([data-active="true"], :focus-visible) .ui-editor-table-overlay__handle {
|
|
@@ -547,11 +584,12 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
547
584
|
}
|
|
548
585
|
|
|
549
586
|
.ui-editor-table-overlay__control--row {
|
|
550
|
-
|
|
551
|
-
|
|
587
|
+
left: 0;
|
|
588
|
+
right: 0;
|
|
589
|
+
top: calc(var(--ui-editor-table-overlay-boundary-index) * 100% / var(--ui-editor-table-overlay-segments));
|
|
552
590
|
width: 100%;
|
|
553
591
|
height: 16px;
|
|
554
|
-
|
|
592
|
+
transform: translateY(-50%);
|
|
555
593
|
}
|
|
556
594
|
|
|
557
595
|
.ui-editor-table-overlay__control--row .ui-editor-table-overlay__handle {
|
|
@@ -582,11 +620,12 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
582
620
|
}
|
|
583
621
|
|
|
584
622
|
.ui-editor-table-overlay__control--col {
|
|
585
|
-
|
|
586
|
-
|
|
623
|
+
top: 0;
|
|
624
|
+
bottom: 0;
|
|
625
|
+
left: calc(var(--ui-editor-table-overlay-boundary-index) * 100% / var(--ui-editor-table-overlay-segments));
|
|
587
626
|
width: 16px;
|
|
588
627
|
height: 100%;
|
|
589
|
-
|
|
628
|
+
transform: translateX(-50%);
|
|
590
629
|
}
|
|
591
630
|
|
|
592
631
|
.ui-editor-table-overlay__control--col .ui-editor-table-overlay__handle {
|
|
@@ -632,6 +671,11 @@ ui-editor-toolbar::-webkit-scrollbar {
|
|
|
632
671
|
table-layout: fixed;
|
|
633
672
|
}
|
|
634
673
|
|
|
674
|
+
.ProseMirror table.ProseMirror-selectednode,
|
|
675
|
+
.ProseMirror .tableWrapper.ProseMirror-selectednode {
|
|
676
|
+
outline: none;
|
|
677
|
+
}
|
|
678
|
+
|
|
635
679
|
.ProseMirror th,
|
|
636
680
|
.ProseMirror td {
|
|
637
681
|
border: 1px solid var(--ui-border, #e5e7eb);
|
package/layout/index.cjs
CHANGED
|
@@ -151,6 +151,85 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
151
151
|
this.setPrimitiveAttribute("gutters", value);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
+
class UISwitcherElement extends UILayoutElement {
|
|
155
|
+
static get observedAttributes() {
|
|
156
|
+
return ["gap", "threshold", "align"];
|
|
157
|
+
}
|
|
158
|
+
get gap() {
|
|
159
|
+
return this.getPrimitiveAttribute("gap");
|
|
160
|
+
}
|
|
161
|
+
set gap(value) {
|
|
162
|
+
this.setPrimitiveAttribute("gap", value);
|
|
163
|
+
}
|
|
164
|
+
get threshold() {
|
|
165
|
+
return this.getPrimitiveAttribute("threshold");
|
|
166
|
+
}
|
|
167
|
+
set threshold(value) {
|
|
168
|
+
this.setPrimitiveAttribute("threshold", value);
|
|
169
|
+
}
|
|
170
|
+
get align() {
|
|
171
|
+
return this.getPrimitiveAttribute("align");
|
|
172
|
+
}
|
|
173
|
+
set align(value) {
|
|
174
|
+
this.setPrimitiveAttribute("align", value);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class UISidebarElement extends UILayoutElement {
|
|
178
|
+
static get observedAttributes() {
|
|
179
|
+
return ["gap", "side", "width", "align"];
|
|
180
|
+
}
|
|
181
|
+
get gap() {
|
|
182
|
+
return this.getPrimitiveAttribute("gap");
|
|
183
|
+
}
|
|
184
|
+
set gap(value) {
|
|
185
|
+
this.setPrimitiveAttribute("gap", value);
|
|
186
|
+
}
|
|
187
|
+
get side() {
|
|
188
|
+
return this.getPrimitiveAttribute("side");
|
|
189
|
+
}
|
|
190
|
+
set side(value) {
|
|
191
|
+
this.setPrimitiveAttribute("side", value);
|
|
192
|
+
}
|
|
193
|
+
get width() {
|
|
194
|
+
return this.getPrimitiveAttribute("width");
|
|
195
|
+
}
|
|
196
|
+
set width(value) {
|
|
197
|
+
this.setPrimitiveAttribute("width", value);
|
|
198
|
+
}
|
|
199
|
+
get align() {
|
|
200
|
+
return this.getPrimitiveAttribute("align");
|
|
201
|
+
}
|
|
202
|
+
set align(value) {
|
|
203
|
+
this.setPrimitiveAttribute("align", value);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
class UIReelElement extends UILayoutElement {
|
|
207
|
+
static get observedAttributes() {
|
|
208
|
+
return ["gap", "item-width", "snap"];
|
|
209
|
+
}
|
|
210
|
+
connectedCallback() {
|
|
211
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "region");
|
|
212
|
+
if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
213
|
+
}
|
|
214
|
+
get gap() {
|
|
215
|
+
return this.getPrimitiveAttribute("gap");
|
|
216
|
+
}
|
|
217
|
+
set gap(value) {
|
|
218
|
+
this.setPrimitiveAttribute("gap", value);
|
|
219
|
+
}
|
|
220
|
+
get itemWidth() {
|
|
221
|
+
return this.getPrimitiveAttribute("item-width");
|
|
222
|
+
}
|
|
223
|
+
set itemWidth(value) {
|
|
224
|
+
this.setPrimitiveAttribute("item-width", value);
|
|
225
|
+
}
|
|
226
|
+
get snap() {
|
|
227
|
+
return this.getPrimitiveAttribute("snap");
|
|
228
|
+
}
|
|
229
|
+
set snap(value) {
|
|
230
|
+
this.setPrimitiveAttribute("snap", value);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
154
233
|
class UISeparatorElement extends UILayoutElement {
|
|
155
234
|
static get observedAttributes() {
|
|
156
235
|
return ["orientation", "role"];
|
|
@@ -191,6 +270,9 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
191
270
|
["ui-cluster", UIClusterElement],
|
|
192
271
|
["ui-grid", UIGridElement],
|
|
193
272
|
["ui-center", UICenterElement],
|
|
273
|
+
["ui-switcher", UISwitcherElement],
|
|
274
|
+
["ui-sidebar", UISidebarElement],
|
|
275
|
+
["ui-reel", UIReelElement],
|
|
194
276
|
["ui-separator", UISeparatorElement]
|
|
195
277
|
];
|
|
196
278
|
for (const [tag, constructor] of definitions) {
|
package/layout/index.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* src/layout.css */
|
|
2
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator),
|
|
3
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *,
|
|
4
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::before,
|
|
5
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) *::after {
|
|
2
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator),
|
|
3
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator) *,
|
|
4
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator) *::before,
|
|
5
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator) *::after {
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
}
|
|
8
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator) {
|
|
9
|
-
all: revert;
|
|
8
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator) {
|
|
9
|
+
all: revert-layer;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
margin: 0;
|
|
12
12
|
font-family: var(--ui-font-family-sans);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
line-height: var(--ui-line-height-md);
|
|
15
15
|
color: var(--ui-text-primary);
|
|
16
16
|
}
|
|
17
|
-
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-separator)[data-ui-inherit-typography] {
|
|
17
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator)[data-ui-inherit-typography] {
|
|
18
18
|
font-family: inherit;
|
|
19
19
|
font-size: inherit;
|
|
20
20
|
line-height: inherit;
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
font-variation-settings: inherit;
|
|
29
29
|
}
|
|
30
30
|
@layer components {
|
|
31
|
+
:where(ui-stack, ui-inline, ui-cluster, ui-grid, ui-center, ui-switcher, ui-sidebar, ui-reel, ui-separator) {
|
|
32
|
+
min-inline-size: 0;
|
|
33
|
+
max-inline-size: 100%;
|
|
34
|
+
}
|
|
31
35
|
ui-stack {
|
|
32
36
|
--ui-layout-gap: var(--ui-space-4, 1rem);
|
|
33
37
|
--ui-layout-align: stretch;
|
|
@@ -102,7 +106,7 @@
|
|
|
102
106
|
--ui-grid-min: 16rem;
|
|
103
107
|
display: grid;
|
|
104
108
|
gap: var(--ui-grid-gap);
|
|
105
|
-
grid-template-columns: repeat(auto-fit, minmax(var(--ui-grid-min), 1fr));
|
|
109
|
+
grid-template-columns: repeat(auto-fit, minmax(min(var(--ui-grid-min), 100%), 1fr));
|
|
106
110
|
}
|
|
107
111
|
ui-grid[gap=xs] {
|
|
108
112
|
--ui-grid-gap: var(--ui-space-2, 0.5rem);
|
|
@@ -129,6 +133,7 @@
|
|
|
129
133
|
--ui-center-measure: 65ch;
|
|
130
134
|
--ui-center-gutters: var(--ui-space-4, 1rem);
|
|
131
135
|
display: block;
|
|
136
|
+
inline-size: 100%;
|
|
132
137
|
max-inline-size: var(--ui-center-measure);
|
|
133
138
|
margin-inline: auto;
|
|
134
139
|
padding-inline: var(--ui-center-gutters);
|
|
@@ -148,6 +153,158 @@
|
|
|
148
153
|
ui-center[gutters=l] {
|
|
149
154
|
--ui-center-gutters: var(--ui-space-5, 1.5rem);
|
|
150
155
|
}
|
|
156
|
+
ui-switcher {
|
|
157
|
+
--ui-switcher-gap: var(--ui-space-4, 1rem);
|
|
158
|
+
--ui-switcher-threshold: 30rem;
|
|
159
|
+
--ui-switcher-align: stretch;
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-wrap: wrap;
|
|
162
|
+
gap: var(--ui-switcher-gap);
|
|
163
|
+
align-items: var(--ui-switcher-align);
|
|
164
|
+
}
|
|
165
|
+
ui-switcher > * {
|
|
166
|
+
min-inline-size: 0;
|
|
167
|
+
flex-grow: 1;
|
|
168
|
+
flex-basis: calc((var(--ui-switcher-threshold) - 100%) * 999);
|
|
169
|
+
}
|
|
170
|
+
ui-switcher[gap=xs] {
|
|
171
|
+
--ui-switcher-gap: var(--ui-space-2, 0.5rem);
|
|
172
|
+
}
|
|
173
|
+
ui-switcher[gap=s] {
|
|
174
|
+
--ui-switcher-gap: var(--ui-space-3, 0.75rem);
|
|
175
|
+
}
|
|
176
|
+
ui-switcher[gap=m] {
|
|
177
|
+
--ui-switcher-gap: var(--ui-space-4, 1rem);
|
|
178
|
+
}
|
|
179
|
+
ui-switcher[gap=l] {
|
|
180
|
+
--ui-switcher-gap: var(--ui-space-5, 1.5rem);
|
|
181
|
+
}
|
|
182
|
+
ui-switcher[threshold=xs] {
|
|
183
|
+
--ui-switcher-threshold: 20rem;
|
|
184
|
+
}
|
|
185
|
+
ui-switcher[threshold=sm] {
|
|
186
|
+
--ui-switcher-threshold: 30rem;
|
|
187
|
+
}
|
|
188
|
+
ui-switcher[threshold=md] {
|
|
189
|
+
--ui-switcher-threshold: 45rem;
|
|
190
|
+
}
|
|
191
|
+
ui-switcher[threshold=lg] {
|
|
192
|
+
--ui-switcher-threshold: 60rem;
|
|
193
|
+
}
|
|
194
|
+
ui-switcher[align=start] {
|
|
195
|
+
--ui-switcher-align: flex-start;
|
|
196
|
+
}
|
|
197
|
+
ui-switcher[align=center] {
|
|
198
|
+
--ui-switcher-align: center;
|
|
199
|
+
}
|
|
200
|
+
ui-switcher[align=end] {
|
|
201
|
+
--ui-switcher-align: flex-end;
|
|
202
|
+
}
|
|
203
|
+
ui-sidebar {
|
|
204
|
+
--ui-sidebar-gap: var(--ui-space-4, 1rem);
|
|
205
|
+
--ui-sidebar-width: 18rem;
|
|
206
|
+
--ui-sidebar-content-min: 50%;
|
|
207
|
+
--ui-sidebar-align: stretch;
|
|
208
|
+
display: flex;
|
|
209
|
+
flex-wrap: wrap;
|
|
210
|
+
gap: var(--ui-sidebar-gap);
|
|
211
|
+
align-items: var(--ui-sidebar-align);
|
|
212
|
+
}
|
|
213
|
+
ui-sidebar > * {
|
|
214
|
+
min-inline-size: 0;
|
|
215
|
+
}
|
|
216
|
+
ui-sidebar > :first-child {
|
|
217
|
+
flex-basis: var(--ui-sidebar-width);
|
|
218
|
+
flex-grow: 1;
|
|
219
|
+
}
|
|
220
|
+
ui-sidebar > :last-child {
|
|
221
|
+
flex-basis: 0;
|
|
222
|
+
flex-grow: 999;
|
|
223
|
+
min-inline-size: min(var(--ui-sidebar-content-min), 100%);
|
|
224
|
+
}
|
|
225
|
+
ui-sidebar[side=end] > :first-child {
|
|
226
|
+
flex-basis: 0;
|
|
227
|
+
flex-grow: 999;
|
|
228
|
+
min-inline-size: min(var(--ui-sidebar-content-min), 100%);
|
|
229
|
+
}
|
|
230
|
+
ui-sidebar[side=end] > :last-child {
|
|
231
|
+
flex-basis: var(--ui-sidebar-width);
|
|
232
|
+
flex-grow: 1;
|
|
233
|
+
min-inline-size: 0;
|
|
234
|
+
}
|
|
235
|
+
ui-sidebar[gap=xs] {
|
|
236
|
+
--ui-sidebar-gap: var(--ui-space-2, 0.5rem);
|
|
237
|
+
}
|
|
238
|
+
ui-sidebar[gap=s] {
|
|
239
|
+
--ui-sidebar-gap: var(--ui-space-3, 0.75rem);
|
|
240
|
+
}
|
|
241
|
+
ui-sidebar[gap=m] {
|
|
242
|
+
--ui-sidebar-gap: var(--ui-space-4, 1rem);
|
|
243
|
+
}
|
|
244
|
+
ui-sidebar[gap=l] {
|
|
245
|
+
--ui-sidebar-gap: var(--ui-space-5, 1.5rem);
|
|
246
|
+
}
|
|
247
|
+
ui-sidebar[width=narrow] {
|
|
248
|
+
--ui-sidebar-width: 14rem;
|
|
249
|
+
}
|
|
250
|
+
ui-sidebar[width=wide] {
|
|
251
|
+
--ui-sidebar-width: 24rem;
|
|
252
|
+
}
|
|
253
|
+
ui-sidebar[align=start] {
|
|
254
|
+
--ui-sidebar-align: flex-start;
|
|
255
|
+
}
|
|
256
|
+
ui-sidebar[align=center] {
|
|
257
|
+
--ui-sidebar-align: center;
|
|
258
|
+
}
|
|
259
|
+
ui-sidebar[align=end] {
|
|
260
|
+
--ui-sidebar-align: flex-end;
|
|
261
|
+
}
|
|
262
|
+
ui-reel {
|
|
263
|
+
--ui-reel-gap: var(--ui-space-4, 1rem);
|
|
264
|
+
--ui-reel-item-width: auto;
|
|
265
|
+
display: flex;
|
|
266
|
+
inline-size: 100%;
|
|
267
|
+
gap: var(--ui-reel-gap);
|
|
268
|
+
overflow-x: auto;
|
|
269
|
+
overflow-y: hidden;
|
|
270
|
+
overscroll-behavior-inline: contain;
|
|
271
|
+
-webkit-overflow-scrolling: touch;
|
|
272
|
+
}
|
|
273
|
+
ui-reel > * {
|
|
274
|
+
min-inline-size: 0;
|
|
275
|
+
flex: 0 0 var(--ui-reel-item-width);
|
|
276
|
+
}
|
|
277
|
+
ui-reel[gap=xs] {
|
|
278
|
+
--ui-reel-gap: var(--ui-space-2, 0.5rem);
|
|
279
|
+
}
|
|
280
|
+
ui-reel[gap=s] {
|
|
281
|
+
--ui-reel-gap: var(--ui-space-3, 0.75rem);
|
|
282
|
+
}
|
|
283
|
+
ui-reel[gap=m] {
|
|
284
|
+
--ui-reel-gap: var(--ui-space-4, 1rem);
|
|
285
|
+
}
|
|
286
|
+
ui-reel[gap=l] {
|
|
287
|
+
--ui-reel-gap: var(--ui-space-5, 1.5rem);
|
|
288
|
+
}
|
|
289
|
+
ui-reel[item-width=sm] {
|
|
290
|
+
--ui-reel-item-width: 12rem;
|
|
291
|
+
}
|
|
292
|
+
ui-reel[item-width=md] {
|
|
293
|
+
--ui-reel-item-width: 16rem;
|
|
294
|
+
}
|
|
295
|
+
ui-reel[item-width=lg] {
|
|
296
|
+
--ui-reel-item-width: 20rem;
|
|
297
|
+
}
|
|
298
|
+
ui-reel[snap=start],
|
|
299
|
+
ui-reel[snap=center] {
|
|
300
|
+
scroll-snap-type: inline mandatory;
|
|
301
|
+
}
|
|
302
|
+
ui-reel[snap=start] > * {
|
|
303
|
+
scroll-snap-align: start;
|
|
304
|
+
}
|
|
305
|
+
ui-reel[snap=center] > * {
|
|
306
|
+
scroll-snap-align: center;
|
|
307
|
+
}
|
|
151
308
|
ui-separator {
|
|
152
309
|
--ui-separator-color: var(--ui-border-default, #d0d5dd);
|
|
153
310
|
--ui-separator-space: var(--ui-space-4, 1rem);
|
package/layout/index.js
CHANGED
|
@@ -127,6 +127,85 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
127
127
|
this.setPrimitiveAttribute("gutters", value);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
+
class UISwitcherElement extends UILayoutElement {
|
|
131
|
+
static get observedAttributes() {
|
|
132
|
+
return ["gap", "threshold", "align"];
|
|
133
|
+
}
|
|
134
|
+
get gap() {
|
|
135
|
+
return this.getPrimitiveAttribute("gap");
|
|
136
|
+
}
|
|
137
|
+
set gap(value) {
|
|
138
|
+
this.setPrimitiveAttribute("gap", value);
|
|
139
|
+
}
|
|
140
|
+
get threshold() {
|
|
141
|
+
return this.getPrimitiveAttribute("threshold");
|
|
142
|
+
}
|
|
143
|
+
set threshold(value) {
|
|
144
|
+
this.setPrimitiveAttribute("threshold", value);
|
|
145
|
+
}
|
|
146
|
+
get align() {
|
|
147
|
+
return this.getPrimitiveAttribute("align");
|
|
148
|
+
}
|
|
149
|
+
set align(value) {
|
|
150
|
+
this.setPrimitiveAttribute("align", value);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
class UISidebarElement extends UILayoutElement {
|
|
154
|
+
static get observedAttributes() {
|
|
155
|
+
return ["gap", "side", "width", "align"];
|
|
156
|
+
}
|
|
157
|
+
get gap() {
|
|
158
|
+
return this.getPrimitiveAttribute("gap");
|
|
159
|
+
}
|
|
160
|
+
set gap(value) {
|
|
161
|
+
this.setPrimitiveAttribute("gap", value);
|
|
162
|
+
}
|
|
163
|
+
get side() {
|
|
164
|
+
return this.getPrimitiveAttribute("side");
|
|
165
|
+
}
|
|
166
|
+
set side(value) {
|
|
167
|
+
this.setPrimitiveAttribute("side", value);
|
|
168
|
+
}
|
|
169
|
+
get width() {
|
|
170
|
+
return this.getPrimitiveAttribute("width");
|
|
171
|
+
}
|
|
172
|
+
set width(value) {
|
|
173
|
+
this.setPrimitiveAttribute("width", value);
|
|
174
|
+
}
|
|
175
|
+
get align() {
|
|
176
|
+
return this.getPrimitiveAttribute("align");
|
|
177
|
+
}
|
|
178
|
+
set align(value) {
|
|
179
|
+
this.setPrimitiveAttribute("align", value);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
class UIReelElement extends UILayoutElement {
|
|
183
|
+
static get observedAttributes() {
|
|
184
|
+
return ["gap", "item-width", "snap"];
|
|
185
|
+
}
|
|
186
|
+
connectedCallback() {
|
|
187
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "region");
|
|
188
|
+
if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
|
|
189
|
+
}
|
|
190
|
+
get gap() {
|
|
191
|
+
return this.getPrimitiveAttribute("gap");
|
|
192
|
+
}
|
|
193
|
+
set gap(value) {
|
|
194
|
+
this.setPrimitiveAttribute("gap", value);
|
|
195
|
+
}
|
|
196
|
+
get itemWidth() {
|
|
197
|
+
return this.getPrimitiveAttribute("item-width");
|
|
198
|
+
}
|
|
199
|
+
set itemWidth(value) {
|
|
200
|
+
this.setPrimitiveAttribute("item-width", value);
|
|
201
|
+
}
|
|
202
|
+
get snap() {
|
|
203
|
+
return this.getPrimitiveAttribute("snap");
|
|
204
|
+
}
|
|
205
|
+
set snap(value) {
|
|
206
|
+
this.setPrimitiveAttribute("snap", value);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
130
209
|
class UISeparatorElement extends UILayoutElement {
|
|
131
210
|
static get observedAttributes() {
|
|
132
211
|
return ["orientation", "role"];
|
|
@@ -167,6 +246,9 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
167
246
|
["ui-cluster", UIClusterElement],
|
|
168
247
|
["ui-grid", UIGridElement],
|
|
169
248
|
["ui-center", UICenterElement],
|
|
249
|
+
["ui-switcher", UISwitcherElement],
|
|
250
|
+
["ui-sidebar", UISidebarElement],
|
|
251
|
+
["ui-reel", UIReelElement],
|
|
170
252
|
["ui-separator", UISeparatorElement]
|
|
171
253
|
];
|
|
172
254
|
for (const [tag, constructor] of definitions) {
|