@orianatech/pire 2.0.0 → 2.1.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/core/Button.d.cts +12 -0
- package/dist/components/core/Button.d.ts +12 -0
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/ComingSoonMark.d.cts +39 -0
- package/dist/components/core/ComingSoonMark.d.ts +40 -0
- package/dist/components/core/ComingSoonMark.d.ts.map +1 -0
- package/dist/components/data/DataTable.d.cts +35 -1
- package/dist/components/data/DataTable.d.ts +35 -1
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/forms/FormField.d.ts.map +1 -1
- package/dist/components/layout/SelectionBar.d.cts +31 -4
- package/dist/components/layout/SelectionBar.d.ts +31 -4
- package/dist/components/layout/SelectionBar.d.ts.map +1 -1
- package/dist/components/navigation/Breadcrumb.d.cts +12 -2
- package/dist/components/navigation/Breadcrumb.d.ts +12 -2
- package/dist/components/navigation/Breadcrumb.d.ts.map +1 -1
- package/dist/components/navigation/Ribbon.d.cts +27 -0
- package/dist/components/navigation/Ribbon.d.ts +27 -0
- package/dist/components/navigation/Ribbon.d.ts.map +1 -1
- package/dist/components/navigation/ShellBar.d.cts +19 -1
- package/dist/components/navigation/ShellBar.d.ts +19 -1
- package/dist/components/navigation/ShellBar.d.ts.map +1 -1
- package/dist/components/patterns/SidePanel.d.cts +17 -3
- package/dist/components/patterns/SidePanel.d.ts +17 -3
- package/dist/components/patterns/SidePanel.d.ts.map +1 -1
- package/dist/components.css +213 -2
- package/dist/i18n/messages.d.cts +24 -0
- package/dist/i18n/messages.d.ts +24 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +1350 -950
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1327 -919
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -387,133 +387,11 @@ function Icon({ name, size = 16, label, pack, style, ...rest }) {
|
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
// src/components/core/Button.tsx
|
|
390
|
-
import * as React from "react";
|
|
391
|
-
import { Button as AriaButton } from "react-aria-components";
|
|
392
|
-
|
|
393
|
-
// src/components/utils/cx.ts
|
|
394
|
-
function cx(...parts) {
|
|
395
|
-
return parts.filter(Boolean).join(" ");
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// src/components/core/Button.tsx
|
|
399
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
400
|
-
var Button = React.forwardRef(function Button2({ children, variant = "secondary", size = "md", icon, iconEnd, fullWidth, className, ...rest }, ref) {
|
|
401
|
-
return /* @__PURE__ */ jsxs(
|
|
402
|
-
AriaButton,
|
|
403
|
-
{
|
|
404
|
-
ref,
|
|
405
|
-
className: cx("pire-btn", className),
|
|
406
|
-
"data-variant": variant,
|
|
407
|
-
"data-size": size,
|
|
408
|
-
"data-full-width": fullWidth ? "true" : void 0,
|
|
409
|
-
...rest,
|
|
410
|
-
children: [
|
|
411
|
-
icon ? /* @__PURE__ */ jsx2(Icon, { name: icon, size: 16 }) : null,
|
|
412
|
-
children,
|
|
413
|
-
iconEnd ? /* @__PURE__ */ jsx2(Icon, { name: iconEnd, size: 16 }) : null
|
|
414
|
-
]
|
|
415
|
-
}
|
|
416
|
-
);
|
|
417
|
-
});
|
|
418
|
-
|
|
419
|
-
// src/components/core/IconButton.tsx
|
|
420
|
-
import * as React3 from "react";
|
|
421
|
-
import { Button as AriaButton2 } from "react-aria-components";
|
|
422
|
-
|
|
423
|
-
// src/components/feedback/Tooltip.tsx
|
|
424
390
|
import * as React2 from "react";
|
|
425
|
-
import {
|
|
426
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
427
|
-
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
428
|
-
const props = React2.isValidElement(
|
|
429
|
-
children
|
|
430
|
-
) ? children.props : void 0;
|
|
431
|
-
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
432
|
-
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? (
|
|
433
|
-
// `Focusable` also dev-warns when the element it clones onto has neither a native
|
|
434
|
-
// interactive tag nor an ARIA widget role — a bare `<span>` is neither. Every disabled
|
|
435
|
-
// control this wraps (`IconButton`, `Button`, …) is button-shaped, so `role="button"` plus
|
|
436
|
-
// `aria-disabled` describes the wrapper the same way its disabled child already describes
|
|
437
|
-
// itself, and is what lets the accessible name (from the child's own text or `aria-label`)
|
|
438
|
-
// reach the element that actually holds focus. No static `tabIndex` here on purpose: it
|
|
439
|
-
// would win over the one `Focusable` computes at clone time (react-aria's `mergeProps` lets
|
|
440
|
-
// a prop already on this element beat the one it supplies), silently making the span
|
|
441
|
-
// unfocusable again and reintroducing the defect this file exists to fix. A real `<button>`
|
|
442
|
-
// is not an option either: `children` is very often a button itself (`IconButton`), and a
|
|
443
|
-
// button nested in a button is invalid HTML that browsers repair by breaking the DOM tree.
|
|
444
|
-
// biome-ignore lint/a11y/useFocusableInteractive: tabIndex is added by Focusable's clone, not statically — see above.
|
|
445
|
-
// biome-ignore lint/a11y/useSemanticElements: a real <button> would nest inside the disabled child, which is often one itself — see above.
|
|
446
|
-
/* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children })
|
|
447
|
-
) : /* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", children });
|
|
448
|
-
return /* @__PURE__ */ jsxs2(TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
449
|
-
/* @__PURE__ */ jsx3(Focusable, { children: target }),
|
|
450
|
-
/* @__PURE__ */ jsxs2(AriaTooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
451
|
-
/* @__PURE__ */ jsx3(OverlayArrow, { children: /* @__PURE__ */ jsx3("span", {}) }),
|
|
452
|
-
label
|
|
453
|
-
] })
|
|
454
|
-
] });
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// src/components/core/IconButton.tsx
|
|
458
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
459
|
-
var IconButton = React3.forwardRef(function IconButton2({
|
|
460
|
-
icon,
|
|
461
|
-
label,
|
|
462
|
-
size = "md",
|
|
463
|
-
variant = "tertiary",
|
|
464
|
-
selected,
|
|
465
|
-
hideTooltip,
|
|
466
|
-
count,
|
|
467
|
-
countMax = 9,
|
|
468
|
-
countVariant = "number",
|
|
469
|
-
className,
|
|
470
|
-
...rest
|
|
471
|
-
}, ref) {
|
|
472
|
-
const showsCount = count != null && count > 0;
|
|
473
|
-
const button = /* @__PURE__ */ jsxs3(
|
|
474
|
-
AriaButton2,
|
|
475
|
-
{
|
|
476
|
-
ref,
|
|
477
|
-
"aria-label": label,
|
|
478
|
-
"aria-pressed": selected,
|
|
479
|
-
className: cx("pire-iconbtn", className),
|
|
480
|
-
"data-size": size,
|
|
481
|
-
"data-variant": variant,
|
|
482
|
-
"data-selected": selected ? "true" : void 0,
|
|
483
|
-
"data-has-count": showsCount ? "true" : void 0,
|
|
484
|
-
...rest,
|
|
485
|
-
children: [
|
|
486
|
-
/* @__PURE__ */ jsx4(Icon, { name: icon, size: size === "lg" ? 20 : 16 }),
|
|
487
|
-
showsCount ? /* @__PURE__ */ jsx4("span", { className: "pire-iconbtn-count", "data-variant": countVariant, "aria-hidden": "true", children: countVariant === "number" ? count > countMax ? `${countMax}+` : count : null }) : null
|
|
488
|
-
]
|
|
489
|
-
}
|
|
490
|
-
);
|
|
491
|
-
return hideTooltip ? button : /* @__PURE__ */ jsx4(Tooltip, { label, children: button });
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
// src/components/core/Badge.tsx
|
|
495
|
-
import * as React4 from "react";
|
|
496
|
-
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
497
|
-
var STATUS_ICON = {
|
|
498
|
-
positive: "check-circle-2",
|
|
499
|
-
critical: "alert-triangle",
|
|
500
|
-
negative: "x-circle",
|
|
501
|
-
informative: "info",
|
|
502
|
-
neutral: "circle"
|
|
503
|
-
};
|
|
504
|
-
var Badge = React4.forwardRef(function Badge2({ children, status = "neutral", showIcon = true, className, ...rest }, ref) {
|
|
505
|
-
return /* @__PURE__ */ jsxs4("span", { ref, className: cx("pire-badge", className), "data-status": status, ...rest, children: [
|
|
506
|
-
showIcon ? /* @__PURE__ */ jsx5(Icon, { name: STATUS_ICON[status], size: 12 }) : null,
|
|
507
|
-
children
|
|
508
|
-
] });
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
// src/components/core/Tag.tsx
|
|
512
|
-
import * as React6 from "react";
|
|
513
|
-
import { Button as AriaButton3 } from "react-aria-components";
|
|
391
|
+
import { Button as AriaButton } from "react-aria-components";
|
|
514
392
|
|
|
515
393
|
// src/i18n/PireIntlProvider.tsx
|
|
516
|
-
import * as
|
|
394
|
+
import * as React from "react";
|
|
517
395
|
|
|
518
396
|
// src/i18n/messages.ts
|
|
519
397
|
var enMessages = {
|
|
@@ -602,7 +480,17 @@ var enMessages = {
|
|
|
602
480
|
tagRemove: "Remove",
|
|
603
481
|
ribbonLabel: "Commands",
|
|
604
482
|
ribbonCollapse: "Collapse the ribbon",
|
|
605
|
-
ribbonExpand: "Expand the ribbon"
|
|
483
|
+
ribbonExpand: "Expand the ribbon",
|
|
484
|
+
comingSoon: "Soon",
|
|
485
|
+
selectionBarCountOne: "{count} {noun} selected",
|
|
486
|
+
selectionBarCountOther: "{count} {noun} selected",
|
|
487
|
+
selectionBarCountOneFeminine: "{count} {noun} selected",
|
|
488
|
+
selectionBarCountOtherFeminine: "{count} {noun} selected",
|
|
489
|
+
selectionBarNounOne: "record",
|
|
490
|
+
selectionBarNounOther: "records",
|
|
491
|
+
selectionBarClear: "Clear selection",
|
|
492
|
+
breadcrumbMore: "Show the full path",
|
|
493
|
+
breadcrumbLabel: "Breadcrumb"
|
|
606
494
|
};
|
|
607
495
|
var esMessages = {
|
|
608
496
|
filterBarLabel: "Filtros",
|
|
@@ -690,29 +578,200 @@ var esMessages = {
|
|
|
690
578
|
tagRemove: "Quitar",
|
|
691
579
|
ribbonLabel: "Comandos",
|
|
692
580
|
ribbonCollapse: "Contraer la cinta",
|
|
693
|
-
ribbonExpand: "Expandir la cinta"
|
|
581
|
+
ribbonExpand: "Expandir la cinta",
|
|
582
|
+
comingSoon: "Pronto",
|
|
583
|
+
selectionBarCountOne: "{count} {noun} seleccionado",
|
|
584
|
+
selectionBarCountOther: "{count} {noun} seleccionados",
|
|
585
|
+
selectionBarCountOneFeminine: "{count} {noun} seleccionada",
|
|
586
|
+
selectionBarCountOtherFeminine: "{count} {noun} seleccionadas",
|
|
587
|
+
selectionBarNounOne: "registro",
|
|
588
|
+
selectionBarNounOther: "registros",
|
|
589
|
+
selectionBarClear: "Quitar selecci\xF3n",
|
|
590
|
+
breadcrumbMore: "Mostrar la ruta completa",
|
|
591
|
+
breadcrumbLabel: "Ruta de navegaci\xF3n"
|
|
694
592
|
};
|
|
695
593
|
|
|
696
594
|
// src/i18n/PireIntlProvider.tsx
|
|
697
|
-
import { jsx as
|
|
698
|
-
var MessagesContext =
|
|
595
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
596
|
+
var MessagesContext = React.createContext(enMessages);
|
|
699
597
|
function PireIntlProvider({ messages, children }) {
|
|
700
|
-
const value =
|
|
701
|
-
return /* @__PURE__ */
|
|
598
|
+
const value = React.useMemo(() => messages ? { ...enMessages, ...messages } : enMessages, [messages]);
|
|
599
|
+
return /* @__PURE__ */ jsx2(MessagesContext.Provider, { value, children });
|
|
702
600
|
}
|
|
703
601
|
function usePireMessages() {
|
|
704
|
-
return
|
|
602
|
+
return React.useContext(MessagesContext);
|
|
705
603
|
}
|
|
706
604
|
function useMessage(key, override) {
|
|
707
|
-
const messages =
|
|
605
|
+
const messages = React.useContext(MessagesContext);
|
|
708
606
|
return override ?? messages[key];
|
|
709
607
|
}
|
|
710
608
|
|
|
711
|
-
// src/components/core/
|
|
609
|
+
// src/components/core/ComingSoonMark.tsx
|
|
610
|
+
import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
611
|
+
function ComingSoonMark({ announce }) {
|
|
612
|
+
const msg = usePireMessages();
|
|
613
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
614
|
+
announce ? /* @__PURE__ */ jsxs("span", { className: "pire-sr-only", children: [
|
|
615
|
+
", ",
|
|
616
|
+
msg.comingSoon
|
|
617
|
+
] }) : null,
|
|
618
|
+
/* @__PURE__ */ jsx3("span", { className: "pire-soon-mark", "aria-hidden": "true", children: msg.comingSoon })
|
|
619
|
+
] });
|
|
620
|
+
}
|
|
621
|
+
function comingSoonProps(label, comingSoon) {
|
|
622
|
+
return {
|
|
623
|
+
"aria-disabled": true,
|
|
624
|
+
"data-coming-soon": "true",
|
|
625
|
+
type: "button",
|
|
626
|
+
onPress: void 0,
|
|
627
|
+
onPressStart: void 0,
|
|
628
|
+
onPressEnd: void 0,
|
|
629
|
+
onPressUp: void 0,
|
|
630
|
+
onPressChange: void 0,
|
|
631
|
+
onClick: void 0,
|
|
632
|
+
...label != null ? { "aria-label": `${label}, ${comingSoon}` } : {}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// src/components/utils/cx.ts
|
|
637
|
+
function cx(...parts) {
|
|
638
|
+
return parts.filter(Boolean).join(" ");
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// src/components/core/Button.tsx
|
|
642
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
643
|
+
var Button = React2.forwardRef(function Button2({
|
|
644
|
+
children,
|
|
645
|
+
variant = "secondary",
|
|
646
|
+
size = "md",
|
|
647
|
+
icon,
|
|
648
|
+
iconEnd,
|
|
649
|
+
fullWidth,
|
|
650
|
+
isComingSoon,
|
|
651
|
+
className,
|
|
652
|
+
...rest
|
|
653
|
+
}, ref) {
|
|
654
|
+
const msg = usePireMessages();
|
|
655
|
+
const soonLabel = rest["aria-label"] ?? (typeof children === "string" ? children : void 0);
|
|
656
|
+
return /* @__PURE__ */ jsxs2(
|
|
657
|
+
AriaButton,
|
|
658
|
+
{
|
|
659
|
+
ref,
|
|
660
|
+
className: cx("pire-btn", className),
|
|
661
|
+
"data-variant": variant,
|
|
662
|
+
"data-size": size,
|
|
663
|
+
"data-full-width": fullWidth ? "true" : void 0,
|
|
664
|
+
...rest,
|
|
665
|
+
...isComingSoon ? comingSoonProps(soonLabel, msg.comingSoon) : {},
|
|
666
|
+
children: [
|
|
667
|
+
icon ? /* @__PURE__ */ jsx4(Icon, { name: icon, size: 16 }) : null,
|
|
668
|
+
children,
|
|
669
|
+
iconEnd ? /* @__PURE__ */ jsx4(Icon, { name: iconEnd, size: 16 }) : null,
|
|
670
|
+
isComingSoon ? /* @__PURE__ */ jsx4(ComingSoonMark, { announce: soonLabel == null }) : null
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
// src/components/core/IconButton.tsx
|
|
677
|
+
import * as React4 from "react";
|
|
678
|
+
import { Button as AriaButton2 } from "react-aria-components";
|
|
679
|
+
|
|
680
|
+
// src/components/feedback/Tooltip.tsx
|
|
681
|
+
import * as React3 from "react";
|
|
682
|
+
import { TooltipTrigger, Tooltip as AriaTooltip, OverlayArrow, Focusable } from "react-aria-components";
|
|
683
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
684
|
+
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
685
|
+
const props = React3.isValidElement(
|
|
686
|
+
children
|
|
687
|
+
) ? children.props : void 0;
|
|
688
|
+
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
689
|
+
const target = React3.isValidElement(children) && !isDisabledChild ? React3.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? (
|
|
690
|
+
// `Focusable` also dev-warns when the element it clones onto has neither a native
|
|
691
|
+
// interactive tag nor an ARIA widget role — a bare `<span>` is neither. Every disabled
|
|
692
|
+
// control this wraps (`IconButton`, `Button`, …) is button-shaped, so `role="button"` plus
|
|
693
|
+
// `aria-disabled` describes the wrapper the same way its disabled child already describes
|
|
694
|
+
// itself, and is what lets the accessible name (from the child's own text or `aria-label`)
|
|
695
|
+
// reach the element that actually holds focus. No static `tabIndex` here on purpose: it
|
|
696
|
+
// would win over the one `Focusable` computes at clone time (react-aria's `mergeProps` lets
|
|
697
|
+
// a prop already on this element beat the one it supplies), silently making the span
|
|
698
|
+
// unfocusable again and reintroducing the defect this file exists to fix. A real `<button>`
|
|
699
|
+
// is not an option either: `children` is very often a button itself (`IconButton`), and a
|
|
700
|
+
// button nested in a button is invalid HTML that browsers repair by breaking the DOM tree.
|
|
701
|
+
// biome-ignore lint/a11y/useFocusableInteractive: tabIndex is added by Focusable's clone, not statically — see above.
|
|
702
|
+
// biome-ignore lint/a11y/useSemanticElements: a real <button> would nest inside the disabled child, which is often one itself — see above.
|
|
703
|
+
/* @__PURE__ */ jsx5("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children })
|
|
704
|
+
) : /* @__PURE__ */ jsx5("span", { className: "pire-tooltip-target", children });
|
|
705
|
+
return /* @__PURE__ */ jsxs3(TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
706
|
+
/* @__PURE__ */ jsx5(Focusable, { children: target }),
|
|
707
|
+
/* @__PURE__ */ jsxs3(AriaTooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
708
|
+
/* @__PURE__ */ jsx5(OverlayArrow, { children: /* @__PURE__ */ jsx5("span", {}) }),
|
|
709
|
+
label
|
|
710
|
+
] })
|
|
711
|
+
] });
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// src/components/core/IconButton.tsx
|
|
715
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
716
|
+
var IconButton = React4.forwardRef(function IconButton2({
|
|
717
|
+
icon,
|
|
718
|
+
label,
|
|
719
|
+
size = "md",
|
|
720
|
+
variant = "tertiary",
|
|
721
|
+
selected,
|
|
722
|
+
hideTooltip,
|
|
723
|
+
count,
|
|
724
|
+
countMax = 9,
|
|
725
|
+
countVariant = "number",
|
|
726
|
+
className,
|
|
727
|
+
...rest
|
|
728
|
+
}, ref) {
|
|
729
|
+
const showsCount = count != null && count > 0;
|
|
730
|
+
const button = /* @__PURE__ */ jsxs4(
|
|
731
|
+
AriaButton2,
|
|
732
|
+
{
|
|
733
|
+
ref,
|
|
734
|
+
"aria-label": label,
|
|
735
|
+
"aria-pressed": selected,
|
|
736
|
+
className: cx("pire-iconbtn", className),
|
|
737
|
+
"data-size": size,
|
|
738
|
+
"data-variant": variant,
|
|
739
|
+
"data-selected": selected ? "true" : void 0,
|
|
740
|
+
"data-has-count": showsCount ? "true" : void 0,
|
|
741
|
+
...rest,
|
|
742
|
+
children: [
|
|
743
|
+
/* @__PURE__ */ jsx6(Icon, { name: icon, size: size === "lg" ? 20 : 16 }),
|
|
744
|
+
showsCount ? /* @__PURE__ */ jsx6("span", { className: "pire-iconbtn-count", "data-variant": countVariant, "aria-hidden": "true", children: countVariant === "number" ? count > countMax ? `${countMax}+` : count : null }) : null
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
);
|
|
748
|
+
return hideTooltip ? button : /* @__PURE__ */ jsx6(Tooltip, { label, children: button });
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
// src/components/core/Badge.tsx
|
|
752
|
+
import * as React5 from "react";
|
|
712
753
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
754
|
+
var STATUS_ICON = {
|
|
755
|
+
positive: "check-circle-2",
|
|
756
|
+
critical: "alert-triangle",
|
|
757
|
+
negative: "x-circle",
|
|
758
|
+
informative: "info",
|
|
759
|
+
neutral: "circle"
|
|
760
|
+
};
|
|
761
|
+
var Badge = React5.forwardRef(function Badge2({ children, status = "neutral", showIcon = true, className, ...rest }, ref) {
|
|
762
|
+
return /* @__PURE__ */ jsxs5("span", { ref, className: cx("pire-badge", className), "data-status": status, ...rest, children: [
|
|
763
|
+
showIcon ? /* @__PURE__ */ jsx7(Icon, { name: STATUS_ICON[status], size: 12 }) : null,
|
|
764
|
+
children
|
|
765
|
+
] });
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
// src/components/core/Tag.tsx
|
|
769
|
+
import * as React6 from "react";
|
|
770
|
+
import { Button as AriaButton3 } from "react-aria-components";
|
|
771
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
713
772
|
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
714
773
|
const msg = usePireMessages();
|
|
715
|
-
return /* @__PURE__ */
|
|
774
|
+
return /* @__PURE__ */ jsxs6(
|
|
716
775
|
"span",
|
|
717
776
|
{
|
|
718
777
|
ref,
|
|
@@ -720,16 +779,16 @@ var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, cate
|
|
|
720
779
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
721
780
|
...rest,
|
|
722
781
|
children: [
|
|
723
|
-
category ? /* @__PURE__ */
|
|
782
|
+
category ? /* @__PURE__ */ jsx8("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
724
783
|
children,
|
|
725
|
-
onRemove ? /* @__PURE__ */
|
|
784
|
+
onRemove ? /* @__PURE__ */ jsx8(
|
|
726
785
|
AriaButton3,
|
|
727
786
|
{
|
|
728
787
|
className: "pire-tag-remove",
|
|
729
788
|
isDisabled,
|
|
730
789
|
onPress: onRemove,
|
|
731
790
|
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
732
|
-
children: /* @__PURE__ */
|
|
791
|
+
children: /* @__PURE__ */ jsx8(Icon, { name: "x", size: 12 })
|
|
733
792
|
}
|
|
734
793
|
) : null
|
|
735
794
|
]
|
|
@@ -738,7 +797,7 @@ var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, cate
|
|
|
738
797
|
});
|
|
739
798
|
|
|
740
799
|
// src/components/core/Card.tsx
|
|
741
|
-
import { jsx as
|
|
800
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
742
801
|
function Card({
|
|
743
802
|
title,
|
|
744
803
|
subtitle,
|
|
@@ -750,23 +809,23 @@ function Card({
|
|
|
750
809
|
className,
|
|
751
810
|
...rest
|
|
752
811
|
}) {
|
|
753
|
-
return /* @__PURE__ */
|
|
812
|
+
return /* @__PURE__ */ jsxs7(
|
|
754
813
|
"section",
|
|
755
814
|
{
|
|
756
815
|
className: cx("pire-card", className),
|
|
757
816
|
"data-interactive": interactive ? "true" : void 0,
|
|
758
817
|
...rest,
|
|
759
818
|
children: [
|
|
760
|
-
title || actions ? /* @__PURE__ */
|
|
761
|
-
icon ? /* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
subtitle ? /* @__PURE__ */
|
|
819
|
+
title || actions ? /* @__PURE__ */ jsxs7("header", { className: "pire-card-head", children: [
|
|
820
|
+
icon ? /* @__PURE__ */ jsx9(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
821
|
+
/* @__PURE__ */ jsxs7("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
822
|
+
/* @__PURE__ */ jsx9("h3", { className: "pire-card-title", children: title }),
|
|
823
|
+
subtitle ? /* @__PURE__ */ jsx9("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
765
824
|
] }),
|
|
766
|
-
actions ? /* @__PURE__ */
|
|
825
|
+
actions ? /* @__PURE__ */ jsx9("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
767
826
|
] }) : null,
|
|
768
|
-
children ? /* @__PURE__ */
|
|
769
|
-
footer ? /* @__PURE__ */
|
|
827
|
+
children ? /* @__PURE__ */ jsx9("div", { className: "pire-card-body", children }) : null,
|
|
828
|
+
footer ? /* @__PURE__ */ jsx9("footer", { className: "pire-card-foot", children: footer }) : null
|
|
770
829
|
]
|
|
771
830
|
}
|
|
772
831
|
);
|
|
@@ -774,11 +833,11 @@ function Card({
|
|
|
774
833
|
|
|
775
834
|
// src/components/core/Avatar.tsx
|
|
776
835
|
import * as React7 from "react";
|
|
777
|
-
import { jsx as
|
|
836
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
778
837
|
var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
779
838
|
function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
780
839
|
const [failed, setFailed] = React7.useState(false);
|
|
781
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ jsx10("span", { className: cx("pire-avatar", className), "data-size": size, role: "img", "aria-label": name, ...rest, children: src && !failed ? /* @__PURE__ */ jsx10(
|
|
782
841
|
"img",
|
|
783
842
|
{
|
|
784
843
|
src,
|
|
@@ -792,7 +851,7 @@ function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
|
792
851
|
// src/components/core/SegmentedControl.tsx
|
|
793
852
|
import * as React8 from "react";
|
|
794
853
|
import { ToggleButtonGroup, ToggleButton } from "react-aria-components";
|
|
795
|
-
import { jsx as
|
|
854
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
796
855
|
function SegmentedControl({
|
|
797
856
|
options,
|
|
798
857
|
value,
|
|
@@ -808,7 +867,7 @@ function SegmentedControl({
|
|
|
808
867
|
() => new Set(value ? [value] : defaultValue ? [defaultValue] : []),
|
|
809
868
|
[value, defaultValue]
|
|
810
869
|
);
|
|
811
|
-
return /* @__PURE__ */
|
|
870
|
+
return /* @__PURE__ */ jsx11(
|
|
812
871
|
ToggleButtonGroup,
|
|
813
872
|
{
|
|
814
873
|
className: cx("pire-segmented", className),
|
|
@@ -822,7 +881,7 @@ function SegmentedControl({
|
|
|
822
881
|
const first = [...keys][0];
|
|
823
882
|
if (first != null) onChange?.(String(first));
|
|
824
883
|
},
|
|
825
|
-
children: options.map((option) => /* @__PURE__ */
|
|
884
|
+
children: options.map((option) => /* @__PURE__ */ jsxs8(
|
|
826
885
|
ToggleButton,
|
|
827
886
|
{
|
|
828
887
|
id: option.id,
|
|
@@ -830,7 +889,7 @@ function SegmentedControl({
|
|
|
830
889
|
isDisabled: option.isDisabled,
|
|
831
890
|
"aria-label": iconOnly ? option.label : void 0,
|
|
832
891
|
children: [
|
|
833
|
-
option.icon ? /* @__PURE__ */
|
|
892
|
+
option.icon ? /* @__PURE__ */ jsx11(Icon, { name: option.icon, size: 16 }) : null,
|
|
834
893
|
iconOnly ? null : option.label
|
|
835
894
|
]
|
|
836
895
|
},
|
|
@@ -842,7 +901,7 @@ function SegmentedControl({
|
|
|
842
901
|
|
|
843
902
|
// src/components/core/Text.tsx
|
|
844
903
|
import * as React9 from "react";
|
|
845
|
-
import { jsx as
|
|
904
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
846
905
|
var Text = React9.forwardRef(function Text2({
|
|
847
906
|
size = "body",
|
|
848
907
|
color = "primary",
|
|
@@ -857,7 +916,7 @@ var Text = React9.forwardRef(function Text2({
|
|
|
857
916
|
}, ref) {
|
|
858
917
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
859
918
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
860
|
-
return /* @__PURE__ */
|
|
919
|
+
return /* @__PURE__ */ jsx12(
|
|
861
920
|
Wrapper,
|
|
862
921
|
{
|
|
863
922
|
ref,
|
|
@@ -874,12 +933,12 @@ var Text = React9.forwardRef(function Text2({
|
|
|
874
933
|
);
|
|
875
934
|
});
|
|
876
935
|
var Strong = React9.forwardRef(function Strong2({ className, ...rest }, ref) {
|
|
877
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ jsx12(Text, { ref, elementType: "span", weight: "strong", className, ...rest });
|
|
878
937
|
});
|
|
879
938
|
|
|
880
939
|
// src/components/core/Heading.tsx
|
|
881
940
|
import { Heading as AriaHeading } from "react-aria-components";
|
|
882
|
-
import { jsx as
|
|
941
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
883
942
|
function Heading({
|
|
884
943
|
level = 2,
|
|
885
944
|
size,
|
|
@@ -891,7 +950,7 @@ function Heading({
|
|
|
891
950
|
}) {
|
|
892
951
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
893
952
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
894
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ jsx13(
|
|
895
954
|
AriaHeading,
|
|
896
955
|
{
|
|
897
956
|
level,
|
|
@@ -907,9 +966,9 @@ function Heading({
|
|
|
907
966
|
|
|
908
967
|
// src/components/core/Link.tsx
|
|
909
968
|
import { Link as AriaLink } from "react-aria-components";
|
|
910
|
-
import { jsx as
|
|
969
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
911
970
|
function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
912
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ jsxs9(
|
|
913
972
|
AriaLink,
|
|
914
973
|
{
|
|
915
974
|
className: cx("pire-link", className),
|
|
@@ -919,7 +978,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
919
978
|
...rest,
|
|
920
979
|
children: [
|
|
921
980
|
children,
|
|
922
|
-
isExternal ? /* @__PURE__ */
|
|
981
|
+
isExternal ? /* @__PURE__ */ jsx14(Icon, { name: "external-link", size: 12, className: "pire-link-external" }) : null
|
|
923
982
|
]
|
|
924
983
|
}
|
|
925
984
|
);
|
|
@@ -927,7 +986,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
927
986
|
|
|
928
987
|
// src/components/core/Separator.tsx
|
|
929
988
|
import { Separator as AriaSeparator } from "react-aria-components";
|
|
930
|
-
import { jsx as
|
|
989
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
931
990
|
function Separator({
|
|
932
991
|
orientation = "horizontal",
|
|
933
992
|
emphasis = "default",
|
|
@@ -935,7 +994,7 @@ function Separator({
|
|
|
935
994
|
className,
|
|
936
995
|
...rest
|
|
937
996
|
}) {
|
|
938
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsx15(
|
|
939
998
|
AriaSeparator,
|
|
940
999
|
{
|
|
941
1000
|
orientation,
|
|
@@ -949,14 +1008,14 @@ function Separator({
|
|
|
949
1008
|
}
|
|
950
1009
|
|
|
951
1010
|
// src/components/core/Kbd.tsx
|
|
952
|
-
import { jsx as
|
|
1011
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
953
1012
|
function Kbd({ children, size = "md", className, ...rest }) {
|
|
954
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ jsx16("kbd", { className: cx("pire-kbd", className), "data-size": size, ...rest, children });
|
|
955
1014
|
}
|
|
956
1015
|
|
|
957
1016
|
// src/components/forms/FieldHelp.tsx
|
|
958
1017
|
import { ButtonContext } from "react-aria-components";
|
|
959
|
-
import { jsx as
|
|
1018
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
960
1019
|
function FieldHelp({ children, label, placement = "top" }) {
|
|
961
1020
|
const msg = usePireMessages();
|
|
962
1021
|
return (
|
|
@@ -967,12 +1026,12 @@ function FieldHelp({ children, label, placement = "top" }) {
|
|
|
967
1026
|
// renders. `value={null}` is React Aria's own idiom for lifting a subtree back out of a
|
|
968
1027
|
// slotted context — the same one `MultiComboBox` and `FieldLabel` use — and is what makes
|
|
969
1028
|
// this component safe anywhere.
|
|
970
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx17(ButtonContext.Provider, { value: null, children: /* @__PURE__ */ jsx17(Tooltip, { label: children, placement, children: /* @__PURE__ */ jsx17(IconButton, { icon: "help-circle", label: label ?? msg.fieldHelp, size: "sm", hideTooltip: true }) }) })
|
|
971
1030
|
);
|
|
972
1031
|
}
|
|
973
1032
|
|
|
974
1033
|
// src/components/forms/FormField.tsx
|
|
975
|
-
import { jsx as
|
|
1034
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
976
1035
|
function FormField({
|
|
977
1036
|
label,
|
|
978
1037
|
htmlFor,
|
|
@@ -985,20 +1044,27 @@ function FormField({
|
|
|
985
1044
|
className,
|
|
986
1045
|
...rest
|
|
987
1046
|
}) {
|
|
988
|
-
const
|
|
1047
|
+
const msg = usePireMessages();
|
|
1048
|
+
const labelEl = /* @__PURE__ */ jsxs10("label", { className: "pire-field-label", htmlFor, children: [
|
|
989
1049
|
label,
|
|
990
|
-
isRequired ? /* @__PURE__ */
|
|
1050
|
+
isRequired ? /* @__PURE__ */ jsx18("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
991
1051
|
] });
|
|
992
|
-
return /* @__PURE__ */
|
|
993
|
-
help ? /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ jsxs10("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
1053
|
+
help ? /* @__PURE__ */ jsxs10("div", { className: "pire-field-labelrow", children: [
|
|
994
1054
|
labelEl,
|
|
995
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ jsx18(
|
|
1056
|
+
FieldHelp,
|
|
1057
|
+
{
|
|
1058
|
+
label: typeof label === "string" ? msg.fieldHelpNamed.replace("{label}", label.toLowerCase()) : void 0,
|
|
1059
|
+
children: help
|
|
1060
|
+
}
|
|
1061
|
+
)
|
|
996
1062
|
] }) : labelEl,
|
|
997
1063
|
children,
|
|
998
|
-
error ? /* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1064
|
+
error ? /* @__PURE__ */ jsxs10("span", { className: "pire-field-error", role: "alert", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx18(Icon, { name: "alert-circle", size: 12 }),
|
|
1000
1066
|
error
|
|
1001
|
-
] }) : hint ? /* @__PURE__ */
|
|
1067
|
+
] }) : hint ? /* @__PURE__ */ jsx18("span", { className: "pire-field-hint", children: hint }) : null
|
|
1002
1068
|
] });
|
|
1003
1069
|
}
|
|
1004
1070
|
|
|
@@ -1031,7 +1097,7 @@ function warnOnce2(key, message) {
|
|
|
1031
1097
|
}
|
|
1032
1098
|
|
|
1033
1099
|
// src/components/forms/FieldLabel.tsx
|
|
1034
|
-
import { jsx as
|
|
1100
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1035
1101
|
function warnHelpWithoutLabel(component, label, help) {
|
|
1036
1102
|
if (!IS_DEV2 || !help || label) return;
|
|
1037
1103
|
warnOnce2(
|
|
@@ -1041,17 +1107,17 @@ function warnHelpWithoutLabel(component, label, help) {
|
|
|
1041
1107
|
}
|
|
1042
1108
|
function FieldLabel({ label, isRequired, help }) {
|
|
1043
1109
|
const msg = usePireMessages();
|
|
1044
|
-
const text = /* @__PURE__ */
|
|
1110
|
+
const text = /* @__PURE__ */ jsxs11(Label, { className: "pire-field-label", children: [
|
|
1045
1111
|
label,
|
|
1046
|
-
isRequired ? /* @__PURE__ */
|
|
1112
|
+
isRequired ? /* @__PURE__ */ jsx19("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1047
1113
|
] });
|
|
1048
1114
|
return (
|
|
1049
1115
|
// React Aria's own idiom for lifting a subtree back out of a slotted context — the same one
|
|
1050
1116
|
// `MultiComboBox` uses on its chips, and the one Popover uses on the way into an overlay.
|
|
1051
1117
|
// Without it every Button below a field inherits that field's trigger props.
|
|
1052
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsx19(ButtonContext2.Provider, { value: null, children: help ? /* @__PURE__ */ jsxs11("div", { className: "pire-field-labelrow", children: [
|
|
1053
1119
|
text,
|
|
1054
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx19(
|
|
1055
1121
|
FieldHelp,
|
|
1056
1122
|
{
|
|
1057
1123
|
label: typeof label === "string" ? msg.fieldHelpNamed.replace("{label}", label.toLowerCase()) : void 0,
|
|
@@ -1064,7 +1130,7 @@ function FieldLabel({ label, isRequired, help }) {
|
|
|
1064
1130
|
|
|
1065
1131
|
// src/components/forms/FieldDescription.tsx
|
|
1066
1132
|
import { Text as Text3 } from "react-aria-components";
|
|
1067
|
-
import { jsx as
|
|
1133
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1068
1134
|
function FieldDescription({ description, help }) {
|
|
1069
1135
|
if (!description && !help) return null;
|
|
1070
1136
|
return (
|
|
@@ -1072,15 +1138,15 @@ function FieldDescription({ description, help }) {
|
|
|
1072
1138
|
// another pire-* class is what grew the document sideways in 0.23.0. Choosing `pire-sr-only`
|
|
1073
1139
|
// when there is no visible description also keeps the node out of `.pire-field`'s flex gap —
|
|
1074
1140
|
// a `pire-field-hint` holding only hidden text still opens a visible gap under every field.
|
|
1075
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ jsxs12(Text3, { slot: "description", className: description ? "pire-field-hint" : "pire-sr-only", children: [
|
|
1076
1142
|
description,
|
|
1077
|
-
help ? /* @__PURE__ */
|
|
1143
|
+
help ? /* @__PURE__ */ jsx20("span", { className: "pire-sr-only", children: help }) : null
|
|
1078
1144
|
] })
|
|
1079
1145
|
);
|
|
1080
1146
|
}
|
|
1081
1147
|
|
|
1082
1148
|
// src/components/forms/Input.tsx
|
|
1083
|
-
import { jsx as
|
|
1149
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1084
1150
|
function Input({
|
|
1085
1151
|
label,
|
|
1086
1152
|
icon,
|
|
@@ -1111,7 +1177,7 @@ function Input({
|
|
|
1111
1177
|
const valueProps = takesOverValue ? { value: ownValue, defaultValue: void 0 } : {};
|
|
1112
1178
|
const showsClear = isClearable && currentValue !== "" && !rest.isDisabled && !rest.isReadOnly;
|
|
1113
1179
|
warnHelpWithoutLabel("Input", label, help);
|
|
1114
|
-
return /* @__PURE__ */
|
|
1180
|
+
return /* @__PURE__ */ jsxs13(
|
|
1115
1181
|
TextField,
|
|
1116
1182
|
{
|
|
1117
1183
|
className: cx("pire-field", className),
|
|
@@ -1121,8 +1187,8 @@ function Input({
|
|
|
1121
1187
|
...rest,
|
|
1122
1188
|
...valueProps,
|
|
1123
1189
|
children: [
|
|
1124
|
-
label ? /* @__PURE__ */
|
|
1125
|
-
/* @__PURE__ */
|
|
1190
|
+
label ? /* @__PURE__ */ jsx21(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1191
|
+
/* @__PURE__ */ jsxs13(
|
|
1126
1192
|
Group,
|
|
1127
1193
|
{
|
|
1128
1194
|
className: "pire-control",
|
|
@@ -1131,9 +1197,9 @@ function Input({
|
|
|
1131
1197
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1132
1198
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1133
1199
|
children: [
|
|
1134
|
-
icon ? /* @__PURE__ */
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
showsClear ? /* @__PURE__ */
|
|
1200
|
+
icon ? /* @__PURE__ */ jsx21(Icon, { name: icon, size: 16, className: "pire-leading-icon" }) : null,
|
|
1201
|
+
/* @__PURE__ */ jsx21(AriaInput, { ref: inputRef, className: "pire-input", "data-numeric": numeric ? "true" : void 0 }),
|
|
1202
|
+
showsClear ? /* @__PURE__ */ jsx21(
|
|
1137
1203
|
AriaButton4,
|
|
1138
1204
|
{
|
|
1139
1205
|
className: "pire-input-clear",
|
|
@@ -1144,12 +1210,12 @@ function Input({
|
|
|
1144
1210
|
children: clearLabel ?? msg.inputClear
|
|
1145
1211
|
}
|
|
1146
1212
|
) : null,
|
|
1147
|
-
suffix ? /* @__PURE__ */
|
|
1213
|
+
suffix ? /* @__PURE__ */ jsx21("span", { className: "pire-affix", children: suffix }) : null
|
|
1148
1214
|
]
|
|
1149
1215
|
}
|
|
1150
1216
|
),
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsx21(FieldDescription, { description, help }),
|
|
1218
|
+
/* @__PURE__ */ jsx21(FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1153
1219
|
]
|
|
1154
1220
|
}
|
|
1155
1221
|
);
|
|
@@ -1158,7 +1224,7 @@ function Input({
|
|
|
1158
1224
|
// src/components/forms/TextArea.tsx
|
|
1159
1225
|
import * as React11 from "react";
|
|
1160
1226
|
import { TextField as TextField2, TextArea as AriaTextArea, Group as Group2, FieldError as FieldError2 } from "react-aria-components";
|
|
1161
|
-
import { jsx as
|
|
1227
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1162
1228
|
var useIsomorphicLayoutEffect = typeof document === "undefined" ? React11.useEffect : React11.useLayoutEffect;
|
|
1163
1229
|
function TextArea({
|
|
1164
1230
|
label,
|
|
@@ -1204,7 +1270,7 @@ function TextArea({
|
|
|
1204
1270
|
grow();
|
|
1205
1271
|
}, [autoGrow, grow, rest.value]);
|
|
1206
1272
|
warnHelpWithoutLabel("TextArea", label, help);
|
|
1207
|
-
return /* @__PURE__ */
|
|
1273
|
+
return /* @__PURE__ */ jsxs14(
|
|
1208
1274
|
TextField2,
|
|
1209
1275
|
{
|
|
1210
1276
|
className: cx("pire-field", className),
|
|
@@ -1213,8 +1279,8 @@ function TextArea({
|
|
|
1213
1279
|
validationBehavior: "aria",
|
|
1214
1280
|
...rest,
|
|
1215
1281
|
children: [
|
|
1216
|
-
label ? /* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1282
|
+
label ? /* @__PURE__ */ jsx22(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1283
|
+
/* @__PURE__ */ jsx22(
|
|
1218
1284
|
Group2,
|
|
1219
1285
|
{
|
|
1220
1286
|
className: "pire-control",
|
|
@@ -1223,7 +1289,7 @@ function TextArea({
|
|
|
1223
1289
|
"data-multiline": "true",
|
|
1224
1290
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1225
1291
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1226
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ jsx22(
|
|
1227
1293
|
AriaTextArea,
|
|
1228
1294
|
{
|
|
1229
1295
|
ref,
|
|
@@ -1235,8 +1301,8 @@ function TextArea({
|
|
|
1235
1301
|
)
|
|
1236
1302
|
}
|
|
1237
1303
|
),
|
|
1238
|
-
/* @__PURE__ */
|
|
1239
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ jsx22(FieldDescription, { description, help }),
|
|
1305
|
+
/* @__PURE__ */ jsx22(FieldError2, { className: "pire-field-error", children: errorMessage })
|
|
1240
1306
|
]
|
|
1241
1307
|
}
|
|
1242
1308
|
);
|
|
@@ -1253,7 +1319,7 @@ import {
|
|
|
1253
1319
|
ListBoxItem,
|
|
1254
1320
|
FieldError as FieldError3
|
|
1255
1321
|
} from "react-aria-components";
|
|
1256
|
-
import { jsx as
|
|
1322
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1257
1323
|
var CLEAR_KEY = "__pire-select-clear__";
|
|
1258
1324
|
var norm = (o) => typeof o === "string" ? { value: o, label: o, isDisabled: false } : o;
|
|
1259
1325
|
function Select({
|
|
@@ -1296,7 +1362,7 @@ function Select({
|
|
|
1296
1362
|
...items
|
|
1297
1363
|
] : items;
|
|
1298
1364
|
warnHelpWithoutLabel("Select", label, help);
|
|
1299
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsxs15(
|
|
1300
1366
|
AriaSelect,
|
|
1301
1367
|
{
|
|
1302
1368
|
className: cx("pire-field", className),
|
|
@@ -1314,8 +1380,8 @@ function Select({
|
|
|
1314
1380
|
validationBehavior: "aria",
|
|
1315
1381
|
...rest,
|
|
1316
1382
|
children: [
|
|
1317
|
-
label ? /* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1383
|
+
label ? /* @__PURE__ */ jsx23(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1384
|
+
/* @__PURE__ */ jsxs15(
|
|
1319
1385
|
AriaButton5,
|
|
1320
1386
|
{
|
|
1321
1387
|
className: "pire-control",
|
|
@@ -1323,20 +1389,20 @@ function Select({
|
|
|
1323
1389
|
"data-full-width": String(fullWidth),
|
|
1324
1390
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1325
1391
|
children: [
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ jsx23(SelectValue, { className: "pire-select-value" }),
|
|
1393
|
+
/* @__PURE__ */ jsx23(Icon, { name: "chevron-down", size: 16, className: "pire-leading-icon" })
|
|
1328
1394
|
]
|
|
1329
1395
|
}
|
|
1330
1396
|
),
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1397
|
+
/* @__PURE__ */ jsx23(FieldDescription, { description, help }),
|
|
1398
|
+
/* @__PURE__ */ jsx23(FieldError3, { className: "pire-field-error", children: errorMessage }),
|
|
1399
|
+
/* @__PURE__ */ jsx23(Popover, { className: "pire-popover", children: /* @__PURE__ */ jsx23(
|
|
1334
1400
|
ListBox,
|
|
1335
1401
|
{
|
|
1336
1402
|
className: "pire-listbox",
|
|
1337
1403
|
items: rows,
|
|
1338
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
1339
|
-
children: (item) => /* @__PURE__ */
|
|
1404
|
+
renderEmptyState: () => /* @__PURE__ */ jsx23("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: emptyLabel ?? msg.selectEmpty }),
|
|
1405
|
+
children: (item) => /* @__PURE__ */ jsx23(
|
|
1340
1406
|
ListBoxItem,
|
|
1341
1407
|
{
|
|
1342
1408
|
className: "pire-option",
|
|
@@ -1356,13 +1422,13 @@ function Select({
|
|
|
1356
1422
|
|
|
1357
1423
|
// src/components/forms/Checkbox.tsx
|
|
1358
1424
|
import { Checkbox as AriaCheckbox } from "react-aria-components";
|
|
1359
|
-
import { Fragment, jsx as
|
|
1425
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1360
1426
|
function Checkbox({ label, hint, children, className, ...rest }) {
|
|
1361
|
-
return /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ jsx24(AriaCheckbox, { className: cx("pire-choice", className), ...rest, children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
1428
|
+
/* @__PURE__ */ jsx24("span", { className: "pire-choice-box", "aria-hidden": "true", children: isIndeterminate ? /* @__PURE__ */ jsx24(Icon, { name: "minus", size: 12 }) : isSelected ? /* @__PURE__ */ jsx24(Icon, { name: "check", size: 12 }) : null }),
|
|
1429
|
+
/* @__PURE__ */ jsxs16("span", { children: [
|
|
1364
1430
|
label ?? children,
|
|
1365
|
-
hint ? /* @__PURE__ */
|
|
1431
|
+
hint ? /* @__PURE__ */ jsx24("span", { className: "pire-choice-hint", children: hint }) : null
|
|
1366
1432
|
] })
|
|
1367
1433
|
] }) });
|
|
1368
1434
|
}
|
|
@@ -1375,7 +1441,7 @@ import {
|
|
|
1375
1441
|
Text as Text4,
|
|
1376
1442
|
FieldError as FieldError4
|
|
1377
1443
|
} from "react-aria-components";
|
|
1378
|
-
import { jsx as
|
|
1444
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1379
1445
|
function RadioGroup({
|
|
1380
1446
|
label,
|
|
1381
1447
|
description,
|
|
@@ -1384,36 +1450,36 @@ function RadioGroup({
|
|
|
1384
1450
|
className,
|
|
1385
1451
|
...rest
|
|
1386
1452
|
}) {
|
|
1387
|
-
return /* @__PURE__ */
|
|
1388
|
-
label ? /* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
description ? /* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsxs17(AriaRadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
1454
|
+
label ? /* @__PURE__ */ jsx25(Label2, { className: "pire-field-label", children: label }) : null,
|
|
1455
|
+
/* @__PURE__ */ jsx25("div", { className: "pire-radiogroup", children }),
|
|
1456
|
+
description ? /* @__PURE__ */ jsx25(Text4, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1457
|
+
/* @__PURE__ */ jsx25(FieldError4, { className: "pire-field-error", children: errorMessage })
|
|
1392
1458
|
] });
|
|
1393
1459
|
}
|
|
1394
1460
|
function Radio({ label, hint, children, className, ...rest }) {
|
|
1395
|
-
return /* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsxs17(AriaRadio, { className: cx("pire-choice", className), ...rest, children: [
|
|
1462
|
+
/* @__PURE__ */ jsx25("span", { className: "pire-choice-box", "data-radio": "true", "aria-hidden": "true" }),
|
|
1463
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
1398
1464
|
label ?? children,
|
|
1399
|
-
hint ? /* @__PURE__ */
|
|
1465
|
+
hint ? /* @__PURE__ */ jsx25("span", { className: "pire-choice-hint", children: hint }) : null
|
|
1400
1466
|
] })
|
|
1401
1467
|
] });
|
|
1402
1468
|
}
|
|
1403
1469
|
|
|
1404
1470
|
// src/components/forms/Switch.tsx
|
|
1405
1471
|
import { Switch as AriaSwitch } from "react-aria-components";
|
|
1406
|
-
import { jsx as
|
|
1472
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1407
1473
|
function Switch({ label, children, className, ...rest }) {
|
|
1408
|
-
return /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ jsxs18(AriaSwitch, { className: cx("pire-choice", className), ...rest, children: [
|
|
1475
|
+
/* @__PURE__ */ jsx26("span", { className: "pire-switch-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx26("span", { className: "pire-switch-thumb" }) }),
|
|
1476
|
+
/* @__PURE__ */ jsx26("span", { children: label ?? children })
|
|
1411
1477
|
] });
|
|
1412
1478
|
}
|
|
1413
1479
|
|
|
1414
1480
|
// src/components/forms/ChoiceCardGroup.tsx
|
|
1415
1481
|
import { RadioGroup as AriaRadioGroup2, Radio as AriaRadio2, FieldError as FieldError5 } from "react-aria-components";
|
|
1416
|
-
import { jsx as
|
|
1482
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1417
1483
|
function ChoiceCardGroup({
|
|
1418
1484
|
label,
|
|
1419
1485
|
description,
|
|
@@ -1431,7 +1497,7 @@ function ChoiceCardGroup({
|
|
|
1431
1497
|
...rest
|
|
1432
1498
|
}) {
|
|
1433
1499
|
warnHelpWithoutLabel("ChoiceCardGroup", label, help);
|
|
1434
|
-
return /* @__PURE__ */
|
|
1500
|
+
return /* @__PURE__ */ jsxs19(
|
|
1435
1501
|
AriaRadioGroup2,
|
|
1436
1502
|
{
|
|
1437
1503
|
className: cx("pire-field", className),
|
|
@@ -1444,24 +1510,24 @@ function ChoiceCardGroup({
|
|
|
1444
1510
|
isDisabled,
|
|
1445
1511
|
isRequired,
|
|
1446
1512
|
children: [
|
|
1447
|
-
label ? /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1513
|
+
label ? /* @__PURE__ */ jsx27(FieldLabel, { label, isRequired, help }) : null,
|
|
1514
|
+
/* @__PURE__ */ jsx27("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs19(
|
|
1449
1515
|
AriaRadio2,
|
|
1450
1516
|
{
|
|
1451
1517
|
value: option.id,
|
|
1452
1518
|
className: "pire-choicecard",
|
|
1453
1519
|
isDisabled: option.isDisabled,
|
|
1454
1520
|
children: [
|
|
1455
|
-
option.icon ? /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
option.description ? /* @__PURE__ */
|
|
1458
|
-
option.preview ? /* @__PURE__ */
|
|
1521
|
+
option.icon ? /* @__PURE__ */ jsx27(Icon, { name: option.icon, size: 20 }) : null,
|
|
1522
|
+
/* @__PURE__ */ jsx27("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1523
|
+
option.description ? /* @__PURE__ */ jsx27("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1524
|
+
option.preview ? /* @__PURE__ */ jsx27("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1459
1525
|
]
|
|
1460
1526
|
},
|
|
1461
1527
|
option.id
|
|
1462
1528
|
)) }),
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ jsx27(FieldDescription, { description, help }),
|
|
1530
|
+
/* @__PURE__ */ jsx27(FieldError5, { className: "pire-field-error", children: errorMessage })
|
|
1465
1531
|
]
|
|
1466
1532
|
}
|
|
1467
1533
|
);
|
|
@@ -1479,7 +1545,7 @@ import {
|
|
|
1479
1545
|
ListBoxItem as ListBoxItem2,
|
|
1480
1546
|
FieldError as FieldError6
|
|
1481
1547
|
} from "react-aria-components";
|
|
1482
|
-
import { jsx as
|
|
1548
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1483
1549
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1484
1550
|
function ComboBox({
|
|
1485
1551
|
label,
|
|
@@ -1527,7 +1593,7 @@ function ComboBox({
|
|
|
1527
1593
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1528
1594
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1529
1595
|
warnHelpWithoutLabel("ComboBox", label, help);
|
|
1530
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ jsxs20(
|
|
1531
1597
|
AriaComboBox,
|
|
1532
1598
|
{
|
|
1533
1599
|
className: cx("pire-field", className),
|
|
@@ -1548,8 +1614,8 @@ function ComboBox({
|
|
|
1548
1614
|
validationBehavior: "aria",
|
|
1549
1615
|
...rest,
|
|
1550
1616
|
children: [
|
|
1551
|
-
label ? /* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1617
|
+
label ? /* @__PURE__ */ jsx28(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1618
|
+
/* @__PURE__ */ jsxs20(
|
|
1553
1619
|
Group3,
|
|
1554
1620
|
{
|
|
1555
1621
|
className: "pire-control",
|
|
@@ -1557,9 +1623,9 @@ function ComboBox({
|
|
|
1557
1623
|
"data-full-width": String(fullWidth),
|
|
1558
1624
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1559
1625
|
children: [
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
showsClear ? /* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsx28(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1627
|
+
/* @__PURE__ */ jsx28(AriaInput2, { className: "pire-input", placeholder: rest.placeholder }),
|
|
1628
|
+
showsClear ? /* @__PURE__ */ jsx28(
|
|
1563
1629
|
AriaButton6,
|
|
1564
1630
|
{
|
|
1565
1631
|
className: "pire-input-clear",
|
|
@@ -1571,22 +1637,22 @@ function ComboBox({
|
|
|
1571
1637
|
children: clearLabel ?? msg.inputClear
|
|
1572
1638
|
}
|
|
1573
1639
|
) : null,
|
|
1574
|
-
/* @__PURE__ */
|
|
1640
|
+
/* @__PURE__ */ jsx28(
|
|
1575
1641
|
AriaButton6,
|
|
1576
1642
|
{
|
|
1577
1643
|
className: "pire-iconbtn",
|
|
1578
1644
|
"data-size": "sm",
|
|
1579
1645
|
"aria-label": msg.comboBoxShowSuggestions,
|
|
1580
1646
|
style: { width: 20, height: 20 },
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1647
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-down", size: 16 })
|
|
1582
1648
|
}
|
|
1583
1649
|
)
|
|
1584
1650
|
]
|
|
1585
1651
|
}
|
|
1586
1652
|
),
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ jsx28(FieldDescription, { description, help }),
|
|
1654
|
+
/* @__PURE__ */ jsx28(FieldError6, { className: "pire-field-error", children: errorMessage }),
|
|
1655
|
+
/* @__PURE__ */ jsx28(Popover2, { className: "pire-popover", children: /* @__PURE__ */ jsx28(
|
|
1590
1656
|
ListBox2,
|
|
1591
1657
|
{
|
|
1592
1658
|
className: "pire-listbox",
|
|
@@ -1594,8 +1660,8 @@ function ComboBox({
|
|
|
1594
1660
|
const el = e.currentTarget;
|
|
1595
1661
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1596
1662
|
} : void 0,
|
|
1597
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1598
|
-
children: (item) => /* @__PURE__ */
|
|
1663
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx28("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1664
|
+
children: (item) => /* @__PURE__ */ jsxs20(
|
|
1599
1665
|
ListBoxItem2,
|
|
1600
1666
|
{
|
|
1601
1667
|
className: "pire-option",
|
|
@@ -1603,8 +1669,8 @@ function ComboBox({
|
|
|
1603
1669
|
textValue: item.label,
|
|
1604
1670
|
isDisabled: item.isDisabled,
|
|
1605
1671
|
children: [
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
item.secondary ? /* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ jsx28("span", { className: "pire-option-label", children: item.label }),
|
|
1673
|
+
item.secondary ? /* @__PURE__ */ jsx28("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1608
1674
|
]
|
|
1609
1675
|
}
|
|
1610
1676
|
)
|
|
@@ -1629,7 +1695,7 @@ import {
|
|
|
1629
1695
|
FieldError as FieldError7,
|
|
1630
1696
|
VisuallyHidden
|
|
1631
1697
|
} from "react-aria-components";
|
|
1632
|
-
import { jsx as
|
|
1698
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1633
1699
|
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1634
1700
|
function MultiComboBox({
|
|
1635
1701
|
label,
|
|
@@ -1696,7 +1762,7 @@ function MultiComboBox({
|
|
|
1696
1762
|
if (!values.includes(next)) commit([...values, next]);
|
|
1697
1763
|
};
|
|
1698
1764
|
warnHelpWithoutLabel("MultiComboBox", label, help);
|
|
1699
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ jsxs21(
|
|
1700
1766
|
AriaComboBox2,
|
|
1701
1767
|
{
|
|
1702
1768
|
className: cx("pire-field", className),
|
|
@@ -1713,8 +1779,8 @@ function MultiComboBox({
|
|
|
1713
1779
|
validationBehavior: "aria",
|
|
1714
1780
|
...rest,
|
|
1715
1781
|
children: [
|
|
1716
|
-
label ? /* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */
|
|
1782
|
+
label ? /* @__PURE__ */ jsx29(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
1783
|
+
/* @__PURE__ */ jsxs21(
|
|
1718
1784
|
Group4,
|
|
1719
1785
|
{
|
|
1720
1786
|
className: "pire-control",
|
|
@@ -1724,14 +1790,14 @@ function MultiComboBox({
|
|
|
1724
1790
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1725
1791
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1726
1792
|
children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1793
|
+
/* @__PURE__ */ jsx29(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1794
|
+
/* @__PURE__ */ jsxs21("div", { className: "pire-chipfield", children: [
|
|
1795
|
+
/* @__PURE__ */ jsx29(ButtonContext3.Provider, { value: null, children: values.map((v) => (
|
|
1730
1796
|
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
1731
1797
|
real, current values and should read as such — they simply lose the × . */
|
|
1732
|
-
/* @__PURE__ */
|
|
1798
|
+
/* @__PURE__ */ jsx29(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
1733
1799
|
)) }),
|
|
1734
|
-
/* @__PURE__ */
|
|
1800
|
+
/* @__PURE__ */ jsx29(
|
|
1735
1801
|
AriaInput3,
|
|
1736
1802
|
{
|
|
1737
1803
|
ref: inputRef,
|
|
@@ -1741,23 +1807,23 @@ function MultiComboBox({
|
|
|
1741
1807
|
}
|
|
1742
1808
|
)
|
|
1743
1809
|
] }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ jsx29(
|
|
1745
1811
|
AriaButton7,
|
|
1746
1812
|
{
|
|
1747
1813
|
className: "pire-iconbtn",
|
|
1748
1814
|
"data-size": "sm",
|
|
1749
1815
|
"aria-label": msg.comboBoxShowSuggestions,
|
|
1750
1816
|
style: { width: 20, height: 20 },
|
|
1751
|
-
children: /* @__PURE__ */
|
|
1817
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "chevron-down", size: 16 })
|
|
1752
1818
|
}
|
|
1753
1819
|
)
|
|
1754
1820
|
]
|
|
1755
1821
|
}
|
|
1756
1822
|
),
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1823
|
+
/* @__PURE__ */ jsx29(VisuallyHidden, { children: /* @__PURE__ */ jsx29("span", { "aria-live": "polite", children: announcement }) }),
|
|
1824
|
+
/* @__PURE__ */ jsx29(FieldDescription, { description, help }),
|
|
1825
|
+
/* @__PURE__ */ jsx29(FieldError7, { className: "pire-field-error", children: errorMessage }),
|
|
1826
|
+
/* @__PURE__ */ jsx29(Popover3, { className: "pire-popover", children: /* @__PURE__ */ jsx29(
|
|
1761
1827
|
ListBox3,
|
|
1762
1828
|
{
|
|
1763
1829
|
className: "pire-listbox",
|
|
@@ -1765,8 +1831,8 @@ function MultiComboBox({
|
|
|
1765
1831
|
const el = e.currentTarget;
|
|
1766
1832
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1767
1833
|
} : void 0,
|
|
1768
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1769
|
-
children: (item) => /* @__PURE__ */
|
|
1834
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx29("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1835
|
+
children: (item) => /* @__PURE__ */ jsxs21(
|
|
1770
1836
|
ListBoxItem3,
|
|
1771
1837
|
{
|
|
1772
1838
|
className: "pire-option",
|
|
@@ -1774,8 +1840,8 @@ function MultiComboBox({
|
|
|
1774
1840
|
textValue: item.label,
|
|
1775
1841
|
isDisabled: item.isDisabled,
|
|
1776
1842
|
children: [
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
item.secondary ? /* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx29("span", { className: "pire-option-label", children: item.label }),
|
|
1844
|
+
item.secondary ? /* @__PURE__ */ jsx29("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1779
1845
|
]
|
|
1780
1846
|
}
|
|
1781
1847
|
)
|
|
@@ -1804,7 +1870,7 @@ function decimalSeparatorFor(locale) {
|
|
|
1804
1870
|
}
|
|
1805
1871
|
|
|
1806
1872
|
// src/components/forms/NumberField.tsx
|
|
1807
|
-
import { jsx as
|
|
1873
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1808
1874
|
function typeIntoInput(el, text) {
|
|
1809
1875
|
const start = el.selectionStart ?? el.value.length;
|
|
1810
1876
|
const end = el.selectionEnd ?? start;
|
|
@@ -1839,7 +1905,7 @@ function ClearButton({ label, onClear }) {
|
|
|
1839
1905
|
if (!state?.inputValue) {
|
|
1840
1906
|
return null;
|
|
1841
1907
|
}
|
|
1842
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ jsx30(
|
|
1843
1909
|
AriaButton8,
|
|
1844
1910
|
{
|
|
1845
1911
|
className: "pire-input-clear",
|
|
@@ -1928,7 +1994,7 @@ function NumberField({
|
|
|
1928
1994
|
typeIntoInput(event.currentTarget, localised);
|
|
1929
1995
|
};
|
|
1930
1996
|
warnHelpWithoutLabel("NumberField", label, help);
|
|
1931
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ jsxs22(
|
|
1932
1998
|
AriaNumberField,
|
|
1933
1999
|
{
|
|
1934
2000
|
className: cx("pire-field", className),
|
|
@@ -1938,8 +2004,8 @@ function NumberField({
|
|
|
1938
2004
|
...rest,
|
|
1939
2005
|
...valueProps,
|
|
1940
2006
|
children: [
|
|
1941
|
-
label ? /* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
2007
|
+
label ? /* @__PURE__ */ jsx30(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
2008
|
+
/* @__PURE__ */ jsxs22(
|
|
1943
2009
|
Group5,
|
|
1944
2010
|
{
|
|
1945
2011
|
className: "pire-control",
|
|
@@ -1949,16 +2015,16 @@ function NumberField({
|
|
|
1949
2015
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1950
2016
|
"data-stepper": stepperLayout,
|
|
1951
2017
|
children: [
|
|
1952
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */
|
|
2018
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx30(
|
|
1953
2019
|
AriaButton8,
|
|
1954
2020
|
{
|
|
1955
2021
|
slot: "decrement",
|
|
1956
2022
|
className: "pire-qty-btn",
|
|
1957
2023
|
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1958
|
-
children: /* @__PURE__ */
|
|
2024
|
+
children: /* @__PURE__ */ jsx30(Icon, { name: "minus", size: 16 })
|
|
1959
2025
|
}
|
|
1960
2026
|
) : null,
|
|
1961
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ jsx30(
|
|
1962
2028
|
AriaInput4,
|
|
1963
2029
|
{
|
|
1964
2030
|
className: "pire-input",
|
|
@@ -1967,52 +2033,52 @@ function NumberField({
|
|
|
1967
2033
|
onPasteCapture: handlePaste
|
|
1968
2034
|
}
|
|
1969
2035
|
),
|
|
1970
|
-
suffix ? /* @__PURE__ */
|
|
1971
|
-
showsClear ? /* @__PURE__ */
|
|
1972
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */
|
|
2036
|
+
suffix ? /* @__PURE__ */ jsx30("span", { className: "pire-affix", children: suffix }) : null,
|
|
2037
|
+
showsClear ? /* @__PURE__ */ jsx30(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
2038
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx30(
|
|
1973
2039
|
AriaButton8,
|
|
1974
2040
|
{
|
|
1975
2041
|
slot: "increment",
|
|
1976
2042
|
className: "pire-qty-btn",
|
|
1977
2043
|
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1978
|
-
children: /* @__PURE__ */
|
|
2044
|
+
children: /* @__PURE__ */ jsx30(Icon, { name: "plus", size: 16 })
|
|
1979
2045
|
}
|
|
1980
2046
|
) : null,
|
|
1981
|
-
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
2047
|
+
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ jsxs22("span", { className: "pire-stepper", children: [
|
|
2048
|
+
/* @__PURE__ */ jsx30(
|
|
1983
2049
|
AriaButton8,
|
|
1984
2050
|
{
|
|
1985
2051
|
slot: "increment",
|
|
1986
2052
|
className: "pire-stepper-btn",
|
|
1987
2053
|
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1988
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ jsx30(Icon, { name: "plus", size: 10 })
|
|
1989
2055
|
}
|
|
1990
2056
|
),
|
|
1991
|
-
/* @__PURE__ */
|
|
2057
|
+
/* @__PURE__ */ jsx30(
|
|
1992
2058
|
AriaButton8,
|
|
1993
2059
|
{
|
|
1994
2060
|
slot: "decrement",
|
|
1995
2061
|
className: "pire-stepper-btn",
|
|
1996
2062
|
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1997
|
-
children: /* @__PURE__ */
|
|
2063
|
+
children: /* @__PURE__ */ jsx30(Icon, { name: "minus", size: 10 })
|
|
1998
2064
|
}
|
|
1999
2065
|
)
|
|
2000
2066
|
] })
|
|
2001
2067
|
]
|
|
2002
2068
|
}
|
|
2003
2069
|
),
|
|
2004
|
-
/* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsx30(FieldDescription, { description, help }),
|
|
2071
|
+
/* @__PURE__ */ jsx30(FieldError8, { className: "pire-field-error", children: errorMessage })
|
|
2006
2072
|
]
|
|
2007
2073
|
}
|
|
2008
2074
|
);
|
|
2009
2075
|
}
|
|
2010
2076
|
|
|
2011
2077
|
// src/components/forms/QuantityStepper.tsx
|
|
2012
|
-
import { jsx as
|
|
2078
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2013
2079
|
function QuantityStepper({ size = "md", ...rest }) {
|
|
2014
2080
|
const msg = usePireMessages();
|
|
2015
|
-
return /* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ jsx31(
|
|
2016
2082
|
NumberField,
|
|
2017
2083
|
{
|
|
2018
2084
|
...rest,
|
|
@@ -2074,13 +2140,13 @@ function coerceBound(value) {
|
|
|
2074
2140
|
}
|
|
2075
2141
|
|
|
2076
2142
|
// src/components/forms/DatePicker.tsx
|
|
2077
|
-
import { jsx as
|
|
2143
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2078
2144
|
function ClearButton2({ label }) {
|
|
2079
2145
|
const state = React16.useContext(DatePickerStateContext);
|
|
2080
2146
|
if (!state?.value) {
|
|
2081
2147
|
return null;
|
|
2082
2148
|
}
|
|
2083
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx32(
|
|
2084
2150
|
AriaButton9,
|
|
2085
2151
|
{
|
|
2086
2152
|
className: "pire-input-clear",
|
|
@@ -2118,7 +2184,7 @@ function DatePicker({
|
|
|
2118
2184
|
valueFormat === "iso" && next ? next.toString() : next
|
|
2119
2185
|
);
|
|
2120
2186
|
warnHelpWithoutLabel("DatePicker", label, help);
|
|
2121
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsxs23(
|
|
2122
2188
|
AriaDatePicker,
|
|
2123
2189
|
{
|
|
2124
2190
|
className: cx("pire-field", className),
|
|
@@ -2131,8 +2197,8 @@ function DatePicker({
|
|
|
2131
2197
|
onChange: handleChange,
|
|
2132
2198
|
...rest,
|
|
2133
2199
|
children: [
|
|
2134
|
-
label ? /* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2200
|
+
label ? /* @__PURE__ */ jsx32(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
2201
|
+
/* @__PURE__ */ jsxs23(
|
|
2136
2202
|
Group6,
|
|
2137
2203
|
{
|
|
2138
2204
|
className: "pire-control",
|
|
@@ -2141,50 +2207,50 @@ function DatePicker({
|
|
|
2141
2207
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
2142
2208
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
2143
2209
|
children: [
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
showsClear ? /* @__PURE__ */
|
|
2146
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsx32(DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx32(DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
2211
|
+
showsClear ? /* @__PURE__ */ jsx32(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2212
|
+
/* @__PURE__ */ jsx32(
|
|
2147
2213
|
AriaButton9,
|
|
2148
2214
|
{
|
|
2149
2215
|
className: "pire-iconbtn",
|
|
2150
2216
|
"data-size": "sm",
|
|
2151
2217
|
"aria-label": msg.datePickerOpenCalendar,
|
|
2152
2218
|
style: { width: 24, height: 24 },
|
|
2153
|
-
children: /* @__PURE__ */
|
|
2219
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "calendar", size: 16 })
|
|
2154
2220
|
}
|
|
2155
2221
|
)
|
|
2156
2222
|
]
|
|
2157
2223
|
}
|
|
2158
2224
|
),
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */
|
|
2163
|
-
/* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ jsx32(FieldDescription, { description, help }),
|
|
2226
|
+
/* @__PURE__ */ jsx32(FieldError9, { className: "pire-field-error", children: errorMessage }),
|
|
2227
|
+
/* @__PURE__ */ jsx32(Popover4, { className: "pire-popover", children: /* @__PURE__ */ jsx32(AriaDialog, { children: /* @__PURE__ */ jsxs23(Calendar, { className: "pire-calendar", children: [
|
|
2228
|
+
/* @__PURE__ */ jsxs23("header", { className: "pire-calendar-head", children: [
|
|
2229
|
+
/* @__PURE__ */ jsx32(
|
|
2164
2230
|
AriaButton9,
|
|
2165
2231
|
{
|
|
2166
2232
|
slot: "previous",
|
|
2167
2233
|
className: "pire-iconbtn",
|
|
2168
2234
|
"data-size": "sm",
|
|
2169
2235
|
"aria-label": msg.datePickerPreviousMonth,
|
|
2170
|
-
children: /* @__PURE__ */
|
|
2236
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "chevron-left", size: 16 })
|
|
2171
2237
|
}
|
|
2172
2238
|
),
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsx32(Heading2, { className: "pire-calendar-title" }),
|
|
2240
|
+
/* @__PURE__ */ jsx32(
|
|
2175
2241
|
AriaButton9,
|
|
2176
2242
|
{
|
|
2177
2243
|
slot: "next",
|
|
2178
2244
|
className: "pire-iconbtn",
|
|
2179
2245
|
"data-size": "sm",
|
|
2180
2246
|
"aria-label": msg.datePickerNextMonth,
|
|
2181
|
-
children: /* @__PURE__ */
|
|
2247
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: "chevron-right", size: 16 })
|
|
2182
2248
|
}
|
|
2183
2249
|
)
|
|
2184
2250
|
] }),
|
|
2185
|
-
/* @__PURE__ */
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsxs23(CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
2252
|
+
/* @__PURE__ */ jsx32(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx32(CalendarHeaderCell, { children: day }) }),
|
|
2253
|
+
/* @__PURE__ */ jsx32(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx32(CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
2188
2254
|
] })
|
|
2189
2255
|
] }) }) })
|
|
2190
2256
|
]
|
|
@@ -2212,7 +2278,7 @@ import {
|
|
|
2212
2278
|
FieldError as FieldError10,
|
|
2213
2279
|
DateRangePickerStateContext
|
|
2214
2280
|
} from "react-aria-components";
|
|
2215
|
-
import { jsx as
|
|
2281
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2216
2282
|
function coerceRange(range) {
|
|
2217
2283
|
if (range === void 0) {
|
|
2218
2284
|
return void 0;
|
|
@@ -2237,7 +2303,7 @@ function ClearButton3({ label }) {
|
|
|
2237
2303
|
if (!state?.value?.start && !state?.value?.end) {
|
|
2238
2304
|
return null;
|
|
2239
2305
|
}
|
|
2240
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ jsx33(
|
|
2241
2307
|
AriaButton10,
|
|
2242
2308
|
{
|
|
2243
2309
|
className: "pire-input-clear",
|
|
@@ -2290,7 +2356,7 @@ function DateRangePicker({
|
|
|
2290
2356
|
);
|
|
2291
2357
|
};
|
|
2292
2358
|
warnHelpWithoutLabel("DateRangePicker", label, help);
|
|
2293
|
-
return /* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ jsxs24(
|
|
2294
2360
|
AriaDateRangePicker,
|
|
2295
2361
|
{
|
|
2296
2362
|
className: cx("pire-field", className),
|
|
@@ -2306,8 +2372,8 @@ function DateRangePicker({
|
|
|
2306
2372
|
...rest,
|
|
2307
2373
|
isInvalid: rest.isInvalid || tooLong || void 0,
|
|
2308
2374
|
children: [
|
|
2309
|
-
label ? /* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2375
|
+
label ? /* @__PURE__ */ jsx33(FieldLabel, { label, isRequired: rest.isRequired, help }) : null,
|
|
2376
|
+
/* @__PURE__ */ jsxs24(
|
|
2311
2377
|
Group7,
|
|
2312
2378
|
{
|
|
2313
2379
|
className: "pire-control pire-daterange-control",
|
|
@@ -2316,30 +2382,30 @@ function DateRangePicker({
|
|
|
2316
2382
|
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
2317
2383
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
2318
2384
|
children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */
|
|
2322
|
-
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ jsx33(DateInput2, { slot: "start", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx33(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2386
|
+
/* @__PURE__ */ jsx33("span", { "aria-hidden": "true", className: "pire-daterange-dash", children: "\u2013" }),
|
|
2387
|
+
/* @__PURE__ */ jsx33(DateInput2, { slot: "end", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx33(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2388
|
+
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ jsx33(ClearButton3, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2389
|
+
/* @__PURE__ */ jsx33(
|
|
2324
2390
|
AriaButton10,
|
|
2325
2391
|
{
|
|
2326
2392
|
className: "pire-iconbtn",
|
|
2327
2393
|
"data-size": "sm",
|
|
2328
2394
|
"aria-label": msg.datePickerOpenCalendar,
|
|
2329
2395
|
style: { width: 24, height: 24 },
|
|
2330
|
-
children: /* @__PURE__ */
|
|
2396
|
+
children: /* @__PURE__ */ jsx33(Icon, { name: "calendar", size: 16 })
|
|
2331
2397
|
}
|
|
2332
2398
|
)
|
|
2333
2399
|
]
|
|
2334
2400
|
}
|
|
2335
2401
|
),
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ jsx33(FieldDescription, { description, help }),
|
|
2403
|
+
/* @__PURE__ */ jsx33(FieldError10, { className: "pire-field-error", children: errorMessage }),
|
|
2404
|
+
/* @__PURE__ */ jsx33(Popover5, { className: "pire-popover", children: /* @__PURE__ */ jsxs24(AriaDialog2, { className: "pire-daterange-dialog", children: [
|
|
2339
2405
|
presets?.length ? (
|
|
2340
2406
|
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
2341
2407
|
// arrowing through a month first.
|
|
2342
|
-
/* @__PURE__ */
|
|
2408
|
+
/* @__PURE__ */ jsx33("div", { className: "pire-daterange-presets", role: "group", "aria-label": msg.dateRangePresetsLabel, children: presets.map((preset) => /* @__PURE__ */ jsx33(
|
|
2343
2409
|
AriaButton10,
|
|
2344
2410
|
{
|
|
2345
2411
|
className: "pire-daterange-preset",
|
|
@@ -2349,33 +2415,33 @@ function DateRangePicker({
|
|
|
2349
2415
|
preset.id
|
|
2350
2416
|
)) })
|
|
2351
2417
|
) : null,
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsxs24(RangeCalendar, { className: "pire-calendar", children: [
|
|
2419
|
+
/* @__PURE__ */ jsxs24("header", { className: "pire-calendar-head", children: [
|
|
2420
|
+
/* @__PURE__ */ jsx33(
|
|
2355
2421
|
AriaButton10,
|
|
2356
2422
|
{
|
|
2357
2423
|
slot: "previous",
|
|
2358
2424
|
className: "pire-iconbtn",
|
|
2359
2425
|
"data-size": "sm",
|
|
2360
2426
|
"aria-label": msg.datePickerPreviousMonth,
|
|
2361
|
-
children: /* @__PURE__ */
|
|
2427
|
+
children: /* @__PURE__ */ jsx33(Icon, { name: "chevron-left", size: 16 })
|
|
2362
2428
|
}
|
|
2363
2429
|
),
|
|
2364
|
-
/* @__PURE__ */
|
|
2365
|
-
/* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ jsx33(Heading3, { className: "pire-calendar-title" }),
|
|
2431
|
+
/* @__PURE__ */ jsx33(
|
|
2366
2432
|
AriaButton10,
|
|
2367
2433
|
{
|
|
2368
2434
|
slot: "next",
|
|
2369
2435
|
className: "pire-iconbtn",
|
|
2370
2436
|
"data-size": "sm",
|
|
2371
2437
|
"aria-label": msg.datePickerNextMonth,
|
|
2372
|
-
children: /* @__PURE__ */
|
|
2438
|
+
children: /* @__PURE__ */ jsx33(Icon, { name: "chevron-right", size: 16 })
|
|
2373
2439
|
}
|
|
2374
2440
|
)
|
|
2375
2441
|
] }),
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsxs24(CalendarGrid2, { className: "pire-calendar-grid", children: [
|
|
2443
|
+
/* @__PURE__ */ jsx33(CalendarGridHeader2, { children: (day) => /* @__PURE__ */ jsx33(CalendarHeaderCell2, { children: day }) }),
|
|
2444
|
+
/* @__PURE__ */ jsx33(CalendarGridBody2, { children: (date) => /* @__PURE__ */ jsx33(CalendarCell2, { date, className: "pire-calendar-cell" }) })
|
|
2379
2445
|
] })
|
|
2380
2446
|
] })
|
|
2381
2447
|
] }) })
|
|
@@ -2393,18 +2459,18 @@ import * as React20 from "react";
|
|
|
2393
2459
|
// src/components/feedback/Dialog.tsx
|
|
2394
2460
|
import * as React18 from "react";
|
|
2395
2461
|
import { ModalOverlay, Modal, Dialog as AriaDialog3, Heading as Heading4 } from "react-aria-components";
|
|
2396
|
-
import { jsx as
|
|
2462
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2397
2463
|
function DialogTitle({ children, className }) {
|
|
2398
|
-
return /* @__PURE__ */
|
|
2464
|
+
return /* @__PURE__ */ jsx34(Heading4, { slot: "title", className: cx("pire-dialog-title", className), children });
|
|
2399
2465
|
}
|
|
2400
2466
|
function DialogDescription({ children, className }) {
|
|
2401
|
-
return /* @__PURE__ */
|
|
2467
|
+
return /* @__PURE__ */ jsx34("p", { className: cx("pire-dialog-sub", className), style: { margin: 0 }, children });
|
|
2402
2468
|
}
|
|
2403
2469
|
function DialogBody({ children, className }) {
|
|
2404
|
-
return /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ jsx34("div", { className: cx("pire-dialog-body", className), children });
|
|
2405
2471
|
}
|
|
2406
2472
|
function DialogActions({ children, className }) {
|
|
2407
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ jsx34("footer", { className: cx("pire-dialog-foot", className), children });
|
|
2408
2474
|
}
|
|
2409
2475
|
function Dialog({
|
|
2410
2476
|
isOpen,
|
|
@@ -2433,11 +2499,11 @@ function Dialog({
|
|
|
2433
2499
|
const actionsSlot = slotOf(DialogActions);
|
|
2434
2500
|
const slots = [titleSlot, descriptionSlot, bodySlot, actionsSlot];
|
|
2435
2501
|
const loose = parts.filter((node) => !slots.includes(node));
|
|
2436
|
-
const heading = titleSlot ?? (title ? /* @__PURE__ */
|
|
2437
|
-
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */
|
|
2438
|
-
const actions = actionsSlot ?? (footer ? /* @__PURE__ */
|
|
2439
|
-
const body = bodySlot ?? (loose.length ? /* @__PURE__ */
|
|
2440
|
-
return /* @__PURE__ */
|
|
2502
|
+
const heading = titleSlot ?? (title ? /* @__PURE__ */ jsx34(Heading4, { slot: "title", className: "pire-dialog-title", children: title }) : null);
|
|
2503
|
+
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ jsx34("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null);
|
|
2504
|
+
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ jsx34("footer", { className: "pire-dialog-foot", children: footer }) : null);
|
|
2505
|
+
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ jsx34("div", { className: "pire-dialog-body", children: loose }) : null);
|
|
2506
|
+
return /* @__PURE__ */ jsx34(
|
|
2441
2507
|
ModalOverlay,
|
|
2442
2508
|
{
|
|
2443
2509
|
className: "pire-modal-overlay",
|
|
@@ -2446,13 +2512,13 @@ function Dialog({
|
|
|
2446
2512
|
onOpenChange: (o) => {
|
|
2447
2513
|
if (!o) close();
|
|
2448
2514
|
},
|
|
2449
|
-
children: /* @__PURE__ */
|
|
2450
|
-
heading || description ? /* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ jsx34(Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ jsxs25(AriaDialog3, { className: "pire-dialog", children: [
|
|
2516
|
+
heading || description ? /* @__PURE__ */ jsxs25("header", { className: "pire-dialog-head", children: [
|
|
2517
|
+
/* @__PURE__ */ jsxs25("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2452
2518
|
heading,
|
|
2453
2519
|
description
|
|
2454
2520
|
] }),
|
|
2455
|
-
showClose ? /* @__PURE__ */
|
|
2521
|
+
showClose ? /* @__PURE__ */ jsx34(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
2456
2522
|
] }) : null,
|
|
2457
2523
|
body,
|
|
2458
2524
|
actions
|
|
@@ -2468,15 +2534,16 @@ import {
|
|
|
2468
2534
|
TableHeader,
|
|
2469
2535
|
TableBody,
|
|
2470
2536
|
TableFooter,
|
|
2537
|
+
TableStateContext,
|
|
2471
2538
|
Column,
|
|
2472
2539
|
Row,
|
|
2473
2540
|
Cell
|
|
2474
2541
|
} from "react-aria-components";
|
|
2475
2542
|
|
|
2476
2543
|
// src/components/feedback/Skeleton.tsx
|
|
2477
|
-
import { jsx as
|
|
2544
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2478
2545
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
2479
|
-
return /* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsx35(
|
|
2480
2547
|
"div",
|
|
2481
2548
|
{
|
|
2482
2549
|
className: cx("pire-skeleton", className),
|
|
@@ -2496,7 +2563,7 @@ function SkeletonTableRow({
|
|
|
2496
2563
|
...rest
|
|
2497
2564
|
}) {
|
|
2498
2565
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2499
|
-
return /* @__PURE__ */
|
|
2566
|
+
return /* @__PURE__ */ jsx35(
|
|
2500
2567
|
"div",
|
|
2501
2568
|
{
|
|
2502
2569
|
className: cx("pire-skeleton-row", className),
|
|
@@ -2506,13 +2573,13 @@ function SkeletonTableRow({
|
|
|
2506
2573
|
...rest,
|
|
2507
2574
|
children: cells.map((c, i) => {
|
|
2508
2575
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2509
|
-
return /* @__PURE__ */
|
|
2576
|
+
return /* @__PURE__ */ jsx35(
|
|
2510
2577
|
"div",
|
|
2511
2578
|
{
|
|
2512
2579
|
className: "pire-skeleton-cell",
|
|
2513
2580
|
"data-align": align,
|
|
2514
2581
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2515
|
-
children: /* @__PURE__ */
|
|
2582
|
+
children: /* @__PURE__ */ jsx35(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2516
2583
|
},
|
|
2517
2584
|
i
|
|
2518
2585
|
);
|
|
@@ -2522,7 +2589,7 @@ function SkeletonTableRow({
|
|
|
2522
2589
|
}
|
|
2523
2590
|
|
|
2524
2591
|
// src/components/data/DataTable.tsx
|
|
2525
|
-
import { jsx as
|
|
2592
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2526
2593
|
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
2527
2594
|
var warned3 = /* @__PURE__ */ new Set();
|
|
2528
2595
|
function warnOnce3(key, message) {
|
|
@@ -2531,6 +2598,93 @@ function warnOnce3(key, message) {
|
|
|
2531
2598
|
console.warn(`[pire] ${message}`);
|
|
2532
2599
|
}
|
|
2533
2600
|
var CHECKBOX_W = 44;
|
|
2601
|
+
var PENDING_KEY = "__pire_pending_row__";
|
|
2602
|
+
var FIELD_SELECTOR = [
|
|
2603
|
+
'input:not([type="hidden"]):not([disabled])',
|
|
2604
|
+
"textarea:not([disabled])",
|
|
2605
|
+
"select:not([disabled])",
|
|
2606
|
+
"button:not([disabled])",
|
|
2607
|
+
'[contenteditable="true"]',
|
|
2608
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
2609
|
+
].join(",");
|
|
2610
|
+
function EditCell({
|
|
2611
|
+
children,
|
|
2612
|
+
isFirst,
|
|
2613
|
+
focusToken,
|
|
2614
|
+
onCommit,
|
|
2615
|
+
onCancel
|
|
2616
|
+
}) {
|
|
2617
|
+
const state = React19.useContext(TableStateContext);
|
|
2618
|
+
const setNavDisabled = state?.setKeyboardNavigationDisabled;
|
|
2619
|
+
const ref = React19.useRef(null);
|
|
2620
|
+
const focusedWithin = React19.useRef(false);
|
|
2621
|
+
React19.useLayoutEffect(() => {
|
|
2622
|
+
if (!isFirst) return;
|
|
2623
|
+
const row = ref.current?.closest('[role="row"]');
|
|
2624
|
+
void focusToken;
|
|
2625
|
+
for (const cell of row?.querySelectorAll(".pire-td-edit") ?? []) {
|
|
2626
|
+
const field = cell.querySelector(FIELD_SELECTOR);
|
|
2627
|
+
if (field) {
|
|
2628
|
+
field.focus();
|
|
2629
|
+
break;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
}, [isFirst, focusToken]);
|
|
2633
|
+
React19.useLayoutEffect(() => {
|
|
2634
|
+
if (!isFirst) return;
|
|
2635
|
+
const row = ref.current?.closest('[role="row"]');
|
|
2636
|
+
return () => {
|
|
2637
|
+
requestAnimationFrame(() => {
|
|
2638
|
+
const active = document.activeElement;
|
|
2639
|
+
if (row?.isConnected && (!active || active === document.body || !active.isConnected)) row.focus();
|
|
2640
|
+
});
|
|
2641
|
+
};
|
|
2642
|
+
}, [isFirst]);
|
|
2643
|
+
React19.useEffect(
|
|
2644
|
+
() => () => {
|
|
2645
|
+
if (focusedWithin.current) setNavDisabled?.(false);
|
|
2646
|
+
},
|
|
2647
|
+
[setNavDisabled]
|
|
2648
|
+
);
|
|
2649
|
+
const stop = (e) => e.stopPropagation();
|
|
2650
|
+
return (
|
|
2651
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: not a control — it only intercepts events bubbling out of the fields inside it, so the grid does not act on them
|
|
2652
|
+
/* @__PURE__ */ jsx36(
|
|
2653
|
+
"div",
|
|
2654
|
+
{
|
|
2655
|
+
ref,
|
|
2656
|
+
className: "pire-td-edit",
|
|
2657
|
+
onFocus: (e) => {
|
|
2658
|
+
e.stopPropagation();
|
|
2659
|
+
focusedWithin.current = true;
|
|
2660
|
+
setNavDisabled?.(true);
|
|
2661
|
+
},
|
|
2662
|
+
onBlur: (e) => {
|
|
2663
|
+
const next = e.relatedTarget;
|
|
2664
|
+
const row = ref.current?.closest('[role="row"]');
|
|
2665
|
+
if (next && row?.contains(next) && next.closest(".pire-td-edit")) return;
|
|
2666
|
+
focusedWithin.current = false;
|
|
2667
|
+
setNavDisabled?.(false);
|
|
2668
|
+
},
|
|
2669
|
+
onKeyDown: (e) => {
|
|
2670
|
+
stop(e);
|
|
2671
|
+
if (e.nativeEvent.isComposing || e.defaultPrevented) return;
|
|
2672
|
+
if (e.key === "Enter" && !(e.target instanceof HTMLTextAreaElement)) {
|
|
2673
|
+
e.preventDefault();
|
|
2674
|
+
onCommit();
|
|
2675
|
+
} else if (e.key === "Escape") {
|
|
2676
|
+
e.preventDefault();
|
|
2677
|
+
onCancel();
|
|
2678
|
+
}
|
|
2679
|
+
},
|
|
2680
|
+
onPointerDown: stop,
|
|
2681
|
+
onMouseDown: stop,
|
|
2682
|
+
onClick: stop,
|
|
2683
|
+
children
|
|
2684
|
+
}
|
|
2685
|
+
)
|
|
2686
|
+
);
|
|
2687
|
+
}
|
|
2534
2688
|
function DataTable({
|
|
2535
2689
|
columns,
|
|
2536
2690
|
rows,
|
|
@@ -2551,11 +2705,17 @@ function DataTable({
|
|
|
2551
2705
|
rowProps,
|
|
2552
2706
|
renderExpanded,
|
|
2553
2707
|
expandedIds,
|
|
2708
|
+
editingRowId,
|
|
2709
|
+
pendingRow,
|
|
2710
|
+
onCommitRow,
|
|
2711
|
+
onCancelRow,
|
|
2554
2712
|
className,
|
|
2555
2713
|
style,
|
|
2556
2714
|
...rest
|
|
2557
2715
|
}) {
|
|
2558
2716
|
const msg = usePireMessages();
|
|
2717
|
+
const [pendingFocus, setPendingFocus] = React19.useState(0);
|
|
2718
|
+
const isEditing = (row) => editingRowId != null && String(row.id) === String(editingRowId);
|
|
2559
2719
|
const selectionMode = selectable === true || selectable === "multiple" ? "multiple" : selectable === "single" ? "single" : "none";
|
|
2560
2720
|
const hasCheckboxColumn = selectionMode === "multiple";
|
|
2561
2721
|
const pinnedGeometry = React19.useMemo(() => {
|
|
@@ -2593,7 +2753,8 @@ function DataTable({
|
|
|
2593
2753
|
const hasPinned = pinnedGeometry.size > 0;
|
|
2594
2754
|
const lastPinnedKey = hasPinned ? [...pinnedGeometry.keys()][pinnedGeometry.size - 1] : void 0;
|
|
2595
2755
|
const sortDescriptor = sort ? { column: sort.key, direction: sort.dir === "asc" ? "ascending" : "descending" } : void 0;
|
|
2596
|
-
const handleSelection = (
|
|
2756
|
+
const handleSelection = (selection) => {
|
|
2757
|
+
const keys = selection !== "all" && selection.has(PENDING_KEY) ? new Set([...selection].filter((key) => key !== PENDING_KEY)) : selection;
|
|
2597
2758
|
if (keys === "all") {
|
|
2598
2759
|
const inCollection = new Set(rows.map((r) => r.id));
|
|
2599
2760
|
return onSelectionChange?.([
|
|
@@ -2609,6 +2770,7 @@ function DataTable({
|
|
|
2609
2770
|
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
2610
2771
|
];
|
|
2611
2772
|
const body = isLoading ? [] : rows;
|
|
2773
|
+
const firstEditable = columns.find((c) => c.renderEdit);
|
|
2612
2774
|
const presentation = new Map(rows.map((row) => [row.id, rowProps?.(row) ?? {}]));
|
|
2613
2775
|
const disabledKeys = rows.filter((row) => presentation.get(row.id)?.isDisabled).map((row) => row.id);
|
|
2614
2776
|
const expanded = new Set((expandedIds ?? []).map(String));
|
|
@@ -2624,14 +2786,14 @@ function DataTable({
|
|
|
2624
2786
|
style: { left: box.left, width: box.width, minWidth: box.width, maxWidth: box.width }
|
|
2625
2787
|
};
|
|
2626
2788
|
};
|
|
2627
|
-
return /* @__PURE__ */
|
|
2789
|
+
return /* @__PURE__ */ jsx36(
|
|
2628
2790
|
"div",
|
|
2629
2791
|
{
|
|
2630
2792
|
className: cx("pire-table-wrap", className),
|
|
2631
2793
|
style,
|
|
2632
2794
|
"data-loading": isLoading ? "true" : void 0,
|
|
2633
2795
|
"aria-busy": isLoading ? "true" : void 0,
|
|
2634
|
-
children: /* @__PURE__ */
|
|
2796
|
+
children: /* @__PURE__ */ jsxs26(
|
|
2635
2797
|
Table,
|
|
2636
2798
|
{
|
|
2637
2799
|
className: "pire-table",
|
|
@@ -2647,11 +2809,11 @@ function DataTable({
|
|
|
2647
2809
|
onSortChange: (d) => onSortChange?.({ key: String(d.column), dir: d.direction === "ascending" ? "asc" : "desc" }),
|
|
2648
2810
|
onRowAction: onRowAction ? (key) => {
|
|
2649
2811
|
const row = rows.find((r) => String(r.id) === String(key));
|
|
2650
|
-
if (row) onRowAction(row);
|
|
2812
|
+
if (row && !isEditing(row)) onRowAction(row);
|
|
2651
2813
|
} : void 0,
|
|
2652
2814
|
children: [
|
|
2653
|
-
/* @__PURE__ */
|
|
2654
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ jsxs26(TableHeader, { className: "pire-thead-row", children: [
|
|
2816
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx36(Column, { className: "pire-th", ...pinProps(null), children: hideSelectAll ? /* @__PURE__ */ jsx36("span", { className: "pire-sr-only", children: msg.dataTableSelectionColumn }) : /* @__PURE__ */ jsx36(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
2655
2817
|
columns.map((c, i) => (
|
|
2656
2818
|
// The checkbox column is never the row header — a selection control does not identify
|
|
2657
2819
|
// the record — so the first *data* column carries it regardless of whether a checkbox
|
|
@@ -2659,7 +2821,7 @@ function DataTable({
|
|
|
2659
2821
|
// table with no row header at all: invisible on first paint, and a hard crash from
|
|
2660
2822
|
// React Aria's own "table must have a row header" invariant the moment `rows` changes
|
|
2661
2823
|
// under it (search, sort, a paginated load).
|
|
2662
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ jsx36(
|
|
2663
2825
|
Column,
|
|
2664
2826
|
{
|
|
2665
2827
|
id: c.key,
|
|
@@ -2669,9 +2831,9 @@ function DataTable({
|
|
|
2669
2831
|
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
2670
2832
|
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
2671
2833
|
...pinProps(c.key),
|
|
2672
|
-
children: /* @__PURE__ */
|
|
2834
|
+
children: /* @__PURE__ */ jsxs26("span", { className: c.hideLabel ? "pire-sr-only" : "pire-th-inner", children: [
|
|
2673
2835
|
c.label,
|
|
2674
|
-
c.sortable ? /* @__PURE__ */
|
|
2836
|
+
c.sortable ? /* @__PURE__ */ jsx36(
|
|
2675
2837
|
Icon,
|
|
2676
2838
|
{
|
|
2677
2839
|
size: 12,
|
|
@@ -2687,65 +2849,117 @@ function DataTable({
|
|
|
2687
2849
|
)
|
|
2688
2850
|
))
|
|
2689
2851
|
] }),
|
|
2690
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsxs26(
|
|
2691
2853
|
TableBody,
|
|
2692
2854
|
{
|
|
2693
|
-
renderEmptyState: () => isLoading ? /* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2855
|
+
renderEmptyState: () => isLoading ? /* @__PURE__ */ jsxs26("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2856
|
+
/* @__PURE__ */ jsx36("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2695
2857
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2696
2858
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2697
|
-
/* @__PURE__ */
|
|
2859
|
+
/* @__PURE__ */ jsx36(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2698
2860
|
))
|
|
2699
|
-
] }) : /* @__PURE__ */
|
|
2700
|
-
children:
|
|
2701
|
-
|
|
2702
|
-
const record = /* @__PURE__ */ jsxs25(
|
|
2861
|
+
] }) : /* @__PURE__ */ jsx36("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }),
|
|
2862
|
+
children: [
|
|
2863
|
+
pendingRow && !isLoading ? /* @__PURE__ */ jsxs26(
|
|
2703
2864
|
Row,
|
|
2704
2865
|
{
|
|
2705
|
-
id:
|
|
2706
|
-
className:
|
|
2707
|
-
"data-
|
|
2866
|
+
id: PENDING_KEY,
|
|
2867
|
+
className: "pire-tr",
|
|
2868
|
+
"data-editing": "true",
|
|
2869
|
+
"data-pending": "true",
|
|
2708
2870
|
children: [
|
|
2709
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2871
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx36(Cell, { className: "pire-td", ...pinProps(null) }) : null,
|
|
2710
2872
|
columns.map((c) => {
|
|
2711
2873
|
const pin = pinProps(c.key);
|
|
2712
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ jsx36(
|
|
2713
2875
|
Cell,
|
|
2714
2876
|
{
|
|
2715
2877
|
className: "pire-td",
|
|
2716
2878
|
"data-numeric": c.numeric ? "true" : void 0,
|
|
2717
|
-
"data-tone": c.tone?.(row) ?? void 0,
|
|
2718
2879
|
...pin,
|
|
2719
2880
|
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2720
|
-
children: c.
|
|
2881
|
+
children: c.renderEdit ? /* @__PURE__ */ jsx36(
|
|
2882
|
+
EditCell,
|
|
2883
|
+
{
|
|
2884
|
+
isFirst: c === firstEditable,
|
|
2885
|
+
focusToken: pendingFocus,
|
|
2886
|
+
onCommit: () => {
|
|
2887
|
+
onCommitRow?.(null);
|
|
2888
|
+
setPendingFocus((n) => n + 1);
|
|
2889
|
+
},
|
|
2890
|
+
onCancel: () => onCancelRow?.(null),
|
|
2891
|
+
children: c.renderEdit(pendingRow)
|
|
2892
|
+
}
|
|
2893
|
+
) : null
|
|
2721
2894
|
},
|
|
2722
2895
|
c.key
|
|
2723
2896
|
);
|
|
2724
2897
|
})
|
|
2725
2898
|
]
|
|
2726
2899
|
},
|
|
2727
|
-
|
|
2728
|
-
)
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2900
|
+
PENDING_KEY
|
|
2901
|
+
) : null,
|
|
2902
|
+
body.flatMap((row) => {
|
|
2903
|
+
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2904
|
+
const editing = isEditing(row);
|
|
2905
|
+
const record = /* @__PURE__ */ jsxs26(
|
|
2906
|
+
Row,
|
|
2907
|
+
{
|
|
2908
|
+
id: row.id,
|
|
2909
|
+
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2910
|
+
"data-pressable": onRowAction && !rowIsDisabled && !editing ? "true" : void 0,
|
|
2911
|
+
"data-editing": editing ? "true" : void 0,
|
|
2912
|
+
children: [
|
|
2913
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx36(Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ jsx36(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2914
|
+
columns.map((c) => {
|
|
2915
|
+
const pin = pinProps(c.key);
|
|
2916
|
+
return /* @__PURE__ */ jsx36(
|
|
2917
|
+
Cell,
|
|
2918
|
+
{
|
|
2919
|
+
className: "pire-td",
|
|
2920
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2921
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2922
|
+
...pin,
|
|
2923
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2924
|
+
children: editing && c.renderEdit ? /* @__PURE__ */ jsx36(
|
|
2925
|
+
EditCell,
|
|
2926
|
+
{
|
|
2927
|
+
isFirst: c === firstEditable,
|
|
2928
|
+
focusToken: 0,
|
|
2929
|
+
onCommit: () => onCommitRow?.(row.id),
|
|
2930
|
+
onCancel: () => onCancelRow?.(row.id),
|
|
2931
|
+
children: c.renderEdit(row)
|
|
2932
|
+
}
|
|
2933
|
+
) : c.render ? c.render(row) : row[c.key]
|
|
2934
|
+
},
|
|
2935
|
+
c.key
|
|
2936
|
+
);
|
|
2937
|
+
})
|
|
2938
|
+
]
|
|
2939
|
+
},
|
|
2940
|
+
row.id
|
|
2941
|
+
);
|
|
2942
|
+
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2943
|
+
return [
|
|
2944
|
+
record,
|
|
2945
|
+
/* @__PURE__ */ jsx36(Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ jsx36(Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))
|
|
2946
|
+
];
|
|
2947
|
+
})
|
|
2948
|
+
]
|
|
2735
2949
|
}
|
|
2736
2950
|
),
|
|
2737
|
-
footer && !isLoading ? /* @__PURE__ */
|
|
2738
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2951
|
+
footer && !isLoading ? /* @__PURE__ */ jsx36(TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ jsxs26(Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2952
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx36(Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2739
2953
|
columns.map((c, i) => {
|
|
2740
2954
|
const pin = pinProps(c.key);
|
|
2741
|
-
return /* @__PURE__ */
|
|
2955
|
+
return /* @__PURE__ */ jsx36(
|
|
2742
2956
|
Cell,
|
|
2743
2957
|
{
|
|
2744
2958
|
className: "pire-tf",
|
|
2745
2959
|
"data-numeric": c.numeric ? "true" : void 0,
|
|
2746
2960
|
...pin,
|
|
2747
2961
|
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2748
|
-
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */
|
|
2962
|
+
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */ jsx36("span", { className: "pire-sr-only", children: msg.dataTableSummaryRow }) : null)
|
|
2749
2963
|
},
|
|
2750
2964
|
c.key
|
|
2751
2965
|
);
|
|
@@ -2759,7 +2973,7 @@ function DataTable({
|
|
|
2759
2973
|
}
|
|
2760
2974
|
|
|
2761
2975
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2762
|
-
import { Fragment as
|
|
2976
|
+
import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2763
2977
|
function ValueHelpDialog({
|
|
2764
2978
|
isOpen,
|
|
2765
2979
|
title,
|
|
@@ -2794,16 +3008,16 @@ function ValueHelpDialog({
|
|
|
2794
3008
|
setQuery(value);
|
|
2795
3009
|
onSearch?.(value);
|
|
2796
3010
|
};
|
|
2797
|
-
return /* @__PURE__ */
|
|
3011
|
+
return /* @__PURE__ */ jsx37(
|
|
2798
3012
|
Dialog,
|
|
2799
3013
|
{
|
|
2800
3014
|
isOpen,
|
|
2801
3015
|
size: "lg",
|
|
2802
3016
|
title: title ?? msg.valueHelpDialogTitle,
|
|
2803
3017
|
onClose,
|
|
2804
|
-
footer: /* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2806
|
-
isMultiple ? /* @__PURE__ */
|
|
3018
|
+
footer: /* @__PURE__ */ jsxs27(Fragment3, { children: [
|
|
3019
|
+
/* @__PURE__ */ jsx37(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
3020
|
+
isMultiple ? /* @__PURE__ */ jsx37(
|
|
2807
3021
|
Button,
|
|
2808
3022
|
{
|
|
2809
3023
|
variant: "primary",
|
|
@@ -2815,8 +3029,8 @@ function ValueHelpDialog({
|
|
|
2815
3029
|
}
|
|
2816
3030
|
) : null
|
|
2817
3031
|
] }),
|
|
2818
|
-
children: /* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
3032
|
+
children: /* @__PURE__ */ jsxs27("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
3033
|
+
/* @__PURE__ */ jsx37(
|
|
2820
3034
|
Input,
|
|
2821
3035
|
{
|
|
2822
3036
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -2829,12 +3043,12 @@ function ValueHelpDialog({
|
|
|
2829
3043
|
autoFocus: true
|
|
2830
3044
|
}
|
|
2831
3045
|
),
|
|
2832
|
-
isMultiple ? /* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
3046
|
+
isMultiple ? /* @__PURE__ */ jsxs27("div", { className: "pire-valuehelp-selectionbar", children: [
|
|
3047
|
+
/* @__PURE__ */ jsx37(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.(rows.map((r) => r.id)), children: msg.valueHelpSelectAllCount.replace("{count}", String(rows.length)) }),
|
|
3048
|
+
/* @__PURE__ */ jsx37(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
3049
|
+
/* @__PURE__ */ jsx37("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2836
3050
|
] }) : null,
|
|
2837
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ jsx37(
|
|
2838
3052
|
"div",
|
|
2839
3053
|
{
|
|
2840
3054
|
onScroll: onLoadMore ? (event) => {
|
|
@@ -2842,7 +3056,7 @@ function ValueHelpDialog({
|
|
|
2842
3056
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2843
3057
|
} : void 0,
|
|
2844
3058
|
style: { overflow: "auto", maxHeight: "48vh" },
|
|
2845
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx37(
|
|
2846
3060
|
DataTable,
|
|
2847
3061
|
{
|
|
2848
3062
|
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
@@ -2869,7 +3083,7 @@ function ValueHelpDialog({
|
|
|
2869
3083
|
}
|
|
2870
3084
|
|
|
2871
3085
|
// src/components/forms/ValueHelpField.tsx
|
|
2872
|
-
import { jsx as
|
|
3086
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2873
3087
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
2874
3088
|
function ValueHelpField({
|
|
2875
3089
|
label,
|
|
@@ -2896,8 +3110,8 @@ function ValueHelpField({
|
|
|
2896
3110
|
}) {
|
|
2897
3111
|
const msg = usePireMessages();
|
|
2898
3112
|
const [open, setOpen] = React21.useState(false);
|
|
2899
|
-
return /* @__PURE__ */
|
|
2900
|
-
/* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ jsxs28("div", { className: cx(className), style, children: [
|
|
3114
|
+
/* @__PURE__ */ jsx38(
|
|
2901
3115
|
Input,
|
|
2902
3116
|
{
|
|
2903
3117
|
label,
|
|
@@ -2909,8 +3123,8 @@ function ValueHelpField({
|
|
|
2909
3123
|
placeholder: placeholder ?? msg.valueHelpFieldPlaceholder,
|
|
2910
3124
|
description,
|
|
2911
3125
|
errorMessage,
|
|
2912
|
-
suffix: /* @__PURE__ */
|
|
2913
|
-
allowsClear && value ? /* @__PURE__ */
|
|
3126
|
+
suffix: /* @__PURE__ */ jsxs28("span", { className: "pire-valuehelp-actions", children: [
|
|
3127
|
+
allowsClear && value ? /* @__PURE__ */ jsx38(
|
|
2914
3128
|
IconButton,
|
|
2915
3129
|
{
|
|
2916
3130
|
icon: "x",
|
|
@@ -2919,7 +3133,7 @@ function ValueHelpField({
|
|
|
2919
3133
|
onPress: () => onChange?.(null)
|
|
2920
3134
|
}
|
|
2921
3135
|
) : null,
|
|
2922
|
-
/* @__PURE__ */
|
|
3136
|
+
/* @__PURE__ */ jsx38(
|
|
2923
3137
|
IconButton,
|
|
2924
3138
|
{
|
|
2925
3139
|
icon: "search",
|
|
@@ -2931,7 +3145,7 @@ function ValueHelpField({
|
|
|
2931
3145
|
] })
|
|
2932
3146
|
}
|
|
2933
3147
|
),
|
|
2934
|
-
/* @__PURE__ */
|
|
3148
|
+
/* @__PURE__ */ jsx38(
|
|
2935
3149
|
ValueHelpDialog,
|
|
2936
3150
|
{
|
|
2937
3151
|
isOpen: open,
|
|
@@ -2956,7 +3170,7 @@ import { FileTrigger, Text as Text5 } from "react-aria-components";
|
|
|
2956
3170
|
|
|
2957
3171
|
// src/components/feedback/ProgressBar.tsx
|
|
2958
3172
|
import { ProgressBar as AriaProgressBar, Label as Label3 } from "react-aria-components";
|
|
2959
|
-
import { Fragment as
|
|
3173
|
+
import { Fragment as Fragment4, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2960
3174
|
function ProgressBar({
|
|
2961
3175
|
value = 0,
|
|
2962
3176
|
minValue = 0,
|
|
@@ -2969,7 +3183,7 @@ function ProgressBar({
|
|
|
2969
3183
|
className,
|
|
2970
3184
|
style
|
|
2971
3185
|
}) {
|
|
2972
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ jsx39(
|
|
2973
3187
|
AriaProgressBar,
|
|
2974
3188
|
{
|
|
2975
3189
|
className: cx("pire-progress", className),
|
|
@@ -2980,19 +3194,19 @@ function ProgressBar({
|
|
|
2980
3194
|
maxValue,
|
|
2981
3195
|
isIndeterminate,
|
|
2982
3196
|
style,
|
|
2983
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */
|
|
2984
|
-
label || showValue ? /* @__PURE__ */
|
|
2985
|
-
label ? /* @__PURE__ */
|
|
2986
|
-
showValue && !isIndeterminate ? /* @__PURE__ */
|
|
3197
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs29(Fragment4, { children: [
|
|
3198
|
+
label || showValue ? /* @__PURE__ */ jsxs29("div", { className: "pire-progress-head", children: [
|
|
3199
|
+
label ? /* @__PURE__ */ jsx39(Label3, { children: label }) : /* @__PURE__ */ jsx39("span", {}),
|
|
3200
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ jsx39("span", { className: "pire-numeric", children: valueText }) : null
|
|
2987
3201
|
] }) : null,
|
|
2988
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ jsx39("div", { className: "pire-progress-track", children: /* @__PURE__ */ jsx39("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
2989
3203
|
] })
|
|
2990
3204
|
}
|
|
2991
3205
|
);
|
|
2992
3206
|
}
|
|
2993
3207
|
|
|
2994
3208
|
// src/components/forms/FileUpload.tsx
|
|
2995
|
-
import { jsx as
|
|
3209
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2996
3210
|
var isImage = (file) => file.type.startsWith("image/");
|
|
2997
3211
|
function formatFileSize(bytes) {
|
|
2998
3212
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -3070,7 +3284,7 @@ function FileUpload({
|
|
|
3070
3284
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
3071
3285
|
};
|
|
3072
3286
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
3073
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ jsxs30(
|
|
3074
3288
|
"div",
|
|
3075
3289
|
{
|
|
3076
3290
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -3079,24 +3293,24 @@ function FileUpload({
|
|
|
3079
3293
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
3080
3294
|
...rest,
|
|
3081
3295
|
children: [
|
|
3082
|
-
label ? /* @__PURE__ */
|
|
3296
|
+
label ? /* @__PURE__ */ jsxs30("span", { className: "pire-field-label", children: [
|
|
3083
3297
|
label,
|
|
3084
|
-
isRequired ? /* @__PURE__ */
|
|
3298
|
+
isRequired ? /* @__PURE__ */ jsx40("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
3085
3299
|
] }) : null,
|
|
3086
|
-
/* @__PURE__ */
|
|
3300
|
+
/* @__PURE__ */ jsx40(
|
|
3087
3301
|
FileTrigger,
|
|
3088
3302
|
{
|
|
3089
3303
|
acceptedFileTypes,
|
|
3090
3304
|
allowsMultiple,
|
|
3091
3305
|
onSelect: accept,
|
|
3092
|
-
children: /* @__PURE__ */
|
|
3306
|
+
children: /* @__PURE__ */ jsx40(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
3093
3307
|
}
|
|
3094
3308
|
),
|
|
3095
|
-
files.length ? /* @__PURE__ */
|
|
3096
|
-
previewUrl ? /* @__PURE__ */
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3099
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
3309
|
+
files.length ? /* @__PURE__ */ jsx40("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs30("li", { className: "pire-fileupload-item", children: [
|
|
3310
|
+
previewUrl ? /* @__PURE__ */ jsx40("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx40(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
3311
|
+
/* @__PURE__ */ jsx40("span", { className: "pire-fileupload-name", children: file.name }),
|
|
3312
|
+
/* @__PURE__ */ jsx40("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
3313
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx40(
|
|
3100
3314
|
IconButton,
|
|
3101
3315
|
{
|
|
3102
3316
|
icon: "x",
|
|
@@ -3106,72 +3320,26 @@ function FileUpload({
|
|
|
3106
3320
|
}
|
|
3107
3321
|
)
|
|
3108
3322
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
3109
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
3110
|
-
description ? /* @__PURE__ */
|
|
3111
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
3323
|
+
uploadProgress != null ? /* @__PURE__ */ jsx40(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
3324
|
+
description ? /* @__PURE__ */ jsx40(Text5, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
3325
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx40("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
3112
3326
|
]
|
|
3113
3327
|
}
|
|
3114
3328
|
);
|
|
3115
3329
|
}
|
|
3116
3330
|
|
|
3117
3331
|
// src/components/navigation/ShellBar.tsx
|
|
3118
|
-
import { MenuTrigger, Button as
|
|
3119
|
-
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3120
|
-
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
3121
|
-
function ShellBar({
|
|
3122
|
-
launcher,
|
|
3123
|
-
product,
|
|
3124
|
-
monogram,
|
|
3125
|
-
title,
|
|
3126
|
-
onMenu,
|
|
3127
|
-
onSearch,
|
|
3128
|
-
menuLabel = "Open navigation",
|
|
3129
|
-
searchLabel = "Search",
|
|
3130
|
-
actions,
|
|
3131
|
-
user,
|
|
3132
|
-
userMenu,
|
|
3133
|
-
userMenuLabel,
|
|
3134
|
-
className,
|
|
3135
|
-
...rest
|
|
3136
|
-
}) {
|
|
3137
|
-
const msg = usePireMessages();
|
|
3138
|
-
return /* @__PURE__ */ jsxs30("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
3139
|
-
launcher,
|
|
3140
|
-
onMenu ? /* @__PURE__ */ jsx40(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
3141
|
-
monogram ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
3142
|
-
product ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
3143
|
-
title ? /* @__PURE__ */ jsx40("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
3144
|
-
/* @__PURE__ */ jsx40("span", { className: "pire-shellbar-spacer" }),
|
|
3145
|
-
onSearch ? /* @__PURE__ */ jsx40(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
3146
|
-
actions,
|
|
3147
|
-
user && userMenu ? (
|
|
3148
|
-
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
3149
|
-
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
3150
|
-
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
3151
|
-
/* @__PURE__ */ jsxs30(MenuTrigger, { children: [
|
|
3152
|
-
/* @__PURE__ */ jsx40(
|
|
3153
|
-
AriaButton11,
|
|
3154
|
-
{
|
|
3155
|
-
className: "pire-avatar pire-avatar-trigger",
|
|
3156
|
-
"aria-label": (userMenuLabel ?? msg.shellBarUserMenu).replace("{user}", user),
|
|
3157
|
-
children: initials2(user)
|
|
3158
|
-
}
|
|
3159
|
-
),
|
|
3160
|
-
/* @__PURE__ */ jsx40(Popover6, { className: "pire-popover", children: userMenu })
|
|
3161
|
-
] })
|
|
3162
|
-
) : user ? /* @__PURE__ */ jsx40("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
3163
|
-
] });
|
|
3164
|
-
}
|
|
3332
|
+
import { MenuTrigger as MenuTrigger2, Button as AriaButton12, Popover as Popover7 } from "react-aria-components";
|
|
3165
3333
|
|
|
3166
|
-
// src/components/navigation/
|
|
3334
|
+
// src/components/navigation/Breadcrumb.tsx
|
|
3167
3335
|
import * as React23 from "react";
|
|
3168
3336
|
import {
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
Popover as
|
|
3337
|
+
Breadcrumbs as AriaBreadcrumbs,
|
|
3338
|
+
Breadcrumb as AriaBreadcrumb,
|
|
3339
|
+
Link as Link2,
|
|
3340
|
+
MenuTrigger,
|
|
3341
|
+
Button as AriaButton11,
|
|
3342
|
+
Popover as Popover6
|
|
3175
3343
|
} from "react-aria-components";
|
|
3176
3344
|
|
|
3177
3345
|
// src/components/navigation/Menu.tsx
|
|
@@ -3237,8 +3405,187 @@ function MenuSeparator({ className }) {
|
|
|
3237
3405
|
return /* @__PURE__ */ jsx41(AriaSeparator2, { className: cx("pire-menu-separator", className) });
|
|
3238
3406
|
}
|
|
3239
3407
|
|
|
3240
|
-
// src/components/navigation/
|
|
3408
|
+
// src/components/navigation/Breadcrumb.tsx
|
|
3241
3409
|
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3410
|
+
var keyOf = (item) => item.id ?? item.label;
|
|
3411
|
+
var MIN_CURRENT = 64;
|
|
3412
|
+
function useFitLevel(enabled) {
|
|
3413
|
+
const boxRef = React23.useRef(null);
|
|
3414
|
+
const measureRef = React23.useRef(null);
|
|
3415
|
+
const [level, setLevel] = React23.useState(0);
|
|
3416
|
+
React23.useLayoutEffect(() => {
|
|
3417
|
+
const box = boxRef.current;
|
|
3418
|
+
const measure = measureRef.current;
|
|
3419
|
+
if (!enabled || !box || !measure) return;
|
|
3420
|
+
const check = () => {
|
|
3421
|
+
const avail = box.clientWidth;
|
|
3422
|
+
const gap = Number.parseFloat(getComputedStyle(measure).columnGap) || 0;
|
|
3423
|
+
const steps = [...measure.querySelectorAll("[data-step]")].map((el) => el.offsetWidth);
|
|
3424
|
+
const more = measure.querySelector("[data-more]")?.offsetWidth ?? 0;
|
|
3425
|
+
const full = steps.reduce((sum, w) => sum + w, 0) + gap * Math.max(steps.length - 1, 0);
|
|
3426
|
+
if (full <= avail + 0.5) return setLevel(0);
|
|
3427
|
+
const first = steps[0] ?? 0;
|
|
3428
|
+
setLevel(first + more + MIN_CURRENT + gap * 2 <= avail ? 1 : 2);
|
|
3429
|
+
};
|
|
3430
|
+
check();
|
|
3431
|
+
const observer = new ResizeObserver(check);
|
|
3432
|
+
observer.observe(box);
|
|
3433
|
+
observer.observe(measure);
|
|
3434
|
+
return () => observer.disconnect();
|
|
3435
|
+
}, [enabled]);
|
|
3436
|
+
return { boxRef, measureRef, level: enabled ? level : 0 };
|
|
3437
|
+
}
|
|
3438
|
+
function Breadcrumb({ items, onNavigate, isCollapsible, className, style }) {
|
|
3439
|
+
const msg = usePireMessages();
|
|
3440
|
+
const { boxRef, measureRef, level } = useFitLevel(!!isCollapsible);
|
|
3441
|
+
const last = items[items.length - 1];
|
|
3442
|
+
const foldFirst = level === 2 && items.length > 1;
|
|
3443
|
+
const collapse = foldFirst || level === 1 && items.length > 2;
|
|
3444
|
+
const folded = collapse ? items.slice(foldFirst ? 0 : 1, -1) : [];
|
|
3445
|
+
const shown = collapse ? foldFirst ? [last] : [items[0], last] : items;
|
|
3446
|
+
const moreAt = foldFirst ? 0 : 1;
|
|
3447
|
+
const separator = /* @__PURE__ */ jsx42(Icon, { name: "chevron-right", size: 12, className: "pire-breadcrumb-sep" });
|
|
3448
|
+
const crumb = (item) => {
|
|
3449
|
+
const isLast = item === last;
|
|
3450
|
+
return /* @__PURE__ */ jsxs32(
|
|
3451
|
+
AriaBreadcrumb,
|
|
3452
|
+
{
|
|
3453
|
+
className: "pire-breadcrumb",
|
|
3454
|
+
id: keyOf(item),
|
|
3455
|
+
"data-last": isLast ? "true" : void 0,
|
|
3456
|
+
children: [
|
|
3457
|
+
isCollapsible ? (
|
|
3458
|
+
// A Link even for the current step, because that is what React Aria marks
|
|
3459
|
+
// `aria-current="page"`. The `title` is what reads the step whole once it truncates.
|
|
3460
|
+
// A class, not an `a` selector: React Aria renders a Link with no `href` as a <span>.
|
|
3461
|
+
/* @__PURE__ */ jsx42(Link2, { className: "pire-breadcrumb-link", href: isLast ? void 0 : item.href, children: /* @__PURE__ */ jsx42("span", { title: isLast ? item.label : void 0, children: item.label }) })
|
|
3462
|
+
) : isLast ? item.label : /* @__PURE__ */ jsx42(Link2, { href: item.href, children: item.label }),
|
|
3463
|
+
isLast ? null : separator
|
|
3464
|
+
]
|
|
3465
|
+
},
|
|
3466
|
+
keyOf(item)
|
|
3467
|
+
);
|
|
3468
|
+
};
|
|
3469
|
+
if (!isCollapsible) {
|
|
3470
|
+
return /* @__PURE__ */ jsx42(
|
|
3471
|
+
AriaBreadcrumbs,
|
|
3472
|
+
{
|
|
3473
|
+
className: cx("pire-breadcrumbs", className),
|
|
3474
|
+
style,
|
|
3475
|
+
items,
|
|
3476
|
+
onAction: (key) => onNavigate?.(String(key)),
|
|
3477
|
+
children: (item) => crumb(item)
|
|
3478
|
+
}
|
|
3479
|
+
);
|
|
3480
|
+
}
|
|
3481
|
+
return /* @__PURE__ */ jsxs32("div", { ref: boxRef, className: cx("pire-breadcrumbs-fit", className), style, children: [
|
|
3482
|
+
/* @__PURE__ */ jsx42(
|
|
3483
|
+
AriaBreadcrumbs,
|
|
3484
|
+
{
|
|
3485
|
+
className: "pire-breadcrumbs",
|
|
3486
|
+
"data-collapsible": "true",
|
|
3487
|
+
onAction: (key) => onNavigate?.(String(key)),
|
|
3488
|
+
children: shown.map(
|
|
3489
|
+
(item, i) => collapse && i === moreAt ? /* @__PURE__ */ jsxs32(React23.Fragment, { children: [
|
|
3490
|
+
/* @__PURE__ */ jsxs32(AriaBreadcrumb, { className: "pire-breadcrumb", id: "__pire_breadcrumb_more__", children: [
|
|
3491
|
+
/* @__PURE__ */ jsxs32(MenuTrigger, { children: [
|
|
3492
|
+
/* @__PURE__ */ jsx42(AriaButton11, { className: "pire-breadcrumb-more", "aria-label": msg.breadcrumbMore, children: /* @__PURE__ */ jsx42(Icon, { name: "more-horizontal", size: 16 }) }),
|
|
3493
|
+
/* @__PURE__ */ jsx42(Popover6, { className: "pire-popover", children: /* @__PURE__ */ jsx42(Menu, { onAction: (key) => onNavigate?.(String(key)), children: folded.map((step) => /* @__PURE__ */ jsx42(MenuItem, { id: keyOf(step), href: step.href, children: step.label }, keyOf(step))) }) })
|
|
3494
|
+
] }),
|
|
3495
|
+
separator
|
|
3496
|
+
] }),
|
|
3497
|
+
crumb(item)
|
|
3498
|
+
] }, "__more__") : crumb(item)
|
|
3499
|
+
)
|
|
3500
|
+
}
|
|
3501
|
+
),
|
|
3502
|
+
/* @__PURE__ */ jsx42("div", { className: "pire-breadcrumbs-measure", "aria-hidden": "true", inert: true, children: /* @__PURE__ */ jsxs32("div", { ref: measureRef, className: "pire-breadcrumbs", "data-measure": "true", children: [
|
|
3503
|
+
items.map((item) => /* @__PURE__ */ jsxs32(
|
|
3504
|
+
"span",
|
|
3505
|
+
{
|
|
3506
|
+
className: "pire-breadcrumb",
|
|
3507
|
+
"data-step": "true",
|
|
3508
|
+
"data-last": item === last ? "true" : void 0,
|
|
3509
|
+
children: [
|
|
3510
|
+
/* @__PURE__ */ jsx42("span", { children: item.label }),
|
|
3511
|
+
item === last ? null : separator
|
|
3512
|
+
]
|
|
3513
|
+
},
|
|
3514
|
+
keyOf(item)
|
|
3515
|
+
)),
|
|
3516
|
+
/* @__PURE__ */ jsxs32("span", { className: "pire-breadcrumb", "data-more": "true", children: [
|
|
3517
|
+
/* @__PURE__ */ jsx42("span", { className: "pire-breadcrumb-more", children: /* @__PURE__ */ jsx42(Icon, { name: "more-horizontal", size: 16 }) }),
|
|
3518
|
+
separator
|
|
3519
|
+
] })
|
|
3520
|
+
] }) })
|
|
3521
|
+
] });
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
// src/components/navigation/ShellBar.tsx
|
|
3525
|
+
import { jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3526
|
+
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
3527
|
+
function ShellBar({
|
|
3528
|
+
launcher,
|
|
3529
|
+
product,
|
|
3530
|
+
monogram,
|
|
3531
|
+
title,
|
|
3532
|
+
breadcrumb,
|
|
3533
|
+
onBreadcrumbNavigate,
|
|
3534
|
+
onMenu,
|
|
3535
|
+
onSearch,
|
|
3536
|
+
menuLabel = "Open navigation",
|
|
3537
|
+
searchLabel = "Search",
|
|
3538
|
+
actions,
|
|
3539
|
+
user,
|
|
3540
|
+
userMenu,
|
|
3541
|
+
userMenuLabel,
|
|
3542
|
+
className,
|
|
3543
|
+
...rest
|
|
3544
|
+
}) {
|
|
3545
|
+
const msg = usePireMessages();
|
|
3546
|
+
return /* @__PURE__ */ jsxs33("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
3547
|
+
launcher,
|
|
3548
|
+
onMenu ? /* @__PURE__ */ jsx43(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
3549
|
+
monogram ? /* @__PURE__ */ jsx43("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
3550
|
+
product ? /* @__PURE__ */ jsx43("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
3551
|
+
breadcrumb?.length ? /* @__PURE__ */ jsxs33("nav", { className: "pire-shellbar-crumbs", "aria-label": msg.breadcrumbLabel, children: [
|
|
3552
|
+
product || monogram ? /* @__PURE__ */ jsx43("span", { className: "pire-shellbar-sep", "aria-hidden": "true" }) : null,
|
|
3553
|
+
/* @__PURE__ */ jsx43(Breadcrumb, { items: breadcrumb, onNavigate: onBreadcrumbNavigate, isCollapsible: true })
|
|
3554
|
+
] }) : null,
|
|
3555
|
+
title ? /* @__PURE__ */ jsx43("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
3556
|
+
breadcrumb?.length ? null : /* @__PURE__ */ jsx43("span", { className: "pire-shellbar-spacer" }),
|
|
3557
|
+
onSearch ? /* @__PURE__ */ jsx43(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
3558
|
+
actions,
|
|
3559
|
+
user && userMenu ? (
|
|
3560
|
+
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
3561
|
+
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
3562
|
+
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
3563
|
+
/* @__PURE__ */ jsxs33(MenuTrigger2, { children: [
|
|
3564
|
+
/* @__PURE__ */ jsx43(
|
|
3565
|
+
AriaButton12,
|
|
3566
|
+
{
|
|
3567
|
+
className: "pire-avatar pire-avatar-trigger",
|
|
3568
|
+
"aria-label": (userMenuLabel ?? msg.shellBarUserMenu).replace("{user}", user),
|
|
3569
|
+
children: initials2(user)
|
|
3570
|
+
}
|
|
3571
|
+
),
|
|
3572
|
+
/* @__PURE__ */ jsx43(Popover7, { className: "pire-popover", children: userMenu })
|
|
3573
|
+
] })
|
|
3574
|
+
) : user ? /* @__PURE__ */ jsx43("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
3575
|
+
] });
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
// src/components/navigation/SideNav.tsx
|
|
3579
|
+
import * as React24 from "react";
|
|
3580
|
+
import {
|
|
3581
|
+
Button as AriaButton13,
|
|
3582
|
+
Disclosure,
|
|
3583
|
+
DisclosureGroup,
|
|
3584
|
+
DisclosurePanel,
|
|
3585
|
+
MenuTrigger as MenuTrigger3,
|
|
3586
|
+
Popover as Popover8
|
|
3587
|
+
} from "react-aria-components";
|
|
3588
|
+
import { jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3242
3589
|
function findActiveParent(groups, value) {
|
|
3243
3590
|
if (value == null) return void 0;
|
|
3244
3591
|
for (const group of groups) {
|
|
@@ -3265,10 +3612,10 @@ function SideNav({
|
|
|
3265
3612
|
const msg = usePireMessages();
|
|
3266
3613
|
const activeParent = findActiveParent(groups, value);
|
|
3267
3614
|
const isControlled = expandedIds != null;
|
|
3268
|
-
const [ownExpanded, setOwnExpanded] =
|
|
3615
|
+
const [ownExpanded, setOwnExpanded] = React24.useState(
|
|
3269
3616
|
() => new Set(defaultExpandedIds ?? (activeParent ? [activeParent] : []))
|
|
3270
3617
|
);
|
|
3271
|
-
const [lastValue, setLastValue] =
|
|
3618
|
+
const [lastValue, setLastValue] = React24.useState(value);
|
|
3272
3619
|
if (value !== lastValue) {
|
|
3273
3620
|
setLastValue(value);
|
|
3274
3621
|
if (!isControlled && activeParent && !ownExpanded.has(activeParent)) {
|
|
@@ -3288,8 +3635,8 @@ function SideNav({
|
|
|
3288
3635
|
};
|
|
3289
3636
|
const renderRow = (item, onPress, isGroup) => {
|
|
3290
3637
|
const selected = !isGroup && item.id === value;
|
|
3291
|
-
const button = /* @__PURE__ */
|
|
3292
|
-
|
|
3638
|
+
const button = /* @__PURE__ */ jsxs34(
|
|
3639
|
+
AriaButton13,
|
|
3293
3640
|
{
|
|
3294
3641
|
className: "pire-sidenav-item",
|
|
3295
3642
|
"data-selected": selected ? "true" : void 0,
|
|
@@ -3298,70 +3645,70 @@ function SideNav({
|
|
|
3298
3645
|
"aria-label": collapsed ? item.label : void 0,
|
|
3299
3646
|
onPress,
|
|
3300
3647
|
children: [
|
|
3301
|
-
item.icon ? /* @__PURE__ */
|
|
3302
|
-
collapsed ? null : /* @__PURE__ */
|
|
3303
|
-
item.count != null && !collapsed ? /* @__PURE__ */
|
|
3648
|
+
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: 16 }) : null,
|
|
3649
|
+
collapsed ? null : /* @__PURE__ */ jsx44("span", { children: item.label }),
|
|
3650
|
+
item.count != null && !collapsed ? /* @__PURE__ */ jsx44("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
3304
3651
|
]
|
|
3305
3652
|
},
|
|
3306
3653
|
item.id
|
|
3307
3654
|
);
|
|
3308
|
-
return collapsed ? /* @__PURE__ */
|
|
3655
|
+
return collapsed ? /* @__PURE__ */ jsx44(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
3309
3656
|
};
|
|
3310
|
-
const renderRailFlyout = (item) => /* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
|
|
3657
|
+
const renderRailFlyout = (item) => /* @__PURE__ */ jsxs34(MenuTrigger3, { children: [
|
|
3658
|
+
/* @__PURE__ */ jsx44(
|
|
3659
|
+
AriaButton13,
|
|
3313
3660
|
{
|
|
3314
3661
|
className: "pire-sidenav-item",
|
|
3315
3662
|
"aria-label": item.label,
|
|
3316
3663
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
3317
|
-
children: item.icon ? /* @__PURE__ */
|
|
3664
|
+
children: item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: 16 }) : null
|
|
3318
3665
|
}
|
|
3319
3666
|
),
|
|
3320
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsx44(Popover8, { className: "pire-popover", placement: "right top", offset: 4, children: /* @__PURE__ */ jsx44(
|
|
3321
3668
|
Menu,
|
|
3322
3669
|
{
|
|
3323
3670
|
"aria-label": item.label,
|
|
3324
3671
|
className: "pire-sidenav-flyout",
|
|
3325
3672
|
onAction: (key) => onChange?.(String(key)),
|
|
3326
|
-
children: (item.items ?? []).map((child) => /* @__PURE__ */
|
|
3673
|
+
children: (item.items ?? []).map((child) => /* @__PURE__ */ jsx44(MenuItem, { id: child.id, children: child.label }, child.id))
|
|
3327
3674
|
}
|
|
3328
3675
|
) })
|
|
3329
3676
|
] }, item.id);
|
|
3330
|
-
const renderSection = (item) => /* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
|
|
3677
|
+
const renderSection = (item) => /* @__PURE__ */ jsxs34(Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
3678
|
+
/* @__PURE__ */ jsxs34(
|
|
3679
|
+
AriaButton13,
|
|
3333
3680
|
{
|
|
3334
3681
|
slot: "trigger",
|
|
3335
3682
|
className: "pire-sidenav-item",
|
|
3336
3683
|
"data-kind": "group",
|
|
3337
3684
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
3338
3685
|
children: [
|
|
3339
|
-
item.icon ? /* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
item.count != null ? /* @__PURE__ */
|
|
3342
|
-
/* @__PURE__ */
|
|
3686
|
+
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: 16 }) : null,
|
|
3687
|
+
/* @__PURE__ */ jsx44("span", { children: item.label }),
|
|
3688
|
+
item.count != null ? /* @__PURE__ */ jsx44("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
3689
|
+
/* @__PURE__ */ jsx44(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
3343
3690
|
]
|
|
3344
3691
|
}
|
|
3345
3692
|
),
|
|
3346
|
-
/* @__PURE__ */
|
|
3693
|
+
/* @__PURE__ */ jsx44(DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
3347
3694
|
const selected = child.id === value;
|
|
3348
|
-
return /* @__PURE__ */
|
|
3349
|
-
|
|
3695
|
+
return /* @__PURE__ */ jsxs34(
|
|
3696
|
+
AriaButton13,
|
|
3350
3697
|
{
|
|
3351
3698
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
3352
3699
|
"data-selected": selected ? "true" : void 0,
|
|
3353
3700
|
"aria-current": selected ? "page" : void 0,
|
|
3354
3701
|
onPress: () => onChange?.(child.id),
|
|
3355
3702
|
children: [
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
child.count != null ? /* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsx44("span", { children: child.label }),
|
|
3704
|
+
child.count != null ? /* @__PURE__ */ jsx44("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
3358
3705
|
]
|
|
3359
3706
|
},
|
|
3360
3707
|
child.id
|
|
3361
3708
|
);
|
|
3362
3709
|
}) })
|
|
3363
3710
|
] }, item.id);
|
|
3364
|
-
return /* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsxs34(
|
|
3365
3712
|
"nav",
|
|
3366
3713
|
{
|
|
3367
3714
|
className: cx("pire-sidenav", className),
|
|
@@ -3378,9 +3725,9 @@ function SideNav({
|
|
|
3378
3725
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
3379
3726
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
3380
3727
|
});
|
|
3381
|
-
return /* @__PURE__ */
|
|
3382
|
-
group.label && !collapsed ? /* @__PURE__ */
|
|
3383
|
-
hasSections ? /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ jsxs34("div", { className: "pire-sidenav-group", children: [
|
|
3729
|
+
group.label && !collapsed ? /* @__PURE__ */ jsx44("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
3730
|
+
hasSections ? /* @__PURE__ */ jsx44(
|
|
3384
3731
|
DisclosureGroup,
|
|
3385
3732
|
{
|
|
3386
3733
|
className: "pire-sidenav-tree",
|
|
@@ -3392,32 +3739,32 @@ function SideNav({
|
|
|
3392
3739
|
) : rows
|
|
3393
3740
|
] }, group.label ?? gi);
|
|
3394
3741
|
}),
|
|
3395
|
-
footer ? /* @__PURE__ */
|
|
3742
|
+
footer ? /* @__PURE__ */ jsx44("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
3396
3743
|
]
|
|
3397
3744
|
}
|
|
3398
3745
|
);
|
|
3399
3746
|
}
|
|
3400
3747
|
|
|
3401
3748
|
// src/components/navigation/ShellRail.tsx
|
|
3402
|
-
import * as
|
|
3403
|
-
import { Button as
|
|
3404
|
-
import { jsx as
|
|
3749
|
+
import * as React25 from "react";
|
|
3750
|
+
import { Button as AriaButton14 } from "react-aria-components";
|
|
3751
|
+
import { jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3405
3752
|
function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
3406
3753
|
const msg = usePireMessages();
|
|
3407
|
-
return /* @__PURE__ */
|
|
3754
|
+
return /* @__PURE__ */ jsx45("nav", { className: cx("pire-shellrail", className), "aria-label": msg.shellRailLabel, ...rest, children: groups.map((group, gi) => (
|
|
3408
3755
|
// The divider is a sibling of the groups rather than a pseudo-element on one, because the
|
|
3409
3756
|
// scrolling zone would carry its own rule out of view on the first wheel event.
|
|
3410
|
-
/* @__PURE__ */
|
|
3411
|
-
gi > 0 ? /* @__PURE__ */
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
|
|
3757
|
+
/* @__PURE__ */ jsxs35(React25.Fragment, { children: [
|
|
3758
|
+
gi > 0 ? /* @__PURE__ */ jsx45("div", { className: "pire-shellrail-divider" }) : null,
|
|
3759
|
+
/* @__PURE__ */ jsx45("div", { className: "pire-shellrail-group", "data-scroll": group.isScrollable ? "true" : void 0, children: group.items.map((item) => /* @__PURE__ */ jsx45(Tooltip, { label: item.label, placement: "right", children: /* @__PURE__ */ jsx45(
|
|
3760
|
+
AriaButton14,
|
|
3414
3761
|
{
|
|
3415
3762
|
className: "pire-shellrail-item",
|
|
3416
3763
|
"aria-label": item.label,
|
|
3417
3764
|
"data-selected": item.id === value ? "true" : void 0,
|
|
3418
3765
|
"aria-current": item.id === value ? "true" : void 0,
|
|
3419
3766
|
onPress: () => onChange?.(item.id),
|
|
3420
|
-
children: /* @__PURE__ */
|
|
3767
|
+
children: /* @__PURE__ */ jsx45("span", { className: "pire-shellrail-tile", children: /* @__PURE__ */ jsx45(Icon, { name: item.icon, size: 20 }) })
|
|
3421
3768
|
}
|
|
3422
3769
|
) }, item.id)) })
|
|
3423
3770
|
] }, group.items[0]?.id ?? gi)
|
|
@@ -3426,9 +3773,9 @@ function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
|
3426
3773
|
|
|
3427
3774
|
// src/components/navigation/Tabs.tsx
|
|
3428
3775
|
import { Tabs as AriaTabs, TabList, Tab as AriaTab, TabPanel } from "react-aria-components";
|
|
3429
|
-
import { jsx as
|
|
3776
|
+
import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3430
3777
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
3431
|
-
return /* @__PURE__ */
|
|
3778
|
+
return /* @__PURE__ */ jsxs36(
|
|
3432
3779
|
AriaTabs,
|
|
3433
3780
|
{
|
|
3434
3781
|
className,
|
|
@@ -3437,41 +3784,19 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
3437
3784
|
defaultSelectedKey: defaultValue,
|
|
3438
3785
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
3439
3786
|
children: [
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
item.icon ? /* @__PURE__ */
|
|
3787
|
+
/* @__PURE__ */ jsx46(TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ jsxs36(AriaTab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
3788
|
+
item.icon ? /* @__PURE__ */ jsx46(Icon, { name: item.icon, size: 16 }) : null,
|
|
3442
3789
|
item.label,
|
|
3443
|
-
item.count != null ? /* @__PURE__ */
|
|
3790
|
+
item.count != null ? /* @__PURE__ */ jsx46("span", { className: "pire-tab-count", children: item.count }) : null
|
|
3444
3791
|
] }) }),
|
|
3445
|
-
items.map((item) => /* @__PURE__ */
|
|
3792
|
+
items.map((item) => /* @__PURE__ */ jsx46(TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
3446
3793
|
]
|
|
3447
3794
|
}
|
|
3448
3795
|
);
|
|
3449
3796
|
}
|
|
3450
3797
|
|
|
3451
|
-
// src/components/navigation/Breadcrumb.tsx
|
|
3452
|
-
import { Breadcrumbs as AriaBreadcrumbs, Breadcrumb as AriaBreadcrumb, Link as Link2 } from "react-aria-components";
|
|
3453
|
-
import { jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3454
|
-
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
3455
|
-
return /* @__PURE__ */ jsx45(
|
|
3456
|
-
AriaBreadcrumbs,
|
|
3457
|
-
{
|
|
3458
|
-
className: cx("pire-breadcrumbs", className),
|
|
3459
|
-
style,
|
|
3460
|
-
items,
|
|
3461
|
-
onAction: (key) => onNavigate?.(String(key)),
|
|
3462
|
-
children: (item) => {
|
|
3463
|
-
const last = items[items.length - 1] === item;
|
|
3464
|
-
return /* @__PURE__ */ jsxs35(AriaBreadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
3465
|
-
last ? item.label : /* @__PURE__ */ jsx45(Link2, { href: item.href, children: item.label }),
|
|
3466
|
-
last ? null : /* @__PURE__ */ jsx45(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
3467
|
-
] });
|
|
3468
|
-
}
|
|
3469
|
-
}
|
|
3470
|
-
);
|
|
3471
|
-
}
|
|
3472
|
-
|
|
3473
3798
|
// src/components/navigation/Pagination.tsx
|
|
3474
|
-
import { jsx as
|
|
3799
|
+
import { jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3475
3800
|
function Pagination({
|
|
3476
3801
|
page = 1,
|
|
3477
3802
|
pageSize = 25,
|
|
@@ -3486,9 +3811,9 @@ function Pagination({
|
|
|
3486
3811
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
3487
3812
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
3488
3813
|
const to = Math.min(total, page * pageSize);
|
|
3489
|
-
return /* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3491
|
-
/* @__PURE__ */
|
|
3814
|
+
return /* @__PURE__ */ jsxs37("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
3815
|
+
/* @__PURE__ */ jsx47("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
3816
|
+
/* @__PURE__ */ jsx47(
|
|
3492
3817
|
IconButton,
|
|
3493
3818
|
{
|
|
3494
3819
|
icon: "chevron-left",
|
|
@@ -3499,8 +3824,8 @@ function Pagination({
|
|
|
3499
3824
|
onPress: () => onPageChange?.(page - 1)
|
|
3500
3825
|
}
|
|
3501
3826
|
),
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3827
|
+
/* @__PURE__ */ jsx47("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
3828
|
+
/* @__PURE__ */ jsx47(
|
|
3504
3829
|
IconButton,
|
|
3505
3830
|
{
|
|
3506
3831
|
icon: "chevron-right",
|
|
@@ -3511,7 +3836,7 @@ function Pagination({
|
|
|
3511
3836
|
onPress: () => onPageChange?.(page + 1)
|
|
3512
3837
|
}
|
|
3513
3838
|
),
|
|
3514
|
-
onPageSizeChange ? /* @__PURE__ */
|
|
3839
|
+
onPageSizeChange ? /* @__PURE__ */ jsx47(
|
|
3515
3840
|
Select,
|
|
3516
3841
|
{
|
|
3517
3842
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -3527,9 +3852,9 @@ function Pagination({
|
|
|
3527
3852
|
}
|
|
3528
3853
|
|
|
3529
3854
|
// src/components/navigation/Ribbon.tsx
|
|
3530
|
-
import * as
|
|
3855
|
+
import * as React26 from "react";
|
|
3531
3856
|
import { Tabs as AriaTabs2, TabList as TabList2, Tab as AriaTab2, TabPanel as TabPanel2, Toolbar, Button as Button3 } from "react-aria-components";
|
|
3532
|
-
import { Fragment as
|
|
3857
|
+
import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3533
3858
|
var outside = (what, parent) => {
|
|
3534
3859
|
const Config = () => {
|
|
3535
3860
|
throw new Error(`[pire] ${what} must be a child of ${parent}.`);
|
|
@@ -3543,7 +3868,7 @@ var RibbonGroup = outside("Ribbon.Group", "Ribbon.Tab");
|
|
|
3543
3868
|
var RibbonCommand = outside("Ribbon.Command", "Ribbon.Group");
|
|
3544
3869
|
var CONFIG_ELEMENTS = /* @__PURE__ */ new Set([RibbonTab, RibbonGroup, RibbonCommand]);
|
|
3545
3870
|
function describe(child) {
|
|
3546
|
-
if (!
|
|
3871
|
+
if (!React26.isValidElement(child)) return JSON.stringify(child);
|
|
3547
3872
|
if (typeof child.type === "string") return `<${child.type}>`;
|
|
3548
3873
|
const type = child.type;
|
|
3549
3874
|
return type?.displayName || type?.name || "a component";
|
|
@@ -3551,13 +3876,13 @@ function describe(child) {
|
|
|
3551
3876
|
function childrenOfType(children, type, what, parent) {
|
|
3552
3877
|
const out = [];
|
|
3553
3878
|
const walk = (nodes, path) => {
|
|
3554
|
-
|
|
3879
|
+
React26.Children.forEach(nodes, (child, i) => {
|
|
3555
3880
|
if (child == null || typeof child === "boolean") return;
|
|
3556
|
-
if (
|
|
3881
|
+
if (React26.isValidElement(child) && child.type === React26.Fragment) {
|
|
3557
3882
|
return walk(child.props.children, `${path}${i}.`);
|
|
3558
3883
|
}
|
|
3559
|
-
if (!
|
|
3560
|
-
const isWrapper =
|
|
3884
|
+
if (!React26.isValidElement(child) || child.type !== type) {
|
|
3885
|
+
const isWrapper = React26.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3561
3886
|
throw new Error(
|
|
3562
3887
|
`[pire] ${parent} accepts only ${what} as children, and got ${describe(child)}.` + (isWrapper ? ` Configuration elements are read, not rendered, so ${parent} cannot see through a wrapper component.` : "")
|
|
3563
3888
|
);
|
|
@@ -3589,37 +3914,54 @@ function Command({
|
|
|
3589
3914
|
selectionCount,
|
|
3590
3915
|
inBar
|
|
3591
3916
|
}) {
|
|
3592
|
-
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3593
|
-
const
|
|
3594
|
-
|
|
3917
|
+
const size = inBar ? "sm" : command.isPrimary ? "lg" : command.size ?? "sm";
|
|
3918
|
+
const msg = usePireMessages();
|
|
3919
|
+
const comingSoon = command.isComingSoon === true;
|
|
3920
|
+
const isDisabled = !comingSoon && (command.isDisabled || command.requiresSelection === true && selectionCount === 0);
|
|
3921
|
+
const button = /* @__PURE__ */ jsxs38(
|
|
3595
3922
|
Button3,
|
|
3596
3923
|
{
|
|
3597
3924
|
className: "pire-ribbon-command",
|
|
3598
3925
|
"data-size": size,
|
|
3926
|
+
"data-primary": command.isPrimary ? "true" : void 0,
|
|
3599
3927
|
isDisabled,
|
|
3600
3928
|
onPress: command.onPress,
|
|
3929
|
+
...comingSoon ? comingSoonProps(command.label, msg.comingSoon) : {},
|
|
3601
3930
|
children: [
|
|
3602
|
-
|
|
3603
|
-
|
|
3931
|
+
comingSoon && size === "lg" ? (
|
|
3932
|
+
// The tile is a column with no room for a third line under a two-line caption, and a mark
|
|
3933
|
+
// pinned to its corner lands on the icon. Beside the icon is the one place it fits.
|
|
3934
|
+
/* @__PURE__ */ jsxs38("span", { className: "pire-ribbon-command-head", children: [
|
|
3935
|
+
command.icon ? /* @__PURE__ */ jsx48(Icon, { name: command.icon, size: 20 }) : null,
|
|
3936
|
+
/* @__PURE__ */ jsx48(ComingSoonMark, { announce: false })
|
|
3937
|
+
] })
|
|
3938
|
+
) : command.icon ? /* @__PURE__ */ jsx48(Icon, { name: command.icon, size: size === "lg" ? 20 : 16 }) : null,
|
|
3939
|
+
/* @__PURE__ */ jsx48("span", { className: "pire-ribbon-command-label", children: command.label }),
|
|
3940
|
+
comingSoon && size !== "lg" ? /* @__PURE__ */ jsx48(ComingSoonMark, { announce: false }) : null
|
|
3604
3941
|
]
|
|
3605
3942
|
}
|
|
3606
3943
|
);
|
|
3944
|
+
return command.tooltip ? /* @__PURE__ */ jsx48(Tooltip, { label: command.tooltip, children: button }) : button;
|
|
3607
3945
|
}
|
|
3608
3946
|
function Group8({ group, selectionCount }) {
|
|
3609
|
-
const
|
|
3610
|
-
const
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3947
|
+
const isLarge = (c) => c.isPrimary || (c.size ?? "sm") === "lg";
|
|
3948
|
+
const large = [
|
|
3949
|
+
...group.commands.filter((c) => c.isPrimary),
|
|
3950
|
+
...group.commands.filter((c) => !c.isPrimary && isLarge(c))
|
|
3951
|
+
];
|
|
3952
|
+
const small = group.commands.filter((c) => !isLarge(c));
|
|
3953
|
+
return /* @__PURE__ */ jsxs38("div", { className: "pire-ribbon-group", role: "group", "aria-label": group.caption, children: [
|
|
3954
|
+
/* @__PURE__ */ jsxs38("div", { className: "pire-ribbon-group-body", children: [
|
|
3955
|
+
large.map((c) => /* @__PURE__ */ jsx48(Command, { command: c, selectionCount }, c.key)),
|
|
3956
|
+
small.length ? /* @__PURE__ */ jsx48("div", { className: "pire-ribbon-stack", children: small.map((c) => /* @__PURE__ */ jsx48(Command, { command: c, selectionCount }, c.key)) }) : null
|
|
3615
3957
|
] }),
|
|
3616
|
-
/* @__PURE__ */
|
|
3958
|
+
/* @__PURE__ */ jsx48("div", { className: "pire-ribbon-caption", "aria-hidden": "true", children: group.caption })
|
|
3617
3959
|
] });
|
|
3618
3960
|
}
|
|
3619
3961
|
function useTrailingOverflow() {
|
|
3620
|
-
const ref =
|
|
3621
|
-
const [overflow, setOverflow] =
|
|
3622
|
-
|
|
3962
|
+
const ref = React26.useRef(null);
|
|
3963
|
+
const [overflow, setOverflow] = React26.useState(false);
|
|
3964
|
+
React26.useEffect(() => {
|
|
3623
3965
|
const node = ref.current;
|
|
3624
3966
|
if (!node) return;
|
|
3625
3967
|
const measure = () => setOverflow(node.scrollLeft + node.clientWidth < node.scrollWidth - 1);
|
|
@@ -3644,9 +3986,9 @@ function Surface({
|
|
|
3644
3986
|
}) {
|
|
3645
3987
|
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3646
3988
|
const domId = id ? { id } : {};
|
|
3647
|
-
return /* @__PURE__ */
|
|
3648
|
-
/* @__PURE__ */
|
|
3649
|
-
/* @__PURE__ */
|
|
3989
|
+
return /* @__PURE__ */ jsxs38(Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
3990
|
+
/* @__PURE__ */ jsx48("div", { className: "pire-ribbon-scroll", ref: scrollRef, children }),
|
|
3991
|
+
/* @__PURE__ */ jsx48("div", { className: "pire-ribbon-trail", "data-overflow": overflow ? "true" : void 0, children: trailing })
|
|
3650
3992
|
] });
|
|
3651
3993
|
}
|
|
3652
3994
|
function barBlocks(tabs) {
|
|
@@ -3654,12 +3996,15 @@ function barBlocks(tabs) {
|
|
|
3654
3996
|
for (const tab of tabs) {
|
|
3655
3997
|
if (tab.isContextual) continue;
|
|
3656
3998
|
for (const group of tab.groups) {
|
|
3657
|
-
const commands = group.commands.filter((c) => c.inBar);
|
|
3999
|
+
const commands = group.commands.filter((c) => c.inBar && !c.isPrimary);
|
|
3658
4000
|
if (commands.length) blocks.push({ key: `${tab.key}:${group.key}`, commands });
|
|
3659
4001
|
}
|
|
3660
4002
|
}
|
|
3661
4003
|
return blocks;
|
|
3662
4004
|
}
|
|
4005
|
+
function barPrimaries(tabs) {
|
|
4006
|
+
return tabs.filter((tab) => !tab.isContextual).flatMap((tab) => tab.groups.flatMap((group) => group.commands.filter((c) => c.isPrimary)));
|
|
4007
|
+
}
|
|
3663
4008
|
function Ribbon({
|
|
3664
4009
|
children,
|
|
3665
4010
|
value,
|
|
@@ -3679,18 +4024,18 @@ function Ribbon({
|
|
|
3679
4024
|
const count = selectionCount ?? 0;
|
|
3680
4025
|
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3681
4026
|
const fallback = visible[0]?.id;
|
|
3682
|
-
const [ownTab, setOwnTab] =
|
|
4027
|
+
const [ownTab, setOwnTab] = React26.useState(defaultValue);
|
|
3683
4028
|
const requested = value ?? ownTab;
|
|
3684
4029
|
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3685
|
-
const select =
|
|
4030
|
+
const select = React26.useCallback(
|
|
3686
4031
|
(id) => {
|
|
3687
4032
|
setOwnTab(id);
|
|
3688
4033
|
onChange?.(id);
|
|
3689
4034
|
},
|
|
3690
4035
|
[onChange]
|
|
3691
4036
|
);
|
|
3692
|
-
const hadSelection =
|
|
3693
|
-
|
|
4037
|
+
const hadSelection = React26.useRef(false);
|
|
4038
|
+
React26.useEffect(() => {
|
|
3694
4039
|
const has = count > 0;
|
|
3695
4040
|
if (has === hadSelection.current) return;
|
|
3696
4041
|
hadSelection.current = has;
|
|
@@ -3699,17 +4044,17 @@ function Ribbon({
|
|
|
3699
4044
|
if (has) select(contextual.id);
|
|
3700
4045
|
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3701
4046
|
}, [count, tabs, requested, select]);
|
|
3702
|
-
const [ownCollapsed, setOwnCollapsed] =
|
|
4047
|
+
const [ownCollapsed, setOwnCollapsed] = React26.useState(false);
|
|
3703
4048
|
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3704
|
-
const toggleRef =
|
|
3705
|
-
const restoreFocus =
|
|
3706
|
-
|
|
4049
|
+
const toggleRef = React26.useRef(null);
|
|
4050
|
+
const restoreFocus = React26.useRef(false);
|
|
4051
|
+
React26.useLayoutEffect(() => {
|
|
3707
4052
|
if (!restoreFocus.current) return;
|
|
3708
4053
|
restoreFocus.current = false;
|
|
3709
4054
|
toggleRef.current?.focus();
|
|
3710
4055
|
});
|
|
3711
|
-
const bandId =
|
|
3712
|
-
const toggle = /* @__PURE__ */
|
|
4056
|
+
const bandId = React26.useId();
|
|
4057
|
+
const toggle = /* @__PURE__ */ jsx48(
|
|
3713
4058
|
Button3,
|
|
3714
4059
|
{
|
|
3715
4060
|
ref: toggleRef,
|
|
@@ -3722,32 +4067,34 @@ function Ribbon({
|
|
|
3722
4067
|
setOwnCollapsed(!collapsed);
|
|
3723
4068
|
onCollapsedChange?.(!collapsed);
|
|
3724
4069
|
},
|
|
3725
|
-
children: /* @__PURE__ */
|
|
4070
|
+
children: /* @__PURE__ */ jsx48(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3726
4071
|
}
|
|
3727
4072
|
);
|
|
3728
4073
|
if (collapsed) {
|
|
3729
4074
|
const blocks = barBlocks(tabs);
|
|
3730
|
-
|
|
4075
|
+
const primaries = barPrimaries(tabs);
|
|
4076
|
+
return /* @__PURE__ */ jsx48("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs38(
|
|
3731
4077
|
Surface,
|
|
3732
4078
|
{
|
|
3733
4079
|
className: "pire-ribbon-bar",
|
|
3734
4080
|
label: rest["aria-label"],
|
|
3735
|
-
trailing: /* @__PURE__ */
|
|
4081
|
+
trailing: /* @__PURE__ */ jsxs38(Fragment8, { children: [
|
|
3736
4082
|
actions,
|
|
3737
4083
|
toggle
|
|
3738
4084
|
] }),
|
|
3739
4085
|
children: [
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
4086
|
+
primaries.map((c) => /* @__PURE__ */ jsx48(Command, { command: c, selectionCount: count, inBar: true }, c.key)),
|
|
4087
|
+
leading ? /* @__PURE__ */ jsx48("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
4088
|
+
blocks.map((block, i) => /* @__PURE__ */ jsxs38(React26.Fragment, { children: [
|
|
4089
|
+
i > 0 || leading || primaries.length ? /* @__PURE__ */ jsx48("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
4090
|
+
block.commands.map((c) => /* @__PURE__ */ jsx48(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3744
4091
|
] }, block.key))
|
|
3745
4092
|
]
|
|
3746
4093
|
}
|
|
3747
4094
|
) });
|
|
3748
4095
|
}
|
|
3749
|
-
return /* @__PURE__ */
|
|
3750
|
-
/* @__PURE__ */
|
|
4096
|
+
return /* @__PURE__ */ jsx48("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs38(AriaTabs2, { selectedKey: selected, onSelectionChange: (k) => select(String(k)), children: [
|
|
4097
|
+
/* @__PURE__ */ jsx48(TabList2, { className: "pire-ribbon-tablist", "aria-label": rest["aria-label"], children: visible.map((tab) => /* @__PURE__ */ jsx48(
|
|
3751
4098
|
AriaTab2,
|
|
3752
4099
|
{
|
|
3753
4100
|
id: tab.id,
|
|
@@ -3757,17 +4104,17 @@ function Ribbon({
|
|
|
3757
4104
|
},
|
|
3758
4105
|
tab.key
|
|
3759
4106
|
)) }),
|
|
3760
|
-
visible.map((tab) => /* @__PURE__ */
|
|
4107
|
+
visible.map((tab) => /* @__PURE__ */ jsx48(TabPanel2, { id: tab.id, className: "pire-ribbon-panel", children: /* @__PURE__ */ jsx48(
|
|
3761
4108
|
Surface,
|
|
3762
4109
|
{
|
|
3763
4110
|
id: bandId,
|
|
3764
4111
|
className: "pire-ribbon-band",
|
|
3765
4112
|
label: msg.ribbonLabel,
|
|
3766
|
-
trailing: /* @__PURE__ */
|
|
4113
|
+
trailing: /* @__PURE__ */ jsxs38(Fragment8, { children: [
|
|
3767
4114
|
actions,
|
|
3768
4115
|
toggle
|
|
3769
4116
|
] }),
|
|
3770
|
-
children: tab.groups.map((group) => /* @__PURE__ */
|
|
4117
|
+
children: tab.groups.map((group) => /* @__PURE__ */ jsx48(Group8, { group, selectionCount: count }, group.key))
|
|
3771
4118
|
}
|
|
3772
4119
|
) }, tab.key))
|
|
3773
4120
|
] }) });
|
|
@@ -3777,7 +4124,7 @@ Ribbon.Group = RibbonGroup;
|
|
|
3777
4124
|
Ribbon.Command = RibbonCommand;
|
|
3778
4125
|
|
|
3779
4126
|
// src/components/feedback/InlineMessage.tsx
|
|
3780
|
-
import { jsx as
|
|
4127
|
+
import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3781
4128
|
var KIND_ICON = {
|
|
3782
4129
|
info: "info",
|
|
3783
4130
|
success: "check-circle-2",
|
|
@@ -3795,7 +4142,7 @@ function InlineMessage({
|
|
|
3795
4142
|
}) {
|
|
3796
4143
|
const msg = usePireMessages();
|
|
3797
4144
|
const assertive = kind === "error" || kind === "warning";
|
|
3798
|
-
return /* @__PURE__ */
|
|
4145
|
+
return /* @__PURE__ */ jsxs39(
|
|
3799
4146
|
"div",
|
|
3800
4147
|
{
|
|
3801
4148
|
className: cx("pire-msg", className),
|
|
@@ -3804,21 +4151,21 @@ function InlineMessage({
|
|
|
3804
4151
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3805
4152
|
...rest,
|
|
3806
4153
|
children: [
|
|
3807
|
-
/* @__PURE__ */
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
title ? /* @__PURE__ */
|
|
3810
|
-
children ? /* @__PURE__ */
|
|
4154
|
+
/* @__PURE__ */ jsx49(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
4155
|
+
/* @__PURE__ */ jsxs39("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
4156
|
+
title ? /* @__PURE__ */ jsx49("span", { className: "pire-msg-title", children: title }) : null,
|
|
4157
|
+
children ? /* @__PURE__ */ jsx49("span", { className: "pire-msg-body", children }) : null,
|
|
3811
4158
|
action
|
|
3812
4159
|
] }),
|
|
3813
|
-
onClose ? /* @__PURE__ */
|
|
4160
|
+
onClose ? /* @__PURE__ */ jsx49(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3814
4161
|
]
|
|
3815
4162
|
}
|
|
3816
4163
|
);
|
|
3817
4164
|
}
|
|
3818
4165
|
|
|
3819
4166
|
// src/components/feedback/Toast.tsx
|
|
3820
|
-
import * as
|
|
3821
|
-
import { jsx as
|
|
4167
|
+
import * as React27 from "react";
|
|
4168
|
+
import { jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3822
4169
|
var KIND_ICON2 = {
|
|
3823
4170
|
info: "info",
|
|
3824
4171
|
success: "check-circle-2",
|
|
@@ -3834,7 +4181,7 @@ function Toast({
|
|
|
3834
4181
|
...rest
|
|
3835
4182
|
}) {
|
|
3836
4183
|
const msg = usePireMessages();
|
|
3837
|
-
return /* @__PURE__ */
|
|
4184
|
+
return /* @__PURE__ */ jsxs40(
|
|
3838
4185
|
"div",
|
|
3839
4186
|
{
|
|
3840
4187
|
className: cx("pire-toast", className),
|
|
@@ -3843,22 +4190,22 @@ function Toast({
|
|
|
3843
4190
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3844
4191
|
...rest,
|
|
3845
4192
|
children: [
|
|
3846
|
-
/* @__PURE__ */
|
|
3847
|
-
/* @__PURE__ */
|
|
3848
|
-
onClose ? /* @__PURE__ */
|
|
4193
|
+
/* @__PURE__ */ jsx50(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
4194
|
+
/* @__PURE__ */ jsx50("span", { style: { flex: 1 }, children }),
|
|
4195
|
+
onClose ? /* @__PURE__ */ jsx50(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3849
4196
|
]
|
|
3850
4197
|
}
|
|
3851
4198
|
);
|
|
3852
4199
|
}
|
|
3853
|
-
var ToastContext =
|
|
4200
|
+
var ToastContext = React27.createContext(null);
|
|
3854
4201
|
function ToastProvider({
|
|
3855
4202
|
children,
|
|
3856
4203
|
timeout = 6e3
|
|
3857
4204
|
}) {
|
|
3858
4205
|
const msg = usePireMessages();
|
|
3859
|
-
const [toasts, setToasts] =
|
|
3860
|
-
const close =
|
|
3861
|
-
const add =
|
|
4206
|
+
const [toasts, setToasts] = React27.useState([]);
|
|
4207
|
+
const close = React27.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
4208
|
+
const add = React27.useCallback(
|
|
3862
4209
|
(toast) => {
|
|
3863
4210
|
const id = Math.random().toString(36).slice(2);
|
|
3864
4211
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
@@ -3868,10 +4215,10 @@ function ToastProvider({
|
|
|
3868
4215
|
},
|
|
3869
4216
|
[close, timeout]
|
|
3870
4217
|
);
|
|
3871
|
-
const value =
|
|
3872
|
-
return /* @__PURE__ */
|
|
4218
|
+
const value = React27.useMemo(() => ({ add, close }), [add, close]);
|
|
4219
|
+
return /* @__PURE__ */ jsxs40(ToastContext.Provider, { value, children: [
|
|
3873
4220
|
children,
|
|
3874
|
-
/* @__PURE__ */
|
|
4221
|
+
/* @__PURE__ */ jsx50("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ jsx50(
|
|
3875
4222
|
Toast,
|
|
3876
4223
|
{
|
|
3877
4224
|
kind: t.kind,
|
|
@@ -3884,14 +4231,14 @@ function ToastProvider({
|
|
|
3884
4231
|
] });
|
|
3885
4232
|
}
|
|
3886
4233
|
function useToast() {
|
|
3887
|
-
const ctx =
|
|
4234
|
+
const ctx = React27.useContext(ToastContext);
|
|
3888
4235
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3889
4236
|
return ctx;
|
|
3890
4237
|
}
|
|
3891
4238
|
|
|
3892
4239
|
// src/components/data/KpiTile.tsx
|
|
3893
|
-
import { Button as
|
|
3894
|
-
import { Fragment as
|
|
4240
|
+
import { Button as AriaButton15 } from "react-aria-components";
|
|
4241
|
+
import { Fragment as Fragment9, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3895
4242
|
function KpiTile({
|
|
3896
4243
|
label,
|
|
3897
4244
|
value,
|
|
@@ -3907,27 +4254,27 @@ function KpiTile({
|
|
|
3907
4254
|
style
|
|
3908
4255
|
}) {
|
|
3909
4256
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3910
|
-
const body = /* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
icon ? /* @__PURE__ */
|
|
4257
|
+
const body = /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
4258
|
+
/* @__PURE__ */ jsxs41("span", { className: "pire-kpi-label", children: [
|
|
4259
|
+
icon ? /* @__PURE__ */ jsx51(Icon, { name: icon, size: 16 }) : null,
|
|
3913
4260
|
label
|
|
3914
4261
|
] }),
|
|
3915
|
-
/* @__PURE__ */
|
|
4262
|
+
/* @__PURE__ */ jsxs41("span", { className: "pire-kpi-value", children: [
|
|
3916
4263
|
value,
|
|
3917
|
-
unit ? /* @__PURE__ */
|
|
4264
|
+
unit ? /* @__PURE__ */ jsx51("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3918
4265
|
] }),
|
|
3919
|
-
delta ? /* @__PURE__ */
|
|
3920
|
-
deltaDirection ? /* @__PURE__ */
|
|
4266
|
+
delta ? /* @__PURE__ */ jsxs41("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
4267
|
+
deltaDirection ? /* @__PURE__ */ jsx51(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3921
4268
|
delta
|
|
3922
4269
|
] }) : null,
|
|
3923
|
-
footnote ? /* @__PURE__ */
|
|
4270
|
+
footnote ? /* @__PURE__ */ jsx51("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3924
4271
|
] });
|
|
3925
4272
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3926
|
-
return onPress ? /* @__PURE__ */
|
|
4273
|
+
return onPress ? /* @__PURE__ */ jsx51(AriaButton15, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ jsx51("div", { ...props, children: body });
|
|
3927
4274
|
}
|
|
3928
4275
|
|
|
3929
4276
|
// src/components/data/ObjectHeader.tsx
|
|
3930
|
-
import { jsx as
|
|
4277
|
+
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3931
4278
|
function ObjectHeader({
|
|
3932
4279
|
title,
|
|
3933
4280
|
subtitle,
|
|
@@ -3939,22 +4286,22 @@ function ObjectHeader({
|
|
|
3939
4286
|
className,
|
|
3940
4287
|
...rest
|
|
3941
4288
|
}) {
|
|
3942
|
-
return /* @__PURE__ */
|
|
4289
|
+
return /* @__PURE__ */ jsxs42("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3943
4290
|
breadcrumb,
|
|
3944
|
-
/* @__PURE__ */
|
|
3945
|
-
/* @__PURE__ */
|
|
3946
|
-
/* @__PURE__ */
|
|
3947
|
-
subtitle || id ? /* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ jsxs42("div", { className: "pire-objheader-row", children: [
|
|
4292
|
+
/* @__PURE__ */ jsxs42("div", { style: { minWidth: 0 }, children: [
|
|
4293
|
+
/* @__PURE__ */ jsx52("h1", { className: "pire-objheader-title", children: title }),
|
|
4294
|
+
subtitle || id ? /* @__PURE__ */ jsxs42("div", { className: "pire-objheader-sub", children: [
|
|
3948
4295
|
subtitle,
|
|
3949
|
-
id ? /* @__PURE__ */
|
|
4296
|
+
id ? /* @__PURE__ */ jsx52("span", { className: "pire-objheader-id", children: id }) : null
|
|
3950
4297
|
] }) : null
|
|
3951
4298
|
] }),
|
|
3952
4299
|
badge,
|
|
3953
|
-
actions ? /* @__PURE__ */
|
|
4300
|
+
actions ? /* @__PURE__ */ jsx52("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3954
4301
|
] }),
|
|
3955
|
-
facts?.length ? /* @__PURE__ */
|
|
3956
|
-
/* @__PURE__ */
|
|
3957
|
-
/* @__PURE__ */
|
|
4302
|
+
facts?.length ? /* @__PURE__ */ jsx52("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ jsxs42("div", { children: [
|
|
4303
|
+
/* @__PURE__ */ jsx52("dt", { className: "pire-fact-label", children: fact.label }),
|
|
4304
|
+
/* @__PURE__ */ jsx52(
|
|
3958
4305
|
"dd",
|
|
3959
4306
|
{
|
|
3960
4307
|
className: "pire-fact-value",
|
|
@@ -3968,7 +4315,7 @@ function ObjectHeader({
|
|
|
3968
4315
|
}
|
|
3969
4316
|
|
|
3970
4317
|
// src/components/data/FilterBar.tsx
|
|
3971
|
-
import { jsx as
|
|
4318
|
+
import { jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3972
4319
|
function FilterBar({
|
|
3973
4320
|
children,
|
|
3974
4321
|
activeFilters = [],
|
|
@@ -3985,22 +4332,22 @@ function FilterBar({
|
|
|
3985
4332
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3986
4333
|
const go = useMessage("filterBarGo", goLabel);
|
|
3987
4334
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3988
|
-
return /* @__PURE__ */
|
|
3989
|
-
/* @__PURE__ */
|
|
4335
|
+
return /* @__PURE__ */ jsxs43("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
4336
|
+
/* @__PURE__ */ jsxs43("div", { className: "pire-filterbar-controls", children: [
|
|
3990
4337
|
children,
|
|
3991
|
-
onGo ? /* @__PURE__ */
|
|
4338
|
+
onGo ? /* @__PURE__ */ jsx53(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3992
4339
|
] }),
|
|
3993
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */
|
|
3994
|
-
activeFilters.map((filter) => /* @__PURE__ */
|
|
3995
|
-
activeFilters.length && onClear ? /* @__PURE__ */
|
|
3996
|
-
resultLabel ? /* @__PURE__ */
|
|
3997
|
-
actions ? /* @__PURE__ */
|
|
4340
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ jsxs43("div", { className: "pire-filterbar-foot", children: [
|
|
4341
|
+
activeFilters.map((filter) => /* @__PURE__ */ jsx53(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
4342
|
+
activeFilters.length && onClear ? /* @__PURE__ */ jsx53(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
4343
|
+
resultLabel ? /* @__PURE__ */ jsx53("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
4344
|
+
actions ? /* @__PURE__ */ jsx53("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3998
4345
|
] }) : null
|
|
3999
4346
|
] });
|
|
4000
4347
|
}
|
|
4001
4348
|
|
|
4002
4349
|
// src/components/data/DescriptionList.tsx
|
|
4003
|
-
import { jsx as
|
|
4350
|
+
import { jsx as jsx54, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4004
4351
|
function DescriptionList({
|
|
4005
4352
|
items,
|
|
4006
4353
|
layout = "rows",
|
|
@@ -4009,32 +4356,32 @@ function DescriptionList({
|
|
|
4009
4356
|
style,
|
|
4010
4357
|
...rest
|
|
4011
4358
|
}) {
|
|
4012
|
-
return /* @__PURE__ */
|
|
4359
|
+
return /* @__PURE__ */ jsx54(
|
|
4013
4360
|
"dl",
|
|
4014
4361
|
{
|
|
4015
4362
|
className: cx("pire-dl", className),
|
|
4016
4363
|
"data-layout": layout,
|
|
4017
4364
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
4018
4365
|
...rest,
|
|
4019
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
4020
|
-
/* @__PURE__ */
|
|
4366
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs44("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
4367
|
+
/* @__PURE__ */ jsxs44("dt", { className: "pire-dl-term", children: [
|
|
4021
4368
|
item.label,
|
|
4022
4369
|
item.hint
|
|
4023
4370
|
] }),
|
|
4024
|
-
/* @__PURE__ */
|
|
4371
|
+
/* @__PURE__ */ jsx54("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
4025
4372
|
] }, i))
|
|
4026
4373
|
}
|
|
4027
4374
|
);
|
|
4028
4375
|
}
|
|
4029
4376
|
|
|
4030
4377
|
// src/components/data/Timeline.tsx
|
|
4031
|
-
import { jsx as
|
|
4378
|
+
import { jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4032
4379
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
4033
4380
|
const list = reverse ? [...entries].reverse() : entries;
|
|
4034
|
-
return /* @__PURE__ */
|
|
4035
|
-
/* @__PURE__ */
|
|
4036
|
-
/* @__PURE__ */
|
|
4037
|
-
entry.actor ? /* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsx55("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ jsxs45("li", { className: "pire-timeline-item", children: [
|
|
4382
|
+
/* @__PURE__ */ jsx55("span", { className: "pire-timeline-time", children: entry.time }),
|
|
4383
|
+
/* @__PURE__ */ jsx55("span", { className: "pire-timeline-text", children: entry.event }),
|
|
4384
|
+
entry.actor ? /* @__PURE__ */ jsx55("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
4038
4385
|
] }, entry.id ?? i)) });
|
|
4039
4386
|
}
|
|
4040
4387
|
|
|
@@ -4120,7 +4467,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
4120
4467
|
}
|
|
4121
4468
|
|
|
4122
4469
|
// src/components/data/ChartFrame.tsx
|
|
4123
|
-
import { jsx as
|
|
4470
|
+
import { jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4124
4471
|
function seriesLegend(series) {
|
|
4125
4472
|
return series.map((one, index) => ({
|
|
4126
4473
|
key: one.id,
|
|
@@ -4143,29 +4490,29 @@ function ChartFrame({
|
|
|
4143
4490
|
children
|
|
4144
4491
|
}) {
|
|
4145
4492
|
const msg = usePireMessages();
|
|
4146
|
-
return /* @__PURE__ */
|
|
4147
|
-
title || description ? /* @__PURE__ */
|
|
4148
|
-
title ? /* @__PURE__ */
|
|
4149
|
-
description ? /* @__PURE__ */
|
|
4493
|
+
return /* @__PURE__ */ jsxs46("figure", { className: cx("pire-chart", className), style, children: [
|
|
4494
|
+
title || description ? /* @__PURE__ */ jsxs46("figcaption", { className: "pire-chart-head", children: [
|
|
4495
|
+
title ? /* @__PURE__ */ jsx56("span", { className: "pire-chart-title", children: title }) : null,
|
|
4496
|
+
description ? /* @__PURE__ */ jsx56("span", { className: "pire-chart-desc", children: description }) : null
|
|
4150
4497
|
] }) : null,
|
|
4151
|
-
legend && legend.length > 1 ? /* @__PURE__ */
|
|
4152
|
-
/* @__PURE__ */
|
|
4498
|
+
legend && legend.length > 1 ? /* @__PURE__ */ jsx56("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ jsxs46("li", { className: "pire-chart-legend-item", children: [
|
|
4499
|
+
/* @__PURE__ */ jsx56("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
4153
4500
|
item.label
|
|
4154
4501
|
] }, item.key)) }) : null,
|
|
4155
|
-
/* @__PURE__ */
|
|
4156
|
-
/* @__PURE__ */
|
|
4157
|
-
/* @__PURE__ */
|
|
4158
|
-
/* @__PURE__ */
|
|
4159
|
-
/* @__PURE__ */
|
|
4160
|
-
series.map((one) => /* @__PURE__ */
|
|
4502
|
+
/* @__PURE__ */ jsx56("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
4503
|
+
/* @__PURE__ */ jsx56("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ jsxs46("table", { children: [
|
|
4504
|
+
/* @__PURE__ */ jsx56("caption", { children: label }),
|
|
4505
|
+
/* @__PURE__ */ jsx56("thead", { children: /* @__PURE__ */ jsxs46("tr", { children: [
|
|
4506
|
+
/* @__PURE__ */ jsx56("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
4507
|
+
series.map((one) => /* @__PURE__ */ jsx56("th", { scope: "col", children: one.label }, one.id))
|
|
4161
4508
|
] }) }),
|
|
4162
|
-
/* @__PURE__ */
|
|
4509
|
+
/* @__PURE__ */ jsx56("tbody", { children: categories.map((category, categoryIndex) => (
|
|
4163
4510
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4164
|
-
/* @__PURE__ */
|
|
4165
|
-
/* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ jsxs46("tr", { children: [
|
|
4512
|
+
/* @__PURE__ */ jsx56("th", { scope: "row", children: category }),
|
|
4166
4513
|
series.map((one) => {
|
|
4167
4514
|
const value = one.values[categoryIndex];
|
|
4168
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx56("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
4169
4516
|
})
|
|
4170
4517
|
] }, categoryIndex)
|
|
4171
4518
|
)) })
|
|
@@ -4174,7 +4521,7 @@ function ChartFrame({
|
|
|
4174
4521
|
}
|
|
4175
4522
|
|
|
4176
4523
|
// src/components/data/BarChart.tsx
|
|
4177
|
-
import { jsx as
|
|
4524
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4178
4525
|
function BarChart({
|
|
4179
4526
|
categories,
|
|
4180
4527
|
series: rawSeries,
|
|
@@ -4206,7 +4553,7 @@ function BarChart({
|
|
|
4206
4553
|
const value = series[0].values[categoryIndex];
|
|
4207
4554
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
4208
4555
|
};
|
|
4209
|
-
return /* @__PURE__ */
|
|
4556
|
+
return /* @__PURE__ */ jsx57(
|
|
4210
4557
|
ChartFrame,
|
|
4211
4558
|
{
|
|
4212
4559
|
label,
|
|
@@ -4219,7 +4566,7 @@ function BarChart({
|
|
|
4219
4566
|
showDataTable,
|
|
4220
4567
|
className,
|
|
4221
4568
|
style,
|
|
4222
|
-
children: !hasData ? /* @__PURE__ */
|
|
4569
|
+
children: !hasData ? /* @__PURE__ */ jsx57("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsx57(
|
|
4223
4570
|
"div",
|
|
4224
4571
|
{
|
|
4225
4572
|
className: "pire-chart-bars",
|
|
@@ -4228,12 +4575,12 @@ function BarChart({
|
|
|
4228
4575
|
style: { "--pire-chart-height": `${height}px` },
|
|
4229
4576
|
children: categories.map((category, categoryIndex) => (
|
|
4230
4577
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4231
|
-
/* @__PURE__ */
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
/* @__PURE__ */
|
|
4578
|
+
/* @__PURE__ */ jsxs47("div", { className: "pire-chart-group", children: [
|
|
4579
|
+
/* @__PURE__ */ jsx57("span", { className: "pire-chart-cat", children: category }),
|
|
4580
|
+
/* @__PURE__ */ jsx57("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
4234
4581
|
const value = one.values[categoryIndex];
|
|
4235
4582
|
if (value == null) return null;
|
|
4236
|
-
return /* @__PURE__ */
|
|
4583
|
+
return /* @__PURE__ */ jsxs47(
|
|
4237
4584
|
"div",
|
|
4238
4585
|
{
|
|
4239
4586
|
className: "pire-chart-bar",
|
|
@@ -4242,8 +4589,8 @@ function BarChart({
|
|
|
4242
4589
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
4243
4590
|
},
|
|
4244
4591
|
children: [
|
|
4245
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */
|
|
4246
|
-
/* @__PURE__ */
|
|
4592
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ jsx57("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
4593
|
+
/* @__PURE__ */ jsxs47("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
4247
4594
|
series.length > 1 ? `${one.label}: ` : "",
|
|
4248
4595
|
formatValue(value)
|
|
4249
4596
|
] })
|
|
@@ -4252,7 +4599,7 @@ function BarChart({
|
|
|
4252
4599
|
one.id
|
|
4253
4600
|
);
|
|
4254
4601
|
}) }),
|
|
4255
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */
|
|
4602
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ jsx57("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
4256
4603
|
] }, categoryIndex)
|
|
4257
4604
|
))
|
|
4258
4605
|
}
|
|
@@ -4262,14 +4609,14 @@ function BarChart({
|
|
|
4262
4609
|
}
|
|
4263
4610
|
|
|
4264
4611
|
// src/components/data/LineChart.tsx
|
|
4265
|
-
import * as
|
|
4266
|
-
import { jsx as
|
|
4612
|
+
import * as React28 from "react";
|
|
4613
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4267
4614
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
4268
4615
|
var MARKER_LIMIT = 20;
|
|
4269
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
4616
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React28.useEffect : React28.useLayoutEffect;
|
|
4270
4617
|
function useMeasuredWidth() {
|
|
4271
|
-
const ref =
|
|
4272
|
-
const [width, setWidth] =
|
|
4618
|
+
const ref = React28.useRef(null);
|
|
4619
|
+
const [width, setWidth] = React28.useState(0);
|
|
4273
4620
|
useIsomorphicLayoutEffect2(() => {
|
|
4274
4621
|
const element = ref.current;
|
|
4275
4622
|
if (!element) return;
|
|
@@ -4330,7 +4677,7 @@ function LineChart({
|
|
|
4330
4677
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
4331
4678
|
};
|
|
4332
4679
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
4333
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ jsx58(
|
|
4334
4681
|
ChartFrame,
|
|
4335
4682
|
{
|
|
4336
4683
|
label,
|
|
@@ -4343,8 +4690,8 @@ function LineChart({
|
|
|
4343
4690
|
showDataTable,
|
|
4344
4691
|
className,
|
|
4345
4692
|
style,
|
|
4346
|
-
children: !hasData ? /* @__PURE__ */
|
|
4347
|
-
width > 0 ? /* @__PURE__ */
|
|
4693
|
+
children: !hasData ? /* @__PURE__ */ jsx58("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs48("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
4694
|
+
width > 0 ? /* @__PURE__ */ jsxs48(
|
|
4348
4695
|
"svg",
|
|
4349
4696
|
{
|
|
4350
4697
|
width,
|
|
@@ -4353,7 +4700,7 @@ function LineChart({
|
|
|
4353
4700
|
"aria-hidden": "true",
|
|
4354
4701
|
focusable: "false",
|
|
4355
4702
|
children: [
|
|
4356
|
-
/* @__PURE__ */
|
|
4703
|
+
/* @__PURE__ */ jsx58("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ jsx58(
|
|
4357
4704
|
"line",
|
|
4358
4705
|
{
|
|
4359
4706
|
x1: PLOT_INSET.left,
|
|
@@ -4363,8 +4710,8 @@ function LineChart({
|
|
|
4363
4710
|
},
|
|
4364
4711
|
tick
|
|
4365
4712
|
)) }),
|
|
4366
|
-
/* @__PURE__ */
|
|
4367
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
4713
|
+
/* @__PURE__ */ jsxs48("g", { className: "pire-chart-tick", children: [
|
|
4714
|
+
scale.ticks.map((tick) => /* @__PURE__ */ jsx58(
|
|
4368
4715
|
"text",
|
|
4369
4716
|
{
|
|
4370
4717
|
x: PLOT_INSET.left - 8,
|
|
@@ -4378,11 +4725,11 @@ function LineChart({
|
|
|
4378
4725
|
categories.map(
|
|
4379
4726
|
(category, index) => index % labelEvery === 0 ? (
|
|
4380
4727
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4381
|
-
/* @__PURE__ */
|
|
4728
|
+
/* @__PURE__ */ jsx58("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
4382
4729
|
) : null
|
|
4383
4730
|
)
|
|
4384
4731
|
] }),
|
|
4385
|
-
showArea && series[0] ? /* @__PURE__ */
|
|
4732
|
+
showArea && series[0] ? /* @__PURE__ */ jsx58(
|
|
4386
4733
|
"path",
|
|
4387
4734
|
{
|
|
4388
4735
|
d: areaFor(series[0].values),
|
|
@@ -4390,10 +4737,10 @@ function LineChart({
|
|
|
4390
4737
|
style: { fill: seriesColor(series[0], 0) }
|
|
4391
4738
|
}
|
|
4392
4739
|
) : null,
|
|
4393
|
-
/* @__PURE__ */
|
|
4394
|
-
withMarkers ? /* @__PURE__ */
|
|
4740
|
+
/* @__PURE__ */ jsx58("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ jsx58("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
4741
|
+
withMarkers ? /* @__PURE__ */ jsx58("g", { className: "pire-chart-marker", children: series.map(
|
|
4395
4742
|
(one, seriesIndex) => one.values.map(
|
|
4396
|
-
(value, index) => value == null ? null : /* @__PURE__ */
|
|
4743
|
+
(value, index) => value == null ? null : /* @__PURE__ */ jsx58(
|
|
4397
4744
|
"circle",
|
|
4398
4745
|
{
|
|
4399
4746
|
cx: xAt(index),
|
|
@@ -4408,7 +4755,7 @@ function LineChart({
|
|
|
4408
4755
|
]
|
|
4409
4756
|
}
|
|
4410
4757
|
) : null,
|
|
4411
|
-
/* @__PURE__ */
|
|
4758
|
+
/* @__PURE__ */ jsx58(
|
|
4412
4759
|
"div",
|
|
4413
4760
|
{
|
|
4414
4761
|
className: "pire-chart-hover",
|
|
@@ -4417,11 +4764,11 @@ function LineChart({
|
|
|
4417
4764
|
},
|
|
4418
4765
|
children: categories.map((category, categoryIndex) => (
|
|
4419
4766
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4420
|
-
/* @__PURE__ */
|
|
4421
|
-
/* @__PURE__ */
|
|
4767
|
+
/* @__PURE__ */ jsx58("div", { className: "pire-chart-band", children: /* @__PURE__ */ jsxs48("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
4768
|
+
/* @__PURE__ */ jsx58("strong", { children: category }),
|
|
4422
4769
|
series.map((one) => {
|
|
4423
4770
|
const value = one.values[categoryIndex];
|
|
4424
|
-
return /* @__PURE__ */
|
|
4771
|
+
return /* @__PURE__ */ jsxs48("span", { className: "pire-chart-tip-row", children: [
|
|
4425
4772
|
one.label,
|
|
4426
4773
|
": ",
|
|
4427
4774
|
value == null ? "No data" : formatValue(value)
|
|
@@ -4437,8 +4784,8 @@ function LineChart({
|
|
|
4437
4784
|
}
|
|
4438
4785
|
|
|
4439
4786
|
// src/components/data/DonutChart.tsx
|
|
4440
|
-
import * as
|
|
4441
|
-
import { jsx as
|
|
4787
|
+
import * as React29 from "react";
|
|
4788
|
+
import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4442
4789
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
4443
4790
|
function DonutChart({
|
|
4444
4791
|
categories,
|
|
@@ -4458,7 +4805,7 @@ function DonutChart({
|
|
|
4458
4805
|
}) {
|
|
4459
4806
|
const label = rest["aria-label"];
|
|
4460
4807
|
const msg = usePireMessages();
|
|
4461
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4808
|
+
const [hoveredIndex, setHoveredIndex] = React29.useState(null);
|
|
4462
4809
|
warnOnDonutShape(series, categories.length, label);
|
|
4463
4810
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
4464
4811
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -4475,7 +4822,7 @@ function DonutChart({
|
|
|
4475
4822
|
}));
|
|
4476
4823
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
4477
4824
|
let arcStart = 0;
|
|
4478
|
-
return /* @__PURE__ */
|
|
4825
|
+
return /* @__PURE__ */ jsx59(
|
|
4479
4826
|
ChartFrame,
|
|
4480
4827
|
{
|
|
4481
4828
|
label,
|
|
@@ -4488,8 +4835,8 @@ function DonutChart({
|
|
|
4488
4835
|
showDataTable,
|
|
4489
4836
|
className,
|
|
4490
4837
|
style,
|
|
4491
|
-
children: !hasData ? /* @__PURE__ */
|
|
4492
|
-
/* @__PURE__ */
|
|
4838
|
+
children: !hasData ? /* @__PURE__ */ jsx59("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs49("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
4839
|
+
/* @__PURE__ */ jsx59(
|
|
4493
4840
|
"svg",
|
|
4494
4841
|
{
|
|
4495
4842
|
width: size,
|
|
@@ -4497,13 +4844,13 @@ function DonutChart({
|
|
|
4497
4844
|
"aria-hidden": "true",
|
|
4498
4845
|
focusable: "false",
|
|
4499
4846
|
onMouseLeave: () => setHoveredIndex(null),
|
|
4500
|
-
children: /* @__PURE__ */
|
|
4847
|
+
children: /* @__PURE__ */ jsx59("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
4501
4848
|
const arcLength = segment.value / total * circumference;
|
|
4502
4849
|
const offset = arcStart;
|
|
4503
4850
|
arcStart += arcLength;
|
|
4504
4851
|
return (
|
|
4505
4852
|
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only enhancement inside an aria-hidden plot — the arcs carry nothing the data table does not, so there is nothing here for a keyboard to reach.
|
|
4506
|
-
/* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsx59(
|
|
4507
4854
|
"circle",
|
|
4508
4855
|
{
|
|
4509
4856
|
className: "pire-chart-arc",
|
|
@@ -4523,9 +4870,9 @@ function DonutChart({
|
|
|
4523
4870
|
}) })
|
|
4524
4871
|
}
|
|
4525
4872
|
),
|
|
4526
|
-
/* @__PURE__ */
|
|
4527
|
-
/* @__PURE__ */
|
|
4528
|
-
/* @__PURE__ */
|
|
4873
|
+
/* @__PURE__ */ jsxs49("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4874
|
+
/* @__PURE__ */ jsx59("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4875
|
+
/* @__PURE__ */ jsx59("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
4529
4876
|
] })
|
|
4530
4877
|
] })
|
|
4531
4878
|
}
|
|
@@ -4536,15 +4883,15 @@ function colorForSegment(index) {
|
|
|
4536
4883
|
}
|
|
4537
4884
|
|
|
4538
4885
|
// src/components/data/LinkList.tsx
|
|
4539
|
-
import { Button as
|
|
4540
|
-
import { jsx as
|
|
4886
|
+
import { Button as AriaButton16 } from "react-aria-components";
|
|
4887
|
+
import { jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4541
4888
|
function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
4542
|
-
return /* @__PURE__ */
|
|
4543
|
-
const keySlot = item.key ? /* @__PURE__ */
|
|
4544
|
-
const textSlot = item.text ? /* @__PURE__ */
|
|
4889
|
+
return /* @__PURE__ */ jsx60("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4890
|
+
const keySlot = item.key ? /* @__PURE__ */ jsx60("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4891
|
+
const textSlot = item.text ? /* @__PURE__ */ jsx60("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
4545
4892
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
4546
|
-
return /* @__PURE__ */
|
|
4547
|
-
item.icon ? /* @__PURE__ */
|
|
4893
|
+
return /* @__PURE__ */ jsx60("div", { role: "listitem", className: "pire-linklist-row", children: /* @__PURE__ */ jsxs50(AriaButton16, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
4894
|
+
item.icon ? /* @__PURE__ */ jsx60(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
4548
4895
|
first,
|
|
4549
4896
|
second,
|
|
4550
4897
|
item.trailing
|
|
@@ -4553,7 +4900,7 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
4553
4900
|
}
|
|
4554
4901
|
|
|
4555
4902
|
// src/components/data/RecordCard.tsx
|
|
4556
|
-
import { jsx as
|
|
4903
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4557
4904
|
function RecordCard({
|
|
4558
4905
|
title,
|
|
4559
4906
|
subtitle,
|
|
@@ -4563,27 +4910,27 @@ function RecordCard({
|
|
|
4563
4910
|
className,
|
|
4564
4911
|
...rest
|
|
4565
4912
|
}) {
|
|
4566
|
-
return /* @__PURE__ */
|
|
4913
|
+
return /* @__PURE__ */ jsxs51(
|
|
4567
4914
|
"div",
|
|
4568
4915
|
{
|
|
4569
4916
|
className: cx("pire-recordcard", className),
|
|
4570
4917
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
4571
4918
|
...rest,
|
|
4572
4919
|
children: [
|
|
4573
|
-
icon ? /* @__PURE__ */
|
|
4574
|
-
/* @__PURE__ */
|
|
4575
|
-
/* @__PURE__ */
|
|
4576
|
-
subtitle ? /* @__PURE__ */
|
|
4920
|
+
icon ? /* @__PURE__ */ jsx61("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx61(Icon, { name: icon, size: 20 }) }) : null,
|
|
4921
|
+
/* @__PURE__ */ jsxs51("span", { className: "pire-recordcard-body", children: [
|
|
4922
|
+
/* @__PURE__ */ jsx61("span", { className: "pire-recordcard-title", children: title }),
|
|
4923
|
+
subtitle ? /* @__PURE__ */ jsx61("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4577
4924
|
] }),
|
|
4578
|
-
action ? /* @__PURE__ */
|
|
4925
|
+
action ? /* @__PURE__ */ jsx61("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4579
4926
|
]
|
|
4580
4927
|
}
|
|
4581
4928
|
);
|
|
4582
4929
|
}
|
|
4583
4930
|
|
|
4584
4931
|
// src/components/data/ViewSwitcher.tsx
|
|
4585
|
-
import { Button as
|
|
4586
|
-
import { jsx as
|
|
4932
|
+
import { Button as AriaButton17 } from "react-aria-components";
|
|
4933
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4587
4934
|
function ViewSwitcher({
|
|
4588
4935
|
name,
|
|
4589
4936
|
isDirty,
|
|
@@ -4596,8 +4943,8 @@ function ViewSwitcher({
|
|
|
4596
4943
|
}) {
|
|
4597
4944
|
const msg = usePireMessages();
|
|
4598
4945
|
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4599
|
-
return /* @__PURE__ */
|
|
4600
|
-
|
|
4946
|
+
return /* @__PURE__ */ jsxs52(
|
|
4947
|
+
AriaButton17,
|
|
4601
4948
|
{
|
|
4602
4949
|
className: cx("pire-viewswitcher", className),
|
|
4603
4950
|
style,
|
|
@@ -4605,36 +4952,36 @@ function ViewSwitcher({
|
|
|
4605
4952
|
isDisabled,
|
|
4606
4953
|
onPress,
|
|
4607
4954
|
children: [
|
|
4608
|
-
/* @__PURE__ */
|
|
4609
|
-
/* @__PURE__ */
|
|
4610
|
-
isDirty ? /* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
4955
|
+
/* @__PURE__ */ jsx62(Icon, { name: icon, size: 16 }),
|
|
4956
|
+
/* @__PURE__ */ jsx62("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4957
|
+
isDirty ? /* @__PURE__ */ jsx62("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4958
|
+
/* @__PURE__ */ jsx62(Icon, { name: "chevron-down", size: 16 })
|
|
4612
4959
|
]
|
|
4613
4960
|
}
|
|
4614
4961
|
);
|
|
4615
4962
|
}
|
|
4616
4963
|
|
|
4617
4964
|
// src/components/data/BarList.tsx
|
|
4618
|
-
import { jsx as
|
|
4965
|
+
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4619
4966
|
function BarList({ items, max, className, ...rest }) {
|
|
4620
4967
|
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4621
|
-
return /* @__PURE__ */
|
|
4968
|
+
return /* @__PURE__ */ jsx63("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4622
4969
|
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4623
|
-
return /* @__PURE__ */
|
|
4624
|
-
/* @__PURE__ */
|
|
4625
|
-
/* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4970
|
+
return /* @__PURE__ */ jsxs53("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4971
|
+
/* @__PURE__ */ jsxs53("span", { className: "pire-barlist-main", children: [
|
|
4972
|
+
/* @__PURE__ */ jsx63("span", { className: "pire-barlist-label", children: item.label }),
|
|
4973
|
+
/* @__PURE__ */ jsx63("span", { className: "pire-barlist-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx63("span", { className: "pire-barlist-fill", style: { width: `${pct}%` } }) })
|
|
4627
4974
|
] }),
|
|
4628
|
-
/* @__PURE__ */
|
|
4629
|
-
/* @__PURE__ */
|
|
4630
|
-
item.hint ? /* @__PURE__ */
|
|
4975
|
+
/* @__PURE__ */ jsxs53("span", { className: "pire-barlist-figure", children: [
|
|
4976
|
+
/* @__PURE__ */ jsx63("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4977
|
+
item.hint ? /* @__PURE__ */ jsx63("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4631
4978
|
] })
|
|
4632
4979
|
] }, item.id);
|
|
4633
4980
|
}) });
|
|
4634
4981
|
}
|
|
4635
4982
|
|
|
4636
4983
|
// src/components/layout/PageBand.tsx
|
|
4637
|
-
import { jsx as
|
|
4984
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
4638
4985
|
function PageBand({
|
|
4639
4986
|
surface = "card",
|
|
4640
4987
|
hasBorder = true,
|
|
@@ -4642,7 +4989,7 @@ function PageBand({
|
|
|
4642
4989
|
className,
|
|
4643
4990
|
...rest
|
|
4644
4991
|
}) {
|
|
4645
|
-
return /* @__PURE__ */
|
|
4992
|
+
return /* @__PURE__ */ jsx64(
|
|
4646
4993
|
"div",
|
|
4647
4994
|
{
|
|
4648
4995
|
className: cx("pire-pageband", className),
|
|
@@ -4655,63 +5002,78 @@ function PageBand({
|
|
|
4655
5002
|
}
|
|
4656
5003
|
|
|
4657
5004
|
// src/components/layout/PageHeader.tsx
|
|
4658
|
-
import { jsx as
|
|
5005
|
+
import { jsx as jsx65, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4659
5006
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
4660
|
-
return /* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
/* @__PURE__ */
|
|
4663
|
-
subtitle ? /* @__PURE__ */
|
|
5007
|
+
return /* @__PURE__ */ jsxs54("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
5008
|
+
/* @__PURE__ */ jsxs54("div", { style: { minWidth: 0 }, children: [
|
|
5009
|
+
/* @__PURE__ */ jsx65("h1", { className: "pire-pageheader-title", children: title }),
|
|
5010
|
+
subtitle ? /* @__PURE__ */ jsx65("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
4664
5011
|
] }),
|
|
4665
|
-
actions ? /* @__PURE__ */
|
|
5012
|
+
actions ? /* @__PURE__ */ jsx65("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
4666
5013
|
] });
|
|
4667
5014
|
}
|
|
4668
5015
|
|
|
4669
5016
|
// src/components/layout/SectionHeader.tsx
|
|
4670
|
-
import { jsx as
|
|
5017
|
+
import { jsx as jsx66, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
4671
5018
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
4672
|
-
return /* @__PURE__ */
|
|
4673
|
-
/* @__PURE__ */
|
|
4674
|
-
meta ? /* @__PURE__ */
|
|
4675
|
-
actions ? /* @__PURE__ */
|
|
5019
|
+
return /* @__PURE__ */ jsxs55("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
5020
|
+
/* @__PURE__ */ jsx66("span", { className: "pire-eyebrow", children: title }),
|
|
5021
|
+
meta ? /* @__PURE__ */ jsx66("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
5022
|
+
actions ? /* @__PURE__ */ jsx66("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
4676
5023
|
] });
|
|
4677
5024
|
}
|
|
4678
5025
|
|
|
4679
5026
|
// src/components/layout/SelectionBar.tsx
|
|
4680
|
-
import
|
|
5027
|
+
import * as React30 from "react";
|
|
5028
|
+
import { useLocale as useLocale2 } from "react-aria-components";
|
|
5029
|
+
import { jsx as jsx67, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4681
5030
|
function SelectionBar({
|
|
4682
5031
|
count,
|
|
4683
|
-
noun
|
|
5032
|
+
noun,
|
|
5033
|
+
gender = "masculine",
|
|
5034
|
+
label,
|
|
5035
|
+
onClear,
|
|
5036
|
+
clearLabel,
|
|
4684
5037
|
children,
|
|
4685
5038
|
actions,
|
|
4686
5039
|
className,
|
|
4687
5040
|
...rest
|
|
4688
5041
|
}) {
|
|
5042
|
+
const msg = usePireMessages();
|
|
5043
|
+
const { locale } = useLocale2();
|
|
5044
|
+
const plural = React30.useMemo(() => new Intl.PluralRules(locale), [locale]);
|
|
5045
|
+
const numbers = React30.useMemo(() => new Intl.NumberFormat(locale), [locale]);
|
|
4689
5046
|
if (!count) return null;
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
5047
|
+
const isOne = plural.select(count) === "one";
|
|
5048
|
+
let sentence;
|
|
5049
|
+
if (label) {
|
|
5050
|
+
sentence = label(count);
|
|
5051
|
+
} else {
|
|
5052
|
+
const word = typeof noun === "string" ? `${noun}${count === 1 ? "" : "s"}` : noun ? isOne ? noun.one : noun.other : isOne ? msg.selectionBarNounOne : msg.selectionBarNounOther;
|
|
5053
|
+
const feminine = gender === "feminine";
|
|
5054
|
+
const template = isOne ? feminine ? msg.selectionBarCountOneFeminine : msg.selectionBarCountOne : feminine ? msg.selectionBarCountOtherFeminine : msg.selectionBarCountOther;
|
|
5055
|
+
sentence = template.replace("{count}", numbers.format(count)).replace("{noun}", word);
|
|
5056
|
+
}
|
|
5057
|
+
return /* @__PURE__ */ jsxs56("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
5058
|
+
/* @__PURE__ */ jsx67("span", { className: "pire-selectionbar-count", children: sentence }),
|
|
5059
|
+
onClear ? /* @__PURE__ */ jsx67(Button, { size: "sm", variant: "tertiary", onPress: onClear, children: clearLabel ?? msg.selectionBarClear }) : null,
|
|
5060
|
+
children ? /* @__PURE__ */ jsx67("span", { className: "pire-selectionbar-note", children }) : null,
|
|
5061
|
+
actions ? /* @__PURE__ */ jsx67("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
4700
5062
|
] });
|
|
4701
5063
|
}
|
|
4702
5064
|
|
|
4703
5065
|
// src/components/layout/FooterBar.tsx
|
|
4704
|
-
import { jsx as
|
|
5066
|
+
import { jsx as jsx68, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
4705
5067
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
4706
|
-
return /* @__PURE__ */
|
|
4707
|
-
note ? /* @__PURE__ */
|
|
5068
|
+
return /* @__PURE__ */ jsxs57("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
5069
|
+
note ? /* @__PURE__ */ jsx68("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
4708
5070
|
children,
|
|
4709
|
-
actions ? /* @__PURE__ */
|
|
5071
|
+
actions ? /* @__PURE__ */ jsx68("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
4710
5072
|
] });
|
|
4711
5073
|
}
|
|
4712
5074
|
|
|
4713
5075
|
// src/components/layout/SplitPane.tsx
|
|
4714
|
-
import { jsx as
|
|
5076
|
+
import { jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4715
5077
|
function SplitPane({
|
|
4716
5078
|
list,
|
|
4717
5079
|
detail,
|
|
@@ -4727,7 +5089,7 @@ function SplitPane({
|
|
|
4727
5089
|
}) {
|
|
4728
5090
|
const msg = usePireMessages();
|
|
4729
5091
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
4730
|
-
return /* @__PURE__ */
|
|
5092
|
+
return /* @__PURE__ */ jsxs58(
|
|
4731
5093
|
"div",
|
|
4732
5094
|
{
|
|
4733
5095
|
className: cx("pire-split", className),
|
|
@@ -4735,10 +5097,10 @@ function SplitPane({
|
|
|
4735
5097
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
4736
5098
|
...rest,
|
|
4737
5099
|
children: [
|
|
4738
|
-
/* @__PURE__ */
|
|
4739
|
-
/* @__PURE__ */
|
|
4740
|
-
onBack ? /* @__PURE__ */
|
|
4741
|
-
detail ?? /* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ jsx69("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
5101
|
+
/* @__PURE__ */ jsxs58("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
5102
|
+
onBack ? /* @__PURE__ */ jsx69("div", { className: "pire-split-back", children: /* @__PURE__ */ jsx69(Button, { variant: "tertiary", size: "sm", icon: "arrow-left", onPress: onBack, children: backLabel ?? msg.splitPaneBack }) }) : null,
|
|
5103
|
+
detail ?? /* @__PURE__ */ jsx69("div", { className: "pire-split-empty", children: emptyDetail })
|
|
4742
5104
|
] })
|
|
4743
5105
|
]
|
|
4744
5106
|
}
|
|
@@ -4746,7 +5108,7 @@ function SplitPane({
|
|
|
4746
5108
|
}
|
|
4747
5109
|
|
|
4748
5110
|
// src/components/patterns/ConfirmDialog.tsx
|
|
4749
|
-
import { Fragment as
|
|
5111
|
+
import { Fragment as Fragment10, jsx as jsx70, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4750
5112
|
function ConfirmDialog({
|
|
4751
5113
|
isOpen,
|
|
4752
5114
|
title,
|
|
@@ -4762,7 +5124,7 @@ function ConfirmDialog({
|
|
|
4762
5124
|
onCancel
|
|
4763
5125
|
}) {
|
|
4764
5126
|
const msg = usePireMessages();
|
|
4765
|
-
return /* @__PURE__ */
|
|
5127
|
+
return /* @__PURE__ */ jsxs59(
|
|
4766
5128
|
Dialog,
|
|
4767
5129
|
{
|
|
4768
5130
|
isOpen,
|
|
@@ -4772,9 +5134,9 @@ function ConfirmDialog({
|
|
|
4772
5134
|
onClose: onCancel,
|
|
4773
5135
|
isDismissable: !isBusy,
|
|
4774
5136
|
showClose: false,
|
|
4775
|
-
footer: /* @__PURE__ */
|
|
4776
|
-
/* @__PURE__ */
|
|
4777
|
-
/* @__PURE__ */
|
|
5137
|
+
footer: /* @__PURE__ */ jsxs59(Fragment10, { children: [
|
|
5138
|
+
/* @__PURE__ */ jsx70(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
5139
|
+
/* @__PURE__ */ jsx70(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
4778
5140
|
] }),
|
|
4779
5141
|
children: [
|
|
4780
5142
|
facts?.length ? (
|
|
@@ -4782,9 +5144,9 @@ function ConfirmDialog({
|
|
|
4782
5144
|
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4783
5145
|
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4784
5146
|
// pairs with an explicit role for the same reason.
|
|
4785
|
-
/* @__PURE__ */
|
|
5147
|
+
/* @__PURE__ */ jsx70("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ jsx70(DescriptionList, { layout: "rows", items: facts }) })
|
|
4786
5148
|
) : null,
|
|
4787
|
-
consequence ? /* @__PURE__ */
|
|
5149
|
+
consequence ? /* @__PURE__ */ jsx70(
|
|
4788
5150
|
InlineMessage,
|
|
4789
5151
|
{
|
|
4790
5152
|
kind: tone === "danger" ? "error" : "warning",
|
|
@@ -4799,7 +5161,7 @@ function ConfirmDialog({
|
|
|
4799
5161
|
}
|
|
4800
5162
|
|
|
4801
5163
|
// src/components/patterns/CommandPalette.tsx
|
|
4802
|
-
import * as
|
|
5164
|
+
import * as React31 from "react";
|
|
4803
5165
|
import {
|
|
4804
5166
|
Autocomplete,
|
|
4805
5167
|
ModalOverlay as ModalOverlay2,
|
|
@@ -4812,7 +5174,7 @@ import {
|
|
|
4812
5174
|
Header as Header2,
|
|
4813
5175
|
useFilter
|
|
4814
5176
|
} from "react-aria-components";
|
|
4815
|
-
import { Fragment as
|
|
5177
|
+
import { Fragment as Fragment11, jsx as jsx71, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
4816
5178
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
4817
5179
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4818
5180
|
function CommandPalette({
|
|
@@ -4833,17 +5195,17 @@ function CommandPalette({
|
|
|
4833
5195
|
style
|
|
4834
5196
|
}) {
|
|
4835
5197
|
const msg = usePireMessages();
|
|
4836
|
-
const [query, setQuery] =
|
|
5198
|
+
const [query, setQuery] = React31.useState("");
|
|
4837
5199
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
4838
|
-
|
|
5200
|
+
React31.useEffect(() => {
|
|
4839
5201
|
if (isOpen) setQuery("");
|
|
4840
5202
|
}, [isOpen]);
|
|
4841
|
-
const searchableById =
|
|
5203
|
+
const searchableById = React31.useMemo(() => {
|
|
4842
5204
|
const byId = /* @__PURE__ */ new Map();
|
|
4843
5205
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
4844
5206
|
return byId;
|
|
4845
5207
|
}, [groups]);
|
|
4846
|
-
const filter =
|
|
5208
|
+
const filter = React31.useCallback(
|
|
4847
5209
|
(textValue, inputValue, node) => {
|
|
4848
5210
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
4849
5211
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
@@ -4856,7 +5218,7 @@ function CommandPalette({
|
|
|
4856
5218
|
};
|
|
4857
5219
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
4858
5220
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
4859
|
-
return /* @__PURE__ */
|
|
5221
|
+
return /* @__PURE__ */ jsx71(
|
|
4860
5222
|
ModalOverlay2,
|
|
4861
5223
|
{
|
|
4862
5224
|
className: "pire-cp-overlay",
|
|
@@ -4865,11 +5227,11 @@ function CommandPalette({
|
|
|
4865
5227
|
onOpenChange: (open) => {
|
|
4866
5228
|
if (!open) onOpenChange?.(false);
|
|
4867
5229
|
},
|
|
4868
|
-
children: /* @__PURE__ */
|
|
4869
|
-
/* @__PURE__ */
|
|
4870
|
-
/* @__PURE__ */
|
|
4871
|
-
/* @__PURE__ */
|
|
4872
|
-
/* @__PURE__ */
|
|
5230
|
+
children: /* @__PURE__ */ jsx71(Modal2, { className: cx("pire-cp-modal", className), style, children: /* @__PURE__ */ jsxs60(AriaDialog4, { className: "pire-cp-dialog", "aria-label": ariaLabel ?? msg.commandPaletteLabel, children: [
|
|
5231
|
+
/* @__PURE__ */ jsxs60(Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
5232
|
+
/* @__PURE__ */ jsxs60(SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
5233
|
+
/* @__PURE__ */ jsx71(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
5234
|
+
/* @__PURE__ */ jsx71(
|
|
4873
5235
|
AriaInput5,
|
|
4874
5236
|
{
|
|
4875
5237
|
className: "pire-cp-input",
|
|
@@ -4878,16 +5240,16 @@ function CommandPalette({
|
|
|
4878
5240
|
}
|
|
4879
5241
|
)
|
|
4880
5242
|
] }),
|
|
4881
|
-
isLoading ? /* @__PURE__ */
|
|
4882
|
-
/* @__PURE__ */
|
|
5243
|
+
isLoading ? /* @__PURE__ */ jsx71("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
5244
|
+
/* @__PURE__ */ jsx71(
|
|
4883
5245
|
AriaMenu2,
|
|
4884
5246
|
{
|
|
4885
5247
|
className: "pire-cp-list",
|
|
4886
5248
|
onAction: (key) => onAction?.(String(key)),
|
|
4887
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
4888
|
-
children: sections.map((section) => /* @__PURE__ */
|
|
4889
|
-
section.label ? /* @__PURE__ */
|
|
4890
|
-
section.items.map((item) => /* @__PURE__ */
|
|
5249
|
+
renderEmptyState: () => /* @__PURE__ */ jsx71("div", { className: "pire-cp-status", children: status }),
|
|
5250
|
+
children: sections.map((section) => /* @__PURE__ */ jsxs60(AriaMenuSection2, { id: section.id, className: "pire-cp-section", children: [
|
|
5251
|
+
section.label ? /* @__PURE__ */ jsx71(Header2, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
5252
|
+
section.items.map((item) => /* @__PURE__ */ jsx71(
|
|
4891
5253
|
MenuItem,
|
|
4892
5254
|
{
|
|
4893
5255
|
id: item.id,
|
|
@@ -4908,18 +5270,18 @@ function CommandPalette({
|
|
|
4908
5270
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
4909
5271
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
4910
5272
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
4911
|
-
/* @__PURE__ */
|
|
4912
|
-
/* @__PURE__ */
|
|
4913
|
-
/* @__PURE__ */
|
|
4914
|
-
/* @__PURE__ */
|
|
5273
|
+
/* @__PURE__ */ jsx71("div", { className: "pire-cp-foot", "aria-hidden": "true", children: footer ?? /* @__PURE__ */ jsxs60(Fragment11, { children: [
|
|
5274
|
+
/* @__PURE__ */ jsxs60("span", { className: "pire-cp-hint", children: [
|
|
5275
|
+
/* @__PURE__ */ jsx71(Kbd, { children: "\u2191" }),
|
|
5276
|
+
/* @__PURE__ */ jsx71(Kbd, { children: "\u2193" }),
|
|
4915
5277
|
msg.commandPaletteHintNavigate
|
|
4916
5278
|
] }),
|
|
4917
|
-
/* @__PURE__ */
|
|
4918
|
-
/* @__PURE__ */
|
|
5279
|
+
/* @__PURE__ */ jsxs60("span", { className: "pire-cp-hint", children: [
|
|
5280
|
+
/* @__PURE__ */ jsx71(Kbd, { children: "\u21B5" }),
|
|
4919
5281
|
msg.commandPaletteHintSelect
|
|
4920
5282
|
] }),
|
|
4921
|
-
/* @__PURE__ */
|
|
4922
|
-
/* @__PURE__ */
|
|
5283
|
+
/* @__PURE__ */ jsxs60("span", { className: "pire-cp-hint", children: [
|
|
5284
|
+
/* @__PURE__ */ jsx71(Kbd, { children: "esc" }),
|
|
4923
5285
|
msg.commandPaletteHintClose
|
|
4924
5286
|
] })
|
|
4925
5287
|
] }) })
|
|
@@ -4929,9 +5291,9 @@ function CommandPalette({
|
|
|
4929
5291
|
);
|
|
4930
5292
|
}
|
|
4931
5293
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
4932
|
-
const handler =
|
|
5294
|
+
const handler = React31.useRef(onTrigger);
|
|
4933
5295
|
handler.current = onTrigger;
|
|
4934
|
-
|
|
5296
|
+
React31.useEffect(() => {
|
|
4935
5297
|
if (isDisabled) return;
|
|
4936
5298
|
const onKeyDown = (event) => {
|
|
4937
5299
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -4945,15 +5307,15 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
4945
5307
|
}
|
|
4946
5308
|
|
|
4947
5309
|
// src/components/patterns/AppLauncher.tsx
|
|
4948
|
-
import * as
|
|
5310
|
+
import * as React32 from "react";
|
|
4949
5311
|
import {
|
|
4950
5312
|
DialogTrigger,
|
|
4951
|
-
Button as
|
|
4952
|
-
Popover as
|
|
5313
|
+
Button as AriaButton18,
|
|
5314
|
+
Popover as Popover9,
|
|
4953
5315
|
Dialog as AriaDialog5,
|
|
4954
5316
|
useFilter as useFilter2
|
|
4955
5317
|
} from "react-aria-components";
|
|
4956
|
-
import { Fragment as
|
|
5318
|
+
import { Fragment as Fragment12, jsx as jsx72, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
4957
5319
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4958
5320
|
function AppLauncher({
|
|
4959
5321
|
sections,
|
|
@@ -4972,13 +5334,13 @@ function AppLauncher({
|
|
|
4972
5334
|
className
|
|
4973
5335
|
}) {
|
|
4974
5336
|
const msg = usePireMessages();
|
|
4975
|
-
const [query, setQuery] =
|
|
5337
|
+
const [query, setQuery] = React32.useState("");
|
|
4976
5338
|
const { contains } = useFilter2({ sensitivity: "base" });
|
|
4977
5339
|
const handleSearch = (next) => {
|
|
4978
5340
|
setQuery(next);
|
|
4979
5341
|
onSearchChange?.(next);
|
|
4980
5342
|
};
|
|
4981
|
-
const visible =
|
|
5343
|
+
const visible = React32.useMemo(() => {
|
|
4982
5344
|
if (isFilteredExternally) return sections;
|
|
4983
5345
|
const q = query.trim();
|
|
4984
5346
|
if (!q) return sections;
|
|
@@ -4989,25 +5351,25 @@ function AppLauncher({
|
|
|
4989
5351
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4990
5352
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4991
5353
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4992
|
-
return /* @__PURE__ */
|
|
4993
|
-
/* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
4995
|
-
|
|
5354
|
+
return /* @__PURE__ */ jsxs61(DialogTrigger, { children: [
|
|
5355
|
+
/* @__PURE__ */ jsx72(AriaButton18, { className: "pire-launcher-trigger", "aria-label": label, children: /* @__PURE__ */ jsx72(Icon, { name: icon, size: 20 }) }),
|
|
5356
|
+
/* @__PURE__ */ jsx72(
|
|
5357
|
+
Popover9,
|
|
4996
5358
|
{
|
|
4997
5359
|
className: cx("pire-launcher-popover", className),
|
|
4998
5360
|
placement: "bottom start",
|
|
4999
5361
|
offset: 0,
|
|
5000
5362
|
crossOffset: 0,
|
|
5001
5363
|
containerPadding: 0,
|
|
5002
|
-
children: /* @__PURE__ */
|
|
5003
|
-
/* @__PURE__ */
|
|
5004
|
-
/* @__PURE__ */
|
|
5005
|
-
meta ? /* @__PURE__ */
|
|
5364
|
+
children: /* @__PURE__ */ jsx72(AriaDialog5, { className: "pire-launcher", "aria-label": label, children: ({ close }) => /* @__PURE__ */ jsxs61(Fragment12, { children: [
|
|
5365
|
+
/* @__PURE__ */ jsxs61("div", { className: "pire-launcher-head", children: [
|
|
5366
|
+
/* @__PURE__ */ jsx72("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
5367
|
+
meta ? /* @__PURE__ */ jsx72("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
5006
5368
|
] }),
|
|
5007
5369
|
isSearchable ? (
|
|
5008
5370
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
5009
5371
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
5010
|
-
/* @__PURE__ */
|
|
5372
|
+
/* @__PURE__ */ jsx72(
|
|
5011
5373
|
Input,
|
|
5012
5374
|
{
|
|
5013
5375
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -5021,18 +5383,18 @@ function AppLauncher({
|
|
|
5021
5383
|
}
|
|
5022
5384
|
)
|
|
5023
5385
|
) : null,
|
|
5024
|
-
isLoading ? /* @__PURE__ */
|
|
5025
|
-
isEmpty ? /* @__PURE__ */
|
|
5386
|
+
isLoading ? /* @__PURE__ */ jsx72("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
5387
|
+
isEmpty ? /* @__PURE__ */ jsx72("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
5026
5388
|
visible.map((section, si) => (
|
|
5027
5389
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
5028
5390
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
5029
|
-
/* @__PURE__ */
|
|
5030
|
-
section.label ? /* @__PURE__ */
|
|
5031
|
-
/* @__PURE__ */
|
|
5391
|
+
/* @__PURE__ */ jsxs61("div", { className: "pire-launcher-section", children: [
|
|
5392
|
+
section.label ? /* @__PURE__ */ jsx72("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
5393
|
+
/* @__PURE__ */ jsx72("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
5032
5394
|
const isCurrent = item.id === value;
|
|
5033
5395
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
5034
|
-
return /* @__PURE__ */
|
|
5035
|
-
|
|
5396
|
+
return /* @__PURE__ */ jsxs61(
|
|
5397
|
+
AriaButton18,
|
|
5036
5398
|
{
|
|
5037
5399
|
className: "pire-launcher-item",
|
|
5038
5400
|
"data-selected": isCurrent ? "true" : void 0,
|
|
@@ -5042,16 +5404,16 @@ function AppLauncher({
|
|
|
5042
5404
|
onAction?.(item.id);
|
|
5043
5405
|
},
|
|
5044
5406
|
children: [
|
|
5045
|
-
item.icon ? /* @__PURE__ */
|
|
5407
|
+
item.icon ? /* @__PURE__ */ jsx72("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ jsx72(
|
|
5046
5408
|
Icon,
|
|
5047
5409
|
{
|
|
5048
5410
|
name: item.icon,
|
|
5049
5411
|
size: (section.variant ?? "tile") === "tile" ? 20 : 16
|
|
5050
5412
|
}
|
|
5051
5413
|
) }) : null,
|
|
5052
|
-
/* @__PURE__ */
|
|
5053
|
-
/* @__PURE__ */
|
|
5054
|
-
showsDescription ? /* @__PURE__ */
|
|
5414
|
+
/* @__PURE__ */ jsxs61("span", { className: "pire-launcher-item-text", children: [
|
|
5415
|
+
/* @__PURE__ */ jsx72("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
5416
|
+
showsDescription ? /* @__PURE__ */ jsx72("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
5055
5417
|
] })
|
|
5056
5418
|
]
|
|
5057
5419
|
},
|
|
@@ -5067,20 +5429,70 @@ function AppLauncher({
|
|
|
5067
5429
|
}
|
|
5068
5430
|
|
|
5069
5431
|
// src/components/patterns/SidePanel.tsx
|
|
5432
|
+
import * as React33 from "react";
|
|
5070
5433
|
import { ModalOverlay as ModalOverlay3, Modal as Modal3, Dialog as AriaDialog6, Heading as Heading5 } from "react-aria-components";
|
|
5071
|
-
import { jsx as
|
|
5434
|
+
import { jsx as jsx73, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
5435
|
+
var PHONE_MAX_WIDTH = 600;
|
|
5436
|
+
var narrowQuery = `(max-width: ${PHONE_MAX_WIDTH}px)`;
|
|
5437
|
+
var subscribeNarrow = (notify) => {
|
|
5438
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
5439
|
+
};
|
|
5440
|
+
const query = window.matchMedia(narrowQuery);
|
|
5441
|
+
query.addEventListener("change", notify);
|
|
5442
|
+
return () => query.removeEventListener("change", notify);
|
|
5443
|
+
};
|
|
5444
|
+
var isNarrow = () => typeof window !== "undefined" && !!window.matchMedia && window.matchMedia(narrowQuery).matches;
|
|
5072
5445
|
function SidePanel({
|
|
5073
5446
|
isOpen,
|
|
5074
5447
|
title,
|
|
5075
5448
|
subtitle,
|
|
5076
5449
|
width = 400,
|
|
5450
|
+
presentation = "modal",
|
|
5077
5451
|
children,
|
|
5078
5452
|
footer,
|
|
5079
5453
|
onClose,
|
|
5080
5454
|
className
|
|
5081
5455
|
}) {
|
|
5082
5456
|
const msg = usePireMessages();
|
|
5083
|
-
|
|
5457
|
+
const titleId = React33.useId();
|
|
5458
|
+
const narrow = React33.useSyncExternalStore(subscribeNarrow, isNarrow, () => false);
|
|
5459
|
+
const head = (heading) => /* @__PURE__ */ jsxs62("header", { className: "pire-dialog-head", children: [
|
|
5460
|
+
/* @__PURE__ */ jsxs62("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
5461
|
+
heading,
|
|
5462
|
+
subtitle ? /* @__PURE__ */ jsx73("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
5463
|
+
] }),
|
|
5464
|
+
/* @__PURE__ */ jsx73(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
5465
|
+
] });
|
|
5466
|
+
if (presentation === "docked" && !narrow) {
|
|
5467
|
+
if (!isOpen) return null;
|
|
5468
|
+
return (
|
|
5469
|
+
// A named `section` (role `region`) rather than the `aside` the shape suggests: `aside` is a
|
|
5470
|
+
// complementary landmark, which must sit at the top level of the page, and a docked editor
|
|
5471
|
+
// lives inside the app's `main` by definition.
|
|
5472
|
+
/* @__PURE__ */ jsxs62(
|
|
5473
|
+
"section",
|
|
5474
|
+
{
|
|
5475
|
+
className: cx("pire-sidepanel", className),
|
|
5476
|
+
"data-presentation": "docked",
|
|
5477
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
5478
|
+
style: { width },
|
|
5479
|
+
onKeyDown: (e) => {
|
|
5480
|
+
if (e.key !== "Escape" || e.defaultPrevented || e.nativeEvent.isComposing) return;
|
|
5481
|
+
e.preventDefault();
|
|
5482
|
+
onClose?.();
|
|
5483
|
+
},
|
|
5484
|
+
children: [
|
|
5485
|
+
head(
|
|
5486
|
+
/* @__PURE__ */ jsx73("h2", { id: titleId, className: "pire-dialog-title", children: title })
|
|
5487
|
+
),
|
|
5488
|
+
/* @__PURE__ */ jsx73("div", { className: "pire-dialog-body", children }),
|
|
5489
|
+
footer ? /* @__PURE__ */ jsx73("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
5490
|
+
]
|
|
5491
|
+
}
|
|
5492
|
+
)
|
|
5493
|
+
);
|
|
5494
|
+
}
|
|
5495
|
+
return /* @__PURE__ */ jsx73(
|
|
5084
5496
|
ModalOverlay3,
|
|
5085
5497
|
{
|
|
5086
5498
|
className: "pire-sidepanel-overlay",
|
|
@@ -5089,23 +5501,19 @@ function SidePanel({
|
|
|
5089
5501
|
onOpenChange: (o) => {
|
|
5090
5502
|
if (!o) onClose?.();
|
|
5091
5503
|
},
|
|
5092
|
-
children: /* @__PURE__ */
|
|
5093
|
-
|
|
5094
|
-
/* @__PURE__ */
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
/* @__PURE__ */ jsx72(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
5099
|
-
] }),
|
|
5100
|
-
/* @__PURE__ */ jsx72("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
5101
|
-
footer ? /* @__PURE__ */ jsx72("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
5504
|
+
children: /* @__PURE__ */ jsx73(Modal3, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ jsxs62(AriaDialog6, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
5505
|
+
head(
|
|
5506
|
+
/* @__PURE__ */ jsx73(Heading5, { slot: "title", className: "pire-dialog-title", children: title })
|
|
5507
|
+
),
|
|
5508
|
+
/* @__PURE__ */ jsx73("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
5509
|
+
footer ? /* @__PURE__ */ jsx73("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
5102
5510
|
] }) })
|
|
5103
5511
|
}
|
|
5104
5512
|
);
|
|
5105
5513
|
}
|
|
5106
5514
|
|
|
5107
5515
|
// src/components/patterns/EmptyState.tsx
|
|
5108
|
-
import { jsx as
|
|
5516
|
+
import { jsx as jsx74, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
5109
5517
|
function EmptyState({
|
|
5110
5518
|
icon = "file-text",
|
|
5111
5519
|
title,
|
|
@@ -5115,18 +5523,18 @@ function EmptyState({
|
|
|
5115
5523
|
className,
|
|
5116
5524
|
...rest
|
|
5117
5525
|
}) {
|
|
5118
|
-
return /* @__PURE__ */
|
|
5119
|
-
/* @__PURE__ */
|
|
5120
|
-
title ? /* @__PURE__ */
|
|
5121
|
-
children ? /* @__PURE__ */
|
|
5526
|
+
return /* @__PURE__ */ jsxs63("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
5527
|
+
/* @__PURE__ */ jsx74(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
5528
|
+
title ? /* @__PURE__ */ jsx74("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
5529
|
+
children ? /* @__PURE__ */ jsx74("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
5122
5530
|
action
|
|
5123
5531
|
] });
|
|
5124
5532
|
}
|
|
5125
5533
|
|
|
5126
5534
|
// src/components/patterns/NumPad.tsx
|
|
5127
|
-
import * as
|
|
5128
|
-
import { useLocale as
|
|
5129
|
-
import { jsx as
|
|
5535
|
+
import * as React34 from "react";
|
|
5536
|
+
import { useLocale as useLocale3 } from "react-aria-components";
|
|
5537
|
+
import { jsx as jsx75, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
5130
5538
|
var BASE_KEYS = [
|
|
5131
5539
|
{ value: "7" },
|
|
5132
5540
|
{ value: "8" },
|
|
@@ -5149,9 +5557,9 @@ function fittingDigits(digits, buffer, separator, maxFractionDigits) {
|
|
|
5149
5557
|
return room <= 0 ? "" : digits.slice(0, room);
|
|
5150
5558
|
}
|
|
5151
5559
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
5152
|
-
const handler =
|
|
5560
|
+
const handler = React34.useRef(onKey);
|
|
5153
5561
|
handler.current = onKey;
|
|
5154
|
-
|
|
5562
|
+
React34.useEffect(() => {
|
|
5155
5563
|
if (isDisabled) return;
|
|
5156
5564
|
const isEditingElsewhere = () => {
|
|
5157
5565
|
const el = document.activeElement;
|
|
@@ -5198,11 +5606,11 @@ function NumPad({
|
|
|
5198
5606
|
style
|
|
5199
5607
|
}) {
|
|
5200
5608
|
const msg = usePireMessages();
|
|
5201
|
-
const containerRef =
|
|
5202
|
-
const { locale } =
|
|
5609
|
+
const containerRef = React34.useRef(null);
|
|
5610
|
+
const { locale } = useLocale3();
|
|
5203
5611
|
const separator = decimalSeparatorFor(locale);
|
|
5204
5612
|
const allowsDecimal = maxFractionDigits !== void 0 && maxFractionDigits > 0;
|
|
5205
|
-
const applyKey =
|
|
5613
|
+
const applyKey = React34.useCallback(
|
|
5206
5614
|
(key) => {
|
|
5207
5615
|
if (isDisabled) return;
|
|
5208
5616
|
if (key.value === "backspace") {
|
|
@@ -5234,7 +5642,7 @@ function NumPad({
|
|
|
5234
5642
|
...allowsDecimal ? [{ value: "decimal", label: separator }] : [],
|
|
5235
5643
|
...extraKeys
|
|
5236
5644
|
];
|
|
5237
|
-
return /* @__PURE__ */
|
|
5645
|
+
return /* @__PURE__ */ jsxs64(
|
|
5238
5646
|
"div",
|
|
5239
5647
|
{
|
|
5240
5648
|
ref: containerRef,
|
|
@@ -5243,10 +5651,10 @@ function NumPad({
|
|
|
5243
5651
|
"data-size": size,
|
|
5244
5652
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
5245
5653
|
children: [
|
|
5246
|
-
target !== void 0 ? /* @__PURE__ */
|
|
5247
|
-
/* @__PURE__ */
|
|
5654
|
+
target !== void 0 ? /* @__PURE__ */ jsx75("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
5655
|
+
/* @__PURE__ */ jsx75("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
5248
5656
|
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : key.value === "decimal" ? msg.numPadDecimal : void 0;
|
|
5249
|
-
return /* @__PURE__ */
|
|
5657
|
+
return /* @__PURE__ */ jsx75(
|
|
5250
5658
|
Button,
|
|
5251
5659
|
{
|
|
5252
5660
|
variant: "secondary",
|
|
@@ -5269,9 +5677,9 @@ function NumPad({
|
|
|
5269
5677
|
}
|
|
5270
5678
|
|
|
5271
5679
|
// src/components/patterns/FileDropZone.tsx
|
|
5272
|
-
import * as
|
|
5680
|
+
import * as React35 from "react";
|
|
5273
5681
|
import { DropZone, FileTrigger as FileTrigger2, isFileDropItem } from "react-aria-components";
|
|
5274
|
-
import { jsx as
|
|
5682
|
+
import { jsx as jsx76, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
5275
5683
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
5276
5684
|
function FileDropZone({
|
|
5277
5685
|
label,
|
|
@@ -5299,10 +5707,10 @@ function FileDropZone({
|
|
|
5299
5707
|
...rest
|
|
5300
5708
|
}) {
|
|
5301
5709
|
const msg = usePireMessages();
|
|
5302
|
-
const [uncontrolled, setUncontrolled] =
|
|
5710
|
+
const [uncontrolled, setUncontrolled] = React35.useState(defaultValue ?? []);
|
|
5303
5711
|
const files = value ?? uncontrolled;
|
|
5304
|
-
const created =
|
|
5305
|
-
|
|
5712
|
+
const created = React35.useRef([]);
|
|
5713
|
+
React35.useEffect(
|
|
5306
5714
|
() => () => {
|
|
5307
5715
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
5308
5716
|
},
|
|
@@ -5325,12 +5733,12 @@ function FileDropZone({
|
|
|
5325
5733
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
5326
5734
|
};
|
|
5327
5735
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
5328
|
-
return /* @__PURE__ */
|
|
5329
|
-
label ? /* @__PURE__ */
|
|
5736
|
+
return /* @__PURE__ */ jsxs65("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
5737
|
+
label ? /* @__PURE__ */ jsxs65("span", { className: "pire-field-label", children: [
|
|
5330
5738
|
label,
|
|
5331
|
-
isRequired ? /* @__PURE__ */
|
|
5739
|
+
isRequired ? /* @__PURE__ */ jsx76("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
5332
5740
|
] }) : null,
|
|
5333
|
-
/* @__PURE__ */
|
|
5741
|
+
/* @__PURE__ */ jsxs65(
|
|
5334
5742
|
DropZone,
|
|
5335
5743
|
{
|
|
5336
5744
|
className: "pire-dropzone",
|
|
@@ -5342,25 +5750,25 @@ function FileDropZone({
|
|
|
5342
5750
|
accept(dropped);
|
|
5343
5751
|
},
|
|
5344
5752
|
children: [
|
|
5345
|
-
/* @__PURE__ */
|
|
5346
|
-
/* @__PURE__ */
|
|
5347
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ jsx76(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
5754
|
+
/* @__PURE__ */ jsx76("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
5755
|
+
/* @__PURE__ */ jsx76(
|
|
5348
5756
|
FileTrigger2,
|
|
5349
5757
|
{
|
|
5350
5758
|
acceptedFileTypes,
|
|
5351
5759
|
allowsMultiple,
|
|
5352
5760
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
5353
|
-
children: /* @__PURE__ */
|
|
5761
|
+
children: /* @__PURE__ */ jsx76(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
5354
5762
|
}
|
|
5355
5763
|
)
|
|
5356
5764
|
]
|
|
5357
5765
|
}
|
|
5358
5766
|
),
|
|
5359
|
-
files.length ? /* @__PURE__ */
|
|
5360
|
-
previewUrl ? /* @__PURE__ */
|
|
5361
|
-
/* @__PURE__ */
|
|
5362
|
-
/* @__PURE__ */
|
|
5363
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
5767
|
+
files.length ? /* @__PURE__ */ jsx76("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs65("li", { className: "pire-fileupload-item", children: [
|
|
5768
|
+
previewUrl ? /* @__PURE__ */ jsx76("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx76(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
5769
|
+
/* @__PURE__ */ jsx76("span", { className: "pire-fileupload-name", children: file.name }),
|
|
5770
|
+
/* @__PURE__ */ jsx76("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
5771
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx76(
|
|
5364
5772
|
IconButton,
|
|
5365
5773
|
{
|
|
5366
5774
|
icon: "x",
|
|
@@ -5370,18 +5778,18 @@ function FileDropZone({
|
|
|
5370
5778
|
}
|
|
5371
5779
|
)
|
|
5372
5780
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
5373
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
5374
|
-
description ? /* @__PURE__ */
|
|
5375
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
5781
|
+
uploadProgress != null ? /* @__PURE__ */ jsx76(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
5782
|
+
description ? /* @__PURE__ */ jsx76("span", { className: "pire-field-hint", children: description }) : null,
|
|
5783
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx76("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
5376
5784
|
] });
|
|
5377
5785
|
}
|
|
5378
5786
|
|
|
5379
5787
|
// src/index.ts
|
|
5380
5788
|
import {
|
|
5381
5789
|
DialogTrigger as DialogTrigger2,
|
|
5382
|
-
MenuTrigger as
|
|
5790
|
+
MenuTrigger as MenuTrigger4,
|
|
5383
5791
|
SubmenuTrigger,
|
|
5384
|
-
Popover as
|
|
5792
|
+
Popover as Popover10,
|
|
5385
5793
|
RouterProvider,
|
|
5386
5794
|
I18nProvider
|
|
5387
5795
|
} from "react-aria-components";
|
|
@@ -5435,7 +5843,7 @@ export {
|
|
|
5435
5843
|
MenuItem,
|
|
5436
5844
|
MenuSection,
|
|
5437
5845
|
MenuSeparator,
|
|
5438
|
-
|
|
5846
|
+
MenuTrigger4 as MenuTrigger,
|
|
5439
5847
|
MultiComboBox,
|
|
5440
5848
|
NumPad,
|
|
5441
5849
|
NumberField,
|
|
@@ -5444,7 +5852,7 @@ export {
|
|
|
5444
5852
|
PageHeader,
|
|
5445
5853
|
Pagination,
|
|
5446
5854
|
PireIntlProvider,
|
|
5447
|
-
|
|
5855
|
+
Popover10 as Popover,
|
|
5448
5856
|
ProgressBar,
|
|
5449
5857
|
QuantityStepper,
|
|
5450
5858
|
Radio,
|