@mcurcio/patchbay 0.6.0 → 0.7.0
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/README.md +2 -1
- package/dist/composites.js +190 -158
- package/dist/composites.js.map +1 -1
- package/dist/graph.js +70 -67
- package/dist/graph.js.map +1 -1
- package/dist/primitives.css +1 -1
- package/dist/primitives.js +108 -93
- package/dist/primitives.js.map +1 -1
- package/dist/testing.js +207 -0
- package/dist/testing.js.map +1 -0
- package/dist/types/composites/banner/Banner.d.ts +9 -3
- package/dist/types/composites/banner/index.d.ts +2 -2
- package/dist/types/composites/command-palette/CommandPalette.d.ts +16 -10
- package/dist/types/composites/command-palette/index.d.ts +2 -2
- package/dist/types/composites/shortcut-sheet/ShortcutSheet.d.ts +17 -11
- package/dist/types/composites/shortcut-sheet/index.d.ts +2 -2
- package/dist/types/composites/toaster/Toaster.d.ts +15 -9
- package/dist/types/composites/toaster/index.d.ts +2 -2
- package/dist/types/graph/meter/Meter.d.ts +9 -3
- package/dist/types/graph/meter/index.d.ts +2 -2
- package/dist/types/graph/node-box/NodeBox.d.ts +7 -8
- package/dist/types/graph/node-box/index.d.ts +2 -2
- package/dist/types/primitives/dialog/Dialog.d.ts +8 -2
- package/dist/types/primitives/dialog/index.d.ts +2 -2
- package/dist/types/primitives/sheet/Sheet.d.ts +8 -2
- package/dist/types/primitives/sheet/index.d.ts +2 -2
- package/dist/types/primitives/splitter/Splitter.d.ts +8 -2
- package/dist/types/primitives/splitter/splitter-math.d.ts +12 -4
- package/dist/types/testing/brand-css.d.ts +41 -0
- package/dist/types/testing/contrast.d.ts +36 -0
- package/dist/types/testing/index.d.ts +2 -0
- package/package.json +5 -1
package/dist/primitives.js
CHANGED
|
@@ -125,28 +125,31 @@ function _() {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
// src/primitives/dialog/Dialog.tsx
|
|
128
|
-
var v = "a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex='-1']),[contenteditable='true']";
|
|
129
|
-
function y(e) {
|
|
130
|
-
return [...e.querySelectorAll(v)].filter((e) => e.closest("[hidden], [inert]") === null && e.tabIndex >= 0);
|
|
131
|
-
}
|
|
128
|
+
var v = { close: "Close" }, y = "a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex='-1']),[contenteditable='true']";
|
|
132
129
|
function b(e) {
|
|
130
|
+
return [...e.querySelectorAll(y)].filter((e) => e.closest("[hidden], [inert]") === null && e.tabIndex >= 0);
|
|
131
|
+
}
|
|
132
|
+
function x(e) {
|
|
133
133
|
let t = e.ownerDocument.querySelectorAll(".pb-dialog");
|
|
134
134
|
return t[t.length - 1] === e;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let d =
|
|
136
|
+
function S({ onClose: e, title: r, children: i, actions: a, labels: c, className: u }) {
|
|
137
|
+
let d = {
|
|
138
|
+
...v,
|
|
139
|
+
...c
|
|
140
|
+
}, f = l(null), p = l(null), m = s(), h = l(e);
|
|
138
141
|
return o(() => {
|
|
139
|
-
|
|
142
|
+
h.current = e;
|
|
140
143
|
}, [e]), o(() => {
|
|
141
|
-
let e =
|
|
144
|
+
let e = f.current;
|
|
142
145
|
if (e === null) return;
|
|
143
146
|
let t = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
144
147
|
if (!e.contains(document.activeElement)) {
|
|
145
|
-
let t =
|
|
146
|
-
(t === null ? void 0 :
|
|
148
|
+
let t = p.current;
|
|
149
|
+
(t === null ? void 0 : b(t)[0])?.focus(), e.contains(document.activeElement) || e.focus();
|
|
147
150
|
}
|
|
148
151
|
let n = (t) => {
|
|
149
|
-
|
|
152
|
+
x(e) && (t.target instanceof Node && e.contains(t.target) || (b(e)[0] ?? e).focus());
|
|
150
153
|
};
|
|
151
154
|
return document.addEventListener("focusin", n), () => {
|
|
152
155
|
document.removeEventListener("focusin", n), t?.isConnected === !0 && t.focus();
|
|
@@ -154,48 +157,48 @@ function x({ onClose: e, title: r, children: i, actions: a, closeLabel: c = "Clo
|
|
|
154
157
|
}, []), /* @__PURE__ */ t("div", {
|
|
155
158
|
className: "pb-dialog-scrim",
|
|
156
159
|
onMouseDown: (e) => {
|
|
157
|
-
e.target === e.currentTarget &&
|
|
160
|
+
e.target === e.currentTarget && h.current();
|
|
158
161
|
},
|
|
159
162
|
children: /* @__PURE__ */ n("div", {
|
|
160
|
-
ref:
|
|
163
|
+
ref: f,
|
|
161
164
|
className: u === void 0 ? "pb-dialog" : `pb-dialog ${u}`,
|
|
162
165
|
role: "dialog",
|
|
163
166
|
"aria-modal": "true",
|
|
164
|
-
"aria-labelledby":
|
|
167
|
+
"aria-labelledby": m,
|
|
165
168
|
tabIndex: -1,
|
|
166
169
|
onKeyDown: (e) => {
|
|
167
170
|
if (e.defaultPrevented) return;
|
|
168
171
|
if (e.key === "Escape") {
|
|
169
|
-
e.preventDefault(), e.stopPropagation(),
|
|
172
|
+
e.preventDefault(), e.stopPropagation(), h.current();
|
|
170
173
|
return;
|
|
171
174
|
}
|
|
172
|
-
if (e.key !== "Tab" ||
|
|
173
|
-
let t =
|
|
175
|
+
if (e.key !== "Tab" || f.current === null) return;
|
|
176
|
+
let t = b(f.current), n = t[0], r = t[t.length - 1];
|
|
174
177
|
if (n === void 0 || r === void 0) {
|
|
175
178
|
e.preventDefault();
|
|
176
179
|
return;
|
|
177
180
|
}
|
|
178
181
|
let i = document.activeElement;
|
|
179
|
-
e.shiftKey && (i === n || i ===
|
|
182
|
+
e.shiftKey && (i === n || i === f.current) ? (e.preventDefault(), r.focus()) : !e.shiftKey && i === r && (e.preventDefault(), n.focus());
|
|
180
183
|
},
|
|
181
184
|
children: [
|
|
182
185
|
/* @__PURE__ */ n("div", {
|
|
183
186
|
className: "pb-dialog-head",
|
|
184
187
|
children: [/* @__PURE__ */ t("h2", {
|
|
185
188
|
className: "pb-dialog-title",
|
|
186
|
-
id:
|
|
189
|
+
id: m,
|
|
187
190
|
children: r
|
|
188
191
|
}), /* @__PURE__ */ t(g, {
|
|
189
192
|
className: "pb-dialog-close",
|
|
190
|
-
label:
|
|
193
|
+
label: d.close,
|
|
191
194
|
onClick: () => {
|
|
192
|
-
|
|
195
|
+
h.current();
|
|
193
196
|
},
|
|
194
197
|
children: /* @__PURE__ */ t(_, {})
|
|
195
198
|
})]
|
|
196
199
|
}),
|
|
197
200
|
/* @__PURE__ */ t("div", {
|
|
198
|
-
ref:
|
|
201
|
+
ref: p,
|
|
199
202
|
className: "pb-dialog-body",
|
|
200
203
|
tabIndex: 0,
|
|
201
204
|
children: i
|
|
@@ -208,15 +211,15 @@ function x({ onClose: e, title: r, children: i, actions: a, closeLabel: c = "Clo
|
|
|
208
211
|
})
|
|
209
212
|
});
|
|
210
213
|
}
|
|
211
|
-
function
|
|
212
|
-
return e ? u(/* @__PURE__ */ t(
|
|
214
|
+
function C({ open: e, ...n }) {
|
|
215
|
+
return e ? u(/* @__PURE__ */ t(S, { ...n }), document.body) : null;
|
|
213
216
|
}
|
|
214
217
|
// src/primitives/field/Field.tsx
|
|
215
|
-
function
|
|
218
|
+
function w(e) {
|
|
216
219
|
return e != null && e !== !1 && e !== "";
|
|
217
220
|
}
|
|
218
|
-
function
|
|
219
|
-
let f = s(), p = u, m = i(p) ? p.props : void 0, h = m?.id ?? `${f}-control`, g =
|
|
221
|
+
function T({ label: e, error: a, hint: o, layout: c = "stacked", className: l, children: u, ...d }) {
|
|
222
|
+
let f = s(), p = u, m = i(p) ? p.props : void 0, h = m?.id ?? `${f}-control`, g = w(o) ? `${f}-hint` : void 0, _ = w(a) ? `${f}-error` : void 0, v = [
|
|
220
223
|
m?.["aria-describedby"],
|
|
221
224
|
g,
|
|
222
225
|
_
|
|
@@ -253,7 +256,7 @@ function w({ label: e, error: a, hint: o, layout: c = "stacked", className: l, c
|
|
|
253
256
|
});
|
|
254
257
|
}
|
|
255
258
|
// src/primitives/key-value/KeyValue.tsx
|
|
256
|
-
function
|
|
259
|
+
function E({ rows: e, label: r, className: i }) {
|
|
257
260
|
return /* @__PURE__ */ t("dl", {
|
|
258
261
|
className: i === void 0 ? "pb-key-value" : `pb-key-value ${i}`,
|
|
259
262
|
"aria-label": r,
|
|
@@ -268,7 +271,7 @@ function T({ rows: e, label: r, className: i }) {
|
|
|
268
271
|
});
|
|
269
272
|
}
|
|
270
273
|
// src/primitives/panel/scroll-focus.ts
|
|
271
|
-
function
|
|
274
|
+
function ee(e) {
|
|
272
275
|
return e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth;
|
|
273
276
|
}
|
|
274
277
|
function D(e) {
|
|
@@ -276,7 +279,7 @@ function D(e) {
|
|
|
276
279
|
let t = e.current;
|
|
277
280
|
if (t === null) return;
|
|
278
281
|
let n = () => {
|
|
279
|
-
|
|
282
|
+
ee(t) ? t.tabIndex = 0 : t.removeAttribute("tabindex");
|
|
280
283
|
};
|
|
281
284
|
n();
|
|
282
285
|
let r = typeof ResizeObserver == "function" ? new ResizeObserver(n) : null, i = () => {
|
|
@@ -426,40 +429,44 @@ function N({ font: e = "ui", className: n, children: r, ...i }) {
|
|
|
426
429
|
});
|
|
427
430
|
}
|
|
428
431
|
// src/primitives/sheet/Sheet.tsx
|
|
429
|
-
|
|
430
|
-
|
|
432
|
+
var P = { close: "Close" };
|
|
433
|
+
function F({ onClose: e, side: r = "right", title: i, label: a, children: c, width: u, labels: d, className: f }) {
|
|
434
|
+
let p = {
|
|
435
|
+
...P,
|
|
436
|
+
...d
|
|
437
|
+
}, m = l(null), h = s(), v = l(null);
|
|
431
438
|
o(() => {
|
|
432
|
-
let e =
|
|
439
|
+
let e = m.current;
|
|
433
440
|
return () => {
|
|
434
|
-
let t =
|
|
441
|
+
let t = v.current, n = document.activeElement;
|
|
435
442
|
(n === null || n === document.body || (e?.contains(n) ?? !1)) && t?.isConnected === !0 && t.focus();
|
|
436
443
|
};
|
|
437
444
|
}, []);
|
|
438
|
-
let
|
|
445
|
+
let y = (e) => {
|
|
439
446
|
let t = e.relatedTarget;
|
|
440
|
-
t instanceof HTMLElement && !e.currentTarget.contains(t) && (
|
|
441
|
-
},
|
|
447
|
+
t instanceof HTMLElement && !e.currentTarget.contains(t) && (v.current = t);
|
|
448
|
+
}, b = (t) => {
|
|
442
449
|
t.defaultPrevented || t.key !== "Escape" || (t.preventDefault(), t.stopPropagation(), e());
|
|
443
|
-
},
|
|
450
|
+
}, x = u === void 0 ? void 0 : { "--pb-sheet-width": `${u}px` };
|
|
444
451
|
return /* @__PURE__ */ n("section", {
|
|
445
|
-
ref:
|
|
452
|
+
ref: m,
|
|
446
453
|
className: f === void 0 ? "pb-sheet" : `pb-sheet ${f}`,
|
|
447
454
|
"data-side": r,
|
|
448
455
|
role: "dialog",
|
|
449
|
-
"aria-labelledby": i === void 0 ? void 0 :
|
|
456
|
+
"aria-labelledby": i === void 0 ? void 0 : h,
|
|
450
457
|
"aria-label": i === void 0 ? a : void 0,
|
|
451
|
-
style:
|
|
452
|
-
onFocus:
|
|
453
|
-
onKeyDown:
|
|
458
|
+
style: x,
|
|
459
|
+
onFocus: y,
|
|
460
|
+
onKeyDown: b,
|
|
454
461
|
children: [/* @__PURE__ */ n("div", {
|
|
455
462
|
className: "pb-sheet-head",
|
|
456
463
|
children: [i === void 0 ? /* @__PURE__ */ t("span", { className: "pb-sheet-title" }) : /* @__PURE__ */ t("h2", {
|
|
457
464
|
className: "pb-sheet-title",
|
|
458
|
-
id:
|
|
465
|
+
id: h,
|
|
459
466
|
children: i
|
|
460
467
|
}), /* @__PURE__ */ t(g, {
|
|
461
468
|
className: "pb-sheet-close",
|
|
462
|
-
label:
|
|
469
|
+
label: p.close,
|
|
463
470
|
onClick: e,
|
|
464
471
|
children: /* @__PURE__ */ t(_, {})
|
|
465
472
|
})]
|
|
@@ -470,52 +477,60 @@ function P({ onClose: e, side: r = "right", title: i, label: a, children: c, wid
|
|
|
470
477
|
})]
|
|
471
478
|
});
|
|
472
479
|
}
|
|
473
|
-
function
|
|
474
|
-
return e ? /* @__PURE__ */ t(
|
|
480
|
+
function I({ open: e, ...n }) {
|
|
481
|
+
return e ? /* @__PURE__ */ t(F, { ...n }) : null;
|
|
475
482
|
}
|
|
476
483
|
// src/primitives/splitter/splitter-math.ts
|
|
477
|
-
function
|
|
484
|
+
function L(e, t) {
|
|
478
485
|
let n = Math.max(t.min, t.max);
|
|
479
486
|
return Math.round(Math.min(n, Math.max(t.min, e)));
|
|
480
487
|
}
|
|
481
|
-
function
|
|
482
|
-
return
|
|
488
|
+
function R(e, t, n, r) {
|
|
489
|
+
return L(e + n * t, r);
|
|
483
490
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
491
|
+
function z(e, t, n) {
|
|
492
|
+
let r = t === "start" ? -1 : 1;
|
|
493
|
+
return e === "vertical" && n === "rtl" ? -r : r;
|
|
486
494
|
}
|
|
487
|
-
|
|
495
|
+
function B(e, t, n) {
|
|
496
|
+
return e === "vertical" ? z(e, t, n) === -1 ? "ArrowLeft" : "ArrowRight" : t === "start" ? "ArrowUp" : "ArrowDown";
|
|
497
|
+
}
|
|
498
|
+
var V = {
|
|
488
499
|
ArrowLeft: "ArrowRight",
|
|
489
500
|
ArrowRight: "ArrowLeft",
|
|
490
501
|
ArrowUp: "ArrowDown",
|
|
491
502
|
ArrowDown: "ArrowUp"
|
|
492
503
|
};
|
|
493
|
-
function
|
|
494
|
-
if (t === n) return
|
|
495
|
-
if (t ===
|
|
496
|
-
if (t === "Home") return
|
|
497
|
-
if (t === "End") return
|
|
504
|
+
function H(e, t, n, r, i) {
|
|
505
|
+
if (t === n) return L(e + r, i);
|
|
506
|
+
if (t === V[n]) return L(e - r, i);
|
|
507
|
+
if (t === "Home") return L(i.min, i);
|
|
508
|
+
if (t === "End") return L(i.max, i);
|
|
498
509
|
}
|
|
499
510
|
// src/primitives/splitter/Splitter.tsx
|
|
500
|
-
function
|
|
511
|
+
function U(e) {
|
|
512
|
+
return getComputedStyle(e).direction === "rtl" ? "rtl" : "ltr";
|
|
513
|
+
}
|
|
514
|
+
function W({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, edge: s = "start", step: c = 16, className: u, onPointerDown: d, onPointerMove: f, onPointerUp: p, onPointerCancel: m, onKeyDown: h, ...g }) {
|
|
501
515
|
let _ = l(null), v = {
|
|
502
516
|
min: r,
|
|
503
517
|
max: i
|
|
504
518
|
}, y = (t) => e === "vertical" ? t.clientX : t.clientY;
|
|
505
|
-
function b(
|
|
506
|
-
if (d?.(
|
|
507
|
-
|
|
508
|
-
let
|
|
509
|
-
typeof
|
|
519
|
+
function b(t) {
|
|
520
|
+
if (d?.(t), t.defaultPrevented || t.button !== 0) return;
|
|
521
|
+
t.preventDefault();
|
|
522
|
+
let r = t.currentTarget;
|
|
523
|
+
typeof r.setPointerCapture == "function" && r.setPointerCapture(t.pointerId), r.focus(), r.dataset.dragging = "", _.current = {
|
|
510
524
|
start: n,
|
|
511
|
-
at: y(
|
|
525
|
+
at: y(t),
|
|
526
|
+
sign: z(e, s, U(r))
|
|
512
527
|
};
|
|
513
528
|
}
|
|
514
529
|
function x(e) {
|
|
515
530
|
f?.(e);
|
|
516
531
|
let t = _.current;
|
|
517
532
|
if (t === null) return;
|
|
518
|
-
let r =
|
|
533
|
+
let r = R(t.start, y(e) - t.at, t.sign, v);
|
|
519
534
|
r !== n && a(r);
|
|
520
535
|
}
|
|
521
536
|
function S(e) {
|
|
@@ -526,7 +541,7 @@ function V({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, ed
|
|
|
526
541
|
}
|
|
527
542
|
function C(t) {
|
|
528
543
|
if (h?.(t), t.defaultPrevented || t.altKey || t.ctrlKey || t.metaKey) return;
|
|
529
|
-
let r =
|
|
544
|
+
let r = H(n, t.key, B(e, s, U(t.currentTarget)), c, v);
|
|
530
545
|
r !== void 0 && (t.preventDefault(), r !== n && a(r));
|
|
531
546
|
}
|
|
532
547
|
return /* @__PURE__ */ t("div", {
|
|
@@ -549,7 +564,7 @@ function V({ orientation: e, value: n, min: r, max: i, onChange: a, label: o, ed
|
|
|
549
564
|
});
|
|
550
565
|
}
|
|
551
566
|
// src/primitives/text-input/TextInput.tsx
|
|
552
|
-
function
|
|
567
|
+
function G({ font: e = "ui", type: n = "text", className: r, ...i }) {
|
|
553
568
|
return /* @__PURE__ */ t("input", {
|
|
554
569
|
...i,
|
|
555
570
|
type: n,
|
|
@@ -558,38 +573,38 @@ function H({ font: e = "ui", type: n = "text", className: r, ...i }) {
|
|
|
558
573
|
});
|
|
559
574
|
}
|
|
560
575
|
// src/primitives/theme-switch/ThemeSwitch.tsx
|
|
561
|
-
var
|
|
576
|
+
var K = {
|
|
562
577
|
theme: "Theme",
|
|
563
578
|
system: "system",
|
|
564
579
|
light: "light",
|
|
565
580
|
dark: "dark",
|
|
566
581
|
systemHint: "follows the system's setting",
|
|
567
582
|
clickFor: "click for"
|
|
568
|
-
},
|
|
583
|
+
}, q = [
|
|
569
584
|
"system",
|
|
570
585
|
"light",
|
|
571
586
|
"dark"
|
|
572
587
|
];
|
|
573
|
-
function
|
|
574
|
-
return
|
|
588
|
+
function J(e) {
|
|
589
|
+
return q[(q.indexOf(e) + 1) % q.length] ?? "system";
|
|
575
590
|
}
|
|
576
|
-
function
|
|
591
|
+
function Y(e, t = K) {
|
|
577
592
|
let n = e === "system" ? ` (${t.systemHint})` : "";
|
|
578
|
-
return `${t.theme}: ${t[e]}${n}; ${t.clickFor} ${t[
|
|
593
|
+
return `${t.theme}: ${t[e]}${n}; ${t.clickFor} ${t[J(e)]}`;
|
|
579
594
|
}
|
|
580
|
-
function
|
|
595
|
+
function X({ choice: e, onChoose: r, labels: i, className: a, ...o }) {
|
|
581
596
|
let s = {
|
|
582
|
-
...
|
|
597
|
+
...K,
|
|
583
598
|
...i
|
|
584
599
|
};
|
|
585
600
|
return /* @__PURE__ */ n("button", {
|
|
586
601
|
...o,
|
|
587
602
|
type: "button",
|
|
588
603
|
className: a === void 0 ? "pb-theme-switch" : `pb-theme-switch ${a}`,
|
|
589
|
-
title:
|
|
604
|
+
title: Y(e, s),
|
|
590
605
|
"aria-label": `${s.theme}: ${s[e]}`,
|
|
591
606
|
onClick: () => {
|
|
592
|
-
r(
|
|
607
|
+
r(J(e));
|
|
593
608
|
},
|
|
594
609
|
children: [/* @__PURE__ */ n("svg", {
|
|
595
610
|
className: "pb-theme-switch-icon",
|
|
@@ -615,16 +630,16 @@ function q({ choice: e, onChoose: r, labels: i, className: a, ...o }) {
|
|
|
615
630
|
});
|
|
616
631
|
}
|
|
617
632
|
// src/primitives/toolbar/roving.ts
|
|
618
|
-
var
|
|
619
|
-
function
|
|
620
|
-
return [...e.querySelectorAll(
|
|
633
|
+
var te = "button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [role=\"button\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"menuitem\"], [role=\"switch\"]";
|
|
634
|
+
function Z(e) {
|
|
635
|
+
return [...e.querySelectorAll(te)].filter((t) => t.closest("[role=\"toolbar\"]") === e);
|
|
621
636
|
}
|
|
622
|
-
function
|
|
637
|
+
function Q(e, t) {
|
|
623
638
|
let n = t !== null && e.includes(t) ? t : e[0] ?? null;
|
|
624
639
|
for (let t of e) t.tabIndex = t === n ? 0 : -1;
|
|
625
640
|
return n;
|
|
626
641
|
}
|
|
627
|
-
function
|
|
642
|
+
function ne(e, t, n, r, i) {
|
|
628
643
|
if (t === 0) return;
|
|
629
644
|
if (n === "Home") return 0;
|
|
630
645
|
if (n === "End") return t - 1;
|
|
@@ -632,7 +647,7 @@ function Z(e, t, n, r, i) {
|
|
|
632
647
|
if (n === o) return (e + 1) % t;
|
|
633
648
|
if (n === a) return (e - 1 + t) % t;
|
|
634
649
|
}
|
|
635
|
-
function
|
|
650
|
+
function re(e) {
|
|
636
651
|
return e instanceof HTMLTextAreaElement ? !0 : e instanceof HTMLInputElement ? ![
|
|
637
652
|
"button",
|
|
638
653
|
"checkbox",
|
|
@@ -652,7 +667,7 @@ function $({ label: e, orientation: n = "horizontal", className: r, ref: i, onKe
|
|
|
652
667
|
let e = d.current;
|
|
653
668
|
if (e === null) return;
|
|
654
669
|
let t = () => {
|
|
655
|
-
f.current =
|
|
670
|
+
f.current = Q(Z(e), f.current);
|
|
656
671
|
};
|
|
657
672
|
t();
|
|
658
673
|
let n = new MutationObserver(t);
|
|
@@ -669,16 +684,16 @@ function $({ label: e, orientation: n = "horizontal", className: r, ref: i, onKe
|
|
|
669
684
|
s?.(e);
|
|
670
685
|
let t = d.current;
|
|
671
686
|
if (t === null) return;
|
|
672
|
-
let n =
|
|
673
|
-
e.target instanceof HTMLElement && n.includes(e.target) && (f.current =
|
|
687
|
+
let n = Z(t);
|
|
688
|
+
e.target instanceof HTMLElement && n.includes(e.target) && (f.current = Q(n, e.target));
|
|
674
689
|
}
|
|
675
690
|
function m(e) {
|
|
676
691
|
a?.(e);
|
|
677
692
|
let t = d.current;
|
|
678
|
-
if (e.defaultPrevented || t === null || e.altKey || e.ctrlKey || e.metaKey ||
|
|
679
|
-
let r =
|
|
693
|
+
if (e.defaultPrevented || t === null || e.altKey || e.ctrlKey || e.metaKey || re(e.target)) return;
|
|
694
|
+
let r = Z(t), i = r.indexOf(e.target);
|
|
680
695
|
if (i === -1) return;
|
|
681
|
-
let o = getComputedStyle(t).direction === "rtl", s =
|
|
696
|
+
let o = getComputedStyle(t).direction === "rtl", s = ne(i, r.length, e.key, n, o);
|
|
682
697
|
s !== void 0 && (e.preventDefault(), r[s]?.focus());
|
|
683
698
|
}
|
|
684
699
|
return /* @__PURE__ */ t("div", {
|
|
@@ -697,14 +712,14 @@ function $({ label: e, orientation: n = "horizontal", className: r, ref: i, onKe
|
|
|
697
712
|
});
|
|
698
713
|
}
|
|
699
714
|
// src/primitives/tool-group/ToolGroup.tsx
|
|
700
|
-
function
|
|
715
|
+
function ie({ className: e, ...n }) {
|
|
701
716
|
return /* @__PURE__ */ t($, {
|
|
702
717
|
...n,
|
|
703
718
|
className: e === void 0 ? "pb-tool-group" : `pb-tool-group ${e}`
|
|
704
719
|
});
|
|
705
720
|
}
|
|
706
721
|
// src/primitives/warn-mark/WarnMark.tsx
|
|
707
|
-
function
|
|
722
|
+
function ae({ label: r, title: i, className: a }) {
|
|
708
723
|
return /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
709
724
|
className: a === void 0 ? "pb-warn-mark" : `pb-warn-mark ${a}`,
|
|
710
725
|
"aria-hidden": "true",
|
|
@@ -715,6 +730,6 @@ function te({ label: r, title: i, className: a }) {
|
|
|
715
730
|
children: r
|
|
716
731
|
})] });
|
|
717
732
|
}
|
|
718
|
-
export { d as Badge, p as Button, h as Checkbox,
|
|
733
|
+
export { d as Badge, p as Button, h as Checkbox, C as Dialog, T as Field, g as IconButton, E as KeyValue, O as Panel, k as Pill, j as RadioGroup, M as SectionTitle, N as Select, I as Sheet, f as Spinner, W as Splitter, G as TextInput, X as ThemeSwitch, ie as ToolGroup, $ as Toolbar, ae as WarnMark, v as defaultDialogLabels, P as defaultSheetLabels, K as defaultThemeSwitchLabels, Y as themeSwitchTitle };
|
|
719
734
|
|
|
720
735
|
//# sourceMappingURL=primitives.js.map
|