@orianatech/pire 1.2.0 → 1.4.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/Tag.d.ts.map +1 -1
- package/dist/components/core/icon-data.generated.d.ts.map +1 -1
- package/dist/components/core/icon-map.d.ts.map +1 -1
- package/dist/components/data/BarList.d.cts +30 -0
- package/dist/components/data/BarList.d.ts +31 -0
- package/dist/components/data/BarList.d.ts.map +1 -0
- package/dist/components/data/DataTable.d.cts +45 -3
- package/dist/components/data/DataTable.d.ts +45 -3
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/data/RecordCard.d.cts +28 -0
- package/dist/components/data/RecordCard.d.ts +29 -0
- package/dist/components/data/RecordCard.d.ts.map +1 -0
- package/dist/components/data/ViewSwitcher.d.cts +32 -0
- package/dist/components/data/ViewSwitcher.d.ts +33 -0
- package/dist/components/data/ViewSwitcher.d.ts.map +1 -0
- package/dist/components/feedback/Tooltip.d.cts +18 -0
- package/dist/components/feedback/Tooltip.d.ts +18 -0
- package/dist/components/feedback/Tooltip.d.ts.map +1 -1
- package/dist/components/forms/ChoiceCardGroup.d.cts +50 -0
- package/dist/components/forms/ChoiceCardGroup.d.ts +51 -0
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +1 -0
- package/dist/components/forms/NumberField.d.cts +18 -1
- package/dist/components/forms/NumberField.d.ts +18 -1
- package/dist/components/forms/NumberField.d.ts.map +1 -1
- package/dist/components/forms/QuantityStepper.d.cts +28 -0
- package/dist/components/forms/QuantityStepper.d.ts +29 -0
- package/dist/components/forms/QuantityStepper.d.ts.map +1 -0
- package/dist/components/navigation/Ribbon.d.cts +75 -0
- package/dist/components/navigation/Ribbon.d.ts +76 -0
- package/dist/components/navigation/Ribbon.d.ts.map +1 -0
- package/dist/components/patterns/ConfirmDialog.d.cts +8 -1
- package/dist/components/patterns/ConfirmDialog.d.ts +8 -1
- package/dist/components/patterns/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/patterns/NumPad.d.cts +60 -0
- package/dist/components/patterns/NumPad.d.ts +61 -0
- package/dist/components/patterns/NumPad.d.ts.map +1 -0
- package/dist/components/patterns/ValueHelpDialog.d.cts +23 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts +23 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts.map +1 -1
- package/dist/components.css +221 -0
- package/dist/i18n/messages.d.cts +48 -0
- package/dist/i18n/messages.d.ts +48 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +1437 -831
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1359 -760
- package/dist/index.js.map +1 -1
- package/dist/tokens/colors.css +7 -0
- package/dist/tokens/themes.css +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,10 +34,12 @@ __export(src_exports, {
|
|
|
34
34
|
Avatar: () => Avatar,
|
|
35
35
|
Badge: () => Badge,
|
|
36
36
|
BarChart: () => BarChart,
|
|
37
|
+
BarList: () => BarList,
|
|
37
38
|
Breadcrumb: () => Breadcrumb,
|
|
38
39
|
Button: () => Button,
|
|
39
40
|
Card: () => Card,
|
|
40
41
|
Checkbox: () => Checkbox,
|
|
42
|
+
ChoiceCardGroup: () => ChoiceCardGroup,
|
|
41
43
|
ComboBox: () => ComboBox,
|
|
42
44
|
CommandPalette: () => CommandPalette,
|
|
43
45
|
ConfirmDialog: () => ConfirmDialog,
|
|
@@ -50,17 +52,17 @@ __export(src_exports, {
|
|
|
50
52
|
DialogBody: () => DialogBody,
|
|
51
53
|
DialogDescription: () => DialogDescription,
|
|
52
54
|
DialogTitle: () => DialogTitle,
|
|
53
|
-
DialogTrigger: () =>
|
|
55
|
+
DialogTrigger: () => import_react_aria_components39.DialogTrigger,
|
|
54
56
|
DonutChart: () => DonutChart,
|
|
55
57
|
EmptyState: () => EmptyState,
|
|
56
58
|
FileDropZone: () => FileDropZone,
|
|
57
59
|
FileUpload: () => FileUpload,
|
|
58
60
|
FilterBar: () => FilterBar,
|
|
59
|
-
Focusable: () =>
|
|
61
|
+
Focusable: () => import_react_aria_components40.Focusable,
|
|
60
62
|
FooterBar: () => FooterBar,
|
|
61
63
|
FormField: () => FormField,
|
|
62
64
|
Heading: () => Heading,
|
|
63
|
-
I18nProvider: () =>
|
|
65
|
+
I18nProvider: () => import_react_aria_components39.I18nProvider,
|
|
64
66
|
ICON_NAMES: () => ICON_NAMES,
|
|
65
67
|
Icon: () => Icon,
|
|
66
68
|
IconButton: () => IconButton,
|
|
@@ -75,19 +77,23 @@ __export(src_exports, {
|
|
|
75
77
|
MenuItem: () => MenuItem,
|
|
76
78
|
MenuSection: () => MenuSection,
|
|
77
79
|
MenuSeparator: () => MenuSeparator,
|
|
78
|
-
MenuTrigger: () =>
|
|
80
|
+
MenuTrigger: () => import_react_aria_components39.MenuTrigger,
|
|
79
81
|
MultiComboBox: () => MultiComboBox,
|
|
82
|
+
NumPad: () => NumPad,
|
|
80
83
|
NumberField: () => NumberField,
|
|
81
84
|
ObjectHeader: () => ObjectHeader,
|
|
82
85
|
PageBand: () => PageBand,
|
|
83
86
|
PageHeader: () => PageHeader,
|
|
84
87
|
Pagination: () => Pagination,
|
|
85
88
|
PireIntlProvider: () => PireIntlProvider,
|
|
86
|
-
Popover: () =>
|
|
89
|
+
Popover: () => import_react_aria_components39.Popover,
|
|
87
90
|
ProgressBar: () => ProgressBar,
|
|
91
|
+
QuantityStepper: () => QuantityStepper,
|
|
88
92
|
Radio: () => Radio,
|
|
89
93
|
RadioGroup: () => RadioGroup,
|
|
90
|
-
|
|
94
|
+
RecordCard: () => RecordCard,
|
|
95
|
+
Ribbon: () => Ribbon,
|
|
96
|
+
RouterProvider: () => import_react_aria_components39.RouterProvider,
|
|
91
97
|
SectionHeader: () => SectionHeader,
|
|
92
98
|
SegmentedControl: () => SegmentedControl,
|
|
93
99
|
Select: () => Select,
|
|
@@ -101,7 +107,7 @@ __export(src_exports, {
|
|
|
101
107
|
SkeletonTableRow: () => SkeletonTableRow,
|
|
102
108
|
SplitPane: () => SplitPane,
|
|
103
109
|
Strong: () => Strong,
|
|
104
|
-
SubmenuTrigger: () =>
|
|
110
|
+
SubmenuTrigger: () => import_react_aria_components39.SubmenuTrigger,
|
|
105
111
|
Switch: () => Switch,
|
|
106
112
|
Tabs: () => Tabs,
|
|
107
113
|
Tag: () => Tag,
|
|
@@ -114,6 +120,7 @@ __export(src_exports, {
|
|
|
114
120
|
VIZ_SLOT_COUNT: () => VIZ_SLOT_COUNT,
|
|
115
121
|
ValueHelpDialog: () => ValueHelpDialog,
|
|
116
122
|
ValueHelpField: () => ValueHelpField,
|
|
123
|
+
ViewSwitcher: () => ViewSwitcher,
|
|
117
124
|
configureIcons: () => configureIcons,
|
|
118
125
|
enMessages: () => enMessages,
|
|
119
126
|
esMessages: () => esMessages,
|
|
@@ -222,6 +229,7 @@ var ICON_MARKUP = {
|
|
|
222
229
|
"percentage": '<path d="M9,14a5,5,0,1,1,5-5A5.0055,5.0055,0,0,1,9,14ZM9,6a3,3,0,1,0,3,3A3.0033,3.0033,0,0,0,9,6Z"/><path d="M.029 15H31.97V17H.029z" transform="rotate(-45 16 16)"/><path d="M23,28a5,5,0,1,1,5-5A5.0055,5.0055,0,0,1,23,28Zm0-8a3,3,0,1,0,3,3A3.0033,3.0033,0,0,0,23,20Z"/>',
|
|
223
230
|
"phone": '<path d="M26,29h-.17C6.18,27.87,3.39,11.29,3,6.23A3,3,0,0,1,5.76,3h5.51a2,2,0,0,1,1.86,1.26L14.65,8a2,2,0,0,1-.44,2.16l-2.13,2.15a9.37,9.37,0,0,0,7.58,7.6l2.17-2.15A2,2,0,0,1,24,17.35l3.77,1.51A2,2,0,0,1,29,20.72V26A3,3,0,0,1,26,29ZM6,5A1,1,0,0,0,5,6v.08C5.46,12,8.41,26,25.94,27A1,1,0,0,0,27,26.06V20.72l-3.77-1.51-2.87,2.85L19.88,22C11.18,20.91,10,12.21,10,12.12l-.06-.48,2.84-2.87L11.28,5Z"/>',
|
|
224
231
|
"piggy-bank": '<path d="M16.5,14H20V12H18V11H16v1.0508A2.5,2.5,0,0,0,16.5,17h1a.5.5,0,0,1,0,1H14v2h2v1h2V19.9492A2.5,2.5,0,0,0,17.5,15h-1a.5.5,0,0,1,0-1Z"/><path d="M29,13H26.98A5.7789,5.7789,0,0,0,25,8.8525V5a1,1,0,0,0-1.6-.8L19.6665,7H15c-5.5095,0-9.4634,3.2412-9.9485,8H5a1.0009,1.0009,0,0,1-1-1V12H2v2a3.0033,3.0033,0,0,0,3,3h.07A9.1733,9.1733,0,0,0,9,23.5566V27a1,1,0,0,0,1,1h4a1,1,0,0,0,1-1V25h3v2a1,1,0,0,0,1,1h4a1,1,0,0,0,1-1V23.6372A5.0926,5.0926,0,0,0,26.8188,20H29a1,1,0,0,0,1-1V14A1,1,0,0,0,29,13Zm-1,5H25.124c-.3052,2.7529-.8235,3.4854-3.124,4.3154V26H20V23H13v3H11V22.3779A7.013,7.013,0,0,1,7,16c0-4.8354,4.0181-7,8-7h5.3335L23,7V9.7764c2.4182,1.8593,1.9126,3.186,2.0183,5.2236H28Z"/>',
|
|
232
|
+
"pin": '<path d="M28.59,13.31,30,11.9,20,2,18.69,3.42,19.87,4.6,8.38,14.32,6.66,12.61,5.25,14l5.66,5.68L2,28.58,3.41,30l8.91-8.91L18,26.75l1.39-1.42-1.71-1.71L27.4,12.13ZM16.26,22.2,9.8,15.74,21.29,6,26,10.71Z"/>',
|
|
225
233
|
"portfolio": '<path d="M28,10H22V6a2,2,0,0,0-2-2H12a2,2,0,0,0-2,2v4H4a2,2,0,0,0-2,2V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V12A2,2,0,0,0,28,10ZM12,6h8v4H12ZM4,26V12H28V26Z"/>',
|
|
226
234
|
"printer": '<path d="M28,9H25V3H7V9H4a2,2,0,0,0-2,2V21a2,2,0,0,0,2,2H7v6H25V23h3a2,2,0,0,0,2-2V11A2,2,0,0,0,28,9ZM9,5H23V9H9ZM23,27H9V17H23Zm5-6H25V15H7v6H4V11H28Z"/>',
|
|
227
235
|
"purchase": '<path d="M28,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V8A2,2,0,0,0,28,6Zm0,2v3H4V8ZM4,24V13H28V24Z"/><path d="M6 20H16V22H6z"/>',
|
|
@@ -257,6 +265,7 @@ var ICON_MARKUP = {
|
|
|
257
265
|
"time": '<path d="M16,30A14,14,0,1,1,30,16,14,14,0,0,1,16,30ZM16,4A12,12,0,1,0,28,16,12,12,0,0,0,16,4Z"/><path d="M20.59 22 15 16.41 15 7 17 7 17 15.58 22 20.59 20.59 22z"/>',
|
|
258
266
|
"trash-can": '<path d="M12 12H14V24H12z"/><path d="M18 12H20V24H18z"/><path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z"/><path d="M12 2H20V4H12z"/>',
|
|
259
267
|
"undo": '<path d="M20,10H7.8149l3.5874-3.5859L10,5,4,11,10,17l1.4023-1.4146L7.8179,12H20a6,6,0,0,1,0,12H12v2h8a8,8,0,0,0,0-16Z"/>',
|
|
268
|
+
"upload": '<path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"/><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"/>',
|
|
260
269
|
"user": '<path d="M16,4a5,5,0,1,1-5,5,5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,16,2Z"/><path d="M26,30H24V25a5,5,0,0,0-5-5H13a5,5,0,0,0-5,5v5H6V25a7,7,0,0,1,7-7h6a7,7,0,0,1,7,7Z"/>',
|
|
261
270
|
"user--admin": '<path d="M12,4A5,5,0,1,1,7,9a5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,12,2Z"/><path d="M22,30H20V25a5,5,0,0,0-5-5H9a5,5,0,0,0-5,5v5H2V25a7,7,0,0,1,7-7h6a7,7,0,0,1,7,7Z"/><path d="M25 16.18 22.41 13.59 21 15 25 19 32 12 30.59 10.59 25 16.18z"/>',
|
|
262
271
|
"user--follow": '<path d="M32 14 28 14 28 10 26 10 26 14 22 14 22 16 26 16 26 20 28 20 28 16 32 16 32 14z"/><path d="M12,4A5,5,0,1,1,7,9a5,5,0,0,1,5-5m0-2a7,7,0,1,0,7,7A7,7,0,0,0,12,2Z"/><path d="M22,30H20V25a5,5,0,0,0-5-5H9a5,5,0,0,0-5,5v5H2V25a7,7,0,0,1,7-7h6a7,7,0,0,1,7,7Z"/>',
|
|
@@ -282,6 +291,11 @@ var CARBON_MAP = {
|
|
|
282
291
|
"file-text": "document",
|
|
283
292
|
"clipboard-list": "list--checked",
|
|
284
293
|
"building-2": "building",
|
|
294
|
+
/* Ribbon and import commands. `task--complete` is Carbon's ticked-list glyph; `check-square`
|
|
295
|
+
already points at it, and the generator de-duplicates by slug, so this costs no bytes. */
|
|
296
|
+
"list-checks": "task--complete",
|
|
297
|
+
"pin": "pin",
|
|
298
|
+
"upload": "upload",
|
|
285
299
|
"boxes": "box",
|
|
286
300
|
"truck": "delivery-truck",
|
|
287
301
|
"stamp": "checkmark--outline",
|
|
@@ -545,7 +559,9 @@ var React2 = __toESM(require("react"), 1);
|
|
|
545
559
|
var import_react_aria_components2 = require("react-aria-components");
|
|
546
560
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
547
561
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
548
|
-
const
|
|
562
|
+
const props = React2.isValidElement(children) ? children.props : void 0;
|
|
563
|
+
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
564
|
+
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", children });
|
|
549
565
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
550
566
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_aria_components2.Focusable, { children: target }),
|
|
551
567
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.Tooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
@@ -610,50 +626,244 @@ var Badge = React4.forwardRef(function Badge2({ children, status = "neutral", sh
|
|
|
610
626
|
});
|
|
611
627
|
|
|
612
628
|
// src/components/core/Tag.tsx
|
|
613
|
-
var
|
|
629
|
+
var React6 = __toESM(require("react"), 1);
|
|
614
630
|
var import_react_aria_components4 = require("react-aria-components");
|
|
631
|
+
|
|
632
|
+
// src/i18n/PireIntlProvider.tsx
|
|
633
|
+
var React5 = __toESM(require("react"), 1);
|
|
634
|
+
|
|
635
|
+
// src/i18n/messages.ts
|
|
636
|
+
var enMessages = {
|
|
637
|
+
filterBarLabel: "Filters",
|
|
638
|
+
filterBarGo: "Go",
|
|
639
|
+
filterBarClearAll: "Clear all",
|
|
640
|
+
dataTableSelectAll: "Select all rows",
|
|
641
|
+
dataTableSelectRow: "Select row",
|
|
642
|
+
dataTableSelectionColumn: "Selection",
|
|
643
|
+
dataTableLoading: "Loading records",
|
|
644
|
+
dataTableSummaryRow: "Summary",
|
|
645
|
+
dataTableEmpty: "No records match the current filters.",
|
|
646
|
+
dialogClose: "Close",
|
|
647
|
+
sidePanelClose: "Close panel",
|
|
648
|
+
inlineMessageDismiss: "Dismiss message",
|
|
649
|
+
toastDismiss: "Dismiss",
|
|
650
|
+
toastRegionLabel: "Notifications",
|
|
651
|
+
selectEmpty: "No options available",
|
|
652
|
+
comboBoxShowSuggestions: "Show suggestions",
|
|
653
|
+
comboBoxLoading: "Searching\u2026",
|
|
654
|
+
datePickerOpenCalendar: "Open calendar",
|
|
655
|
+
datePickerPreviousMonth: "Previous month",
|
|
656
|
+
datePickerNextMonth: "Next month",
|
|
657
|
+
dateRangePresetsLabel: "Date range shortcuts",
|
|
658
|
+
numberFieldIncrease: "Increase",
|
|
659
|
+
numberFieldDecrease: "Decrease",
|
|
660
|
+
inputClear: "Clear",
|
|
661
|
+
valueHelpFieldPlaceholder: "Not selected",
|
|
662
|
+
valueHelpFieldClear: "Clear selection",
|
|
663
|
+
valueHelpFieldOpenNamed: "Select {label}",
|
|
664
|
+
valueHelpFieldOpen: "Open value help",
|
|
665
|
+
valueHelpDialogSearch: "Search records",
|
|
666
|
+
valueHelpDialogTitle: "Select a record",
|
|
667
|
+
valueHelpDialogSearchPlaceholder: "Search by ID or name",
|
|
668
|
+
valueHelpDialogEmpty: "No records found",
|
|
669
|
+
valueHelpDialogCancel: "Cancel",
|
|
670
|
+
paginationLabel: "Pagination",
|
|
671
|
+
paginationRange: "{from}\u2013{to} of {total}",
|
|
672
|
+
paginationPageOf: "Page {page} of {pages}",
|
|
673
|
+
paginationPrevious: "Previous page",
|
|
674
|
+
paginationNext: "Next page",
|
|
675
|
+
paginationRowsPerPage: "Rows per page",
|
|
676
|
+
sideNavLabel: "Main navigation",
|
|
677
|
+
shellRailLabel: "Applications",
|
|
678
|
+
appLauncherLabel: "All applications",
|
|
679
|
+
appLauncherTitle: "All applications",
|
|
680
|
+
appLauncherSearch: "Search for an application",
|
|
681
|
+
appLauncherEmpty: "No application matches that search.",
|
|
682
|
+
appLauncherLoading: "Loading applications\u2026",
|
|
683
|
+
splitPaneList: "List",
|
|
684
|
+
splitPaneDetail: "Detail",
|
|
685
|
+
splitPaneBack: "Back to list",
|
|
686
|
+
fileUploadChoose: "Choose files",
|
|
687
|
+
fileUploadRemoveNamed: "Remove {name}",
|
|
688
|
+
fileUploadUploading: "Uploading",
|
|
689
|
+
fileDropZonePrompt: "Drag files here, or choose them",
|
|
690
|
+
shellBarUserMenu: "Account menu for {user}",
|
|
691
|
+
commandPaletteLabel: "Command palette",
|
|
692
|
+
commandPaletteSearchLabel: "Search commands and records",
|
|
693
|
+
commandPalettePlaceholder: "Search for a screen, an action or a record\u2026",
|
|
694
|
+
commandPaletteEmpty: "Nothing matches that",
|
|
695
|
+
commandPaletteLoading: "Searching\u2026",
|
|
696
|
+
commandPaletteHintNavigate: "navigate",
|
|
697
|
+
commandPaletteHintSelect: "open",
|
|
698
|
+
commandPaletteHintClose: "close",
|
|
699
|
+
chartCategoryHeader: "Category",
|
|
700
|
+
chartNoValue: "No data",
|
|
701
|
+
chartEmpty: "No data for this period",
|
|
702
|
+
numPadClear: "Clear",
|
|
703
|
+
numPadBackspace: "Remove last digit",
|
|
704
|
+
viewSwitcherName: "Saved views: {view}",
|
|
705
|
+
viewSwitcherNameModified: "Saved views: {view}, modified",
|
|
706
|
+
viewSwitcherModifiedMark: "\xB7 modified",
|
|
707
|
+
quantityStepperIncrease: "Increase quantity",
|
|
708
|
+
quantityStepperDecrease: "Decrease quantity",
|
|
709
|
+
confirmDialogFactsLabel: "Summary",
|
|
710
|
+
valueHelpSelectAllCount: "Select all ({count})",
|
|
711
|
+
valueHelpClearSelection: "Clear selection",
|
|
712
|
+
valueHelpSelectedCount: "Selected: {count}",
|
|
713
|
+
valueHelpConfirm: "Apply selection",
|
|
714
|
+
tagRemoveNamed: "Remove {name}",
|
|
715
|
+
tagRemove: "Remove",
|
|
716
|
+
ribbonLabel: "Commands",
|
|
717
|
+
ribbonCollapse: "Collapse the ribbon",
|
|
718
|
+
ribbonExpand: "Expand the ribbon"
|
|
719
|
+
};
|
|
720
|
+
var esMessages = {
|
|
721
|
+
filterBarLabel: "Filtros",
|
|
722
|
+
filterBarGo: "Buscar",
|
|
723
|
+
filterBarClearAll: "Limpiar todo",
|
|
724
|
+
dataTableSelectAll: "Seleccionar todas las filas",
|
|
725
|
+
dataTableSelectRow: "Seleccionar fila",
|
|
726
|
+
dataTableSelectionColumn: "Selecci\xF3n",
|
|
727
|
+
dataTableLoading: "Cargando registros",
|
|
728
|
+
dataTableSummaryRow: "Resumen",
|
|
729
|
+
dataTableEmpty: "Ning\xFAn registro coincide con los filtros actuales.",
|
|
730
|
+
dialogClose: "Cerrar",
|
|
731
|
+
sidePanelClose: "Cerrar panel",
|
|
732
|
+
inlineMessageDismiss: "Descartar mensaje",
|
|
733
|
+
toastDismiss: "Descartar",
|
|
734
|
+
toastRegionLabel: "Notificaciones",
|
|
735
|
+
selectEmpty: "Sin opciones disponibles",
|
|
736
|
+
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
737
|
+
comboBoxLoading: "Buscando\u2026",
|
|
738
|
+
datePickerOpenCalendar: "Abrir calendario",
|
|
739
|
+
datePickerPreviousMonth: "Mes anterior",
|
|
740
|
+
datePickerNextMonth: "Mes siguiente",
|
|
741
|
+
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
742
|
+
numberFieldIncrease: "Aumentar",
|
|
743
|
+
numberFieldDecrease: "Disminuir",
|
|
744
|
+
inputClear: "Limpiar",
|
|
745
|
+
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
746
|
+
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
747
|
+
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
748
|
+
valueHelpFieldOpen: "Abrir ayuda de valores",
|
|
749
|
+
valueHelpDialogSearch: "Buscar registros",
|
|
750
|
+
valueHelpDialogTitle: "Seleccionar un registro",
|
|
751
|
+
valueHelpDialogSearchPlaceholder: "Buscar por c\xF3digo o nombre",
|
|
752
|
+
valueHelpDialogEmpty: "No se encontraron registros",
|
|
753
|
+
valueHelpDialogCancel: "Cancelar",
|
|
754
|
+
paginationLabel: "Paginaci\xF3n",
|
|
755
|
+
paginationRange: "{from}\u2013{to} de {total}",
|
|
756
|
+
paginationPageOf: "P\xE1gina {page} de {pages}",
|
|
757
|
+
paginationPrevious: "P\xE1gina anterior",
|
|
758
|
+
paginationNext: "P\xE1gina siguiente",
|
|
759
|
+
paginationRowsPerPage: "Filas por p\xE1gina",
|
|
760
|
+
sideNavLabel: "Navegaci\xF3n principal",
|
|
761
|
+
shellRailLabel: "Aplicaciones",
|
|
762
|
+
appLauncherLabel: "Todas las aplicaciones",
|
|
763
|
+
appLauncherTitle: "Todas las aplicaciones",
|
|
764
|
+
appLauncherSearch: "Busc\xE1 una aplicaci\xF3n",
|
|
765
|
+
appLauncherEmpty: "Ninguna aplicaci\xF3n coincide con esa b\xFAsqueda.",
|
|
766
|
+
appLauncherLoading: "Cargando aplicaciones\u2026",
|
|
767
|
+
splitPaneList: "Lista",
|
|
768
|
+
splitPaneDetail: "Detalle",
|
|
769
|
+
splitPaneBack: "Volver a la lista",
|
|
770
|
+
fileUploadChoose: "Elegir archivos",
|
|
771
|
+
fileUploadRemoveNamed: "Quitar {name}",
|
|
772
|
+
fileUploadUploading: "Subiendo",
|
|
773
|
+
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
774
|
+
shellBarUserMenu: "Men\xFA de cuenta de {user}",
|
|
775
|
+
commandPaletteLabel: "Paleta de comandos",
|
|
776
|
+
commandPaletteSearchLabel: "Buscar comandos y registros",
|
|
777
|
+
commandPalettePlaceholder: "Busc\xE1 una pantalla, una acci\xF3n o un registro\u2026",
|
|
778
|
+
commandPaletteEmpty: "No hay coincidencias",
|
|
779
|
+
commandPaletteLoading: "Buscando\u2026",
|
|
780
|
+
commandPaletteHintNavigate: "navegar",
|
|
781
|
+
commandPaletteHintSelect: "abrir",
|
|
782
|
+
commandPaletteHintClose: "cerrar",
|
|
783
|
+
chartCategoryHeader: "Categor\xEDa",
|
|
784
|
+
chartNoValue: "Sin datos",
|
|
785
|
+
chartEmpty: "Sin datos para este per\xEDodo",
|
|
786
|
+
numPadClear: "Limpiar",
|
|
787
|
+
numPadBackspace: "Borrar \xFAltimo d\xEDgito",
|
|
788
|
+
viewSwitcherName: "Vistas guardadas: {view}",
|
|
789
|
+
viewSwitcherNameModified: "Vistas guardadas: {view}, modificada",
|
|
790
|
+
viewSwitcherModifiedMark: "\xB7 modificada",
|
|
791
|
+
quantityStepperIncrease: "Aumentar cantidad",
|
|
792
|
+
quantityStepperDecrease: "Disminuir cantidad",
|
|
793
|
+
confirmDialogFactsLabel: "Resumen",
|
|
794
|
+
valueHelpSelectAllCount: "Seleccionar todo ({count})",
|
|
795
|
+
valueHelpClearSelection: "Limpiar selecci\xF3n",
|
|
796
|
+
valueHelpSelectedCount: "Seleccionadas: {count}",
|
|
797
|
+
valueHelpConfirm: "Aplicar selecci\xF3n",
|
|
798
|
+
tagRemoveNamed: "Quitar {name}",
|
|
799
|
+
tagRemove: "Quitar",
|
|
800
|
+
ribbonLabel: "Comandos",
|
|
801
|
+
ribbonCollapse: "Contraer la cinta",
|
|
802
|
+
ribbonExpand: "Expandir la cinta"
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
// src/i18n/PireIntlProvider.tsx
|
|
615
806
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
616
|
-
var
|
|
617
|
-
|
|
618
|
-
|
|
807
|
+
var MessagesContext = React5.createContext(enMessages);
|
|
808
|
+
function PireIntlProvider({ messages, children }) {
|
|
809
|
+
const value = React5.useMemo(
|
|
810
|
+
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
811
|
+
[messages]
|
|
812
|
+
);
|
|
813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessagesContext.Provider, { value, children });
|
|
814
|
+
}
|
|
815
|
+
function usePireMessages() {
|
|
816
|
+
return React5.useContext(MessagesContext);
|
|
817
|
+
}
|
|
818
|
+
function useMessage(key, override) {
|
|
819
|
+
const messages = React5.useContext(MessagesContext);
|
|
820
|
+
return override ?? messages[key];
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// src/components/core/Tag.tsx
|
|
824
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
825
|
+
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
826
|
+
const msg = usePireMessages();
|
|
827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { ref, className: cx("pire-tag", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
828
|
+
category ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
619
829
|
children,
|
|
620
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
830
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
621
831
|
import_react_aria_components4.Button,
|
|
622
832
|
{
|
|
623
833
|
className: "pire-tag-remove",
|
|
624
834
|
isDisabled,
|
|
625
835
|
onPress: onRemove,
|
|
626
|
-
"aria-label":
|
|
627
|
-
children: /* @__PURE__ */ (0,
|
|
836
|
+
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
837
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "x", size: 12 })
|
|
628
838
|
}
|
|
629
839
|
) : null
|
|
630
840
|
] });
|
|
631
841
|
});
|
|
632
842
|
|
|
633
843
|
// src/components/core/Card.tsx
|
|
634
|
-
var
|
|
844
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
635
845
|
function Card({ title, subtitle, icon, actions, footer, interactive, children, className, ...rest }) {
|
|
636
|
-
return /* @__PURE__ */ (0,
|
|
637
|
-
title || actions ? /* @__PURE__ */ (0,
|
|
638
|
-
icon ? /* @__PURE__ */ (0,
|
|
639
|
-
/* @__PURE__ */ (0,
|
|
640
|
-
/* @__PURE__ */ (0,
|
|
641
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: cx("pire-card", className), "data-interactive": interactive ? "true" : void 0, ...rest, children: [
|
|
847
|
+
title || actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "pire-card-head", children: [
|
|
848
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
850
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "pire-card-title", children: title }),
|
|
851
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
642
852
|
] }),
|
|
643
|
-
actions ? /* @__PURE__ */ (0,
|
|
853
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
644
854
|
] }) : null,
|
|
645
|
-
children ? /* @__PURE__ */ (0,
|
|
646
|
-
footer ? /* @__PURE__ */ (0,
|
|
855
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "pire-card-body", children }) : null,
|
|
856
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("footer", { className: "pire-card-foot", children: footer }) : null
|
|
647
857
|
] });
|
|
648
858
|
}
|
|
649
859
|
|
|
650
860
|
// src/components/core/Avatar.tsx
|
|
651
|
-
var
|
|
652
|
-
var
|
|
861
|
+
var React7 = __toESM(require("react"), 1);
|
|
862
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
653
863
|
var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
654
864
|
function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
655
|
-
const [failed, setFailed] =
|
|
656
|
-
return /* @__PURE__ */ (0,
|
|
865
|
+
const [failed, setFailed] = React7.useState(false);
|
|
866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cx("pire-avatar", className), "data-size": size, role: "img", "aria-label": name, ...rest, children: src && !failed ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
657
867
|
"img",
|
|
658
868
|
{
|
|
659
869
|
src,
|
|
@@ -665,9 +875,9 @@ function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
|
665
875
|
}
|
|
666
876
|
|
|
667
877
|
// src/components/core/SegmentedControl.tsx
|
|
668
|
-
var
|
|
878
|
+
var React8 = __toESM(require("react"), 1);
|
|
669
879
|
var import_react_aria_components5 = require("react-aria-components");
|
|
670
|
-
var
|
|
880
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
671
881
|
function SegmentedControl({
|
|
672
882
|
options,
|
|
673
883
|
value,
|
|
@@ -679,8 +889,8 @@ function SegmentedControl({
|
|
|
679
889
|
style,
|
|
680
890
|
...rest
|
|
681
891
|
}) {
|
|
682
|
-
const selected =
|
|
683
|
-
return /* @__PURE__ */ (0,
|
|
892
|
+
const selected = React8.useMemo(() => new Set(value ? [value] : defaultValue ? [defaultValue] : []), [value, defaultValue]);
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
684
894
|
import_react_aria_components5.ToggleButtonGroup,
|
|
685
895
|
{
|
|
686
896
|
className: cx("pire-segmented", className),
|
|
@@ -694,7 +904,7 @@ function SegmentedControl({
|
|
|
694
904
|
const first = [...keys][0];
|
|
695
905
|
if (first != null) onChange?.(String(first));
|
|
696
906
|
},
|
|
697
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
907
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
698
908
|
import_react_aria_components5.ToggleButton,
|
|
699
909
|
{
|
|
700
910
|
id: option.id,
|
|
@@ -702,7 +912,7 @@ function SegmentedControl({
|
|
|
702
912
|
isDisabled: option.isDisabled,
|
|
703
913
|
"aria-label": iconOnly ? option.label : void 0,
|
|
704
914
|
children: [
|
|
705
|
-
option.icon ? /* @__PURE__ */ (0,
|
|
915
|
+
option.icon ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { name: option.icon, size: 16 }) : null,
|
|
706
916
|
iconOnly ? null : option.label
|
|
707
917
|
]
|
|
708
918
|
},
|
|
@@ -713,9 +923,9 @@ function SegmentedControl({
|
|
|
713
923
|
}
|
|
714
924
|
|
|
715
925
|
// src/components/core/Text.tsx
|
|
716
|
-
var
|
|
717
|
-
var
|
|
718
|
-
var Text =
|
|
926
|
+
var React9 = __toESM(require("react"), 1);
|
|
927
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
928
|
+
var Text = React9.forwardRef(function Text2({
|
|
719
929
|
size = "body",
|
|
720
930
|
color = "primary",
|
|
721
931
|
weight = "regular",
|
|
@@ -729,7 +939,7 @@ var Text = React8.forwardRef(function Text2({
|
|
|
729
939
|
}, ref) {
|
|
730
940
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
731
941
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
732
|
-
return /* @__PURE__ */ (0,
|
|
942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
733
943
|
Wrapper,
|
|
734
944
|
{
|
|
735
945
|
ref,
|
|
@@ -745,13 +955,13 @@ var Text = React8.forwardRef(function Text2({
|
|
|
745
955
|
}
|
|
746
956
|
);
|
|
747
957
|
});
|
|
748
|
-
var Strong =
|
|
749
|
-
return /* @__PURE__ */ (0,
|
|
958
|
+
var Strong = React9.forwardRef(function Strong2({ className, ...rest }, ref) {
|
|
959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { ref, elementType: "span", weight: "strong", className, ...rest });
|
|
750
960
|
});
|
|
751
961
|
|
|
752
962
|
// src/components/core/Heading.tsx
|
|
753
963
|
var import_react_aria_components6 = require("react-aria-components");
|
|
754
|
-
var
|
|
964
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
755
965
|
function Heading({
|
|
756
966
|
level = 2,
|
|
757
967
|
size,
|
|
@@ -763,7 +973,7 @@ function Heading({
|
|
|
763
973
|
}) {
|
|
764
974
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
765
975
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
767
977
|
import_react_aria_components6.Heading,
|
|
768
978
|
{
|
|
769
979
|
level,
|
|
@@ -779,9 +989,9 @@ function Heading({
|
|
|
779
989
|
|
|
780
990
|
// src/components/core/Link.tsx
|
|
781
991
|
var import_react_aria_components7 = require("react-aria-components");
|
|
782
|
-
var
|
|
992
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
783
993
|
function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
784
|
-
return /* @__PURE__ */ (0,
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
785
995
|
import_react_aria_components7.Link,
|
|
786
996
|
{
|
|
787
997
|
className: cx("pire-link", className),
|
|
@@ -791,7 +1001,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
791
1001
|
...rest,
|
|
792
1002
|
children: [
|
|
793
1003
|
children,
|
|
794
|
-
isExternal ? /* @__PURE__ */ (0,
|
|
1004
|
+
isExternal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: "external-link", size: 12, className: "pire-link-external" }) : null
|
|
795
1005
|
]
|
|
796
1006
|
}
|
|
797
1007
|
);
|
|
@@ -799,7 +1009,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
799
1009
|
|
|
800
1010
|
// src/components/core/Separator.tsx
|
|
801
1011
|
var import_react_aria_components8 = require("react-aria-components");
|
|
802
|
-
var
|
|
1012
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
803
1013
|
function Separator({
|
|
804
1014
|
orientation = "horizontal",
|
|
805
1015
|
emphasis = "default",
|
|
@@ -807,7 +1017,7 @@ function Separator({
|
|
|
807
1017
|
className,
|
|
808
1018
|
...rest
|
|
809
1019
|
}) {
|
|
810
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
811
1021
|
import_react_aria_components8.Separator,
|
|
812
1022
|
{
|
|
813
1023
|
orientation,
|
|
@@ -821,24 +1031,24 @@ function Separator({
|
|
|
821
1031
|
}
|
|
822
1032
|
|
|
823
1033
|
// src/components/core/Kbd.tsx
|
|
824
|
-
var
|
|
1034
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
825
1035
|
function Kbd({ children, size = "md", className, ...rest }) {
|
|
826
|
-
return /* @__PURE__ */ (0,
|
|
1036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("kbd", { className: cx("pire-kbd", className), "data-size": size, ...rest, children });
|
|
827
1037
|
}
|
|
828
1038
|
|
|
829
1039
|
// src/components/forms/FormField.tsx
|
|
830
|
-
var
|
|
1040
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
831
1041
|
function FormField({ label, htmlFor, isRequired, hint, error, layout = "stacked", children, className, ...rest }) {
|
|
832
|
-
return /* @__PURE__ */ (0,
|
|
833
|
-
/* @__PURE__ */ (0,
|
|
1042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "pire-field-label", htmlFor, children: [
|
|
834
1044
|
label,
|
|
835
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
1045
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
836
1046
|
] }),
|
|
837
1047
|
children,
|
|
838
|
-
error ? /* @__PURE__ */ (0,
|
|
839
|
-
/* @__PURE__ */ (0,
|
|
1048
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "pire-field-error", role: "alert", children: [
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "alert-circle", size: 12 }),
|
|
840
1050
|
error
|
|
841
|
-
] }) : hint ? /* @__PURE__ */ (0,
|
|
1051
|
+
] }) : hint ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "pire-field-hint", children: hint }) : null
|
|
842
1052
|
] });
|
|
843
1053
|
}
|
|
844
1054
|
|
|
@@ -846,161 +1056,6 @@ function FormField({ label, htmlFor, isRequired, hint, error, layout = "stacked"
|
|
|
846
1056
|
var React10 = __toESM(require("react"), 1);
|
|
847
1057
|
var import_react_aria_components9 = require("react-aria-components");
|
|
848
1058
|
|
|
849
|
-
// src/i18n/PireIntlProvider.tsx
|
|
850
|
-
var React9 = __toESM(require("react"), 1);
|
|
851
|
-
|
|
852
|
-
// src/i18n/messages.ts
|
|
853
|
-
var enMessages = {
|
|
854
|
-
filterBarLabel: "Filters",
|
|
855
|
-
filterBarGo: "Go",
|
|
856
|
-
filterBarClearAll: "Clear all",
|
|
857
|
-
dataTableSelectAll: "Select all rows",
|
|
858
|
-
dataTableSelectRow: "Select row",
|
|
859
|
-
dataTableLoading: "Loading records",
|
|
860
|
-
dataTableSummaryRow: "Summary",
|
|
861
|
-
dataTableEmpty: "No records match the current filters.",
|
|
862
|
-
dialogClose: "Close",
|
|
863
|
-
sidePanelClose: "Close panel",
|
|
864
|
-
inlineMessageDismiss: "Dismiss message",
|
|
865
|
-
toastDismiss: "Dismiss",
|
|
866
|
-
toastRegionLabel: "Notifications",
|
|
867
|
-
selectEmpty: "No options available",
|
|
868
|
-
comboBoxShowSuggestions: "Show suggestions",
|
|
869
|
-
comboBoxLoading: "Searching\u2026",
|
|
870
|
-
datePickerOpenCalendar: "Open calendar",
|
|
871
|
-
datePickerPreviousMonth: "Previous month",
|
|
872
|
-
datePickerNextMonth: "Next month",
|
|
873
|
-
dateRangePresetsLabel: "Date range shortcuts",
|
|
874
|
-
numberFieldIncrease: "Increase",
|
|
875
|
-
numberFieldDecrease: "Decrease",
|
|
876
|
-
inputClear: "Clear",
|
|
877
|
-
valueHelpFieldPlaceholder: "Not selected",
|
|
878
|
-
valueHelpFieldClear: "Clear selection",
|
|
879
|
-
valueHelpFieldOpenNamed: "Select {label}",
|
|
880
|
-
valueHelpFieldOpen: "Open value help",
|
|
881
|
-
valueHelpDialogSearch: "Search records",
|
|
882
|
-
valueHelpDialogTitle: "Select a record",
|
|
883
|
-
valueHelpDialogSearchPlaceholder: "Search by ID or name",
|
|
884
|
-
valueHelpDialogEmpty: "No records found",
|
|
885
|
-
valueHelpDialogCancel: "Cancel",
|
|
886
|
-
paginationLabel: "Pagination",
|
|
887
|
-
paginationRange: "{from}\u2013{to} of {total}",
|
|
888
|
-
paginationPageOf: "Page {page} of {pages}",
|
|
889
|
-
paginationPrevious: "Previous page",
|
|
890
|
-
paginationNext: "Next page",
|
|
891
|
-
paginationRowsPerPage: "Rows per page",
|
|
892
|
-
sideNavLabel: "Main navigation",
|
|
893
|
-
shellRailLabel: "Applications",
|
|
894
|
-
appLauncherLabel: "All applications",
|
|
895
|
-
appLauncherTitle: "All applications",
|
|
896
|
-
appLauncherSearch: "Search for an application",
|
|
897
|
-
appLauncherEmpty: "No application matches that search.",
|
|
898
|
-
appLauncherLoading: "Loading applications\u2026",
|
|
899
|
-
splitPaneList: "List",
|
|
900
|
-
splitPaneDetail: "Detail",
|
|
901
|
-
splitPaneBack: "Back to list",
|
|
902
|
-
fileUploadChoose: "Choose files",
|
|
903
|
-
fileUploadRemoveNamed: "Remove {name}",
|
|
904
|
-
fileUploadUploading: "Uploading",
|
|
905
|
-
fileDropZonePrompt: "Drag files here, or choose them",
|
|
906
|
-
shellBarUserMenu: "Account menu for {user}",
|
|
907
|
-
commandPaletteLabel: "Command palette",
|
|
908
|
-
commandPaletteSearchLabel: "Search commands and records",
|
|
909
|
-
commandPalettePlaceholder: "Search for a screen, an action or a record\u2026",
|
|
910
|
-
commandPaletteEmpty: "Nothing matches that",
|
|
911
|
-
commandPaletteLoading: "Searching\u2026",
|
|
912
|
-
commandPaletteHintNavigate: "navigate",
|
|
913
|
-
commandPaletteHintSelect: "open",
|
|
914
|
-
commandPaletteHintClose: "close",
|
|
915
|
-
chartCategoryHeader: "Category",
|
|
916
|
-
chartNoValue: "No data",
|
|
917
|
-
chartEmpty: "No data for this period"
|
|
918
|
-
};
|
|
919
|
-
var esMessages = {
|
|
920
|
-
filterBarLabel: "Filtros",
|
|
921
|
-
filterBarGo: "Buscar",
|
|
922
|
-
filterBarClearAll: "Limpiar todo",
|
|
923
|
-
dataTableSelectAll: "Seleccionar todas las filas",
|
|
924
|
-
dataTableSelectRow: "Seleccionar fila",
|
|
925
|
-
dataTableLoading: "Cargando registros",
|
|
926
|
-
dataTableSummaryRow: "Resumen",
|
|
927
|
-
dataTableEmpty: "Ning\xFAn registro coincide con los filtros actuales.",
|
|
928
|
-
dialogClose: "Cerrar",
|
|
929
|
-
sidePanelClose: "Cerrar panel",
|
|
930
|
-
inlineMessageDismiss: "Descartar mensaje",
|
|
931
|
-
toastDismiss: "Descartar",
|
|
932
|
-
toastRegionLabel: "Notificaciones",
|
|
933
|
-
selectEmpty: "Sin opciones disponibles",
|
|
934
|
-
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
935
|
-
comboBoxLoading: "Buscando\u2026",
|
|
936
|
-
datePickerOpenCalendar: "Abrir calendario",
|
|
937
|
-
datePickerPreviousMonth: "Mes anterior",
|
|
938
|
-
datePickerNextMonth: "Mes siguiente",
|
|
939
|
-
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
940
|
-
numberFieldIncrease: "Aumentar",
|
|
941
|
-
numberFieldDecrease: "Disminuir",
|
|
942
|
-
inputClear: "Limpiar",
|
|
943
|
-
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
944
|
-
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
945
|
-
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
946
|
-
valueHelpFieldOpen: "Abrir ayuda de valores",
|
|
947
|
-
valueHelpDialogSearch: "Buscar registros",
|
|
948
|
-
valueHelpDialogTitle: "Seleccionar un registro",
|
|
949
|
-
valueHelpDialogSearchPlaceholder: "Buscar por c\xF3digo o nombre",
|
|
950
|
-
valueHelpDialogEmpty: "No se encontraron registros",
|
|
951
|
-
valueHelpDialogCancel: "Cancelar",
|
|
952
|
-
paginationLabel: "Paginaci\xF3n",
|
|
953
|
-
paginationRange: "{from}\u2013{to} de {total}",
|
|
954
|
-
paginationPageOf: "P\xE1gina {page} de {pages}",
|
|
955
|
-
paginationPrevious: "P\xE1gina anterior",
|
|
956
|
-
paginationNext: "P\xE1gina siguiente",
|
|
957
|
-
paginationRowsPerPage: "Filas por p\xE1gina",
|
|
958
|
-
sideNavLabel: "Navegaci\xF3n principal",
|
|
959
|
-
shellRailLabel: "Aplicaciones",
|
|
960
|
-
appLauncherLabel: "Todas las aplicaciones",
|
|
961
|
-
appLauncherTitle: "Todas las aplicaciones",
|
|
962
|
-
appLauncherSearch: "Busc\xE1 una aplicaci\xF3n",
|
|
963
|
-
appLauncherEmpty: "Ninguna aplicaci\xF3n coincide con esa b\xFAsqueda.",
|
|
964
|
-
appLauncherLoading: "Cargando aplicaciones\u2026",
|
|
965
|
-
splitPaneList: "Lista",
|
|
966
|
-
splitPaneDetail: "Detalle",
|
|
967
|
-
splitPaneBack: "Volver a la lista",
|
|
968
|
-
fileUploadChoose: "Elegir archivos",
|
|
969
|
-
fileUploadRemoveNamed: "Quitar {name}",
|
|
970
|
-
fileUploadUploading: "Subiendo",
|
|
971
|
-
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
972
|
-
shellBarUserMenu: "Men\xFA de cuenta de {user}",
|
|
973
|
-
commandPaletteLabel: "Paleta de comandos",
|
|
974
|
-
commandPaletteSearchLabel: "Buscar comandos y registros",
|
|
975
|
-
commandPalettePlaceholder: "Busc\xE1 una pantalla, una acci\xF3n o un registro\u2026",
|
|
976
|
-
commandPaletteEmpty: "No hay coincidencias",
|
|
977
|
-
commandPaletteLoading: "Buscando\u2026",
|
|
978
|
-
commandPaletteHintNavigate: "navegar",
|
|
979
|
-
commandPaletteHintSelect: "abrir",
|
|
980
|
-
commandPaletteHintClose: "cerrar",
|
|
981
|
-
chartCategoryHeader: "Categor\xEDa",
|
|
982
|
-
chartNoValue: "Sin datos",
|
|
983
|
-
chartEmpty: "Sin datos para este per\xEDodo"
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
// src/i18n/PireIntlProvider.tsx
|
|
987
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
988
|
-
var MessagesContext = React9.createContext(enMessages);
|
|
989
|
-
function PireIntlProvider({ messages, children }) {
|
|
990
|
-
const value = React9.useMemo(
|
|
991
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
992
|
-
[messages]
|
|
993
|
-
);
|
|
994
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MessagesContext.Provider, { value, children });
|
|
995
|
-
}
|
|
996
|
-
function usePireMessages() {
|
|
997
|
-
return React9.useContext(MessagesContext);
|
|
998
|
-
}
|
|
999
|
-
function useMessage(key, override) {
|
|
1000
|
-
const messages = React9.useContext(MessagesContext);
|
|
1001
|
-
return override ?? messages[key];
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
1059
|
// src/components/utils/focusField.ts
|
|
1005
1060
|
function focusFieldOf(button) {
|
|
1006
1061
|
const control = button?.closest?.(".pire-control");
|
|
@@ -1281,10 +1336,58 @@ function Switch({ label, children, className, ...rest }) {
|
|
|
1281
1336
|
] });
|
|
1282
1337
|
}
|
|
1283
1338
|
|
|
1284
|
-
// src/components/forms/
|
|
1285
|
-
var React12 = __toESM(require("react"), 1);
|
|
1339
|
+
// src/components/forms/ChoiceCardGroup.tsx
|
|
1286
1340
|
var import_react_aria_components15 = require("react-aria-components");
|
|
1287
1341
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1342
|
+
function ChoiceCardGroup({
|
|
1343
|
+
label,
|
|
1344
|
+
description,
|
|
1345
|
+
errorMessage,
|
|
1346
|
+
options,
|
|
1347
|
+
value,
|
|
1348
|
+
defaultValue,
|
|
1349
|
+
onChange,
|
|
1350
|
+
columns = 2,
|
|
1351
|
+
isDisabled,
|
|
1352
|
+
isRequired,
|
|
1353
|
+
className,
|
|
1354
|
+
style,
|
|
1355
|
+
...rest
|
|
1356
|
+
}) {
|
|
1357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1358
|
+
import_react_aria_components15.RadioGroup,
|
|
1359
|
+
{
|
|
1360
|
+
className: cx("pire-field", className),
|
|
1361
|
+
style,
|
|
1362
|
+
validationBehavior: "aria",
|
|
1363
|
+
"aria-label": label ? void 0 : rest["aria-label"],
|
|
1364
|
+
value,
|
|
1365
|
+
defaultValue,
|
|
1366
|
+
onChange,
|
|
1367
|
+
isDisabled,
|
|
1368
|
+
isRequired,
|
|
1369
|
+
children: [
|
|
1370
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components15.Label, { className: "pire-field-label", children: [
|
|
1371
|
+
label,
|
|
1372
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1373
|
+
] }) : null,
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_aria_components15.Radio, { value: option.id, className: "pire-choicecard", isDisabled: option.isDisabled, children: [
|
|
1375
|
+
option.icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: option.icon, size: 20 }) : null,
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1377
|
+
option.description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1378
|
+
option.preview ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1379
|
+
] }, option.id)) }),
|
|
1380
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1382
|
+
]
|
|
1383
|
+
}
|
|
1384
|
+
);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// src/components/forms/ComboBox.tsx
|
|
1388
|
+
var React12 = __toESM(require("react"), 1);
|
|
1389
|
+
var import_react_aria_components16 = require("react-aria-components");
|
|
1390
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1288
1391
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1289
1392
|
function ComboBox({
|
|
1290
1393
|
label,
|
|
@@ -1330,8 +1433,8 @@ function ComboBox({
|
|
|
1330
1433
|
};
|
|
1331
1434
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1332
1435
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1333
|
-
return /* @__PURE__ */ (0,
|
|
1334
|
-
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1437
|
+
import_react_aria_components16.ComboBox,
|
|
1335
1438
|
{
|
|
1336
1439
|
className: cx("pire-field", className),
|
|
1337
1440
|
style,
|
|
@@ -1351,22 +1454,22 @@ function ComboBox({
|
|
|
1351
1454
|
validationBehavior: "aria",
|
|
1352
1455
|
...rest,
|
|
1353
1456
|
children: [
|
|
1354
|
-
label ? /* @__PURE__ */ (0,
|
|
1457
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components16.Label, { className: "pire-field-label", children: [
|
|
1355
1458
|
label,
|
|
1356
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1459
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1357
1460
|
] }) : null,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1462
|
+
import_react_aria_components16.Group,
|
|
1360
1463
|
{
|
|
1361
1464
|
className: "pire-control",
|
|
1362
1465
|
"data-size": size,
|
|
1363
1466
|
"data-full-width": String(fullWidth),
|
|
1364
1467
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1365
1468
|
children: [
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1369
|
-
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components16.Input, { className: "pire-input", placeholder: rest.placeholder }),
|
|
1471
|
+
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1472
|
+
import_react_aria_components16.Button,
|
|
1370
1473
|
{
|
|
1371
1474
|
className: "pire-input-clear",
|
|
1372
1475
|
slot: null,
|
|
@@ -1377,24 +1480,24 @@ function ComboBox({
|
|
|
1377
1480
|
children: clearLabel ?? msg.inputClear
|
|
1378
1481
|
}
|
|
1379
1482
|
) : null,
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components16.Button, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.comboBoxShowSuggestions, style: { width: 20, height: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "chevron-down", size: 16 }) })
|
|
1381
1484
|
]
|
|
1382
1485
|
}
|
|
1383
1486
|
),
|
|
1384
|
-
description ? /* @__PURE__ */ (0,
|
|
1385
|
-
/* @__PURE__ */ (0,
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1387
|
-
|
|
1487
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components16.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components16.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_aria_components16.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1490
|
+
import_react_aria_components16.ListBox,
|
|
1388
1491
|
{
|
|
1389
1492
|
className: "pire-listbox",
|
|
1390
1493
|
onScroll: onLoadMore ? (e) => {
|
|
1391
1494
|
const el = e.currentTarget;
|
|
1392
1495
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1393
1496
|
} : void 0,
|
|
1394
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0,
|
|
1395
|
-
children: (item) => /* @__PURE__ */ (0,
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1397
|
-
item.secondary ? /* @__PURE__ */ (0,
|
|
1497
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1498
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components16.ListBoxItem, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1500
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1398
1501
|
] })
|
|
1399
1502
|
}
|
|
1400
1503
|
) })
|
|
@@ -1405,8 +1508,8 @@ function ComboBox({
|
|
|
1405
1508
|
|
|
1406
1509
|
// src/components/forms/MultiComboBox.tsx
|
|
1407
1510
|
var React13 = __toESM(require("react"), 1);
|
|
1408
|
-
var
|
|
1409
|
-
var
|
|
1511
|
+
var import_react_aria_components17 = require("react-aria-components");
|
|
1512
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1410
1513
|
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1411
1514
|
function MultiComboBox({
|
|
1412
1515
|
label,
|
|
@@ -1471,8 +1574,8 @@ function MultiComboBox({
|
|
|
1471
1574
|
e.stopPropagation();
|
|
1472
1575
|
if (!values.includes(next)) commit([...values, next]);
|
|
1473
1576
|
};
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1475
|
-
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1578
|
+
import_react_aria_components17.ComboBox,
|
|
1476
1579
|
{
|
|
1477
1580
|
className: cx("pire-field", className),
|
|
1478
1581
|
style,
|
|
@@ -1488,12 +1591,12 @@ function MultiComboBox({
|
|
|
1488
1591
|
validationBehavior: "aria",
|
|
1489
1592
|
...rest,
|
|
1490
1593
|
children: [
|
|
1491
|
-
label ? /* @__PURE__ */ (0,
|
|
1594
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_aria_components17.Label, { className: "pire-field-label", children: [
|
|
1492
1595
|
label,
|
|
1493
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1596
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1494
1597
|
] }) : null,
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1496
|
-
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1599
|
+
import_react_aria_components17.Group,
|
|
1497
1600
|
{
|
|
1498
1601
|
className: "pire-control",
|
|
1499
1602
|
"data-size": size,
|
|
@@ -1502,15 +1605,15 @@ function MultiComboBox({
|
|
|
1502
1605
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1503
1606
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1504
1607
|
children: [
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1506
|
-
/* @__PURE__ */ (0,
|
|
1507
|
-
/* @__PURE__ */ (0,
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "pire-chipfield", children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.ButtonContext.Provider, { value: null, children: values.map((v) => (
|
|
1508
1611
|
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
1509
1612
|
real, current values and should read as such — they simply lose the × . */
|
|
1510
|
-
/* @__PURE__ */ (0,
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
1511
1614
|
)) }),
|
|
1512
|
-
/* @__PURE__ */ (0,
|
|
1513
|
-
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1616
|
+
import_react_aria_components17.Input,
|
|
1514
1617
|
{
|
|
1515
1618
|
ref: inputRef,
|
|
1516
1619
|
className: cx("pire-input", "pire-chipinput"),
|
|
@@ -1519,25 +1622,25 @@ function MultiComboBox({
|
|
|
1519
1622
|
}
|
|
1520
1623
|
)
|
|
1521
1624
|
] }),
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1625
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.Button, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.comboBoxShowSuggestions, style: { width: 20, height: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron-down", size: 16 }) })
|
|
1523
1626
|
]
|
|
1524
1627
|
}
|
|
1525
1628
|
),
|
|
1526
|
-
/* @__PURE__ */ (0,
|
|
1527
|
-
description ? /* @__PURE__ */ (0,
|
|
1528
|
-
/* @__PURE__ */ (0,
|
|
1529
|
-
/* @__PURE__ */ (0,
|
|
1530
|
-
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { "aria-live": "polite", children: announcement }) }),
|
|
1630
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_aria_components17.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1633
|
+
import_react_aria_components17.ListBox,
|
|
1531
1634
|
{
|
|
1532
1635
|
className: "pire-listbox",
|
|
1533
1636
|
onScroll: onLoadMore ? (e) => {
|
|
1534
1637
|
const el = e.currentTarget;
|
|
1535
1638
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1536
1639
|
} : void 0,
|
|
1537
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0,
|
|
1538
|
-
children: (item) => /* @__PURE__ */ (0,
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1540
|
-
item.secondary ? /* @__PURE__ */ (0,
|
|
1640
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1641
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_aria_components17.ListBoxItem, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1643
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1541
1644
|
] })
|
|
1542
1645
|
}
|
|
1543
1646
|
) })
|
|
@@ -1548,8 +1651,8 @@ function MultiComboBox({
|
|
|
1548
1651
|
|
|
1549
1652
|
// src/components/forms/NumberField.tsx
|
|
1550
1653
|
var React14 = __toESM(require("react"), 1);
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1654
|
+
var import_react_aria_components18 = require("react-aria-components");
|
|
1655
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1553
1656
|
function decimalSeparatorFor(locale) {
|
|
1554
1657
|
return new Intl.NumberFormat(locale).formatToParts(1.1).find((part) => part.type === "decimal")?.value ?? ".";
|
|
1555
1658
|
}
|
|
@@ -1583,12 +1686,12 @@ function toAriaNumber(value) {
|
|
|
1583
1686
|
return typeof value === "number" ? value : Number(value);
|
|
1584
1687
|
}
|
|
1585
1688
|
function ClearButton({ label, onClear }) {
|
|
1586
|
-
const state = React14.useContext(
|
|
1689
|
+
const state = React14.useContext(import_react_aria_components18.NumberFieldStateContext);
|
|
1587
1690
|
if (!state?.inputValue) {
|
|
1588
1691
|
return null;
|
|
1589
1692
|
}
|
|
1590
|
-
return /* @__PURE__ */ (0,
|
|
1591
|
-
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1694
|
+
import_react_aria_components18.Button,
|
|
1592
1695
|
{
|
|
1593
1696
|
className: "pire-input-clear",
|
|
1594
1697
|
slot: null,
|
|
@@ -1606,6 +1709,9 @@ function NumberField({
|
|
|
1606
1709
|
description,
|
|
1607
1710
|
errorMessage,
|
|
1608
1711
|
hideStepper,
|
|
1712
|
+
stepperLayout = "stacked",
|
|
1713
|
+
incrementLabel,
|
|
1714
|
+
decrementLabel,
|
|
1609
1715
|
size = "md",
|
|
1610
1716
|
fullWidth = true,
|
|
1611
1717
|
className,
|
|
@@ -1619,7 +1725,7 @@ function NumberField({
|
|
|
1619
1725
|
...rest
|
|
1620
1726
|
}) {
|
|
1621
1727
|
const msg = usePireMessages();
|
|
1622
|
-
const { locale } = (0,
|
|
1728
|
+
const { locale } = (0, import_react_aria_components18.useLocale)();
|
|
1623
1729
|
const empty = emptyValue === void 0 ? NaN : emptyValue;
|
|
1624
1730
|
const isControlled = value !== void 0;
|
|
1625
1731
|
const [ownValue, setOwnValue] = React14.useState(() => toAriaNumber(defaultValue) ?? NaN);
|
|
@@ -1671,8 +1777,8 @@ function NumberField({
|
|
|
1671
1777
|
event.stopPropagation();
|
|
1672
1778
|
typeIntoInput(event.currentTarget, localised);
|
|
1673
1779
|
};
|
|
1674
|
-
return /* @__PURE__ */ (0,
|
|
1675
|
-
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1781
|
+
import_react_aria_components18.NumberField,
|
|
1676
1782
|
{
|
|
1677
1783
|
className: cx("pire-field", className),
|
|
1678
1784
|
style,
|
|
@@ -1681,21 +1787,23 @@ function NumberField({
|
|
|
1681
1787
|
...rest,
|
|
1682
1788
|
...valueProps,
|
|
1683
1789
|
children: [
|
|
1684
|
-
label ? /* @__PURE__ */ (0,
|
|
1790
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components18.Label, { className: "pire-field-label", children: [
|
|
1685
1791
|
label,
|
|
1686
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1792
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1687
1793
|
] }) : null,
|
|
1688
|
-
/* @__PURE__ */ (0,
|
|
1689
|
-
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1795
|
+
import_react_aria_components18.Group,
|
|
1690
1796
|
{
|
|
1691
1797
|
className: "pire-control",
|
|
1692
1798
|
"data-size": size,
|
|
1693
1799
|
"data-full-width": String(fullWidth),
|
|
1694
1800
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1695
1801
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1802
|
+
"data-stepper": stepperLayout,
|
|
1696
1803
|
children: [
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
1698
|
-
|
|
1804
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.Button, { slot: "decrement", className: "pire-qty-btn", "aria-label": decrementLabel ?? msg.numberFieldDecrease, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 16 }) }) : null,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1806
|
+
import_react_aria_components18.Input,
|
|
1699
1807
|
{
|
|
1700
1808
|
className: "pire-input",
|
|
1701
1809
|
"data-numeric": "true",
|
|
@@ -1703,25 +1811,43 @@ function NumberField({
|
|
|
1703
1811
|
onPasteCapture: handlePaste
|
|
1704
1812
|
}
|
|
1705
1813
|
),
|
|
1706
|
-
suffix ? /* @__PURE__ */ (0,
|
|
1707
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1708
|
-
hideStepper
|
|
1709
|
-
|
|
1710
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
suffix ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-affix", children: suffix }) : null,
|
|
1815
|
+
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1816
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.Button, { slot: "increment", className: "pire-qty-btn", "aria-label": incrementLabel ?? msg.numberFieldIncrease, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 16 }) }) : null,
|
|
1817
|
+
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "pire-stepper", children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.Button, { slot: "increment", className: "pire-stepper-btn", "aria-label": incrementLabel ?? msg.numberFieldIncrease, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 10 }) }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.Button, { slot: "decrement", className: "pire-stepper-btn", "aria-label": decrementLabel ?? msg.numberFieldDecrease, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 10 }) })
|
|
1711
1820
|
] })
|
|
1712
1821
|
]
|
|
1713
1822
|
}
|
|
1714
1823
|
),
|
|
1715
|
-
description ? /* @__PURE__ */ (0,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1824
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components18.FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1717
1826
|
]
|
|
1718
1827
|
}
|
|
1719
1828
|
);
|
|
1720
1829
|
}
|
|
1721
1830
|
|
|
1831
|
+
// src/components/forms/QuantityStepper.tsx
|
|
1832
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1833
|
+
function QuantityStepper({ size = "md", ...rest }) {
|
|
1834
|
+
const msg = usePireMessages();
|
|
1835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1836
|
+
NumberField,
|
|
1837
|
+
{
|
|
1838
|
+
...rest,
|
|
1839
|
+
size,
|
|
1840
|
+
stepperLayout: "inline",
|
|
1841
|
+
emptyValue: null,
|
|
1842
|
+
incrementLabel: msg.quantityStepperIncrease,
|
|
1843
|
+
decrementLabel: msg.quantityStepperDecrease
|
|
1844
|
+
}
|
|
1845
|
+
);
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1722
1848
|
// src/components/forms/DatePicker.tsx
|
|
1723
1849
|
var React15 = __toESM(require("react"), 1);
|
|
1724
|
-
var
|
|
1850
|
+
var import_react_aria_components19 = require("react-aria-components");
|
|
1725
1851
|
|
|
1726
1852
|
// src/components/forms/dateValues.ts
|
|
1727
1853
|
var import_date = require("@internationalized/date");
|
|
@@ -1751,14 +1877,14 @@ function coerceBound(value) {
|
|
|
1751
1877
|
}
|
|
1752
1878
|
|
|
1753
1879
|
// src/components/forms/DatePicker.tsx
|
|
1754
|
-
var
|
|
1880
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1755
1881
|
function ClearButton2({ label }) {
|
|
1756
|
-
const state = React15.useContext(
|
|
1882
|
+
const state = React15.useContext(import_react_aria_components19.DatePickerStateContext);
|
|
1757
1883
|
if (!state?.value) {
|
|
1758
1884
|
return null;
|
|
1759
1885
|
}
|
|
1760
|
-
return /* @__PURE__ */ (0,
|
|
1761
|
-
|
|
1886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1887
|
+
import_react_aria_components19.Button,
|
|
1762
1888
|
{
|
|
1763
1889
|
className: "pire-input-clear",
|
|
1764
1890
|
slot: null,
|
|
@@ -1793,8 +1919,8 @@ function DatePicker({
|
|
|
1793
1919
|
const handleChange = (next) => onChange?.(
|
|
1794
1920
|
valueFormat === "iso" && next ? next.toString() : next
|
|
1795
1921
|
);
|
|
1796
|
-
return /* @__PURE__ */ (0,
|
|
1797
|
-
|
|
1922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1923
|
+
import_react_aria_components19.DatePicker,
|
|
1798
1924
|
{
|
|
1799
1925
|
className: cx("pire-field", className),
|
|
1800
1926
|
style,
|
|
@@ -1806,12 +1932,12 @@ function DatePicker({
|
|
|
1806
1932
|
onChange: handleChange,
|
|
1807
1933
|
...rest,
|
|
1808
1934
|
children: [
|
|
1809
|
-
label ? /* @__PURE__ */ (0,
|
|
1935
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.Label, { className: "pire-field-label", children: [
|
|
1810
1936
|
label,
|
|
1811
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1937
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1812
1938
|
] }) : null,
|
|
1813
|
-
/* @__PURE__ */ (0,
|
|
1814
|
-
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1940
|
+
import_react_aria_components19.Group,
|
|
1815
1941
|
{
|
|
1816
1942
|
className: "pire-control",
|
|
1817
1943
|
"data-size": size,
|
|
@@ -1819,23 +1945,23 @@ function DatePicker({
|
|
|
1819
1945
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1820
1946
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1821
1947
|
children: [
|
|
1822
|
-
/* @__PURE__ */ (0,
|
|
1823
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1824
|
-
/* @__PURE__ */ (0,
|
|
1948
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1949
|
+
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Button, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerOpenCalendar, style: { width: 24, height: 24 }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "calendar", size: 16 }) })
|
|
1825
1951
|
]
|
|
1826
1952
|
}
|
|
1827
1953
|
),
|
|
1828
|
-
description ? /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1954
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Dialog, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.Calendar, { className: "pire-calendar", children: [
|
|
1957
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "pire-calendar-head", children: [
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Button, { slot: "previous", className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerPreviousMonth, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-left", size: 16 }) }),
|
|
1959
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Heading, { className: "pire-calendar-title" }),
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Button, { slot: "next", className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerNextMonth, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-right", size: 16 }) })
|
|
1835
1961
|
] }),
|
|
1836
|
-
/* @__PURE__ */ (0,
|
|
1837
|
-
/* @__PURE__ */ (0,
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1962
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1963
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarHeaderCell, { children: day }) }),
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarGridBody, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
1839
1965
|
] })
|
|
1840
1966
|
] }) }) })
|
|
1841
1967
|
]
|
|
@@ -1845,8 +1971,8 @@ function DatePicker({
|
|
|
1845
1971
|
|
|
1846
1972
|
// src/components/forms/DateRangePicker.tsx
|
|
1847
1973
|
var React16 = __toESM(require("react"), 1);
|
|
1848
|
-
var
|
|
1849
|
-
var
|
|
1974
|
+
var import_react_aria_components20 = require("react-aria-components");
|
|
1975
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1850
1976
|
function coerceRange(range) {
|
|
1851
1977
|
if (range === void 0) {
|
|
1852
1978
|
return void 0;
|
|
@@ -1867,12 +1993,12 @@ function rangeLengthInDays(range) {
|
|
|
1867
1993
|
return end.toDate("UTC").getTime() / 864e5 - start.toDate("UTC").getTime() / 864e5 + 1;
|
|
1868
1994
|
}
|
|
1869
1995
|
function ClearButton3({ label }) {
|
|
1870
|
-
const state = React16.useContext(
|
|
1996
|
+
const state = React16.useContext(import_react_aria_components20.DateRangePickerStateContext);
|
|
1871
1997
|
if (!state?.value?.start && !state?.value?.end) {
|
|
1872
1998
|
return null;
|
|
1873
1999
|
}
|
|
1874
|
-
return /* @__PURE__ */ (0,
|
|
1875
|
-
|
|
2000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2001
|
+
import_react_aria_components20.Button,
|
|
1876
2002
|
{
|
|
1877
2003
|
className: "pire-input-clear",
|
|
1878
2004
|
slot: null,
|
|
@@ -1920,8 +2046,8 @@ function DateRangePicker({
|
|
|
1920
2046
|
}
|
|
1921
2047
|
onChange(valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end });
|
|
1922
2048
|
};
|
|
1923
|
-
return /* @__PURE__ */ (0,
|
|
1924
|
-
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2050
|
+
import_react_aria_components20.DateRangePicker,
|
|
1925
2051
|
{
|
|
1926
2052
|
className: cx("pire-field", className),
|
|
1927
2053
|
style,
|
|
@@ -1936,12 +2062,12 @@ function DateRangePicker({
|
|
|
1936
2062
|
...rest,
|
|
1937
2063
|
isInvalid: rest.isInvalid || tooLong || void 0,
|
|
1938
2064
|
children: [
|
|
1939
|
-
label ? /* @__PURE__ */ (0,
|
|
2065
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components20.Label, { className: "pire-field-label", children: [
|
|
1940
2066
|
label,
|
|
1941
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
2067
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1942
2068
|
] }) : null,
|
|
1943
|
-
/* @__PURE__ */ (0,
|
|
1944
|
-
|
|
2069
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2070
|
+
import_react_aria_components20.Group,
|
|
1945
2071
|
{
|
|
1946
2072
|
className: "pire-control pire-daterange-control",
|
|
1947
2073
|
"data-size": size,
|
|
@@ -1949,31 +2075,31 @@ function DateRangePicker({
|
|
|
1949
2075
|
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
1950
2076
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1951
2077
|
children: [
|
|
1952
|
-
/* @__PURE__ */ (0,
|
|
1953
|
-
/* @__PURE__ */ (0,
|
|
1954
|
-
/* @__PURE__ */ (0,
|
|
1955
|
-
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ (0,
|
|
1956
|
-
/* @__PURE__ */ (0,
|
|
1957
|
-
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.DateInput, { slot: "start", className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { "aria-hidden": "true", className: "pire-daterange-dash", children: "\u2013" }),
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.DateInput, { slot: "end", className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
2081
|
+
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ClearButton3, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2083
|
+
import_react_aria_components20.Button,
|
|
1958
2084
|
{
|
|
1959
2085
|
className: "pire-iconbtn",
|
|
1960
2086
|
"data-size": "sm",
|
|
1961
2087
|
"aria-label": msg.datePickerOpenCalendar,
|
|
1962
2088
|
style: { width: 24, height: 24 },
|
|
1963
|
-
children: /* @__PURE__ */ (0,
|
|
2089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "calendar", size: 16 })
|
|
1964
2090
|
}
|
|
1965
2091
|
)
|
|
1966
2092
|
]
|
|
1967
2093
|
}
|
|
1968
2094
|
),
|
|
1969
|
-
description ? /* @__PURE__ */ (0,
|
|
1970
|
-
/* @__PURE__ */ (0,
|
|
1971
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
2097
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components20.Dialog, { className: "pire-daterange-dialog", children: [
|
|
1972
2098
|
presets?.length ? (
|
|
1973
2099
|
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
1974
2100
|
// arrowing through a month first.
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
1976
|
-
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "pire-daterange-presets", role: "group", "aria-label": msg.dateRangePresetsLabel, children: presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2102
|
+
import_react_aria_components20.Button,
|
|
1977
2103
|
{
|
|
1978
2104
|
className: "pire-daterange-preset",
|
|
1979
2105
|
onPress: () => emit(coerceRange(preset.range()) ?? null),
|
|
@@ -1982,33 +2108,33 @@ function DateRangePicker({
|
|
|
1982
2108
|
preset.id
|
|
1983
2109
|
)) })
|
|
1984
2110
|
) : null,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
1987
|
-
/* @__PURE__ */ (0,
|
|
1988
|
-
|
|
2111
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components20.RangeCalendar, { className: "pire-calendar", children: [
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("header", { className: "pire-calendar-head", children: [
|
|
2113
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2114
|
+
import_react_aria_components20.Button,
|
|
1989
2115
|
{
|
|
1990
2116
|
slot: "previous",
|
|
1991
2117
|
className: "pire-iconbtn",
|
|
1992
2118
|
"data-size": "sm",
|
|
1993
2119
|
"aria-label": msg.datePickerPreviousMonth,
|
|
1994
|
-
children: /* @__PURE__ */ (0,
|
|
2120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "chevron-left", size: 16 })
|
|
1995
2121
|
}
|
|
1996
2122
|
),
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.Heading, { className: "pire-calendar-title" }),
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2125
|
+
import_react_aria_components20.Button,
|
|
2000
2126
|
{
|
|
2001
2127
|
slot: "next",
|
|
2002
2128
|
className: "pire-iconbtn",
|
|
2003
2129
|
"data-size": "sm",
|
|
2004
2130
|
"aria-label": msg.datePickerNextMonth,
|
|
2005
|
-
children: /* @__PURE__ */ (0,
|
|
2131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "chevron-right", size: 16 })
|
|
2006
2132
|
}
|
|
2007
2133
|
)
|
|
2008
2134
|
] }),
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
/* @__PURE__ */ (0,
|
|
2011
|
-
/* @__PURE__ */ (0,
|
|
2135
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components20.CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
2136
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.CalendarHeaderCell, { children: day }) }),
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.CalendarGridBody, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components20.CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
2012
2138
|
] })
|
|
2013
2139
|
] })
|
|
2014
2140
|
] }) })
|
|
@@ -2018,26 +2144,26 @@ function DateRangePicker({
|
|
|
2018
2144
|
}
|
|
2019
2145
|
|
|
2020
2146
|
// src/components/forms/ValueHelpField.tsx
|
|
2021
|
-
var
|
|
2147
|
+
var React20 = __toESM(require("react"), 1);
|
|
2022
2148
|
|
|
2023
2149
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2024
|
-
var
|
|
2150
|
+
var React19 = __toESM(require("react"), 1);
|
|
2025
2151
|
|
|
2026
2152
|
// src/components/feedback/Dialog.tsx
|
|
2027
2153
|
var React17 = __toESM(require("react"), 1);
|
|
2028
|
-
var
|
|
2029
|
-
var
|
|
2154
|
+
var import_react_aria_components21 = require("react-aria-components");
|
|
2155
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2030
2156
|
function DialogTitle({ children, className }) {
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components21.Heading, { slot: "title", className: cx("pire-dialog-title", className), children });
|
|
2032
2158
|
}
|
|
2033
2159
|
function DialogDescription({ children, className }) {
|
|
2034
|
-
return /* @__PURE__ */ (0,
|
|
2160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: cx("pire-dialog-sub", className), style: { margin: 0 }, children });
|
|
2035
2161
|
}
|
|
2036
2162
|
function DialogBody({ children, className }) {
|
|
2037
|
-
return /* @__PURE__ */ (0,
|
|
2163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cx("pire-dialog-body", className), children });
|
|
2038
2164
|
}
|
|
2039
2165
|
function DialogActions({ children, className }) {
|
|
2040
|
-
return /* @__PURE__ */ (0,
|
|
2166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("footer", { className: cx("pire-dialog-foot", className), children });
|
|
2041
2167
|
}
|
|
2042
2168
|
function Dialog({
|
|
2043
2169
|
isOpen,
|
|
@@ -2066,12 +2192,12 @@ function Dialog({
|
|
|
2066
2192
|
const actionsSlot = slotOf(DialogActions);
|
|
2067
2193
|
const slots = [titleSlot, descriptionSlot, bodySlot, actionsSlot];
|
|
2068
2194
|
const loose = parts.filter((node) => !slots.includes(node));
|
|
2069
|
-
const heading = titleSlot ?? (title ? /* @__PURE__ */ (0,
|
|
2070
|
-
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ (0,
|
|
2071
|
-
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ (0,
|
|
2072
|
-
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ (0,
|
|
2073
|
-
return /* @__PURE__ */ (0,
|
|
2074
|
-
|
|
2195
|
+
const heading = titleSlot ?? (title ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components21.Heading, { slot: "title", className: "pire-dialog-title", children: title }) : null);
|
|
2196
|
+
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null);
|
|
2197
|
+
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null);
|
|
2198
|
+
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "pire-dialog-body", children: loose }) : null);
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2200
|
+
import_react_aria_components21.ModalOverlay,
|
|
2075
2201
|
{
|
|
2076
2202
|
className: "pire-modal-overlay",
|
|
2077
2203
|
isOpen,
|
|
@@ -2079,13 +2205,13 @@ function Dialog({
|
|
|
2079
2205
|
onOpenChange: (o) => {
|
|
2080
2206
|
if (!o) close();
|
|
2081
2207
|
},
|
|
2082
|
-
children: /* @__PURE__ */ (0,
|
|
2083
|
-
heading || description ? /* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_aria_components21.Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_aria_components21.Dialog, { className: "pire-dialog", children: [
|
|
2209
|
+
heading || description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2085
2211
|
heading,
|
|
2086
2212
|
description
|
|
2087
2213
|
] }),
|
|
2088
|
-
showClose ? /* @__PURE__ */ (0,
|
|
2214
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
2089
2215
|
] }) : null,
|
|
2090
2216
|
body,
|
|
2091
2217
|
actions
|
|
@@ -2095,12 +2221,13 @@ function Dialog({
|
|
|
2095
2221
|
}
|
|
2096
2222
|
|
|
2097
2223
|
// src/components/data/DataTable.tsx
|
|
2098
|
-
var
|
|
2224
|
+
var React18 = __toESM(require("react"), 1);
|
|
2225
|
+
var import_react_aria_components22 = require("react-aria-components");
|
|
2099
2226
|
|
|
2100
2227
|
// src/components/feedback/Skeleton.tsx
|
|
2101
|
-
var
|
|
2228
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2102
2229
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2104
2231
|
"div",
|
|
2105
2232
|
{
|
|
2106
2233
|
className: cx("pire-skeleton", className),
|
|
@@ -2114,7 +2241,7 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2114
2241
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2115
2242
|
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
2116
2243
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2117
|
-
return /* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2118
2245
|
"div",
|
|
2119
2246
|
{
|
|
2120
2247
|
className: cx("pire-skeleton-row", className),
|
|
@@ -2126,13 +2253,13 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2126
2253
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2127
2254
|
return (
|
|
2128
2255
|
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2130
2257
|
"div",
|
|
2131
2258
|
{
|
|
2132
2259
|
className: "pire-skeleton-cell",
|
|
2133
2260
|
"data-align": align,
|
|
2134
2261
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2135
|
-
children: /* @__PURE__ */ (0,
|
|
2262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2136
2263
|
},
|
|
2137
2264
|
i
|
|
2138
2265
|
)
|
|
@@ -2143,7 +2270,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2143
2270
|
}
|
|
2144
2271
|
|
|
2145
2272
|
// src/components/data/DataTable.tsx
|
|
2146
|
-
var
|
|
2273
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2274
|
+
var IS_DEV2 = process.env.NODE_ENV !== "production";
|
|
2275
|
+
var warned2 = /* @__PURE__ */ new Set();
|
|
2276
|
+
function warnOnce2(key, message) {
|
|
2277
|
+
if (warned2.has(key)) return;
|
|
2278
|
+
warned2.add(key);
|
|
2279
|
+
console.warn(`[pire] ${message}`);
|
|
2280
|
+
}
|
|
2281
|
+
var CHECKBOX_W = 44;
|
|
2147
2282
|
function DataTable({
|
|
2148
2283
|
columns,
|
|
2149
2284
|
rows,
|
|
@@ -2151,6 +2286,7 @@ function DataTable({
|
|
|
2151
2286
|
selectable,
|
|
2152
2287
|
selected,
|
|
2153
2288
|
onSelectionChange,
|
|
2289
|
+
hideSelectAll,
|
|
2154
2290
|
sort,
|
|
2155
2291
|
onSortChange,
|
|
2156
2292
|
onRowAction,
|
|
@@ -2170,14 +2306,53 @@ function DataTable({
|
|
|
2170
2306
|
const msg = usePireMessages();
|
|
2171
2307
|
const selectionMode = selectable === true || selectable === "multiple" ? "multiple" : selectable === "single" ? "single" : "none";
|
|
2172
2308
|
const hasCheckboxColumn = selectionMode === "multiple";
|
|
2309
|
+
const pinnedGeometry = React18.useMemo(() => {
|
|
2310
|
+
const geometry = /* @__PURE__ */ new Map();
|
|
2311
|
+
let x = hasCheckboxColumn ? CHECKBOX_W : 0;
|
|
2312
|
+
let broke = null;
|
|
2313
|
+
for (const column of columns) {
|
|
2314
|
+
if (!column.pinned) {
|
|
2315
|
+
broke = "unpinned";
|
|
2316
|
+
break;
|
|
2317
|
+
}
|
|
2318
|
+
if (typeof column.width !== "number") {
|
|
2319
|
+
if (IS_DEV2) warnOnce2(
|
|
2320
|
+
`pin-width:${column.key}`,
|
|
2321
|
+
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2322
|
+
);
|
|
2323
|
+
broke = "width";
|
|
2324
|
+
break;
|
|
2325
|
+
}
|
|
2326
|
+
geometry.set(column.key, { left: x, width: column.width });
|
|
2327
|
+
x += column.width;
|
|
2328
|
+
}
|
|
2329
|
+
if (IS_DEV2 && broke === "unpinned") {
|
|
2330
|
+
const stranded = columns.slice(geometry.size).find((c) => c.pinned);
|
|
2331
|
+
if (stranded) {
|
|
2332
|
+
warnOnce2(
|
|
2333
|
+
`pin-gap:${stranded.key}`,
|
|
2334
|
+
`DataTable column "${stranded.key}" is pinned but does not sit in the leading run, so it will scroll. Move it before the first unpinned column.`
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
return geometry;
|
|
2339
|
+
}, [columns, hasCheckboxColumn]);
|
|
2340
|
+
const hasPinned = pinnedGeometry.size > 0;
|
|
2341
|
+
const lastPinnedKey = hasPinned ? [...pinnedGeometry.keys()][pinnedGeometry.size - 1] : void 0;
|
|
2173
2342
|
const sortDescriptor = sort ? { column: sort.key, direction: sort.dir === "asc" ? "ascending" : "descending" } : void 0;
|
|
2174
2343
|
const handleSelection = (keys) => {
|
|
2175
|
-
if (keys === "all")
|
|
2344
|
+
if (keys === "all") {
|
|
2345
|
+
const inCollection = new Set(rows.map((r) => r.id));
|
|
2346
|
+
return onSelectionChange?.([
|
|
2347
|
+
...rows.map((r) => r.id),
|
|
2348
|
+
...(selected ?? []).filter((id) => !inCollection.has(id))
|
|
2349
|
+
]);
|
|
2350
|
+
}
|
|
2176
2351
|
onSelectionChange?.([...keys]);
|
|
2177
2352
|
};
|
|
2178
2353
|
const skeletonRows = loadingRowCount ?? (rows.length || 5);
|
|
2179
2354
|
const skeletonColumns = [
|
|
2180
|
-
...hasCheckboxColumn ? [{ width:
|
|
2355
|
+
...hasCheckboxColumn ? [{ width: CHECKBOX_W }] : [],
|
|
2181
2356
|
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
2182
2357
|
];
|
|
2183
2358
|
const body = isLoading ? [] : rows;
|
|
@@ -2186,19 +2361,30 @@ function DataTable({
|
|
|
2186
2361
|
const expanded = new Set((expandedIds ?? []).map(String));
|
|
2187
2362
|
const spanAll = columns.length + (hasCheckboxColumn ? 1 : 0);
|
|
2188
2363
|
const expandedKey = (id) => `${id}::__pire_expanded__`;
|
|
2189
|
-
|
|
2364
|
+
const pinProps = (key) => {
|
|
2365
|
+
if (!hasPinned) return {};
|
|
2366
|
+
const box = key === null ? { left: 0, width: CHECKBOX_W } : pinnedGeometry.get(key);
|
|
2367
|
+
if (!box) return {};
|
|
2368
|
+
return {
|
|
2369
|
+
"data-pinned": "true",
|
|
2370
|
+
"data-pinned-last": key !== null && key === lastPinnedKey ? "true" : void 0,
|
|
2371
|
+
style: { left: box.left, width: box.width, minWidth: box.width, maxWidth: box.width }
|
|
2372
|
+
};
|
|
2373
|
+
};
|
|
2374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2190
2375
|
"div",
|
|
2191
2376
|
{
|
|
2192
2377
|
className: cx("pire-table-wrap", className),
|
|
2193
2378
|
style,
|
|
2194
2379
|
"data-loading": isLoading ? "true" : void 0,
|
|
2195
2380
|
"aria-busy": isLoading ? "true" : void 0,
|
|
2196
|
-
children: /* @__PURE__ */ (0,
|
|
2197
|
-
|
|
2381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2382
|
+
import_react_aria_components22.Table,
|
|
2198
2383
|
{
|
|
2199
2384
|
className: "pire-table",
|
|
2200
2385
|
"data-density": density,
|
|
2201
2386
|
"data-sticky": String(stickyHeader),
|
|
2387
|
+
"data-pinned": hasPinned ? "true" : void 0,
|
|
2202
2388
|
"aria-label": rest["aria-label"],
|
|
2203
2389
|
disabledKeys: disabledKeys.length ? new Set(disabledKeys) : void 0,
|
|
2204
2390
|
selectionMode,
|
|
@@ -2211,78 +2397,95 @@ function DataTable({
|
|
|
2211
2397
|
if (row) onRowAction(row);
|
|
2212
2398
|
} : void 0,
|
|
2213
2399
|
children: [
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2215
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2216
|
-
columns.map((c, i) =>
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_aria_components22.TableHeader, { className: "pire-thead-row", children: [
|
|
2401
|
+
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Column, { className: "pire-th", ...pinProps(null), children: hideSelectAll ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sr-only", children: msg.dataTableSelectionColumn }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
2402
|
+
columns.map((c, i) => (
|
|
2403
|
+
// The checkbox column is never the row header — a selection control does not identify
|
|
2404
|
+
// the record — so the first *data* column carries it regardless of whether a checkbox
|
|
2405
|
+
// column precedes it. Conditioning this on `hasCheckboxColumn` left every selectable
|
|
2406
|
+
// table with no row header at all: invisible on first paint, and a hard crash from
|
|
2407
|
+
// React Aria's own "table must have a row header" invariant the moment `rows` changes
|
|
2408
|
+
// under it (search, sort, a paginated load).
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2410
|
+
import_react_aria_components22.Column,
|
|
2411
|
+
{
|
|
2412
|
+
id: c.key,
|
|
2413
|
+
className: "pire-th",
|
|
2414
|
+
isRowHeader: i === 0,
|
|
2415
|
+
allowsSorting: c.sortable,
|
|
2416
|
+
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
2417
|
+
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
2418
|
+
...pinProps(c.key),
|
|
2419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: c.hideLabel ? "pire-sr-only" : "pire-th-inner", children: [
|
|
2420
|
+
c.label,
|
|
2421
|
+
c.sortable ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2422
|
+
Icon,
|
|
2423
|
+
{
|
|
2424
|
+
size: 12,
|
|
2425
|
+
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
2426
|
+
style: { color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)" }
|
|
2427
|
+
}
|
|
2428
|
+
) : null
|
|
2429
|
+
] })
|
|
2430
|
+
},
|
|
2431
|
+
c.key
|
|
2432
|
+
)
|
|
2239
2433
|
))
|
|
2240
2434
|
] }),
|
|
2241
|
-
/* @__PURE__ */ (0,
|
|
2242
|
-
/* @__PURE__ */ (0,
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.TableBody, { renderEmptyState: () => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2243
2437
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2244
2438
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2245
|
-
/* @__PURE__ */ (0,
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2246
2440
|
))
|
|
2247
|
-
] }) : /* @__PURE__ */ (0,
|
|
2441
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }), children: body.flatMap((row) => {
|
|
2248
2442
|
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2249
|
-
const record = /* @__PURE__ */ (0,
|
|
2250
|
-
|
|
2443
|
+
const record = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2444
|
+
import_react_aria_components22.Row,
|
|
2251
2445
|
{
|
|
2252
2446
|
id: row.id,
|
|
2253
2447
|
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2254
2448
|
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2255
2449
|
children: [
|
|
2256
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2257
|
-
columns.map((c) =>
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2450
|
+
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2451
|
+
columns.map((c) => {
|
|
2452
|
+
const pin = pinProps(c.key);
|
|
2453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2454
|
+
import_react_aria_components22.Cell,
|
|
2455
|
+
{
|
|
2456
|
+
className: "pire-td",
|
|
2457
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2458
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2459
|
+
...pin,
|
|
2460
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2461
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
2462
|
+
},
|
|
2463
|
+
c.key
|
|
2464
|
+
);
|
|
2465
|
+
})
|
|
2267
2466
|
]
|
|
2268
2467
|
},
|
|
2269
2468
|
row.id
|
|
2270
2469
|
);
|
|
2271
2470
|
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2272
|
-
return [record, /* @__PURE__ */ (0,
|
|
2471
|
+
return [record, /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))];
|
|
2273
2472
|
}) }),
|
|
2274
|
-
footer && !isLoading ? /* @__PURE__ */ (0,
|
|
2275
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2276
|
-
columns.map((c, i) =>
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2473
|
+
footer && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_aria_components22.Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2474
|
+
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2475
|
+
columns.map((c, i) => {
|
|
2476
|
+
const pin = pinProps(c.key);
|
|
2477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2478
|
+
import_react_aria_components22.Cell,
|
|
2479
|
+
{
|
|
2480
|
+
className: "pire-tf",
|
|
2481
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2482
|
+
...pin,
|
|
2483
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2484
|
+
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sr-only", children: msg.dataTableSummaryRow }) : null)
|
|
2485
|
+
},
|
|
2486
|
+
c.key
|
|
2487
|
+
);
|
|
2488
|
+
})
|
|
2286
2489
|
] }) }) : null
|
|
2287
2490
|
]
|
|
2288
2491
|
}
|
|
@@ -2292,7 +2495,7 @@ function DataTable({
|
|
|
2292
2495
|
}
|
|
2293
2496
|
|
|
2294
2497
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2295
|
-
var
|
|
2498
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2296
2499
|
function ValueHelpDialog({
|
|
2297
2500
|
isOpen,
|
|
2298
2501
|
title,
|
|
@@ -2305,14 +2508,19 @@ function ValueHelpDialog({
|
|
|
2305
2508
|
isLoading,
|
|
2306
2509
|
onLoadMore,
|
|
2307
2510
|
onSelect,
|
|
2308
|
-
onClose
|
|
2511
|
+
onClose,
|
|
2512
|
+
selectionMode = "single",
|
|
2513
|
+
selectedKeys,
|
|
2514
|
+
onSelectionChange,
|
|
2515
|
+
onConfirm
|
|
2309
2516
|
}) {
|
|
2310
2517
|
const msg = usePireMessages();
|
|
2311
|
-
const [query, setQuery] =
|
|
2312
|
-
|
|
2518
|
+
const [query, setQuery] = React19.useState("");
|
|
2519
|
+
React19.useEffect(() => {
|
|
2313
2520
|
if (isOpen) setQuery("");
|
|
2314
2521
|
}, [isOpen]);
|
|
2315
|
-
const
|
|
2522
|
+
const isMultiple = selectionMode === "multiple";
|
|
2523
|
+
const filtered = React19.useMemo(() => {
|
|
2316
2524
|
if (isFilteredExternally) return rows;
|
|
2317
2525
|
const q = query.trim().toLowerCase();
|
|
2318
2526
|
if (!q) return rows;
|
|
@@ -2322,16 +2530,22 @@ function ValueHelpDialog({
|
|
|
2322
2530
|
setQuery(value);
|
|
2323
2531
|
onSearch?.(value);
|
|
2324
2532
|
};
|
|
2325
|
-
return /* @__PURE__ */ (0,
|
|
2533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2326
2534
|
Dialog,
|
|
2327
2535
|
{
|
|
2328
2536
|
isOpen,
|
|
2329
2537
|
size: "lg",
|
|
2330
2538
|
title: title ?? msg.valueHelpDialogTitle,
|
|
2331
2539
|
onClose,
|
|
2332
|
-
footer: /* @__PURE__ */ (0,
|
|
2333
|
-
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2540
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2542
|
+
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "primary", onPress: () => {
|
|
2543
|
+
onConfirm?.(selectedKeys ?? []);
|
|
2544
|
+
onClose?.();
|
|
2545
|
+
}, children: msg.valueHelpConfirm }) : null
|
|
2546
|
+
] }),
|
|
2547
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2335
2549
|
Input,
|
|
2336
2550
|
{
|
|
2337
2551
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -2344,10 +2558,15 @@ function ValueHelpDialog({
|
|
|
2344
2558
|
autoFocus: true
|
|
2345
2559
|
}
|
|
2346
2560
|
),
|
|
2347
|
-
/* @__PURE__ */ (0,
|
|
2561
|
+
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "pire-valuehelp-selectionbar", children: [
|
|
2562
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.(rows.map((r) => r.id)), children: msg.valueHelpSelectAllCount.replace("{count}", String(rows.length)) }),
|
|
2563
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2564
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2565
|
+
] }) : null,
|
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { onScroll: onLoadMore ? (event) => {
|
|
2348
2567
|
const el = event.currentTarget;
|
|
2349
2568
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2350
|
-
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ (0,
|
|
2569
|
+
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2351
2570
|
DataTable,
|
|
2352
2571
|
{
|
|
2353
2572
|
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
@@ -2356,7 +2575,11 @@ function ValueHelpDialog({
|
|
|
2356
2575
|
rows: filtered,
|
|
2357
2576
|
isLoading,
|
|
2358
2577
|
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2359
|
-
|
|
2578
|
+
selectable: isMultiple ? "multiple" : void 0,
|
|
2579
|
+
hideSelectAll: isMultiple,
|
|
2580
|
+
selected: isMultiple ? selectedKeys : void 0,
|
|
2581
|
+
onSelectionChange: isMultiple ? onSelectionChange : void 0,
|
|
2582
|
+
onRowAction: isMultiple ? void 0 : (row) => {
|
|
2360
2583
|
onSelect?.(row);
|
|
2361
2584
|
onClose?.();
|
|
2362
2585
|
}
|
|
@@ -2368,7 +2591,7 @@ function ValueHelpDialog({
|
|
|
2368
2591
|
}
|
|
2369
2592
|
|
|
2370
2593
|
// src/components/forms/ValueHelpField.tsx
|
|
2371
|
-
var
|
|
2594
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2372
2595
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
2373
2596
|
function ValueHelpField({
|
|
2374
2597
|
label,
|
|
@@ -2394,9 +2617,9 @@ function ValueHelpField({
|
|
|
2394
2617
|
style
|
|
2395
2618
|
}) {
|
|
2396
2619
|
const msg = usePireMessages();
|
|
2397
|
-
const [open, setOpen] =
|
|
2398
|
-
return /* @__PURE__ */ (0,
|
|
2399
|
-
/* @__PURE__ */ (0,
|
|
2620
|
+
const [open, setOpen] = React20.useState(false);
|
|
2621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: cx(className), style, children: [
|
|
2622
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2400
2623
|
Input,
|
|
2401
2624
|
{
|
|
2402
2625
|
label,
|
|
@@ -2408,8 +2631,8 @@ function ValueHelpField({
|
|
|
2408
2631
|
placeholder: placeholder ?? msg.valueHelpFieldPlaceholder,
|
|
2409
2632
|
description,
|
|
2410
2633
|
errorMessage,
|
|
2411
|
-
suffix: /* @__PURE__ */ (0,
|
|
2412
|
-
allowsClear && value ? /* @__PURE__ */ (0,
|
|
2634
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "pire-valuehelp-actions", children: [
|
|
2635
|
+
allowsClear && value ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2413
2636
|
IconButton,
|
|
2414
2637
|
{
|
|
2415
2638
|
icon: "x",
|
|
@@ -2418,7 +2641,7 @@ function ValueHelpField({
|
|
|
2418
2641
|
onPress: () => onChange?.(null)
|
|
2419
2642
|
}
|
|
2420
2643
|
) : null,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2422
2645
|
IconButton,
|
|
2423
2646
|
{
|
|
2424
2647
|
icon: "search",
|
|
@@ -2430,7 +2653,7 @@ function ValueHelpField({
|
|
|
2430
2653
|
] })
|
|
2431
2654
|
}
|
|
2432
2655
|
),
|
|
2433
|
-
/* @__PURE__ */ (0,
|
|
2656
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2434
2657
|
ValueHelpDialog,
|
|
2435
2658
|
{
|
|
2436
2659
|
isOpen: open,
|
|
@@ -2450,12 +2673,12 @@ function ValueHelpField({
|
|
|
2450
2673
|
}
|
|
2451
2674
|
|
|
2452
2675
|
// src/components/forms/FileUpload.tsx
|
|
2453
|
-
var
|
|
2454
|
-
var
|
|
2676
|
+
var React21 = __toESM(require("react"), 1);
|
|
2677
|
+
var import_react_aria_components24 = require("react-aria-components");
|
|
2455
2678
|
|
|
2456
2679
|
// src/components/feedback/ProgressBar.tsx
|
|
2457
|
-
var
|
|
2458
|
-
var
|
|
2680
|
+
var import_react_aria_components23 = require("react-aria-components");
|
|
2681
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2459
2682
|
function ProgressBar({
|
|
2460
2683
|
value = 0,
|
|
2461
2684
|
minValue = 0,
|
|
@@ -2468,8 +2691,8 @@ function ProgressBar({
|
|
|
2468
2691
|
className,
|
|
2469
2692
|
style
|
|
2470
2693
|
}) {
|
|
2471
|
-
return /* @__PURE__ */ (0,
|
|
2472
|
-
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2695
|
+
import_react_aria_components23.ProgressBar,
|
|
2473
2696
|
{
|
|
2474
2697
|
className: cx("pire-progress", className),
|
|
2475
2698
|
"data-status": status,
|
|
@@ -2479,19 +2702,19 @@ function ProgressBar({
|
|
|
2479
2702
|
maxValue,
|
|
2480
2703
|
isIndeterminate,
|
|
2481
2704
|
style,
|
|
2482
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */ (0,
|
|
2483
|
-
label || showValue ? /* @__PURE__ */ (0,
|
|
2484
|
-
label ? /* @__PURE__ */ (0,
|
|
2485
|
-
showValue && !isIndeterminate ? /* @__PURE__ */ (0,
|
|
2705
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2706
|
+
label || showValue ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pire-progress-head", children: [
|
|
2707
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_aria_components23.Label, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", {}),
|
|
2708
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pire-numeric", children: valueText }) : null
|
|
2486
2709
|
] }) : null,
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2710
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pire-progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
2488
2711
|
] })
|
|
2489
2712
|
}
|
|
2490
2713
|
);
|
|
2491
2714
|
}
|
|
2492
2715
|
|
|
2493
2716
|
// src/components/forms/FileUpload.tsx
|
|
2494
|
-
var
|
|
2717
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2495
2718
|
var isImage = (file) => file.type.startsWith("image/");
|
|
2496
2719
|
function formatFileSize(bytes) {
|
|
2497
2720
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2541,10 +2764,10 @@ function FileUpload({
|
|
|
2541
2764
|
...rest
|
|
2542
2765
|
}) {
|
|
2543
2766
|
const msg = usePireMessages();
|
|
2544
|
-
const [uncontrolled, setUncontrolled] =
|
|
2767
|
+
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2545
2768
|
const files = value ?? uncontrolled;
|
|
2546
|
-
const created =
|
|
2547
|
-
|
|
2769
|
+
const created = React21.useRef([]);
|
|
2770
|
+
React21.useEffect(() => () => {
|
|
2548
2771
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2549
2772
|
}, []);
|
|
2550
2773
|
const commit = (next) => {
|
|
@@ -2564,7 +2787,7 @@ function FileUpload({
|
|
|
2564
2787
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
2565
2788
|
};
|
|
2566
2789
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
2567
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2568
2791
|
"div",
|
|
2569
2792
|
{
|
|
2570
2793
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -2573,24 +2796,24 @@ function FileUpload({
|
|
|
2573
2796
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
2574
2797
|
...rest,
|
|
2575
2798
|
children: [
|
|
2576
|
-
label ? /* @__PURE__ */ (0,
|
|
2799
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "pire-field-label", children: [
|
|
2577
2800
|
label,
|
|
2578
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
2801
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2579
2802
|
] }) : null,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2804
|
+
import_react_aria_components24.FileTrigger,
|
|
2582
2805
|
{
|
|
2583
2806
|
acceptedFileTypes,
|
|
2584
2807
|
allowsMultiple,
|
|
2585
2808
|
onSelect: accept,
|
|
2586
|
-
children: /* @__PURE__ */ (0,
|
|
2809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
2587
2810
|
}
|
|
2588
2811
|
),
|
|
2589
|
-
files.length ? /* @__PURE__ */ (0,
|
|
2590
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
2592
|
-
/* @__PURE__ */ (0,
|
|
2593
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
2812
|
+
files.length ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "pire-fileupload-item", children: [
|
|
2813
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
2816
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2594
2817
|
IconButton,
|
|
2595
2818
|
{
|
|
2596
2819
|
icon: "x",
|
|
@@ -2600,17 +2823,17 @@ function FileUpload({
|
|
|
2600
2823
|
}
|
|
2601
2824
|
)
|
|
2602
2825
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
2603
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
2604
|
-
description ? /* @__PURE__ */ (0,
|
|
2605
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
2826
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
2827
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_aria_components24.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
2828
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
2606
2829
|
]
|
|
2607
2830
|
}
|
|
2608
2831
|
);
|
|
2609
2832
|
}
|
|
2610
2833
|
|
|
2611
2834
|
// src/components/navigation/ShellBar.tsx
|
|
2612
|
-
var
|
|
2613
|
-
var
|
|
2835
|
+
var import_react_aria_components25 = require("react-aria-components");
|
|
2836
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2614
2837
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
2615
2838
|
function ShellBar({
|
|
2616
2839
|
launcher,
|
|
@@ -2629,46 +2852,46 @@ function ShellBar({
|
|
|
2629
2852
|
...rest
|
|
2630
2853
|
}) {
|
|
2631
2854
|
const msg = usePireMessages();
|
|
2632
|
-
return /* @__PURE__ */ (0,
|
|
2855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
2633
2856
|
launcher,
|
|
2634
|
-
onMenu ? /* @__PURE__ */ (0,
|
|
2635
|
-
monogram ? /* @__PURE__ */ (0,
|
|
2636
|
-
product ? /* @__PURE__ */ (0,
|
|
2637
|
-
title ? /* @__PURE__ */ (0,
|
|
2638
|
-
/* @__PURE__ */ (0,
|
|
2639
|
-
onSearch ? /* @__PURE__ */ (0,
|
|
2857
|
+
onMenu ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
2858
|
+
monogram ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
2859
|
+
product ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
2860
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-shellbar-spacer" }),
|
|
2862
|
+
onSearch ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
2640
2863
|
actions,
|
|
2641
2864
|
user && userMenu ? (
|
|
2642
2865
|
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
2643
2866
|
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
2644
2867
|
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
2645
|
-
/* @__PURE__ */ (0,
|
|
2646
|
-
/* @__PURE__ */ (0,
|
|
2647
|
-
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_aria_components25.MenuTrigger, { children: [
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2870
|
+
import_react_aria_components25.Button,
|
|
2648
2871
|
{
|
|
2649
2872
|
className: "pire-avatar pire-avatar-trigger",
|
|
2650
2873
|
"aria-label": (userMenuLabel ?? msg.shellBarUserMenu).replace("{user}", user),
|
|
2651
2874
|
children: initials2(user)
|
|
2652
2875
|
}
|
|
2653
2876
|
),
|
|
2654
|
-
/* @__PURE__ */ (0,
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_aria_components25.Popover, { className: "pire-popover", children: userMenu })
|
|
2655
2878
|
] })
|
|
2656
|
-
) : user ? /* @__PURE__ */ (0,
|
|
2879
|
+
) : user ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
2657
2880
|
] });
|
|
2658
2881
|
}
|
|
2659
2882
|
|
|
2660
2883
|
// src/components/navigation/SideNav.tsx
|
|
2661
|
-
var
|
|
2662
|
-
var
|
|
2884
|
+
var React22 = __toESM(require("react"), 1);
|
|
2885
|
+
var import_react_aria_components27 = require("react-aria-components");
|
|
2663
2886
|
|
|
2664
2887
|
// src/components/navigation/Menu.tsx
|
|
2665
|
-
var
|
|
2666
|
-
var
|
|
2888
|
+
var import_react_aria_components26 = require("react-aria-components");
|
|
2889
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2667
2890
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2668
2891
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2669
2892
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2670
|
-
return /* @__PURE__ */ (0,
|
|
2671
|
-
|
|
2893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2894
|
+
import_react_aria_components26.Menu,
|
|
2672
2895
|
{
|
|
2673
2896
|
className: cx("pire-menu", className),
|
|
2674
2897
|
style: menuStyle,
|
|
@@ -2691,35 +2914,35 @@ function MenuItem({
|
|
|
2691
2914
|
...rest
|
|
2692
2915
|
}) {
|
|
2693
2916
|
const keys = shortcutKeys(shortcut);
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
2695
|
-
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2918
|
+
import_react_aria_components26.MenuItem,
|
|
2696
2919
|
{
|
|
2697
2920
|
className: cx("pire-menu-item", className),
|
|
2698
2921
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
2699
2922
|
...rest,
|
|
2700
2923
|
children: [
|
|
2701
|
-
icon ? /* @__PURE__ */ (0,
|
|
2702
|
-
/* @__PURE__ */ (0,
|
|
2703
|
-
/* @__PURE__ */ (0,
|
|
2704
|
-
description ? /* @__PURE__ */ (0,
|
|
2924
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: icon, size: 16, className: "pire-menu-item-icon" }) : null,
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "pire-menu-item-body", children: [
|
|
2926
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-label", children }),
|
|
2927
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
2705
2928
|
] }),
|
|
2706
|
-
keys.length ? /* @__PURE__ */ (0,
|
|
2929
|
+
keys.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Kbd, { size: "sm", children: cap }, `${cap}-${index}`)) }) : null
|
|
2707
2930
|
]
|
|
2708
2931
|
}
|
|
2709
2932
|
);
|
|
2710
2933
|
}
|
|
2711
2934
|
function MenuSection({ title, children, className, ...rest }) {
|
|
2712
|
-
return /* @__PURE__ */ (0,
|
|
2713
|
-
title ? /* @__PURE__ */ (0,
|
|
2935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_aria_components26.MenuSection, { className: cx("pire-menu-section", className), ...rest, children: [
|
|
2936
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components26.Header, { className: "pire-menu-section-title", children: title }) : null,
|
|
2714
2937
|
children
|
|
2715
2938
|
] });
|
|
2716
2939
|
}
|
|
2717
2940
|
function MenuSeparator({ className }) {
|
|
2718
|
-
return /* @__PURE__ */ (0,
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components26.Separator, { className: cx("pire-menu-separator", className) });
|
|
2719
2942
|
}
|
|
2720
2943
|
|
|
2721
2944
|
// src/components/navigation/SideNav.tsx
|
|
2722
|
-
var
|
|
2945
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2723
2946
|
function findActiveParent(groups, value) {
|
|
2724
2947
|
if (value == null) return void 0;
|
|
2725
2948
|
for (const group of groups) {
|
|
@@ -2745,10 +2968,10 @@ function SideNav({
|
|
|
2745
2968
|
const msg = usePireMessages();
|
|
2746
2969
|
const activeParent = findActiveParent(groups, value);
|
|
2747
2970
|
const isControlled = expandedIds != null;
|
|
2748
|
-
const [ownExpanded, setOwnExpanded] =
|
|
2971
|
+
const [ownExpanded, setOwnExpanded] = React22.useState(
|
|
2749
2972
|
() => new Set(defaultExpandedIds ?? (activeParent ? [activeParent] : []))
|
|
2750
2973
|
);
|
|
2751
|
-
const [lastValue, setLastValue] =
|
|
2974
|
+
const [lastValue, setLastValue] = React22.useState(value);
|
|
2752
2975
|
if (value !== lastValue) {
|
|
2753
2976
|
setLastValue(value);
|
|
2754
2977
|
if (!isControlled && activeParent && !ownExpanded.has(activeParent)) {
|
|
@@ -2768,8 +2991,8 @@ function SideNav({
|
|
|
2768
2991
|
};
|
|
2769
2992
|
const renderRow = (item, onPress, isGroup) => {
|
|
2770
2993
|
const selected = !isGroup && item.id === value;
|
|
2771
|
-
const button = /* @__PURE__ */ (0,
|
|
2772
|
-
|
|
2994
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2995
|
+
import_react_aria_components27.Button,
|
|
2773
2996
|
{
|
|
2774
2997
|
className: "pire-sidenav-item",
|
|
2775
2998
|
"data-selected": selected ? "true" : void 0,
|
|
@@ -2778,70 +3001,70 @@ function SideNav({
|
|
|
2778
3001
|
"aria-label": collapsed ? item.label : void 0,
|
|
2779
3002
|
onPress,
|
|
2780
3003
|
children: [
|
|
2781
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2782
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
2783
|
-
item.count != null && !collapsed ? /* @__PURE__ */ (0,
|
|
3004
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
3005
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: item.label }),
|
|
3006
|
+
item.count != null && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
2784
3007
|
]
|
|
2785
3008
|
},
|
|
2786
3009
|
item.id
|
|
2787
3010
|
);
|
|
2788
|
-
return collapsed ? /* @__PURE__ */ (0,
|
|
3011
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
2789
3012
|
};
|
|
2790
|
-
const renderRailFlyout = (item) => /* @__PURE__ */ (0,
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
2792
|
-
|
|
3013
|
+
const renderRailFlyout = (item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_aria_components27.MenuTrigger, { children: [
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3015
|
+
import_react_aria_components27.Button,
|
|
2793
3016
|
{
|
|
2794
3017
|
className: "pire-sidenav-item",
|
|
2795
3018
|
"aria-label": item.label,
|
|
2796
3019
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2797
|
-
children: item.icon ? /* @__PURE__ */ (0,
|
|
3020
|
+
children: item.icon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: item.icon, size: 16 }) : null
|
|
2798
3021
|
}
|
|
2799
3022
|
),
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_aria_components27.Popover, { className: "pire-popover", placement: "right top", offset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2801
3024
|
Menu,
|
|
2802
3025
|
{
|
|
2803
3026
|
"aria-label": item.label,
|
|
2804
3027
|
className: "pire-sidenav-flyout",
|
|
2805
3028
|
onAction: (key) => onChange?.(String(key)),
|
|
2806
|
-
children: (item.items ?? []).map((child) => /* @__PURE__ */ (0,
|
|
3029
|
+
children: (item.items ?? []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuItem, { id: child.id, children: child.label }, child.id))
|
|
2807
3030
|
}
|
|
2808
3031
|
) })
|
|
2809
3032
|
] }, item.id);
|
|
2810
|
-
const renderSection = (item) => /* @__PURE__ */ (0,
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2812
|
-
|
|
3033
|
+
const renderSection = (item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_aria_components27.Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3035
|
+
import_react_aria_components27.Button,
|
|
2813
3036
|
{
|
|
2814
3037
|
slot: "trigger",
|
|
2815
3038
|
className: "pire-sidenav-item",
|
|
2816
3039
|
"data-kind": "group",
|
|
2817
3040
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2818
3041
|
children: [
|
|
2819
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2821
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
3042
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: item.label }),
|
|
3044
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
2823
3046
|
]
|
|
2824
3047
|
}
|
|
2825
3048
|
),
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_aria_components27.DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
2827
3050
|
const selected = child.id === value;
|
|
2828
|
-
return /* @__PURE__ */ (0,
|
|
2829
|
-
|
|
3051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3052
|
+
import_react_aria_components27.Button,
|
|
2830
3053
|
{
|
|
2831
3054
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
2832
3055
|
"data-selected": selected ? "true" : void 0,
|
|
2833
3056
|
"aria-current": selected ? "page" : void 0,
|
|
2834
3057
|
onPress: () => onChange?.(child.id),
|
|
2835
3058
|
children: [
|
|
2836
|
-
/* @__PURE__ */ (0,
|
|
2837
|
-
child.count != null ? /* @__PURE__ */ (0,
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: child.label }),
|
|
3060
|
+
child.count != null ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
2838
3061
|
]
|
|
2839
3062
|
},
|
|
2840
3063
|
child.id
|
|
2841
3064
|
);
|
|
2842
3065
|
}) })
|
|
2843
3066
|
] }, item.id);
|
|
2844
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2845
3068
|
"nav",
|
|
2846
3069
|
{
|
|
2847
3070
|
className: cx("pire-sidenav", className),
|
|
@@ -2857,10 +3080,10 @@ function SideNav({
|
|
|
2857
3080
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
2858
3081
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
2859
3082
|
});
|
|
2860
|
-
return /* @__PURE__ */ (0,
|
|
2861
|
-
group.label && !collapsed ? /* @__PURE__ */ (0,
|
|
2862
|
-
hasSections ? /* @__PURE__ */ (0,
|
|
2863
|
-
|
|
3083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "pire-sidenav-group", children: [
|
|
3084
|
+
group.label && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
3085
|
+
hasSections ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3086
|
+
import_react_aria_components27.DisclosureGroup,
|
|
2864
3087
|
{
|
|
2865
3088
|
className: "pire-sidenav-tree",
|
|
2866
3089
|
allowsMultipleExpanded: true,
|
|
@@ -2871,44 +3094,44 @@ function SideNav({
|
|
|
2871
3094
|
) : rows
|
|
2872
3095
|
] }, group.label ?? gi);
|
|
2873
3096
|
}),
|
|
2874
|
-
footer ? /* @__PURE__ */ (0,
|
|
3097
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
2875
3098
|
]
|
|
2876
3099
|
}
|
|
2877
3100
|
);
|
|
2878
3101
|
}
|
|
2879
3102
|
|
|
2880
3103
|
// src/components/navigation/ShellRail.tsx
|
|
2881
|
-
var
|
|
2882
|
-
var
|
|
2883
|
-
var
|
|
3104
|
+
var React23 = __toESM(require("react"), 1);
|
|
3105
|
+
var import_react_aria_components28 = require("react-aria-components");
|
|
3106
|
+
var import_jsx_runtime40 = (
|
|
2884
3107
|
// The divider is a sibling of the groups rather than a pseudo-element on one, because the
|
|
2885
3108
|
// scrolling zone would carry its own rule out of view on the first wheel event.
|
|
2886
3109
|
require("react/jsx-runtime")
|
|
2887
3110
|
);
|
|
2888
3111
|
function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
2889
3112
|
const msg = usePireMessages();
|
|
2890
|
-
return /* @__PURE__ */ (0,
|
|
2891
|
-
gi > 0 ? /* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2893
|
-
|
|
3113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("nav", { className: cx("pire-shellrail", className), "aria-label": msg.shellRailLabel, ...rest, children: groups.map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(React23.Fragment, { children: [
|
|
3114
|
+
gi > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "pire-shellrail-divider" }) : null,
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "pire-shellrail-group", "data-scroll": group.isScrollable ? "true" : void 0, children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Tooltip, { label: item.label, placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3116
|
+
import_react_aria_components28.Button,
|
|
2894
3117
|
{
|
|
2895
3118
|
className: "pire-shellrail-item",
|
|
2896
3119
|
"aria-label": item.label,
|
|
2897
3120
|
"data-selected": item.id === value ? "true" : void 0,
|
|
2898
3121
|
"aria-current": item.id === value ? "true" : void 0,
|
|
2899
3122
|
onPress: () => onChange?.(item.id),
|
|
2900
|
-
children: /* @__PURE__ */ (0,
|
|
3123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "pire-shellrail-tile", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { name: item.icon, size: 20 }) })
|
|
2901
3124
|
}
|
|
2902
3125
|
) }, item.id)) })
|
|
2903
3126
|
] }, group.items[0]?.id ?? gi)) });
|
|
2904
3127
|
}
|
|
2905
3128
|
|
|
2906
3129
|
// src/components/navigation/Tabs.tsx
|
|
2907
|
-
var
|
|
2908
|
-
var
|
|
3130
|
+
var import_react_aria_components29 = require("react-aria-components");
|
|
3131
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2909
3132
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
2910
|
-
return /* @__PURE__ */ (0,
|
|
2911
|
-
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3134
|
+
import_react_aria_components29.Tabs,
|
|
2912
3135
|
{
|
|
2913
3136
|
className,
|
|
2914
3137
|
style,
|
|
@@ -2916,23 +3139,23 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
2916
3139
|
defaultSelectedKey: defaultValue,
|
|
2917
3140
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
2918
3141
|
children: [
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
2920
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_aria_components29.TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_react_aria_components29.Tab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
3143
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
2921
3144
|
item.label,
|
|
2922
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
3145
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "pire-tab-count", children: item.count }) : null
|
|
2923
3146
|
] }) }),
|
|
2924
|
-
items.map((item) => /* @__PURE__ */ (0,
|
|
3147
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_aria_components29.TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
2925
3148
|
]
|
|
2926
3149
|
}
|
|
2927
3150
|
);
|
|
2928
3151
|
}
|
|
2929
3152
|
|
|
2930
3153
|
// src/components/navigation/Breadcrumb.tsx
|
|
2931
|
-
var
|
|
2932
|
-
var
|
|
3154
|
+
var import_react_aria_components30 = require("react-aria-components");
|
|
3155
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2933
3156
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
2934
|
-
return /* @__PURE__ */ (0,
|
|
2935
|
-
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3158
|
+
import_react_aria_components30.Breadcrumbs,
|
|
2936
3159
|
{
|
|
2937
3160
|
className: cx("pire-breadcrumbs", className),
|
|
2938
3161
|
style,
|
|
@@ -2940,9 +3163,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2940
3163
|
onAction: (key) => onNavigate?.(String(key)),
|
|
2941
3164
|
children: (item) => {
|
|
2942
3165
|
const last = items[items.length - 1] === item;
|
|
2943
|
-
return /* @__PURE__ */ (0,
|
|
2944
|
-
last ? item.label : /* @__PURE__ */ (0,
|
|
2945
|
-
last ? null : /* @__PURE__ */ (0,
|
|
3166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_react_aria_components30.Breadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
3167
|
+
last ? item.label : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_aria_components30.Link, { href: item.href, children: item.label }),
|
|
3168
|
+
last ? null : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
2946
3169
|
] });
|
|
2947
3170
|
}
|
|
2948
3171
|
}
|
|
@@ -2950,7 +3173,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2950
3173
|
}
|
|
2951
3174
|
|
|
2952
3175
|
// src/components/navigation/Pagination.tsx
|
|
2953
|
-
var
|
|
3176
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2954
3177
|
function Pagination({
|
|
2955
3178
|
page = 1,
|
|
2956
3179
|
pageSize = 25,
|
|
@@ -2965,9 +3188,9 @@ function Pagination({
|
|
|
2965
3188
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2966
3189
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
2967
3190
|
const to = Math.min(total, page * pageSize);
|
|
2968
|
-
return /* @__PURE__ */ (0,
|
|
2969
|
-
/* @__PURE__ */ (0,
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
3191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2971
3194
|
IconButton,
|
|
2972
3195
|
{
|
|
2973
3196
|
icon: "chevron-left",
|
|
@@ -2978,8 +3201,8 @@ function Pagination({
|
|
|
2978
3201
|
onPress: () => onPageChange?.(page - 1)
|
|
2979
3202
|
}
|
|
2980
3203
|
),
|
|
2981
|
-
/* @__PURE__ */ (0,
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
3204
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
3205
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2983
3206
|
IconButton,
|
|
2984
3207
|
{
|
|
2985
3208
|
icon: "chevron-right",
|
|
@@ -2990,7 +3213,7 @@ function Pagination({
|
|
|
2990
3213
|
onPress: () => onPageChange?.(page + 1)
|
|
2991
3214
|
}
|
|
2992
3215
|
),
|
|
2993
|
-
onPageSizeChange ? /* @__PURE__ */ (0,
|
|
3216
|
+
onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2994
3217
|
Select,
|
|
2995
3218
|
{
|
|
2996
3219
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -3005,8 +3228,195 @@ function Pagination({
|
|
|
3005
3228
|
] });
|
|
3006
3229
|
}
|
|
3007
3230
|
|
|
3231
|
+
// src/components/navigation/Ribbon.tsx
|
|
3232
|
+
var React24 = __toESM(require("react"), 1);
|
|
3233
|
+
var import_react_aria_components31 = require("react-aria-components");
|
|
3234
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3235
|
+
var outside = (what, parent) => {
|
|
3236
|
+
const Config = () => {
|
|
3237
|
+
throw new Error(`[pire] ${what} must be a child of ${parent}.`);
|
|
3238
|
+
};
|
|
3239
|
+
Object.defineProperty(Config, "name", { value: what });
|
|
3240
|
+
Config.displayName = what;
|
|
3241
|
+
return Config;
|
|
3242
|
+
};
|
|
3243
|
+
var RibbonTab = outside("Ribbon.Tab", "Ribbon");
|
|
3244
|
+
var RibbonGroup = outside("Ribbon.Group", "Ribbon.Tab");
|
|
3245
|
+
var RibbonCommand = outside("Ribbon.Command", "Ribbon.Group");
|
|
3246
|
+
var CONFIG_ELEMENTS = /* @__PURE__ */ new Set([RibbonTab, RibbonGroup, RibbonCommand]);
|
|
3247
|
+
function describe(child) {
|
|
3248
|
+
if (!React24.isValidElement(child)) return JSON.stringify(child);
|
|
3249
|
+
if (typeof child.type === "string") return `<${child.type}>`;
|
|
3250
|
+
const type = child.type;
|
|
3251
|
+
return type?.displayName || type?.name || "a component";
|
|
3252
|
+
}
|
|
3253
|
+
function childrenOfType(children, type, what, parent) {
|
|
3254
|
+
const out = [];
|
|
3255
|
+
const walk = (nodes, path) => {
|
|
3256
|
+
React24.Children.forEach(nodes, (child, i) => {
|
|
3257
|
+
if (child == null || typeof child === "boolean") return;
|
|
3258
|
+
if (React24.isValidElement(child) && child.type === React24.Fragment) {
|
|
3259
|
+
return walk(child.props.children, `${path}${i}.`);
|
|
3260
|
+
}
|
|
3261
|
+
if (!React24.isValidElement(child) || child.type !== type) {
|
|
3262
|
+
const isWrapper = React24.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3263
|
+
throw new Error(`[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.` : ""));
|
|
3264
|
+
}
|
|
3265
|
+
out.push({ ...child.props, key: child.key != null ? String(child.key) : `${path}${i}` });
|
|
3266
|
+
});
|
|
3267
|
+
};
|
|
3268
|
+
walk(children, "");
|
|
3269
|
+
return out;
|
|
3270
|
+
}
|
|
3271
|
+
function readTabs(children) {
|
|
3272
|
+
return childrenOfType(children, RibbonTab, "Ribbon.Tab", "Ribbon").map((tab) => ({
|
|
3273
|
+
...tab,
|
|
3274
|
+
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map((group) => ({
|
|
3275
|
+
...group,
|
|
3276
|
+
commands: childrenOfType(group.children, RibbonCommand, "Ribbon.Command", "Ribbon.Group")
|
|
3277
|
+
}))
|
|
3278
|
+
}));
|
|
3279
|
+
}
|
|
3280
|
+
function Command({ command, selectionCount, inBar }) {
|
|
3281
|
+
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3282
|
+
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3284
|
+
import_react_aria_components31.Button,
|
|
3285
|
+
{
|
|
3286
|
+
className: "pire-ribbon-command",
|
|
3287
|
+
"data-size": size,
|
|
3288
|
+
isDisabled,
|
|
3289
|
+
onPress: command.onPress,
|
|
3290
|
+
children: [
|
|
3291
|
+
command.icon ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: command.icon, size: size === "lg" ? 20 : 16 }) : null,
|
|
3292
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-command-label", children: command.label })
|
|
3293
|
+
]
|
|
3294
|
+
}
|
|
3295
|
+
);
|
|
3296
|
+
}
|
|
3297
|
+
function Group8({ group, selectionCount }) {
|
|
3298
|
+
const large = group.commands.filter((c) => (c.size ?? "sm") === "lg");
|
|
3299
|
+
const small = group.commands.filter((c) => (c.size ?? "sm") !== "lg");
|
|
3300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "pire-ribbon-group", role: "group", "aria-label": group.caption, children: [
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "pire-ribbon-group-body", children: [
|
|
3302
|
+
large.map((c) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Command, { command: c, selectionCount }, c.key)),
|
|
3303
|
+
small.length ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-stack", children: small.map((c) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Command, { command: c, selectionCount }, c.key)) }) : null
|
|
3304
|
+
] }),
|
|
3305
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-caption", "aria-hidden": "true", children: group.caption })
|
|
3306
|
+
] });
|
|
3307
|
+
}
|
|
3308
|
+
function barBlocks(tabs) {
|
|
3309
|
+
const blocks = [];
|
|
3310
|
+
for (const tab of tabs) {
|
|
3311
|
+
if (tab.isContextual) continue;
|
|
3312
|
+
for (const group of tab.groups) {
|
|
3313
|
+
const commands = group.commands.filter((c) => c.inBar);
|
|
3314
|
+
if (commands.length) blocks.push({ key: `${tab.key}:${group.key}`, commands });
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
return blocks;
|
|
3318
|
+
}
|
|
3319
|
+
function Ribbon({
|
|
3320
|
+
children,
|
|
3321
|
+
value,
|
|
3322
|
+
defaultValue,
|
|
3323
|
+
onChange,
|
|
3324
|
+
isCollapsed,
|
|
3325
|
+
onCollapsedChange,
|
|
3326
|
+
leading,
|
|
3327
|
+
actions,
|
|
3328
|
+
selectionCount,
|
|
3329
|
+
className,
|
|
3330
|
+
style,
|
|
3331
|
+
...rest
|
|
3332
|
+
}) {
|
|
3333
|
+
const msg = usePireMessages();
|
|
3334
|
+
const tabs = readTabs(children);
|
|
3335
|
+
const count = selectionCount ?? 0;
|
|
3336
|
+
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3337
|
+
const fallback = visible[0]?.id;
|
|
3338
|
+
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3339
|
+
const requested = value ?? ownTab;
|
|
3340
|
+
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3341
|
+
const select = React24.useCallback((id) => {
|
|
3342
|
+
setOwnTab(id);
|
|
3343
|
+
onChange?.(id);
|
|
3344
|
+
}, [onChange]);
|
|
3345
|
+
const hadSelection = React24.useRef(false);
|
|
3346
|
+
React24.useEffect(() => {
|
|
3347
|
+
const has = count > 0;
|
|
3348
|
+
if (has === hadSelection.current) return;
|
|
3349
|
+
hadSelection.current = has;
|
|
3350
|
+
const contextual = tabs.find((tab) => tab.isContextual);
|
|
3351
|
+
if (!contextual) return;
|
|
3352
|
+
if (has) select(contextual.id);
|
|
3353
|
+
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3354
|
+
}, [count, tabs, requested, select]);
|
|
3355
|
+
const [ownCollapsed, setOwnCollapsed] = React24.useState(false);
|
|
3356
|
+
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3357
|
+
const toggleRef = React24.useRef(null);
|
|
3358
|
+
const restoreFocus = React24.useRef(false);
|
|
3359
|
+
React24.useLayoutEffect(() => {
|
|
3360
|
+
if (!restoreFocus.current) return;
|
|
3361
|
+
restoreFocus.current = false;
|
|
3362
|
+
toggleRef.current?.focus();
|
|
3363
|
+
});
|
|
3364
|
+
const bandId = React24.useId();
|
|
3365
|
+
const bandDomId = { id: bandId };
|
|
3366
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3367
|
+
import_react_aria_components31.Button,
|
|
3368
|
+
{
|
|
3369
|
+
ref: toggleRef,
|
|
3370
|
+
className: "pire-ribbon-toggle",
|
|
3371
|
+
"aria-expanded": !collapsed,
|
|
3372
|
+
"aria-controls": bandId,
|
|
3373
|
+
"aria-label": collapsed ? msg.ribbonExpand : msg.ribbonCollapse,
|
|
3374
|
+
onPress: () => {
|
|
3375
|
+
restoreFocus.current = document.activeElement === toggleRef.current;
|
|
3376
|
+
setOwnCollapsed(!collapsed);
|
|
3377
|
+
onCollapsedChange?.(!collapsed);
|
|
3378
|
+
},
|
|
3379
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3380
|
+
}
|
|
3381
|
+
);
|
|
3382
|
+
if (collapsed) {
|
|
3383
|
+
const blocks = barBlocks(tabs);
|
|
3384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { className: "pire-ribbon-bar", "aria-label": rest["aria-label"], children: [
|
|
3385
|
+
leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
3386
|
+
blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(React24.Fragment, { children: [
|
|
3387
|
+
i > 0 || leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
3388
|
+
block.commands.map((c) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3389
|
+
] }, block.key)),
|
|
3390
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3391
|
+
actions,
|
|
3392
|
+
toggle
|
|
3393
|
+
] }) });
|
|
3394
|
+
}
|
|
3395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Tabs, { selectedKey: selected, onSelectionChange: (k) => select(String(k)), children: [
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_aria_components31.TabList, { className: "pire-ribbon-tablist", "aria-label": rest["aria-label"], children: visible.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3397
|
+
import_react_aria_components31.Tab,
|
|
3398
|
+
{
|
|
3399
|
+
id: tab.id,
|
|
3400
|
+
className: "pire-ribbon-tab",
|
|
3401
|
+
"data-contextual": tab.isContextual ? "true" : void 0,
|
|
3402
|
+
children: tab.label
|
|
3403
|
+
},
|
|
3404
|
+
tab.key
|
|
3405
|
+
)) }),
|
|
3406
|
+
visible.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_aria_components31.TabPanel, { id: tab.id, className: "pire-ribbon-panel", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { ...bandDomId, className: "pire-ribbon-band", "aria-label": msg.ribbonLabel, children: [
|
|
3407
|
+
tab.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Group8, { group, selectionCount: count }, group.key)),
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3409
|
+
actions,
|
|
3410
|
+
toggle
|
|
3411
|
+
] }) }, tab.key))
|
|
3412
|
+
] }) });
|
|
3413
|
+
}
|
|
3414
|
+
Ribbon.Tab = RibbonTab;
|
|
3415
|
+
Ribbon.Group = RibbonGroup;
|
|
3416
|
+
Ribbon.Command = RibbonCommand;
|
|
3417
|
+
|
|
3008
3418
|
// src/components/feedback/InlineMessage.tsx
|
|
3009
|
-
var
|
|
3419
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3010
3420
|
var KIND_ICON = {
|
|
3011
3421
|
info: "info",
|
|
3012
3422
|
success: "check-circle-2",
|
|
@@ -3016,7 +3426,7 @@ var KIND_ICON = {
|
|
|
3016
3426
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
3017
3427
|
const msg = usePireMessages();
|
|
3018
3428
|
const assertive = kind === "error" || kind === "warning";
|
|
3019
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3020
3430
|
"div",
|
|
3021
3431
|
{
|
|
3022
3432
|
className: cx("pire-msg", className),
|
|
@@ -3025,21 +3435,21 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
3025
3435
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3026
3436
|
...rest,
|
|
3027
3437
|
children: [
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
title ? /* @__PURE__ */ (0,
|
|
3031
|
-
children ? /* @__PURE__ */ (0,
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
3440
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-title", children: title }) : null,
|
|
3441
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-body", children }) : null,
|
|
3032
3442
|
action
|
|
3033
3443
|
] }),
|
|
3034
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3444
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3035
3445
|
]
|
|
3036
3446
|
}
|
|
3037
3447
|
);
|
|
3038
3448
|
}
|
|
3039
3449
|
|
|
3040
3450
|
// src/components/feedback/Toast.tsx
|
|
3041
|
-
var
|
|
3042
|
-
var
|
|
3451
|
+
var React25 = __toESM(require("react"), 1);
|
|
3452
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3043
3453
|
var KIND_ICON2 = {
|
|
3044
3454
|
info: "info",
|
|
3045
3455
|
success: "check-circle-2",
|
|
@@ -3048,7 +3458,7 @@ var KIND_ICON2 = {
|
|
|
3048
3458
|
};
|
|
3049
3459
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
3050
3460
|
const msg = usePireMessages();
|
|
3051
|
-
return /* @__PURE__ */ (0,
|
|
3461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3052
3462
|
"div",
|
|
3053
3463
|
{
|
|
3054
3464
|
className: cx("pire-toast", className),
|
|
@@ -3057,40 +3467,40 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3057
3467
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3058
3468
|
...rest,
|
|
3059
3469
|
children: [
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { style: { flex: 1 }, children }),
|
|
3472
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3063
3473
|
]
|
|
3064
3474
|
}
|
|
3065
3475
|
);
|
|
3066
3476
|
}
|
|
3067
|
-
var ToastContext =
|
|
3477
|
+
var ToastContext = React25.createContext(null);
|
|
3068
3478
|
function ToastProvider({ children, timeout = 6e3 }) {
|
|
3069
3479
|
const msg = usePireMessages();
|
|
3070
|
-
const [toasts, setToasts] =
|
|
3071
|
-
const close =
|
|
3072
|
-
const add =
|
|
3480
|
+
const [toasts, setToasts] = React25.useState([]);
|
|
3481
|
+
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3482
|
+
const add = React25.useCallback((toast) => {
|
|
3073
3483
|
const id = Math.random().toString(36).slice(2);
|
|
3074
3484
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
3075
3485
|
const ms = toast.timeout ?? timeout;
|
|
3076
3486
|
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3077
3487
|
return id;
|
|
3078
3488
|
}, [close, timeout]);
|
|
3079
|
-
const value =
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3489
|
+
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToastContext.Provider, { value, children: [
|
|
3081
3491
|
children,
|
|
3082
|
-
/* @__PURE__ */ (0,
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
3083
3493
|
] });
|
|
3084
3494
|
}
|
|
3085
3495
|
function useToast() {
|
|
3086
|
-
const ctx =
|
|
3496
|
+
const ctx = React25.useContext(ToastContext);
|
|
3087
3497
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3088
3498
|
return ctx;
|
|
3089
3499
|
}
|
|
3090
3500
|
|
|
3091
3501
|
// src/components/data/KpiTile.tsx
|
|
3092
|
-
var
|
|
3093
|
-
var
|
|
3502
|
+
var import_react_aria_components32 = require("react-aria-components");
|
|
3503
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3094
3504
|
function KpiTile({
|
|
3095
3505
|
label,
|
|
3096
3506
|
value,
|
|
@@ -3106,50 +3516,50 @@ function KpiTile({
|
|
|
3106
3516
|
style
|
|
3107
3517
|
}) {
|
|
3108
3518
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3109
|
-
const body = /* @__PURE__ */ (0,
|
|
3110
|
-
/* @__PURE__ */ (0,
|
|
3111
|
-
icon ? /* @__PURE__ */ (0,
|
|
3519
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
3520
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-label", children: [
|
|
3521
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: icon, size: 16 }) : null,
|
|
3112
3522
|
label
|
|
3113
3523
|
] }),
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3524
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-value", children: [
|
|
3115
3525
|
value,
|
|
3116
|
-
unit ? /* @__PURE__ */ (0,
|
|
3526
|
+
unit ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3117
3527
|
] }),
|
|
3118
|
-
delta ? /* @__PURE__ */ (0,
|
|
3119
|
-
deltaDirection ? /* @__PURE__ */ (0,
|
|
3528
|
+
delta ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
3529
|
+
deltaDirection ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3120
3530
|
delta
|
|
3121
3531
|
] }) : null,
|
|
3122
|
-
footnote ? /* @__PURE__ */ (0,
|
|
3532
|
+
footnote ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3123
3533
|
] });
|
|
3124
3534
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3125
|
-
return onPress ? /* @__PURE__ */ (0,
|
|
3535
|
+
return onPress ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_aria_components32.Button, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ...props, children: body });
|
|
3126
3536
|
}
|
|
3127
3537
|
|
|
3128
3538
|
// src/components/data/ObjectHeader.tsx
|
|
3129
|
-
var
|
|
3539
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3130
3540
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
3131
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3132
3542
|
breadcrumb,
|
|
3133
|
-
/* @__PURE__ */ (0,
|
|
3134
|
-
/* @__PURE__ */ (0,
|
|
3135
|
-
/* @__PURE__ */ (0,
|
|
3136
|
-
subtitle || id ? /* @__PURE__ */ (0,
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h1", { className: "pire-objheader-title", children: title }),
|
|
3546
|
+
subtitle || id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-sub", children: [
|
|
3137
3547
|
subtitle,
|
|
3138
|
-
id ? /* @__PURE__ */ (0,
|
|
3548
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-objheader-id", children: id }) : null
|
|
3139
3549
|
] }) : null
|
|
3140
3550
|
] }),
|
|
3141
3551
|
badge,
|
|
3142
|
-
actions ? /* @__PURE__ */ (0,
|
|
3552
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3143
3553
|
] }),
|
|
3144
|
-
facts?.length ? /* @__PURE__ */ (0,
|
|
3145
|
-
/* @__PURE__ */ (0,
|
|
3146
|
-
/* @__PURE__ */ (0,
|
|
3554
|
+
facts?.length ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
3555
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3556
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
3147
3557
|
] }, fact.label)) }) : null
|
|
3148
3558
|
] });
|
|
3149
3559
|
}
|
|
3150
3560
|
|
|
3151
3561
|
// src/components/data/FilterBar.tsx
|
|
3152
|
-
var
|
|
3562
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3153
3563
|
function FilterBar({
|
|
3154
3564
|
children,
|
|
3155
3565
|
activeFilters = [],
|
|
@@ -3166,49 +3576,49 @@ function FilterBar({
|
|
|
3166
3576
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3167
3577
|
const go = useMessage("filterBarGo", goLabel);
|
|
3168
3578
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3169
|
-
return /* @__PURE__ */ (0,
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-controls", children: [
|
|
3171
3581
|
children,
|
|
3172
|
-
onGo ? /* @__PURE__ */ (0,
|
|
3582
|
+
onGo ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3173
3583
|
] }),
|
|
3174
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0,
|
|
3175
|
-
activeFilters.map((filter) => /* @__PURE__ */ (0,
|
|
3176
|
-
activeFilters.length && onClear ? /* @__PURE__ */ (0,
|
|
3177
|
-
resultLabel ? /* @__PURE__ */ (0,
|
|
3178
|
-
actions ? /* @__PURE__ */ (0,
|
|
3584
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-foot", children: [
|
|
3585
|
+
activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
3586
|
+
activeFilters.length && onClear ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
3587
|
+
resultLabel ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
3588
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3179
3589
|
] }) : null
|
|
3180
3590
|
] });
|
|
3181
3591
|
}
|
|
3182
3592
|
|
|
3183
3593
|
// src/components/data/DescriptionList.tsx
|
|
3184
|
-
var
|
|
3594
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3185
3595
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
3186
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3187
3597
|
"dl",
|
|
3188
3598
|
{
|
|
3189
3599
|
className: cx("pire-dl", className),
|
|
3190
3600
|
"data-layout": layout,
|
|
3191
3601
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
3192
3602
|
...rest,
|
|
3193
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
3194
|
-
/* @__PURE__ */ (0,
|
|
3603
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("dt", { className: "pire-dl-term", children: [
|
|
3195
3605
|
item.label,
|
|
3196
3606
|
item.hint
|
|
3197
3607
|
] }),
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
3199
3609
|
] }, i))
|
|
3200
3610
|
}
|
|
3201
3611
|
);
|
|
3202
3612
|
}
|
|
3203
3613
|
|
|
3204
3614
|
// src/components/data/Timeline.tsx
|
|
3205
|
-
var
|
|
3615
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3206
3616
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
3207
3617
|
const list = reverse ? [...entries].reverse() : entries;
|
|
3208
|
-
return /* @__PURE__ */ (0,
|
|
3209
|
-
/* @__PURE__ */ (0,
|
|
3210
|
-
/* @__PURE__ */ (0,
|
|
3211
|
-
entry.actor ? /* @__PURE__ */ (0,
|
|
3618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("li", { className: "pire-timeline-item", children: [
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-time", children: entry.time }),
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-text", children: entry.event }),
|
|
3621
|
+
entry.actor ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
3212
3622
|
] }, entry.id ?? i)) });
|
|
3213
3623
|
}
|
|
3214
3624
|
|
|
@@ -3254,10 +3664,10 @@ function seriesColor(series, index) {
|
|
|
3254
3664
|
const slot = series.colorIndex ?? index + 1;
|
|
3255
3665
|
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
3256
3666
|
}
|
|
3257
|
-
var
|
|
3667
|
+
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
3258
3668
|
var warnedCharts = /* @__PURE__ */ new Set();
|
|
3259
3669
|
function warnOnSlotOverflow(series, chartLabel) {
|
|
3260
|
-
if (!
|
|
3670
|
+
if (!IS_DEV3 || warnedCharts.has(chartLabel)) return;
|
|
3261
3671
|
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
3262
3672
|
warnedCharts.add(chartLabel);
|
|
3263
3673
|
console.warn(
|
|
@@ -3265,7 +3675,7 @@ function warnOnSlotOverflow(series, chartLabel) {
|
|
|
3265
3675
|
);
|
|
3266
3676
|
}
|
|
3267
3677
|
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
3268
|
-
if (!
|
|
3678
|
+
if (!IS_DEV3 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
3269
3679
|
const complaints = [];
|
|
3270
3680
|
if (series.length > 1) {
|
|
3271
3681
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
@@ -3291,7 +3701,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
3291
3701
|
}
|
|
3292
3702
|
|
|
3293
3703
|
// src/components/data/ChartFrame.tsx
|
|
3294
|
-
var
|
|
3704
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3295
3705
|
function seriesLegend(series) {
|
|
3296
3706
|
return series.map((one, index) => ({
|
|
3297
3707
|
key: one.id,
|
|
@@ -3314,29 +3724,29 @@ function ChartFrame({
|
|
|
3314
3724
|
children
|
|
3315
3725
|
}) {
|
|
3316
3726
|
const msg = usePireMessages();
|
|
3317
|
-
return /* @__PURE__ */ (0,
|
|
3318
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3319
|
-
title ? /* @__PURE__ */ (0,
|
|
3320
|
-
description ? /* @__PURE__ */ (0,
|
|
3727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figure", { className: cx("pire-chart", className), style, children: [
|
|
3728
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figcaption", { className: "pire-chart-head", children: [
|
|
3729
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-title", children: title }) : null,
|
|
3730
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-desc", children: description }) : null
|
|
3321
3731
|
] }) : null,
|
|
3322
|
-
legend && legend.length > 1 ? /* @__PURE__ */ (0,
|
|
3323
|
-
/* @__PURE__ */ (0,
|
|
3732
|
+
legend && legend.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { className: "pire-chart-legend-item", children: [
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
3324
3734
|
item.label
|
|
3325
3735
|
] }, item.key)) }) : null,
|
|
3326
|
-
/* @__PURE__ */ (0,
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3329
|
-
/* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3331
|
-
series.map((one) => /* @__PURE__ */ (0,
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("table", { children: [
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("caption", { children: label }),
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
3741
|
+
series.map((one) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: one.label }, one.id))
|
|
3332
3742
|
] }) }),
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tbody", { children: categories.map((category, categoryIndex) => (
|
|
3334
3744
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3745
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3746
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "row", children: category }),
|
|
3337
3747
|
series.map((one) => {
|
|
3338
3748
|
const value = one.values[categoryIndex];
|
|
3339
|
-
return /* @__PURE__ */ (0,
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
3340
3750
|
})
|
|
3341
3751
|
] }, categoryIndex)
|
|
3342
3752
|
)) })
|
|
@@ -3345,7 +3755,7 @@ function ChartFrame({
|
|
|
3345
3755
|
}
|
|
3346
3756
|
|
|
3347
3757
|
// src/components/data/BarChart.tsx
|
|
3348
|
-
var
|
|
3758
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3349
3759
|
function BarChart({
|
|
3350
3760
|
categories,
|
|
3351
3761
|
series: rawSeries,
|
|
@@ -3377,7 +3787,7 @@ function BarChart({
|
|
|
3377
3787
|
const value = series[0].values[categoryIndex];
|
|
3378
3788
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
3379
3789
|
};
|
|
3380
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3381
3791
|
ChartFrame,
|
|
3382
3792
|
{
|
|
3383
3793
|
label,
|
|
@@ -3390,7 +3800,7 @@ function BarChart({
|
|
|
3390
3800
|
showDataTable,
|
|
3391
3801
|
className,
|
|
3392
3802
|
style,
|
|
3393
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3803
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3394
3804
|
"div",
|
|
3395
3805
|
{
|
|
3396
3806
|
className: "pire-chart-bars",
|
|
@@ -3399,12 +3809,12 @@ function BarChart({
|
|
|
3399
3809
|
style: { "--pire-chart-height": `${height}px` },
|
|
3400
3810
|
children: categories.map((category, categoryIndex) => (
|
|
3401
3811
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3812
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "pire-chart-group", children: [
|
|
3813
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-cat", children: category }),
|
|
3814
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
3405
3815
|
const value = one.values[categoryIndex];
|
|
3406
3816
|
if (value == null) return null;
|
|
3407
|
-
return /* @__PURE__ */ (0,
|
|
3817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3408
3818
|
"div",
|
|
3409
3819
|
{
|
|
3410
3820
|
className: "pire-chart-bar",
|
|
@@ -3413,8 +3823,8 @@ function BarChart({
|
|
|
3413
3823
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
3414
3824
|
},
|
|
3415
3825
|
children: [
|
|
3416
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */ (0,
|
|
3417
|
-
/* @__PURE__ */ (0,
|
|
3826
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
3827
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3418
3828
|
series.length > 1 ? `${one.label}: ` : "",
|
|
3419
3829
|
formatValue(value)
|
|
3420
3830
|
] })
|
|
@@ -3423,7 +3833,7 @@ function BarChart({
|
|
|
3423
3833
|
one.id
|
|
3424
3834
|
);
|
|
3425
3835
|
}) }),
|
|
3426
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0,
|
|
3836
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
3427
3837
|
] }, categoryIndex)
|
|
3428
3838
|
))
|
|
3429
3839
|
}
|
|
@@ -3433,14 +3843,14 @@ function BarChart({
|
|
|
3433
3843
|
}
|
|
3434
3844
|
|
|
3435
3845
|
// src/components/data/LineChart.tsx
|
|
3436
|
-
var
|
|
3437
|
-
var
|
|
3846
|
+
var React26 = __toESM(require("react"), 1);
|
|
3847
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3438
3848
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
3439
3849
|
var MARKER_LIMIT = 20;
|
|
3440
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
3850
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React26.useEffect : React26.useLayoutEffect;
|
|
3441
3851
|
function useMeasuredWidth() {
|
|
3442
|
-
const ref =
|
|
3443
|
-
const [width, setWidth] =
|
|
3852
|
+
const ref = React26.useRef(null);
|
|
3853
|
+
const [width, setWidth] = React26.useState(0);
|
|
3444
3854
|
useIsomorphicLayoutEffect2(() => {
|
|
3445
3855
|
const element = ref.current;
|
|
3446
3856
|
if (!element) return;
|
|
@@ -3501,7 +3911,7 @@ function LineChart({
|
|
|
3501
3911
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
3502
3912
|
};
|
|
3503
3913
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
3504
|
-
return /* @__PURE__ */ (0,
|
|
3914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3505
3915
|
ChartFrame,
|
|
3506
3916
|
{
|
|
3507
3917
|
label,
|
|
@@ -3514,8 +3924,8 @@ function LineChart({
|
|
|
3514
3924
|
showDataTable,
|
|
3515
3925
|
className,
|
|
3516
3926
|
style,
|
|
3517
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3518
|
-
width > 0 ? /* @__PURE__ */ (0,
|
|
3927
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
3928
|
+
width > 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3519
3929
|
"svg",
|
|
3520
3930
|
{
|
|
3521
3931
|
width,
|
|
@@ -3524,7 +3934,7 @@ function LineChart({
|
|
|
3524
3934
|
"aria-hidden": "true",
|
|
3525
3935
|
focusable: "false",
|
|
3526
3936
|
children: [
|
|
3527
|
-
/* @__PURE__ */ (0,
|
|
3937
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3528
3938
|
"line",
|
|
3529
3939
|
{
|
|
3530
3940
|
x1: PLOT_INSET.left,
|
|
@@ -3534,8 +3944,8 @@ function LineChart({
|
|
|
3534
3944
|
},
|
|
3535
3945
|
tick
|
|
3536
3946
|
)) }),
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3538
|
-
scale.ticks.map((tick) => /* @__PURE__ */ (0,
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("g", { className: "pire-chart-tick", children: [
|
|
3948
|
+
scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3539
3949
|
"text",
|
|
3540
3950
|
{
|
|
3541
3951
|
x: PLOT_INSET.left - 8,
|
|
@@ -3548,10 +3958,10 @@ function LineChart({
|
|
|
3548
3958
|
)),
|
|
3549
3959
|
categories.map((category, index) => index % labelEvery === 0 ? (
|
|
3550
3960
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3961
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
3552
3962
|
) : null)
|
|
3553
3963
|
] }),
|
|
3554
|
-
showArea && series[0] ? /* @__PURE__ */ (0,
|
|
3964
|
+
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3555
3965
|
"path",
|
|
3556
3966
|
{
|
|
3557
3967
|
d: areaFor(series[0].values),
|
|
@@ -3559,10 +3969,10 @@ function LineChart({
|
|
|
3559
3969
|
style: { fill: seriesColor(series[0], 0) }
|
|
3560
3970
|
}
|
|
3561
3971
|
) : null,
|
|
3562
|
-
/* @__PURE__ */ (0,
|
|
3563
|
-
withMarkers ? /* @__PURE__ */ (0,
|
|
3972
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
3973
|
+
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map((one, seriesIndex) => one.values.map((value, index) => value == null ? null : (
|
|
3564
3974
|
// biome-ignore lint/suspicious/noArrayIndexKey: a series is positional — the index is the point's identity, and category labels repeat.
|
|
3565
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3566
3976
|
"circle",
|
|
3567
3977
|
{
|
|
3568
3978
|
cx: xAt(index),
|
|
@@ -3576,18 +3986,18 @@ function LineChart({
|
|
|
3576
3986
|
]
|
|
3577
3987
|
}
|
|
3578
3988
|
) : null,
|
|
3579
|
-
/* @__PURE__ */ (0,
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3580
3990
|
"div",
|
|
3581
3991
|
{
|
|
3582
3992
|
className: "pire-chart-hover",
|
|
3583
3993
|
style: { inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px` },
|
|
3584
3994
|
children: categories.map((category, categoryIndex) => (
|
|
3585
3995
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3586
|
-
/* @__PURE__ */ (0,
|
|
3587
|
-
/* @__PURE__ */ (0,
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-band", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3997
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: category }),
|
|
3588
3998
|
series.map((one) => {
|
|
3589
3999
|
const value = one.values[categoryIndex];
|
|
3590
|
-
return /* @__PURE__ */ (0,
|
|
4000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip-row", children: [
|
|
3591
4001
|
one.label,
|
|
3592
4002
|
": ",
|
|
3593
4003
|
value == null ? "No data" : formatValue(value)
|
|
@@ -3603,8 +4013,8 @@ function LineChart({
|
|
|
3603
4013
|
}
|
|
3604
4014
|
|
|
3605
4015
|
// src/components/data/DonutChart.tsx
|
|
3606
|
-
var
|
|
3607
|
-
var
|
|
4016
|
+
var React27 = __toESM(require("react"), 1);
|
|
4017
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3608
4018
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
3609
4019
|
function DonutChart({
|
|
3610
4020
|
categories,
|
|
@@ -3624,7 +4034,7 @@ function DonutChart({
|
|
|
3624
4034
|
}) {
|
|
3625
4035
|
const label = rest["aria-label"];
|
|
3626
4036
|
const msg = usePireMessages();
|
|
3627
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4037
|
+
const [hoveredIndex, setHoveredIndex] = React27.useState(null);
|
|
3628
4038
|
warnOnDonutShape(series, categories.length, label);
|
|
3629
4039
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
3630
4040
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -3641,7 +4051,7 @@ function DonutChart({
|
|
|
3641
4051
|
}));
|
|
3642
4052
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
3643
4053
|
let arcStart = 0;
|
|
3644
|
-
return /* @__PURE__ */ (0,
|
|
4054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3645
4055
|
ChartFrame,
|
|
3646
4056
|
{
|
|
3647
4057
|
label,
|
|
@@ -3654,8 +4064,8 @@ function DonutChart({
|
|
|
3654
4064
|
showDataTable,
|
|
3655
4065
|
className,
|
|
3656
4066
|
style,
|
|
3657
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3658
|
-
/* @__PURE__ */ (0,
|
|
4067
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3659
4069
|
"svg",
|
|
3660
4070
|
{
|
|
3661
4071
|
width: size,
|
|
@@ -3663,13 +4073,13 @@ function DonutChart({
|
|
|
3663
4073
|
"aria-hidden": "true",
|
|
3664
4074
|
focusable: "false",
|
|
3665
4075
|
onMouseLeave: () => setHoveredIndex(null),
|
|
3666
|
-
children: /* @__PURE__ */ (0,
|
|
4076
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
3667
4077
|
const arcLength = segment.value / total * circumference;
|
|
3668
4078
|
const offset = arcStart;
|
|
3669
4079
|
arcStart += arcLength;
|
|
3670
4080
|
return (
|
|
3671
4081
|
// 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.
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3673
4083
|
"circle",
|
|
3674
4084
|
{
|
|
3675
4085
|
className: "pire-chart-arc",
|
|
@@ -3689,9 +4099,9 @@ function DonutChart({
|
|
|
3689
4099
|
}) })
|
|
3690
4100
|
}
|
|
3691
4101
|
),
|
|
3692
|
-
/* @__PURE__ */ (0,
|
|
3693
|
-
/* @__PURE__ */ (0,
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
3695
4105
|
] })
|
|
3696
4106
|
] })
|
|
3697
4107
|
}
|
|
@@ -3702,15 +4112,15 @@ function colorForSegment(index) {
|
|
|
3702
4112
|
}
|
|
3703
4113
|
|
|
3704
4114
|
// src/components/data/LinkList.tsx
|
|
3705
|
-
var
|
|
3706
|
-
var
|
|
4115
|
+
var import_react_aria_components33 = require("react-aria-components");
|
|
4116
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3707
4117
|
function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
3708
|
-
return /* @__PURE__ */ (0,
|
|
3709
|
-
const keySlot = item.key ? /* @__PURE__ */ (0,
|
|
3710
|
-
const textSlot = item.text ? /* @__PURE__ */ (0,
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4119
|
+
const keySlot = item.key ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4120
|
+
const textSlot = item.text ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
3711
4121
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
3712
|
-
return /* @__PURE__ */ (0,
|
|
3713
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { role: "listitem", className: "pire-linklist-row", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_aria_components33.Button, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
4123
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
3714
4124
|
first,
|
|
3715
4125
|
second,
|
|
3716
4126
|
item.trailing
|
|
@@ -3718,8 +4128,73 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
3718
4128
|
}) });
|
|
3719
4129
|
}
|
|
3720
4130
|
|
|
4131
|
+
// src/components/data/RecordCard.tsx
|
|
4132
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4133
|
+
function RecordCard({ title, subtitle, icon, action, isDisabled, className, ...rest }) {
|
|
4134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cx("pire-recordcard", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
4135
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: icon, size: 20 }) }) : null,
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pire-recordcard-body", children: [
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-title", children: title }),
|
|
4138
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4139
|
+
] }),
|
|
4140
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4141
|
+
] });
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
// src/components/data/ViewSwitcher.tsx
|
|
4145
|
+
var import_react_aria_components34 = require("react-aria-components");
|
|
4146
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4147
|
+
function ViewSwitcher({
|
|
4148
|
+
name,
|
|
4149
|
+
isDirty,
|
|
4150
|
+
icon = "star",
|
|
4151
|
+
onPress,
|
|
4152
|
+
isDisabled,
|
|
4153
|
+
"aria-label": ariaLabel,
|
|
4154
|
+
className,
|
|
4155
|
+
style
|
|
4156
|
+
}) {
|
|
4157
|
+
const msg = usePireMessages();
|
|
4158
|
+
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4160
|
+
import_react_aria_components34.Button,
|
|
4161
|
+
{
|
|
4162
|
+
className: cx("pire-viewswitcher", className),
|
|
4163
|
+
style,
|
|
4164
|
+
"aria-label": label,
|
|
4165
|
+
isDisabled,
|
|
4166
|
+
onPress,
|
|
4167
|
+
children: [
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: icon, size: 16 }),
|
|
4169
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4170
|
+
isDirty ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
4172
|
+
]
|
|
4173
|
+
}
|
|
4174
|
+
);
|
|
4175
|
+
}
|
|
4176
|
+
|
|
4177
|
+
// src/components/data/BarList.tsx
|
|
4178
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4179
|
+
function BarList({ items, max, className, ...rest }) {
|
|
4180
|
+
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4182
|
+
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-main", children: [
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-label", children: item.label }),
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-track", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-fill", style: { width: `${pct}%` } }) })
|
|
4187
|
+
] }),
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-figure", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4190
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4191
|
+
] })
|
|
4192
|
+
] }, item.id);
|
|
4193
|
+
}) });
|
|
4194
|
+
}
|
|
4195
|
+
|
|
3721
4196
|
// src/components/layout/PageBand.tsx
|
|
3722
|
-
var
|
|
4197
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3723
4198
|
function PageBand({
|
|
3724
4199
|
surface = "card",
|
|
3725
4200
|
hasBorder = true,
|
|
@@ -3727,7 +4202,7 @@ function PageBand({
|
|
|
3727
4202
|
className,
|
|
3728
4203
|
...rest
|
|
3729
4204
|
}) {
|
|
3730
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3731
4206
|
"div",
|
|
3732
4207
|
{
|
|
3733
4208
|
className: cx("pire-pageband", className),
|
|
@@ -3740,56 +4215,56 @@ function PageBand({
|
|
|
3740
4215
|
}
|
|
3741
4216
|
|
|
3742
4217
|
// src/components/layout/PageHeader.tsx
|
|
3743
|
-
var
|
|
4218
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3744
4219
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
3745
|
-
return /* @__PURE__ */ (0,
|
|
3746
|
-
/* @__PURE__ */ (0,
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3748
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h1", { className: "pire-pageheader-title", children: title }),
|
|
4223
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
3749
4224
|
] }),
|
|
3750
|
-
actions ? /* @__PURE__ */ (0,
|
|
4225
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
3751
4226
|
] });
|
|
3752
4227
|
}
|
|
3753
4228
|
|
|
3754
4229
|
// src/components/layout/SectionHeader.tsx
|
|
3755
|
-
var
|
|
4230
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3756
4231
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
3757
|
-
return /* @__PURE__ */ (0,
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
3759
|
-
meta ? /* @__PURE__ */ (0,
|
|
3760
|
-
actions ? /* @__PURE__ */ (0,
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "pire-eyebrow", children: title }),
|
|
4234
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
4235
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
3761
4236
|
] });
|
|
3762
4237
|
}
|
|
3763
4238
|
|
|
3764
4239
|
// src/components/layout/SelectionBar.tsx
|
|
3765
|
-
var
|
|
4240
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3766
4241
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
3767
4242
|
if (!count) return null;
|
|
3768
|
-
return /* @__PURE__ */ (0,
|
|
3769
|
-
/* @__PURE__ */ (0,
|
|
4243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
3770
4245
|
count.toLocaleString(),
|
|
3771
4246
|
" ",
|
|
3772
4247
|
noun,
|
|
3773
4248
|
count === 1 ? "" : "s",
|
|
3774
4249
|
" selected"
|
|
3775
4250
|
] }),
|
|
3776
|
-
children ? /* @__PURE__ */ (0,
|
|
3777
|
-
actions ? /* @__PURE__ */ (0,
|
|
4251
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
4252
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
3778
4253
|
] });
|
|
3779
4254
|
}
|
|
3780
4255
|
|
|
3781
4256
|
// src/components/layout/FooterBar.tsx
|
|
3782
|
-
var
|
|
4257
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3783
4258
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
3784
|
-
return /* @__PURE__ */ (0,
|
|
3785
|
-
note ? /* @__PURE__ */ (0,
|
|
4259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
4260
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
3786
4261
|
children,
|
|
3787
|
-
actions ? /* @__PURE__ */ (0,
|
|
4262
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
3788
4263
|
] });
|
|
3789
4264
|
}
|
|
3790
4265
|
|
|
3791
4266
|
// src/components/layout/SplitPane.tsx
|
|
3792
|
-
var
|
|
4267
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3793
4268
|
function SplitPane({
|
|
3794
4269
|
list,
|
|
3795
4270
|
detail,
|
|
@@ -3805,7 +4280,7 @@ function SplitPane({
|
|
|
3805
4280
|
}) {
|
|
3806
4281
|
const msg = usePireMessages();
|
|
3807
4282
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
3808
|
-
return /* @__PURE__ */ (0,
|
|
4283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3809
4284
|
"div",
|
|
3810
4285
|
{
|
|
3811
4286
|
className: cx("pire-split", className),
|
|
@@ -3813,10 +4288,10 @@ function SplitPane({
|
|
|
3813
4288
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
3814
4289
|
...rest,
|
|
3815
4290
|
children: [
|
|
3816
|
-
/* @__PURE__ */ (0,
|
|
3817
|
-
/* @__PURE__ */ (0,
|
|
3818
|
-
onBack ? /* @__PURE__ */ (0,
|
|
3819
|
-
detail ?? /* @__PURE__ */ (0,
|
|
4291
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
4292
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
4293
|
+
onBack ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pire-split-back", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Button, { variant: "tertiary", size: "sm", icon: "arrow-left", onPress: onBack, children: backLabel ?? msg.splitPaneBack }) }) : null,
|
|
4294
|
+
detail ?? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pire-split-empty", children: emptyDetail })
|
|
3820
4295
|
] })
|
|
3821
4296
|
]
|
|
3822
4297
|
}
|
|
@@ -3824,11 +4299,12 @@ function SplitPane({
|
|
|
3824
4299
|
}
|
|
3825
4300
|
|
|
3826
4301
|
// src/components/patterns/ConfirmDialog.tsx
|
|
3827
|
-
var
|
|
4302
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3828
4303
|
function ConfirmDialog({
|
|
3829
4304
|
isOpen,
|
|
3830
4305
|
title,
|
|
3831
4306
|
subtitle,
|
|
4307
|
+
facts,
|
|
3832
4308
|
consequence,
|
|
3833
4309
|
children,
|
|
3834
4310
|
confirmLabel = "Confirm",
|
|
@@ -3838,7 +4314,8 @@ function ConfirmDialog({
|
|
|
3838
4314
|
onConfirm,
|
|
3839
4315
|
onCancel
|
|
3840
4316
|
}) {
|
|
3841
|
-
|
|
4317
|
+
const msg = usePireMessages();
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3842
4319
|
Dialog,
|
|
3843
4320
|
{
|
|
3844
4321
|
isOpen,
|
|
@@ -3848,12 +4325,19 @@ function ConfirmDialog({
|
|
|
3848
4325
|
onClose: onCancel,
|
|
3849
4326
|
isDismissable: !isBusy,
|
|
3850
4327
|
showClose: false,
|
|
3851
|
-
footer: /* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
4328
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
3854
4331
|
] }),
|
|
3855
4332
|
children: [
|
|
3856
|
-
|
|
4333
|
+
facts?.length ? (
|
|
4334
|
+
// The role is what makes the name stick. A bare <div> resolves to `generic`, which
|
|
4335
|
+
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4336
|
+
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4337
|
+
// pairs with an explicit role for the same reason.
|
|
4338
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DescriptionList, { layout: "rows", items: facts }) })
|
|
4339
|
+
) : null,
|
|
4340
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
3857
4341
|
children
|
|
3858
4342
|
]
|
|
3859
4343
|
}
|
|
@@ -3861,9 +4345,9 @@ function ConfirmDialog({
|
|
|
3861
4345
|
}
|
|
3862
4346
|
|
|
3863
4347
|
// src/components/patterns/CommandPalette.tsx
|
|
3864
|
-
var
|
|
3865
|
-
var
|
|
3866
|
-
var
|
|
4348
|
+
var React28 = __toESM(require("react"), 1);
|
|
4349
|
+
var import_react_aria_components35 = require("react-aria-components");
|
|
4350
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3867
4351
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
3868
4352
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
3869
4353
|
function CommandPalette({
|
|
@@ -3884,17 +4368,17 @@ function CommandPalette({
|
|
|
3884
4368
|
style
|
|
3885
4369
|
}) {
|
|
3886
4370
|
const msg = usePireMessages();
|
|
3887
|
-
const [query, setQuery] =
|
|
3888
|
-
const { contains } = (0,
|
|
3889
|
-
|
|
4371
|
+
const [query, setQuery] = React28.useState("");
|
|
4372
|
+
const { contains } = (0, import_react_aria_components35.useFilter)({ sensitivity: "base" });
|
|
4373
|
+
React28.useEffect(() => {
|
|
3890
4374
|
if (isOpen) setQuery("");
|
|
3891
4375
|
}, [isOpen]);
|
|
3892
|
-
const searchableById =
|
|
4376
|
+
const searchableById = React28.useMemo(() => {
|
|
3893
4377
|
const byId = /* @__PURE__ */ new Map();
|
|
3894
4378
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
3895
4379
|
return byId;
|
|
3896
4380
|
}, [groups]);
|
|
3897
|
-
const filter =
|
|
4381
|
+
const filter = React28.useCallback((textValue, inputValue, node) => {
|
|
3898
4382
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
3899
4383
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
3900
4384
|
}, [contains, searchableById]);
|
|
@@ -3904,8 +4388,8 @@ function CommandPalette({
|
|
|
3904
4388
|
};
|
|
3905
4389
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
3906
4390
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
3907
|
-
return /* @__PURE__ */ (0,
|
|
3908
|
-
|
|
4391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4392
|
+
import_react_aria_components35.ModalOverlay,
|
|
3909
4393
|
{
|
|
3910
4394
|
className: "pire-cp-overlay",
|
|
3911
4395
|
isOpen,
|
|
@@ -3913,12 +4397,12 @@ function CommandPalette({
|
|
|
3913
4397
|
onOpenChange: (open) => {
|
|
3914
4398
|
if (!open) onOpenChange?.(false);
|
|
3915
4399
|
},
|
|
3916
|
-
children: /* @__PURE__ */ (0,
|
|
3917
|
-
/* @__PURE__ */ (0,
|
|
3918
|
-
/* @__PURE__ */ (0,
|
|
3919
|
-
/* @__PURE__ */ (0,
|
|
3920
|
-
/* @__PURE__ */ (0,
|
|
3921
|
-
|
|
4400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_aria_components35.Modal, { className: cx("pire-cp-modal", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.Dialog, { className: "pire-cp-dialog", "aria-label": ariaLabel ?? msg.commandPaletteLabel, children: [
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4405
|
+
import_react_aria_components35.Input,
|
|
3922
4406
|
{
|
|
3923
4407
|
className: "pire-cp-input",
|
|
3924
4408
|
autoFocus: true,
|
|
@@ -3926,16 +4410,16 @@ function CommandPalette({
|
|
|
3926
4410
|
}
|
|
3927
4411
|
)
|
|
3928
4412
|
] }),
|
|
3929
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
3931
|
-
|
|
4413
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4415
|
+
import_react_aria_components35.Menu,
|
|
3932
4416
|
{
|
|
3933
4417
|
className: "pire-cp-list",
|
|
3934
4418
|
onAction: (key) => onAction?.(String(key)),
|
|
3935
|
-
renderEmptyState: () => /* @__PURE__ */ (0,
|
|
3936
|
-
children: sections.map((section) => /* @__PURE__ */ (0,
|
|
3937
|
-
section.label ? /* @__PURE__ */ (0,
|
|
3938
|
-
section.items.map((item) => /* @__PURE__ */ (0,
|
|
4419
|
+
renderEmptyState: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-status", children: status }),
|
|
4420
|
+
children: sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.MenuSection, { id: section.id, className: "pire-cp-section", children: [
|
|
4421
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_aria_components35.Header, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
4422
|
+
section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3939
4423
|
MenuItem,
|
|
3940
4424
|
{
|
|
3941
4425
|
id: item.id,
|
|
@@ -3956,18 +4440,18 @@ function CommandPalette({
|
|
|
3956
4440
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
3957
4441
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
3958
4442
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
3959
|
-
/* @__PURE__ */ (0,
|
|
3960
|
-
/* @__PURE__ */ (0,
|
|
3961
|
-
/* @__PURE__ */ (0,
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-foot", "aria-hidden": "true", children: footer ?? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2191" }),
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2193" }),
|
|
3963
4447
|
msg.commandPaletteHintNavigate
|
|
3964
4448
|
] }),
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3966
|
-
/* @__PURE__ */ (0,
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4450
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u21B5" }),
|
|
3967
4451
|
msg.commandPaletteHintSelect
|
|
3968
4452
|
] }),
|
|
3969
|
-
/* @__PURE__ */ (0,
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "esc" }),
|
|
3971
4455
|
msg.commandPaletteHintClose
|
|
3972
4456
|
] })
|
|
3973
4457
|
] }) })
|
|
@@ -3977,9 +4461,9 @@ function CommandPalette({
|
|
|
3977
4461
|
);
|
|
3978
4462
|
}
|
|
3979
4463
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
3980
|
-
const handler =
|
|
4464
|
+
const handler = React28.useRef(onTrigger);
|
|
3981
4465
|
handler.current = onTrigger;
|
|
3982
|
-
|
|
4466
|
+
React28.useEffect(() => {
|
|
3983
4467
|
if (isDisabled) return;
|
|
3984
4468
|
const onKeyDown = (event) => {
|
|
3985
4469
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -3993,9 +4477,9 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
3993
4477
|
}
|
|
3994
4478
|
|
|
3995
4479
|
// src/components/patterns/AppLauncher.tsx
|
|
3996
|
-
var
|
|
3997
|
-
var
|
|
3998
|
-
var
|
|
4480
|
+
var React29 = __toESM(require("react"), 1);
|
|
4481
|
+
var import_react_aria_components36 = require("react-aria-components");
|
|
4482
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3999
4483
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4000
4484
|
function AppLauncher({
|
|
4001
4485
|
sections,
|
|
@@ -4014,13 +4498,13 @@ function AppLauncher({
|
|
|
4014
4498
|
className
|
|
4015
4499
|
}) {
|
|
4016
4500
|
const msg = usePireMessages();
|
|
4017
|
-
const [query, setQuery] =
|
|
4018
|
-
const { contains } = (0,
|
|
4501
|
+
const [query, setQuery] = React29.useState("");
|
|
4502
|
+
const { contains } = (0, import_react_aria_components36.useFilter)({ sensitivity: "base" });
|
|
4019
4503
|
const handleSearch = (next) => {
|
|
4020
4504
|
setQuery(next);
|
|
4021
4505
|
onSearchChange?.(next);
|
|
4022
4506
|
};
|
|
4023
|
-
const visible =
|
|
4507
|
+
const visible = React29.useMemo(() => {
|
|
4024
4508
|
if (isFilteredExternally) return sections;
|
|
4025
4509
|
const q = query.trim();
|
|
4026
4510
|
if (!q) return sections;
|
|
@@ -4028,25 +4512,25 @@ function AppLauncher({
|
|
|
4028
4512
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4029
4513
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4030
4514
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4031
|
-
return /* @__PURE__ */ (0,
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
4034
|
-
|
|
4515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_aria_components36.DialogTrigger, { children: [
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react_aria_components36.Button, { className: "pire-launcher-trigger", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { name: icon, size: 20 }) }),
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4518
|
+
import_react_aria_components36.Popover,
|
|
4035
4519
|
{
|
|
4036
4520
|
className: cx("pire-launcher-popover", className),
|
|
4037
4521
|
placement: "bottom start",
|
|
4038
4522
|
offset: 0,
|
|
4039
4523
|
crossOffset: 0,
|
|
4040
4524
|
containerPadding: 0,
|
|
4041
|
-
children: /* @__PURE__ */ (0,
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4044
|
-
meta ? /* @__PURE__ */ (0,
|
|
4525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react_aria_components36.Dialog, { className: "pire-launcher", "aria-label": label, children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-head", children: [
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
4528
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
4045
4529
|
] }),
|
|
4046
4530
|
isSearchable ? (
|
|
4047
4531
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
4048
4532
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4050
4534
|
Input,
|
|
4051
4535
|
{
|
|
4052
4536
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -4060,18 +4544,18 @@ function AppLauncher({
|
|
|
4060
4544
|
}
|
|
4061
4545
|
)
|
|
4062
4546
|
) : null,
|
|
4063
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
4064
|
-
isEmpty ? /* @__PURE__ */ (0,
|
|
4547
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
4548
|
+
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
4065
4549
|
visible.map((section, si) => (
|
|
4066
4550
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
4067
4551
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
4068
|
-
/* @__PURE__ */ (0,
|
|
4069
|
-
section.label ? /* @__PURE__ */ (0,
|
|
4070
|
-
/* @__PURE__ */ (0,
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-section", children: [
|
|
4553
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
4554
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
4071
4555
|
const isCurrent = item.id === value;
|
|
4072
4556
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
4073
|
-
return /* @__PURE__ */ (0,
|
|
4074
|
-
|
|
4557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
4558
|
+
import_react_aria_components36.Button,
|
|
4075
4559
|
{
|
|
4076
4560
|
className: "pire-launcher-item",
|
|
4077
4561
|
"data-selected": isCurrent ? "true" : void 0,
|
|
@@ -4081,10 +4565,10 @@ function AppLauncher({
|
|
|
4081
4565
|
onAction?.(item.id);
|
|
4082
4566
|
},
|
|
4083
4567
|
children: [
|
|
4084
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
showsDescription ? /* @__PURE__ */ (0,
|
|
4568
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { name: item.icon, size: (section.variant ?? "tile") === "tile" ? 20 : 16 }) }) : null,
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "pire-launcher-item-text", children: [
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4571
|
+
showsDescription ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
4088
4572
|
] })
|
|
4089
4573
|
]
|
|
4090
4574
|
},
|
|
@@ -4100,12 +4584,12 @@ function AppLauncher({
|
|
|
4100
4584
|
}
|
|
4101
4585
|
|
|
4102
4586
|
// src/components/patterns/SidePanel.tsx
|
|
4103
|
-
var
|
|
4104
|
-
var
|
|
4587
|
+
var import_react_aria_components37 = require("react-aria-components");
|
|
4588
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4105
4589
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
4106
4590
|
const msg = usePireMessages();
|
|
4107
|
-
return /* @__PURE__ */ (0,
|
|
4108
|
-
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4592
|
+
import_react_aria_components37.ModalOverlay,
|
|
4109
4593
|
{
|
|
4110
4594
|
className: "pire-sidepanel-overlay",
|
|
4111
4595
|
isOpen,
|
|
@@ -4113,36 +4597,151 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4113
4597
|
onOpenChange: (o) => {
|
|
4114
4598
|
if (!o) onClose?.();
|
|
4115
4599
|
},
|
|
4116
|
-
children: /* @__PURE__ */ (0,
|
|
4117
|
-
/* @__PURE__ */ (0,
|
|
4118
|
-
/* @__PURE__ */ (0,
|
|
4119
|
-
/* @__PURE__ */ (0,
|
|
4120
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components37.Modal, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react_aria_components37.Dialog, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
4601
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
4602
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components37.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
4604
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
4121
4605
|
] }),
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
4123
4607
|
] }),
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4125
|
-
footer ? /* @__PURE__ */ (0,
|
|
4608
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
4609
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
4126
4610
|
] }) })
|
|
4127
4611
|
}
|
|
4128
4612
|
);
|
|
4129
4613
|
}
|
|
4130
4614
|
|
|
4131
4615
|
// src/components/patterns/EmptyState.tsx
|
|
4132
|
-
var
|
|
4616
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4133
4617
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
4134
|
-
return /* @__PURE__ */ (0,
|
|
4135
|
-
/* @__PURE__ */ (0,
|
|
4136
|
-
title ? /* @__PURE__ */ (0,
|
|
4137
|
-
children ? /* @__PURE__ */ (0,
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4620
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
4621
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
4138
4622
|
action
|
|
4139
4623
|
] });
|
|
4140
4624
|
}
|
|
4141
4625
|
|
|
4626
|
+
// src/components/patterns/NumPad.tsx
|
|
4627
|
+
var React30 = __toESM(require("react"), 1);
|
|
4628
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4629
|
+
var BASE_KEYS = [
|
|
4630
|
+
{ value: "7" },
|
|
4631
|
+
{ value: "8" },
|
|
4632
|
+
{ value: "9" },
|
|
4633
|
+
{ value: "clear", label: "C" },
|
|
4634
|
+
{ value: "4" },
|
|
4635
|
+
{ value: "5" },
|
|
4636
|
+
{ value: "6" },
|
|
4637
|
+
{ value: "backspace", label: "\u232B" },
|
|
4638
|
+
{ value: "1" },
|
|
4639
|
+
{ value: "2" },
|
|
4640
|
+
{ value: "3" },
|
|
4641
|
+
{ value: "0" }
|
|
4642
|
+
];
|
|
4643
|
+
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
4644
|
+
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
4645
|
+
const handler = React30.useRef(onKey);
|
|
4646
|
+
handler.current = onKey;
|
|
4647
|
+
React30.useEffect(() => {
|
|
4648
|
+
if (isDisabled) return;
|
|
4649
|
+
const isEditingElsewhere = () => {
|
|
4650
|
+
const el = document.activeElement;
|
|
4651
|
+
if (!el) return false;
|
|
4652
|
+
const tag = el.tagName;
|
|
4653
|
+
return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || el.hasAttribute("contenteditable");
|
|
4654
|
+
};
|
|
4655
|
+
const isBackgroundedByAnOverlay = () => containerRef.current?.closest("[inert]") != null;
|
|
4656
|
+
const onKeyDown = (event) => {
|
|
4657
|
+
if (event.metaKey || event.ctrlKey || event.altKey) return;
|
|
4658
|
+
if (isEditingElsewhere() || isBackgroundedByAnOverlay()) return;
|
|
4659
|
+
if (event.key >= "0" && event.key <= "9") {
|
|
4660
|
+
handler.current(event.key);
|
|
4661
|
+
return;
|
|
4662
|
+
}
|
|
4663
|
+
if (event.key === "Backspace") {
|
|
4664
|
+
handler.current("backspace");
|
|
4665
|
+
return;
|
|
4666
|
+
}
|
|
4667
|
+
if (event.key === "Escape") {
|
|
4668
|
+
handler.current("clear");
|
|
4669
|
+
return;
|
|
4670
|
+
}
|
|
4671
|
+
};
|
|
4672
|
+
document.addEventListener("keydown", onKeyDown);
|
|
4673
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
4674
|
+
}, [isDisabled, containerRef]);
|
|
4675
|
+
}
|
|
4676
|
+
function NumPad({
|
|
4677
|
+
"aria-label": ariaLabel,
|
|
4678
|
+
target,
|
|
4679
|
+
value,
|
|
4680
|
+
onChange,
|
|
4681
|
+
extraKeys = [],
|
|
4682
|
+
onAction,
|
|
4683
|
+
isDisabled,
|
|
4684
|
+
size = "md",
|
|
4685
|
+
className,
|
|
4686
|
+
style
|
|
4687
|
+
}) {
|
|
4688
|
+
const msg = usePireMessages();
|
|
4689
|
+
const containerRef = React30.useRef(null);
|
|
4690
|
+
const applyKey = React30.useCallback((key) => {
|
|
4691
|
+
if (isDisabled) return;
|
|
4692
|
+
if (key.value === "backspace") {
|
|
4693
|
+
onChange(value.slice(0, -1));
|
|
4694
|
+
return;
|
|
4695
|
+
}
|
|
4696
|
+
if (key.value === "clear") {
|
|
4697
|
+
onChange("");
|
|
4698
|
+
return;
|
|
4699
|
+
}
|
|
4700
|
+
if (isInsertable(key.value)) {
|
|
4701
|
+
onChange(value + key.value);
|
|
4702
|
+
return;
|
|
4703
|
+
}
|
|
4704
|
+
onAction?.(key.value);
|
|
4705
|
+
}, [isDisabled, value, onChange, onAction]);
|
|
4706
|
+
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4707
|
+
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4709
|
+
"div",
|
|
4710
|
+
{
|
|
4711
|
+
ref: containerRef,
|
|
4712
|
+
className: cx("pire-numpad", className),
|
|
4713
|
+
style,
|
|
4714
|
+
"data-size": size,
|
|
4715
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
4716
|
+
children: [
|
|
4717
|
+
target !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
4719
|
+
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
4720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4721
|
+
Button,
|
|
4722
|
+
{
|
|
4723
|
+
variant: "secondary",
|
|
4724
|
+
size,
|
|
4725
|
+
fullWidth: true,
|
|
4726
|
+
className: "pire-numpad-key",
|
|
4727
|
+
"data-span": key.span === 2 ? "2" : void 0,
|
|
4728
|
+
isDisabled,
|
|
4729
|
+
"aria-label": accessibleLabel,
|
|
4730
|
+
onPress: () => applyKey(key),
|
|
4731
|
+
children: key.label ?? key.value
|
|
4732
|
+
},
|
|
4733
|
+
key.value
|
|
4734
|
+
);
|
|
4735
|
+
}) })
|
|
4736
|
+
]
|
|
4737
|
+
}
|
|
4738
|
+
);
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4142
4741
|
// src/components/patterns/FileDropZone.tsx
|
|
4143
|
-
var
|
|
4144
|
-
var
|
|
4145
|
-
var
|
|
4742
|
+
var React31 = __toESM(require("react"), 1);
|
|
4743
|
+
var import_react_aria_components38 = require("react-aria-components");
|
|
4744
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4146
4745
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
4147
4746
|
function FileDropZone({
|
|
4148
4747
|
label,
|
|
@@ -4170,10 +4769,10 @@ function FileDropZone({
|
|
|
4170
4769
|
...rest
|
|
4171
4770
|
}) {
|
|
4172
4771
|
const msg = usePireMessages();
|
|
4173
|
-
const [uncontrolled, setUncontrolled] =
|
|
4772
|
+
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4174
4773
|
const files = value ?? uncontrolled;
|
|
4175
|
-
const created =
|
|
4176
|
-
|
|
4774
|
+
const created = React31.useRef([]);
|
|
4775
|
+
React31.useEffect(() => () => {
|
|
4177
4776
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
4178
4777
|
}, []);
|
|
4179
4778
|
const commit = (next) => {
|
|
@@ -4193,13 +4792,13 @@ function FileDropZone({
|
|
|
4193
4792
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
4194
4793
|
};
|
|
4195
4794
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
4196
|
-
return /* @__PURE__ */ (0,
|
|
4197
|
-
label ? /* @__PURE__ */ (0,
|
|
4795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
4796
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: "pire-field-label", children: [
|
|
4198
4797
|
label,
|
|
4199
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
4798
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
4200
4799
|
] }) : null,
|
|
4201
|
-
/* @__PURE__ */ (0,
|
|
4202
|
-
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
4801
|
+
import_react_aria_components38.DropZone,
|
|
4203
4802
|
{
|
|
4204
4803
|
className: "pire-dropzone",
|
|
4205
4804
|
"aria-label": ariaLabel,
|
|
@@ -4207,30 +4806,30 @@ function FileDropZone({
|
|
|
4207
4806
|
isDisabled: isDisabled || isReadOnly,
|
|
4208
4807
|
onDrop: async (e) => {
|
|
4209
4808
|
const dropped = await Promise.all(
|
|
4210
|
-
e.items.filter(
|
|
4809
|
+
e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile())
|
|
4211
4810
|
);
|
|
4212
4811
|
accept(dropped);
|
|
4213
4812
|
},
|
|
4214
4813
|
children: [
|
|
4215
|
-
/* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4218
|
-
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
4816
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4817
|
+
import_react_aria_components38.FileTrigger,
|
|
4219
4818
|
{
|
|
4220
4819
|
acceptedFileTypes,
|
|
4221
4820
|
allowsMultiple,
|
|
4222
4821
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
4223
|
-
children: /* @__PURE__ */ (0,
|
|
4822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
4224
4823
|
}
|
|
4225
4824
|
)
|
|
4226
4825
|
]
|
|
4227
4826
|
}
|
|
4228
4827
|
),
|
|
4229
|
-
files.length ? /* @__PURE__ */ (0,
|
|
4230
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4232
|
-
/* @__PURE__ */ (0,
|
|
4233
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
4828
|
+
files.length ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("li", { className: "pire-fileupload-item", children: [
|
|
4829
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
4830
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
4832
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4234
4833
|
IconButton,
|
|
4235
4834
|
{
|
|
4236
4835
|
icon: "x",
|
|
@@ -4240,25 +4839,27 @@ function FileDropZone({
|
|
|
4240
4839
|
}
|
|
4241
4840
|
)
|
|
4242
4841
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
4243
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
4244
|
-
description ? /* @__PURE__ */ (0,
|
|
4245
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
4842
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
4843
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-hint", children: description }) : null,
|
|
4844
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
4246
4845
|
] });
|
|
4247
4846
|
}
|
|
4248
4847
|
|
|
4249
4848
|
// src/index.ts
|
|
4250
|
-
var
|
|
4251
|
-
var
|
|
4849
|
+
var import_react_aria_components39 = require("react-aria-components");
|
|
4850
|
+
var import_react_aria_components40 = require("react-aria-components");
|
|
4252
4851
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4253
4852
|
0 && (module.exports = {
|
|
4254
4853
|
AppLauncher,
|
|
4255
4854
|
Avatar,
|
|
4256
4855
|
Badge,
|
|
4257
4856
|
BarChart,
|
|
4857
|
+
BarList,
|
|
4258
4858
|
Breadcrumb,
|
|
4259
4859
|
Button,
|
|
4260
4860
|
Card,
|
|
4261
4861
|
Checkbox,
|
|
4862
|
+
ChoiceCardGroup,
|
|
4262
4863
|
ComboBox,
|
|
4263
4864
|
CommandPalette,
|
|
4264
4865
|
ConfirmDialog,
|
|
@@ -4298,6 +4899,7 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4298
4899
|
MenuSeparator,
|
|
4299
4900
|
MenuTrigger,
|
|
4300
4901
|
MultiComboBox,
|
|
4902
|
+
NumPad,
|
|
4301
4903
|
NumberField,
|
|
4302
4904
|
ObjectHeader,
|
|
4303
4905
|
PageBand,
|
|
@@ -4306,8 +4908,11 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4306
4908
|
PireIntlProvider,
|
|
4307
4909
|
Popover,
|
|
4308
4910
|
ProgressBar,
|
|
4911
|
+
QuantityStepper,
|
|
4309
4912
|
Radio,
|
|
4310
4913
|
RadioGroup,
|
|
4914
|
+
RecordCard,
|
|
4915
|
+
Ribbon,
|
|
4311
4916
|
RouterProvider,
|
|
4312
4917
|
SectionHeader,
|
|
4313
4918
|
SegmentedControl,
|
|
@@ -4335,6 +4940,7 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4335
4940
|
VIZ_SLOT_COUNT,
|
|
4336
4941
|
ValueHelpDialog,
|
|
4337
4942
|
ValueHelpField,
|
|
4943
|
+
ViewSwitcher,
|
|
4338
4944
|
configureIcons,
|
|
4339
4945
|
enMessages,
|
|
4340
4946
|
esMessages,
|