@fairfox/polly 0.71.0 → 0.73.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/dist/src/client/index.js +2 -2
- package/dist/src/client/index.js.map +2 -2
- package/dist/src/elysia/index.js +464 -4
- package/dist/src/elysia/index.js.map +6 -4
- package/dist/src/peer.d.ts +2 -0
- package/dist/src/peer.js +468 -4
- package/dist/src/peer.js.map +8 -5
- package/dist/src/polly-ui/ActionInput.d.ts +12 -2
- package/dist/src/polly-ui/ActionSelect.d.ts +36 -0
- package/dist/src/polly-ui/Button.d.ts +4 -0
- package/dist/src/polly-ui/Cluster.d.ts +36 -0
- package/dist/src/polly-ui/Code.d.ts +18 -0
- package/dist/src/polly-ui/Surface.d.ts +12 -1
- package/dist/src/polly-ui/Text.d.ts +43 -0
- package/dist/src/polly-ui/index.css +320 -194
- package/dist/src/polly-ui/index.d.ts +5 -1
- package/dist/src/polly-ui/index.js +533 -284
- package/dist/src/polly-ui/index.js.map +14 -8
- package/dist/src/polly-ui/internal/dispatch-action.d.ts +13 -0
- package/dist/src/polly-ui/internal/passthrough.d.ts +25 -0
- package/dist/src/polly-ui/markdown.js +3 -3
- package/dist/src/polly-ui/markdown.js.map +2 -2
- package/dist/src/polly-ui/styles.css +345 -194
- package/dist/src/polly-ui/theme.css +1 -0
- package/dist/src/shared/lib/peer-repo-server.d.ts +18 -0
- package/dist/src/shared/lib/sweep-sealed.d.ts +111 -0
- package/dist/tools/quality/src/cli.js +6 -2
- package/dist/tools/quality/src/cli.js.map +3 -3
- package/dist/tools/quality/src/index.js +6 -2
- package/dist/tools/quality/src/index.js.map +3 -3
- package/dist/tools/test/src/browser/run.js +89 -49
- package/dist/tools/test/src/browser/run.js.map +6 -5
- package/dist/tools/test/src/browser/runner-core.d.ts +32 -0
- package/dist/tools/test/src/e2e-mesh/index.js +193 -171
- package/dist/tools/test/src/e2e-mesh/index.js.map +4 -4
- package/dist/tools/test/src/visual/index.js +270 -251
- package/dist/tools/test/src/visual/index.js.map +5 -5
- package/dist/tools/verify/specs/tla/MeshSeed.cfg +27 -0
- package/dist/tools/verify/specs/tla/MeshSeed.tla +179 -0
- package/dist/tools/verify/specs/tla/README.md +11 -1
- package/dist/tools/verify/src/cli.js +136 -51
- package/dist/tools/verify/src/cli.js.map +9 -7
- package/dist/tools/visualize/src/cli.js +72 -2
- package/dist/tools/visualize/src/cli.js.map +5 -5
- package/package.json +3 -2
|
@@ -103,12 +103,47 @@ var ActionInput_module_default = {
|
|
|
103
103
|
placeholder: "placeholder_-n6UrQ"
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
+
// src/polly-ui/internal/dispatch-action.ts
|
|
107
|
+
function dispatchAction(action, data) {
|
|
108
|
+
const hidden = document.createElement("button");
|
|
109
|
+
hidden.setAttribute("data-action", action);
|
|
110
|
+
for (const [key, value] of Object.entries(data)) {
|
|
111
|
+
const dashKey = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
112
|
+
hidden.setAttribute(`data-action-${dashKey}`, value);
|
|
113
|
+
}
|
|
114
|
+
hidden.style.position = "fixed";
|
|
115
|
+
hidden.style.opacity = "0";
|
|
116
|
+
hidden.style.pointerEvents = "none";
|
|
117
|
+
hidden.tabIndex = -1;
|
|
118
|
+
document.body.appendChild(hidden);
|
|
119
|
+
try {
|
|
120
|
+
hidden.click();
|
|
121
|
+
} finally {
|
|
122
|
+
hidden.remove();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/polly-ui/internal/passthrough.ts
|
|
127
|
+
function collectPassthrough(props) {
|
|
128
|
+
const out = {};
|
|
129
|
+
for (const key of Object.keys(props)) {
|
|
130
|
+
if (!key.startsWith("data-") && !key.startsWith("aria-"))
|
|
131
|
+
continue;
|
|
132
|
+
const value = props[key];
|
|
133
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
134
|
+
out[key] = value;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
|
|
106
140
|
// src/polly-ui/ActionInput.tsx
|
|
107
141
|
import { jsxDEV as jsxDEV2 } from "preact/jsx-dev-runtime";
|
|
108
142
|
function ActionInput(props) {
|
|
109
143
|
const variant = props.variant ?? "single";
|
|
110
144
|
const saveOn = props.saveOn ?? "blur";
|
|
111
|
-
const
|
|
145
|
+
const live = saveOn === "input";
|
|
146
|
+
const [mode, setMode] = useState(live ? "edit" : "view");
|
|
112
147
|
const [draft, setDraft] = useState(props.value);
|
|
113
148
|
const inputRef = useRef(null);
|
|
114
149
|
useEffect(() => {
|
|
@@ -116,11 +151,11 @@ function ActionInput(props) {
|
|
|
116
151
|
setDraft(props.value);
|
|
117
152
|
}, [props.value, mode]);
|
|
118
153
|
useEffect(() => {
|
|
119
|
-
if (mode === "edit" && inputRef.current) {
|
|
154
|
+
if (mode === "edit" && !live && inputRef.current) {
|
|
120
155
|
inputRef.current.focus();
|
|
121
156
|
inputRef.current.select?.();
|
|
122
157
|
}
|
|
123
|
-
}, [mode]);
|
|
158
|
+
}, [mode, live]);
|
|
124
159
|
const enterEdit = useCallback(() => {
|
|
125
160
|
if (props.disabled)
|
|
126
161
|
return;
|
|
@@ -128,36 +163,17 @@ function ActionInput(props) {
|
|
|
128
163
|
setMode("edit");
|
|
129
164
|
}, [props.disabled, props.value]);
|
|
130
165
|
const commit = useCallback((next) => {
|
|
131
|
-
if (next
|
|
132
|
-
|
|
133
|
-
return;
|
|
166
|
+
if (next !== props.value) {
|
|
167
|
+
dispatchAction(props.action, { ...props.actionData ?? {}, value: next });
|
|
134
168
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
const hidden = document.createElement("button");
|
|
140
|
-
hidden.setAttribute("data-action", props.action);
|
|
141
|
-
for (const [key, value] of Object.entries(dataAttrs)) {
|
|
142
|
-
const dashKey = key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
143
|
-
hidden.setAttribute(`data-action-${dashKey}`, value);
|
|
144
|
-
}
|
|
145
|
-
hidden.style.position = "fixed";
|
|
146
|
-
hidden.style.opacity = "0";
|
|
147
|
-
hidden.style.pointerEvents = "none";
|
|
148
|
-
hidden.tabIndex = -1;
|
|
149
|
-
document.body.appendChild(hidden);
|
|
150
|
-
try {
|
|
151
|
-
hidden.click();
|
|
152
|
-
} finally {
|
|
153
|
-
hidden.remove();
|
|
154
|
-
}
|
|
155
|
-
setMode("view");
|
|
156
|
-
}, [props.action, props.actionData, props.value]);
|
|
169
|
+
if (!live)
|
|
170
|
+
setMode("view");
|
|
171
|
+
}, [props.action, props.actionData, props.value, live]);
|
|
157
172
|
const cancel = useCallback(() => {
|
|
158
173
|
setDraft(props.value);
|
|
159
|
-
|
|
160
|
-
|
|
174
|
+
if (!live)
|
|
175
|
+
setMode("view");
|
|
176
|
+
}, [props.value, live]);
|
|
161
177
|
const onKeyDown = (event) => {
|
|
162
178
|
if (event.key === "Escape") {
|
|
163
179
|
event.preventDefault();
|
|
@@ -178,10 +194,12 @@ function ActionInput(props) {
|
|
|
178
194
|
}
|
|
179
195
|
};
|
|
180
196
|
const className = props.className ? `${ActionInput_module_default["root"]} ${props.className}` : ActionInput_module_default["root"];
|
|
197
|
+
const passthrough = collectPassthrough(props);
|
|
181
198
|
if (mode === "view") {
|
|
182
199
|
const rendered = props.renderView ? props.renderView(props.value) : props.value;
|
|
183
200
|
const isEmpty = props.value.length === 0;
|
|
184
201
|
return /* @__PURE__ */ jsxDEV2("div", {
|
|
202
|
+
...passthrough,
|
|
185
203
|
class: `${className} ${ActionInput_module_default["view"]}`,
|
|
186
204
|
"data-polly-ui": true,
|
|
187
205
|
"data-polly-action-input": true,
|
|
@@ -206,6 +224,7 @@ function ActionInput(props) {
|
|
|
206
224
|
}, undefined, false, undefined, this);
|
|
207
225
|
}
|
|
208
226
|
const common = {
|
|
227
|
+
...passthrough,
|
|
209
228
|
class: `${ActionInput_module_default["edit"]} ${ActionInput_module_default["root"]}`,
|
|
210
229
|
"data-polly-ui": true,
|
|
211
230
|
"data-polly-action-input": true,
|
|
@@ -213,11 +232,16 @@ function ActionInput(props) {
|
|
|
213
232
|
"data-variant": variant,
|
|
214
233
|
placeholder: props.placeholder,
|
|
215
234
|
value: draft,
|
|
216
|
-
onInput: (e) =>
|
|
235
|
+
onInput: (e) => {
|
|
236
|
+
const next = e.currentTarget.value;
|
|
237
|
+
setDraft(next);
|
|
238
|
+
if (live)
|
|
239
|
+
commit(next);
|
|
240
|
+
},
|
|
217
241
|
onBlur: () => {
|
|
218
242
|
if (saveOn === "blur")
|
|
219
243
|
commit(draft);
|
|
220
|
-
else
|
|
244
|
+
else if (!live)
|
|
221
245
|
cancel();
|
|
222
246
|
},
|
|
223
247
|
onKeyDown,
|
|
@@ -236,62 +260,23 @@ function ActionInput(props) {
|
|
|
236
260
|
ref: (el) => {
|
|
237
261
|
inputRef.current = el;
|
|
238
262
|
},
|
|
239
|
-
type: "text",
|
|
263
|
+
type: props.inputType ?? "text",
|
|
240
264
|
...common
|
|
241
265
|
}, undefined, false, undefined, this);
|
|
242
266
|
}
|
|
243
|
-
// src/polly-ui/
|
|
244
|
-
|
|
245
|
-
badge: "badge_cZd0Aw",
|
|
246
|
-
info: "info_cZd0Aw",
|
|
247
|
-
success: "success_cZd0Aw",
|
|
248
|
-
warning: "warning_cZd0Aw",
|
|
249
|
-
danger: "danger_cZd0Aw"
|
|
250
|
-
};
|
|
267
|
+
// src/polly-ui/ActionSelect.tsx
|
|
268
|
+
import { useSignal } from "@preact/signals";
|
|
251
269
|
|
|
252
|
-
// src/polly-ui/
|
|
253
|
-
import {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return Badge_module_default["danger"];
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
function Badge(props) {
|
|
266
|
-
const { children, variant = "default", className, id } = props;
|
|
267
|
-
const parts = [Badge_module_default["badge"]];
|
|
268
|
-
const v = variantClass(variant);
|
|
269
|
-
if (v)
|
|
270
|
-
parts.push(v);
|
|
271
|
-
if (className)
|
|
272
|
-
parts.push(className);
|
|
273
|
-
return /* @__PURE__ */ jsxDEV3("span", {
|
|
274
|
-
id,
|
|
275
|
-
class: parts.join(" "),
|
|
276
|
-
"data-polly-ui": true,
|
|
277
|
-
"data-polly-badge": variant,
|
|
278
|
-
children
|
|
279
|
-
}, undefined, false, undefined, this);
|
|
280
|
-
}
|
|
281
|
-
// src/polly-ui/Button.module.css
|
|
282
|
-
var Button_module_default = {
|
|
283
|
-
btn: "btn_c4HKfA",
|
|
284
|
-
tierPrimary: "tierPrimary_c4HKfA",
|
|
285
|
-
tierSecondary: "tierSecondary_c4HKfA",
|
|
286
|
-
tierTertiary: "tierTertiary_c4HKfA",
|
|
287
|
-
colorInfo: "colorInfo_c4HKfA",
|
|
288
|
-
colorSuccess: "colorSuccess_c4HKfA",
|
|
289
|
-
colorWarning: "colorWarning_c4HKfA",
|
|
290
|
-
colorDanger: "colorDanger_c4HKfA",
|
|
291
|
-
btnSmall: "btnSmall_c4HKfA",
|
|
292
|
-
btnLarge: "btnLarge_c4HKfA",
|
|
293
|
-
btnCircle: "btnCircle_c4HKfA",
|
|
294
|
-
btnFullWidth: "btnFullWidth_c4HKfA"
|
|
270
|
+
// src/polly-ui/Dropdown.tsx
|
|
271
|
+
import { useSignalEffect } from "@preact/signals";
|
|
272
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "preact/hooks";
|
|
273
|
+
|
|
274
|
+
// src/polly-ui/Dropdown.module.css
|
|
275
|
+
var Dropdown_module_default = {
|
|
276
|
+
dropdown: "dropdown_HX48zA",
|
|
277
|
+
trigger: "trigger_HX48zA",
|
|
278
|
+
menu: "menu_HX48zA",
|
|
279
|
+
alignRight: "alignRight_HX48zA"
|
|
295
280
|
};
|
|
296
281
|
|
|
297
282
|
// src/polly-ui/Layout.tsx
|
|
@@ -404,8 +389,239 @@ function Layout(props) {
|
|
|
404
389
|
}, children);
|
|
405
390
|
}
|
|
406
391
|
|
|
407
|
-
// src/polly-ui/
|
|
392
|
+
// src/polly-ui/Dropdown.tsx
|
|
393
|
+
import { jsxDEV as jsxDEV3 } from "preact/jsx-dev-runtime";
|
|
394
|
+
var dropdownCounter = 0;
|
|
395
|
+
function Dropdown(props) {
|
|
396
|
+
const { isOpen, trigger, children, align = "left", multiSelect = false, className, id } = props;
|
|
397
|
+
const menuRef = useRef2(null);
|
|
398
|
+
const triggerRef = useRef2(null);
|
|
399
|
+
const idRef = useRef2(`polly-dropdown-${++dropdownCounter}`);
|
|
400
|
+
const popoverId = idRef.current;
|
|
401
|
+
useEffect2(() => {
|
|
402
|
+
triggerRef.current?.setAttribute("popovertarget", popoverId);
|
|
403
|
+
}, [popoverId]);
|
|
404
|
+
useEffect2(() => {
|
|
405
|
+
const menu = menuRef.current;
|
|
406
|
+
if (!menu)
|
|
407
|
+
return;
|
|
408
|
+
const onOverlayClose = (e) => {
|
|
409
|
+
if (e instanceof CustomEvent && e.detail?.id === popoverId) {
|
|
410
|
+
isOpen.value = false;
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
menu.addEventListener("overlay:close", onOverlayClose);
|
|
414
|
+
return () => {
|
|
415
|
+
menu.removeEventListener("overlay:close", onOverlayClose);
|
|
416
|
+
};
|
|
417
|
+
}, [popoverId, isOpen]);
|
|
418
|
+
useSignalEffect(() => {
|
|
419
|
+
const menu = menuRef.current;
|
|
420
|
+
if (!menu)
|
|
421
|
+
return;
|
|
422
|
+
if (isOpen.value && !menu.matches(":popover-open")) {
|
|
423
|
+
menu.showPopover();
|
|
424
|
+
} else if (!isOpen.value && menu.matches(":popover-open")) {
|
|
425
|
+
menu.hidePopover();
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
const handleToggle = (e) => {
|
|
429
|
+
if ("newState" in e) {
|
|
430
|
+
isOpen.value = e.newState === "open";
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
const handleMenuClick = () => {
|
|
434
|
+
if (!multiSelect) {
|
|
435
|
+
isOpen.value = false;
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
const handleKeyDown = (e) => {
|
|
439
|
+
if (e.key === "Escape") {
|
|
440
|
+
isOpen.value = false;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const parts = [Dropdown_module_default["dropdown"] ?? ""];
|
|
444
|
+
if (className)
|
|
445
|
+
parts.push(className);
|
|
446
|
+
const menuParts = [Dropdown_module_default["menu"] ?? ""];
|
|
447
|
+
if (align === "right")
|
|
448
|
+
menuParts.push(Dropdown_module_default["alignRight"] ?? "");
|
|
449
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
450
|
+
id,
|
|
451
|
+
class: parts.filter(Boolean).join(" "),
|
|
452
|
+
"data-polly-ui": true,
|
|
453
|
+
"data-polly-dropdown": true,
|
|
454
|
+
children: [
|
|
455
|
+
/* @__PURE__ */ jsxDEV3("button", {
|
|
456
|
+
ref: triggerRef,
|
|
457
|
+
type: "button",
|
|
458
|
+
class: Dropdown_module_default["trigger"],
|
|
459
|
+
children: trigger
|
|
460
|
+
}, undefined, false, undefined, this),
|
|
461
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
462
|
+
ref: menuRef,
|
|
463
|
+
id: popoverId,
|
|
464
|
+
role: "listbox",
|
|
465
|
+
class: menuParts.filter(Boolean).join(" "),
|
|
466
|
+
popover: "auto",
|
|
467
|
+
"data-overlay-id": popoverId,
|
|
468
|
+
onToggle: handleToggle,
|
|
469
|
+
onClick: handleMenuClick,
|
|
470
|
+
onKeyDown: handleKeyDown,
|
|
471
|
+
children: /* @__PURE__ */ jsxDEV3(Layout, {
|
|
472
|
+
rows: "auto",
|
|
473
|
+
gap: "0",
|
|
474
|
+
children
|
|
475
|
+
}, undefined, false, undefined, this)
|
|
476
|
+
}, undefined, false, undefined, this)
|
|
477
|
+
]
|
|
478
|
+
}, undefined, true, undefined, this);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// src/polly-ui/Select.module.css
|
|
482
|
+
var Select_module_default = {
|
|
483
|
+
select: "select_daofbw",
|
|
484
|
+
label: "label_daofbw",
|
|
485
|
+
trigger: "trigger_daofbw",
|
|
486
|
+
placeholder: "placeholder_daofbw",
|
|
487
|
+
actions: "actions_daofbw",
|
|
488
|
+
actionBtn: "actionBtn_daofbw",
|
|
489
|
+
option: "option_daofbw",
|
|
490
|
+
optionSelected: "optionSelected_daofbw",
|
|
491
|
+
optionCheck: "optionCheck_daofbw"
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
// src/polly-ui/ActionSelect.tsx
|
|
408
495
|
import { jsxDEV as jsxDEV4 } from "preact/jsx-dev-runtime";
|
|
496
|
+
function labelFor(options, value) {
|
|
497
|
+
for (const opt of options) {
|
|
498
|
+
if (opt.value === value)
|
|
499
|
+
return opt.label;
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
function ActionSelect(props) {
|
|
504
|
+
const {
|
|
505
|
+
value,
|
|
506
|
+
options,
|
|
507
|
+
action,
|
|
508
|
+
actionData,
|
|
509
|
+
label,
|
|
510
|
+
placeholder = "Select…",
|
|
511
|
+
disabled = false,
|
|
512
|
+
className,
|
|
513
|
+
id
|
|
514
|
+
} = props;
|
|
515
|
+
const isOpen = useSignal(false);
|
|
516
|
+
const current = labelFor(options, value);
|
|
517
|
+
const isEmpty = current === undefined;
|
|
518
|
+
const displayText = current ?? placeholder;
|
|
519
|
+
const commit = (next) => {
|
|
520
|
+
isOpen.value = false;
|
|
521
|
+
if (next === value)
|
|
522
|
+
return;
|
|
523
|
+
dispatchAction(action, { ...actionData ?? {}, value: next });
|
|
524
|
+
};
|
|
525
|
+
const triggerClass = isEmpty ? `${Select_module_default["trigger"]} ${Select_module_default["placeholder"]}` : Select_module_default["trigger"];
|
|
526
|
+
const parts = [Select_module_default["select"] ?? ""];
|
|
527
|
+
if (className)
|
|
528
|
+
parts.push(className);
|
|
529
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
530
|
+
...collectPassthrough(props),
|
|
531
|
+
id,
|
|
532
|
+
class: parts.filter(Boolean).join(" "),
|
|
533
|
+
"data-polly-ui": true,
|
|
534
|
+
"data-polly-action-select": true,
|
|
535
|
+
"data-state": isEmpty ? "empty" : "filled",
|
|
536
|
+
children: [
|
|
537
|
+
label !== undefined && /* @__PURE__ */ jsxDEV4("span", {
|
|
538
|
+
class: Select_module_default["label"],
|
|
539
|
+
children: label
|
|
540
|
+
}, undefined, false, undefined, this),
|
|
541
|
+
disabled ? /* @__PURE__ */ jsxDEV4("span", {
|
|
542
|
+
class: triggerClass,
|
|
543
|
+
"aria-disabled": "true",
|
|
544
|
+
children: displayText
|
|
545
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV4(Dropdown, {
|
|
546
|
+
isOpen,
|
|
547
|
+
trigger: /* @__PURE__ */ jsxDEV4("span", {
|
|
548
|
+
class: triggerClass,
|
|
549
|
+
children: displayText
|
|
550
|
+
}, undefined, false, undefined, this),
|
|
551
|
+
children: options.map((opt) => {
|
|
552
|
+
const isSelected = opt.value === value;
|
|
553
|
+
const optClass = isSelected ? `${Select_module_default["option"]} ${Select_module_default["optionSelected"]}` : Select_module_default["option"];
|
|
554
|
+
return /* @__PURE__ */ jsxDEV4("button", {
|
|
555
|
+
type: "button",
|
|
556
|
+
role: "option",
|
|
557
|
+
class: optClass,
|
|
558
|
+
"aria-selected": isSelected ? "true" : "false",
|
|
559
|
+
onClick: () => commit(opt.value),
|
|
560
|
+
children: /* @__PURE__ */ jsxDEV4("span", {
|
|
561
|
+
children: opt.label
|
|
562
|
+
}, undefined, false, undefined, this)
|
|
563
|
+
}, opt.value, false, undefined, this);
|
|
564
|
+
})
|
|
565
|
+
}, undefined, false, undefined, this)
|
|
566
|
+
]
|
|
567
|
+
}, undefined, true, undefined, this);
|
|
568
|
+
}
|
|
569
|
+
// src/polly-ui/Badge.module.css
|
|
570
|
+
var Badge_module_default = {
|
|
571
|
+
badge: "badge_cZd0Aw",
|
|
572
|
+
info: "info_cZd0Aw",
|
|
573
|
+
success: "success_cZd0Aw",
|
|
574
|
+
warning: "warning_cZd0Aw",
|
|
575
|
+
danger: "danger_cZd0Aw"
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
// src/polly-ui/Badge.tsx
|
|
579
|
+
import { jsxDEV as jsxDEV5 } from "preact/jsx-dev-runtime";
|
|
580
|
+
function variantClass(variant) {
|
|
581
|
+
if (variant === "info")
|
|
582
|
+
return Badge_module_default["info"];
|
|
583
|
+
if (variant === "success")
|
|
584
|
+
return Badge_module_default["success"];
|
|
585
|
+
if (variant === "warning")
|
|
586
|
+
return Badge_module_default["warning"];
|
|
587
|
+
if (variant === "danger")
|
|
588
|
+
return Badge_module_default["danger"];
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
function Badge(props) {
|
|
592
|
+
const { children, variant = "default", className, id } = props;
|
|
593
|
+
const parts = [Badge_module_default["badge"]];
|
|
594
|
+
const v = variantClass(variant);
|
|
595
|
+
if (v)
|
|
596
|
+
parts.push(v);
|
|
597
|
+
if (className)
|
|
598
|
+
parts.push(className);
|
|
599
|
+
return /* @__PURE__ */ jsxDEV5("span", {
|
|
600
|
+
id,
|
|
601
|
+
class: parts.join(" "),
|
|
602
|
+
"data-polly-ui": true,
|
|
603
|
+
"data-polly-badge": variant,
|
|
604
|
+
children
|
|
605
|
+
}, undefined, false, undefined, this);
|
|
606
|
+
}
|
|
607
|
+
// src/polly-ui/Button.module.css
|
|
608
|
+
var Button_module_default = {
|
|
609
|
+
btn: "btn_c4HKfA",
|
|
610
|
+
tierPrimary: "tierPrimary_c4HKfA",
|
|
611
|
+
tierSecondary: "tierSecondary_c4HKfA",
|
|
612
|
+
tierTertiary: "tierTertiary_c4HKfA",
|
|
613
|
+
colorInfo: "colorInfo_c4HKfA",
|
|
614
|
+
colorSuccess: "colorSuccess_c4HKfA",
|
|
615
|
+
colorWarning: "colorWarning_c4HKfA",
|
|
616
|
+
colorDanger: "colorDanger_c4HKfA",
|
|
617
|
+
btnSmall: "btnSmall_c4HKfA",
|
|
618
|
+
btnLarge: "btnLarge_c4HKfA",
|
|
619
|
+
btnCircle: "btnCircle_c4HKfA",
|
|
620
|
+
btnFullWidth: "btnFullWidth_c4HKfA"
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
// src/polly-ui/Button.tsx
|
|
624
|
+
import { jsxDEV as jsxDEV6 } from "preact/jsx-dev-runtime";
|
|
409
625
|
function tierClass(tier) {
|
|
410
626
|
if (tier === "primary")
|
|
411
627
|
return Button_module_default["tierPrimary"];
|
|
@@ -462,14 +678,14 @@ function Button(props) {
|
|
|
462
678
|
if (className)
|
|
463
679
|
parts.push(className);
|
|
464
680
|
const buttonClass = parts.filter(Boolean).join(" ");
|
|
465
|
-
const content = icon ? /* @__PURE__ */
|
|
681
|
+
const content = icon ? /* @__PURE__ */ jsxDEV6(Layout, {
|
|
466
682
|
inline: true,
|
|
467
683
|
columns: "auto auto",
|
|
468
684
|
gap: "0.5em",
|
|
469
685
|
alignItems: "center",
|
|
470
686
|
children: [
|
|
471
687
|
icon,
|
|
472
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ jsxDEV6("span", {
|
|
473
689
|
children: label
|
|
474
690
|
}, undefined, false, undefined, this)
|
|
475
691
|
]
|
|
@@ -486,13 +702,14 @@ function Button(props) {
|
|
|
486
702
|
}
|
|
487
703
|
}
|
|
488
704
|
if ("href" in props && props.href) {
|
|
489
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsxDEV6("a", {
|
|
490
706
|
id,
|
|
491
707
|
class: buttonClass,
|
|
492
708
|
title,
|
|
493
709
|
href: disabled ? undefined : props.href,
|
|
494
710
|
target: "target" in props ? props.target : undefined,
|
|
495
711
|
rel: "rel" in props ? props.rel : undefined,
|
|
712
|
+
download: "download" in props ? props.download : undefined,
|
|
496
713
|
"aria-disabled": disabled,
|
|
497
714
|
"aria-label": ariaLabel,
|
|
498
715
|
"data-polly-ui": true,
|
|
@@ -503,7 +720,7 @@ function Button(props) {
|
|
|
503
720
|
}, undefined, false, undefined, this);
|
|
504
721
|
}
|
|
505
722
|
const resolvedType = "type" in props && props.type ? props.type : "button";
|
|
506
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsxDEV6("button", {
|
|
507
724
|
id,
|
|
508
725
|
class: buttonClass,
|
|
509
726
|
title,
|
|
@@ -643,6 +860,7 @@ function Surface(props) {
|
|
|
643
860
|
const position = props.position ?? v.position;
|
|
644
861
|
const inset = props.inset ?? v.inset;
|
|
645
862
|
const zIndex = props.zIndex ?? v.zIndex;
|
|
863
|
+
const { maxHeight, overflow, borderStyle, transform } = props;
|
|
646
864
|
const borderWidth = props.borderWidth ?? v.borderWidth ?? (border && border !== "none" ? "default" : undefined);
|
|
647
865
|
const style = {};
|
|
648
866
|
if (padding)
|
|
@@ -657,18 +875,26 @@ function Surface(props) {
|
|
|
657
875
|
style["--s-border-width"] = borderWidthValue(borderWidth);
|
|
658
876
|
if (shadow)
|
|
659
877
|
style["--s-shadow"] = shadowValue(shadow);
|
|
878
|
+
if (borderStyle)
|
|
879
|
+
style["--s-border-style"] = borderStyle;
|
|
660
880
|
if (width)
|
|
661
881
|
style["--s-w"] = width;
|
|
662
882
|
if (height)
|
|
663
883
|
style["--s-h"] = height;
|
|
664
884
|
if (minHeight)
|
|
665
885
|
style["--s-mh"] = minHeight;
|
|
886
|
+
if (maxHeight)
|
|
887
|
+
style["--s-maxh"] = maxHeight;
|
|
666
888
|
if (maxInlineSize)
|
|
667
889
|
style["--s-mis"] = maxInlineSize;
|
|
890
|
+
if (overflow)
|
|
891
|
+
style["--s-overflow"] = overflow;
|
|
668
892
|
if (position)
|
|
669
893
|
style["--s-position"] = position;
|
|
670
894
|
if (inset)
|
|
671
895
|
style["--s-inset"] = inset;
|
|
896
|
+
if (transform)
|
|
897
|
+
style["--s-transform"] = transform;
|
|
672
898
|
if (zIndex !== undefined)
|
|
673
899
|
style["--s-z"] = String(zIndex);
|
|
674
900
|
if (props.style) {
|
|
@@ -715,10 +941,10 @@ function Surface(props) {
|
|
|
715
941
|
}
|
|
716
942
|
|
|
717
943
|
// src/polly-ui/Card.tsx
|
|
718
|
-
import { jsxDEV as
|
|
944
|
+
import { jsxDEV as jsxDEV7 } from "preact/jsx-dev-runtime";
|
|
719
945
|
function Root(props) {
|
|
720
946
|
const { variant = "raised", radius = "md", ...rest } = props;
|
|
721
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ jsxDEV7(Surface, {
|
|
722
948
|
variant,
|
|
723
949
|
radius,
|
|
724
950
|
"data-polly-card": true,
|
|
@@ -733,7 +959,7 @@ function Header(props) {
|
|
|
733
959
|
borderSides = "block-end",
|
|
734
960
|
...rest
|
|
735
961
|
} = props;
|
|
736
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsxDEV7(Surface, {
|
|
737
963
|
padding,
|
|
738
964
|
border,
|
|
739
965
|
borderSides,
|
|
@@ -744,7 +970,7 @@ function Header(props) {
|
|
|
744
970
|
}
|
|
745
971
|
function Body(props) {
|
|
746
972
|
const { padding = "var(--polly-space-lg)", ...rest } = props;
|
|
747
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsxDEV7(Surface, {
|
|
748
974
|
padding,
|
|
749
975
|
"data-polly-card-body": true,
|
|
750
976
|
...rest,
|
|
@@ -758,7 +984,7 @@ function Footer(props) {
|
|
|
758
984
|
borderSides = "block-start",
|
|
759
985
|
...rest
|
|
760
986
|
} = props;
|
|
761
|
-
return /* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ jsxDEV7(Surface, {
|
|
762
988
|
padding,
|
|
763
989
|
border,
|
|
764
990
|
borderSides,
|
|
@@ -777,7 +1003,7 @@ var Checkbox_module_default = {
|
|
|
777
1003
|
};
|
|
778
1004
|
|
|
779
1005
|
// src/polly-ui/Checkbox.tsx
|
|
780
|
-
import { jsxDEV as
|
|
1006
|
+
import { jsxDEV as jsxDEV8 } from "preact/jsx-dev-runtime";
|
|
781
1007
|
function isSignal(value) {
|
|
782
1008
|
return typeof value === "object" && value !== null && "value" in value && "peek" in value;
|
|
783
1009
|
}
|
|
@@ -794,12 +1020,12 @@ function Checkbox(props) {
|
|
|
794
1020
|
parts.push(Checkbox_module_default["disabled"] ?? "");
|
|
795
1021
|
if (className)
|
|
796
1022
|
parts.push(className);
|
|
797
|
-
return /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ jsxDEV8("label", {
|
|
798
1024
|
class: parts.filter(Boolean).join(" "),
|
|
799
1025
|
"data-polly-ui": true,
|
|
800
1026
|
"data-polly-checkbox": true,
|
|
801
1027
|
children: [
|
|
802
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ jsxDEV8("input", {
|
|
803
1029
|
id,
|
|
804
1030
|
type: "checkbox",
|
|
805
1031
|
class: Checkbox_module_default["input"],
|
|
@@ -809,13 +1035,88 @@ function Checkbox(props) {
|
|
|
809
1035
|
disabled,
|
|
810
1036
|
onChange: handleChange
|
|
811
1037
|
}, undefined, false, undefined, this),
|
|
812
|
-
label !== undefined && /* @__PURE__ */
|
|
1038
|
+
label !== undefined && /* @__PURE__ */ jsxDEV8("span", {
|
|
813
1039
|
class: Checkbox_module_default["label"],
|
|
814
1040
|
children: label
|
|
815
1041
|
}, undefined, false, undefined, this)
|
|
816
1042
|
]
|
|
817
1043
|
}, undefined, true, undefined, this);
|
|
818
1044
|
}
|
|
1045
|
+
// src/polly-ui/Cluster.tsx
|
|
1046
|
+
import { createElement as createElement3 } from "preact";
|
|
1047
|
+
|
|
1048
|
+
// src/polly-ui/Cluster.module.css
|
|
1049
|
+
var Cluster_module_default = {
|
|
1050
|
+
cluster: "cluster_pNLz5g",
|
|
1051
|
+
inline: "inline_pNLz5g"
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
// src/polly-ui/Cluster.tsx
|
|
1055
|
+
function Cluster(props) {
|
|
1056
|
+
const { children, as = "div", gap, padding, justify, align, inline, className, id, role } = props;
|
|
1057
|
+
const style = {};
|
|
1058
|
+
if (gap)
|
|
1059
|
+
style["--c-gap"] = gap;
|
|
1060
|
+
if (padding)
|
|
1061
|
+
style["--c-p"] = padding;
|
|
1062
|
+
if (justify)
|
|
1063
|
+
style["--c-jc"] = justify;
|
|
1064
|
+
if (align)
|
|
1065
|
+
style["--c-ai"] = align;
|
|
1066
|
+
const parts = [Cluster_module_default["cluster"]];
|
|
1067
|
+
if (inline)
|
|
1068
|
+
parts.push(Cluster_module_default["inline"]);
|
|
1069
|
+
if (className)
|
|
1070
|
+
parts.push(className);
|
|
1071
|
+
return createElement3(as, {
|
|
1072
|
+
...collectPassthrough(props),
|
|
1073
|
+
id,
|
|
1074
|
+
class: parts.filter(Boolean).join(" "),
|
|
1075
|
+
style,
|
|
1076
|
+
role,
|
|
1077
|
+
"aria-label": props["aria-label"],
|
|
1078
|
+
"data-polly-ui": true,
|
|
1079
|
+
"data-polly-cluster": true
|
|
1080
|
+
}, children);
|
|
1081
|
+
}
|
|
1082
|
+
// src/polly-ui/Code.module.css
|
|
1083
|
+
var Code_module_default = {
|
|
1084
|
+
code: "code_Vc8yiw",
|
|
1085
|
+
block: "block_Vc8yiw"
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1088
|
+
// src/polly-ui/Code.tsx
|
|
1089
|
+
import { jsxDEV as jsxDEV9 } from "preact/jsx-dev-runtime";
|
|
1090
|
+
function Code(props) {
|
|
1091
|
+
const { children, block, className, id } = props;
|
|
1092
|
+
const passthrough = collectPassthrough(props);
|
|
1093
|
+
if (block) {
|
|
1094
|
+
const parts2 = [Code_module_default["block"]];
|
|
1095
|
+
if (className)
|
|
1096
|
+
parts2.push(className);
|
|
1097
|
+
return /* @__PURE__ */ jsxDEV9("pre", {
|
|
1098
|
+
...passthrough,
|
|
1099
|
+
id,
|
|
1100
|
+
class: parts2.filter(Boolean).join(" "),
|
|
1101
|
+
"data-polly-ui": true,
|
|
1102
|
+
"data-polly-code": "block",
|
|
1103
|
+
children: /* @__PURE__ */ jsxDEV9("code", {
|
|
1104
|
+
children
|
|
1105
|
+
}, undefined, false, undefined, this)
|
|
1106
|
+
}, undefined, false, undefined, this);
|
|
1107
|
+
}
|
|
1108
|
+
const parts = [Code_module_default["code"]];
|
|
1109
|
+
if (className)
|
|
1110
|
+
parts.push(className);
|
|
1111
|
+
return /* @__PURE__ */ jsxDEV9("code", {
|
|
1112
|
+
...passthrough,
|
|
1113
|
+
id,
|
|
1114
|
+
class: parts.filter(Boolean).join(" "),
|
|
1115
|
+
"data-polly-ui": true,
|
|
1116
|
+
"data-polly-code": "inline",
|
|
1117
|
+
children
|
|
1118
|
+
}, undefined, false, undefined, this);
|
|
1119
|
+
}
|
|
819
1120
|
// src/polly-ui/Collapsible.module.css
|
|
820
1121
|
var Collapsible_module_default = {
|
|
821
1122
|
collapsible: "collapsible_sEhnPw",
|
|
@@ -824,24 +1125,24 @@ var Collapsible_module_default = {
|
|
|
824
1125
|
};
|
|
825
1126
|
|
|
826
1127
|
// src/polly-ui/Collapsible.tsx
|
|
827
|
-
import { jsxDEV as
|
|
1128
|
+
import { jsxDEV as jsxDEV10 } from "preact/jsx-dev-runtime";
|
|
828
1129
|
function Collapsible(props) {
|
|
829
1130
|
const { summary, children, defaultOpen = false, className, id } = props;
|
|
830
1131
|
const parts = [Collapsible_module_default["collapsible"]];
|
|
831
1132
|
if (className)
|
|
832
1133
|
parts.push(className);
|
|
833
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ jsxDEV10("details", {
|
|
834
1135
|
id,
|
|
835
1136
|
class: parts.join(" "),
|
|
836
1137
|
open: defaultOpen,
|
|
837
1138
|
"data-polly-ui": true,
|
|
838
1139
|
"data-polly-collapsible": true,
|
|
839
1140
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsxDEV10("summary", {
|
|
841
1142
|
class: Collapsible_module_default["summary"],
|
|
842
1143
|
children: summary
|
|
843
1144
|
}, undefined, false, undefined, this),
|
|
844
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsxDEV10("div", {
|
|
845
1146
|
class: Collapsible_module_default["content"],
|
|
846
1147
|
children
|
|
847
1148
|
}, undefined, false, undefined, this)
|
|
@@ -862,7 +1163,7 @@ var ConfirmDialog_module_default = {
|
|
|
862
1163
|
// src/polly-ui/Modal.tsx
|
|
863
1164
|
import { createContext } from "preact";
|
|
864
1165
|
import { createPortal } from "preact/compat";
|
|
865
|
-
import { useContext, useEffect as
|
|
1166
|
+
import { useContext, useEffect as useEffect4, useId, useRef as useRef4, useState as useState2 } from "preact/hooks";
|
|
866
1167
|
|
|
867
1168
|
// src/actions/overlay.ts
|
|
868
1169
|
import { signal } from "@preact/signals";
|
|
@@ -978,7 +1279,7 @@ var Modal_module_default = {
|
|
|
978
1279
|
|
|
979
1280
|
// src/polly-ui/OverlayRoot.tsx
|
|
980
1281
|
import { effect } from "@preact/signals";
|
|
981
|
-
import { useEffect as
|
|
1282
|
+
import { useEffect as useEffect3, useRef as useRef3 } from "preact/hooks";
|
|
982
1283
|
|
|
983
1284
|
// src/polly-ui/internal/scroll-lock.ts
|
|
984
1285
|
var count = 0;
|
|
@@ -1011,10 +1312,10 @@ var OverlayRoot_module_default = {
|
|
|
1011
1312
|
};
|
|
1012
1313
|
|
|
1013
1314
|
// src/polly-ui/OverlayRoot.tsx
|
|
1014
|
-
import { jsxDEV as
|
|
1315
|
+
import { jsxDEV as jsxDEV11 } from "preact/jsx-dev-runtime";
|
|
1015
1316
|
function OverlayRoot() {
|
|
1016
|
-
const ref =
|
|
1017
|
-
|
|
1317
|
+
const ref = useRef3(null);
|
|
1318
|
+
useEffect3(() => {
|
|
1018
1319
|
let release = null;
|
|
1019
1320
|
const dispose = effect(() => {
|
|
1020
1321
|
if (hasOpenOverlay()) {
|
|
@@ -1030,7 +1331,7 @@ function OverlayRoot() {
|
|
|
1030
1331
|
release?.();
|
|
1031
1332
|
};
|
|
1032
1333
|
}, []);
|
|
1033
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsxDEV11("div", {
|
|
1034
1335
|
ref,
|
|
1035
1336
|
class: OverlayRoot_module_default["root"],
|
|
1036
1337
|
"data-polly-ui": true,
|
|
@@ -1042,7 +1343,7 @@ function getOverlayRootNode() {
|
|
|
1042
1343
|
}
|
|
1043
1344
|
|
|
1044
1345
|
// src/polly-ui/Modal.tsx
|
|
1045
|
-
import { jsxDEV as
|
|
1346
|
+
import { jsxDEV as jsxDEV12 } from "preact/jsx-dev-runtime";
|
|
1046
1347
|
var Ctx = createContext(null);
|
|
1047
1348
|
function useModal() {
|
|
1048
1349
|
const ctx = useContext(Ctx);
|
|
@@ -1054,17 +1355,17 @@ function Root2({ when, onClose, children, "aria-label": ariaLabel }) {
|
|
|
1054
1355
|
const id = useId();
|
|
1055
1356
|
const titleId = `${id}-title`;
|
|
1056
1357
|
const descId = `${id}-desc`;
|
|
1057
|
-
const mountRef =
|
|
1358
|
+
const mountRef = useRef4(null);
|
|
1058
1359
|
const [portalNode, setPortalNode] = useState2(null);
|
|
1059
1360
|
const isOpen = typeof when === "boolean" ? when : when.value;
|
|
1060
|
-
|
|
1361
|
+
useEffect4(() => {
|
|
1061
1362
|
if (!isOpen) {
|
|
1062
1363
|
setPortalNode(null);
|
|
1063
1364
|
return;
|
|
1064
1365
|
}
|
|
1065
1366
|
setPortalNode(getOverlayRootNode());
|
|
1066
1367
|
}, [isOpen]);
|
|
1067
|
-
|
|
1368
|
+
useEffect4(() => {
|
|
1068
1369
|
if (!isOpen || !portalNode)
|
|
1069
1370
|
return;
|
|
1070
1371
|
const entry = { id, onClose };
|
|
@@ -1082,9 +1383,9 @@ function Root2({ when, onClose, children, "aria-label": ariaLabel }) {
|
|
|
1082
1383
|
onClose?.();
|
|
1083
1384
|
};
|
|
1084
1385
|
const ctx = { id, titleId, descId, close };
|
|
1085
|
-
const content = /* @__PURE__ */
|
|
1386
|
+
const content = /* @__PURE__ */ jsxDEV12(Ctx.Provider, {
|
|
1086
1387
|
value: ctx,
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1388
|
+
children: /* @__PURE__ */ jsxDEV12("div", {
|
|
1088
1389
|
ref: mountRef,
|
|
1089
1390
|
class: Modal_module_default["container"],
|
|
1090
1391
|
"data-polly-ui": true,
|
|
@@ -1103,7 +1404,7 @@ function Root2({ when, onClose, children, "aria-label": ariaLabel }) {
|
|
|
1103
1404
|
}
|
|
1104
1405
|
function Backdrop() {
|
|
1105
1406
|
const { close } = useModal();
|
|
1106
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1107
1408
|
class: Modal_module_default["backdrop"],
|
|
1108
1409
|
"data-polly-modal-backdrop": true,
|
|
1109
1410
|
onClick: close,
|
|
@@ -1112,7 +1413,7 @@ function Backdrop() {
|
|
|
1112
1413
|
}
|
|
1113
1414
|
function Content({ children, className, style }) {
|
|
1114
1415
|
const cls = className ? `${Modal_module_default["surface"]} ${className}` : Modal_module_default["surface"];
|
|
1115
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsxDEV12(Surface, {
|
|
1116
1417
|
variant: "raised",
|
|
1117
1418
|
radius: "lg",
|
|
1118
1419
|
shadow: "lg",
|
|
@@ -1124,7 +1425,7 @@ function Content({ children, className, style }) {
|
|
|
1124
1425
|
}, undefined, false, undefined, this);
|
|
1125
1426
|
}
|
|
1126
1427
|
function Header2({ children }) {
|
|
1127
|
-
return /* @__PURE__ */
|
|
1428
|
+
return /* @__PURE__ */ jsxDEV12("header", {
|
|
1128
1429
|
class: Modal_module_default["header"],
|
|
1129
1430
|
"data-polly-modal-header": true,
|
|
1130
1431
|
children
|
|
@@ -1132,7 +1433,7 @@ function Header2({ children }) {
|
|
|
1132
1433
|
}
|
|
1133
1434
|
function Title({ children }) {
|
|
1134
1435
|
const { titleId } = useModal();
|
|
1135
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ jsxDEV12("h2", {
|
|
1136
1437
|
id: titleId,
|
|
1137
1438
|
class: Modal_module_default["title"],
|
|
1138
1439
|
"data-polly-modal-title": true,
|
|
@@ -1141,7 +1442,7 @@ function Title({ children }) {
|
|
|
1141
1442
|
}
|
|
1142
1443
|
function Body2({ children }) {
|
|
1143
1444
|
const { descId } = useModal();
|
|
1144
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ jsxDEV12("div", {
|
|
1145
1446
|
id: descId,
|
|
1146
1447
|
class: Modal_module_default["body"],
|
|
1147
1448
|
"data-polly-modal-body": true,
|
|
@@ -1149,7 +1450,7 @@ function Body2({ children }) {
|
|
|
1149
1450
|
}, undefined, false, undefined, this);
|
|
1150
1451
|
}
|
|
1151
1452
|
function Footer2({ children }) {
|
|
1152
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsxDEV12("footer", {
|
|
1153
1454
|
class: Modal_module_default["footer"],
|
|
1154
1455
|
"data-polly-modal-footer": true,
|
|
1155
1456
|
children
|
|
@@ -1158,7 +1459,7 @@ function Footer2({ children }) {
|
|
|
1158
1459
|
function Close({ children, action }) {
|
|
1159
1460
|
const { close } = useModal();
|
|
1160
1461
|
if (action) {
|
|
1161
|
-
return /* @__PURE__ */
|
|
1462
|
+
return /* @__PURE__ */ jsxDEV12("button", {
|
|
1162
1463
|
type: "button",
|
|
1163
1464
|
class: Modal_module_default["close"],
|
|
1164
1465
|
"data-polly-ui": true,
|
|
@@ -1168,7 +1469,7 @@ function Close({ children, action }) {
|
|
|
1168
1469
|
children
|
|
1169
1470
|
}, undefined, false, undefined, this);
|
|
1170
1471
|
}
|
|
1171
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ jsxDEV12("button", {
|
|
1172
1473
|
type: "button",
|
|
1173
1474
|
class: Modal_module_default["close"],
|
|
1174
1475
|
"data-polly-ui": true,
|
|
@@ -1190,7 +1491,7 @@ var Modal = {
|
|
|
1190
1491
|
};
|
|
1191
1492
|
|
|
1192
1493
|
// src/polly-ui/ConfirmDialog.tsx
|
|
1193
|
-
import { jsxDEV as
|
|
1494
|
+
import { jsxDEV as jsxDEV13 } from "preact/jsx-dev-runtime";
|
|
1194
1495
|
var pending = signal2(null);
|
|
1195
1496
|
var isOpen = signal2(false);
|
|
1196
1497
|
var nextId = 0;
|
|
@@ -1221,27 +1522,27 @@ function Host() {
|
|
|
1221
1522
|
const current = pending.value;
|
|
1222
1523
|
if (!current)
|
|
1223
1524
|
return null;
|
|
1224
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ jsxDEV13(Modal.Root, {
|
|
1225
1526
|
when: isOpen,
|
|
1226
1527
|
onClose: () => close(false),
|
|
1227
1528
|
children: [
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ jsxDEV13(Modal.Backdrop, {}, undefined, false, undefined, this),
|
|
1530
|
+
/* @__PURE__ */ jsxDEV13(Modal.Content, {
|
|
1230
1531
|
children: [
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
children: /* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ jsxDEV13(Modal.Header, {
|
|
1533
|
+
children: /* @__PURE__ */ jsxDEV13(Modal.Title, {
|
|
1233
1534
|
children: current.title
|
|
1234
1535
|
}, undefined, false, undefined, this)
|
|
1235
1536
|
}, undefined, false, undefined, this),
|
|
1236
|
-
current.body ? /* @__PURE__ */
|
|
1537
|
+
current.body ? /* @__PURE__ */ jsxDEV13(Modal.Body, {
|
|
1237
1538
|
children: current.body
|
|
1238
1539
|
}, undefined, false, undefined, this) : null,
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
children: /* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsxDEV13(Modal.Footer, {
|
|
1541
|
+
children: /* @__PURE__ */ jsxDEV13("div", {
|
|
1241
1542
|
class: ConfirmDialog_module_default["actions"],
|
|
1242
1543
|
"data-polly-confirm-actions": true,
|
|
1243
1544
|
children: [
|
|
1244
|
-
/* @__PURE__ */
|
|
1545
|
+
/* @__PURE__ */ jsxDEV13("button", {
|
|
1245
1546
|
type: "button",
|
|
1246
1547
|
class: ConfirmDialog_module_default["cancel"],
|
|
1247
1548
|
"data-polly-ui": true,
|
|
@@ -1250,7 +1551,7 @@ function Host() {
|
|
|
1250
1551
|
onClick: () => close(false),
|
|
1251
1552
|
children: current.cancelLabel ?? "Cancel"
|
|
1252
1553
|
}, undefined, false, undefined, this),
|
|
1253
|
-
/* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ jsxDEV13("button", {
|
|
1254
1555
|
type: "button",
|
|
1255
1556
|
class: current.danger ? ConfirmDialog_module_default["confirmDanger"] : ConfirmDialog_module_default["confirm"],
|
|
1256
1557
|
"data-polly-ui": true,
|
|
@@ -1268,124 +1569,9 @@ function Host() {
|
|
|
1268
1569
|
}, undefined, true, undefined, this);
|
|
1269
1570
|
}
|
|
1270
1571
|
var ConfirmDialog = { Host, confirm };
|
|
1271
|
-
// src/polly-ui/Dropdown.tsx
|
|
1272
|
-
import { useSignalEffect } from "@preact/signals";
|
|
1273
|
-
import { useEffect as useEffect4, useRef as useRef4 } from "preact/hooks";
|
|
1274
|
-
|
|
1275
|
-
// src/polly-ui/Dropdown.module.css
|
|
1276
|
-
var Dropdown_module_default = {
|
|
1277
|
-
dropdown: "dropdown_HX48zA",
|
|
1278
|
-
trigger: "trigger_HX48zA",
|
|
1279
|
-
menu: "menu_HX48zA",
|
|
1280
|
-
alignRight: "alignRight_HX48zA"
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
// src/polly-ui/Dropdown.tsx
|
|
1284
|
-
import { jsxDEV as jsxDEV11 } from "preact/jsx-dev-runtime";
|
|
1285
|
-
var dropdownCounter = 0;
|
|
1286
|
-
function Dropdown(props) {
|
|
1287
|
-
const { isOpen: isOpen2, trigger, children, align = "left", multiSelect = false, className, id } = props;
|
|
1288
|
-
const menuRef = useRef4(null);
|
|
1289
|
-
const triggerRef = useRef4(null);
|
|
1290
|
-
const idRef = useRef4(`polly-dropdown-${++dropdownCounter}`);
|
|
1291
|
-
const popoverId = idRef.current;
|
|
1292
|
-
useEffect4(() => {
|
|
1293
|
-
triggerRef.current?.setAttribute("popovertarget", popoverId);
|
|
1294
|
-
}, [popoverId]);
|
|
1295
|
-
useEffect4(() => {
|
|
1296
|
-
const menu = menuRef.current;
|
|
1297
|
-
if (!menu)
|
|
1298
|
-
return;
|
|
1299
|
-
const onOverlayClose = (e) => {
|
|
1300
|
-
if (e instanceof CustomEvent && e.detail?.id === popoverId) {
|
|
1301
|
-
isOpen2.value = false;
|
|
1302
|
-
}
|
|
1303
|
-
};
|
|
1304
|
-
menu.addEventListener("overlay:close", onOverlayClose);
|
|
1305
|
-
return () => {
|
|
1306
|
-
menu.removeEventListener("overlay:close", onOverlayClose);
|
|
1307
|
-
};
|
|
1308
|
-
}, [popoverId, isOpen2]);
|
|
1309
|
-
useSignalEffect(() => {
|
|
1310
|
-
const menu = menuRef.current;
|
|
1311
|
-
if (!menu)
|
|
1312
|
-
return;
|
|
1313
|
-
if (isOpen2.value && !menu.matches(":popover-open")) {
|
|
1314
|
-
menu.showPopover();
|
|
1315
|
-
} else if (!isOpen2.value && menu.matches(":popover-open")) {
|
|
1316
|
-
menu.hidePopover();
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
|
-
const handleToggle = (e) => {
|
|
1320
|
-
if ("newState" in e) {
|
|
1321
|
-
isOpen2.value = e.newState === "open";
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
const handleMenuClick = () => {
|
|
1325
|
-
if (!multiSelect) {
|
|
1326
|
-
isOpen2.value = false;
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
const handleKeyDown = (e) => {
|
|
1330
|
-
if (e.key === "Escape") {
|
|
1331
|
-
isOpen2.value = false;
|
|
1332
|
-
}
|
|
1333
|
-
};
|
|
1334
|
-
const parts = [Dropdown_module_default["dropdown"] ?? ""];
|
|
1335
|
-
if (className)
|
|
1336
|
-
parts.push(className);
|
|
1337
|
-
const menuParts = [Dropdown_module_default["menu"] ?? ""];
|
|
1338
|
-
if (align === "right")
|
|
1339
|
-
menuParts.push(Dropdown_module_default["alignRight"] ?? "");
|
|
1340
|
-
return /* @__PURE__ */ jsxDEV11("div", {
|
|
1341
|
-
id,
|
|
1342
|
-
class: parts.filter(Boolean).join(" "),
|
|
1343
|
-
"data-polly-ui": true,
|
|
1344
|
-
"data-polly-dropdown": true,
|
|
1345
|
-
children: [
|
|
1346
|
-
/* @__PURE__ */ jsxDEV11("button", {
|
|
1347
|
-
ref: triggerRef,
|
|
1348
|
-
type: "button",
|
|
1349
|
-
class: Dropdown_module_default["trigger"],
|
|
1350
|
-
children: trigger
|
|
1351
|
-
}, undefined, false, undefined, this),
|
|
1352
|
-
/* @__PURE__ */ jsxDEV11("div", {
|
|
1353
|
-
ref: menuRef,
|
|
1354
|
-
id: popoverId,
|
|
1355
|
-
role: "listbox",
|
|
1356
|
-
class: menuParts.filter(Boolean).join(" "),
|
|
1357
|
-
popover: "auto",
|
|
1358
|
-
"data-overlay-id": popoverId,
|
|
1359
|
-
onToggle: handleToggle,
|
|
1360
|
-
onClick: handleMenuClick,
|
|
1361
|
-
onKeyDown: handleKeyDown,
|
|
1362
|
-
children: /* @__PURE__ */ jsxDEV11(Layout, {
|
|
1363
|
-
rows: "auto",
|
|
1364
|
-
gap: "0",
|
|
1365
|
-
children
|
|
1366
|
-
}, undefined, false, undefined, this)
|
|
1367
|
-
}, undefined, false, undefined, this)
|
|
1368
|
-
]
|
|
1369
|
-
}, undefined, true, undefined, this);
|
|
1370
|
-
}
|
|
1371
|
-
// src/polly-ui/Select.tsx
|
|
1372
|
-
import { useComputed, useSignal } from "@preact/signals";
|
|
1373
|
-
|
|
1374
|
-
// src/polly-ui/Select.module.css
|
|
1375
|
-
var Select_module_default = {
|
|
1376
|
-
select: "select_daofbw",
|
|
1377
|
-
label: "label_daofbw",
|
|
1378
|
-
trigger: "trigger_daofbw",
|
|
1379
|
-
placeholder: "placeholder_daofbw",
|
|
1380
|
-
actions: "actions_daofbw",
|
|
1381
|
-
actionBtn: "actionBtn_daofbw",
|
|
1382
|
-
option: "option_daofbw",
|
|
1383
|
-
optionSelected: "optionSelected_daofbw",
|
|
1384
|
-
optionCheck: "optionCheck_daofbw"
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1387
1572
|
// src/polly-ui/Select.tsx
|
|
1388
|
-
import {
|
|
1573
|
+
import { useComputed, useSignal as useSignal2 } from "@preact/signals";
|
|
1574
|
+
import { jsxDEV as jsxDEV14 } from "preact/jsx-dev-runtime";
|
|
1389
1575
|
function formatSelected(options, selected) {
|
|
1390
1576
|
if (selected.size === 0)
|
|
1391
1577
|
return "";
|
|
@@ -1407,7 +1593,7 @@ function Select(props) {
|
|
|
1407
1593
|
className,
|
|
1408
1594
|
id
|
|
1409
1595
|
} = props;
|
|
1410
|
-
const isOpen2 =
|
|
1596
|
+
const isOpen2 = useSignal2(false);
|
|
1411
1597
|
const displayText = useComputed(() => {
|
|
1412
1598
|
const text = formatSelected(options, selected.value);
|
|
1413
1599
|
return text.length > 0 ? text : placeholder;
|
|
@@ -1433,7 +1619,7 @@ function Select(props) {
|
|
|
1433
1619
|
selected.value = new Set;
|
|
1434
1620
|
};
|
|
1435
1621
|
const triggerClass = isEmpty.value ? `${Select_module_default["trigger"]} ${Select_module_default["placeholder"]}` : Select_module_default["trigger"];
|
|
1436
|
-
const triggerButton = /* @__PURE__ */
|
|
1622
|
+
const triggerButton = /* @__PURE__ */ jsxDEV14("button", {
|
|
1437
1623
|
type: "button",
|
|
1438
1624
|
class: triggerClass,
|
|
1439
1625
|
disabled,
|
|
@@ -1442,34 +1628,34 @@ function Select(props) {
|
|
|
1442
1628
|
const parts = [Select_module_default["select"] ?? ""];
|
|
1443
1629
|
if (className)
|
|
1444
1630
|
parts.push(className);
|
|
1445
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsxDEV14("div", {
|
|
1446
1632
|
id,
|
|
1447
1633
|
class: parts.filter(Boolean).join(" "),
|
|
1448
1634
|
"data-polly-ui": true,
|
|
1449
1635
|
"data-polly-select": true,
|
|
1450
1636
|
children: [
|
|
1451
|
-
label !== undefined && /* @__PURE__ */
|
|
1637
|
+
label !== undefined && /* @__PURE__ */ jsxDEV14("span", {
|
|
1452
1638
|
class: Select_module_default["label"],
|
|
1453
1639
|
children: label
|
|
1454
1640
|
}, undefined, false, undefined, this),
|
|
1455
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ jsxDEV14(Dropdown, {
|
|
1456
1642
|
isOpen: isOpen2,
|
|
1457
1643
|
trigger: triggerButton,
|
|
1458
1644
|
multiSelect,
|
|
1459
1645
|
children: [
|
|
1460
|
-
multiSelect && /* @__PURE__ */
|
|
1646
|
+
multiSelect && /* @__PURE__ */ jsxDEV14("div", {
|
|
1461
1647
|
class: Select_module_default["actions"],
|
|
1462
|
-
children: /* @__PURE__ */
|
|
1648
|
+
children: /* @__PURE__ */ jsxDEV14(Layout, {
|
|
1463
1649
|
columns: "1fr 1fr",
|
|
1464
1650
|
gap: "var(--polly-space-xs)",
|
|
1465
1651
|
children: [
|
|
1466
|
-
/* @__PURE__ */
|
|
1652
|
+
/* @__PURE__ */ jsxDEV14("button", {
|
|
1467
1653
|
type: "button",
|
|
1468
1654
|
class: Select_module_default["actionBtn"],
|
|
1469
1655
|
onClick: handleSelectAll,
|
|
1470
1656
|
children: "Select All"
|
|
1471
1657
|
}, undefined, false, undefined, this),
|
|
1472
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ jsxDEV14("button", {
|
|
1473
1659
|
type: "button",
|
|
1474
1660
|
class: Select_module_default["actionBtn"],
|
|
1475
1661
|
onClick: handleClear,
|
|
@@ -1481,19 +1667,19 @@ function Select(props) {
|
|
|
1481
1667
|
options.map((opt) => {
|
|
1482
1668
|
const isSelected = selected.value.has(opt.value);
|
|
1483
1669
|
const optClass = isSelected ? `${Select_module_default["option"]} ${Select_module_default["optionSelected"]}` : Select_module_default["option"];
|
|
1484
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ jsxDEV14("button", {
|
|
1485
1671
|
type: "button",
|
|
1486
1672
|
class: optClass,
|
|
1487
1673
|
onClick: () => handleOptionClick(opt.value),
|
|
1488
1674
|
children: [
|
|
1489
|
-
multiSelect && /* @__PURE__ */
|
|
1675
|
+
multiSelect && /* @__PURE__ */ jsxDEV14("input", {
|
|
1490
1676
|
type: "checkbox",
|
|
1491
1677
|
class: Select_module_default["optionCheck"],
|
|
1492
1678
|
checked: isSelected,
|
|
1493
1679
|
tabIndex: -1,
|
|
1494
1680
|
readOnly: true
|
|
1495
1681
|
}, undefined, false, undefined, this),
|
|
1496
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ jsxDEV14("span", {
|
|
1497
1683
|
children: opt.label
|
|
1498
1684
|
}, undefined, false, undefined, this)
|
|
1499
1685
|
]
|
|
@@ -1513,7 +1699,7 @@ var Skeleton_module_default = {
|
|
|
1513
1699
|
};
|
|
1514
1700
|
|
|
1515
1701
|
// src/polly-ui/Skeleton.tsx
|
|
1516
|
-
import { jsxDEV as
|
|
1702
|
+
import { jsxDEV as jsxDEV15 } from "preact/jsx-dev-runtime";
|
|
1517
1703
|
function resolveSize(value) {
|
|
1518
1704
|
if (value === undefined)
|
|
1519
1705
|
return;
|
|
@@ -1546,7 +1732,7 @@ function Skeleton(props) {
|
|
|
1546
1732
|
parts.push(vClass);
|
|
1547
1733
|
if (className)
|
|
1548
1734
|
parts.push(className);
|
|
1549
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ jsxDEV15("span", {
|
|
1550
1736
|
class: parts.join(" "),
|
|
1551
1737
|
style,
|
|
1552
1738
|
"data-polly-ui": true,
|
|
@@ -1562,26 +1748,26 @@ var Tabs_module_default = {
|
|
|
1562
1748
|
};
|
|
1563
1749
|
|
|
1564
1750
|
// src/polly-ui/Tabs.tsx
|
|
1565
|
-
import { jsxDEV as
|
|
1751
|
+
import { jsxDEV as jsxDEV16 } from "preact/jsx-dev-runtime";
|
|
1566
1752
|
function Tabs(props) {
|
|
1567
1753
|
const { tabs, activeTab, action, className, id } = props;
|
|
1568
1754
|
const parts = [Tabs_module_default["tabs"] ?? ""];
|
|
1569
1755
|
if (className)
|
|
1570
1756
|
parts.push(className);
|
|
1571
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ jsxDEV16("nav", {
|
|
1572
1758
|
id,
|
|
1573
1759
|
class: parts.filter(Boolean).join(" "),
|
|
1574
1760
|
"aria-label": props["aria-label"],
|
|
1575
1761
|
"data-polly-ui": true,
|
|
1576
1762
|
"data-polly-tabs": true,
|
|
1577
|
-
children: /* @__PURE__ */
|
|
1763
|
+
children: /* @__PURE__ */ jsxDEV16(Layout, {
|
|
1578
1764
|
columns: `repeat(${tabs.length}, auto)`,
|
|
1579
1765
|
gap: "0",
|
|
1580
1766
|
alignItems: "end",
|
|
1581
1767
|
children: tabs.map((tab) => {
|
|
1582
1768
|
const isActive = activeTab === tab.id;
|
|
1583
1769
|
const tabClass = isActive ? `${Tabs_module_default["tab"]} ${Tabs_module_default["active"]}` : Tabs_module_default["tab"];
|
|
1584
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ jsxDEV16("button", {
|
|
1585
1771
|
type: "button",
|
|
1586
1772
|
class: tabClass,
|
|
1587
1773
|
disabled: tab.disabled,
|
|
@@ -1594,6 +1780,65 @@ function Tabs(props) {
|
|
|
1594
1780
|
}, undefined, false, undefined, this)
|
|
1595
1781
|
}, undefined, false, undefined, this);
|
|
1596
1782
|
}
|
|
1783
|
+
// src/polly-ui/Text.tsx
|
|
1784
|
+
import { createElement as createElement4 } from "preact";
|
|
1785
|
+
|
|
1786
|
+
// src/polly-ui/Text.module.css
|
|
1787
|
+
var Text_module_default = {
|
|
1788
|
+
text: "text_75HKdQ",
|
|
1789
|
+
muted: "muted_75HKdQ",
|
|
1790
|
+
danger: "danger_75HKdQ",
|
|
1791
|
+
warning: "warning_75HKdQ",
|
|
1792
|
+
success: "success_75HKdQ",
|
|
1793
|
+
italic: "italic_75HKdQ",
|
|
1794
|
+
tight: "tight_75HKdQ",
|
|
1795
|
+
base: "base_75HKdQ",
|
|
1796
|
+
loose: "loose_75HKdQ",
|
|
1797
|
+
xs: "xs_75HKdQ",
|
|
1798
|
+
sm: "sm_75HKdQ",
|
|
1799
|
+
md: "md_75HKdQ",
|
|
1800
|
+
lg: "lg_75HKdQ",
|
|
1801
|
+
xl: "xl_75HKdQ",
|
|
1802
|
+
normal: "normal_75HKdQ",
|
|
1803
|
+
medium: "medium_75HKdQ",
|
|
1804
|
+
bold: "bold_75HKdQ"
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
// src/polly-ui/Text.tsx
|
|
1808
|
+
function Text(props) {
|
|
1809
|
+
const {
|
|
1810
|
+
children,
|
|
1811
|
+
as = "span",
|
|
1812
|
+
tone = "default",
|
|
1813
|
+
size,
|
|
1814
|
+
weight,
|
|
1815
|
+
italic,
|
|
1816
|
+
leading,
|
|
1817
|
+
className,
|
|
1818
|
+
id
|
|
1819
|
+
} = props;
|
|
1820
|
+
const parts = [Text_module_default["text"]];
|
|
1821
|
+
if (tone !== "default")
|
|
1822
|
+
parts.push(Text_module_default[tone]);
|
|
1823
|
+
if (size)
|
|
1824
|
+
parts.push(Text_module_default[size]);
|
|
1825
|
+
if (weight)
|
|
1826
|
+
parts.push(Text_module_default[weight]);
|
|
1827
|
+
if (italic)
|
|
1828
|
+
parts.push(Text_module_default["italic"]);
|
|
1829
|
+
if (leading)
|
|
1830
|
+
parts.push(Text_module_default[leading]);
|
|
1831
|
+
if (className)
|
|
1832
|
+
parts.push(className);
|
|
1833
|
+
return createElement4(as, {
|
|
1834
|
+
...collectPassthrough(props),
|
|
1835
|
+
id,
|
|
1836
|
+
class: parts.filter(Boolean).join(" "),
|
|
1837
|
+
for: props.htmlFor,
|
|
1838
|
+
"data-polly-ui": true,
|
|
1839
|
+
"data-polly-text": tone
|
|
1840
|
+
}, children);
|
|
1841
|
+
}
|
|
1597
1842
|
// src/polly-ui/internal/input-base.ts
|
|
1598
1843
|
function buildInputA11y(props) {
|
|
1599
1844
|
const attrs = {
|
|
@@ -1619,7 +1864,7 @@ var TextInput_module_default = {
|
|
|
1619
1864
|
};
|
|
1620
1865
|
|
|
1621
1866
|
// src/polly-ui/TextInput.tsx
|
|
1622
|
-
import { jsxDEV as
|
|
1867
|
+
import { jsxDEV as jsxDEV17 } from "preact/jsx-dev-runtime";
|
|
1623
1868
|
function isSignal2(v) {
|
|
1624
1869
|
return typeof v === "object" && v !== null && "value" in v && "peek" in v;
|
|
1625
1870
|
}
|
|
@@ -1640,7 +1885,7 @@ function TextInput(props) {
|
|
|
1640
1885
|
const defaultValue = controlled ? undefined : props.value ?? "";
|
|
1641
1886
|
const className = props.className ? `${TextInput_module_default["input"]} ${props.className}` : TextInput_module_default["input"];
|
|
1642
1887
|
if (variant === "multi") {
|
|
1643
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ jsxDEV17("textarea", {
|
|
1644
1889
|
...a11y,
|
|
1645
1890
|
class: className,
|
|
1646
1891
|
"data-polly-input-variant": "multi",
|
|
@@ -1655,7 +1900,7 @@ function TextInput(props) {
|
|
|
1655
1900
|
}
|
|
1656
1901
|
}, undefined, false, undefined, this);
|
|
1657
1902
|
}
|
|
1658
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsxDEV17("input", {
|
|
1659
1904
|
...a11y,
|
|
1660
1905
|
type: "text",
|
|
1661
1906
|
class: className,
|
|
@@ -1714,7 +1959,7 @@ var Toast_module_default = {
|
|
|
1714
1959
|
};
|
|
1715
1960
|
|
|
1716
1961
|
// src/polly-ui/Toast.tsx
|
|
1717
|
-
import { jsxDEV as
|
|
1962
|
+
import { jsxDEV as jsxDEV18 } from "preact/jsx-dev-runtime";
|
|
1718
1963
|
function Viewport(props) {
|
|
1719
1964
|
const autoDismissMs = props.autoDismissMs ?? 5000;
|
|
1720
1965
|
const [portalNode, setPortalNode] = useState3(null);
|
|
@@ -1736,13 +1981,13 @@ function Viewport(props) {
|
|
|
1736
1981
|
}, [paused, entries, autoDismissMs]);
|
|
1737
1982
|
if (!portalNode)
|
|
1738
1983
|
return null;
|
|
1739
|
-
const content = /* @__PURE__ */
|
|
1984
|
+
const content = /* @__PURE__ */ jsxDEV18("div", {
|
|
1740
1985
|
class: `${Toast_module_default["viewport"]} ${props.className ?? ""}`.trim(),
|
|
1741
1986
|
"data-polly-ui": true,
|
|
1742
1987
|
"data-polly-toast-viewport": true,
|
|
1743
1988
|
onMouseEnter: () => setPaused(true),
|
|
1744
1989
|
onMouseLeave: () => setPaused(false),
|
|
1745
|
-
children: entries.map((entry) => /* @__PURE__ */
|
|
1990
|
+
children: entries.map((entry) => /* @__PURE__ */ jsxDEV18(ToastItem, {
|
|
1746
1991
|
entry
|
|
1747
1992
|
}, entry.id, false, undefined, this))
|
|
1748
1993
|
}, undefined, false, undefined, this);
|
|
@@ -1750,7 +1995,7 @@ function Viewport(props) {
|
|
|
1750
1995
|
}
|
|
1751
1996
|
function ToastItem({ entry }) {
|
|
1752
1997
|
const liveness = entry.severity === "error" ? "assertive" : "polite";
|
|
1753
|
-
return /* @__PURE__ */
|
|
1998
|
+
return /* @__PURE__ */ jsxDEV18(Surface, {
|
|
1754
1999
|
variant: "raised",
|
|
1755
2000
|
padding: "var(--polly-space-md) var(--polly-space-lg)",
|
|
1756
2001
|
className: Toast_module_default["item"],
|
|
@@ -1760,11 +2005,11 @@ function ToastItem({ entry }) {
|
|
|
1760
2005
|
role: entry.severity === "error" ? "alert" : "status",
|
|
1761
2006
|
"aria-live": liveness,
|
|
1762
2007
|
children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ jsxDEV18("span", {
|
|
1764
2009
|
class: Toast_module_default["message"],
|
|
1765
2010
|
children: entry.message
|
|
1766
2011
|
}, undefined, false, undefined, this),
|
|
1767
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsxDEV18("button", {
|
|
1768
2013
|
type: "button",
|
|
1769
2014
|
class: Toast_module_default["close"],
|
|
1770
2015
|
"data-polly-ui": true,
|
|
@@ -1791,7 +2036,7 @@ var Toggle_module_default = {
|
|
|
1791
2036
|
};
|
|
1792
2037
|
|
|
1793
2038
|
// src/polly-ui/Toggle.tsx
|
|
1794
|
-
import { jsxDEV as
|
|
2039
|
+
import { jsxDEV as jsxDEV19 } from "preact/jsx-dev-runtime";
|
|
1795
2040
|
function Toggle(props) {
|
|
1796
2041
|
const { checked = false, disabled = false, label, name, className, id } = props;
|
|
1797
2042
|
const parts = [Toggle_module_default["toggle"]];
|
|
@@ -1799,12 +2044,12 @@ function Toggle(props) {
|
|
|
1799
2044
|
parts.push(Toggle_module_default["disabled"]);
|
|
1800
2045
|
if (className)
|
|
1801
2046
|
parts.push(className);
|
|
1802
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ jsxDEV19("label", {
|
|
1803
2048
|
class: parts.join(" "),
|
|
1804
2049
|
"data-polly-ui": true,
|
|
1805
2050
|
"data-polly-toggle": true,
|
|
1806
2051
|
children: [
|
|
1807
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ jsxDEV19("input", {
|
|
1808
2053
|
id,
|
|
1809
2054
|
type: "checkbox",
|
|
1810
2055
|
role: "switch",
|
|
@@ -1814,13 +2059,13 @@ function Toggle(props) {
|
|
|
1814
2059
|
checked,
|
|
1815
2060
|
disabled
|
|
1816
2061
|
}, undefined, false, undefined, this),
|
|
1817
|
-
/* @__PURE__ */
|
|
2062
|
+
/* @__PURE__ */ jsxDEV19("span", {
|
|
1818
2063
|
class: checked ? `${Toggle_module_default["track"]} ${Toggle_module_default["trackChecked"]}` : Toggle_module_default["track"],
|
|
1819
|
-
children: /* @__PURE__ */
|
|
2064
|
+
children: /* @__PURE__ */ jsxDEV19("span", {
|
|
1820
2065
|
class: checked ? `${Toggle_module_default["thumb"]} ${Toggle_module_default["thumbChecked"]}` : Toggle_module_default["thumb"]
|
|
1821
2066
|
}, undefined, false, undefined, this)
|
|
1822
2067
|
}, undefined, false, undefined, this),
|
|
1823
|
-
label !== undefined && /* @__PURE__ */
|
|
2068
|
+
label !== undefined && /* @__PURE__ */ jsxDEV19("span", {
|
|
1824
2069
|
class: Toggle_module_default["label"],
|
|
1825
2070
|
children: label
|
|
1826
2071
|
}, undefined, false, undefined, this)
|
|
@@ -1833,6 +2078,7 @@ export {
|
|
|
1833
2078
|
Toggle,
|
|
1834
2079
|
Toast,
|
|
1835
2080
|
TextInput,
|
|
2081
|
+
Text,
|
|
1836
2082
|
Tabs,
|
|
1837
2083
|
Surface,
|
|
1838
2084
|
Skeleton,
|
|
@@ -1843,12 +2089,15 @@ export {
|
|
|
1843
2089
|
Dropdown,
|
|
1844
2090
|
ConfirmDialog,
|
|
1845
2091
|
Collapsible,
|
|
2092
|
+
Code,
|
|
2093
|
+
Cluster,
|
|
1846
2094
|
Checkbox,
|
|
1847
2095
|
Card,
|
|
1848
2096
|
Button,
|
|
1849
2097
|
Badge,
|
|
2098
|
+
ActionSelect,
|
|
1850
2099
|
ActionInput,
|
|
1851
2100
|
ActionForm
|
|
1852
2101
|
};
|
|
1853
2102
|
|
|
1854
|
-
//# debugId=
|
|
2103
|
+
//# debugId=7DA35338ECD4891D64756E2164756E21
|