@fairfox/polly 0.88.1 → 0.89.1
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/cli/polly.js +4 -4
- package/dist/cli/polly.js.map +2 -2
- package/dist/gallery/gallery.css +53 -59
- package/dist/gallery/gallery.js +1240 -1073
- package/dist/src/actions/index.js +5 -78
- package/dist/src/actions/index.js.map +2 -2
- package/dist/src/background/index.js +126 -152
- package/dist/src/background/index.js.map +4 -4
- package/dist/src/background/message-router.js +126 -152
- package/dist/src/background/message-router.js.map +4 -4
- package/dist/src/client/index.js +186 -259
- package/dist/src/client/index.js.map +5 -5
- package/dist/src/elysia/index.js +21 -35
- package/dist/src/elysia/index.js.map +2 -2
- package/dist/src/index.js +218 -246
- package/dist/src/index.js.map +10 -10
- package/dist/src/mesh.js +49 -61
- package/dist/src/mesh.js.map +4 -4
- package/dist/src/peer.js +23 -52
- package/dist/src/peer.js.map +2 -2
- package/dist/src/polly-ui/ActionSelect.d.ts +4 -0
- package/dist/src/polly-ui/Button.d.ts +7 -0
- package/dist/src/polly-ui/Collapsible.d.ts +3 -1
- package/dist/src/polly-ui/Layout.d.ts +16 -1
- package/dist/src/polly-ui/index.css +49 -59
- package/dist/src/polly-ui/index.js +227 -237
- package/dist/src/polly-ui/index.js.map +16 -15
- package/dist/src/polly-ui/internal/select-trigger.d.ts +33 -0
- package/dist/src/polly-ui/markdown.js +72 -145
- package/dist/src/polly-ui/markdown.js.map +2 -2
- package/dist/src/polly-ui/styles.css +49 -59
- package/dist/src/polly-ui/theme.css +10 -0
- package/dist/src/shared/adapters/index.js +31 -44
- package/dist/src/shared/adapters/index.js.map +2 -2
- package/dist/src/shared/lib/context-helpers.js +126 -152
- package/dist/src/shared/lib/context-helpers.js.map +4 -4
- package/dist/src/shared/lib/errors.js +1 -74
- package/dist/src/shared/lib/errors.js.map +2 -2
- package/dist/src/shared/lib/guards.js +1 -74
- package/dist/src/shared/lib/guards.js.map +2 -2
- package/dist/src/shared/lib/message-bus.js +126 -152
- package/dist/src/shared/lib/message-bus.js.map +4 -4
- package/dist/src/shared/lib/resource.js +16 -27
- package/dist/src/shared/lib/resource.js.map +5 -5
- package/dist/src/shared/lib/state.js +13 -26
- package/dist/src/shared/lib/state.js.map +2 -2
- package/dist/src/shared/lib/test-helpers.js +1 -74
- package/dist/src/shared/lib/test-helpers.js.map +2 -2
- package/dist/src/shared/state/app-state.js +35 -46
- package/dist/src/shared/state/app-state.js.map +5 -5
- package/dist/src/shared/types/messages.js +1 -74
- package/dist/src/shared/types/messages.js.map +2 -2
- package/dist/tools/bdd/src/cli.js +11 -15
- package/dist/tools/bdd/src/cli.js.map +2 -2
- package/dist/tools/bdd/src/index.js +11 -19
- package/dist/tools/bdd/src/index.js.map +2 -2
- package/dist/tools/gallery/src/cli.js +1 -18
- package/dist/tools/gallery/src/cli.js.map +2 -2
- package/dist/tools/init/src/cli.js +1 -18
- package/dist/tools/init/src/cli.js.map +2 -2
- package/dist/tools/mutate/src/cli.js +8 -25
- package/dist/tools/mutate/src/cli.js.map +2 -2
- package/dist/tools/mutate/src/index.js +8 -26
- package/dist/tools/mutate/src/index.js.map +2 -2
- package/dist/tools/quality/src/cli.js +39 -46
- package/dist/tools/quality/src/cli.js.map +3 -3
- package/dist/tools/quality/src/css/check-layout.d.ts +5 -3
- package/dist/tools/quality/src/index.js +39 -47
- package/dist/tools/quality/src/index.js.map +3 -3
- package/dist/tools/test/src/adapters/index.js +4 -77
- package/dist/tools/test/src/adapters/index.js.map +2 -2
- package/dist/tools/test/src/browser/index.js +1 -74
- package/dist/tools/test/src/browser/index.js.map +2 -2
- package/dist/tools/test/src/browser/run.js +5 -22
- package/dist/tools/test/src/browser/run.js.map +2 -2
- package/dist/tools/test/src/contrast/index.js +1 -74
- package/dist/tools/test/src/contrast/index.js.map +2 -2
- package/dist/tools/test/src/coverage-policy/cli.js +13 -25
- package/dist/tools/test/src/coverage-policy/cli.js.map +2 -2
- package/dist/tools/test/src/coverage-policy/index.js +11 -23
- package/dist/tools/test/src/coverage-policy/index.js.map +2 -2
- package/dist/tools/test/src/e2e-mesh/index.js +18 -43
- package/dist/tools/test/src/e2e-mesh/index.js.map +2 -2
- package/dist/tools/test/src/e2e-relay/index.js +615 -623
- package/dist/tools/test/src/e2e-relay/index.js.map +2 -2
- package/dist/tools/test/src/index.js +30 -103
- package/dist/tools/test/src/index.js.map +5 -5
- package/dist/tools/test/src/test-utils.js +1 -74
- package/dist/tools/test/src/test-utils.js.map +2 -2
- package/dist/tools/test/src/tiers/cli.js +1 -18
- package/dist/tools/test/src/tiers/cli.js.map +2 -2
- package/dist/tools/test/src/tiers/worker.js +11 -15
- package/dist/tools/test/src/tiers/worker.js.map +2 -2
- package/dist/tools/test/src/visual/index.js +1112 -1134
- package/dist/tools/test/src/visual/index.js.map +3 -3
- package/dist/tools/verify/src/cli.js +103 -169
- package/dist/tools/verify/src/cli.js.map +2 -2
- package/dist/tools/verify/src/config.js +1 -74
- package/dist/tools/verify/src/config.js.map +2 -2
- package/dist/tools/verify/src/stryker/index.js +1 -19
- package/dist/tools/verify/src/stryker/index.js.map +2 -2
- package/dist/tools/visualize/src/cli.js +69 -85
- package/dist/tools/visualize/src/cli.js.map +2 -2
- package/package.json +1 -1
|
@@ -1,76 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(mod))
|
|
24
|
-
if (!__hasOwnProp.call(to, key))
|
|
25
|
-
__defProp(to, key, {
|
|
26
|
-
get: __accessProp.bind(mod, key),
|
|
27
|
-
enumerable: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (canCache)
|
|
31
|
-
cache.set(mod, to);
|
|
32
|
-
return to;
|
|
33
|
-
};
|
|
34
|
-
var __toCommonJS = (from) => {
|
|
35
|
-
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
36
|
-
if (entry)
|
|
37
|
-
return entry;
|
|
38
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
39
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
40
|
-
for (var key of __getOwnPropNames(from))
|
|
41
|
-
if (!__hasOwnProp.call(entry, key))
|
|
42
|
-
__defProp(entry, key, {
|
|
43
|
-
get: __accessProp.bind(from, key),
|
|
44
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
__moduleCache.set(from, entry);
|
|
48
|
-
return entry;
|
|
49
|
-
};
|
|
50
|
-
var __moduleCache;
|
|
51
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
52
|
-
var __returnValue = (v) => v;
|
|
53
|
-
function __exportSetter(name, newValue) {
|
|
54
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
55
|
-
}
|
|
56
|
-
var __export = (target, all) => {
|
|
57
|
-
for (var name in all)
|
|
58
|
-
__defProp(target, name, {
|
|
59
|
-
get: all[name],
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
set: __exportSetter.bind(all, name)
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
66
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
67
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
68
|
-
}) : x)(function(x) {
|
|
69
|
-
if (typeof require !== "undefined")
|
|
70
|
-
return require.apply(this, arguments);
|
|
71
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
72
|
-
});
|
|
73
|
-
|
|
74
1
|
// src/polly-ui/ActionForm.module.css
|
|
75
2
|
var ActionForm_module_default = {
|
|
76
3
|
form: "form_oqTahQ"
|
|
@@ -321,6 +248,10 @@ function Layout(props) {
|
|
|
321
248
|
className,
|
|
322
249
|
onClick,
|
|
323
250
|
onKeyDown,
|
|
251
|
+
onKeyUp,
|
|
252
|
+
onMouseEnter,
|
|
253
|
+
onMouseLeave,
|
|
254
|
+
elementRef,
|
|
324
255
|
role,
|
|
325
256
|
tabIndex,
|
|
326
257
|
id
|
|
@@ -385,6 +316,10 @@ function Layout(props) {
|
|
|
385
316
|
style,
|
|
386
317
|
onClick,
|
|
387
318
|
onKeyDown,
|
|
319
|
+
onKeyUp,
|
|
320
|
+
onMouseEnter,
|
|
321
|
+
onMouseLeave,
|
|
322
|
+
ref: elementRef,
|
|
388
323
|
role,
|
|
389
324
|
tabIndex,
|
|
390
325
|
"aria-label": props["aria-label"],
|
|
@@ -435,11 +370,11 @@ function Dropdown(props) {
|
|
|
435
370
|
}, [popoverId, isOpen]);
|
|
436
371
|
useEffect2(() => {
|
|
437
372
|
const menu = menuRef.current;
|
|
438
|
-
const
|
|
439
|
-
if (!menu || !
|
|
373
|
+
const trigger = triggerRef.current;
|
|
374
|
+
if (!menu || !trigger)
|
|
440
375
|
return;
|
|
441
376
|
const positionMenu = () => {
|
|
442
|
-
const t =
|
|
377
|
+
const t = trigger.getBoundingClientRect();
|
|
443
378
|
const prevDisplay = menu.style.display;
|
|
444
379
|
menu.style.maxHeight = "";
|
|
445
380
|
menu.style.display = "block";
|
|
@@ -448,7 +383,7 @@ function Dropdown(props) {
|
|
|
448
383
|
menu.style.display = prevDisplay;
|
|
449
384
|
const viewportWidth = document.documentElement.clientWidth;
|
|
450
385
|
const viewportHeight = document.documentElement.clientHeight;
|
|
451
|
-
const isRtl = getComputedStyle(
|
|
386
|
+
const isRtl = getComputedStyle(trigger).direction === "rtl" || document.documentElement.dir === "rtl";
|
|
452
387
|
const physicalRight = isRtl && align === "left" || align === "right";
|
|
453
388
|
let left = physicalRight ? t.right - menuWidth : t.left;
|
|
454
389
|
const maxLeft = Math.max(VIEWPORT_PADDING, viewportWidth - menuWidth - VIEWPORT_PADDING);
|
|
@@ -570,8 +505,33 @@ var Select_module_default = {
|
|
|
570
505
|
optionCheck: "optionCheck_daofbw"
|
|
571
506
|
};
|
|
572
507
|
|
|
508
|
+
// src/polly-ui/internal/select-trigger.tsx
|
|
509
|
+
import { jsxDEV as jsxDEV4 } from "preact/jsx-dev-runtime";
|
|
510
|
+
function SelectTrigger(props) {
|
|
511
|
+
const { label, caret = true, as = "div" } = props;
|
|
512
|
+
return /* @__PURE__ */ jsxDEV4(Layout, {
|
|
513
|
+
as,
|
|
514
|
+
inline: true,
|
|
515
|
+
columns: caret ? "1fr auto" : "1fr",
|
|
516
|
+
...caret ? { gap: "var(--polly-space-sm)" } : {},
|
|
517
|
+
alignItems: "center",
|
|
518
|
+
maxInlineSize: "100%",
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
521
|
+
class: Select_module_default["triggerLabel"],
|
|
522
|
+
"data-polly-select-label": true,
|
|
523
|
+
children: label
|
|
524
|
+
}, undefined, false, undefined, this),
|
|
525
|
+
caret && /* @__PURE__ */ jsxDEV4("span", {
|
|
526
|
+
class: Select_module_default["caret"],
|
|
527
|
+
"aria-hidden": "true"
|
|
528
|
+
}, undefined, false, undefined, this)
|
|
529
|
+
]
|
|
530
|
+
}, undefined, true, undefined, this);
|
|
531
|
+
}
|
|
532
|
+
|
|
573
533
|
// src/polly-ui/ActionSelect.tsx
|
|
574
|
-
import { jsxDEV as
|
|
534
|
+
import { jsxDEV as jsxDEV5 } from "preact/jsx-dev-runtime";
|
|
575
535
|
function labelFor(options, value) {
|
|
576
536
|
for (const opt of options) {
|
|
577
537
|
if (opt.value === value)
|
|
@@ -611,7 +571,7 @@ function ActionSelect(props) {
|
|
|
611
571
|
const parts = [Select_module_default["select"] ?? ""];
|
|
612
572
|
if (className)
|
|
613
573
|
parts.push(className);
|
|
614
|
-
return /* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
615
575
|
...collectPassthrough(props),
|
|
616
576
|
id,
|
|
617
577
|
class: parts.filter(Boolean).join(" "),
|
|
@@ -619,44 +579,36 @@ function ActionSelect(props) {
|
|
|
619
579
|
"data-polly-action-select": true,
|
|
620
580
|
"data-state": isEmpty ? "empty" : "filled",
|
|
621
581
|
children: [
|
|
622
|
-
label !== undefined && /* @__PURE__ */
|
|
582
|
+
label !== undefined && /* @__PURE__ */ jsxDEV5("span", {
|
|
623
583
|
class: Select_module_default["label"],
|
|
624
584
|
children: label
|
|
625
585
|
}, undefined, false, undefined, this),
|
|
626
|
-
disabled ? /* @__PURE__ */
|
|
586
|
+
disabled ? /* @__PURE__ */ jsxDEV5("span", {
|
|
627
587
|
class: triggerClass,
|
|
628
588
|
"aria-disabled": "true",
|
|
629
589
|
title: displayText,
|
|
630
|
-
children: /* @__PURE__ */
|
|
631
|
-
|
|
632
|
-
|
|
590
|
+
children: /* @__PURE__ */ jsxDEV5(SelectTrigger, {
|
|
591
|
+
as: "span",
|
|
592
|
+
caret: false,
|
|
593
|
+
label: displayText
|
|
633
594
|
}, undefined, false, undefined, this)
|
|
634
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
595
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV5(Dropdown, {
|
|
635
596
|
isOpen,
|
|
636
597
|
triggerClassName: triggerClass,
|
|
637
598
|
triggerTitle: displayText,
|
|
638
|
-
trigger: /* @__PURE__ */
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
class: Select_module_default["triggerLabel"],
|
|
642
|
-
children: displayText
|
|
643
|
-
}, undefined, false, undefined, this),
|
|
644
|
-
/* @__PURE__ */ jsxDEV4("span", {
|
|
645
|
-
class: Select_module_default["caret"],
|
|
646
|
-
"aria-hidden": "true"
|
|
647
|
-
}, undefined, false, undefined, this)
|
|
648
|
-
]
|
|
649
|
-
}, undefined, true, undefined, this),
|
|
599
|
+
trigger: /* @__PURE__ */ jsxDEV5(SelectTrigger, {
|
|
600
|
+
label: displayText
|
|
601
|
+
}, undefined, false, undefined, this),
|
|
650
602
|
children: options.map((opt) => {
|
|
651
603
|
const isSelected = opt.value === value;
|
|
652
604
|
const optClass = isSelected ? `${Select_module_default["option"]} ${Select_module_default["optionSelected"]}` : Select_module_default["option"];
|
|
653
|
-
return /* @__PURE__ */
|
|
605
|
+
return /* @__PURE__ */ jsxDEV5("button", {
|
|
654
606
|
type: "button",
|
|
655
607
|
role: "option",
|
|
656
608
|
class: optClass,
|
|
657
609
|
"aria-selected": isSelected ? "true" : "false",
|
|
658
610
|
onClick: () => commit(opt.value),
|
|
659
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ jsxDEV5("span", {
|
|
660
612
|
children: opt.label
|
|
661
613
|
}, undefined, false, undefined, this)
|
|
662
614
|
}, opt.value, false, undefined, this);
|
|
@@ -675,7 +627,7 @@ var Badge_module_default = {
|
|
|
675
627
|
};
|
|
676
628
|
|
|
677
629
|
// src/polly-ui/Badge.tsx
|
|
678
|
-
import { jsxDEV as
|
|
630
|
+
import { jsxDEV as jsxDEV6 } from "preact/jsx-dev-runtime";
|
|
679
631
|
function variantClass(variant) {
|
|
680
632
|
if (variant === "info")
|
|
681
633
|
return Badge_module_default["info"];
|
|
@@ -695,7 +647,7 @@ function Badge(props) {
|
|
|
695
647
|
parts.push(v);
|
|
696
648
|
if (className)
|
|
697
649
|
parts.push(className);
|
|
698
|
-
return /* @__PURE__ */
|
|
650
|
+
return /* @__PURE__ */ jsxDEV6("span", {
|
|
699
651
|
id,
|
|
700
652
|
title,
|
|
701
653
|
class: parts.join(" "),
|
|
@@ -718,13 +670,14 @@ var Button_module_default = {
|
|
|
718
670
|
btnLarge: "btnLarge_c4HKfA",
|
|
719
671
|
btnCircle: "btnCircle_c4HKfA",
|
|
720
672
|
btnFullWidth: "btnFullWidth_c4HKfA",
|
|
673
|
+
btnFlush: "btnFlush_c4HKfA",
|
|
721
674
|
btnBounded: "btnBounded_c4HKfA",
|
|
722
675
|
icon: "icon_c4HKfA",
|
|
723
676
|
label: "label_c4HKfA"
|
|
724
677
|
};
|
|
725
678
|
|
|
726
679
|
// src/polly-ui/Button.tsx
|
|
727
|
-
import { jsxDEV as
|
|
680
|
+
import { jsxDEV as jsxDEV7 } from "preact/jsx-dev-runtime";
|
|
728
681
|
function tierClass(tier) {
|
|
729
682
|
if (tier === "primary")
|
|
730
683
|
return Button_module_default["tierPrimary"];
|
|
@@ -760,6 +713,7 @@ function Button(props) {
|
|
|
760
713
|
fullWidth = false,
|
|
761
714
|
circle = false,
|
|
762
715
|
bounded = false,
|
|
716
|
+
flush = false,
|
|
763
717
|
className,
|
|
764
718
|
title,
|
|
765
719
|
icon,
|
|
@@ -781,16 +735,22 @@ function Button(props) {
|
|
|
781
735
|
parts.push(Button_module_default["btnFullWidth"] ?? "");
|
|
782
736
|
if (bounded)
|
|
783
737
|
parts.push(Button_module_default["btnBounded"] ?? "");
|
|
738
|
+
if (flush)
|
|
739
|
+
parts.push(Button_module_default["btnFlush"] ?? "");
|
|
784
740
|
if (className)
|
|
785
741
|
parts.push(className);
|
|
786
742
|
const buttonClass = parts.filter(Boolean).join(" ");
|
|
787
|
-
const content = /* @__PURE__ */
|
|
743
|
+
const content = icon === undefined ? label : /* @__PURE__ */ jsxDEV7(Layout, {
|
|
744
|
+
inline: true,
|
|
745
|
+
columns: "auto auto",
|
|
746
|
+
gap: "var(--polly-space-sm)",
|
|
747
|
+
alignItems: "center",
|
|
788
748
|
children: [
|
|
789
|
-
|
|
749
|
+
/* @__PURE__ */ jsxDEV7("span", {
|
|
790
750
|
class: Button_module_default["icon"],
|
|
791
751
|
children: icon
|
|
792
752
|
}, undefined, false, undefined, this),
|
|
793
|
-
label !== undefined && /* @__PURE__ */
|
|
753
|
+
label !== undefined && /* @__PURE__ */ jsxDEV7("span", {
|
|
794
754
|
class: Button_module_default["label"],
|
|
795
755
|
children: label
|
|
796
756
|
}, undefined, false, undefined, this)
|
|
@@ -809,7 +769,7 @@ function Button(props) {
|
|
|
809
769
|
}
|
|
810
770
|
}
|
|
811
771
|
if ("href" in props && props.href) {
|
|
812
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ jsxDEV7("a", {
|
|
813
773
|
id,
|
|
814
774
|
class: buttonClass,
|
|
815
775
|
title: resolvedTitle,
|
|
@@ -827,7 +787,7 @@ function Button(props) {
|
|
|
827
787
|
}, undefined, false, undefined, this);
|
|
828
788
|
}
|
|
829
789
|
const resolvedType = "type" in props && props.type ? props.type : "button";
|
|
830
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsxDEV7("button", {
|
|
831
791
|
id,
|
|
832
792
|
class: buttonClass,
|
|
833
793
|
title: resolvedTitle,
|
|
@@ -871,6 +831,7 @@ var variantDefaults = {
|
|
|
871
831
|
border: "default"
|
|
872
832
|
},
|
|
873
833
|
bubble: {
|
|
834
|
+
background: "var(--polly-surface-bubble)",
|
|
874
835
|
radius: "md",
|
|
875
836
|
border: "default",
|
|
876
837
|
padding: "var(--polly-space-sm) var(--polly-space-md)"
|
|
@@ -1054,10 +1015,10 @@ function Surface(props) {
|
|
|
1054
1015
|
}
|
|
1055
1016
|
|
|
1056
1017
|
// src/polly-ui/Card.tsx
|
|
1057
|
-
import { jsxDEV as
|
|
1018
|
+
import { jsxDEV as jsxDEV8 } from "preact/jsx-dev-runtime";
|
|
1058
1019
|
function Root(props) {
|
|
1059
1020
|
const { variant = "raised", radius = "md", ...rest } = props;
|
|
1060
|
-
return /* @__PURE__ */
|
|
1021
|
+
return /* @__PURE__ */ jsxDEV8(Surface, {
|
|
1061
1022
|
variant,
|
|
1062
1023
|
radius,
|
|
1063
1024
|
"data-polly-card": true,
|
|
@@ -1072,7 +1033,7 @@ function Header(props) {
|
|
|
1072
1033
|
borderSides = "block-end",
|
|
1073
1034
|
...rest
|
|
1074
1035
|
} = props;
|
|
1075
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ jsxDEV8(Surface, {
|
|
1076
1037
|
padding,
|
|
1077
1038
|
border,
|
|
1078
1039
|
borderSides,
|
|
@@ -1083,7 +1044,7 @@ function Header(props) {
|
|
|
1083
1044
|
}
|
|
1084
1045
|
function Body(props) {
|
|
1085
1046
|
const { padding = "var(--polly-space-lg)", ...rest } = props;
|
|
1086
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsxDEV8(Surface, {
|
|
1087
1048
|
padding,
|
|
1088
1049
|
"data-polly-card-body": true,
|
|
1089
1050
|
...rest,
|
|
@@ -1097,7 +1058,7 @@ function Footer(props) {
|
|
|
1097
1058
|
borderSides = "block-start",
|
|
1098
1059
|
...rest
|
|
1099
1060
|
} = props;
|
|
1100
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ jsxDEV8(Surface, {
|
|
1101
1062
|
padding,
|
|
1102
1063
|
border,
|
|
1103
1064
|
borderSides,
|
|
@@ -1116,7 +1077,7 @@ var Checkbox_module_default = {
|
|
|
1116
1077
|
};
|
|
1117
1078
|
|
|
1118
1079
|
// src/polly-ui/Checkbox.tsx
|
|
1119
|
-
import { jsxDEV as
|
|
1080
|
+
import { jsxDEV as jsxDEV9 } from "preact/jsx-dev-runtime";
|
|
1120
1081
|
function isSignal(value) {
|
|
1121
1082
|
return typeof value === "object" && value !== null && "value" in value && "peek" in value;
|
|
1122
1083
|
}
|
|
@@ -1133,12 +1094,17 @@ function Checkbox(props) {
|
|
|
1133
1094
|
parts.push(Checkbox_module_default["disabled"] ?? "");
|
|
1134
1095
|
if (className)
|
|
1135
1096
|
parts.push(className);
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
|
|
1097
|
+
return /* @__PURE__ */ jsxDEV9(Layout, {
|
|
1098
|
+
as: "label",
|
|
1099
|
+
inline: true,
|
|
1100
|
+
columns: "auto auto",
|
|
1101
|
+
gap: "var(--polly-space-sm)",
|
|
1102
|
+
alignItems: "center",
|
|
1103
|
+
className: parts.filter(Boolean).join(" "),
|
|
1138
1104
|
"data-polly-ui": true,
|
|
1139
1105
|
"data-polly-checkbox": true,
|
|
1140
1106
|
children: [
|
|
1141
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ jsxDEV9("input", {
|
|
1142
1108
|
id,
|
|
1143
1109
|
type: "checkbox",
|
|
1144
1110
|
class: Checkbox_module_default["input"],
|
|
@@ -1148,7 +1114,7 @@ function Checkbox(props) {
|
|
|
1148
1114
|
disabled,
|
|
1149
1115
|
onChange: handleChange
|
|
1150
1116
|
}, undefined, false, undefined, this),
|
|
1151
|
-
label !== undefined && /* @__PURE__ */
|
|
1117
|
+
label !== undefined && /* @__PURE__ */ jsxDEV9("span", {
|
|
1152
1118
|
class: Checkbox_module_default["label"],
|
|
1153
1119
|
children: label
|
|
1154
1120
|
}, undefined, false, undefined, this)
|
|
@@ -1199,21 +1165,21 @@ var Code_module_default = {
|
|
|
1199
1165
|
};
|
|
1200
1166
|
|
|
1201
1167
|
// src/polly-ui/Code.tsx
|
|
1202
|
-
import { jsxDEV as
|
|
1168
|
+
import { jsxDEV as jsxDEV10 } from "preact/jsx-dev-runtime";
|
|
1203
1169
|
function Code(props) {
|
|
1204
1170
|
const { children, block, className, id } = props;
|
|
1205
1171
|
const passthrough = collectPassthrough(props);
|
|
1206
1172
|
if (block) {
|
|
1207
|
-
const
|
|
1173
|
+
const parts = [Code_module_default["block"]];
|
|
1208
1174
|
if (className)
|
|
1209
|
-
|
|
1210
|
-
return /* @__PURE__ */
|
|
1175
|
+
parts.push(className);
|
|
1176
|
+
return /* @__PURE__ */ jsxDEV10("pre", {
|
|
1211
1177
|
...passthrough,
|
|
1212
1178
|
id,
|
|
1213
|
-
class:
|
|
1179
|
+
class: parts.filter(Boolean).join(" "),
|
|
1214
1180
|
"data-polly-ui": true,
|
|
1215
1181
|
"data-polly-code": "block",
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1182
|
+
children: /* @__PURE__ */ jsxDEV10("code", {
|
|
1217
1183
|
children
|
|
1218
1184
|
}, undefined, false, undefined, this)
|
|
1219
1185
|
}, undefined, false, undefined, this);
|
|
@@ -1221,7 +1187,7 @@ function Code(props) {
|
|
|
1221
1187
|
const parts = [Code_module_default["code"]];
|
|
1222
1188
|
if (className)
|
|
1223
1189
|
parts.push(className);
|
|
1224
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsxDEV10("code", {
|
|
1225
1191
|
...passthrough,
|
|
1226
1192
|
id,
|
|
1227
1193
|
class: parts.filter(Boolean).join(" "),
|
|
@@ -1234,11 +1200,13 @@ function Code(props) {
|
|
|
1234
1200
|
var Collapsible_module_default = {
|
|
1235
1201
|
collapsible: "collapsible_sEhnPw",
|
|
1236
1202
|
summary: "summary_sEhnPw",
|
|
1203
|
+
marker: "marker_sEhnPw",
|
|
1204
|
+
summaryContent: "summaryContent_sEhnPw",
|
|
1237
1205
|
content: "content_sEhnPw"
|
|
1238
1206
|
};
|
|
1239
1207
|
|
|
1240
1208
|
// src/polly-ui/Collapsible.tsx
|
|
1241
|
-
import { jsxDEV as
|
|
1209
|
+
import { jsxDEV as jsxDEV11 } from "preact/jsx-dev-runtime";
|
|
1242
1210
|
var NON_TEXT_INPUT_TYPES = new Set([
|
|
1243
1211
|
"checkbox",
|
|
1244
1212
|
"radio",
|
|
@@ -1274,19 +1242,32 @@ function Collapsible(props) {
|
|
|
1274
1242
|
const parts = [Collapsible_module_default["collapsible"]];
|
|
1275
1243
|
if (className)
|
|
1276
1244
|
parts.push(className);
|
|
1277
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ jsxDEV11("details", {
|
|
1278
1246
|
id,
|
|
1279
1247
|
class: parts.join(" "),
|
|
1280
1248
|
open: defaultOpen,
|
|
1281
1249
|
"data-polly-ui": true,
|
|
1282
1250
|
"data-polly-collapsible": true,
|
|
1283
1251
|
children: [
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
|
|
1252
|
+
/* @__PURE__ */ jsxDEV11(Layout, {
|
|
1253
|
+
as: "summary",
|
|
1254
|
+
columns: "auto 1fr",
|
|
1255
|
+
gap: "var(--polly-space-sm)",
|
|
1256
|
+
alignItems: "center",
|
|
1257
|
+
className: Collapsible_module_default["summary"],
|
|
1286
1258
|
onKeyUp: handleSummaryKeyUp,
|
|
1287
|
-
children:
|
|
1288
|
-
|
|
1289
|
-
|
|
1259
|
+
children: [
|
|
1260
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
1261
|
+
class: Collapsible_module_default["marker"],
|
|
1262
|
+
"aria-hidden": "true"
|
|
1263
|
+
}, undefined, false, undefined, this),
|
|
1264
|
+
/* @__PURE__ */ jsxDEV11("span", {
|
|
1265
|
+
class: Collapsible_module_default["summaryContent"],
|
|
1266
|
+
children: summary
|
|
1267
|
+
}, undefined, false, undefined, this)
|
|
1268
|
+
]
|
|
1269
|
+
}, undefined, true, undefined, this),
|
|
1270
|
+
/* @__PURE__ */ jsxDEV11("div", {
|
|
1290
1271
|
class: Collapsible_module_default["content"],
|
|
1291
1272
|
children
|
|
1292
1273
|
}, undefined, false, undefined, this)
|
|
@@ -1456,7 +1437,7 @@ var OverlayRoot_module_default = {
|
|
|
1456
1437
|
};
|
|
1457
1438
|
|
|
1458
1439
|
// src/polly-ui/OverlayRoot.tsx
|
|
1459
|
-
import { jsxDEV as
|
|
1440
|
+
import { jsxDEV as jsxDEV12 } from "preact/jsx-dev-runtime";
|
|
1460
1441
|
function OverlayRoot() {
|
|
1461
1442
|
const ref = useRef3(null);
|
|
1462
1443
|
useEffect3(() => {
|
|
@@ -1475,7 +1456,7 @@ function OverlayRoot() {
|
|
|
1475
1456
|
release?.();
|
|
1476
1457
|
};
|
|
1477
1458
|
}, []);
|
|
1478
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1479
1460
|
ref,
|
|
1480
1461
|
class: OverlayRoot_module_default["root"],
|
|
1481
1462
|
"data-polly-ui": true,
|
|
@@ -1487,7 +1468,7 @@ function getOverlayRootNode() {
|
|
|
1487
1468
|
}
|
|
1488
1469
|
|
|
1489
1470
|
// src/polly-ui/Modal.tsx
|
|
1490
|
-
import { jsxDEV as
|
|
1471
|
+
import { jsxDEV as jsxDEV13 } from "preact/jsx-dev-runtime";
|
|
1491
1472
|
var Ctx = createContext(null);
|
|
1492
1473
|
function useModal() {
|
|
1493
1474
|
const ctx = useContext(Ctx);
|
|
@@ -1529,11 +1510,14 @@ function Root2({ when, onClose, children, "aria-label": ariaLabel }) {
|
|
|
1529
1510
|
onClose?.();
|
|
1530
1511
|
};
|
|
1531
1512
|
const ctx = { id, titleId, descId, close };
|
|
1532
|
-
const content = /* @__PURE__ */
|
|
1513
|
+
const content = /* @__PURE__ */ jsxDEV13(Ctx.Provider, {
|
|
1533
1514
|
value: ctx,
|
|
1534
|
-
children: /* @__PURE__ */
|
|
1535
|
-
|
|
1536
|
-
|
|
1515
|
+
children: /* @__PURE__ */ jsxDEV13(Layout, {
|
|
1516
|
+
elementRef: mountRef,
|
|
1517
|
+
alignItems: "center",
|
|
1518
|
+
justifyItems: "center",
|
|
1519
|
+
height: "100%",
|
|
1520
|
+
className: Modal_module_default["container"],
|
|
1537
1521
|
"data-polly-ui": true,
|
|
1538
1522
|
"data-polly-modal-content": true,
|
|
1539
1523
|
"data-overlay-id": id,
|
|
@@ -1550,7 +1534,7 @@ function Root2({ when, onClose, children, "aria-label": ariaLabel }) {
|
|
|
1550
1534
|
}
|
|
1551
1535
|
function Backdrop() {
|
|
1552
1536
|
const { close } = useModal();
|
|
1553
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ jsxDEV13("div", {
|
|
1554
1538
|
class: Modal_module_default["backdrop"],
|
|
1555
1539
|
"data-polly-modal-backdrop": true,
|
|
1556
1540
|
onClick: close,
|
|
@@ -1559,7 +1543,7 @@ function Backdrop() {
|
|
|
1559
1543
|
}
|
|
1560
1544
|
function Content({ children, className, style }) {
|
|
1561
1545
|
const cls = className ? `${Modal_module_default["surface"]} ${className}` : Modal_module_default["surface"];
|
|
1562
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ jsxDEV13(Surface, {
|
|
1563
1547
|
variant: "raised",
|
|
1564
1548
|
radius: "lg",
|
|
1565
1549
|
shadow: "lg",
|
|
@@ -1571,7 +1555,7 @@ function Content({ children, className, style }) {
|
|
|
1571
1555
|
}, undefined, false, undefined, this);
|
|
1572
1556
|
}
|
|
1573
1557
|
function Header2({ children }) {
|
|
1574
|
-
return /* @__PURE__ */
|
|
1558
|
+
return /* @__PURE__ */ jsxDEV13("header", {
|
|
1575
1559
|
class: Modal_module_default["header"],
|
|
1576
1560
|
"data-polly-modal-header": true,
|
|
1577
1561
|
children
|
|
@@ -1579,7 +1563,7 @@ function Header2({ children }) {
|
|
|
1579
1563
|
}
|
|
1580
1564
|
function Title({ children }) {
|
|
1581
1565
|
const { titleId } = useModal();
|
|
1582
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsxDEV13("h2", {
|
|
1583
1567
|
id: titleId,
|
|
1584
1568
|
class: Modal_module_default["title"],
|
|
1585
1569
|
"data-polly-modal-title": true,
|
|
@@ -1588,7 +1572,7 @@ function Title({ children }) {
|
|
|
1588
1572
|
}
|
|
1589
1573
|
function Body2({ children }) {
|
|
1590
1574
|
const { descId } = useModal();
|
|
1591
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ jsxDEV13("div", {
|
|
1592
1576
|
id: descId,
|
|
1593
1577
|
class: Modal_module_default["body"],
|
|
1594
1578
|
"data-polly-modal-body": true,
|
|
@@ -1596,7 +1580,7 @@ function Body2({ children }) {
|
|
|
1596
1580
|
}, undefined, false, undefined, this);
|
|
1597
1581
|
}
|
|
1598
1582
|
function Footer2({ children }) {
|
|
1599
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ jsxDEV13("footer", {
|
|
1600
1584
|
class: Modal_module_default["footer"],
|
|
1601
1585
|
"data-polly-modal-footer": true,
|
|
1602
1586
|
children
|
|
@@ -1605,7 +1589,7 @@ function Footer2({ children }) {
|
|
|
1605
1589
|
function Close({ children, action }) {
|
|
1606
1590
|
const { close } = useModal();
|
|
1607
1591
|
if (action) {
|
|
1608
|
-
return /* @__PURE__ */
|
|
1592
|
+
return /* @__PURE__ */ jsxDEV13("button", {
|
|
1609
1593
|
type: "button",
|
|
1610
1594
|
class: Modal_module_default["close"],
|
|
1611
1595
|
"data-polly-ui": true,
|
|
@@ -1615,7 +1599,7 @@ function Close({ children, action }) {
|
|
|
1615
1599
|
children
|
|
1616
1600
|
}, undefined, false, undefined, this);
|
|
1617
1601
|
}
|
|
1618
|
-
return /* @__PURE__ */
|
|
1602
|
+
return /* @__PURE__ */ jsxDEV13("button", {
|
|
1619
1603
|
type: "button",
|
|
1620
1604
|
class: Modal_module_default["close"],
|
|
1621
1605
|
"data-polly-ui": true,
|
|
@@ -1637,7 +1621,7 @@ var Modal = {
|
|
|
1637
1621
|
};
|
|
1638
1622
|
|
|
1639
1623
|
// src/polly-ui/ConfirmDialog.tsx
|
|
1640
|
-
import { jsxDEV as
|
|
1624
|
+
import { jsxDEV as jsxDEV14 } from "preact/jsx-dev-runtime";
|
|
1641
1625
|
var pending = signal2(null);
|
|
1642
1626
|
var isOpen = signal2(false);
|
|
1643
1627
|
var nextId = 0;
|
|
@@ -1668,27 +1652,30 @@ function Host() {
|
|
|
1668
1652
|
const current = pending.value;
|
|
1669
1653
|
if (!current)
|
|
1670
1654
|
return null;
|
|
1671
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsxDEV14(Modal.Root, {
|
|
1672
1656
|
when: isOpen,
|
|
1673
1657
|
onClose: () => close(false),
|
|
1674
1658
|
children: [
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ jsxDEV14(Modal.Backdrop, {}, undefined, false, undefined, this),
|
|
1660
|
+
/* @__PURE__ */ jsxDEV14(Modal.Content, {
|
|
1677
1661
|
children: [
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
children: /* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ jsxDEV14(Modal.Header, {
|
|
1663
|
+
children: /* @__PURE__ */ jsxDEV14(Modal.Title, {
|
|
1680
1664
|
children: current.title
|
|
1681
1665
|
}, undefined, false, undefined, this)
|
|
1682
1666
|
}, undefined, false, undefined, this),
|
|
1683
|
-
current.body ? /* @__PURE__ */
|
|
1667
|
+
current.body ? /* @__PURE__ */ jsxDEV14(Modal.Body, {
|
|
1684
1668
|
children: current.body
|
|
1685
1669
|
}, undefined, false, undefined, this) : null,
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
children: /* @__PURE__ */
|
|
1688
|
-
|
|
1670
|
+
/* @__PURE__ */ jsxDEV14(Modal.Footer, {
|
|
1671
|
+
children: /* @__PURE__ */ jsxDEV14(Layout, {
|
|
1672
|
+
columns: "auto auto",
|
|
1673
|
+
gap: "var(--polly-space-sm)",
|
|
1674
|
+
justifyContent: "end",
|
|
1675
|
+
className: ConfirmDialog_module_default["actions"],
|
|
1689
1676
|
"data-polly-confirm-actions": true,
|
|
1690
1677
|
children: [
|
|
1691
|
-
/* @__PURE__ */
|
|
1678
|
+
/* @__PURE__ */ jsxDEV14("button", {
|
|
1692
1679
|
type: "button",
|
|
1693
1680
|
class: ConfirmDialog_module_default["cancel"],
|
|
1694
1681
|
"data-polly-ui": true,
|
|
@@ -1697,7 +1684,7 @@ function Host() {
|
|
|
1697
1684
|
onClick: () => close(false),
|
|
1698
1685
|
children: current.cancelLabel ?? "Cancel"
|
|
1699
1686
|
}, undefined, false, undefined, this),
|
|
1700
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ jsxDEV14("button", {
|
|
1701
1688
|
type: "button",
|
|
1702
1689
|
class: current.danger ? ConfirmDialog_module_default["confirmDanger"] : ConfirmDialog_module_default["confirm"],
|
|
1703
1690
|
"data-polly-ui": true,
|
|
@@ -1723,7 +1710,7 @@ var FileInput_module_default = {
|
|
|
1723
1710
|
};
|
|
1724
1711
|
|
|
1725
1712
|
// src/polly-ui/FileInput.tsx
|
|
1726
|
-
import { jsxDEV as
|
|
1713
|
+
import { jsxDEV as jsxDEV15 } from "preact/jsx-dev-runtime";
|
|
1727
1714
|
function FileInput(props) {
|
|
1728
1715
|
const { onFiles, label = "Choose file", accept, multiple, disabled, className, id } = props;
|
|
1729
1716
|
const handleChange = (e) => {
|
|
@@ -1736,13 +1723,13 @@ function FileInput(props) {
|
|
|
1736
1723
|
parts.push(FileInput_module_default["disabled"]);
|
|
1737
1724
|
if (className)
|
|
1738
1725
|
parts.push(className);
|
|
1739
|
-
return /* @__PURE__ */
|
|
1726
|
+
return /* @__PURE__ */ jsxDEV15("label", {
|
|
1740
1727
|
id,
|
|
1741
1728
|
class: parts.filter(Boolean).join(" "),
|
|
1742
1729
|
"data-polly-ui": true,
|
|
1743
1730
|
"data-polly-file-input": true,
|
|
1744
1731
|
children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsxDEV15("input", {
|
|
1746
1733
|
type: "file",
|
|
1747
1734
|
class: FileInput_module_default["native"],
|
|
1748
1735
|
accept,
|
|
@@ -1750,7 +1737,7 @@ function FileInput(props) {
|
|
|
1750
1737
|
disabled,
|
|
1751
1738
|
onChange: handleChange
|
|
1752
1739
|
}, undefined, false, undefined, this),
|
|
1753
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsxDEV15("span", {
|
|
1754
1741
|
children: label
|
|
1755
1742
|
}, undefined, false, undefined, this)
|
|
1756
1743
|
]
|
|
@@ -1776,7 +1763,7 @@ var Link_module_default = {
|
|
|
1776
1763
|
};
|
|
1777
1764
|
|
|
1778
1765
|
// src/polly-ui/Link.tsx
|
|
1779
|
-
import { jsxDEV as
|
|
1766
|
+
import { jsxDEV as jsxDEV16 } from "preact/jsx-dev-runtime";
|
|
1780
1767
|
function Link(props) {
|
|
1781
1768
|
const { children, href, external, download, subtle, className, id } = props;
|
|
1782
1769
|
const parts = [Link_module_default["link"]];
|
|
@@ -1784,7 +1771,7 @@ function Link(props) {
|
|
|
1784
1771
|
parts.push(Link_module_default["subtle"]);
|
|
1785
1772
|
if (className)
|
|
1786
1773
|
parts.push(className);
|
|
1787
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ jsxDEV16("a", {
|
|
1788
1775
|
...collectPassthrough(props),
|
|
1789
1776
|
id,
|
|
1790
1777
|
class: parts.filter(Boolean).join(" "),
|
|
@@ -1804,7 +1791,7 @@ var Output_module_default = {
|
|
|
1804
1791
|
};
|
|
1805
1792
|
|
|
1806
1793
|
// src/polly-ui/Output.tsx
|
|
1807
|
-
import { jsxDEV as
|
|
1794
|
+
import { jsxDEV as jsxDEV17 } from "preact/jsx-dev-runtime";
|
|
1808
1795
|
function Output(props) {
|
|
1809
1796
|
const { children, scroll, tabIndex, className, id } = props;
|
|
1810
1797
|
const parts = [Output_module_default["output"]];
|
|
@@ -1812,7 +1799,7 @@ function Output(props) {
|
|
|
1812
1799
|
parts.push(Output_module_default["scroll"]);
|
|
1813
1800
|
if (className)
|
|
1814
1801
|
parts.push(className);
|
|
1815
|
-
return /* @__PURE__ */
|
|
1802
|
+
return /* @__PURE__ */ jsxDEV17("pre", {
|
|
1816
1803
|
...collectPassthrough(props),
|
|
1817
1804
|
id,
|
|
1818
1805
|
class: parts.filter(Boolean).join(" "),
|
|
@@ -1824,7 +1811,7 @@ function Output(props) {
|
|
|
1824
1811
|
}
|
|
1825
1812
|
// src/polly-ui/Select.tsx
|
|
1826
1813
|
import { useComputed, useSignal as useSignal2 } from "@preact/signals";
|
|
1827
|
-
import { jsxDEV as
|
|
1814
|
+
import { jsxDEV as jsxDEV18 } from "preact/jsx-dev-runtime";
|
|
1828
1815
|
var MULTI_SELECT_LABEL_THRESHOLD = 2;
|
|
1829
1816
|
function formatSelected(options, selected, multiSelect) {
|
|
1830
1817
|
if (selected.size === 0)
|
|
@@ -1852,7 +1839,7 @@ function Select(props) {
|
|
|
1852
1839
|
className,
|
|
1853
1840
|
id
|
|
1854
1841
|
} = props;
|
|
1855
|
-
const
|
|
1842
|
+
const isOpen = useSignal2(false);
|
|
1856
1843
|
const displayText = useComputed(() => {
|
|
1857
1844
|
const text = formatSelected(options, selected.value, multiSelect);
|
|
1858
1845
|
return text.length > 0 ? text : placeholder;
|
|
@@ -1868,7 +1855,7 @@ function Select(props) {
|
|
|
1868
1855
|
selected.value = next;
|
|
1869
1856
|
} else {
|
|
1870
1857
|
selected.value = new Set([value]);
|
|
1871
|
-
|
|
1858
|
+
isOpen.value = false;
|
|
1872
1859
|
}
|
|
1873
1860
|
};
|
|
1874
1861
|
const handleSelectAll = () => {
|
|
@@ -1879,7 +1866,7 @@ function Select(props) {
|
|
|
1879
1866
|
};
|
|
1880
1867
|
const handleClearOption = () => {
|
|
1881
1868
|
selected.value = new Set;
|
|
1882
|
-
|
|
1869
|
+
isOpen.value = false;
|
|
1883
1870
|
};
|
|
1884
1871
|
const triggerParts = [Select_module_default["trigger"] ?? ""];
|
|
1885
1872
|
if (isEmpty.value)
|
|
@@ -1887,52 +1874,43 @@ function Select(props) {
|
|
|
1887
1874
|
if (wide)
|
|
1888
1875
|
triggerParts.push(Select_module_default["triggerWide"] ?? "");
|
|
1889
1876
|
const triggerClass = triggerParts.filter(Boolean).join(" ");
|
|
1890
|
-
const triggerContent = /* @__PURE__ */
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
class: Select_module_default["triggerLabel"],
|
|
1894
|
-
children: displayText.value
|
|
1895
|
-
}, undefined, false, undefined, this),
|
|
1896
|
-
/* @__PURE__ */ jsxDEV17("span", {
|
|
1897
|
-
class: Select_module_default["caret"],
|
|
1898
|
-
"aria-hidden": "true"
|
|
1899
|
-
}, undefined, false, undefined, this)
|
|
1900
|
-
]
|
|
1901
|
-
}, undefined, true, undefined, this);
|
|
1877
|
+
const triggerContent = /* @__PURE__ */ jsxDEV18(SelectTrigger, {
|
|
1878
|
+
label: displayText.value
|
|
1879
|
+
}, undefined, false, undefined, this);
|
|
1902
1880
|
const parts = [Select_module_default["select"] ?? ""];
|
|
1903
1881
|
if (className)
|
|
1904
1882
|
parts.push(className);
|
|
1905
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsxDEV18("div", {
|
|
1906
1884
|
id,
|
|
1907
1885
|
class: parts.filter(Boolean).join(" "),
|
|
1908
1886
|
"data-polly-ui": true,
|
|
1909
1887
|
"data-polly-select": true,
|
|
1910
1888
|
children: [
|
|
1911
|
-
label !== undefined && /* @__PURE__ */
|
|
1889
|
+
label !== undefined && /* @__PURE__ */ jsxDEV18("span", {
|
|
1912
1890
|
class: Select_module_default["label"],
|
|
1913
1891
|
children: label
|
|
1914
1892
|
}, undefined, false, undefined, this),
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
isOpen
|
|
1893
|
+
/* @__PURE__ */ jsxDEV18(Dropdown, {
|
|
1894
|
+
isOpen,
|
|
1917
1895
|
trigger: triggerContent,
|
|
1918
1896
|
triggerClassName: triggerClass,
|
|
1919
1897
|
triggerDisabled: disabled,
|
|
1920
1898
|
triggerTitle: displayText.value,
|
|
1921
1899
|
multiSelect,
|
|
1922
1900
|
children: [
|
|
1923
|
-
multiSelect && /* @__PURE__ */
|
|
1901
|
+
multiSelect && /* @__PURE__ */ jsxDEV18("div", {
|
|
1924
1902
|
class: Select_module_default["actions"],
|
|
1925
|
-
children: /* @__PURE__ */
|
|
1903
|
+
children: /* @__PURE__ */ jsxDEV18(Layout, {
|
|
1926
1904
|
columns: "1fr 1fr",
|
|
1927
1905
|
gap: "var(--polly-space-xs)",
|
|
1928
1906
|
children: [
|
|
1929
|
-
/* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ jsxDEV18("button", {
|
|
1930
1908
|
type: "button",
|
|
1931
1909
|
class: Select_module_default["actionBtn"],
|
|
1932
1910
|
onClick: handleSelectAll,
|
|
1933
1911
|
children: "Select All"
|
|
1934
1912
|
}, undefined, false, undefined, this),
|
|
1935
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ jsxDEV18("button", {
|
|
1936
1914
|
type: "button",
|
|
1937
1915
|
class: Select_module_default["actionBtn"],
|
|
1938
1916
|
onClick: handleClear,
|
|
@@ -1941,35 +1919,35 @@ function Select(props) {
|
|
|
1941
1919
|
]
|
|
1942
1920
|
}, undefined, true, undefined, this)
|
|
1943
1921
|
}, undefined, false, undefined, this),
|
|
1944
|
-
!multiSelect && clearable && /* @__PURE__ */
|
|
1922
|
+
!multiSelect && clearable && /* @__PURE__ */ jsxDEV18("button", {
|
|
1945
1923
|
type: "button",
|
|
1946
1924
|
role: "option",
|
|
1947
1925
|
"aria-selected": isEmpty.value ? "true" : "false",
|
|
1948
1926
|
class: isEmpty.value ? `${Select_module_default["option"]} ${Select_module_default["optionSelected"]}` : Select_module_default["option"],
|
|
1949
1927
|
"data-polly-select-clear": true,
|
|
1950
1928
|
onClick: handleClearOption,
|
|
1951
|
-
children: /* @__PURE__ */
|
|
1929
|
+
children: /* @__PURE__ */ jsxDEV18("span", {
|
|
1952
1930
|
children: placeholder
|
|
1953
1931
|
}, undefined, false, undefined, this)
|
|
1954
1932
|
}, undefined, false, undefined, this),
|
|
1955
1933
|
options.map((opt) => {
|
|
1956
1934
|
const isSelected = selected.value.has(opt.value);
|
|
1957
1935
|
const optClass = isSelected ? `${Select_module_default["option"]} ${Select_module_default["optionSelected"]}` : Select_module_default["option"];
|
|
1958
|
-
return /* @__PURE__ */
|
|
1936
|
+
return /* @__PURE__ */ jsxDEV18("button", {
|
|
1959
1937
|
type: "button",
|
|
1960
1938
|
role: "option",
|
|
1961
1939
|
"aria-selected": isSelected ? "true" : "false",
|
|
1962
1940
|
class: optClass,
|
|
1963
1941
|
onClick: () => handleOptionClick(opt.value),
|
|
1964
1942
|
children: [
|
|
1965
|
-
multiSelect && /* @__PURE__ */
|
|
1943
|
+
multiSelect && /* @__PURE__ */ jsxDEV18("input", {
|
|
1966
1944
|
type: "checkbox",
|
|
1967
1945
|
class: Select_module_default["optionCheck"],
|
|
1968
1946
|
checked: isSelected,
|
|
1969
1947
|
tabIndex: -1,
|
|
1970
1948
|
readOnly: true
|
|
1971
1949
|
}, undefined, false, undefined, this),
|
|
1972
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
1973
1951
|
children: opt.label
|
|
1974
1952
|
}, undefined, false, undefined, this)
|
|
1975
1953
|
]
|
|
@@ -1989,7 +1967,7 @@ var Skeleton_module_default = {
|
|
|
1989
1967
|
};
|
|
1990
1968
|
|
|
1991
1969
|
// src/polly-ui/Skeleton.tsx
|
|
1992
|
-
import { jsxDEV as
|
|
1970
|
+
import { jsxDEV as jsxDEV19 } from "preact/jsx-dev-runtime";
|
|
1993
1971
|
function resolveSize(value) {
|
|
1994
1972
|
if (value === undefined)
|
|
1995
1973
|
return;
|
|
@@ -2022,7 +2000,7 @@ function Skeleton(props) {
|
|
|
2022
2000
|
parts.push(vClass);
|
|
2023
2001
|
if (className)
|
|
2024
2002
|
parts.push(className);
|
|
2025
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsxDEV19("span", {
|
|
2026
2004
|
class: parts.join(" "),
|
|
2027
2005
|
style,
|
|
2028
2006
|
"data-polly-ui": true,
|
|
@@ -2038,19 +2016,19 @@ var Tabs_module_default = {
|
|
|
2038
2016
|
};
|
|
2039
2017
|
|
|
2040
2018
|
// src/polly-ui/Tabs.tsx
|
|
2041
|
-
import { jsxDEV as
|
|
2019
|
+
import { jsxDEV as jsxDEV20 } from "preact/jsx-dev-runtime";
|
|
2042
2020
|
function Tabs(props) {
|
|
2043
2021
|
const { tabs, activeTab, action, className, id } = props;
|
|
2044
2022
|
const parts = [Tabs_module_default["tabs"] ?? ""];
|
|
2045
2023
|
if (className)
|
|
2046
2024
|
parts.push(className);
|
|
2047
|
-
return /* @__PURE__ */
|
|
2025
|
+
return /* @__PURE__ */ jsxDEV20("nav", {
|
|
2048
2026
|
id,
|
|
2049
2027
|
class: parts.filter(Boolean).join(" "),
|
|
2050
2028
|
"aria-label": props["aria-label"],
|
|
2051
2029
|
"data-polly-ui": true,
|
|
2052
2030
|
"data-polly-tabs": true,
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2031
|
+
children: /* @__PURE__ */ jsxDEV20(Layout, {
|
|
2054
2032
|
columns: `repeat(${tabs.length}, auto)`,
|
|
2055
2033
|
gap: "0",
|
|
2056
2034
|
alignItems: "end",
|
|
@@ -2058,7 +2036,7 @@ function Tabs(props) {
|
|
|
2058
2036
|
children: tabs.map((tab) => {
|
|
2059
2037
|
const isActive = activeTab === tab.id;
|
|
2060
2038
|
const tabClass = isActive ? `${Tabs_module_default["tab"]} ${Tabs_module_default["active"]}` : Tabs_module_default["tab"];
|
|
2061
|
-
return /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsxDEV20("button", {
|
|
2062
2040
|
type: "button",
|
|
2063
2041
|
class: tabClass,
|
|
2064
2042
|
disabled: tab.disabled,
|
|
@@ -2164,7 +2142,7 @@ var TextInput_module_default = {
|
|
|
2164
2142
|
};
|
|
2165
2143
|
|
|
2166
2144
|
// src/polly-ui/TextInput.tsx
|
|
2167
|
-
import { jsxDEV as
|
|
2145
|
+
import { jsxDEV as jsxDEV21 } from "preact/jsx-dev-runtime";
|
|
2168
2146
|
function isSignal2(v) {
|
|
2169
2147
|
return typeof v === "object" && v !== null && "value" in v && "peek" in v;
|
|
2170
2148
|
}
|
|
@@ -2192,7 +2170,7 @@ function TextInput(props) {
|
|
|
2192
2170
|
props.value.value = e.currentTarget.value;
|
|
2193
2171
|
}
|
|
2194
2172
|
};
|
|
2195
|
-
const control = variant === "multi" ? /* @__PURE__ */
|
|
2173
|
+
const control = variant === "multi" ? /* @__PURE__ */ jsxDEV21("textarea", {
|
|
2196
2174
|
...a11y,
|
|
2197
2175
|
class: className,
|
|
2198
2176
|
title: props.title,
|
|
@@ -2202,7 +2180,7 @@ function TextInput(props) {
|
|
|
2202
2180
|
value: stringValue,
|
|
2203
2181
|
defaultValue,
|
|
2204
2182
|
onInput
|
|
2205
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
2183
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV21("input", {
|
|
2206
2184
|
...a11y,
|
|
2207
2185
|
type: props.inputType ?? "text",
|
|
2208
2186
|
class: className,
|
|
@@ -2218,13 +2196,14 @@ function TextInput(props) {
|
|
|
2218
2196
|
}, undefined, false, undefined, this);
|
|
2219
2197
|
if (!hasError)
|
|
2220
2198
|
return control;
|
|
2221
|
-
return /* @__PURE__ */
|
|
2222
|
-
|
|
2199
|
+
return /* @__PURE__ */ jsxDEV21(Layout, {
|
|
2200
|
+
gap: "var(--polly-space-xs)",
|
|
2201
|
+
className: TextInput_module_default["field"],
|
|
2223
2202
|
"data-polly-ui": true,
|
|
2224
2203
|
"data-polly-field": true,
|
|
2225
2204
|
children: [
|
|
2226
2205
|
control,
|
|
2227
|
-
/* @__PURE__ */
|
|
2206
|
+
/* @__PURE__ */ jsxDEV21("span", {
|
|
2228
2207
|
id: errorId,
|
|
2229
2208
|
role: "alert",
|
|
2230
2209
|
class: TextInput_module_default["error"],
|
|
@@ -2277,7 +2256,7 @@ var Toast_module_default = {
|
|
|
2277
2256
|
};
|
|
2278
2257
|
|
|
2279
2258
|
// src/polly-ui/Toast.tsx
|
|
2280
|
-
import { jsxDEV as
|
|
2259
|
+
import { jsxDEV as jsxDEV22 } from "preact/jsx-dev-runtime";
|
|
2281
2260
|
function Viewport(props) {
|
|
2282
2261
|
const autoDismissMs = props.autoDismissMs ?? 5000;
|
|
2283
2262
|
const [portalNode, setPortalNode] = useState3(null);
|
|
@@ -2299,13 +2278,14 @@ function Viewport(props) {
|
|
|
2299
2278
|
}, [paused, entries, autoDismissMs]);
|
|
2300
2279
|
if (!portalNode)
|
|
2301
2280
|
return null;
|
|
2302
|
-
const content = /* @__PURE__ */
|
|
2303
|
-
|
|
2281
|
+
const content = /* @__PURE__ */ jsxDEV22(Layout, {
|
|
2282
|
+
gap: "var(--polly-space-sm)",
|
|
2283
|
+
className: `${Toast_module_default["viewport"]} ${props.className ?? ""}`.trim(),
|
|
2304
2284
|
"data-polly-ui": true,
|
|
2305
2285
|
"data-polly-toast-viewport": true,
|
|
2306
2286
|
onMouseEnter: () => setPaused(true),
|
|
2307
2287
|
onMouseLeave: () => setPaused(false),
|
|
2308
|
-
children: entries.map((entry) => /* @__PURE__ */
|
|
2288
|
+
children: entries.map((entry) => /* @__PURE__ */ jsxDEV22(ToastItem, {
|
|
2309
2289
|
entry
|
|
2310
2290
|
}, entry.id, false, undefined, this))
|
|
2311
2291
|
}, undefined, false, undefined, this);
|
|
@@ -2313,7 +2293,7 @@ function Viewport(props) {
|
|
|
2313
2293
|
}
|
|
2314
2294
|
function ToastItem({ entry }) {
|
|
2315
2295
|
const liveness = entry.severity === "error" ? "assertive" : "polite";
|
|
2316
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ jsxDEV22(Surface, {
|
|
2317
2297
|
variant: "raised",
|
|
2318
2298
|
padding: "var(--polly-space-md) var(--polly-space-lg)",
|
|
2319
2299
|
className: Toast_module_default["item"],
|
|
@@ -2322,23 +2302,28 @@ function ToastItem({ entry }) {
|
|
|
2322
2302
|
"data-severity": entry.severity,
|
|
2323
2303
|
role: entry.severity === "error" ? "alert" : "status",
|
|
2324
2304
|
"aria-live": liveness,
|
|
2325
|
-
children:
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
"
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2305
|
+
children: /* @__PURE__ */ jsxDEV22(Layout, {
|
|
2306
|
+
columns: "1fr auto",
|
|
2307
|
+
gap: "var(--polly-space-md)",
|
|
2308
|
+
alignItems: "center",
|
|
2309
|
+
children: [
|
|
2310
|
+
/* @__PURE__ */ jsxDEV22("span", {
|
|
2311
|
+
class: Toast_module_default["message"],
|
|
2312
|
+
children: entry.message
|
|
2313
|
+
}, undefined, false, undefined, this),
|
|
2314
|
+
/* @__PURE__ */ jsxDEV22("button", {
|
|
2315
|
+
type: "button",
|
|
2316
|
+
class: Toast_module_default["close"],
|
|
2317
|
+
"data-polly-ui": true,
|
|
2318
|
+
"data-polly-interactive": true,
|
|
2319
|
+
"data-polly-toast-close": true,
|
|
2320
|
+
onClick: () => clearError(entry.id),
|
|
2321
|
+
"aria-label": "Dismiss",
|
|
2322
|
+
children: "×"
|
|
2323
|
+
}, undefined, false, undefined, this)
|
|
2324
|
+
]
|
|
2325
|
+
}, undefined, true, undefined, this)
|
|
2326
|
+
}, undefined, false, undefined, this);
|
|
2342
2327
|
}
|
|
2343
2328
|
var Toast = { Viewport };
|
|
2344
2329
|
// src/polly-ui/Toggle.module.css
|
|
@@ -2354,7 +2339,7 @@ var Toggle_module_default = {
|
|
|
2354
2339
|
};
|
|
2355
2340
|
|
|
2356
2341
|
// src/polly-ui/Toggle.tsx
|
|
2357
|
-
import { jsxDEV as
|
|
2342
|
+
import { jsxDEV as jsxDEV23 } from "preact/jsx-dev-runtime";
|
|
2358
2343
|
function Toggle(props) {
|
|
2359
2344
|
const { checked = false, disabled = false, label, name, className, id } = props;
|
|
2360
2345
|
const parts = [Toggle_module_default["toggle"]];
|
|
@@ -2362,12 +2347,17 @@ function Toggle(props) {
|
|
|
2362
2347
|
parts.push(Toggle_module_default["disabled"]);
|
|
2363
2348
|
if (className)
|
|
2364
2349
|
parts.push(className);
|
|
2365
|
-
return /* @__PURE__ */
|
|
2366
|
-
|
|
2350
|
+
return /* @__PURE__ */ jsxDEV23(Layout, {
|
|
2351
|
+
as: "label",
|
|
2352
|
+
inline: true,
|
|
2353
|
+
columns: "auto auto",
|
|
2354
|
+
gap: "var(--polly-space-sm)",
|
|
2355
|
+
alignItems: "center",
|
|
2356
|
+
className: parts.join(" "),
|
|
2367
2357
|
"data-polly-ui": true,
|
|
2368
2358
|
"data-polly-toggle": true,
|
|
2369
2359
|
children: [
|
|
2370
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ jsxDEV23("input", {
|
|
2371
2361
|
id,
|
|
2372
2362
|
type: "checkbox",
|
|
2373
2363
|
role: "switch",
|
|
@@ -2377,13 +2367,13 @@ function Toggle(props) {
|
|
|
2377
2367
|
checked,
|
|
2378
2368
|
disabled
|
|
2379
2369
|
}, undefined, false, undefined, this),
|
|
2380
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsxDEV23("span", {
|
|
2381
2371
|
class: checked ? `${Toggle_module_default["track"]} ${Toggle_module_default["trackChecked"]}` : Toggle_module_default["track"],
|
|
2382
|
-
children: /* @__PURE__ */
|
|
2372
|
+
children: /* @__PURE__ */ jsxDEV23("span", {
|
|
2383
2373
|
class: checked ? `${Toggle_module_default["thumb"]} ${Toggle_module_default["thumbChecked"]}` : Toggle_module_default["thumb"]
|
|
2384
2374
|
}, undefined, false, undefined, this)
|
|
2385
2375
|
}, undefined, false, undefined, this),
|
|
2386
|
-
label !== undefined && /* @__PURE__ */
|
|
2376
|
+
label !== undefined && /* @__PURE__ */ jsxDEV23("span", {
|
|
2387
2377
|
class: Toggle_module_default["label"],
|
|
2388
2378
|
children: label
|
|
2389
2379
|
}, undefined, false, undefined, this)
|
|
@@ -2422,4 +2412,4 @@ export {
|
|
|
2422
2412
|
getOverlayRootNode
|
|
2423
2413
|
};
|
|
2424
2414
|
|
|
2425
|
-
//# debugId=
|
|
2415
|
+
//# debugId=EE704C83CAA1B4AA64756E2164756E21
|