@orianatech/pire 0.2.0 → 0.3.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/components/feedback/Skeleton.d.cts +43 -0
- package/dist/components/feedback/Skeleton.d.ts +44 -0
- package/dist/components/feedback/Skeleton.d.ts.map +1 -0
- package/dist/components/forms/MultiComboBox.d.cts +58 -0
- package/dist/components/forms/MultiComboBox.d.ts +59 -0
- package/dist/components/forms/MultiComboBox.d.ts.map +1 -0
- package/dist/components/forms/TextArea.d.cts +42 -0
- package/dist/components/forms/TextArea.d.ts +43 -0
- package/dist/components/forms/TextArea.d.ts.map +1 -0
- package/dist/components.css +55 -3
- package/dist/index.cjs +558 -299
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +561 -293
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -372,19 +372,104 @@ function Input({
|
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
// src/components/forms/TextArea.tsx
|
|
376
|
+
import * as React6 from "react";
|
|
377
|
+
import { TextField as TextField2, Label as Label2, TextArea as AriaTextArea, Group as Group2, Text as Text2, FieldError as FieldError2 } from "react-aria-components";
|
|
378
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
379
|
+
var useIsomorphicLayoutEffect = typeof document === "undefined" ? React6.useEffect : React6.useLayoutEffect;
|
|
380
|
+
function TextArea({
|
|
381
|
+
label,
|
|
382
|
+
description,
|
|
383
|
+
errorMessage,
|
|
384
|
+
size = "md",
|
|
385
|
+
rows = 3,
|
|
386
|
+
autoGrow,
|
|
387
|
+
maxRows,
|
|
388
|
+
fullWidth = true,
|
|
389
|
+
className,
|
|
390
|
+
style,
|
|
391
|
+
textAreaRef,
|
|
392
|
+
onChange,
|
|
393
|
+
...rest
|
|
394
|
+
}) {
|
|
395
|
+
const innerRef = React6.useRef(null);
|
|
396
|
+
const ref = React6.useCallback((node) => {
|
|
397
|
+
innerRef.current = node;
|
|
398
|
+
if (typeof textAreaRef === "function") textAreaRef(node);
|
|
399
|
+
else if (textAreaRef) textAreaRef.current = node;
|
|
400
|
+
}, [textAreaRef]);
|
|
401
|
+
const grow = React6.useCallback(() => {
|
|
402
|
+
const el = innerRef.current;
|
|
403
|
+
if (!el || !autoGrow) return;
|
|
404
|
+
const styles = getComputedStyle(el);
|
|
405
|
+
const lineHeight = Number.parseFloat(styles.lineHeight) || Number.parseFloat(styles.fontSize) * 1.5;
|
|
406
|
+
const chrome = el.offsetHeight - el.clientHeight;
|
|
407
|
+
el.style.height = "auto";
|
|
408
|
+
const wanted = maxRows ? Math.min(el.scrollHeight, Math.ceil(lineHeight * maxRows)) : el.scrollHeight;
|
|
409
|
+
const next = `${wanted + chrome}px`;
|
|
410
|
+
if (el.style.height !== next) el.style.height = next;
|
|
411
|
+
}, [autoGrow, maxRows]);
|
|
412
|
+
useIsomorphicLayoutEffect(() => {
|
|
413
|
+
if (!autoGrow) {
|
|
414
|
+
if (innerRef.current) innerRef.current.style.height = "";
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
grow();
|
|
418
|
+
}, [autoGrow, grow, rest.value]);
|
|
419
|
+
return /* @__PURE__ */ jsxs9(
|
|
420
|
+
TextField2,
|
|
421
|
+
{
|
|
422
|
+
className: cx("pire-field", className),
|
|
423
|
+
style,
|
|
424
|
+
onChange,
|
|
425
|
+
validationBehavior: "aria",
|
|
426
|
+
...rest,
|
|
427
|
+
children: [
|
|
428
|
+
label ? /* @__PURE__ */ jsxs9(Label2, { className: "pire-field-label", children: [
|
|
429
|
+
label,
|
|
430
|
+
rest.isRequired ? /* @__PURE__ */ jsx12("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
431
|
+
] }) : null,
|
|
432
|
+
/* @__PURE__ */ jsx12(
|
|
433
|
+
Group2,
|
|
434
|
+
{
|
|
435
|
+
className: "pire-control",
|
|
436
|
+
"data-size": size,
|
|
437
|
+
"data-full-width": String(fullWidth),
|
|
438
|
+
"data-multiline": "true",
|
|
439
|
+
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
440
|
+
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
441
|
+
children: /* @__PURE__ */ jsx12(
|
|
442
|
+
AriaTextArea,
|
|
443
|
+
{
|
|
444
|
+
ref,
|
|
445
|
+
rows,
|
|
446
|
+
onInput: autoGrow ? grow : void 0,
|
|
447
|
+
className: cx("pire-input", "pire-textarea"),
|
|
448
|
+
"data-auto-grow": autoGrow ? "true" : void 0
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
),
|
|
453
|
+
description ? /* @__PURE__ */ jsx12(Text2, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
454
|
+
/* @__PURE__ */ jsx12(FieldError2, { className: "pire-field-error", children: errorMessage })
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
375
460
|
// src/components/forms/Select.tsx
|
|
376
461
|
import {
|
|
377
462
|
Select as AriaSelect,
|
|
378
|
-
Label as
|
|
463
|
+
Label as Label3,
|
|
379
464
|
Button as AriaButton4,
|
|
380
465
|
SelectValue,
|
|
381
466
|
Popover,
|
|
382
467
|
ListBox,
|
|
383
468
|
ListBoxItem,
|
|
384
|
-
Text as
|
|
385
|
-
FieldError as
|
|
469
|
+
Text as Text3,
|
|
470
|
+
FieldError as FieldError3
|
|
386
471
|
} from "react-aria-components";
|
|
387
|
-
import { jsx as
|
|
472
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
388
473
|
var norm = (o) => typeof o === "string" ? { value: o, label: o, isDisabled: false } : o;
|
|
389
474
|
function Select({
|
|
390
475
|
label,
|
|
@@ -402,7 +487,7 @@ function Select({
|
|
|
402
487
|
...rest
|
|
403
488
|
}) {
|
|
404
489
|
const items = options.map(norm);
|
|
405
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsxs10(
|
|
406
491
|
AriaSelect,
|
|
407
492
|
{
|
|
408
493
|
className: cx("pire-field", className),
|
|
@@ -414,11 +499,11 @@ function Select({
|
|
|
414
499
|
validationBehavior: "aria",
|
|
415
500
|
...rest,
|
|
416
501
|
children: [
|
|
417
|
-
label ? /* @__PURE__ */
|
|
502
|
+
label ? /* @__PURE__ */ jsxs10(Label3, { className: "pire-field-label", children: [
|
|
418
503
|
label,
|
|
419
|
-
rest.isRequired ? /* @__PURE__ */
|
|
504
|
+
rest.isRequired ? /* @__PURE__ */ jsx13("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
420
505
|
] }) : null,
|
|
421
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ jsxs10(
|
|
422
507
|
AriaButton4,
|
|
423
508
|
{
|
|
424
509
|
className: "pire-control",
|
|
@@ -426,14 +511,14 @@ function Select({
|
|
|
426
511
|
"data-full-width": String(fullWidth),
|
|
427
512
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
428
513
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ jsx13(SelectValue, { className: "pire-select-value" }),
|
|
515
|
+
/* @__PURE__ */ jsx13(Icon, { name: "chevron-down", size: 16, className: "pire-leading-icon" })
|
|
431
516
|
]
|
|
432
517
|
}
|
|
433
518
|
),
|
|
434
|
-
description ? /* @__PURE__ */
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
519
|
+
description ? /* @__PURE__ */ jsx13(Text3, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
520
|
+
/* @__PURE__ */ jsx13(FieldError3, { className: "pire-field-error", children: errorMessage }),
|
|
521
|
+
/* @__PURE__ */ jsx13(Popover, { className: "pire-popover", children: /* @__PURE__ */ jsx13(ListBox, { className: "pire-listbox", items, children: (item) => /* @__PURE__ */ jsx13(ListBoxItem, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: item.label }) }) })
|
|
437
522
|
]
|
|
438
523
|
}
|
|
439
524
|
);
|
|
@@ -441,13 +526,13 @@ function Select({
|
|
|
441
526
|
|
|
442
527
|
// src/components/forms/Checkbox.tsx
|
|
443
528
|
import { Checkbox as AriaCheckbox } from "react-aria-components";
|
|
444
|
-
import { Fragment, jsx as
|
|
529
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
445
530
|
function Checkbox({ label, hint, children, className, ...rest }) {
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ jsx14(AriaCheckbox, { className: cx("pire-choice", className), ...rest, children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
532
|
+
/* @__PURE__ */ jsx14("span", { className: "pire-choice-box", "aria-hidden": "true", children: isIndeterminate ? /* @__PURE__ */ jsx14(Icon, { name: "minus", size: 12 }) : isSelected ? /* @__PURE__ */ jsx14(Icon, { name: "check", size: 12 }) : null }),
|
|
533
|
+
/* @__PURE__ */ jsxs11("span", { children: [
|
|
449
534
|
label ?? children,
|
|
450
|
-
hint ? /* @__PURE__ */
|
|
535
|
+
hint ? /* @__PURE__ */ jsx14("span", { className: "pire-choice-hint", children: hint }) : null
|
|
451
536
|
] })
|
|
452
537
|
] }) });
|
|
453
538
|
}
|
|
@@ -456,53 +541,53 @@ function Checkbox({ label, hint, children, className, ...rest }) {
|
|
|
456
541
|
import {
|
|
457
542
|
RadioGroup as AriaRadioGroup,
|
|
458
543
|
Radio as AriaRadio,
|
|
459
|
-
Label as
|
|
460
|
-
Text as
|
|
461
|
-
FieldError as
|
|
544
|
+
Label as Label4,
|
|
545
|
+
Text as Text4,
|
|
546
|
+
FieldError as FieldError4
|
|
462
547
|
} from "react-aria-components";
|
|
463
|
-
import { jsx as
|
|
548
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
464
549
|
function RadioGroup({ label, description, errorMessage, children, className, ...rest }) {
|
|
465
|
-
return /* @__PURE__ */
|
|
466
|
-
label ? /* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
description ? /* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ jsxs12(AriaRadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
551
|
+
label ? /* @__PURE__ */ jsx15(Label4, { className: "pire-field-label", children: label }) : null,
|
|
552
|
+
/* @__PURE__ */ jsx15("div", { className: "pire-radiogroup", children }),
|
|
553
|
+
description ? /* @__PURE__ */ jsx15(Text4, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
554
|
+
/* @__PURE__ */ jsx15(FieldError4, { className: "pire-field-error", children: errorMessage })
|
|
470
555
|
] });
|
|
471
556
|
}
|
|
472
557
|
function Radio({ label, hint, children, className, ...rest }) {
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
558
|
+
return /* @__PURE__ */ jsxs12(AriaRadio, { className: cx("pire-choice", className), ...rest, children: [
|
|
559
|
+
/* @__PURE__ */ jsx15("span", { className: "pire-choice-box", "data-radio": "true", "aria-hidden": "true" }),
|
|
560
|
+
/* @__PURE__ */ jsxs12("span", { children: [
|
|
476
561
|
label ?? children,
|
|
477
|
-
hint ? /* @__PURE__ */
|
|
562
|
+
hint ? /* @__PURE__ */ jsx15("span", { className: "pire-choice-hint", children: hint }) : null
|
|
478
563
|
] })
|
|
479
564
|
] });
|
|
480
565
|
}
|
|
481
566
|
|
|
482
567
|
// src/components/forms/Switch.tsx
|
|
483
568
|
import { Switch as AriaSwitch } from "react-aria-components";
|
|
484
|
-
import { jsx as
|
|
569
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
485
570
|
function Switch({ label, children, className, ...rest }) {
|
|
486
|
-
return /* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ jsxs13(AriaSwitch, { className: cx("pire-choice", className), ...rest, children: [
|
|
572
|
+
/* @__PURE__ */ jsx16("span", { className: "pire-switch-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("span", { className: "pire-switch-thumb" }) }),
|
|
573
|
+
/* @__PURE__ */ jsx16("span", { children: label ?? children })
|
|
489
574
|
] });
|
|
490
575
|
}
|
|
491
576
|
|
|
492
577
|
// src/components/forms/ComboBox.tsx
|
|
493
578
|
import {
|
|
494
579
|
ComboBox as AriaComboBox,
|
|
495
|
-
Label as
|
|
580
|
+
Label as Label5,
|
|
496
581
|
Input as AriaInput2,
|
|
497
582
|
Button as AriaButton5,
|
|
498
|
-
Group as
|
|
583
|
+
Group as Group3,
|
|
499
584
|
Popover as Popover2,
|
|
500
585
|
ListBox as ListBox2,
|
|
501
586
|
ListBoxItem as ListBoxItem2,
|
|
502
|
-
Text as
|
|
503
|
-
FieldError as
|
|
587
|
+
Text as Text5,
|
|
588
|
+
FieldError as FieldError5
|
|
504
589
|
} from "react-aria-components";
|
|
505
|
-
import { jsx as
|
|
590
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
506
591
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
507
592
|
function ComboBox({
|
|
508
593
|
label,
|
|
@@ -520,7 +605,7 @@ function ComboBox({
|
|
|
520
605
|
...rest
|
|
521
606
|
}) {
|
|
522
607
|
const items = options.map(norm2);
|
|
523
|
-
return /* @__PURE__ */
|
|
608
|
+
return /* @__PURE__ */ jsxs14(
|
|
524
609
|
AriaComboBox,
|
|
525
610
|
{
|
|
526
611
|
className: cx("pire-field", className),
|
|
@@ -534,46 +619,180 @@ function ComboBox({
|
|
|
534
619
|
validationBehavior: "aria",
|
|
535
620
|
...rest,
|
|
536
621
|
children: [
|
|
537
|
-
label ? /* @__PURE__ */
|
|
622
|
+
label ? /* @__PURE__ */ jsxs14(Label5, { className: "pire-field-label", children: [
|
|
538
623
|
label,
|
|
539
|
-
rest.isRequired ? /* @__PURE__ */
|
|
624
|
+
rest.isRequired ? /* @__PURE__ */ jsx17("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
540
625
|
] }) : null,
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
|
|
626
|
+
/* @__PURE__ */ jsxs14(
|
|
627
|
+
Group3,
|
|
543
628
|
{
|
|
544
629
|
className: "pire-control",
|
|
545
630
|
"data-size": size,
|
|
546
631
|
"data-full-width": String(fullWidth),
|
|
547
632
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
548
633
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsx17(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
635
|
+
/* @__PURE__ */ jsx17(AriaInput2, { className: "pire-input", placeholder: rest.placeholder }),
|
|
636
|
+
/* @__PURE__ */ jsx17(AriaButton5, { className: "pire-iconbtn", "data-size": "sm", "aria-label": "Show suggestions", style: { width: 20, height: 20 }, children: /* @__PURE__ */ jsx17(Icon, { name: "chevron-down", size: 16 }) })
|
|
552
637
|
]
|
|
553
638
|
}
|
|
554
639
|
),
|
|
555
|
-
description ? /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
item.secondary ? /* @__PURE__ */
|
|
640
|
+
description ? /* @__PURE__ */ jsx17(Text5, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
641
|
+
/* @__PURE__ */ jsx17(FieldError5, { className: "pire-field-error", children: errorMessage }),
|
|
642
|
+
/* @__PURE__ */ jsx17(Popover2, { className: "pire-popover", children: /* @__PURE__ */ jsx17(ListBox2, { className: "pire-listbox", children: (item) => /* @__PURE__ */ jsxs14(ListBoxItem2, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
643
|
+
/* @__PURE__ */ jsx17("span", { style: { flex: 1 }, children: item.label }),
|
|
644
|
+
item.secondary ? /* @__PURE__ */ jsx17("span", { style: { font: "var(--type-code)", color: "var(--text-tertiary)" }, children: item.secondary }) : null
|
|
560
645
|
] }) }) })
|
|
561
646
|
]
|
|
562
647
|
}
|
|
563
648
|
);
|
|
564
649
|
}
|
|
565
650
|
|
|
566
|
-
// src/components/forms/
|
|
651
|
+
// src/components/forms/MultiComboBox.tsx
|
|
652
|
+
import * as React7 from "react";
|
|
567
653
|
import {
|
|
568
|
-
|
|
569
|
-
Label as
|
|
654
|
+
ComboBox as AriaComboBox2,
|
|
655
|
+
Label as Label6,
|
|
570
656
|
Input as AriaInput3,
|
|
571
|
-
Group as Group3,
|
|
572
657
|
Button as AriaButton6,
|
|
573
|
-
|
|
574
|
-
|
|
658
|
+
ButtonContext,
|
|
659
|
+
Group as Group4,
|
|
660
|
+
Popover as Popover3,
|
|
661
|
+
ListBox as ListBox3,
|
|
662
|
+
ListBoxItem as ListBoxItem3,
|
|
663
|
+
Text as Text6,
|
|
664
|
+
FieldError as FieldError6,
|
|
665
|
+
VisuallyHidden
|
|
575
666
|
} from "react-aria-components";
|
|
576
|
-
import { jsx as
|
|
667
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
668
|
+
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
669
|
+
function MultiComboBox({
|
|
670
|
+
label,
|
|
671
|
+
value,
|
|
672
|
+
defaultValue,
|
|
673
|
+
onChange,
|
|
674
|
+
onInputChange,
|
|
675
|
+
options = [],
|
|
676
|
+
description,
|
|
677
|
+
errorMessage,
|
|
678
|
+
allowsCustomValue,
|
|
679
|
+
size = "md",
|
|
680
|
+
fullWidth = true,
|
|
681
|
+
className,
|
|
682
|
+
style,
|
|
683
|
+
...rest
|
|
684
|
+
}) {
|
|
685
|
+
const items = React7.useMemo(() => options.map(norm3), [options]);
|
|
686
|
+
const [uncontrolled, setUncontrolled] = React7.useState(defaultValue ?? []);
|
|
687
|
+
const [announcement, setAnnouncement] = React7.useState("");
|
|
688
|
+
const inputRef = React7.useRef(null);
|
|
689
|
+
const raw = value ?? uncontrolled;
|
|
690
|
+
const contentKey = raw.join("\0");
|
|
691
|
+
const values = React7.useMemo(() => raw, [contentKey]);
|
|
692
|
+
const labelOf = (v) => items.find((o) => o.value === v)?.label ?? v;
|
|
693
|
+
const isEditable = !rest.isDisabled && !rest.isReadOnly;
|
|
694
|
+
const commit = (next) => {
|
|
695
|
+
const added = next.find((v) => !values.includes(v));
|
|
696
|
+
const removed = values.find((v) => !next.includes(v));
|
|
697
|
+
if (added) setAnnouncement(`${labelOf(added)} added. ${next.length} selected.`);
|
|
698
|
+
else if (removed) setAnnouncement(`${labelOf(removed)} removed. ${next.length} selected.`);
|
|
699
|
+
if (value === void 0) setUncontrolled(next);
|
|
700
|
+
onChange?.(next);
|
|
701
|
+
};
|
|
702
|
+
const remove = (v) => {
|
|
703
|
+
commit(values.filter((x) => x !== v));
|
|
704
|
+
inputRef.current?.focus();
|
|
705
|
+
};
|
|
706
|
+
const onKeyDownCapture = (e) => {
|
|
707
|
+
const el = e.currentTarget;
|
|
708
|
+
if (!isEditable) return;
|
|
709
|
+
if (e.key === "Backspace" && el.value === "" && values.length > 0) {
|
|
710
|
+
e.preventDefault();
|
|
711
|
+
e.stopPropagation();
|
|
712
|
+
commit(values.slice(0, -1));
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
if (e.key !== "Enter" || !allowsCustomValue) return;
|
|
716
|
+
const text = el.value.trim();
|
|
717
|
+
if (text === "" || el.getAttribute("aria-activedescendant")) return;
|
|
718
|
+
const match = items.find((o) => o.label.toLowerCase() === text.toLowerCase());
|
|
719
|
+
const next = match ? match.value : text;
|
|
720
|
+
e.preventDefault();
|
|
721
|
+
e.stopPropagation();
|
|
722
|
+
if (!values.includes(next)) commit([...values, next]);
|
|
723
|
+
};
|
|
724
|
+
return /* @__PURE__ */ jsxs15(
|
|
725
|
+
AriaComboBox2,
|
|
726
|
+
{
|
|
727
|
+
className: cx("pire-field", className),
|
|
728
|
+
style,
|
|
729
|
+
selectionMode: "multiple",
|
|
730
|
+
value: values,
|
|
731
|
+
onChange: (keys) => commit(keys.map(String)),
|
|
732
|
+
onInputChange,
|
|
733
|
+
defaultItems: items,
|
|
734
|
+
menuTrigger: "input",
|
|
735
|
+
validationBehavior: "aria",
|
|
736
|
+
...rest,
|
|
737
|
+
children: [
|
|
738
|
+
label ? /* @__PURE__ */ jsxs15(Label6, { className: "pire-field-label", children: [
|
|
739
|
+
label,
|
|
740
|
+
rest.isRequired ? /* @__PURE__ */ jsx18("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
741
|
+
] }) : null,
|
|
742
|
+
/* @__PURE__ */ jsxs15(
|
|
743
|
+
Group4,
|
|
744
|
+
{
|
|
745
|
+
className: "pire-control",
|
|
746
|
+
"data-size": size,
|
|
747
|
+
"data-full-width": String(fullWidth),
|
|
748
|
+
"data-multiline": "true",
|
|
749
|
+
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
750
|
+
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsx18(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
753
|
+
/* @__PURE__ */ jsxs15("div", { className: "pire-chipfield", children: [
|
|
754
|
+
/* @__PURE__ */ jsx18(ButtonContext.Provider, { value: null, children: values.map((v) => (
|
|
755
|
+
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
756
|
+
real, current values and should read as such — they simply lose the × . */
|
|
757
|
+
/* @__PURE__ */ jsx18(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
758
|
+
)) }),
|
|
759
|
+
/* @__PURE__ */ jsx18(
|
|
760
|
+
AriaInput3,
|
|
761
|
+
{
|
|
762
|
+
ref: inputRef,
|
|
763
|
+
className: cx("pire-input", "pire-chipinput"),
|
|
764
|
+
placeholder: rest.placeholder,
|
|
765
|
+
onKeyDownCapture
|
|
766
|
+
}
|
|
767
|
+
)
|
|
768
|
+
] }),
|
|
769
|
+
/* @__PURE__ */ jsx18(AriaButton6, { className: "pire-iconbtn", "data-size": "sm", "aria-label": "Show suggestions", style: { width: 20, height: 20 }, children: /* @__PURE__ */ jsx18(Icon, { name: "chevron-down", size: 16 }) })
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
),
|
|
773
|
+
/* @__PURE__ */ jsx18(VisuallyHidden, { children: /* @__PURE__ */ jsx18("span", { "aria-live": "polite", children: announcement }) }),
|
|
774
|
+
description ? /* @__PURE__ */ jsx18(Text6, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
775
|
+
/* @__PURE__ */ jsx18(FieldError6, { className: "pire-field-error", children: errorMessage }),
|
|
776
|
+
/* @__PURE__ */ jsx18(Popover3, { className: "pire-popover", children: /* @__PURE__ */ jsx18(ListBox3, { className: "pire-listbox", children: (item) => /* @__PURE__ */ jsxs15(ListBoxItem3, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
777
|
+
/* @__PURE__ */ jsx18("span", { style: { flex: 1 }, children: item.label }),
|
|
778
|
+
item.secondary ? /* @__PURE__ */ jsx18("span", { style: { font: "var(--type-code)", color: "var(--text-tertiary)" }, children: item.secondary }) : null
|
|
779
|
+
] }) }) })
|
|
780
|
+
]
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
// src/components/forms/NumberField.tsx
|
|
786
|
+
import {
|
|
787
|
+
NumberField as AriaNumberField,
|
|
788
|
+
Label as Label7,
|
|
789
|
+
Input as AriaInput4,
|
|
790
|
+
Group as Group5,
|
|
791
|
+
Button as AriaButton7,
|
|
792
|
+
Text as Text7,
|
|
793
|
+
FieldError as FieldError7
|
|
794
|
+
} from "react-aria-components";
|
|
795
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
577
796
|
function NumberField({
|
|
578
797
|
label,
|
|
579
798
|
suffix,
|
|
@@ -586,13 +805,13 @@ function NumberField({
|
|
|
586
805
|
style,
|
|
587
806
|
...rest
|
|
588
807
|
}) {
|
|
589
|
-
return /* @__PURE__ */
|
|
590
|
-
label ? /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ jsxs16(AriaNumberField, { className: cx("pire-field", className), style, validationBehavior: "aria", ...rest, children: [
|
|
809
|
+
label ? /* @__PURE__ */ jsxs16(Label7, { className: "pire-field-label", children: [
|
|
591
810
|
label,
|
|
592
|
-
rest.isRequired ? /* @__PURE__ */
|
|
811
|
+
rest.isRequired ? /* @__PURE__ */ jsx19("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
593
812
|
] }) : null,
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
|
|
813
|
+
/* @__PURE__ */ jsxs16(
|
|
814
|
+
Group5,
|
|
596
815
|
{
|
|
597
816
|
className: "pire-control",
|
|
598
817
|
"data-size": size,
|
|
@@ -600,29 +819,29 @@ function NumberField({
|
|
|
600
819
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
601
820
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
602
821
|
children: [
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
suffix ? /* @__PURE__ */
|
|
605
|
-
hideStepper ? null : /* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ jsx19(AriaInput4, { className: "pire-input", "data-numeric": "true" }),
|
|
823
|
+
suffix ? /* @__PURE__ */ jsx19("span", { className: "pire-affix", children: suffix }) : null,
|
|
824
|
+
hideStepper ? null : /* @__PURE__ */ jsxs16("span", { className: "pire-stepper", children: [
|
|
825
|
+
/* @__PURE__ */ jsx19(AriaButton7, { slot: "increment", className: "pire-stepper-btn", "aria-label": "Increase", children: /* @__PURE__ */ jsx19(Icon, { name: "plus", size: 10 }) }),
|
|
826
|
+
/* @__PURE__ */ jsx19(AriaButton7, { slot: "decrement", className: "pire-stepper-btn", "aria-label": "Decrease", children: /* @__PURE__ */ jsx19(Icon, { name: "minus", size: 10 }) })
|
|
608
827
|
] })
|
|
609
828
|
]
|
|
610
829
|
}
|
|
611
830
|
),
|
|
612
|
-
description ? /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
831
|
+
description ? /* @__PURE__ */ jsx19(Text7, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
832
|
+
/* @__PURE__ */ jsx19(FieldError7, { className: "pire-field-error", children: errorMessage })
|
|
614
833
|
] });
|
|
615
834
|
}
|
|
616
835
|
|
|
617
836
|
// src/components/forms/DatePicker.tsx
|
|
618
837
|
import {
|
|
619
838
|
DatePicker as AriaDatePicker,
|
|
620
|
-
Label as
|
|
621
|
-
Group as
|
|
839
|
+
Label as Label8,
|
|
840
|
+
Group as Group6,
|
|
622
841
|
DateInput,
|
|
623
842
|
DateSegment,
|
|
624
|
-
Button as
|
|
625
|
-
Popover as
|
|
843
|
+
Button as AriaButton8,
|
|
844
|
+
Popover as Popover4,
|
|
626
845
|
Dialog as AriaDialog,
|
|
627
846
|
Calendar,
|
|
628
847
|
CalendarGrid,
|
|
@@ -631,10 +850,10 @@ import {
|
|
|
631
850
|
CalendarGridBody,
|
|
632
851
|
CalendarCell,
|
|
633
852
|
Heading,
|
|
634
|
-
Text as
|
|
635
|
-
FieldError as
|
|
853
|
+
Text as Text8,
|
|
854
|
+
FieldError as FieldError8
|
|
636
855
|
} from "react-aria-components";
|
|
637
|
-
import { jsx as
|
|
856
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
638
857
|
function DatePicker({
|
|
639
858
|
label,
|
|
640
859
|
description,
|
|
@@ -645,13 +864,13 @@ function DatePicker({
|
|
|
645
864
|
style,
|
|
646
865
|
...rest
|
|
647
866
|
}) {
|
|
648
|
-
return /* @__PURE__ */
|
|
649
|
-
label ? /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ jsxs17(AriaDatePicker, { className: cx("pire-field", className), style, validationBehavior: "aria", ...rest, children: [
|
|
868
|
+
label ? /* @__PURE__ */ jsxs17(Label8, { className: "pire-field-label", children: [
|
|
650
869
|
label,
|
|
651
|
-
rest.isRequired ? /* @__PURE__ */
|
|
870
|
+
rest.isRequired ? /* @__PURE__ */ jsx20("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
652
871
|
] }) : null,
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
|
|
872
|
+
/* @__PURE__ */ jsxs17(
|
|
873
|
+
Group6,
|
|
655
874
|
{
|
|
656
875
|
className: "pire-control",
|
|
657
876
|
"data-size": size,
|
|
@@ -659,36 +878,36 @@ function DatePicker({
|
|
|
659
878
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
660
879
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
661
880
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ jsx20(DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx20(DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
882
|
+
/* @__PURE__ */ jsx20(AriaButton8, { className: "pire-iconbtn", "data-size": "sm", "aria-label": "Open calendar", style: { width: 24, height: 24 }, children: /* @__PURE__ */ jsx20(Icon, { name: "calendar", size: 16 }) })
|
|
664
883
|
]
|
|
665
884
|
}
|
|
666
885
|
),
|
|
667
|
-
description ? /* @__PURE__ */
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
886
|
+
description ? /* @__PURE__ */ jsx20(Text8, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
887
|
+
/* @__PURE__ */ jsx20(FieldError8, { className: "pire-field-error", children: errorMessage }),
|
|
888
|
+
/* @__PURE__ */ jsx20(Popover4, { className: "pire-popover", children: /* @__PURE__ */ jsx20(AriaDialog, { children: /* @__PURE__ */ jsxs17(Calendar, { className: "pire-calendar", children: [
|
|
889
|
+
/* @__PURE__ */ jsxs17("header", { className: "pire-calendar-head", children: [
|
|
890
|
+
/* @__PURE__ */ jsx20(AriaButton8, { slot: "previous", className: "pire-iconbtn", "data-size": "sm", "aria-label": "Previous month", children: /* @__PURE__ */ jsx20(Icon, { name: "chevron-left", size: 16 }) }),
|
|
891
|
+
/* @__PURE__ */ jsx20(Heading, { className: "pire-calendar-title" }),
|
|
892
|
+
/* @__PURE__ */ jsx20(AriaButton8, { slot: "next", className: "pire-iconbtn", "data-size": "sm", "aria-label": "Next month", children: /* @__PURE__ */ jsx20(Icon, { name: "chevron-right", size: 16 }) })
|
|
674
893
|
] }),
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ jsxs17(CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
895
|
+
/* @__PURE__ */ jsx20(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx20(CalendarHeaderCell, { children: day }) }),
|
|
896
|
+
/* @__PURE__ */ jsx20(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx20(CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
678
897
|
] })
|
|
679
898
|
] }) }) })
|
|
680
899
|
] });
|
|
681
900
|
}
|
|
682
901
|
|
|
683
902
|
// src/components/forms/ValueHelpField.tsx
|
|
684
|
-
import * as
|
|
903
|
+
import * as React9 from "react";
|
|
685
904
|
|
|
686
905
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
687
|
-
import * as
|
|
906
|
+
import * as React8 from "react";
|
|
688
907
|
|
|
689
908
|
// src/components/feedback/Dialog.tsx
|
|
690
909
|
import { ModalOverlay, Modal, Dialog as AriaDialog2, Heading as Heading2 } from "react-aria-components";
|
|
691
|
-
import { jsx as
|
|
910
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
692
911
|
function Dialog({
|
|
693
912
|
isOpen,
|
|
694
913
|
onOpenChange,
|
|
@@ -707,7 +926,7 @@ function Dialog({
|
|
|
707
926
|
onClose?.();
|
|
708
927
|
onOpenChange?.(false);
|
|
709
928
|
};
|
|
710
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ jsx21(
|
|
711
930
|
ModalOverlay,
|
|
712
931
|
{
|
|
713
932
|
className: "pire-modal-overlay",
|
|
@@ -716,16 +935,16 @@ function Dialog({
|
|
|
716
935
|
onOpenChange: (o) => {
|
|
717
936
|
if (!o) close();
|
|
718
937
|
},
|
|
719
|
-
children: /* @__PURE__ */
|
|
720
|
-
title ? /* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
subtitle ? /* @__PURE__ */
|
|
938
|
+
children: /* @__PURE__ */ jsx21(Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ jsxs18(AriaDialog2, { className: "pire-dialog", children: [
|
|
939
|
+
title ? /* @__PURE__ */ jsxs18("header", { className: "pire-dialog-head", children: [
|
|
940
|
+
/* @__PURE__ */ jsxs18("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
941
|
+
/* @__PURE__ */ jsx21(Heading2, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
942
|
+
subtitle ? /* @__PURE__ */ jsx21("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
724
943
|
] }),
|
|
725
|
-
showClose ? /* @__PURE__ */
|
|
944
|
+
showClose ? /* @__PURE__ */ jsx21(IconButton, { icon: "x", label: "Close", size: "sm", onPress: close }) : null
|
|
726
945
|
] }) : null,
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
footer ? /* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ jsx21("div", { className: "pire-dialog-body", children }),
|
|
947
|
+
footer ? /* @__PURE__ */ jsx21("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
729
948
|
] }) })
|
|
730
949
|
}
|
|
731
950
|
);
|
|
@@ -740,7 +959,7 @@ import {
|
|
|
740
959
|
Row,
|
|
741
960
|
Cell
|
|
742
961
|
} from "react-aria-components";
|
|
743
|
-
import { jsx as
|
|
962
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
744
963
|
function DataTable({
|
|
745
964
|
columns,
|
|
746
965
|
rows,
|
|
@@ -762,7 +981,7 @@ function DataTable({
|
|
|
762
981
|
if (keys === "all") return onSelectionChange?.(rows.map((r) => r.id));
|
|
763
982
|
onSelectionChange?.([...keys]);
|
|
764
983
|
};
|
|
765
|
-
return /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ jsx22("div", { className: cx("pire-table-wrap", className), style, children: /* @__PURE__ */ jsxs19(
|
|
766
985
|
Table,
|
|
767
986
|
{
|
|
768
987
|
className: "pire-table",
|
|
@@ -779,9 +998,9 @@ function DataTable({
|
|
|
779
998
|
if (row) onRowAction(row);
|
|
780
999
|
} : void 0,
|
|
781
1000
|
children: [
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
selectable ? /* @__PURE__ */
|
|
784
|
-
columns.map((c, i) => /* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ jsxs19(TableHeader, { className: "pire-thead-row", children: [
|
|
1002
|
+
selectable ? /* @__PURE__ */ jsx22(Column, { className: "pire-th", width: 44, children: /* @__PURE__ */ jsx22(Checkbox, { slot: "selection", "aria-label": "Select all rows" }) }) : null,
|
|
1003
|
+
columns.map((c, i) => /* @__PURE__ */ jsx22(
|
|
785
1004
|
Column,
|
|
786
1005
|
{
|
|
787
1006
|
id: c.key,
|
|
@@ -791,9 +1010,9 @@ function DataTable({
|
|
|
791
1010
|
width: c.width,
|
|
792
1011
|
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
793
1012
|
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
794
|
-
children: /* @__PURE__ */
|
|
1013
|
+
children: /* @__PURE__ */ jsxs19("span", { className: "pire-th-inner", children: [
|
|
795
1014
|
c.label,
|
|
796
|
-
c.sortable ? /* @__PURE__ */
|
|
1015
|
+
c.sortable ? /* @__PURE__ */ jsx22(
|
|
797
1016
|
Icon,
|
|
798
1017
|
{
|
|
799
1018
|
size: 12,
|
|
@@ -806,9 +1025,9 @@ function DataTable({
|
|
|
806
1025
|
c.key
|
|
807
1026
|
))
|
|
808
1027
|
] }),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
selectable ? /* @__PURE__ */
|
|
811
|
-
columns.map((c) => /* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ jsx22(TableBody, { renderEmptyState: () => /* @__PURE__ */ jsx22("div", { className: "pire-table-empty", children: emptyLabel }), children: rows.map((row) => /* @__PURE__ */ jsxs19(Row, { id: row.id, className: "pire-tr", "data-pressable": onRowAction ? "true" : void 0, children: [
|
|
1029
|
+
selectable ? /* @__PURE__ */ jsx22(Cell, { className: "pire-td", children: /* @__PURE__ */ jsx22(Checkbox, { slot: "selection", "aria-label": "Select row" }) }) : null,
|
|
1030
|
+
columns.map((c) => /* @__PURE__ */ jsx22(
|
|
812
1031
|
Cell,
|
|
813
1032
|
{
|
|
814
1033
|
className: "pire-td",
|
|
@@ -825,7 +1044,7 @@ function DataTable({
|
|
|
825
1044
|
}
|
|
826
1045
|
|
|
827
1046
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
828
|
-
import { jsx as
|
|
1047
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
829
1048
|
function ValueHelpDialog({
|
|
830
1049
|
isOpen,
|
|
831
1050
|
title = "Select a record",
|
|
@@ -836,25 +1055,25 @@ function ValueHelpDialog({
|
|
|
836
1055
|
onSelect,
|
|
837
1056
|
onClose
|
|
838
1057
|
}) {
|
|
839
|
-
const [query, setQuery] =
|
|
840
|
-
|
|
1058
|
+
const [query, setQuery] = React8.useState("");
|
|
1059
|
+
React8.useEffect(() => {
|
|
841
1060
|
if (isOpen) setQuery("");
|
|
842
1061
|
}, [isOpen]);
|
|
843
|
-
const filtered =
|
|
1062
|
+
const filtered = React8.useMemo(() => {
|
|
844
1063
|
const q = query.trim().toLowerCase();
|
|
845
1064
|
if (!q) return rows;
|
|
846
1065
|
return rows.filter((row) => Object.values(row).some((v) => String(v).toLowerCase().includes(q)));
|
|
847
1066
|
}, [rows, query]);
|
|
848
|
-
return /* @__PURE__ */
|
|
1067
|
+
return /* @__PURE__ */ jsx23(
|
|
849
1068
|
Dialog,
|
|
850
1069
|
{
|
|
851
1070
|
isOpen,
|
|
852
1071
|
size: "lg",
|
|
853
1072
|
title,
|
|
854
1073
|
onClose,
|
|
855
|
-
footer: /* @__PURE__ */
|
|
856
|
-
children: /* @__PURE__ */
|
|
857
|
-
/* @__PURE__ */
|
|
1074
|
+
footer: /* @__PURE__ */ jsx23(Button, { variant: "tertiary", onPress: onClose, children: "Cancel" }),
|
|
1075
|
+
children: /* @__PURE__ */ jsxs20("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
1076
|
+
/* @__PURE__ */ jsx23(
|
|
858
1077
|
Input,
|
|
859
1078
|
{
|
|
860
1079
|
"aria-label": "Search records",
|
|
@@ -866,7 +1085,7 @@ function ValueHelpDialog({
|
|
|
866
1085
|
autoFocus: true
|
|
867
1086
|
}
|
|
868
1087
|
),
|
|
869
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ jsx23(
|
|
870
1089
|
DataTable,
|
|
871
1090
|
{
|
|
872
1091
|
"aria-label": typeof title === "string" ? title : "Records",
|
|
@@ -886,7 +1105,7 @@ function ValueHelpDialog({
|
|
|
886
1105
|
}
|
|
887
1106
|
|
|
888
1107
|
// src/components/forms/ValueHelpField.tsx
|
|
889
|
-
import { jsx as
|
|
1108
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
890
1109
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
891
1110
|
function ValueHelpField({
|
|
892
1111
|
label,
|
|
@@ -906,10 +1125,10 @@ function ValueHelpField({
|
|
|
906
1125
|
className,
|
|
907
1126
|
style
|
|
908
1127
|
}) {
|
|
909
|
-
const [open, setOpen] =
|
|
910
|
-
return /* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
1128
|
+
const [open, setOpen] = React9.useState(false);
|
|
1129
|
+
return /* @__PURE__ */ jsxs21("div", { className: cx(className), style, children: [
|
|
1130
|
+
/* @__PURE__ */ jsxs21("div", { style: { display: "flex", gap: "var(--sp-2)", alignItems: "flex-end" }, children: [
|
|
1131
|
+
/* @__PURE__ */ jsx24(
|
|
913
1132
|
Input,
|
|
914
1133
|
{
|
|
915
1134
|
label,
|
|
@@ -923,7 +1142,7 @@ function ValueHelpField({
|
|
|
923
1142
|
errorMessage
|
|
924
1143
|
}
|
|
925
1144
|
),
|
|
926
|
-
allowsClear && value ? /* @__PURE__ */
|
|
1145
|
+
allowsClear && value ? /* @__PURE__ */ jsx24(
|
|
927
1146
|
IconButton,
|
|
928
1147
|
{
|
|
929
1148
|
icon: "x",
|
|
@@ -933,7 +1152,7 @@ function ValueHelpField({
|
|
|
933
1152
|
onPress: () => onChange?.(null)
|
|
934
1153
|
}
|
|
935
1154
|
) : null,
|
|
936
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ jsx24(
|
|
937
1156
|
IconButton,
|
|
938
1157
|
{
|
|
939
1158
|
icon: "search",
|
|
@@ -944,7 +1163,7 @@ function ValueHelpField({
|
|
|
944
1163
|
}
|
|
945
1164
|
)
|
|
946
1165
|
] }),
|
|
947
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ jsx24(
|
|
948
1167
|
ValueHelpDialog,
|
|
949
1168
|
{
|
|
950
1169
|
isOpen: open,
|
|
@@ -959,26 +1178,26 @@ function ValueHelpField({
|
|
|
959
1178
|
}
|
|
960
1179
|
|
|
961
1180
|
// src/components/navigation/ShellBar.tsx
|
|
962
|
-
import { jsx as
|
|
1181
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
963
1182
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
964
1183
|
function ShellBar({ product, monogram, title, onMenu, onSearch, actions, user, className, ...rest }) {
|
|
965
|
-
return /* @__PURE__ */
|
|
966
|
-
onMenu ? /* @__PURE__ */
|
|
967
|
-
monogram ? /* @__PURE__ */
|
|
968
|
-
product ? /* @__PURE__ */
|
|
969
|
-
title ? /* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
onSearch ? /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ jsxs22("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
1185
|
+
onMenu ? /* @__PURE__ */ jsx25(IconButton, { icon: "menu", label: "Open navigation", variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
1186
|
+
monogram ? /* @__PURE__ */ jsx25("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
1187
|
+
product ? /* @__PURE__ */ jsx25("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
1188
|
+
title ? /* @__PURE__ */ jsx25("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
1189
|
+
/* @__PURE__ */ jsx25("span", { className: "pire-shellbar-spacer" }),
|
|
1190
|
+
onSearch ? /* @__PURE__ */ jsx25(IconButton, { icon: "search", label: "Search", variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
972
1191
|
actions,
|
|
973
|
-
user ? /* @__PURE__ */
|
|
1192
|
+
user ? /* @__PURE__ */ jsx25("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
974
1193
|
] });
|
|
975
1194
|
}
|
|
976
1195
|
|
|
977
1196
|
// src/components/navigation/SideNav.tsx
|
|
978
|
-
import { Button as
|
|
979
|
-
import { jsx as
|
|
1197
|
+
import { Button as AriaButton9 } from "react-aria-components";
|
|
1198
|
+
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
980
1199
|
function SideNav({ groups, value, onChange, collapsed, footer, className, ...rest }) {
|
|
981
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ jsxs23(
|
|
982
1201
|
"nav",
|
|
983
1202
|
{
|
|
984
1203
|
className: cx("pire-sidenav", className),
|
|
@@ -986,29 +1205,29 @@ function SideNav({ groups, value, onChange, collapsed, footer, className, ...res
|
|
|
986
1205
|
"aria-label": "Main navigation",
|
|
987
1206
|
...rest,
|
|
988
1207
|
children: [
|
|
989
|
-
groups.map((group, gi) => /* @__PURE__ */
|
|
990
|
-
group.label && !collapsed ? /* @__PURE__ */
|
|
1208
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs23("div", { className: "pire-sidenav-group", children: [
|
|
1209
|
+
group.label && !collapsed ? /* @__PURE__ */ jsx26("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
991
1210
|
group.items.map((item) => {
|
|
992
1211
|
const selected = item.id === value;
|
|
993
|
-
const button = /* @__PURE__ */
|
|
994
|
-
|
|
1212
|
+
const button = /* @__PURE__ */ jsxs23(
|
|
1213
|
+
AriaButton9,
|
|
995
1214
|
{
|
|
996
1215
|
className: "pire-sidenav-item",
|
|
997
1216
|
"data-selected": selected ? "true" : void 0,
|
|
998
1217
|
"aria-current": selected ? "page" : void 0,
|
|
999
1218
|
onPress: () => onChange?.(item.id),
|
|
1000
1219
|
children: [
|
|
1001
|
-
item.icon ? /* @__PURE__ */
|
|
1002
|
-
collapsed ? null : /* @__PURE__ */
|
|
1003
|
-
item.count != null && !collapsed ? /* @__PURE__ */
|
|
1220
|
+
item.icon ? /* @__PURE__ */ jsx26(Icon, { name: item.icon, size: 16 }) : null,
|
|
1221
|
+
collapsed ? null : /* @__PURE__ */ jsx26("span", { children: item.label }),
|
|
1222
|
+
item.count != null && !collapsed ? /* @__PURE__ */ jsx26("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
1004
1223
|
]
|
|
1005
1224
|
},
|
|
1006
1225
|
item.id
|
|
1007
1226
|
);
|
|
1008
|
-
return collapsed ? /* @__PURE__ */
|
|
1227
|
+
return collapsed ? /* @__PURE__ */ jsx26(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
1009
1228
|
})
|
|
1010
1229
|
] }, group.label ?? gi)),
|
|
1011
|
-
footer ? /* @__PURE__ */
|
|
1230
|
+
footer ? /* @__PURE__ */ jsx26("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
1012
1231
|
]
|
|
1013
1232
|
}
|
|
1014
1233
|
);
|
|
@@ -1016,9 +1235,9 @@ function SideNav({ groups, value, onChange, collapsed, footer, className, ...res
|
|
|
1016
1235
|
|
|
1017
1236
|
// src/components/navigation/Tabs.tsx
|
|
1018
1237
|
import { Tabs as AriaTabs, TabList, Tab as AriaTab, TabPanel } from "react-aria-components";
|
|
1019
|
-
import { jsx as
|
|
1238
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1020
1239
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1240
|
+
return /* @__PURE__ */ jsxs24(
|
|
1022
1241
|
AriaTabs,
|
|
1023
1242
|
{
|
|
1024
1243
|
className,
|
|
@@ -1027,12 +1246,12 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
1027
1246
|
defaultSelectedKey: defaultValue,
|
|
1028
1247
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
1029
1248
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
item.icon ? /* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx27(TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ jsxs24(AriaTab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
1250
|
+
item.icon ? /* @__PURE__ */ jsx27(Icon, { name: item.icon, size: 16 }) : null,
|
|
1032
1251
|
item.label,
|
|
1033
|
-
item.count != null ? /* @__PURE__ */
|
|
1252
|
+
item.count != null ? /* @__PURE__ */ jsx27("span", { className: "pire-tab-count", children: item.count }) : null
|
|
1034
1253
|
] }) }),
|
|
1035
|
-
items.map((item) => /* @__PURE__ */
|
|
1254
|
+
items.map((item) => /* @__PURE__ */ jsx27(TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
1036
1255
|
]
|
|
1037
1256
|
}
|
|
1038
1257
|
);
|
|
@@ -1040,9 +1259,9 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
1040
1259
|
|
|
1041
1260
|
// src/components/navigation/Breadcrumb.tsx
|
|
1042
1261
|
import { Breadcrumbs as AriaBreadcrumbs, Breadcrumb as AriaBreadcrumb, Link } from "react-aria-components";
|
|
1043
|
-
import { jsx as
|
|
1262
|
+
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1044
1263
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
1045
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ jsx28(
|
|
1046
1265
|
AriaBreadcrumbs,
|
|
1047
1266
|
{
|
|
1048
1267
|
className: cx("pire-breadcrumbs", className),
|
|
@@ -1051,9 +1270,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
1051
1270
|
onAction: (key) => onNavigate?.(String(key)),
|
|
1052
1271
|
children: (item) => {
|
|
1053
1272
|
const last = items[items.length - 1] === item;
|
|
1054
|
-
return /* @__PURE__ */
|
|
1055
|
-
last ? item.label : /* @__PURE__ */
|
|
1056
|
-
last ? null : /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ jsxs25(AriaBreadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
1274
|
+
last ? item.label : /* @__PURE__ */ jsx28(Link, { href: item.href, children: item.label }),
|
|
1275
|
+
last ? null : /* @__PURE__ */ jsx28(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
1057
1276
|
] });
|
|
1058
1277
|
}
|
|
1059
1278
|
}
|
|
@@ -1061,7 +1280,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
1061
1280
|
}
|
|
1062
1281
|
|
|
1063
1282
|
// src/components/navigation/Pagination.tsx
|
|
1064
|
-
import { jsx as
|
|
1283
|
+
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1065
1284
|
function Pagination({
|
|
1066
1285
|
page = 1,
|
|
1067
1286
|
pageSize = 25,
|
|
@@ -1075,15 +1294,15 @@ function Pagination({
|
|
|
1075
1294
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
1076
1295
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
1077
1296
|
const to = Math.min(total, page * pageSize);
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1297
|
+
return /* @__PURE__ */ jsxs26("nav", { className: cx("pire-pagination", className), style, "aria-label": "Pagination", children: [
|
|
1298
|
+
/* @__PURE__ */ jsxs26("span", { className: "pire-pagination-count", children: [
|
|
1080
1299
|
from.toLocaleString(),
|
|
1081
1300
|
"\u2013",
|
|
1082
1301
|
to.toLocaleString(),
|
|
1083
1302
|
" of ",
|
|
1084
1303
|
total.toLocaleString()
|
|
1085
1304
|
] }),
|
|
1086
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ jsx29(
|
|
1087
1306
|
IconButton,
|
|
1088
1307
|
{
|
|
1089
1308
|
icon: "chevron-left",
|
|
@@ -1094,13 +1313,13 @@ function Pagination({
|
|
|
1094
1313
|
onPress: () => onPageChange?.(page - 1)
|
|
1095
1314
|
}
|
|
1096
1315
|
),
|
|
1097
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsxs26("span", { className: "pire-pagination-count", "aria-live": "polite", children: [
|
|
1098
1317
|
"Page ",
|
|
1099
1318
|
page,
|
|
1100
1319
|
" of ",
|
|
1101
1320
|
pages
|
|
1102
1321
|
] }),
|
|
1103
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ jsx29(
|
|
1104
1323
|
IconButton,
|
|
1105
1324
|
{
|
|
1106
1325
|
icon: "chevron-right",
|
|
@@ -1111,7 +1330,7 @@ function Pagination({
|
|
|
1111
1330
|
onPress: () => onPageChange?.(page + 1)
|
|
1112
1331
|
}
|
|
1113
1332
|
),
|
|
1114
|
-
onPageSizeChange ? /* @__PURE__ */
|
|
1333
|
+
onPageSizeChange ? /* @__PURE__ */ jsx29(
|
|
1115
1334
|
Select,
|
|
1116
1335
|
{
|
|
1117
1336
|
"aria-label": "Rows per page",
|
|
@@ -1127,7 +1346,7 @@ function Pagination({
|
|
|
1127
1346
|
}
|
|
1128
1347
|
|
|
1129
1348
|
// src/components/feedback/InlineMessage.tsx
|
|
1130
|
-
import { jsx as
|
|
1349
|
+
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1131
1350
|
var KIND_ICON = {
|
|
1132
1351
|
info: "info",
|
|
1133
1352
|
success: "check-circle-2",
|
|
@@ -1136,7 +1355,7 @@ var KIND_ICON = {
|
|
|
1136
1355
|
};
|
|
1137
1356
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
1138
1357
|
const assertive = kind === "error" || kind === "warning";
|
|
1139
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ jsxs27(
|
|
1140
1359
|
"div",
|
|
1141
1360
|
{
|
|
1142
1361
|
className: cx("pire-msg", className),
|
|
@@ -1145,21 +1364,21 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
1145
1364
|
"aria-live": assertive ? "assertive" : "polite",
|
|
1146
1365
|
...rest,
|
|
1147
1366
|
children: [
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
title ? /* @__PURE__ */
|
|
1151
|
-
children ? /* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ jsx30(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
1368
|
+
/* @__PURE__ */ jsxs27("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
1369
|
+
title ? /* @__PURE__ */ jsx30("span", { className: "pire-msg-title", children: title }) : null,
|
|
1370
|
+
children ? /* @__PURE__ */ jsx30("span", { className: "pire-msg-body", children }) : null,
|
|
1152
1371
|
action
|
|
1153
1372
|
] }),
|
|
1154
|
-
onClose ? /* @__PURE__ */
|
|
1373
|
+
onClose ? /* @__PURE__ */ jsx30(IconButton, { icon: "x", label: "Dismiss message", size: "sm", onPress: onClose }) : null
|
|
1155
1374
|
]
|
|
1156
1375
|
}
|
|
1157
1376
|
);
|
|
1158
1377
|
}
|
|
1159
1378
|
|
|
1160
1379
|
// src/components/feedback/ProgressBar.tsx
|
|
1161
|
-
import { ProgressBar as AriaProgressBar, Label as
|
|
1162
|
-
import { Fragment as Fragment2, jsx as
|
|
1380
|
+
import { ProgressBar as AriaProgressBar, Label as Label9 } from "react-aria-components";
|
|
1381
|
+
import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1163
1382
|
function ProgressBar({
|
|
1164
1383
|
value = 0,
|
|
1165
1384
|
minValue = 0,
|
|
@@ -1172,7 +1391,7 @@ function ProgressBar({
|
|
|
1172
1391
|
className,
|
|
1173
1392
|
style
|
|
1174
1393
|
}) {
|
|
1175
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsx31(
|
|
1176
1395
|
AriaProgressBar,
|
|
1177
1396
|
{
|
|
1178
1397
|
className: cx("pire-progress", className),
|
|
@@ -1183,20 +1402,20 @@ function ProgressBar({
|
|
|
1183
1402
|
maxValue,
|
|
1184
1403
|
isIndeterminate,
|
|
1185
1404
|
style,
|
|
1186
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */
|
|
1187
|
-
label || showValue ? /* @__PURE__ */
|
|
1188
|
-
label ? /* @__PURE__ */
|
|
1189
|
-
showValue && !isIndeterminate ? /* @__PURE__ */
|
|
1405
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs28(Fragment2, { children: [
|
|
1406
|
+
label || showValue ? /* @__PURE__ */ jsxs28("div", { className: "pire-progress-head", children: [
|
|
1407
|
+
label ? /* @__PURE__ */ jsx31(Label9, { children: label }) : /* @__PURE__ */ jsx31("span", {}),
|
|
1408
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ jsx31("span", { className: "pire-numeric", children: valueText }) : null
|
|
1190
1409
|
] }) : null,
|
|
1191
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ jsx31("div", { className: "pire-progress-track", children: /* @__PURE__ */ jsx31("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
1192
1411
|
] })
|
|
1193
1412
|
}
|
|
1194
1413
|
);
|
|
1195
1414
|
}
|
|
1196
1415
|
|
|
1197
1416
|
// src/components/feedback/Toast.tsx
|
|
1198
|
-
import * as
|
|
1199
|
-
import { jsx as
|
|
1417
|
+
import * as React10 from "react";
|
|
1418
|
+
import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1200
1419
|
var KIND_ICON2 = {
|
|
1201
1420
|
info: "info",
|
|
1202
1421
|
success: "check-circle-2",
|
|
@@ -1204,7 +1423,7 @@ var KIND_ICON2 = {
|
|
|
1204
1423
|
error: "alert-octagon"
|
|
1205
1424
|
};
|
|
1206
1425
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
1207
|
-
return /* @__PURE__ */
|
|
1426
|
+
return /* @__PURE__ */ jsxs29(
|
|
1208
1427
|
"div",
|
|
1209
1428
|
{
|
|
1210
1429
|
className: cx("pire-toast", className),
|
|
@@ -1213,39 +1432,84 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
1213
1432
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
1214
1433
|
...rest,
|
|
1215
1434
|
children: [
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
onClose ? /* @__PURE__ */
|
|
1435
|
+
/* @__PURE__ */ jsx32(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
1436
|
+
/* @__PURE__ */ jsx32("span", { style: { flex: 1 }, children }),
|
|
1437
|
+
onClose ? /* @__PURE__ */ jsx32(IconButton, { icon: "x", label: "Dismiss", size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
1219
1438
|
]
|
|
1220
1439
|
}
|
|
1221
1440
|
);
|
|
1222
1441
|
}
|
|
1223
|
-
var ToastContext =
|
|
1442
|
+
var ToastContext = React10.createContext(null);
|
|
1224
1443
|
function ToastProvider({ children, timeout = 6e3 }) {
|
|
1225
|
-
const [toasts, setToasts] =
|
|
1226
|
-
const close =
|
|
1227
|
-
const add =
|
|
1444
|
+
const [toasts, setToasts] = React10.useState([]);
|
|
1445
|
+
const close = React10.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
1446
|
+
const add = React10.useCallback((toast) => {
|
|
1228
1447
|
const id = Math.random().toString(36).slice(2);
|
|
1229
1448
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
1230
1449
|
const ms = toast.timeout ?? timeout;
|
|
1231
1450
|
if (ms > 0) setTimeout(() => close(id), ms);
|
|
1232
1451
|
return id;
|
|
1233
1452
|
}, [close, timeout]);
|
|
1234
|
-
const value =
|
|
1235
|
-
return /* @__PURE__ */
|
|
1453
|
+
const value = React10.useMemo(() => ({ add, close }), [add, close]);
|
|
1454
|
+
return /* @__PURE__ */ jsxs29(ToastContext.Provider, { value, children: [
|
|
1236
1455
|
children,
|
|
1237
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ jsx32("div", { className: "pire-toast-region", role: "region", "aria-label": "Notifications", children: toasts.map((t) => /* @__PURE__ */ jsx32(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
1238
1457
|
] });
|
|
1239
1458
|
}
|
|
1240
1459
|
function useToast() {
|
|
1241
|
-
const ctx =
|
|
1460
|
+
const ctx = React10.useContext(ToastContext);
|
|
1242
1461
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
1243
1462
|
return ctx;
|
|
1244
1463
|
}
|
|
1245
1464
|
|
|
1465
|
+
// src/components/feedback/Skeleton.tsx
|
|
1466
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1467
|
+
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
1468
|
+
return /* @__PURE__ */ jsx33(
|
|
1469
|
+
"div",
|
|
1470
|
+
{
|
|
1471
|
+
className: cx("pire-skeleton", className),
|
|
1472
|
+
"data-shape": shape,
|
|
1473
|
+
"aria-hidden": "true",
|
|
1474
|
+
style: { width, height, ...style },
|
|
1475
|
+
...rest
|
|
1476
|
+
}
|
|
1477
|
+
);
|
|
1478
|
+
}
|
|
1479
|
+
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
1480
|
+
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
1481
|
+
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
1482
|
+
return /* @__PURE__ */ jsx33(
|
|
1483
|
+
"div",
|
|
1484
|
+
{
|
|
1485
|
+
className: cx("pire-skeleton-row", className),
|
|
1486
|
+
"data-density": density,
|
|
1487
|
+
"aria-hidden": "true",
|
|
1488
|
+
style,
|
|
1489
|
+
...rest,
|
|
1490
|
+
children: cells.map((c, i) => {
|
|
1491
|
+
const align = c.numeric ? "right" : c.align ?? "left";
|
|
1492
|
+
return (
|
|
1493
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
1494
|
+
/* @__PURE__ */ jsx33(
|
|
1495
|
+
"div",
|
|
1496
|
+
{
|
|
1497
|
+
className: "pire-skeleton-cell",
|
|
1498
|
+
"data-align": align,
|
|
1499
|
+
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
1500
|
+
children: /* @__PURE__ */ jsx33(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
1501
|
+
},
|
|
1502
|
+
i
|
|
1503
|
+
)
|
|
1504
|
+
);
|
|
1505
|
+
})
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1246
1510
|
// src/components/data/KpiTile.tsx
|
|
1247
|
-
import { Button as
|
|
1248
|
-
import { Fragment as Fragment3, jsx as
|
|
1511
|
+
import { Button as AriaButton10 } from "react-aria-components";
|
|
1512
|
+
import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1249
1513
|
function KpiTile({
|
|
1250
1514
|
label,
|
|
1251
1515
|
value,
|
|
@@ -1261,50 +1525,50 @@ function KpiTile({
|
|
|
1261
1525
|
style
|
|
1262
1526
|
}) {
|
|
1263
1527
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
1264
|
-
const body = /* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
icon ? /* @__PURE__ */
|
|
1528
|
+
const body = /* @__PURE__ */ jsxs30(Fragment3, { children: [
|
|
1529
|
+
/* @__PURE__ */ jsxs30("span", { className: "pire-kpi-label", children: [
|
|
1530
|
+
icon ? /* @__PURE__ */ jsx34(Icon, { name: icon, size: 16 }) : null,
|
|
1267
1531
|
label
|
|
1268
1532
|
] }),
|
|
1269
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ jsxs30("span", { className: "pire-kpi-value", children: [
|
|
1270
1534
|
value,
|
|
1271
|
-
unit ? /* @__PURE__ */
|
|
1535
|
+
unit ? /* @__PURE__ */ jsx34("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
1272
1536
|
] }),
|
|
1273
|
-
delta ? /* @__PURE__ */
|
|
1274
|
-
deltaDirection ? /* @__PURE__ */
|
|
1537
|
+
delta ? /* @__PURE__ */ jsxs30("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
1538
|
+
deltaDirection ? /* @__PURE__ */ jsx34(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
1275
1539
|
delta
|
|
1276
1540
|
] }) : null,
|
|
1277
|
-
footnote ? /* @__PURE__ */
|
|
1541
|
+
footnote ? /* @__PURE__ */ jsx34("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
1278
1542
|
] });
|
|
1279
1543
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
1280
|
-
return onPress ? /* @__PURE__ */
|
|
1544
|
+
return onPress ? /* @__PURE__ */ jsx34(AriaButton10, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ jsx34("div", { ...props, children: body });
|
|
1281
1545
|
}
|
|
1282
1546
|
|
|
1283
1547
|
// src/components/data/ObjectHeader.tsx
|
|
1284
|
-
import { jsx as
|
|
1548
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1285
1549
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
1286
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ jsxs31("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
1287
1551
|
breadcrumb,
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
subtitle || id ? /* @__PURE__ */
|
|
1552
|
+
/* @__PURE__ */ jsxs31("div", { className: "pire-objheader-row", children: [
|
|
1553
|
+
/* @__PURE__ */ jsxs31("div", { style: { minWidth: 0 }, children: [
|
|
1554
|
+
/* @__PURE__ */ jsx35("h1", { className: "pire-objheader-title", children: title }),
|
|
1555
|
+
subtitle || id ? /* @__PURE__ */ jsxs31("div", { className: "pire-objheader-sub", children: [
|
|
1292
1556
|
subtitle,
|
|
1293
|
-
id ? /* @__PURE__ */
|
|
1557
|
+
id ? /* @__PURE__ */ jsx35("span", { className: "pire-objheader-id", children: id }) : null
|
|
1294
1558
|
] }) : null
|
|
1295
1559
|
] }),
|
|
1296
1560
|
badge,
|
|
1297
|
-
actions ? /* @__PURE__ */
|
|
1561
|
+
actions ? /* @__PURE__ */ jsx35("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
1298
1562
|
] }),
|
|
1299
|
-
facts?.length ? /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1563
|
+
facts?.length ? /* @__PURE__ */ jsx35("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ jsxs31("div", { children: [
|
|
1564
|
+
/* @__PURE__ */ jsx35("dt", { className: "pire-fact-label", children: fact.label }),
|
|
1565
|
+
/* @__PURE__ */ jsx35("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
1302
1566
|
] }, fact.label)) }) : null
|
|
1303
1567
|
] });
|
|
1304
1568
|
}
|
|
1305
1569
|
|
|
1306
1570
|
// src/components/data/FilterBar.tsx
|
|
1307
|
-
import { jsx as
|
|
1571
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1308
1572
|
function FilterBar({
|
|
1309
1573
|
children,
|
|
1310
1574
|
activeFilters = [],
|
|
@@ -1316,115 +1580,115 @@ function FilterBar({
|
|
|
1316
1580
|
className,
|
|
1317
1581
|
...rest
|
|
1318
1582
|
}) {
|
|
1319
|
-
return /* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ jsxs32("section", { className: cx("pire-filterbar", className), "aria-label": "Filters", ...rest, children: [
|
|
1584
|
+
/* @__PURE__ */ jsxs32("div", { className: "pire-filterbar-controls", children: [
|
|
1321
1585
|
children,
|
|
1322
|
-
onGo ? /* @__PURE__ */
|
|
1586
|
+
onGo ? /* @__PURE__ */ jsx36(Button, { variant: "primary", onPress: onGo, children: "Go" }) : null
|
|
1323
1587
|
] }),
|
|
1324
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */
|
|
1325
|
-
activeFilters.map((filter) => /* @__PURE__ */
|
|
1326
|
-
activeFilters.length && onClear ? /* @__PURE__ */
|
|
1327
|
-
resultLabel ? /* @__PURE__ */
|
|
1328
|
-
actions ? /* @__PURE__ */
|
|
1588
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ jsxs32("div", { className: "pire-filterbar-foot", children: [
|
|
1589
|
+
activeFilters.map((filter) => /* @__PURE__ */ jsx36(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
1590
|
+
activeFilters.length && onClear ? /* @__PURE__ */ jsx36(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: "Clear all" }) : null,
|
|
1591
|
+
resultLabel ? /* @__PURE__ */ jsx36("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
1592
|
+
actions ? /* @__PURE__ */ jsx36("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
1329
1593
|
] }) : null
|
|
1330
1594
|
] });
|
|
1331
1595
|
}
|
|
1332
1596
|
|
|
1333
1597
|
// src/components/data/DescriptionList.tsx
|
|
1334
|
-
import { jsx as
|
|
1598
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1335
1599
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
1336
|
-
return /* @__PURE__ */
|
|
1600
|
+
return /* @__PURE__ */ jsx37(
|
|
1337
1601
|
"dl",
|
|
1338
1602
|
{
|
|
1339
1603
|
className: cx("pire-dl", className),
|
|
1340
1604
|
"data-layout": layout,
|
|
1341
1605
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
1342
1606
|
...rest,
|
|
1343
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1607
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs33("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
1608
|
+
/* @__PURE__ */ jsxs33("dt", { className: "pire-dl-term", children: [
|
|
1345
1609
|
item.label,
|
|
1346
1610
|
item.hint
|
|
1347
1611
|
] }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ jsx37("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
1349
1613
|
] }, i))
|
|
1350
1614
|
}
|
|
1351
1615
|
);
|
|
1352
1616
|
}
|
|
1353
1617
|
|
|
1354
1618
|
// src/components/data/Timeline.tsx
|
|
1355
|
-
import { jsx as
|
|
1619
|
+
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1356
1620
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
1357
1621
|
const list = reverse ? [...entries].reverse() : entries;
|
|
1358
|
-
return /* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
entry.actor ? /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ jsx38("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ jsxs34("li", { className: "pire-timeline-item", children: [
|
|
1623
|
+
/* @__PURE__ */ jsx38("span", { className: "pire-timeline-time", children: entry.time }),
|
|
1624
|
+
/* @__PURE__ */ jsx38("span", { className: "pire-timeline-text", children: entry.event }),
|
|
1625
|
+
entry.actor ? /* @__PURE__ */ jsx38("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
1362
1626
|
] }, entry.id ?? i)) });
|
|
1363
1627
|
}
|
|
1364
1628
|
|
|
1365
1629
|
// src/components/data/LinkList.tsx
|
|
1366
|
-
import { Button as
|
|
1367
|
-
import { jsx as
|
|
1630
|
+
import { Button as AriaButton11 } from "react-aria-components";
|
|
1631
|
+
import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
1368
1632
|
function LinkList({ items, onSelect, className, ...rest }) {
|
|
1369
|
-
return /* @__PURE__ */
|
|
1370
|
-
item.icon ? /* @__PURE__ */
|
|
1371
|
-
item.key ? /* @__PURE__ */
|
|
1372
|
-
item.text ? /* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsx39("div", { className: cx("pire-linklist", className), role: "list", ...rest, children: items.map((item) => /* @__PURE__ */ jsxs35(AriaButton11, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
1634
|
+
item.icon ? /* @__PURE__ */ jsx39(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
1635
|
+
item.key ? /* @__PURE__ */ jsx39("span", { className: "pire-linklist-key", children: item.key }) : null,
|
|
1636
|
+
item.text ? /* @__PURE__ */ jsx39("span", { className: "pire-linklist-text", children: item.text }) : null,
|
|
1373
1637
|
item.trailing
|
|
1374
1638
|
] }, item.id)) });
|
|
1375
1639
|
}
|
|
1376
1640
|
|
|
1377
1641
|
// src/components/layout/PageHeader.tsx
|
|
1378
|
-
import { jsx as
|
|
1642
|
+
import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
1379
1643
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
1380
|
-
return /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
subtitle ? /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ jsxs36("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
1645
|
+
/* @__PURE__ */ jsxs36("div", { style: { minWidth: 0 }, children: [
|
|
1646
|
+
/* @__PURE__ */ jsx40("h1", { className: "pire-pageheader-title", children: title }),
|
|
1647
|
+
subtitle ? /* @__PURE__ */ jsx40("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
1384
1648
|
] }),
|
|
1385
|
-
actions ? /* @__PURE__ */
|
|
1649
|
+
actions ? /* @__PURE__ */ jsx40("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
1386
1650
|
] });
|
|
1387
1651
|
}
|
|
1388
1652
|
|
|
1389
1653
|
// src/components/layout/SectionHeader.tsx
|
|
1390
|
-
import { jsx as
|
|
1654
|
+
import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
1391
1655
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
meta ? /* @__PURE__ */
|
|
1395
|
-
actions ? /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ jsxs37("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
1657
|
+
/* @__PURE__ */ jsx41("span", { className: "pire-eyebrow", children: title }),
|
|
1658
|
+
meta ? /* @__PURE__ */ jsx41("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
1659
|
+
actions ? /* @__PURE__ */ jsx41("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
1396
1660
|
] });
|
|
1397
1661
|
}
|
|
1398
1662
|
|
|
1399
1663
|
// src/components/layout/SelectionBar.tsx
|
|
1400
|
-
import { jsx as
|
|
1664
|
+
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
1401
1665
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
1402
1666
|
if (!count) return null;
|
|
1403
|
-
return /* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ jsxs38("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
1668
|
+
/* @__PURE__ */ jsxs38("span", { className: "pire-selectionbar-count", children: [
|
|
1405
1669
|
count.toLocaleString(),
|
|
1406
1670
|
" ",
|
|
1407
1671
|
noun,
|
|
1408
1672
|
count === 1 ? "" : "s",
|
|
1409
1673
|
" selected"
|
|
1410
1674
|
] }),
|
|
1411
|
-
children ? /* @__PURE__ */
|
|
1412
|
-
actions ? /* @__PURE__ */
|
|
1675
|
+
children ? /* @__PURE__ */ jsx42("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
1676
|
+
actions ? /* @__PURE__ */ jsx42("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
1413
1677
|
] });
|
|
1414
1678
|
}
|
|
1415
1679
|
|
|
1416
1680
|
// src/components/layout/FooterBar.tsx
|
|
1417
|
-
import { jsx as
|
|
1681
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
1418
1682
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
-
note ? /* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ jsxs39("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
1684
|
+
note ? /* @__PURE__ */ jsx43("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
1421
1685
|
children,
|
|
1422
|
-
actions ? /* @__PURE__ */
|
|
1686
|
+
actions ? /* @__PURE__ */ jsx43("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
1423
1687
|
] });
|
|
1424
1688
|
}
|
|
1425
1689
|
|
|
1426
1690
|
// src/components/patterns/ConfirmDialog.tsx
|
|
1427
|
-
import { Fragment as Fragment4, jsx as
|
|
1691
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
1428
1692
|
function ConfirmDialog({
|
|
1429
1693
|
isOpen,
|
|
1430
1694
|
title,
|
|
@@ -1438,7 +1702,7 @@ function ConfirmDialog({
|
|
|
1438
1702
|
onConfirm,
|
|
1439
1703
|
onCancel
|
|
1440
1704
|
}) {
|
|
1441
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ jsxs40(
|
|
1442
1706
|
Dialog,
|
|
1443
1707
|
{
|
|
1444
1708
|
isOpen,
|
|
@@ -1448,12 +1712,12 @@ function ConfirmDialog({
|
|
|
1448
1712
|
onClose: onCancel,
|
|
1449
1713
|
isDismissable: !isBusy,
|
|
1450
1714
|
showClose: false,
|
|
1451
|
-
footer: /* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
1715
|
+
footer: /* @__PURE__ */ jsxs40(Fragment4, { children: [
|
|
1716
|
+
/* @__PURE__ */ jsx44(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
1717
|
+
/* @__PURE__ */ jsx44(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
1454
1718
|
] }),
|
|
1455
1719
|
children: [
|
|
1456
|
-
consequence ? /* @__PURE__ */
|
|
1720
|
+
consequence ? /* @__PURE__ */ jsx44(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
1457
1721
|
children
|
|
1458
1722
|
]
|
|
1459
1723
|
}
|
|
@@ -1462,9 +1726,9 @@ function ConfirmDialog({
|
|
|
1462
1726
|
|
|
1463
1727
|
// src/components/patterns/SidePanel.tsx
|
|
1464
1728
|
import { ModalOverlay as ModalOverlay2, Modal as Modal2, Dialog as AriaDialog3, Heading as Heading3 } from "react-aria-components";
|
|
1465
|
-
import { jsx as
|
|
1729
|
+
import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
1466
1730
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
1467
|
-
return /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ jsx45(
|
|
1468
1732
|
ModalOverlay2,
|
|
1469
1733
|
{
|
|
1470
1734
|
className: "pire-sidepanel-overlay",
|
|
@@ -1473,34 +1737,34 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
1473
1737
|
onOpenChange: (o) => {
|
|
1474
1738
|
if (!o) onClose?.();
|
|
1475
1739
|
},
|
|
1476
|
-
children: /* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
subtitle ? /* @__PURE__ */
|
|
1740
|
+
children: /* @__PURE__ */ jsx45(Modal2, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ jsxs41(AriaDialog3, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
1741
|
+
/* @__PURE__ */ jsxs41("header", { className: "pire-dialog-head", children: [
|
|
1742
|
+
/* @__PURE__ */ jsxs41("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1743
|
+
/* @__PURE__ */ jsx45(Heading3, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
1744
|
+
subtitle ? /* @__PURE__ */ jsx45("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
1481
1745
|
] }),
|
|
1482
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsx45(IconButton, { icon: "x", label: "Close panel", size: "sm", onPress: onClose })
|
|
1483
1747
|
] }),
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
footer ? /* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ jsx45("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
1749
|
+
footer ? /* @__PURE__ */ jsx45("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
1486
1750
|
] }) })
|
|
1487
1751
|
}
|
|
1488
1752
|
);
|
|
1489
1753
|
}
|
|
1490
1754
|
|
|
1491
1755
|
// src/components/patterns/EmptyState.tsx
|
|
1492
|
-
import { jsx as
|
|
1756
|
+
import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
1493
1757
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
1494
|
-
return /* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
title ? /* @__PURE__ */
|
|
1497
|
-
children ? /* @__PURE__ */
|
|
1758
|
+
return /* @__PURE__ */ jsxs42("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
1759
|
+
/* @__PURE__ */ jsx46(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
1760
|
+
title ? /* @__PURE__ */ jsx46("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
1761
|
+
children ? /* @__PURE__ */ jsx46("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
1498
1762
|
action
|
|
1499
1763
|
] });
|
|
1500
1764
|
}
|
|
1501
1765
|
|
|
1502
1766
|
// src/index.ts
|
|
1503
|
-
import { DialogTrigger, MenuTrigger, Menu, MenuItem, Popover as
|
|
1767
|
+
import { DialogTrigger, MenuTrigger, Menu, MenuItem, Popover as Popover5, Separator, I18nProvider } from "react-aria-components";
|
|
1504
1768
|
export {
|
|
1505
1769
|
Avatar,
|
|
1506
1770
|
Badge,
|
|
@@ -1529,11 +1793,12 @@ export {
|
|
|
1529
1793
|
Menu,
|
|
1530
1794
|
MenuItem,
|
|
1531
1795
|
MenuTrigger,
|
|
1796
|
+
MultiComboBox,
|
|
1532
1797
|
NumberField,
|
|
1533
1798
|
ObjectHeader,
|
|
1534
1799
|
PageHeader,
|
|
1535
1800
|
Pagination,
|
|
1536
|
-
|
|
1801
|
+
Popover5 as Popover,
|
|
1537
1802
|
ProgressBar,
|
|
1538
1803
|
Radio,
|
|
1539
1804
|
RadioGroup,
|
|
@@ -1545,9 +1810,12 @@ export {
|
|
|
1545
1810
|
ShellBar,
|
|
1546
1811
|
SideNav,
|
|
1547
1812
|
SidePanel,
|
|
1813
|
+
Skeleton,
|
|
1814
|
+
SkeletonTableRow,
|
|
1548
1815
|
Switch,
|
|
1549
1816
|
Tabs,
|
|
1550
1817
|
Tag,
|
|
1818
|
+
TextArea,
|
|
1551
1819
|
Timeline,
|
|
1552
1820
|
Toast,
|
|
1553
1821
|
ToastProvider,
|