@orianatech/pire 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/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 +259 -2
- package/dist/i18n/messages.d.cts +44 -0
- package/dist/i18n/messages.d.ts +44 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +1371 -845
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1294 -774
- 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,7 +77,7 @@ __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,
|
|
80
82
|
NumPad: () => NumPad,
|
|
81
83
|
NumberField: () => NumberField,
|
|
@@ -84,11 +86,14 @@ __export(src_exports, {
|
|
|
84
86
|
PageHeader: () => PageHeader,
|
|
85
87
|
Pagination: () => Pagination,
|
|
86
88
|
PireIntlProvider: () => PireIntlProvider,
|
|
87
|
-
Popover: () =>
|
|
89
|
+
Popover: () => import_react_aria_components39.Popover,
|
|
88
90
|
ProgressBar: () => ProgressBar,
|
|
91
|
+
QuantityStepper: () => QuantityStepper,
|
|
89
92
|
Radio: () => Radio,
|
|
90
93
|
RadioGroup: () => RadioGroup,
|
|
91
|
-
|
|
94
|
+
RecordCard: () => RecordCard,
|
|
95
|
+
Ribbon: () => Ribbon,
|
|
96
|
+
RouterProvider: () => import_react_aria_components39.RouterProvider,
|
|
92
97
|
SectionHeader: () => SectionHeader,
|
|
93
98
|
SegmentedControl: () => SegmentedControl,
|
|
94
99
|
Select: () => Select,
|
|
@@ -102,7 +107,7 @@ __export(src_exports, {
|
|
|
102
107
|
SkeletonTableRow: () => SkeletonTableRow,
|
|
103
108
|
SplitPane: () => SplitPane,
|
|
104
109
|
Strong: () => Strong,
|
|
105
|
-
SubmenuTrigger: () =>
|
|
110
|
+
SubmenuTrigger: () => import_react_aria_components39.SubmenuTrigger,
|
|
106
111
|
Switch: () => Switch,
|
|
107
112
|
Tabs: () => Tabs,
|
|
108
113
|
Tag: () => Tag,
|
|
@@ -115,6 +120,7 @@ __export(src_exports, {
|
|
|
115
120
|
VIZ_SLOT_COUNT: () => VIZ_SLOT_COUNT,
|
|
116
121
|
ValueHelpDialog: () => ValueHelpDialog,
|
|
117
122
|
ValueHelpField: () => ValueHelpField,
|
|
123
|
+
ViewSwitcher: () => ViewSwitcher,
|
|
118
124
|
configureIcons: () => configureIcons,
|
|
119
125
|
enMessages: () => enMessages,
|
|
120
126
|
esMessages: () => esMessages,
|
|
@@ -223,6 +229,7 @@ var ICON_MARKUP = {
|
|
|
223
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"/>',
|
|
224
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"/>',
|
|
225
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"/>',
|
|
226
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"/>',
|
|
227
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"/>',
|
|
228
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"/>',
|
|
@@ -258,6 +265,7 @@ var ICON_MARKUP = {
|
|
|
258
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"/>',
|
|
259
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"/>',
|
|
260
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"/>',
|
|
261
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"/>',
|
|
262
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"/>',
|
|
263
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"/>',
|
|
@@ -283,6 +291,11 @@ var CARBON_MAP = {
|
|
|
283
291
|
"file-text": "document",
|
|
284
292
|
"clipboard-list": "list--checked",
|
|
285
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",
|
|
286
299
|
"boxes": "box",
|
|
287
300
|
"truck": "delivery-truck",
|
|
288
301
|
"stamp": "checkmark--outline",
|
|
@@ -546,7 +559,9 @@ var React2 = __toESM(require("react"), 1);
|
|
|
546
559
|
var import_react_aria_components2 = require("react-aria-components");
|
|
547
560
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
548
561
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
549
|
-
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 });
|
|
550
565
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
551
566
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_aria_components2.Focusable, { children: target }),
|
|
552
567
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.Tooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
@@ -611,50 +626,244 @@ var Badge = React4.forwardRef(function Badge2({ children, status = "neutral", sh
|
|
|
611
626
|
});
|
|
612
627
|
|
|
613
628
|
// src/components/core/Tag.tsx
|
|
614
|
-
var
|
|
629
|
+
var React6 = __toESM(require("react"), 1);
|
|
615
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
|
|
616
806
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
617
|
-
var
|
|
618
|
-
|
|
619
|
-
|
|
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,
|
|
620
829
|
children,
|
|
621
|
-
onRemove ? /* @__PURE__ */ (0,
|
|
830
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
622
831
|
import_react_aria_components4.Button,
|
|
623
832
|
{
|
|
624
833
|
className: "pire-tag-remove",
|
|
625
834
|
isDisabled,
|
|
626
835
|
onPress: onRemove,
|
|
627
|
-
"aria-label":
|
|
628
|
-
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 })
|
|
629
838
|
}
|
|
630
839
|
) : null
|
|
631
840
|
] });
|
|
632
841
|
});
|
|
633
842
|
|
|
634
843
|
// src/components/core/Card.tsx
|
|
635
|
-
var
|
|
844
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
636
845
|
function Card({ title, subtitle, icon, actions, footer, interactive, children, className, ...rest }) {
|
|
637
|
-
return /* @__PURE__ */ (0,
|
|
638
|
-
title || actions ? /* @__PURE__ */ (0,
|
|
639
|
-
icon ? /* @__PURE__ */ (0,
|
|
640
|
-
/* @__PURE__ */ (0,
|
|
641
|
-
/* @__PURE__ */ (0,
|
|
642
|
-
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
|
|
643
852
|
] }),
|
|
644
|
-
actions ? /* @__PURE__ */ (0,
|
|
853
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
645
854
|
] }) : null,
|
|
646
|
-
children ? /* @__PURE__ */ (0,
|
|
647
|
-
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
|
|
648
857
|
] });
|
|
649
858
|
}
|
|
650
859
|
|
|
651
860
|
// src/components/core/Avatar.tsx
|
|
652
|
-
var
|
|
653
|
-
var
|
|
861
|
+
var React7 = __toESM(require("react"), 1);
|
|
862
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
654
863
|
var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
655
864
|
function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
656
|
-
const [failed, setFailed] =
|
|
657
|
-
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)(
|
|
658
867
|
"img",
|
|
659
868
|
{
|
|
660
869
|
src,
|
|
@@ -666,9 +875,9 @@ function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
|
666
875
|
}
|
|
667
876
|
|
|
668
877
|
// src/components/core/SegmentedControl.tsx
|
|
669
|
-
var
|
|
878
|
+
var React8 = __toESM(require("react"), 1);
|
|
670
879
|
var import_react_aria_components5 = require("react-aria-components");
|
|
671
|
-
var
|
|
880
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
672
881
|
function SegmentedControl({
|
|
673
882
|
options,
|
|
674
883
|
value,
|
|
@@ -680,8 +889,8 @@ function SegmentedControl({
|
|
|
680
889
|
style,
|
|
681
890
|
...rest
|
|
682
891
|
}) {
|
|
683
|
-
const selected =
|
|
684
|
-
return /* @__PURE__ */ (0,
|
|
892
|
+
const selected = React8.useMemo(() => new Set(value ? [value] : defaultValue ? [defaultValue] : []), [value, defaultValue]);
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
685
894
|
import_react_aria_components5.ToggleButtonGroup,
|
|
686
895
|
{
|
|
687
896
|
className: cx("pire-segmented", className),
|
|
@@ -695,7 +904,7 @@ function SegmentedControl({
|
|
|
695
904
|
const first = [...keys][0];
|
|
696
905
|
if (first != null) onChange?.(String(first));
|
|
697
906
|
},
|
|
698
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
907
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
699
908
|
import_react_aria_components5.ToggleButton,
|
|
700
909
|
{
|
|
701
910
|
id: option.id,
|
|
@@ -703,7 +912,7 @@ function SegmentedControl({
|
|
|
703
912
|
isDisabled: option.isDisabled,
|
|
704
913
|
"aria-label": iconOnly ? option.label : void 0,
|
|
705
914
|
children: [
|
|
706
|
-
option.icon ? /* @__PURE__ */ (0,
|
|
915
|
+
option.icon ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon, { name: option.icon, size: 16 }) : null,
|
|
707
916
|
iconOnly ? null : option.label
|
|
708
917
|
]
|
|
709
918
|
},
|
|
@@ -714,9 +923,9 @@ function SegmentedControl({
|
|
|
714
923
|
}
|
|
715
924
|
|
|
716
925
|
// src/components/core/Text.tsx
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
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({
|
|
720
929
|
size = "body",
|
|
721
930
|
color = "primary",
|
|
722
931
|
weight = "regular",
|
|
@@ -730,7 +939,7 @@ var Text = React8.forwardRef(function Text2({
|
|
|
730
939
|
}, ref) {
|
|
731
940
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
732
941
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
733
|
-
return /* @__PURE__ */ (0,
|
|
942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
734
943
|
Wrapper,
|
|
735
944
|
{
|
|
736
945
|
ref,
|
|
@@ -746,13 +955,13 @@ var Text = React8.forwardRef(function Text2({
|
|
|
746
955
|
}
|
|
747
956
|
);
|
|
748
957
|
});
|
|
749
|
-
var Strong =
|
|
750
|
-
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 });
|
|
751
960
|
});
|
|
752
961
|
|
|
753
962
|
// src/components/core/Heading.tsx
|
|
754
963
|
var import_react_aria_components6 = require("react-aria-components");
|
|
755
|
-
var
|
|
964
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
756
965
|
function Heading({
|
|
757
966
|
level = 2,
|
|
758
967
|
size,
|
|
@@ -764,7 +973,7 @@ function Heading({
|
|
|
764
973
|
}) {
|
|
765
974
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
766
975
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
767
|
-
return /* @__PURE__ */ (0,
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
768
977
|
import_react_aria_components6.Heading,
|
|
769
978
|
{
|
|
770
979
|
level,
|
|
@@ -780,9 +989,9 @@ function Heading({
|
|
|
780
989
|
|
|
781
990
|
// src/components/core/Link.tsx
|
|
782
991
|
var import_react_aria_components7 = require("react-aria-components");
|
|
783
|
-
var
|
|
992
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
784
993
|
function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
785
|
-
return /* @__PURE__ */ (0,
|
|
994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
786
995
|
import_react_aria_components7.Link,
|
|
787
996
|
{
|
|
788
997
|
className: cx("pire-link", className),
|
|
@@ -792,7 +1001,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
792
1001
|
...rest,
|
|
793
1002
|
children: [
|
|
794
1003
|
children,
|
|
795
|
-
isExternal ? /* @__PURE__ */ (0,
|
|
1004
|
+
isExternal ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: "external-link", size: 12, className: "pire-link-external" }) : null
|
|
796
1005
|
]
|
|
797
1006
|
}
|
|
798
1007
|
);
|
|
@@ -800,7 +1009,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
800
1009
|
|
|
801
1010
|
// src/components/core/Separator.tsx
|
|
802
1011
|
var import_react_aria_components8 = require("react-aria-components");
|
|
803
|
-
var
|
|
1012
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
804
1013
|
function Separator({
|
|
805
1014
|
orientation = "horizontal",
|
|
806
1015
|
emphasis = "default",
|
|
@@ -808,7 +1017,7 @@ function Separator({
|
|
|
808
1017
|
className,
|
|
809
1018
|
...rest
|
|
810
1019
|
}) {
|
|
811
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
812
1021
|
import_react_aria_components8.Separator,
|
|
813
1022
|
{
|
|
814
1023
|
orientation,
|
|
@@ -822,24 +1031,24 @@ function Separator({
|
|
|
822
1031
|
}
|
|
823
1032
|
|
|
824
1033
|
// src/components/core/Kbd.tsx
|
|
825
|
-
var
|
|
1034
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
826
1035
|
function Kbd({ children, size = "md", className, ...rest }) {
|
|
827
|
-
return /* @__PURE__ */ (0,
|
|
1036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("kbd", { className: cx("pire-kbd", className), "data-size": size, ...rest, children });
|
|
828
1037
|
}
|
|
829
1038
|
|
|
830
1039
|
// src/components/forms/FormField.tsx
|
|
831
|
-
var
|
|
1040
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
832
1041
|
function FormField({ label, htmlFor, isRequired, hint, error, layout = "stacked", children, className, ...rest }) {
|
|
833
|
-
return /* @__PURE__ */ (0,
|
|
834
|
-
/* @__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: [
|
|
835
1044
|
label,
|
|
836
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
1045
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
837
1046
|
] }),
|
|
838
1047
|
children,
|
|
839
|
-
error ? /* @__PURE__ */ (0,
|
|
840
|
-
/* @__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 }),
|
|
841
1050
|
error
|
|
842
|
-
] }) : hint ? /* @__PURE__ */ (0,
|
|
1051
|
+
] }) : hint ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "pire-field-hint", children: hint }) : null
|
|
843
1052
|
] });
|
|
844
1053
|
}
|
|
845
1054
|
|
|
@@ -847,165 +1056,6 @@ function FormField({ label, htmlFor, isRequired, hint, error, layout = "stacked"
|
|
|
847
1056
|
var React10 = __toESM(require("react"), 1);
|
|
848
1057
|
var import_react_aria_components9 = require("react-aria-components");
|
|
849
1058
|
|
|
850
|
-
// src/i18n/PireIntlProvider.tsx
|
|
851
|
-
var React9 = __toESM(require("react"), 1);
|
|
852
|
-
|
|
853
|
-
// src/i18n/messages.ts
|
|
854
|
-
var enMessages = {
|
|
855
|
-
filterBarLabel: "Filters",
|
|
856
|
-
filterBarGo: "Go",
|
|
857
|
-
filterBarClearAll: "Clear all",
|
|
858
|
-
dataTableSelectAll: "Select all rows",
|
|
859
|
-
dataTableSelectRow: "Select row",
|
|
860
|
-
dataTableLoading: "Loading records",
|
|
861
|
-
dataTableSummaryRow: "Summary",
|
|
862
|
-
dataTableEmpty: "No records match the current filters.",
|
|
863
|
-
dialogClose: "Close",
|
|
864
|
-
sidePanelClose: "Close panel",
|
|
865
|
-
inlineMessageDismiss: "Dismiss message",
|
|
866
|
-
toastDismiss: "Dismiss",
|
|
867
|
-
toastRegionLabel: "Notifications",
|
|
868
|
-
selectEmpty: "No options available",
|
|
869
|
-
comboBoxShowSuggestions: "Show suggestions",
|
|
870
|
-
comboBoxLoading: "Searching\u2026",
|
|
871
|
-
datePickerOpenCalendar: "Open calendar",
|
|
872
|
-
datePickerPreviousMonth: "Previous month",
|
|
873
|
-
datePickerNextMonth: "Next month",
|
|
874
|
-
dateRangePresetsLabel: "Date range shortcuts",
|
|
875
|
-
numberFieldIncrease: "Increase",
|
|
876
|
-
numberFieldDecrease: "Decrease",
|
|
877
|
-
inputClear: "Clear",
|
|
878
|
-
valueHelpFieldPlaceholder: "Not selected",
|
|
879
|
-
valueHelpFieldClear: "Clear selection",
|
|
880
|
-
valueHelpFieldOpenNamed: "Select {label}",
|
|
881
|
-
valueHelpFieldOpen: "Open value help",
|
|
882
|
-
valueHelpDialogSearch: "Search records",
|
|
883
|
-
valueHelpDialogTitle: "Select a record",
|
|
884
|
-
valueHelpDialogSearchPlaceholder: "Search by ID or name",
|
|
885
|
-
valueHelpDialogEmpty: "No records found",
|
|
886
|
-
valueHelpDialogCancel: "Cancel",
|
|
887
|
-
paginationLabel: "Pagination",
|
|
888
|
-
paginationRange: "{from}\u2013{to} of {total}",
|
|
889
|
-
paginationPageOf: "Page {page} of {pages}",
|
|
890
|
-
paginationPrevious: "Previous page",
|
|
891
|
-
paginationNext: "Next page",
|
|
892
|
-
paginationRowsPerPage: "Rows per page",
|
|
893
|
-
sideNavLabel: "Main navigation",
|
|
894
|
-
shellRailLabel: "Applications",
|
|
895
|
-
appLauncherLabel: "All applications",
|
|
896
|
-
appLauncherTitle: "All applications",
|
|
897
|
-
appLauncherSearch: "Search for an application",
|
|
898
|
-
appLauncherEmpty: "No application matches that search.",
|
|
899
|
-
appLauncherLoading: "Loading applications\u2026",
|
|
900
|
-
splitPaneList: "List",
|
|
901
|
-
splitPaneDetail: "Detail",
|
|
902
|
-
splitPaneBack: "Back to list",
|
|
903
|
-
fileUploadChoose: "Choose files",
|
|
904
|
-
fileUploadRemoveNamed: "Remove {name}",
|
|
905
|
-
fileUploadUploading: "Uploading",
|
|
906
|
-
fileDropZonePrompt: "Drag files here, or choose them",
|
|
907
|
-
shellBarUserMenu: "Account menu for {user}",
|
|
908
|
-
commandPaletteLabel: "Command palette",
|
|
909
|
-
commandPaletteSearchLabel: "Search commands and records",
|
|
910
|
-
commandPalettePlaceholder: "Search for a screen, an action or a record\u2026",
|
|
911
|
-
commandPaletteEmpty: "Nothing matches that",
|
|
912
|
-
commandPaletteLoading: "Searching\u2026",
|
|
913
|
-
commandPaletteHintNavigate: "navigate",
|
|
914
|
-
commandPaletteHintSelect: "open",
|
|
915
|
-
commandPaletteHintClose: "close",
|
|
916
|
-
chartCategoryHeader: "Category",
|
|
917
|
-
chartNoValue: "No data",
|
|
918
|
-
chartEmpty: "No data for this period",
|
|
919
|
-
numPadClear: "Clear",
|
|
920
|
-
numPadBackspace: "Remove last digit"
|
|
921
|
-
};
|
|
922
|
-
var esMessages = {
|
|
923
|
-
filterBarLabel: "Filtros",
|
|
924
|
-
filterBarGo: "Buscar",
|
|
925
|
-
filterBarClearAll: "Limpiar todo",
|
|
926
|
-
dataTableSelectAll: "Seleccionar todas las filas",
|
|
927
|
-
dataTableSelectRow: "Seleccionar fila",
|
|
928
|
-
dataTableLoading: "Cargando registros",
|
|
929
|
-
dataTableSummaryRow: "Resumen",
|
|
930
|
-
dataTableEmpty: "Ning\xFAn registro coincide con los filtros actuales.",
|
|
931
|
-
dialogClose: "Cerrar",
|
|
932
|
-
sidePanelClose: "Cerrar panel",
|
|
933
|
-
inlineMessageDismiss: "Descartar mensaje",
|
|
934
|
-
toastDismiss: "Descartar",
|
|
935
|
-
toastRegionLabel: "Notificaciones",
|
|
936
|
-
selectEmpty: "Sin opciones disponibles",
|
|
937
|
-
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
938
|
-
comboBoxLoading: "Buscando\u2026",
|
|
939
|
-
datePickerOpenCalendar: "Abrir calendario",
|
|
940
|
-
datePickerPreviousMonth: "Mes anterior",
|
|
941
|
-
datePickerNextMonth: "Mes siguiente",
|
|
942
|
-
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
943
|
-
numberFieldIncrease: "Aumentar",
|
|
944
|
-
numberFieldDecrease: "Disminuir",
|
|
945
|
-
inputClear: "Limpiar",
|
|
946
|
-
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
947
|
-
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
948
|
-
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
949
|
-
valueHelpFieldOpen: "Abrir ayuda de valores",
|
|
950
|
-
valueHelpDialogSearch: "Buscar registros",
|
|
951
|
-
valueHelpDialogTitle: "Seleccionar un registro",
|
|
952
|
-
valueHelpDialogSearchPlaceholder: "Buscar por c\xF3digo o nombre",
|
|
953
|
-
valueHelpDialogEmpty: "No se encontraron registros",
|
|
954
|
-
valueHelpDialogCancel: "Cancelar",
|
|
955
|
-
paginationLabel: "Paginaci\xF3n",
|
|
956
|
-
paginationRange: "{from}\u2013{to} de {total}",
|
|
957
|
-
paginationPageOf: "P\xE1gina {page} de {pages}",
|
|
958
|
-
paginationPrevious: "P\xE1gina anterior",
|
|
959
|
-
paginationNext: "P\xE1gina siguiente",
|
|
960
|
-
paginationRowsPerPage: "Filas por p\xE1gina",
|
|
961
|
-
sideNavLabel: "Navegaci\xF3n principal",
|
|
962
|
-
shellRailLabel: "Aplicaciones",
|
|
963
|
-
appLauncherLabel: "Todas las aplicaciones",
|
|
964
|
-
appLauncherTitle: "Todas las aplicaciones",
|
|
965
|
-
appLauncherSearch: "Busc\xE1 una aplicaci\xF3n",
|
|
966
|
-
appLauncherEmpty: "Ninguna aplicaci\xF3n coincide con esa b\xFAsqueda.",
|
|
967
|
-
appLauncherLoading: "Cargando aplicaciones\u2026",
|
|
968
|
-
splitPaneList: "Lista",
|
|
969
|
-
splitPaneDetail: "Detalle",
|
|
970
|
-
splitPaneBack: "Volver a la lista",
|
|
971
|
-
fileUploadChoose: "Elegir archivos",
|
|
972
|
-
fileUploadRemoveNamed: "Quitar {name}",
|
|
973
|
-
fileUploadUploading: "Subiendo",
|
|
974
|
-
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
975
|
-
shellBarUserMenu: "Men\xFA de cuenta de {user}",
|
|
976
|
-
commandPaletteLabel: "Paleta de comandos",
|
|
977
|
-
commandPaletteSearchLabel: "Buscar comandos y registros",
|
|
978
|
-
commandPalettePlaceholder: "Busc\xE1 una pantalla, una acci\xF3n o un registro\u2026",
|
|
979
|
-
commandPaletteEmpty: "No hay coincidencias",
|
|
980
|
-
commandPaletteLoading: "Buscando\u2026",
|
|
981
|
-
commandPaletteHintNavigate: "navegar",
|
|
982
|
-
commandPaletteHintSelect: "abrir",
|
|
983
|
-
commandPaletteHintClose: "cerrar",
|
|
984
|
-
chartCategoryHeader: "Categor\xEDa",
|
|
985
|
-
chartNoValue: "Sin datos",
|
|
986
|
-
chartEmpty: "Sin datos para este per\xEDodo",
|
|
987
|
-
numPadClear: "Limpiar",
|
|
988
|
-
numPadBackspace: "Borrar \xFAltimo d\xEDgito"
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
// src/i18n/PireIntlProvider.tsx
|
|
992
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
993
|
-
var MessagesContext = React9.createContext(enMessages);
|
|
994
|
-
function PireIntlProvider({ messages, children }) {
|
|
995
|
-
const value = React9.useMemo(
|
|
996
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
997
|
-
[messages]
|
|
998
|
-
);
|
|
999
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MessagesContext.Provider, { value, children });
|
|
1000
|
-
}
|
|
1001
|
-
function usePireMessages() {
|
|
1002
|
-
return React9.useContext(MessagesContext);
|
|
1003
|
-
}
|
|
1004
|
-
function useMessage(key, override) {
|
|
1005
|
-
const messages = React9.useContext(MessagesContext);
|
|
1006
|
-
return override ?? messages[key];
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
1059
|
// src/components/utils/focusField.ts
|
|
1010
1060
|
function focusFieldOf(button) {
|
|
1011
1061
|
const control = button?.closest?.(".pire-control");
|
|
@@ -1286,10 +1336,58 @@ function Switch({ label, children, className, ...rest }) {
|
|
|
1286
1336
|
] });
|
|
1287
1337
|
}
|
|
1288
1338
|
|
|
1289
|
-
// src/components/forms/
|
|
1290
|
-
var React12 = __toESM(require("react"), 1);
|
|
1339
|
+
// src/components/forms/ChoiceCardGroup.tsx
|
|
1291
1340
|
var import_react_aria_components15 = require("react-aria-components");
|
|
1292
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");
|
|
1293
1391
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1294
1392
|
function ComboBox({
|
|
1295
1393
|
label,
|
|
@@ -1335,8 +1433,8 @@ function ComboBox({
|
|
|
1335
1433
|
};
|
|
1336
1434
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1337
1435
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1338
|
-
return /* @__PURE__ */ (0,
|
|
1339
|
-
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1437
|
+
import_react_aria_components16.ComboBox,
|
|
1340
1438
|
{
|
|
1341
1439
|
className: cx("pire-field", className),
|
|
1342
1440
|
style,
|
|
@@ -1356,22 +1454,22 @@ function ComboBox({
|
|
|
1356
1454
|
validationBehavior: "aria",
|
|
1357
1455
|
...rest,
|
|
1358
1456
|
children: [
|
|
1359
|
-
label ? /* @__PURE__ */ (0,
|
|
1457
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react_aria_components16.Label, { className: "pire-field-label", children: [
|
|
1360
1458
|
label,
|
|
1361
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1459
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1362
1460
|
] }) : null,
|
|
1363
|
-
/* @__PURE__ */ (0,
|
|
1364
|
-
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1462
|
+
import_react_aria_components16.Group,
|
|
1365
1463
|
{
|
|
1366
1464
|
className: "pire-control",
|
|
1367
1465
|
"data-size": size,
|
|
1368
1466
|
"data-full-width": String(fullWidth),
|
|
1369
1467
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1370
1468
|
children: [
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1374
|
-
|
|
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,
|
|
1375
1473
|
{
|
|
1376
1474
|
className: "pire-input-clear",
|
|
1377
1475
|
slot: null,
|
|
@@ -1382,24 +1480,24 @@ function ComboBox({
|
|
|
1382
1480
|
children: clearLabel ?? msg.inputClear
|
|
1383
1481
|
}
|
|
1384
1482
|
) : null,
|
|
1385
|
-
/* @__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 }) })
|
|
1386
1484
|
]
|
|
1387
1485
|
}
|
|
1388
1486
|
),
|
|
1389
|
-
description ? /* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
|
|
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,
|
|
1393
1491
|
{
|
|
1394
1492
|
className: "pire-listbox",
|
|
1395
1493
|
onScroll: onLoadMore ? (e) => {
|
|
1396
1494
|
const el = e.currentTarget;
|
|
1397
1495
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1398
1496
|
} : void 0,
|
|
1399
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0,
|
|
1400
|
-
children: (item) => /* @__PURE__ */ (0,
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1402
|
-
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
|
|
1403
1501
|
] })
|
|
1404
1502
|
}
|
|
1405
1503
|
) })
|
|
@@ -1410,8 +1508,8 @@ function ComboBox({
|
|
|
1410
1508
|
|
|
1411
1509
|
// src/components/forms/MultiComboBox.tsx
|
|
1412
1510
|
var React13 = __toESM(require("react"), 1);
|
|
1413
|
-
var
|
|
1414
|
-
var
|
|
1511
|
+
var import_react_aria_components17 = require("react-aria-components");
|
|
1512
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1415
1513
|
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1416
1514
|
function MultiComboBox({
|
|
1417
1515
|
label,
|
|
@@ -1476,8 +1574,8 @@ function MultiComboBox({
|
|
|
1476
1574
|
e.stopPropagation();
|
|
1477
1575
|
if (!values.includes(next)) commit([...values, next]);
|
|
1478
1576
|
};
|
|
1479
|
-
return /* @__PURE__ */ (0,
|
|
1480
|
-
|
|
1577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1578
|
+
import_react_aria_components17.ComboBox,
|
|
1481
1579
|
{
|
|
1482
1580
|
className: cx("pire-field", className),
|
|
1483
1581
|
style,
|
|
@@ -1493,12 +1591,12 @@ function MultiComboBox({
|
|
|
1493
1591
|
validationBehavior: "aria",
|
|
1494
1592
|
...rest,
|
|
1495
1593
|
children: [
|
|
1496
|
-
label ? /* @__PURE__ */ (0,
|
|
1594
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react_aria_components17.Label, { className: "pire-field-label", children: [
|
|
1497
1595
|
label,
|
|
1498
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1596
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1499
1597
|
] }) : null,
|
|
1500
|
-
/* @__PURE__ */ (0,
|
|
1501
|
-
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1599
|
+
import_react_aria_components17.Group,
|
|
1502
1600
|
{
|
|
1503
1601
|
className: "pire-control",
|
|
1504
1602
|
"data-size": size,
|
|
@@ -1507,15 +1605,15 @@ function MultiComboBox({
|
|
|
1507
1605
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1508
1606
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1509
1607
|
children: [
|
|
1510
|
-
/* @__PURE__ */ (0,
|
|
1511
|
-
/* @__PURE__ */ (0,
|
|
1512
|
-
/* @__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) => (
|
|
1513
1611
|
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
1514
1612
|
real, current values and should read as such — they simply lose the × . */
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
1516
1614
|
)) }),
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1616
|
+
import_react_aria_components17.Input,
|
|
1519
1617
|
{
|
|
1520
1618
|
ref: inputRef,
|
|
1521
1619
|
className: cx("pire-input", "pire-chipinput"),
|
|
@@ -1524,25 +1622,25 @@ function MultiComboBox({
|
|
|
1524
1622
|
}
|
|
1525
1623
|
)
|
|
1526
1624
|
] }),
|
|
1527
|
-
/* @__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 }) })
|
|
1528
1626
|
]
|
|
1529
1627
|
}
|
|
1530
1628
|
),
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1532
|
-
description ? /* @__PURE__ */ (0,
|
|
1533
|
-
/* @__PURE__ */ (0,
|
|
1534
|
-
/* @__PURE__ */ (0,
|
|
1535
|
-
|
|
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,
|
|
1536
1634
|
{
|
|
1537
1635
|
className: "pire-listbox",
|
|
1538
1636
|
onScroll: onLoadMore ? (e) => {
|
|
1539
1637
|
const el = e.currentTarget;
|
|
1540
1638
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1541
1639
|
} : void 0,
|
|
1542
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0,
|
|
1543
|
-
children: (item) => /* @__PURE__ */ (0,
|
|
1544
|
-
/* @__PURE__ */ (0,
|
|
1545
|
-
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
|
|
1546
1644
|
] })
|
|
1547
1645
|
}
|
|
1548
1646
|
) })
|
|
@@ -1553,8 +1651,8 @@ function MultiComboBox({
|
|
|
1553
1651
|
|
|
1554
1652
|
// src/components/forms/NumberField.tsx
|
|
1555
1653
|
var React14 = __toESM(require("react"), 1);
|
|
1556
|
-
var
|
|
1557
|
-
var
|
|
1654
|
+
var import_react_aria_components18 = require("react-aria-components");
|
|
1655
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1558
1656
|
function decimalSeparatorFor(locale) {
|
|
1559
1657
|
return new Intl.NumberFormat(locale).formatToParts(1.1).find((part) => part.type === "decimal")?.value ?? ".";
|
|
1560
1658
|
}
|
|
@@ -1588,12 +1686,12 @@ function toAriaNumber(value) {
|
|
|
1588
1686
|
return typeof value === "number" ? value : Number(value);
|
|
1589
1687
|
}
|
|
1590
1688
|
function ClearButton({ label, onClear }) {
|
|
1591
|
-
const state = React14.useContext(
|
|
1689
|
+
const state = React14.useContext(import_react_aria_components18.NumberFieldStateContext);
|
|
1592
1690
|
if (!state?.inputValue) {
|
|
1593
1691
|
return null;
|
|
1594
1692
|
}
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1596
|
-
|
|
1693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1694
|
+
import_react_aria_components18.Button,
|
|
1597
1695
|
{
|
|
1598
1696
|
className: "pire-input-clear",
|
|
1599
1697
|
slot: null,
|
|
@@ -1611,6 +1709,9 @@ function NumberField({
|
|
|
1611
1709
|
description,
|
|
1612
1710
|
errorMessage,
|
|
1613
1711
|
hideStepper,
|
|
1712
|
+
stepperLayout = "stacked",
|
|
1713
|
+
incrementLabel,
|
|
1714
|
+
decrementLabel,
|
|
1614
1715
|
size = "md",
|
|
1615
1716
|
fullWidth = true,
|
|
1616
1717
|
className,
|
|
@@ -1624,7 +1725,7 @@ function NumberField({
|
|
|
1624
1725
|
...rest
|
|
1625
1726
|
}) {
|
|
1626
1727
|
const msg = usePireMessages();
|
|
1627
|
-
const { locale } = (0,
|
|
1728
|
+
const { locale } = (0, import_react_aria_components18.useLocale)();
|
|
1628
1729
|
const empty = emptyValue === void 0 ? NaN : emptyValue;
|
|
1629
1730
|
const isControlled = value !== void 0;
|
|
1630
1731
|
const [ownValue, setOwnValue] = React14.useState(() => toAriaNumber(defaultValue) ?? NaN);
|
|
@@ -1676,8 +1777,8 @@ function NumberField({
|
|
|
1676
1777
|
event.stopPropagation();
|
|
1677
1778
|
typeIntoInput(event.currentTarget, localised);
|
|
1678
1779
|
};
|
|
1679
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
-
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1781
|
+
import_react_aria_components18.NumberField,
|
|
1681
1782
|
{
|
|
1682
1783
|
className: cx("pire-field", className),
|
|
1683
1784
|
style,
|
|
@@ -1686,21 +1787,23 @@ function NumberField({
|
|
|
1686
1787
|
...rest,
|
|
1687
1788
|
...valueProps,
|
|
1688
1789
|
children: [
|
|
1689
|
-
label ? /* @__PURE__ */ (0,
|
|
1790
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components18.Label, { className: "pire-field-label", children: [
|
|
1690
1791
|
label,
|
|
1691
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1792
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1692
1793
|
] }) : null,
|
|
1693
|
-
/* @__PURE__ */ (0,
|
|
1694
|
-
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1795
|
+
import_react_aria_components18.Group,
|
|
1695
1796
|
{
|
|
1696
1797
|
className: "pire-control",
|
|
1697
1798
|
"data-size": size,
|
|
1698
1799
|
"data-full-width": String(fullWidth),
|
|
1699
1800
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1700
1801
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1802
|
+
"data-stepper": stepperLayout,
|
|
1701
1803
|
children: [
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1703
|
-
|
|
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,
|
|
1704
1807
|
{
|
|
1705
1808
|
className: "pire-input",
|
|
1706
1809
|
"data-numeric": "true",
|
|
@@ -1708,25 +1811,43 @@ function NumberField({
|
|
|
1708
1811
|
onPasteCapture: handlePaste
|
|
1709
1812
|
}
|
|
1710
1813
|
),
|
|
1711
|
-
suffix ? /* @__PURE__ */ (0,
|
|
1712
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1713
|
-
hideStepper
|
|
1714
|
-
|
|
1715
|
-
/* @__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 }) })
|
|
1716
1820
|
] })
|
|
1717
1821
|
]
|
|
1718
1822
|
}
|
|
1719
1823
|
),
|
|
1720
|
-
description ? /* @__PURE__ */ (0,
|
|
1721
|
-
/* @__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 })
|
|
1722
1826
|
]
|
|
1723
1827
|
}
|
|
1724
1828
|
);
|
|
1725
1829
|
}
|
|
1726
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
|
+
|
|
1727
1848
|
// src/components/forms/DatePicker.tsx
|
|
1728
1849
|
var React15 = __toESM(require("react"), 1);
|
|
1729
|
-
var
|
|
1850
|
+
var import_react_aria_components19 = require("react-aria-components");
|
|
1730
1851
|
|
|
1731
1852
|
// src/components/forms/dateValues.ts
|
|
1732
1853
|
var import_date = require("@internationalized/date");
|
|
@@ -1756,14 +1877,14 @@ function coerceBound(value) {
|
|
|
1756
1877
|
}
|
|
1757
1878
|
|
|
1758
1879
|
// src/components/forms/DatePicker.tsx
|
|
1759
|
-
var
|
|
1880
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1760
1881
|
function ClearButton2({ label }) {
|
|
1761
|
-
const state = React15.useContext(
|
|
1882
|
+
const state = React15.useContext(import_react_aria_components19.DatePickerStateContext);
|
|
1762
1883
|
if (!state?.value) {
|
|
1763
1884
|
return null;
|
|
1764
1885
|
}
|
|
1765
|
-
return /* @__PURE__ */ (0,
|
|
1766
|
-
|
|
1886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1887
|
+
import_react_aria_components19.Button,
|
|
1767
1888
|
{
|
|
1768
1889
|
className: "pire-input-clear",
|
|
1769
1890
|
slot: null,
|
|
@@ -1798,8 +1919,8 @@ function DatePicker({
|
|
|
1798
1919
|
const handleChange = (next) => onChange?.(
|
|
1799
1920
|
valueFormat === "iso" && next ? next.toString() : next
|
|
1800
1921
|
);
|
|
1801
|
-
return /* @__PURE__ */ (0,
|
|
1802
|
-
|
|
1922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1923
|
+
import_react_aria_components19.DatePicker,
|
|
1803
1924
|
{
|
|
1804
1925
|
className: cx("pire-field", className),
|
|
1805
1926
|
style,
|
|
@@ -1811,12 +1932,12 @@ function DatePicker({
|
|
|
1811
1932
|
onChange: handleChange,
|
|
1812
1933
|
...rest,
|
|
1813
1934
|
children: [
|
|
1814
|
-
label ? /* @__PURE__ */ (0,
|
|
1935
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.Label, { className: "pire-field-label", children: [
|
|
1815
1936
|
label,
|
|
1816
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
1937
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1817
1938
|
] }) : null,
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1819
|
-
|
|
1939
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1940
|
+
import_react_aria_components19.Group,
|
|
1820
1941
|
{
|
|
1821
1942
|
className: "pire-control",
|
|
1822
1943
|
"data-size": size,
|
|
@@ -1824,23 +1945,23 @@ function DatePicker({
|
|
|
1824
1945
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1825
1946
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1826
1947
|
children: [
|
|
1827
|
-
/* @__PURE__ */ (0,
|
|
1828
|
-
showsClear ? /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__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 }) })
|
|
1830
1951
|
]
|
|
1831
1952
|
}
|
|
1832
1953
|
),
|
|
1833
|
-
description ? /* @__PURE__ */ (0,
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1835
|
-
/* @__PURE__ */ (0,
|
|
1836
|
-
/* @__PURE__ */ (0,
|
|
1837
|
-
/* @__PURE__ */ (0,
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
/* @__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 }) })
|
|
1840
1961
|
] }),
|
|
1841
|
-
/* @__PURE__ */ (0,
|
|
1842
|
-
/* @__PURE__ */ (0,
|
|
1843
|
-
/* @__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" }) })
|
|
1844
1965
|
] })
|
|
1845
1966
|
] }) }) })
|
|
1846
1967
|
]
|
|
@@ -1850,8 +1971,8 @@ function DatePicker({
|
|
|
1850
1971
|
|
|
1851
1972
|
// src/components/forms/DateRangePicker.tsx
|
|
1852
1973
|
var React16 = __toESM(require("react"), 1);
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
1974
|
+
var import_react_aria_components20 = require("react-aria-components");
|
|
1975
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1855
1976
|
function coerceRange(range) {
|
|
1856
1977
|
if (range === void 0) {
|
|
1857
1978
|
return void 0;
|
|
@@ -1872,12 +1993,12 @@ function rangeLengthInDays(range) {
|
|
|
1872
1993
|
return end.toDate("UTC").getTime() / 864e5 - start.toDate("UTC").getTime() / 864e5 + 1;
|
|
1873
1994
|
}
|
|
1874
1995
|
function ClearButton3({ label }) {
|
|
1875
|
-
const state = React16.useContext(
|
|
1996
|
+
const state = React16.useContext(import_react_aria_components20.DateRangePickerStateContext);
|
|
1876
1997
|
if (!state?.value?.start && !state?.value?.end) {
|
|
1877
1998
|
return null;
|
|
1878
1999
|
}
|
|
1879
|
-
return /* @__PURE__ */ (0,
|
|
1880
|
-
|
|
2000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2001
|
+
import_react_aria_components20.Button,
|
|
1881
2002
|
{
|
|
1882
2003
|
className: "pire-input-clear",
|
|
1883
2004
|
slot: null,
|
|
@@ -1925,8 +2046,8 @@ function DateRangePicker({
|
|
|
1925
2046
|
}
|
|
1926
2047
|
onChange(valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end });
|
|
1927
2048
|
};
|
|
1928
|
-
return /* @__PURE__ */ (0,
|
|
1929
|
-
|
|
2049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2050
|
+
import_react_aria_components20.DateRangePicker,
|
|
1930
2051
|
{
|
|
1931
2052
|
className: cx("pire-field", className),
|
|
1932
2053
|
style,
|
|
@@ -1941,12 +2062,12 @@ function DateRangePicker({
|
|
|
1941
2062
|
...rest,
|
|
1942
2063
|
isInvalid: rest.isInvalid || tooLong || void 0,
|
|
1943
2064
|
children: [
|
|
1944
|
-
label ? /* @__PURE__ */ (0,
|
|
2065
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components20.Label, { className: "pire-field-label", children: [
|
|
1945
2066
|
label,
|
|
1946
|
-
rest.isRequired ? /* @__PURE__ */ (0,
|
|
2067
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1947
2068
|
] }) : null,
|
|
1948
|
-
/* @__PURE__ */ (0,
|
|
1949
|
-
|
|
2069
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2070
|
+
import_react_aria_components20.Group,
|
|
1950
2071
|
{
|
|
1951
2072
|
className: "pire-control pire-daterange-control",
|
|
1952
2073
|
"data-size": size,
|
|
@@ -1954,31 +2075,31 @@ function DateRangePicker({
|
|
|
1954
2075
|
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
1955
2076
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1956
2077
|
children: [
|
|
1957
|
-
/* @__PURE__ */ (0,
|
|
1958
|
-
/* @__PURE__ */ (0,
|
|
1959
|
-
/* @__PURE__ */ (0,
|
|
1960
|
-
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ (0,
|
|
1961
|
-
/* @__PURE__ */ (0,
|
|
1962
|
-
|
|
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,
|
|
1963
2084
|
{
|
|
1964
2085
|
className: "pire-iconbtn",
|
|
1965
2086
|
"data-size": "sm",
|
|
1966
2087
|
"aria-label": msg.datePickerOpenCalendar,
|
|
1967
2088
|
style: { width: 24, height: 24 },
|
|
1968
|
-
children: /* @__PURE__ */ (0,
|
|
2089
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "calendar", size: 16 })
|
|
1969
2090
|
}
|
|
1970
2091
|
)
|
|
1971
2092
|
]
|
|
1972
2093
|
}
|
|
1973
2094
|
),
|
|
1974
|
-
description ? /* @__PURE__ */ (0,
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
1976
|
-
/* @__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: [
|
|
1977
2098
|
presets?.length ? (
|
|
1978
2099
|
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
1979
2100
|
// arrowing through a month first.
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1981
|
-
|
|
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,
|
|
1982
2103
|
{
|
|
1983
2104
|
className: "pire-daterange-preset",
|
|
1984
2105
|
onPress: () => emit(coerceRange(preset.range()) ?? null),
|
|
@@ -1987,33 +2108,33 @@ function DateRangePicker({
|
|
|
1987
2108
|
preset.id
|
|
1988
2109
|
)) })
|
|
1989
2110
|
) : null,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1993
|
-
|
|
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,
|
|
1994
2115
|
{
|
|
1995
2116
|
slot: "previous",
|
|
1996
2117
|
className: "pire-iconbtn",
|
|
1997
2118
|
"data-size": "sm",
|
|
1998
2119
|
"aria-label": msg.datePickerPreviousMonth,
|
|
1999
|
-
children: /* @__PURE__ */ (0,
|
|
2120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "chevron-left", size: 16 })
|
|
2000
2121
|
}
|
|
2001
2122
|
),
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2003
|
-
/* @__PURE__ */ (0,
|
|
2004
|
-
|
|
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,
|
|
2005
2126
|
{
|
|
2006
2127
|
slot: "next",
|
|
2007
2128
|
className: "pire-iconbtn",
|
|
2008
2129
|
"data-size": "sm",
|
|
2009
2130
|
"aria-label": msg.datePickerNextMonth,
|
|
2010
|
-
children: /* @__PURE__ */ (0,
|
|
2131
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "chevron-right", size: 16 })
|
|
2011
2132
|
}
|
|
2012
2133
|
)
|
|
2013
2134
|
] }),
|
|
2014
|
-
/* @__PURE__ */ (0,
|
|
2015
|
-
/* @__PURE__ */ (0,
|
|
2016
|
-
/* @__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" }) })
|
|
2017
2138
|
] })
|
|
2018
2139
|
] })
|
|
2019
2140
|
] }) })
|
|
@@ -2023,26 +2144,26 @@ function DateRangePicker({
|
|
|
2023
2144
|
}
|
|
2024
2145
|
|
|
2025
2146
|
// src/components/forms/ValueHelpField.tsx
|
|
2026
|
-
var
|
|
2147
|
+
var React20 = __toESM(require("react"), 1);
|
|
2027
2148
|
|
|
2028
2149
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2029
|
-
var
|
|
2150
|
+
var React19 = __toESM(require("react"), 1);
|
|
2030
2151
|
|
|
2031
2152
|
// src/components/feedback/Dialog.tsx
|
|
2032
2153
|
var React17 = __toESM(require("react"), 1);
|
|
2033
|
-
var
|
|
2034
|
-
var
|
|
2154
|
+
var import_react_aria_components21 = require("react-aria-components");
|
|
2155
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2035
2156
|
function DialogTitle({ children, className }) {
|
|
2036
|
-
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 });
|
|
2037
2158
|
}
|
|
2038
2159
|
function DialogDescription({ children, className }) {
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: cx("pire-dialog-sub", className), style: { margin: 0 }, children });
|
|
2040
2161
|
}
|
|
2041
2162
|
function DialogBody({ children, className }) {
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cx("pire-dialog-body", className), children });
|
|
2043
2164
|
}
|
|
2044
2165
|
function DialogActions({ children, className }) {
|
|
2045
|
-
return /* @__PURE__ */ (0,
|
|
2166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("footer", { className: cx("pire-dialog-foot", className), children });
|
|
2046
2167
|
}
|
|
2047
2168
|
function Dialog({
|
|
2048
2169
|
isOpen,
|
|
@@ -2071,12 +2192,12 @@ function Dialog({
|
|
|
2071
2192
|
const actionsSlot = slotOf(DialogActions);
|
|
2072
2193
|
const slots = [titleSlot, descriptionSlot, bodySlot, actionsSlot];
|
|
2073
2194
|
const loose = parts.filter((node) => !slots.includes(node));
|
|
2074
|
-
const heading = titleSlot ?? (title ? /* @__PURE__ */ (0,
|
|
2075
|
-
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ (0,
|
|
2076
|
-
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ (0,
|
|
2077
|
-
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ (0,
|
|
2078
|
-
return /* @__PURE__ */ (0,
|
|
2079
|
-
|
|
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,
|
|
2080
2201
|
{
|
|
2081
2202
|
className: "pire-modal-overlay",
|
|
2082
2203
|
isOpen,
|
|
@@ -2084,13 +2205,13 @@ function Dialog({
|
|
|
2084
2205
|
onOpenChange: (o) => {
|
|
2085
2206
|
if (!o) close();
|
|
2086
2207
|
},
|
|
2087
|
-
children: /* @__PURE__ */ (0,
|
|
2088
|
-
heading || description ? /* @__PURE__ */ (0,
|
|
2089
|
-
/* @__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: [
|
|
2090
2211
|
heading,
|
|
2091
2212
|
description
|
|
2092
2213
|
] }),
|
|
2093
|
-
showClose ? /* @__PURE__ */ (0,
|
|
2214
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
2094
2215
|
] }) : null,
|
|
2095
2216
|
body,
|
|
2096
2217
|
actions
|
|
@@ -2100,12 +2221,13 @@ function Dialog({
|
|
|
2100
2221
|
}
|
|
2101
2222
|
|
|
2102
2223
|
// src/components/data/DataTable.tsx
|
|
2103
|
-
var
|
|
2224
|
+
var React18 = __toESM(require("react"), 1);
|
|
2225
|
+
var import_react_aria_components22 = require("react-aria-components");
|
|
2104
2226
|
|
|
2105
2227
|
// src/components/feedback/Skeleton.tsx
|
|
2106
|
-
var
|
|
2228
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2107
2229
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2109
2231
|
"div",
|
|
2110
2232
|
{
|
|
2111
2233
|
className: cx("pire-skeleton", className),
|
|
@@ -2119,7 +2241,7 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2119
2241
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2120
2242
|
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
2121
2243
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2122
|
-
return /* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2123
2245
|
"div",
|
|
2124
2246
|
{
|
|
2125
2247
|
className: cx("pire-skeleton-row", className),
|
|
@@ -2131,13 +2253,13 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2131
2253
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2132
2254
|
return (
|
|
2133
2255
|
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
2134
|
-
/* @__PURE__ */ (0,
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2135
2257
|
"div",
|
|
2136
2258
|
{
|
|
2137
2259
|
className: "pire-skeleton-cell",
|
|
2138
2260
|
"data-align": align,
|
|
2139
2261
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2140
|
-
children: /* @__PURE__ */ (0,
|
|
2262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2141
2263
|
},
|
|
2142
2264
|
i
|
|
2143
2265
|
)
|
|
@@ -2148,7 +2270,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2148
2270
|
}
|
|
2149
2271
|
|
|
2150
2272
|
// src/components/data/DataTable.tsx
|
|
2151
|
-
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;
|
|
2152
2282
|
function DataTable({
|
|
2153
2283
|
columns,
|
|
2154
2284
|
rows,
|
|
@@ -2156,6 +2286,7 @@ function DataTable({
|
|
|
2156
2286
|
selectable,
|
|
2157
2287
|
selected,
|
|
2158
2288
|
onSelectionChange,
|
|
2289
|
+
hideSelectAll,
|
|
2159
2290
|
sort,
|
|
2160
2291
|
onSortChange,
|
|
2161
2292
|
onRowAction,
|
|
@@ -2175,14 +2306,53 @@ function DataTable({
|
|
|
2175
2306
|
const msg = usePireMessages();
|
|
2176
2307
|
const selectionMode = selectable === true || selectable === "multiple" ? "multiple" : selectable === "single" ? "single" : "none";
|
|
2177
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;
|
|
2178
2342
|
const sortDescriptor = sort ? { column: sort.key, direction: sort.dir === "asc" ? "ascending" : "descending" } : void 0;
|
|
2179
2343
|
const handleSelection = (keys) => {
|
|
2180
|
-
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
|
+
}
|
|
2181
2351
|
onSelectionChange?.([...keys]);
|
|
2182
2352
|
};
|
|
2183
2353
|
const skeletonRows = loadingRowCount ?? (rows.length || 5);
|
|
2184
2354
|
const skeletonColumns = [
|
|
2185
|
-
...hasCheckboxColumn ? [{ width:
|
|
2355
|
+
...hasCheckboxColumn ? [{ width: CHECKBOX_W }] : [],
|
|
2186
2356
|
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
2187
2357
|
];
|
|
2188
2358
|
const body = isLoading ? [] : rows;
|
|
@@ -2191,19 +2361,30 @@ function DataTable({
|
|
|
2191
2361
|
const expanded = new Set((expandedIds ?? []).map(String));
|
|
2192
2362
|
const spanAll = columns.length + (hasCheckboxColumn ? 1 : 0);
|
|
2193
2363
|
const expandedKey = (id) => `${id}::__pire_expanded__`;
|
|
2194
|
-
|
|
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)(
|
|
2195
2375
|
"div",
|
|
2196
2376
|
{
|
|
2197
2377
|
className: cx("pire-table-wrap", className),
|
|
2198
2378
|
style,
|
|
2199
2379
|
"data-loading": isLoading ? "true" : void 0,
|
|
2200
2380
|
"aria-busy": isLoading ? "true" : void 0,
|
|
2201
|
-
children: /* @__PURE__ */ (0,
|
|
2202
|
-
|
|
2381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2382
|
+
import_react_aria_components22.Table,
|
|
2203
2383
|
{
|
|
2204
2384
|
className: "pire-table",
|
|
2205
2385
|
"data-density": density,
|
|
2206
2386
|
"data-sticky": String(stickyHeader),
|
|
2387
|
+
"data-pinned": hasPinned ? "true" : void 0,
|
|
2207
2388
|
"aria-label": rest["aria-label"],
|
|
2208
2389
|
disabledKeys: disabledKeys.length ? new Set(disabledKeys) : void 0,
|
|
2209
2390
|
selectionMode,
|
|
@@ -2216,78 +2397,95 @@ function DataTable({
|
|
|
2216
2397
|
if (row) onRowAction(row);
|
|
2217
2398
|
} : void 0,
|
|
2218
2399
|
children: [
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2221
|
-
columns.map((c, i) =>
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
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
|
+
)
|
|
2244
2433
|
))
|
|
2245
2434
|
] }),
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2247
|
-
/* @__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 }),
|
|
2248
2437
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2249
2438
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2250
|
-
/* @__PURE__ */ (0,
|
|
2439
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2251
2440
|
))
|
|
2252
|
-
] }) : /* @__PURE__ */ (0,
|
|
2441
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }), children: body.flatMap((row) => {
|
|
2253
2442
|
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2254
|
-
const record = /* @__PURE__ */ (0,
|
|
2255
|
-
|
|
2443
|
+
const record = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2444
|
+
import_react_aria_components22.Row,
|
|
2256
2445
|
{
|
|
2257
2446
|
id: row.id,
|
|
2258
2447
|
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2259
2448
|
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2260
2449
|
children: [
|
|
2261
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2262
|
-
columns.map((c) =>
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
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
|
+
})
|
|
2272
2466
|
]
|
|
2273
2467
|
},
|
|
2274
2468
|
row.id
|
|
2275
2469
|
);
|
|
2276
2470
|
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2277
|
-
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))];
|
|
2278
2472
|
}) }),
|
|
2279
|
-
footer && !isLoading ? /* @__PURE__ */ (0,
|
|
2280
|
-
hasCheckboxColumn ? /* @__PURE__ */ (0,
|
|
2281
|
-
columns.map((c, i) =>
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
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
|
+
})
|
|
2291
2489
|
] }) }) : null
|
|
2292
2490
|
]
|
|
2293
2491
|
}
|
|
@@ -2297,7 +2495,7 @@ function DataTable({
|
|
|
2297
2495
|
}
|
|
2298
2496
|
|
|
2299
2497
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2300
|
-
var
|
|
2498
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2301
2499
|
function ValueHelpDialog({
|
|
2302
2500
|
isOpen,
|
|
2303
2501
|
title,
|
|
@@ -2310,14 +2508,19 @@ function ValueHelpDialog({
|
|
|
2310
2508
|
isLoading,
|
|
2311
2509
|
onLoadMore,
|
|
2312
2510
|
onSelect,
|
|
2313
|
-
onClose
|
|
2511
|
+
onClose,
|
|
2512
|
+
selectionMode = "single",
|
|
2513
|
+
selectedKeys,
|
|
2514
|
+
onSelectionChange,
|
|
2515
|
+
onConfirm
|
|
2314
2516
|
}) {
|
|
2315
2517
|
const msg = usePireMessages();
|
|
2316
|
-
const [query, setQuery] =
|
|
2317
|
-
|
|
2518
|
+
const [query, setQuery] = React19.useState("");
|
|
2519
|
+
React19.useEffect(() => {
|
|
2318
2520
|
if (isOpen) setQuery("");
|
|
2319
2521
|
}, [isOpen]);
|
|
2320
|
-
const
|
|
2522
|
+
const isMultiple = selectionMode === "multiple";
|
|
2523
|
+
const filtered = React19.useMemo(() => {
|
|
2321
2524
|
if (isFilteredExternally) return rows;
|
|
2322
2525
|
const q = query.trim().toLowerCase();
|
|
2323
2526
|
if (!q) return rows;
|
|
@@ -2327,16 +2530,22 @@ function ValueHelpDialog({
|
|
|
2327
2530
|
setQuery(value);
|
|
2328
2531
|
onSearch?.(value);
|
|
2329
2532
|
};
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
2533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2331
2534
|
Dialog,
|
|
2332
2535
|
{
|
|
2333
2536
|
isOpen,
|
|
2334
2537
|
size: "lg",
|
|
2335
2538
|
title: title ?? msg.valueHelpDialogTitle,
|
|
2336
2539
|
onClose,
|
|
2337
|
-
footer: /* @__PURE__ */ (0,
|
|
2338
|
-
|
|
2339
|
-
/* @__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)(
|
|
2340
2549
|
Input,
|
|
2341
2550
|
{
|
|
2342
2551
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -2349,10 +2558,15 @@ function ValueHelpDialog({
|
|
|
2349
2558
|
autoFocus: true
|
|
2350
2559
|
}
|
|
2351
2560
|
),
|
|
2352
|
-
/* @__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) => {
|
|
2353
2567
|
const el = event.currentTarget;
|
|
2354
2568
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2355
|
-
} : 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)(
|
|
2356
2570
|
DataTable,
|
|
2357
2571
|
{
|
|
2358
2572
|
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
@@ -2361,7 +2575,11 @@ function ValueHelpDialog({
|
|
|
2361
2575
|
rows: filtered,
|
|
2362
2576
|
isLoading,
|
|
2363
2577
|
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2364
|
-
|
|
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) => {
|
|
2365
2583
|
onSelect?.(row);
|
|
2366
2584
|
onClose?.();
|
|
2367
2585
|
}
|
|
@@ -2373,7 +2591,7 @@ function ValueHelpDialog({
|
|
|
2373
2591
|
}
|
|
2374
2592
|
|
|
2375
2593
|
// src/components/forms/ValueHelpField.tsx
|
|
2376
|
-
var
|
|
2594
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2377
2595
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
2378
2596
|
function ValueHelpField({
|
|
2379
2597
|
label,
|
|
@@ -2399,9 +2617,9 @@ function ValueHelpField({
|
|
|
2399
2617
|
style
|
|
2400
2618
|
}) {
|
|
2401
2619
|
const msg = usePireMessages();
|
|
2402
|
-
const [open, setOpen] =
|
|
2403
|
-
return /* @__PURE__ */ (0,
|
|
2404
|
-
/* @__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)(
|
|
2405
2623
|
Input,
|
|
2406
2624
|
{
|
|
2407
2625
|
label,
|
|
@@ -2413,8 +2631,8 @@ function ValueHelpField({
|
|
|
2413
2631
|
placeholder: placeholder ?? msg.valueHelpFieldPlaceholder,
|
|
2414
2632
|
description,
|
|
2415
2633
|
errorMessage,
|
|
2416
|
-
suffix: /* @__PURE__ */ (0,
|
|
2417
|
-
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)(
|
|
2418
2636
|
IconButton,
|
|
2419
2637
|
{
|
|
2420
2638
|
icon: "x",
|
|
@@ -2423,7 +2641,7 @@ function ValueHelpField({
|
|
|
2423
2641
|
onPress: () => onChange?.(null)
|
|
2424
2642
|
}
|
|
2425
2643
|
) : null,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2427
2645
|
IconButton,
|
|
2428
2646
|
{
|
|
2429
2647
|
icon: "search",
|
|
@@ -2435,7 +2653,7 @@ function ValueHelpField({
|
|
|
2435
2653
|
] })
|
|
2436
2654
|
}
|
|
2437
2655
|
),
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2656
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2439
2657
|
ValueHelpDialog,
|
|
2440
2658
|
{
|
|
2441
2659
|
isOpen: open,
|
|
@@ -2455,12 +2673,12 @@ function ValueHelpField({
|
|
|
2455
2673
|
}
|
|
2456
2674
|
|
|
2457
2675
|
// src/components/forms/FileUpload.tsx
|
|
2458
|
-
var
|
|
2459
|
-
var
|
|
2676
|
+
var React21 = __toESM(require("react"), 1);
|
|
2677
|
+
var import_react_aria_components24 = require("react-aria-components");
|
|
2460
2678
|
|
|
2461
2679
|
// src/components/feedback/ProgressBar.tsx
|
|
2462
|
-
var
|
|
2463
|
-
var
|
|
2680
|
+
var import_react_aria_components23 = require("react-aria-components");
|
|
2681
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2464
2682
|
function ProgressBar({
|
|
2465
2683
|
value = 0,
|
|
2466
2684
|
minValue = 0,
|
|
@@ -2473,8 +2691,8 @@ function ProgressBar({
|
|
|
2473
2691
|
className,
|
|
2474
2692
|
style
|
|
2475
2693
|
}) {
|
|
2476
|
-
return /* @__PURE__ */ (0,
|
|
2477
|
-
|
|
2694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2695
|
+
import_react_aria_components23.ProgressBar,
|
|
2478
2696
|
{
|
|
2479
2697
|
className: cx("pire-progress", className),
|
|
2480
2698
|
"data-status": status,
|
|
@@ -2484,19 +2702,19 @@ function ProgressBar({
|
|
|
2484
2702
|
maxValue,
|
|
2485
2703
|
isIndeterminate,
|
|
2486
2704
|
style,
|
|
2487
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */ (0,
|
|
2488
|
-
label || showValue ? /* @__PURE__ */ (0,
|
|
2489
|
-
label ? /* @__PURE__ */ (0,
|
|
2490
|
-
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
|
|
2491
2709
|
] }) : null,
|
|
2492
|
-
/* @__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}%` } }) })
|
|
2493
2711
|
] })
|
|
2494
2712
|
}
|
|
2495
2713
|
);
|
|
2496
2714
|
}
|
|
2497
2715
|
|
|
2498
2716
|
// src/components/forms/FileUpload.tsx
|
|
2499
|
-
var
|
|
2717
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2500
2718
|
var isImage = (file) => file.type.startsWith("image/");
|
|
2501
2719
|
function formatFileSize(bytes) {
|
|
2502
2720
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2546,10 +2764,10 @@ function FileUpload({
|
|
|
2546
2764
|
...rest
|
|
2547
2765
|
}) {
|
|
2548
2766
|
const msg = usePireMessages();
|
|
2549
|
-
const [uncontrolled, setUncontrolled] =
|
|
2767
|
+
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2550
2768
|
const files = value ?? uncontrolled;
|
|
2551
|
-
const created =
|
|
2552
|
-
|
|
2769
|
+
const created = React21.useRef([]);
|
|
2770
|
+
React21.useEffect(() => () => {
|
|
2553
2771
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2554
2772
|
}, []);
|
|
2555
2773
|
const commit = (next) => {
|
|
@@ -2569,7 +2787,7 @@ function FileUpload({
|
|
|
2569
2787
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
2570
2788
|
};
|
|
2571
2789
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
2572
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2573
2791
|
"div",
|
|
2574
2792
|
{
|
|
2575
2793
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -2578,24 +2796,24 @@ function FileUpload({
|
|
|
2578
2796
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
2579
2797
|
...rest,
|
|
2580
2798
|
children: [
|
|
2581
|
-
label ? /* @__PURE__ */ (0,
|
|
2799
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "pire-field-label", children: [
|
|
2582
2800
|
label,
|
|
2583
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
2801
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2584
2802
|
] }) : null,
|
|
2585
|
-
/* @__PURE__ */ (0,
|
|
2586
|
-
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2804
|
+
import_react_aria_components24.FileTrigger,
|
|
2587
2805
|
{
|
|
2588
2806
|
acceptedFileTypes,
|
|
2589
2807
|
allowsMultiple,
|
|
2590
2808
|
onSelect: accept,
|
|
2591
|
-
children: /* @__PURE__ */ (0,
|
|
2809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
2592
2810
|
}
|
|
2593
2811
|
),
|
|
2594
|
-
files.length ? /* @__PURE__ */ (0,
|
|
2595
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
2598
|
-
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)(
|
|
2599
2817
|
IconButton,
|
|
2600
2818
|
{
|
|
2601
2819
|
icon: "x",
|
|
@@ -2605,17 +2823,17 @@ function FileUpload({
|
|
|
2605
2823
|
}
|
|
2606
2824
|
)
|
|
2607
2825
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
2608
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
2609
|
-
description ? /* @__PURE__ */ (0,
|
|
2610
|
-
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
|
|
2611
2829
|
]
|
|
2612
2830
|
}
|
|
2613
2831
|
);
|
|
2614
2832
|
}
|
|
2615
2833
|
|
|
2616
2834
|
// src/components/navigation/ShellBar.tsx
|
|
2617
|
-
var
|
|
2618
|
-
var
|
|
2835
|
+
var import_react_aria_components25 = require("react-aria-components");
|
|
2836
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2619
2837
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
2620
2838
|
function ShellBar({
|
|
2621
2839
|
launcher,
|
|
@@ -2634,46 +2852,46 @@ function ShellBar({
|
|
|
2634
2852
|
...rest
|
|
2635
2853
|
}) {
|
|
2636
2854
|
const msg = usePireMessages();
|
|
2637
|
-
return /* @__PURE__ */ (0,
|
|
2855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
2638
2856
|
launcher,
|
|
2639
|
-
onMenu ? /* @__PURE__ */ (0,
|
|
2640
|
-
monogram ? /* @__PURE__ */ (0,
|
|
2641
|
-
product ? /* @__PURE__ */ (0,
|
|
2642
|
-
title ? /* @__PURE__ */ (0,
|
|
2643
|
-
/* @__PURE__ */ (0,
|
|
2644
|
-
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,
|
|
2645
2863
|
actions,
|
|
2646
2864
|
user && userMenu ? (
|
|
2647
2865
|
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
2648
2866
|
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
2649
2867
|
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
2650
|
-
/* @__PURE__ */ (0,
|
|
2651
|
-
/* @__PURE__ */ (0,
|
|
2652
|
-
|
|
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,
|
|
2653
2871
|
{
|
|
2654
2872
|
className: "pire-avatar pire-avatar-trigger",
|
|
2655
2873
|
"aria-label": (userMenuLabel ?? msg.shellBarUserMenu).replace("{user}", user),
|
|
2656
2874
|
children: initials2(user)
|
|
2657
2875
|
}
|
|
2658
2876
|
),
|
|
2659
|
-
/* @__PURE__ */ (0,
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_aria_components25.Popover, { className: "pire-popover", children: userMenu })
|
|
2660
2878
|
] })
|
|
2661
|
-
) : 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
|
|
2662
2880
|
] });
|
|
2663
2881
|
}
|
|
2664
2882
|
|
|
2665
2883
|
// src/components/navigation/SideNav.tsx
|
|
2666
|
-
var
|
|
2667
|
-
var
|
|
2884
|
+
var React22 = __toESM(require("react"), 1);
|
|
2885
|
+
var import_react_aria_components27 = require("react-aria-components");
|
|
2668
2886
|
|
|
2669
2887
|
// src/components/navigation/Menu.tsx
|
|
2670
|
-
var
|
|
2671
|
-
var
|
|
2888
|
+
var import_react_aria_components26 = require("react-aria-components");
|
|
2889
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2672
2890
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2673
2891
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2674
2892
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2675
|
-
return /* @__PURE__ */ (0,
|
|
2676
|
-
|
|
2893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2894
|
+
import_react_aria_components26.Menu,
|
|
2677
2895
|
{
|
|
2678
2896
|
className: cx("pire-menu", className),
|
|
2679
2897
|
style: menuStyle,
|
|
@@ -2696,35 +2914,35 @@ function MenuItem({
|
|
|
2696
2914
|
...rest
|
|
2697
2915
|
}) {
|
|
2698
2916
|
const keys = shortcutKeys(shortcut);
|
|
2699
|
-
return /* @__PURE__ */ (0,
|
|
2700
|
-
|
|
2917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
2918
|
+
import_react_aria_components26.MenuItem,
|
|
2701
2919
|
{
|
|
2702
2920
|
className: cx("pire-menu-item", className),
|
|
2703
2921
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
2704
2922
|
...rest,
|
|
2705
2923
|
children: [
|
|
2706
|
-
icon ? /* @__PURE__ */ (0,
|
|
2707
|
-
/* @__PURE__ */ (0,
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2709
|
-
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
|
|
2710
2928
|
] }),
|
|
2711
|
-
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
|
|
2712
2930
|
]
|
|
2713
2931
|
}
|
|
2714
2932
|
);
|
|
2715
2933
|
}
|
|
2716
2934
|
function MenuSection({ title, children, className, ...rest }) {
|
|
2717
|
-
return /* @__PURE__ */ (0,
|
|
2718
|
-
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,
|
|
2719
2937
|
children
|
|
2720
2938
|
] });
|
|
2721
2939
|
}
|
|
2722
2940
|
function MenuSeparator({ className }) {
|
|
2723
|
-
return /* @__PURE__ */ (0,
|
|
2941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components26.Separator, { className: cx("pire-menu-separator", className) });
|
|
2724
2942
|
}
|
|
2725
2943
|
|
|
2726
2944
|
// src/components/navigation/SideNav.tsx
|
|
2727
|
-
var
|
|
2945
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2728
2946
|
function findActiveParent(groups, value) {
|
|
2729
2947
|
if (value == null) return void 0;
|
|
2730
2948
|
for (const group of groups) {
|
|
@@ -2750,10 +2968,10 @@ function SideNav({
|
|
|
2750
2968
|
const msg = usePireMessages();
|
|
2751
2969
|
const activeParent = findActiveParent(groups, value);
|
|
2752
2970
|
const isControlled = expandedIds != null;
|
|
2753
|
-
const [ownExpanded, setOwnExpanded] =
|
|
2971
|
+
const [ownExpanded, setOwnExpanded] = React22.useState(
|
|
2754
2972
|
() => new Set(defaultExpandedIds ?? (activeParent ? [activeParent] : []))
|
|
2755
2973
|
);
|
|
2756
|
-
const [lastValue, setLastValue] =
|
|
2974
|
+
const [lastValue, setLastValue] = React22.useState(value);
|
|
2757
2975
|
if (value !== lastValue) {
|
|
2758
2976
|
setLastValue(value);
|
|
2759
2977
|
if (!isControlled && activeParent && !ownExpanded.has(activeParent)) {
|
|
@@ -2773,8 +2991,8 @@ function SideNav({
|
|
|
2773
2991
|
};
|
|
2774
2992
|
const renderRow = (item, onPress, isGroup) => {
|
|
2775
2993
|
const selected = !isGroup && item.id === value;
|
|
2776
|
-
const button = /* @__PURE__ */ (0,
|
|
2777
|
-
|
|
2994
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2995
|
+
import_react_aria_components27.Button,
|
|
2778
2996
|
{
|
|
2779
2997
|
className: "pire-sidenav-item",
|
|
2780
2998
|
"data-selected": selected ? "true" : void 0,
|
|
@@ -2783,70 +3001,70 @@ function SideNav({
|
|
|
2783
3001
|
"aria-label": collapsed ? item.label : void 0,
|
|
2784
3002
|
onPress,
|
|
2785
3003
|
children: [
|
|
2786
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2787
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
2788
|
-
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
|
|
2789
3007
|
]
|
|
2790
3008
|
},
|
|
2791
3009
|
item.id
|
|
2792
3010
|
);
|
|
2793
|
-
return collapsed ? /* @__PURE__ */ (0,
|
|
3011
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
2794
3012
|
};
|
|
2795
|
-
const renderRailFlyout = (item) => /* @__PURE__ */ (0,
|
|
2796
|
-
/* @__PURE__ */ (0,
|
|
2797
|
-
|
|
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,
|
|
2798
3016
|
{
|
|
2799
3017
|
className: "pire-sidenav-item",
|
|
2800
3018
|
"aria-label": item.label,
|
|
2801
3019
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2802
|
-
children: item.icon ? /* @__PURE__ */ (0,
|
|
3020
|
+
children: item.icon ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: item.icon, size: 16 }) : null
|
|
2803
3021
|
}
|
|
2804
3022
|
),
|
|
2805
|
-
/* @__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)(
|
|
2806
3024
|
Menu,
|
|
2807
3025
|
{
|
|
2808
3026
|
"aria-label": item.label,
|
|
2809
3027
|
className: "pire-sidenav-flyout",
|
|
2810
3028
|
onAction: (key) => onChange?.(String(key)),
|
|
2811
|
-
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))
|
|
2812
3030
|
}
|
|
2813
3031
|
) })
|
|
2814
3032
|
] }, item.id);
|
|
2815
|
-
const renderSection = (item) => /* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2817
|
-
|
|
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,
|
|
2818
3036
|
{
|
|
2819
3037
|
slot: "trigger",
|
|
2820
3038
|
className: "pire-sidenav-item",
|
|
2821
3039
|
"data-kind": "group",
|
|
2822
3040
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2823
3041
|
children: [
|
|
2824
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
2827
|
-
/* @__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" })
|
|
2828
3046
|
]
|
|
2829
3047
|
}
|
|
2830
3048
|
),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_aria_components27.DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
2832
3050
|
const selected = child.id === value;
|
|
2833
|
-
return /* @__PURE__ */ (0,
|
|
2834
|
-
|
|
3051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3052
|
+
import_react_aria_components27.Button,
|
|
2835
3053
|
{
|
|
2836
3054
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
2837
3055
|
"data-selected": selected ? "true" : void 0,
|
|
2838
3056
|
"aria-current": selected ? "page" : void 0,
|
|
2839
3057
|
onPress: () => onChange?.(child.id),
|
|
2840
3058
|
children: [
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
2842
|
-
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
|
|
2843
3061
|
]
|
|
2844
3062
|
},
|
|
2845
3063
|
child.id
|
|
2846
3064
|
);
|
|
2847
3065
|
}) })
|
|
2848
3066
|
] }, item.id);
|
|
2849
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2850
3068
|
"nav",
|
|
2851
3069
|
{
|
|
2852
3070
|
className: cx("pire-sidenav", className),
|
|
@@ -2862,10 +3080,10 @@ function SideNav({
|
|
|
2862
3080
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
2863
3081
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
2864
3082
|
});
|
|
2865
|
-
return /* @__PURE__ */ (0,
|
|
2866
|
-
group.label && !collapsed ? /* @__PURE__ */ (0,
|
|
2867
|
-
hasSections ? /* @__PURE__ */ (0,
|
|
2868
|
-
|
|
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,
|
|
2869
3087
|
{
|
|
2870
3088
|
className: "pire-sidenav-tree",
|
|
2871
3089
|
allowsMultipleExpanded: true,
|
|
@@ -2876,44 +3094,44 @@ function SideNav({
|
|
|
2876
3094
|
) : rows
|
|
2877
3095
|
] }, group.label ?? gi);
|
|
2878
3096
|
}),
|
|
2879
|
-
footer ? /* @__PURE__ */ (0,
|
|
3097
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
2880
3098
|
]
|
|
2881
3099
|
}
|
|
2882
3100
|
);
|
|
2883
3101
|
}
|
|
2884
3102
|
|
|
2885
3103
|
// src/components/navigation/ShellRail.tsx
|
|
2886
|
-
var
|
|
2887
|
-
var
|
|
2888
|
-
var
|
|
3104
|
+
var React23 = __toESM(require("react"), 1);
|
|
3105
|
+
var import_react_aria_components28 = require("react-aria-components");
|
|
3106
|
+
var import_jsx_runtime40 = (
|
|
2889
3107
|
// The divider is a sibling of the groups rather than a pseudo-element on one, because the
|
|
2890
3108
|
// scrolling zone would carry its own rule out of view on the first wheel event.
|
|
2891
3109
|
require("react/jsx-runtime")
|
|
2892
3110
|
);
|
|
2893
3111
|
function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
2894
3112
|
const msg = usePireMessages();
|
|
2895
|
-
return /* @__PURE__ */ (0,
|
|
2896
|
-
gi > 0 ? /* @__PURE__ */ (0,
|
|
2897
|
-
/* @__PURE__ */ (0,
|
|
2898
|
-
|
|
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,
|
|
2899
3117
|
{
|
|
2900
3118
|
className: "pire-shellrail-item",
|
|
2901
3119
|
"aria-label": item.label,
|
|
2902
3120
|
"data-selected": item.id === value ? "true" : void 0,
|
|
2903
3121
|
"aria-current": item.id === value ? "true" : void 0,
|
|
2904
3122
|
onPress: () => onChange?.(item.id),
|
|
2905
|
-
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 }) })
|
|
2906
3124
|
}
|
|
2907
3125
|
) }, item.id)) })
|
|
2908
3126
|
] }, group.items[0]?.id ?? gi)) });
|
|
2909
3127
|
}
|
|
2910
3128
|
|
|
2911
3129
|
// src/components/navigation/Tabs.tsx
|
|
2912
|
-
var
|
|
2913
|
-
var
|
|
3130
|
+
var import_react_aria_components29 = require("react-aria-components");
|
|
3131
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2914
3132
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
2915
|
-
return /* @__PURE__ */ (0,
|
|
2916
|
-
|
|
3133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3134
|
+
import_react_aria_components29.Tabs,
|
|
2917
3135
|
{
|
|
2918
3136
|
className,
|
|
2919
3137
|
style,
|
|
@@ -2921,23 +3139,23 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
2921
3139
|
defaultSelectedKey: defaultValue,
|
|
2922
3140
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
2923
3141
|
children: [
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
2925
|
-
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,
|
|
2926
3144
|
item.label,
|
|
2927
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
3145
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "pire-tab-count", children: item.count }) : null
|
|
2928
3146
|
] }) }),
|
|
2929
|
-
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))
|
|
2930
3148
|
]
|
|
2931
3149
|
}
|
|
2932
3150
|
);
|
|
2933
3151
|
}
|
|
2934
3152
|
|
|
2935
3153
|
// src/components/navigation/Breadcrumb.tsx
|
|
2936
|
-
var
|
|
2937
|
-
var
|
|
3154
|
+
var import_react_aria_components30 = require("react-aria-components");
|
|
3155
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2938
3156
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
2939
|
-
return /* @__PURE__ */ (0,
|
|
2940
|
-
|
|
3157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3158
|
+
import_react_aria_components30.Breadcrumbs,
|
|
2941
3159
|
{
|
|
2942
3160
|
className: cx("pire-breadcrumbs", className),
|
|
2943
3161
|
style,
|
|
@@ -2945,9 +3163,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2945
3163
|
onAction: (key) => onNavigate?.(String(key)),
|
|
2946
3164
|
children: (item) => {
|
|
2947
3165
|
const last = items[items.length - 1] === item;
|
|
2948
|
-
return /* @__PURE__ */ (0,
|
|
2949
|
-
last ? item.label : /* @__PURE__ */ (0,
|
|
2950
|
-
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)" } })
|
|
2951
3169
|
] });
|
|
2952
3170
|
}
|
|
2953
3171
|
}
|
|
@@ -2955,7 +3173,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2955
3173
|
}
|
|
2956
3174
|
|
|
2957
3175
|
// src/components/navigation/Pagination.tsx
|
|
2958
|
-
var
|
|
3176
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2959
3177
|
function Pagination({
|
|
2960
3178
|
page = 1,
|
|
2961
3179
|
pageSize = 25,
|
|
@@ -2970,9 +3188,9 @@ function Pagination({
|
|
|
2970
3188
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2971
3189
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
2972
3190
|
const to = Math.min(total, page * pageSize);
|
|
2973
|
-
return /* @__PURE__ */ (0,
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
2975
|
-
/* @__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)(
|
|
2976
3194
|
IconButton,
|
|
2977
3195
|
{
|
|
2978
3196
|
icon: "chevron-left",
|
|
@@ -2983,8 +3201,8 @@ function Pagination({
|
|
|
2983
3201
|
onPress: () => onPageChange?.(page - 1)
|
|
2984
3202
|
}
|
|
2985
3203
|
),
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
2987
|
-
/* @__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)(
|
|
2988
3206
|
IconButton,
|
|
2989
3207
|
{
|
|
2990
3208
|
icon: "chevron-right",
|
|
@@ -2995,7 +3213,7 @@ function Pagination({
|
|
|
2995
3213
|
onPress: () => onPageChange?.(page + 1)
|
|
2996
3214
|
}
|
|
2997
3215
|
),
|
|
2998
|
-
onPageSizeChange ? /* @__PURE__ */ (0,
|
|
3216
|
+
onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2999
3217
|
Select,
|
|
3000
3218
|
{
|
|
3001
3219
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -3010,8 +3228,236 @@ function Pagination({
|
|
|
3010
3228
|
] });
|
|
3011
3229
|
}
|
|
3012
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 useTrailingOverflow() {
|
|
3309
|
+
const ref = React24.useRef(null);
|
|
3310
|
+
const [overflow, setOverflow] = React24.useState(false);
|
|
3311
|
+
React24.useEffect(() => {
|
|
3312
|
+
const node = ref.current;
|
|
3313
|
+
if (!node) return;
|
|
3314
|
+
const measure = () => setOverflow(node.scrollLeft + node.clientWidth < node.scrollWidth - 1);
|
|
3315
|
+
measure();
|
|
3316
|
+
node.addEventListener("scroll", measure, { passive: true });
|
|
3317
|
+
const resize = new ResizeObserver(measure);
|
|
3318
|
+
resize.observe(node);
|
|
3319
|
+
for (const child of node.children) resize.observe(child);
|
|
3320
|
+
return () => {
|
|
3321
|
+
node.removeEventListener("scroll", measure);
|
|
3322
|
+
resize.disconnect();
|
|
3323
|
+
};
|
|
3324
|
+
}, []);
|
|
3325
|
+
return [ref, overflow];
|
|
3326
|
+
}
|
|
3327
|
+
function Surface({ className, id, label, trailing, children }) {
|
|
3328
|
+
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3329
|
+
const domId = id ? { id } : {};
|
|
3330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-scroll", ref: scrollRef, children }),
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-trail", "data-overflow": overflow ? "true" : void 0, children: trailing })
|
|
3333
|
+
] });
|
|
3334
|
+
}
|
|
3335
|
+
function barBlocks(tabs) {
|
|
3336
|
+
const blocks = [];
|
|
3337
|
+
for (const tab of tabs) {
|
|
3338
|
+
if (tab.isContextual) continue;
|
|
3339
|
+
for (const group of tab.groups) {
|
|
3340
|
+
const commands = group.commands.filter((c) => c.inBar);
|
|
3341
|
+
if (commands.length) blocks.push({ key: `${tab.key}:${group.key}`, commands });
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
return blocks;
|
|
3345
|
+
}
|
|
3346
|
+
function Ribbon({
|
|
3347
|
+
children,
|
|
3348
|
+
value,
|
|
3349
|
+
defaultValue,
|
|
3350
|
+
onChange,
|
|
3351
|
+
isCollapsed,
|
|
3352
|
+
onCollapsedChange,
|
|
3353
|
+
leading,
|
|
3354
|
+
actions,
|
|
3355
|
+
selectionCount,
|
|
3356
|
+
className,
|
|
3357
|
+
style,
|
|
3358
|
+
...rest
|
|
3359
|
+
}) {
|
|
3360
|
+
const msg = usePireMessages();
|
|
3361
|
+
const tabs = readTabs(children);
|
|
3362
|
+
const count = selectionCount ?? 0;
|
|
3363
|
+
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3364
|
+
const fallback = visible[0]?.id;
|
|
3365
|
+
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3366
|
+
const requested = value ?? ownTab;
|
|
3367
|
+
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3368
|
+
const select = React24.useCallback((id) => {
|
|
3369
|
+
setOwnTab(id);
|
|
3370
|
+
onChange?.(id);
|
|
3371
|
+
}, [onChange]);
|
|
3372
|
+
const hadSelection = React24.useRef(false);
|
|
3373
|
+
React24.useEffect(() => {
|
|
3374
|
+
const has = count > 0;
|
|
3375
|
+
if (has === hadSelection.current) return;
|
|
3376
|
+
hadSelection.current = has;
|
|
3377
|
+
const contextual = tabs.find((tab) => tab.isContextual);
|
|
3378
|
+
if (!contextual) return;
|
|
3379
|
+
if (has) select(contextual.id);
|
|
3380
|
+
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3381
|
+
}, [count, tabs, requested, select]);
|
|
3382
|
+
const [ownCollapsed, setOwnCollapsed] = React24.useState(false);
|
|
3383
|
+
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3384
|
+
const toggleRef = React24.useRef(null);
|
|
3385
|
+
const restoreFocus = React24.useRef(false);
|
|
3386
|
+
React24.useLayoutEffect(() => {
|
|
3387
|
+
if (!restoreFocus.current) return;
|
|
3388
|
+
restoreFocus.current = false;
|
|
3389
|
+
toggleRef.current?.focus();
|
|
3390
|
+
});
|
|
3391
|
+
const bandId = React24.useId();
|
|
3392
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3393
|
+
import_react_aria_components31.Button,
|
|
3394
|
+
{
|
|
3395
|
+
ref: toggleRef,
|
|
3396
|
+
className: "pire-ribbon-toggle",
|
|
3397
|
+
"aria-expanded": !collapsed,
|
|
3398
|
+
"aria-controls": bandId,
|
|
3399
|
+
"aria-label": collapsed ? msg.ribbonExpand : msg.ribbonCollapse,
|
|
3400
|
+
onPress: () => {
|
|
3401
|
+
restoreFocus.current = document.activeElement === toggleRef.current;
|
|
3402
|
+
setOwnCollapsed(!collapsed);
|
|
3403
|
+
onCollapsedChange?.(!collapsed);
|
|
3404
|
+
},
|
|
3405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3406
|
+
}
|
|
3407
|
+
);
|
|
3408
|
+
if (collapsed) {
|
|
3409
|
+
const blocks = barBlocks(tabs);
|
|
3410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3411
|
+
Surface,
|
|
3412
|
+
{
|
|
3413
|
+
className: "pire-ribbon-bar",
|
|
3414
|
+
label: rest["aria-label"],
|
|
3415
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3416
|
+
actions,
|
|
3417
|
+
toggle
|
|
3418
|
+
] }),
|
|
3419
|
+
children: [
|
|
3420
|
+
leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
3421
|
+
blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(React24.Fragment, { children: [
|
|
3422
|
+
i > 0 || leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
3423
|
+
block.commands.map((c) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3424
|
+
] }, block.key))
|
|
3425
|
+
]
|
|
3426
|
+
}
|
|
3427
|
+
) });
|
|
3428
|
+
}
|
|
3429
|
+
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: [
|
|
3430
|
+
/* @__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)(
|
|
3431
|
+
import_react_aria_components31.Tab,
|
|
3432
|
+
{
|
|
3433
|
+
id: tab.id,
|
|
3434
|
+
className: "pire-ribbon-tab",
|
|
3435
|
+
"data-contextual": tab.isContextual ? "true" : void 0,
|
|
3436
|
+
children: tab.label
|
|
3437
|
+
},
|
|
3438
|
+
tab.key
|
|
3439
|
+
)) }),
|
|
3440
|
+
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.jsx)(
|
|
3441
|
+
Surface,
|
|
3442
|
+
{
|
|
3443
|
+
id: bandId,
|
|
3444
|
+
className: "pire-ribbon-band",
|
|
3445
|
+
label: msg.ribbonLabel,
|
|
3446
|
+
trailing: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3447
|
+
actions,
|
|
3448
|
+
toggle
|
|
3449
|
+
] }),
|
|
3450
|
+
children: tab.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Group8, { group, selectionCount: count }, group.key))
|
|
3451
|
+
}
|
|
3452
|
+
) }, tab.key))
|
|
3453
|
+
] }) });
|
|
3454
|
+
}
|
|
3455
|
+
Ribbon.Tab = RibbonTab;
|
|
3456
|
+
Ribbon.Group = RibbonGroup;
|
|
3457
|
+
Ribbon.Command = RibbonCommand;
|
|
3458
|
+
|
|
3013
3459
|
// src/components/feedback/InlineMessage.tsx
|
|
3014
|
-
var
|
|
3460
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3015
3461
|
var KIND_ICON = {
|
|
3016
3462
|
info: "info",
|
|
3017
3463
|
success: "check-circle-2",
|
|
@@ -3021,7 +3467,7 @@ var KIND_ICON = {
|
|
|
3021
3467
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
3022
3468
|
const msg = usePireMessages();
|
|
3023
3469
|
const assertive = kind === "error" || kind === "warning";
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
3470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3025
3471
|
"div",
|
|
3026
3472
|
{
|
|
3027
3473
|
className: cx("pire-msg", className),
|
|
@@ -3030,21 +3476,21 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
3030
3476
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3031
3477
|
...rest,
|
|
3032
3478
|
children: [
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3035
|
-
title ? /* @__PURE__ */ (0,
|
|
3036
|
-
children ? /* @__PURE__ */ (0,
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
3481
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-title", children: title }) : null,
|
|
3482
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-body", children }) : null,
|
|
3037
3483
|
action
|
|
3038
3484
|
] }),
|
|
3039
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3485
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3040
3486
|
]
|
|
3041
3487
|
}
|
|
3042
3488
|
);
|
|
3043
3489
|
}
|
|
3044
3490
|
|
|
3045
3491
|
// src/components/feedback/Toast.tsx
|
|
3046
|
-
var
|
|
3047
|
-
var
|
|
3492
|
+
var React25 = __toESM(require("react"), 1);
|
|
3493
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3048
3494
|
var KIND_ICON2 = {
|
|
3049
3495
|
info: "info",
|
|
3050
3496
|
success: "check-circle-2",
|
|
@@ -3053,7 +3499,7 @@ var KIND_ICON2 = {
|
|
|
3053
3499
|
};
|
|
3054
3500
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
3055
3501
|
const msg = usePireMessages();
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3057
3503
|
"div",
|
|
3058
3504
|
{
|
|
3059
3505
|
className: cx("pire-toast", className),
|
|
@@ -3062,40 +3508,40 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3062
3508
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3063
3509
|
...rest,
|
|
3064
3510
|
children: [
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
3512
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { style: { flex: 1 }, children }),
|
|
3513
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3068
3514
|
]
|
|
3069
3515
|
}
|
|
3070
3516
|
);
|
|
3071
3517
|
}
|
|
3072
|
-
var ToastContext =
|
|
3518
|
+
var ToastContext = React25.createContext(null);
|
|
3073
3519
|
function ToastProvider({ children, timeout = 6e3 }) {
|
|
3074
3520
|
const msg = usePireMessages();
|
|
3075
|
-
const [toasts, setToasts] =
|
|
3076
|
-
const close =
|
|
3077
|
-
const add =
|
|
3521
|
+
const [toasts, setToasts] = React25.useState([]);
|
|
3522
|
+
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3523
|
+
const add = React25.useCallback((toast) => {
|
|
3078
3524
|
const id = Math.random().toString(36).slice(2);
|
|
3079
3525
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
3080
3526
|
const ms = toast.timeout ?? timeout;
|
|
3081
3527
|
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3082
3528
|
return id;
|
|
3083
3529
|
}, [close, timeout]);
|
|
3084
|
-
const value =
|
|
3085
|
-
return /* @__PURE__ */ (0,
|
|
3530
|
+
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToastContext.Provider, { value, children: [
|
|
3086
3532
|
children,
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3533
|
+
/* @__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)) })
|
|
3088
3534
|
] });
|
|
3089
3535
|
}
|
|
3090
3536
|
function useToast() {
|
|
3091
|
-
const ctx =
|
|
3537
|
+
const ctx = React25.useContext(ToastContext);
|
|
3092
3538
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3093
3539
|
return ctx;
|
|
3094
3540
|
}
|
|
3095
3541
|
|
|
3096
3542
|
// src/components/data/KpiTile.tsx
|
|
3097
|
-
var
|
|
3098
|
-
var
|
|
3543
|
+
var import_react_aria_components32 = require("react-aria-components");
|
|
3544
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3099
3545
|
function KpiTile({
|
|
3100
3546
|
label,
|
|
3101
3547
|
value,
|
|
@@ -3111,50 +3557,50 @@ function KpiTile({
|
|
|
3111
3557
|
style
|
|
3112
3558
|
}) {
|
|
3113
3559
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3114
|
-
const body = /* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
icon ? /* @__PURE__ */ (0,
|
|
3560
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-label", children: [
|
|
3562
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: icon, size: 16 }) : null,
|
|
3117
3563
|
label
|
|
3118
3564
|
] }),
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3565
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-value", children: [
|
|
3120
3566
|
value,
|
|
3121
|
-
unit ? /* @__PURE__ */ (0,
|
|
3567
|
+
unit ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3122
3568
|
] }),
|
|
3123
|
-
delta ? /* @__PURE__ */ (0,
|
|
3124
|
-
deltaDirection ? /* @__PURE__ */ (0,
|
|
3569
|
+
delta ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
3570
|
+
deltaDirection ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3125
3571
|
delta
|
|
3126
3572
|
] }) : null,
|
|
3127
|
-
footnote ? /* @__PURE__ */ (0,
|
|
3573
|
+
footnote ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3128
3574
|
] });
|
|
3129
3575
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3130
|
-
return onPress ? /* @__PURE__ */ (0,
|
|
3576
|
+
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 });
|
|
3131
3577
|
}
|
|
3132
3578
|
|
|
3133
3579
|
// src/components/data/ObjectHeader.tsx
|
|
3134
|
-
var
|
|
3580
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3135
3581
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
3136
|
-
return /* @__PURE__ */ (0,
|
|
3582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3137
3583
|
breadcrumb,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3141
|
-
subtitle || id ? /* @__PURE__ */ (0,
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h1", { className: "pire-objheader-title", children: title }),
|
|
3587
|
+
subtitle || id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-sub", children: [
|
|
3142
3588
|
subtitle,
|
|
3143
|
-
id ? /* @__PURE__ */ (0,
|
|
3589
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-objheader-id", children: id }) : null
|
|
3144
3590
|
] }) : null
|
|
3145
3591
|
] }),
|
|
3146
3592
|
badge,
|
|
3147
|
-
actions ? /* @__PURE__ */ (0,
|
|
3593
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3148
3594
|
] }),
|
|
3149
|
-
facts?.length ? /* @__PURE__ */ (0,
|
|
3150
|
-
/* @__PURE__ */ (0,
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3595
|
+
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: [
|
|
3596
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
3152
3598
|
] }, fact.label)) }) : null
|
|
3153
3599
|
] });
|
|
3154
3600
|
}
|
|
3155
3601
|
|
|
3156
3602
|
// src/components/data/FilterBar.tsx
|
|
3157
|
-
var
|
|
3603
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3158
3604
|
function FilterBar({
|
|
3159
3605
|
children,
|
|
3160
3606
|
activeFilters = [],
|
|
@@ -3171,49 +3617,49 @@ function FilterBar({
|
|
|
3171
3617
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3172
3618
|
const go = useMessage("filterBarGo", goLabel);
|
|
3173
3619
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3174
|
-
return /* @__PURE__ */ (0,
|
|
3175
|
-
/* @__PURE__ */ (0,
|
|
3620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
3621
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-controls", children: [
|
|
3176
3622
|
children,
|
|
3177
|
-
onGo ? /* @__PURE__ */ (0,
|
|
3623
|
+
onGo ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3178
3624
|
] }),
|
|
3179
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0,
|
|
3180
|
-
activeFilters.map((filter) => /* @__PURE__ */ (0,
|
|
3181
|
-
activeFilters.length && onClear ? /* @__PURE__ */ (0,
|
|
3182
|
-
resultLabel ? /* @__PURE__ */ (0,
|
|
3183
|
-
actions ? /* @__PURE__ */ (0,
|
|
3625
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-foot", children: [
|
|
3626
|
+
activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
3627
|
+
activeFilters.length && onClear ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
3628
|
+
resultLabel ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
3629
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3184
3630
|
] }) : null
|
|
3185
3631
|
] });
|
|
3186
3632
|
}
|
|
3187
3633
|
|
|
3188
3634
|
// src/components/data/DescriptionList.tsx
|
|
3189
|
-
var
|
|
3635
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3190
3636
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
3191
|
-
return /* @__PURE__ */ (0,
|
|
3637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3192
3638
|
"dl",
|
|
3193
3639
|
{
|
|
3194
3640
|
className: cx("pire-dl", className),
|
|
3195
3641
|
"data-layout": layout,
|
|
3196
3642
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
3197
3643
|
...rest,
|
|
3198
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3644
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
3645
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("dt", { className: "pire-dl-term", children: [
|
|
3200
3646
|
item.label,
|
|
3201
3647
|
item.hint
|
|
3202
3648
|
] }),
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
3204
3650
|
] }, i))
|
|
3205
3651
|
}
|
|
3206
3652
|
);
|
|
3207
3653
|
}
|
|
3208
3654
|
|
|
3209
3655
|
// src/components/data/Timeline.tsx
|
|
3210
|
-
var
|
|
3656
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3211
3657
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
3212
3658
|
const list = reverse ? [...entries].reverse() : entries;
|
|
3213
|
-
return /* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3216
|
-
entry.actor ? /* @__PURE__ */ (0,
|
|
3659
|
+
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: [
|
|
3660
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-time", children: entry.time }),
|
|
3661
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-text", children: entry.event }),
|
|
3662
|
+
entry.actor ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
3217
3663
|
] }, entry.id ?? i)) });
|
|
3218
3664
|
}
|
|
3219
3665
|
|
|
@@ -3259,10 +3705,10 @@ function seriesColor(series, index) {
|
|
|
3259
3705
|
const slot = series.colorIndex ?? index + 1;
|
|
3260
3706
|
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
3261
3707
|
}
|
|
3262
|
-
var
|
|
3708
|
+
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
3263
3709
|
var warnedCharts = /* @__PURE__ */ new Set();
|
|
3264
3710
|
function warnOnSlotOverflow(series, chartLabel) {
|
|
3265
|
-
if (!
|
|
3711
|
+
if (!IS_DEV3 || warnedCharts.has(chartLabel)) return;
|
|
3266
3712
|
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
3267
3713
|
warnedCharts.add(chartLabel);
|
|
3268
3714
|
console.warn(
|
|
@@ -3270,7 +3716,7 @@ function warnOnSlotOverflow(series, chartLabel) {
|
|
|
3270
3716
|
);
|
|
3271
3717
|
}
|
|
3272
3718
|
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
3273
|
-
if (!
|
|
3719
|
+
if (!IS_DEV3 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
3274
3720
|
const complaints = [];
|
|
3275
3721
|
if (series.length > 1) {
|
|
3276
3722
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
@@ -3296,7 +3742,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
3296
3742
|
}
|
|
3297
3743
|
|
|
3298
3744
|
// src/components/data/ChartFrame.tsx
|
|
3299
|
-
var
|
|
3745
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3300
3746
|
function seriesLegend(series) {
|
|
3301
3747
|
return series.map((one, index) => ({
|
|
3302
3748
|
key: one.id,
|
|
@@ -3319,29 +3765,29 @@ function ChartFrame({
|
|
|
3319
3765
|
children
|
|
3320
3766
|
}) {
|
|
3321
3767
|
const msg = usePireMessages();
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3323
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3324
|
-
title ? /* @__PURE__ */ (0,
|
|
3325
|
-
description ? /* @__PURE__ */ (0,
|
|
3768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figure", { className: cx("pire-chart", className), style, children: [
|
|
3769
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figcaption", { className: "pire-chart-head", children: [
|
|
3770
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-title", children: title }) : null,
|
|
3771
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-desc", children: description }) : null
|
|
3326
3772
|
] }) : null,
|
|
3327
|
-
legend && legend.length > 1 ? /* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3773
|
+
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: [
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
3329
3775
|
item.label
|
|
3330
3776
|
] }, item.key)) }) : null,
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
series.map((one) => /* @__PURE__ */ (0,
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("table", { children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("caption", { children: label }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
3782
|
+
series.map((one) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: one.label }, one.id))
|
|
3337
3783
|
] }) }),
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tbody", { children: categories.map((category, categoryIndex) => (
|
|
3339
3785
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3340
|
-
/* @__PURE__ */ (0,
|
|
3341
|
-
/* @__PURE__ */ (0,
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "row", children: category }),
|
|
3342
3788
|
series.map((one) => {
|
|
3343
3789
|
const value = one.values[categoryIndex];
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
3345
3791
|
})
|
|
3346
3792
|
] }, categoryIndex)
|
|
3347
3793
|
)) })
|
|
@@ -3350,7 +3796,7 @@ function ChartFrame({
|
|
|
3350
3796
|
}
|
|
3351
3797
|
|
|
3352
3798
|
// src/components/data/BarChart.tsx
|
|
3353
|
-
var
|
|
3799
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3354
3800
|
function BarChart({
|
|
3355
3801
|
categories,
|
|
3356
3802
|
series: rawSeries,
|
|
@@ -3382,7 +3828,7 @@ function BarChart({
|
|
|
3382
3828
|
const value = series[0].values[categoryIndex];
|
|
3383
3829
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
3384
3830
|
};
|
|
3385
|
-
return /* @__PURE__ */ (0,
|
|
3831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3386
3832
|
ChartFrame,
|
|
3387
3833
|
{
|
|
3388
3834
|
label,
|
|
@@ -3395,7 +3841,7 @@ function BarChart({
|
|
|
3395
3841
|
showDataTable,
|
|
3396
3842
|
className,
|
|
3397
3843
|
style,
|
|
3398
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3844
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3399
3845
|
"div",
|
|
3400
3846
|
{
|
|
3401
3847
|
className: "pire-chart-bars",
|
|
@@ -3404,12 +3850,12 @@ function BarChart({
|
|
|
3404
3850
|
style: { "--pire-chart-height": `${height}px` },
|
|
3405
3851
|
children: categories.map((category, categoryIndex) => (
|
|
3406
3852
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3407
|
-
/* @__PURE__ */ (0,
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3853
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "pire-chart-group", children: [
|
|
3854
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-cat", children: category }),
|
|
3855
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
3410
3856
|
const value = one.values[categoryIndex];
|
|
3411
3857
|
if (value == null) return null;
|
|
3412
|
-
return /* @__PURE__ */ (0,
|
|
3858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3413
3859
|
"div",
|
|
3414
3860
|
{
|
|
3415
3861
|
className: "pire-chart-bar",
|
|
@@ -3418,8 +3864,8 @@ function BarChart({
|
|
|
3418
3864
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
3419
3865
|
},
|
|
3420
3866
|
children: [
|
|
3421
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3867
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
3868
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3423
3869
|
series.length > 1 ? `${one.label}: ` : "",
|
|
3424
3870
|
formatValue(value)
|
|
3425
3871
|
] })
|
|
@@ -3428,7 +3874,7 @@ function BarChart({
|
|
|
3428
3874
|
one.id
|
|
3429
3875
|
);
|
|
3430
3876
|
}) }),
|
|
3431
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0,
|
|
3877
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
3432
3878
|
] }, categoryIndex)
|
|
3433
3879
|
))
|
|
3434
3880
|
}
|
|
@@ -3438,14 +3884,14 @@ function BarChart({
|
|
|
3438
3884
|
}
|
|
3439
3885
|
|
|
3440
3886
|
// src/components/data/LineChart.tsx
|
|
3441
|
-
var
|
|
3442
|
-
var
|
|
3887
|
+
var React26 = __toESM(require("react"), 1);
|
|
3888
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3443
3889
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
3444
3890
|
var MARKER_LIMIT = 20;
|
|
3445
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
3891
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React26.useEffect : React26.useLayoutEffect;
|
|
3446
3892
|
function useMeasuredWidth() {
|
|
3447
|
-
const ref =
|
|
3448
|
-
const [width, setWidth] =
|
|
3893
|
+
const ref = React26.useRef(null);
|
|
3894
|
+
const [width, setWidth] = React26.useState(0);
|
|
3449
3895
|
useIsomorphicLayoutEffect2(() => {
|
|
3450
3896
|
const element = ref.current;
|
|
3451
3897
|
if (!element) return;
|
|
@@ -3506,7 +3952,7 @@ function LineChart({
|
|
|
3506
3952
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
3507
3953
|
};
|
|
3508
3954
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
3509
|
-
return /* @__PURE__ */ (0,
|
|
3955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3510
3956
|
ChartFrame,
|
|
3511
3957
|
{
|
|
3512
3958
|
label,
|
|
@@ -3519,8 +3965,8 @@ function LineChart({
|
|
|
3519
3965
|
showDataTable,
|
|
3520
3966
|
className,
|
|
3521
3967
|
style,
|
|
3522
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3523
|
-
width > 0 ? /* @__PURE__ */ (0,
|
|
3968
|
+
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: [
|
|
3969
|
+
width > 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3524
3970
|
"svg",
|
|
3525
3971
|
{
|
|
3526
3972
|
width,
|
|
@@ -3529,7 +3975,7 @@ function LineChart({
|
|
|
3529
3975
|
"aria-hidden": "true",
|
|
3530
3976
|
focusable: "false",
|
|
3531
3977
|
children: [
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3533
3979
|
"line",
|
|
3534
3980
|
{
|
|
3535
3981
|
x1: PLOT_INSET.left,
|
|
@@ -3539,8 +3985,8 @@ function LineChart({
|
|
|
3539
3985
|
},
|
|
3540
3986
|
tick
|
|
3541
3987
|
)) }),
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3543
|
-
scale.ticks.map((tick) => /* @__PURE__ */ (0,
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("g", { className: "pire-chart-tick", children: [
|
|
3989
|
+
scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3544
3990
|
"text",
|
|
3545
3991
|
{
|
|
3546
3992
|
x: PLOT_INSET.left - 8,
|
|
@@ -3553,10 +3999,10 @@ function LineChart({
|
|
|
3553
3999
|
)),
|
|
3554
4000
|
categories.map((category, index) => index % labelEvery === 0 ? (
|
|
3555
4001
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3556
|
-
/* @__PURE__ */ (0,
|
|
4002
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
3557
4003
|
) : null)
|
|
3558
4004
|
] }),
|
|
3559
|
-
showArea && series[0] ? /* @__PURE__ */ (0,
|
|
4005
|
+
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3560
4006
|
"path",
|
|
3561
4007
|
{
|
|
3562
4008
|
d: areaFor(series[0].values),
|
|
@@ -3564,10 +4010,10 @@ function LineChart({
|
|
|
3564
4010
|
style: { fill: seriesColor(series[0], 0) }
|
|
3565
4011
|
}
|
|
3566
4012
|
) : null,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
withMarkers ? /* @__PURE__ */ (0,
|
|
4013
|
+
/* @__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)) }),
|
|
4014
|
+
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 : (
|
|
3569
4015
|
// biome-ignore lint/suspicious/noArrayIndexKey: a series is positional — the index is the point's identity, and category labels repeat.
|
|
3570
|
-
/* @__PURE__ */ (0,
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3571
4017
|
"circle",
|
|
3572
4018
|
{
|
|
3573
4019
|
cx: xAt(index),
|
|
@@ -3581,18 +4027,18 @@ function LineChart({
|
|
|
3581
4027
|
]
|
|
3582
4028
|
}
|
|
3583
4029
|
) : null,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3585
4031
|
"div",
|
|
3586
4032
|
{
|
|
3587
4033
|
className: "pire-chart-hover",
|
|
3588
4034
|
style: { inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px` },
|
|
3589
4035
|
children: categories.map((category, categoryIndex) => (
|
|
3590
4036
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
4037
|
+
/* @__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: [
|
|
4038
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: category }),
|
|
3593
4039
|
series.map((one) => {
|
|
3594
4040
|
const value = one.values[categoryIndex];
|
|
3595
|
-
return /* @__PURE__ */ (0,
|
|
4041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip-row", children: [
|
|
3596
4042
|
one.label,
|
|
3597
4043
|
": ",
|
|
3598
4044
|
value == null ? "No data" : formatValue(value)
|
|
@@ -3608,8 +4054,8 @@ function LineChart({
|
|
|
3608
4054
|
}
|
|
3609
4055
|
|
|
3610
4056
|
// src/components/data/DonutChart.tsx
|
|
3611
|
-
var
|
|
3612
|
-
var
|
|
4057
|
+
var React27 = __toESM(require("react"), 1);
|
|
4058
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3613
4059
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
3614
4060
|
function DonutChart({
|
|
3615
4061
|
categories,
|
|
@@ -3629,7 +4075,7 @@ function DonutChart({
|
|
|
3629
4075
|
}) {
|
|
3630
4076
|
const label = rest["aria-label"];
|
|
3631
4077
|
const msg = usePireMessages();
|
|
3632
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4078
|
+
const [hoveredIndex, setHoveredIndex] = React27.useState(null);
|
|
3633
4079
|
warnOnDonutShape(series, categories.length, label);
|
|
3634
4080
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
3635
4081
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -3646,7 +4092,7 @@ function DonutChart({
|
|
|
3646
4092
|
}));
|
|
3647
4093
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
3648
4094
|
let arcStart = 0;
|
|
3649
|
-
return /* @__PURE__ */ (0,
|
|
4095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3650
4096
|
ChartFrame,
|
|
3651
4097
|
{
|
|
3652
4098
|
label,
|
|
@@ -3659,8 +4105,8 @@ function DonutChart({
|
|
|
3659
4105
|
showDataTable,
|
|
3660
4106
|
className,
|
|
3661
4107
|
style,
|
|
3662
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
4108
|
+
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: [
|
|
4109
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3664
4110
|
"svg",
|
|
3665
4111
|
{
|
|
3666
4112
|
width: size,
|
|
@@ -3668,13 +4114,13 @@ function DonutChart({
|
|
|
3668
4114
|
"aria-hidden": "true",
|
|
3669
4115
|
focusable: "false",
|
|
3670
4116
|
onMouseLeave: () => setHoveredIndex(null),
|
|
3671
|
-
children: /* @__PURE__ */ (0,
|
|
4117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
3672
4118
|
const arcLength = segment.value / total * circumference;
|
|
3673
4119
|
const offset = arcStart;
|
|
3674
4120
|
arcStart += arcLength;
|
|
3675
4121
|
return (
|
|
3676
4122
|
// 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.
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
4123
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3678
4124
|
"circle",
|
|
3679
4125
|
{
|
|
3680
4126
|
className: "pire-chart-arc",
|
|
@@ -3694,9 +4140,9 @@ function DonutChart({
|
|
|
3694
4140
|
}) })
|
|
3695
4141
|
}
|
|
3696
4142
|
),
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3698
|
-
/* @__PURE__ */ (0,
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4144
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
3700
4146
|
] })
|
|
3701
4147
|
] })
|
|
3702
4148
|
}
|
|
@@ -3707,15 +4153,15 @@ function colorForSegment(index) {
|
|
|
3707
4153
|
}
|
|
3708
4154
|
|
|
3709
4155
|
// src/components/data/LinkList.tsx
|
|
3710
|
-
var
|
|
3711
|
-
var
|
|
4156
|
+
var import_react_aria_components33 = require("react-aria-components");
|
|
4157
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3712
4158
|
function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
3713
|
-
return /* @__PURE__ */ (0,
|
|
3714
|
-
const keySlot = item.key ? /* @__PURE__ */ (0,
|
|
3715
|
-
const textSlot = item.text ? /* @__PURE__ */ (0,
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4160
|
+
const keySlot = item.key ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4161
|
+
const textSlot = item.text ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
3716
4162
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
3717
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4163
|
+
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: [
|
|
4164
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
3719
4165
|
first,
|
|
3720
4166
|
second,
|
|
3721
4167
|
item.trailing
|
|
@@ -3723,8 +4169,73 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
3723
4169
|
}) });
|
|
3724
4170
|
}
|
|
3725
4171
|
|
|
4172
|
+
// src/components/data/RecordCard.tsx
|
|
4173
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4174
|
+
function RecordCard({ title, subtitle, icon, action, isDisabled, className, ...rest }) {
|
|
4175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cx("pire-recordcard", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
4176
|
+
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,
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pire-recordcard-body", children: [
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-title", children: title }),
|
|
4179
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4180
|
+
] }),
|
|
4181
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4182
|
+
] });
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
// src/components/data/ViewSwitcher.tsx
|
|
4186
|
+
var import_react_aria_components34 = require("react-aria-components");
|
|
4187
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4188
|
+
function ViewSwitcher({
|
|
4189
|
+
name,
|
|
4190
|
+
isDirty,
|
|
4191
|
+
icon = "star",
|
|
4192
|
+
onPress,
|
|
4193
|
+
isDisabled,
|
|
4194
|
+
"aria-label": ariaLabel,
|
|
4195
|
+
className,
|
|
4196
|
+
style
|
|
4197
|
+
}) {
|
|
4198
|
+
const msg = usePireMessages();
|
|
4199
|
+
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4201
|
+
import_react_aria_components34.Button,
|
|
4202
|
+
{
|
|
4203
|
+
className: cx("pire-viewswitcher", className),
|
|
4204
|
+
style,
|
|
4205
|
+
"aria-label": label,
|
|
4206
|
+
isDisabled,
|
|
4207
|
+
onPress,
|
|
4208
|
+
children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: icon, size: 16 }),
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4211
|
+
isDirty ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
4213
|
+
]
|
|
4214
|
+
}
|
|
4215
|
+
);
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
// src/components/data/BarList.tsx
|
|
4219
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4220
|
+
function BarList({ items, max, className, ...rest }) {
|
|
4221
|
+
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4223
|
+
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-main", children: [
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-label", children: item.label }),
|
|
4227
|
+
/* @__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}%` } }) })
|
|
4228
|
+
] }),
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-figure", children: [
|
|
4230
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4231
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4232
|
+
] })
|
|
4233
|
+
] }, item.id);
|
|
4234
|
+
}) });
|
|
4235
|
+
}
|
|
4236
|
+
|
|
3726
4237
|
// src/components/layout/PageBand.tsx
|
|
3727
|
-
var
|
|
4238
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3728
4239
|
function PageBand({
|
|
3729
4240
|
surface = "card",
|
|
3730
4241
|
hasBorder = true,
|
|
@@ -3732,7 +4243,7 @@ function PageBand({
|
|
|
3732
4243
|
className,
|
|
3733
4244
|
...rest
|
|
3734
4245
|
}) {
|
|
3735
|
-
return /* @__PURE__ */ (0,
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3736
4247
|
"div",
|
|
3737
4248
|
{
|
|
3738
4249
|
className: cx("pire-pageband", className),
|
|
@@ -3745,56 +4256,56 @@ function PageBand({
|
|
|
3745
4256
|
}
|
|
3746
4257
|
|
|
3747
4258
|
// src/components/layout/PageHeader.tsx
|
|
3748
|
-
var
|
|
4259
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3749
4260
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
3750
|
-
return /* @__PURE__ */ (0,
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3752
|
-
/* @__PURE__ */ (0,
|
|
3753
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
4262
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h1", { className: "pire-pageheader-title", children: title }),
|
|
4264
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
3754
4265
|
] }),
|
|
3755
|
-
actions ? /* @__PURE__ */ (0,
|
|
4266
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
3756
4267
|
] });
|
|
3757
4268
|
}
|
|
3758
4269
|
|
|
3759
4270
|
// src/components/layout/SectionHeader.tsx
|
|
3760
|
-
var
|
|
4271
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3761
4272
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
3762
|
-
return /* @__PURE__ */ (0,
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
-
meta ? /* @__PURE__ */ (0,
|
|
3765
|
-
actions ? /* @__PURE__ */ (0,
|
|
4273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
4274
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "pire-eyebrow", children: title }),
|
|
4275
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
4276
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
3766
4277
|
] });
|
|
3767
4278
|
}
|
|
3768
4279
|
|
|
3769
4280
|
// src/components/layout/SelectionBar.tsx
|
|
3770
|
-
var
|
|
4281
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3771
4282
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
3772
4283
|
if (!count) return null;
|
|
3773
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
4284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4285
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
3775
4286
|
count.toLocaleString(),
|
|
3776
4287
|
" ",
|
|
3777
4288
|
noun,
|
|
3778
4289
|
count === 1 ? "" : "s",
|
|
3779
4290
|
" selected"
|
|
3780
4291
|
] }),
|
|
3781
|
-
children ? /* @__PURE__ */ (0,
|
|
3782
|
-
actions ? /* @__PURE__ */ (0,
|
|
4292
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
4293
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
3783
4294
|
] });
|
|
3784
4295
|
}
|
|
3785
4296
|
|
|
3786
4297
|
// src/components/layout/FooterBar.tsx
|
|
3787
|
-
var
|
|
4298
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3788
4299
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
3789
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
-
note ? /* @__PURE__ */ (0,
|
|
4300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
4301
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
3791
4302
|
children,
|
|
3792
|
-
actions ? /* @__PURE__ */ (0,
|
|
4303
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
3793
4304
|
] });
|
|
3794
4305
|
}
|
|
3795
4306
|
|
|
3796
4307
|
// src/components/layout/SplitPane.tsx
|
|
3797
|
-
var
|
|
4308
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3798
4309
|
function SplitPane({
|
|
3799
4310
|
list,
|
|
3800
4311
|
detail,
|
|
@@ -3810,7 +4321,7 @@ function SplitPane({
|
|
|
3810
4321
|
}) {
|
|
3811
4322
|
const msg = usePireMessages();
|
|
3812
4323
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
3813
|
-
return /* @__PURE__ */ (0,
|
|
4324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3814
4325
|
"div",
|
|
3815
4326
|
{
|
|
3816
4327
|
className: cx("pire-split", className),
|
|
@@ -3818,10 +4329,10 @@ function SplitPane({
|
|
|
3818
4329
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
3819
4330
|
...rest,
|
|
3820
4331
|
children: [
|
|
3821
|
-
/* @__PURE__ */ (0,
|
|
3822
|
-
/* @__PURE__ */ (0,
|
|
3823
|
-
onBack ? /* @__PURE__ */ (0,
|
|
3824
|
-
detail ?? /* @__PURE__ */ (0,
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
4334
|
+
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,
|
|
4335
|
+
detail ?? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pire-split-empty", children: emptyDetail })
|
|
3825
4336
|
] })
|
|
3826
4337
|
]
|
|
3827
4338
|
}
|
|
@@ -3829,11 +4340,12 @@ function SplitPane({
|
|
|
3829
4340
|
}
|
|
3830
4341
|
|
|
3831
4342
|
// src/components/patterns/ConfirmDialog.tsx
|
|
3832
|
-
var
|
|
4343
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3833
4344
|
function ConfirmDialog({
|
|
3834
4345
|
isOpen,
|
|
3835
4346
|
title,
|
|
3836
4347
|
subtitle,
|
|
4348
|
+
facts,
|
|
3837
4349
|
consequence,
|
|
3838
4350
|
children,
|
|
3839
4351
|
confirmLabel = "Confirm",
|
|
@@ -3843,7 +4355,8 @@ function ConfirmDialog({
|
|
|
3843
4355
|
onConfirm,
|
|
3844
4356
|
onCancel
|
|
3845
4357
|
}) {
|
|
3846
|
-
|
|
4358
|
+
const msg = usePireMessages();
|
|
4359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3847
4360
|
Dialog,
|
|
3848
4361
|
{
|
|
3849
4362
|
isOpen,
|
|
@@ -3853,12 +4366,19 @@ function ConfirmDialog({
|
|
|
3853
4366
|
onClose: onCancel,
|
|
3854
4367
|
isDismissable: !isBusy,
|
|
3855
4368
|
showClose: false,
|
|
3856
|
-
footer: /* @__PURE__ */ (0,
|
|
3857
|
-
/* @__PURE__ */ (0,
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
4369
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4370
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
3859
4372
|
] }),
|
|
3860
4373
|
children: [
|
|
3861
|
-
|
|
4374
|
+
facts?.length ? (
|
|
4375
|
+
// The role is what makes the name stick. A bare <div> resolves to `generic`, which
|
|
4376
|
+
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4377
|
+
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4378
|
+
// pairs with an explicit role for the same reason.
|
|
4379
|
+
/* @__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 }) })
|
|
4380
|
+
) : null,
|
|
4381
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
3862
4382
|
children
|
|
3863
4383
|
]
|
|
3864
4384
|
}
|
|
@@ -3866,9 +4386,9 @@ function ConfirmDialog({
|
|
|
3866
4386
|
}
|
|
3867
4387
|
|
|
3868
4388
|
// src/components/patterns/CommandPalette.tsx
|
|
3869
|
-
var
|
|
3870
|
-
var
|
|
3871
|
-
var
|
|
4389
|
+
var React28 = __toESM(require("react"), 1);
|
|
4390
|
+
var import_react_aria_components35 = require("react-aria-components");
|
|
4391
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3872
4392
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
3873
4393
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
3874
4394
|
function CommandPalette({
|
|
@@ -3889,17 +4409,17 @@ function CommandPalette({
|
|
|
3889
4409
|
style
|
|
3890
4410
|
}) {
|
|
3891
4411
|
const msg = usePireMessages();
|
|
3892
|
-
const [query, setQuery] =
|
|
3893
|
-
const { contains } = (0,
|
|
3894
|
-
|
|
4412
|
+
const [query, setQuery] = React28.useState("");
|
|
4413
|
+
const { contains } = (0, import_react_aria_components35.useFilter)({ sensitivity: "base" });
|
|
4414
|
+
React28.useEffect(() => {
|
|
3895
4415
|
if (isOpen) setQuery("");
|
|
3896
4416
|
}, [isOpen]);
|
|
3897
|
-
const searchableById =
|
|
4417
|
+
const searchableById = React28.useMemo(() => {
|
|
3898
4418
|
const byId = /* @__PURE__ */ new Map();
|
|
3899
4419
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
3900
4420
|
return byId;
|
|
3901
4421
|
}, [groups]);
|
|
3902
|
-
const filter =
|
|
4422
|
+
const filter = React28.useCallback((textValue, inputValue, node) => {
|
|
3903
4423
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
3904
4424
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
3905
4425
|
}, [contains, searchableById]);
|
|
@@ -3909,8 +4429,8 @@ function CommandPalette({
|
|
|
3909
4429
|
};
|
|
3910
4430
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
3911
4431
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3913
|
-
|
|
4432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4433
|
+
import_react_aria_components35.ModalOverlay,
|
|
3914
4434
|
{
|
|
3915
4435
|
className: "pire-cp-overlay",
|
|
3916
4436
|
isOpen,
|
|
@@ -3918,12 +4438,12 @@ function CommandPalette({
|
|
|
3918
4438
|
onOpenChange: (open) => {
|
|
3919
4439
|
if (!open) onOpenChange?.(false);
|
|
3920
4440
|
},
|
|
3921
|
-
children: /* @__PURE__ */ (0,
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3923
|
-
/* @__PURE__ */ (0,
|
|
3924
|
-
/* @__PURE__ */ (0,
|
|
3925
|
-
/* @__PURE__ */ (0,
|
|
3926
|
-
|
|
4441
|
+
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: [
|
|
4442
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4446
|
+
import_react_aria_components35.Input,
|
|
3927
4447
|
{
|
|
3928
4448
|
className: "pire-cp-input",
|
|
3929
4449
|
autoFocus: true,
|
|
@@ -3931,16 +4451,16 @@ function CommandPalette({
|
|
|
3931
4451
|
}
|
|
3932
4452
|
)
|
|
3933
4453
|
] }),
|
|
3934
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
3936
|
-
|
|
4454
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
4455
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4456
|
+
import_react_aria_components35.Menu,
|
|
3937
4457
|
{
|
|
3938
4458
|
className: "pire-cp-list",
|
|
3939
4459
|
onAction: (key) => onAction?.(String(key)),
|
|
3940
|
-
renderEmptyState: () => /* @__PURE__ */ (0,
|
|
3941
|
-
children: sections.map((section) => /* @__PURE__ */ (0,
|
|
3942
|
-
section.label ? /* @__PURE__ */ (0,
|
|
3943
|
-
section.items.map((item) => /* @__PURE__ */ (0,
|
|
4460
|
+
renderEmptyState: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-status", children: status }),
|
|
4461
|
+
children: sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.MenuSection, { id: section.id, className: "pire-cp-section", children: [
|
|
4462
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_aria_components35.Header, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
4463
|
+
section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3944
4464
|
MenuItem,
|
|
3945
4465
|
{
|
|
3946
4466
|
id: item.id,
|
|
@@ -3961,18 +4481,18 @@ function CommandPalette({
|
|
|
3961
4481
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
3962
4482
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
3963
4483
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3966
|
-
/* @__PURE__ */ (0,
|
|
3967
|
-
/* @__PURE__ */ (0,
|
|
4484
|
+
/* @__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: [
|
|
4485
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4486
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2191" }),
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2193" }),
|
|
3968
4488
|
msg.commandPaletteHintNavigate
|
|
3969
4489
|
] }),
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u21B5" }),
|
|
3972
4492
|
msg.commandPaletteHintSelect
|
|
3973
4493
|
] }),
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4494
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4495
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "esc" }),
|
|
3976
4496
|
msg.commandPaletteHintClose
|
|
3977
4497
|
] })
|
|
3978
4498
|
] }) })
|
|
@@ -3982,9 +4502,9 @@ function CommandPalette({
|
|
|
3982
4502
|
);
|
|
3983
4503
|
}
|
|
3984
4504
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
3985
|
-
const handler =
|
|
4505
|
+
const handler = React28.useRef(onTrigger);
|
|
3986
4506
|
handler.current = onTrigger;
|
|
3987
|
-
|
|
4507
|
+
React28.useEffect(() => {
|
|
3988
4508
|
if (isDisabled) return;
|
|
3989
4509
|
const onKeyDown = (event) => {
|
|
3990
4510
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -3998,9 +4518,9 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
3998
4518
|
}
|
|
3999
4519
|
|
|
4000
4520
|
// src/components/patterns/AppLauncher.tsx
|
|
4001
|
-
var
|
|
4002
|
-
var
|
|
4003
|
-
var
|
|
4521
|
+
var React29 = __toESM(require("react"), 1);
|
|
4522
|
+
var import_react_aria_components36 = require("react-aria-components");
|
|
4523
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4004
4524
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4005
4525
|
function AppLauncher({
|
|
4006
4526
|
sections,
|
|
@@ -4019,13 +4539,13 @@ function AppLauncher({
|
|
|
4019
4539
|
className
|
|
4020
4540
|
}) {
|
|
4021
4541
|
const msg = usePireMessages();
|
|
4022
|
-
const [query, setQuery] =
|
|
4023
|
-
const { contains } = (0,
|
|
4542
|
+
const [query, setQuery] = React29.useState("");
|
|
4543
|
+
const { contains } = (0, import_react_aria_components36.useFilter)({ sensitivity: "base" });
|
|
4024
4544
|
const handleSearch = (next) => {
|
|
4025
4545
|
setQuery(next);
|
|
4026
4546
|
onSearchChange?.(next);
|
|
4027
4547
|
};
|
|
4028
|
-
const visible =
|
|
4548
|
+
const visible = React29.useMemo(() => {
|
|
4029
4549
|
if (isFilteredExternally) return sections;
|
|
4030
4550
|
const q = query.trim();
|
|
4031
4551
|
if (!q) return sections;
|
|
@@ -4033,25 +4553,25 @@ function AppLauncher({
|
|
|
4033
4553
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4034
4554
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4035
4555
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4036
|
-
return /* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4039
|
-
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_aria_components36.DialogTrigger, { children: [
|
|
4557
|
+
/* @__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 }) }),
|
|
4558
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4559
|
+
import_react_aria_components36.Popover,
|
|
4040
4560
|
{
|
|
4041
4561
|
className: cx("pire-launcher-popover", className),
|
|
4042
4562
|
placement: "bottom start",
|
|
4043
4563
|
offset: 0,
|
|
4044
4564
|
crossOffset: 0,
|
|
4045
4565
|
containerPadding: 0,
|
|
4046
|
-
children: /* @__PURE__ */ (0,
|
|
4047
|
-
/* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
meta ? /* @__PURE__ */ (0,
|
|
4566
|
+
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: [
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-head", children: [
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
4569
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
4050
4570
|
] }),
|
|
4051
4571
|
isSearchable ? (
|
|
4052
4572
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
4053
4573
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
4054
|
-
/* @__PURE__ */ (0,
|
|
4574
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4055
4575
|
Input,
|
|
4056
4576
|
{
|
|
4057
4577
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -4065,18 +4585,18 @@ function AppLauncher({
|
|
|
4065
4585
|
}
|
|
4066
4586
|
)
|
|
4067
4587
|
) : null,
|
|
4068
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
4069
|
-
isEmpty ? /* @__PURE__ */ (0,
|
|
4588
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
4589
|
+
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
4070
4590
|
visible.map((section, si) => (
|
|
4071
4591
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
4072
4592
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4074
|
-
section.label ? /* @__PURE__ */ (0,
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4593
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-section", children: [
|
|
4594
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
4595
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
4076
4596
|
const isCurrent = item.id === value;
|
|
4077
4597
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
4078
|
-
return /* @__PURE__ */ (0,
|
|
4079
|
-
|
|
4598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
4599
|
+
import_react_aria_components36.Button,
|
|
4080
4600
|
{
|
|
4081
4601
|
className: "pire-launcher-item",
|
|
4082
4602
|
"data-selected": isCurrent ? "true" : void 0,
|
|
@@ -4086,10 +4606,10 @@ function AppLauncher({
|
|
|
4086
4606
|
onAction?.(item.id);
|
|
4087
4607
|
},
|
|
4088
4608
|
children: [
|
|
4089
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
showsDescription ? /* @__PURE__ */ (0,
|
|
4609
|
+
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,
|
|
4610
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "pire-launcher-item-text", children: [
|
|
4611
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4612
|
+
showsDescription ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
4093
4613
|
] })
|
|
4094
4614
|
]
|
|
4095
4615
|
},
|
|
@@ -4105,12 +4625,12 @@ function AppLauncher({
|
|
|
4105
4625
|
}
|
|
4106
4626
|
|
|
4107
4627
|
// src/components/patterns/SidePanel.tsx
|
|
4108
|
-
var
|
|
4109
|
-
var
|
|
4628
|
+
var import_react_aria_components37 = require("react-aria-components");
|
|
4629
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4110
4630
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
4111
4631
|
const msg = usePireMessages();
|
|
4112
|
-
return /* @__PURE__ */ (0,
|
|
4113
|
-
|
|
4632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4633
|
+
import_react_aria_components37.ModalOverlay,
|
|
4114
4634
|
{
|
|
4115
4635
|
className: "pire-sidepanel-overlay",
|
|
4116
4636
|
isOpen,
|
|
@@ -4118,35 +4638,35 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4118
4638
|
onOpenChange: (o) => {
|
|
4119
4639
|
if (!o) onClose?.();
|
|
4120
4640
|
},
|
|
4121
|
-
children: /* @__PURE__ */ (0,
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4125
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4641
|
+
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: [
|
|
4642
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
4643
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4644
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components37.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
4645
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
4126
4646
|
] }),
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
4128
4648
|
] }),
|
|
4129
|
-
/* @__PURE__ */ (0,
|
|
4130
|
-
footer ? /* @__PURE__ */ (0,
|
|
4649
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
4650
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
4131
4651
|
] }) })
|
|
4132
4652
|
}
|
|
4133
4653
|
);
|
|
4134
4654
|
}
|
|
4135
4655
|
|
|
4136
4656
|
// src/components/patterns/EmptyState.tsx
|
|
4137
|
-
var
|
|
4657
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4138
4658
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
4139
|
-
return /* @__PURE__ */ (0,
|
|
4140
|
-
/* @__PURE__ */ (0,
|
|
4141
|
-
title ? /* @__PURE__ */ (0,
|
|
4142
|
-
children ? /* @__PURE__ */ (0,
|
|
4659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4660
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4661
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
4662
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
4143
4663
|
action
|
|
4144
4664
|
] });
|
|
4145
4665
|
}
|
|
4146
4666
|
|
|
4147
4667
|
// src/components/patterns/NumPad.tsx
|
|
4148
|
-
var
|
|
4149
|
-
var
|
|
4668
|
+
var React30 = __toESM(require("react"), 1);
|
|
4669
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4150
4670
|
var BASE_KEYS = [
|
|
4151
4671
|
{ value: "7" },
|
|
4152
4672
|
{ value: "8" },
|
|
@@ -4163,9 +4683,9 @@ var BASE_KEYS = [
|
|
|
4163
4683
|
];
|
|
4164
4684
|
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
4165
4685
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
4166
|
-
const handler =
|
|
4686
|
+
const handler = React30.useRef(onKey);
|
|
4167
4687
|
handler.current = onKey;
|
|
4168
|
-
|
|
4688
|
+
React30.useEffect(() => {
|
|
4169
4689
|
if (isDisabled) return;
|
|
4170
4690
|
const isEditingElsewhere = () => {
|
|
4171
4691
|
const el = document.activeElement;
|
|
@@ -4207,8 +4727,8 @@ function NumPad({
|
|
|
4207
4727
|
style
|
|
4208
4728
|
}) {
|
|
4209
4729
|
const msg = usePireMessages();
|
|
4210
|
-
const containerRef =
|
|
4211
|
-
const applyKey =
|
|
4730
|
+
const containerRef = React30.useRef(null);
|
|
4731
|
+
const applyKey = React30.useCallback((key) => {
|
|
4212
4732
|
if (isDisabled) return;
|
|
4213
4733
|
if (key.value === "backspace") {
|
|
4214
4734
|
onChange(value.slice(0, -1));
|
|
@@ -4226,7 +4746,7 @@ function NumPad({
|
|
|
4226
4746
|
}, [isDisabled, value, onChange, onAction]);
|
|
4227
4747
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4228
4748
|
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4229
|
-
return /* @__PURE__ */ (0,
|
|
4749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4230
4750
|
"div",
|
|
4231
4751
|
{
|
|
4232
4752
|
ref: containerRef,
|
|
@@ -4235,10 +4755,10 @@ function NumPad({
|
|
|
4235
4755
|
"data-size": size,
|
|
4236
4756
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
4237
4757
|
children: [
|
|
4238
|
-
target !== void 0 ? /* @__PURE__ */ (0,
|
|
4239
|
-
/* @__PURE__ */ (0,
|
|
4758
|
+
target !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
4759
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
4240
4760
|
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
4241
|
-
return /* @__PURE__ */ (0,
|
|
4761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4242
4762
|
Button,
|
|
4243
4763
|
{
|
|
4244
4764
|
variant: "secondary",
|
|
@@ -4260,9 +4780,9 @@ function NumPad({
|
|
|
4260
4780
|
}
|
|
4261
4781
|
|
|
4262
4782
|
// src/components/patterns/FileDropZone.tsx
|
|
4263
|
-
var
|
|
4264
|
-
var
|
|
4265
|
-
var
|
|
4783
|
+
var React31 = __toESM(require("react"), 1);
|
|
4784
|
+
var import_react_aria_components38 = require("react-aria-components");
|
|
4785
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4266
4786
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
4267
4787
|
function FileDropZone({
|
|
4268
4788
|
label,
|
|
@@ -4290,10 +4810,10 @@ function FileDropZone({
|
|
|
4290
4810
|
...rest
|
|
4291
4811
|
}) {
|
|
4292
4812
|
const msg = usePireMessages();
|
|
4293
|
-
const [uncontrolled, setUncontrolled] =
|
|
4813
|
+
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4294
4814
|
const files = value ?? uncontrolled;
|
|
4295
|
-
const created =
|
|
4296
|
-
|
|
4815
|
+
const created = React31.useRef([]);
|
|
4816
|
+
React31.useEffect(() => () => {
|
|
4297
4817
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
4298
4818
|
}, []);
|
|
4299
4819
|
const commit = (next) => {
|
|
@@ -4313,13 +4833,13 @@ function FileDropZone({
|
|
|
4313
4833
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
4314
4834
|
};
|
|
4315
4835
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
4316
|
-
return /* @__PURE__ */ (0,
|
|
4317
|
-
label ? /* @__PURE__ */ (0,
|
|
4836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
4837
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: "pire-field-label", children: [
|
|
4318
4838
|
label,
|
|
4319
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
4839
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
4320
4840
|
] }) : null,
|
|
4321
|
-
/* @__PURE__ */ (0,
|
|
4322
|
-
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
4842
|
+
import_react_aria_components38.DropZone,
|
|
4323
4843
|
{
|
|
4324
4844
|
className: "pire-dropzone",
|
|
4325
4845
|
"aria-label": ariaLabel,
|
|
@@ -4327,30 +4847,30 @@ function FileDropZone({
|
|
|
4327
4847
|
isDisabled: isDisabled || isReadOnly,
|
|
4328
4848
|
onDrop: async (e) => {
|
|
4329
4849
|
const dropped = await Promise.all(
|
|
4330
|
-
e.items.filter(
|
|
4850
|
+
e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile())
|
|
4331
4851
|
);
|
|
4332
4852
|
accept(dropped);
|
|
4333
4853
|
},
|
|
4334
4854
|
children: [
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
|
|
4855
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
4856
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
4857
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4858
|
+
import_react_aria_components38.FileTrigger,
|
|
4339
4859
|
{
|
|
4340
4860
|
acceptedFileTypes,
|
|
4341
4861
|
allowsMultiple,
|
|
4342
4862
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
4343
|
-
children: /* @__PURE__ */ (0,
|
|
4863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
4344
4864
|
}
|
|
4345
4865
|
)
|
|
4346
4866
|
]
|
|
4347
4867
|
}
|
|
4348
4868
|
),
|
|
4349
|
-
files.length ? /* @__PURE__ */ (0,
|
|
4350
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
4351
|
-
/* @__PURE__ */ (0,
|
|
4352
|
-
/* @__PURE__ */ (0,
|
|
4353
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
4869
|
+
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: [
|
|
4870
|
+
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" }),
|
|
4871
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
4872
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
4873
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4354
4874
|
IconButton,
|
|
4355
4875
|
{
|
|
4356
4876
|
icon: "x",
|
|
@@ -4360,25 +4880,27 @@ function FileDropZone({
|
|
|
4360
4880
|
}
|
|
4361
4881
|
)
|
|
4362
4882
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
4363
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
4364
|
-
description ? /* @__PURE__ */ (0,
|
|
4365
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
4883
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
4884
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-hint", children: description }) : null,
|
|
4885
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
4366
4886
|
] });
|
|
4367
4887
|
}
|
|
4368
4888
|
|
|
4369
4889
|
// src/index.ts
|
|
4370
|
-
var
|
|
4371
|
-
var
|
|
4890
|
+
var import_react_aria_components39 = require("react-aria-components");
|
|
4891
|
+
var import_react_aria_components40 = require("react-aria-components");
|
|
4372
4892
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4373
4893
|
0 && (module.exports = {
|
|
4374
4894
|
AppLauncher,
|
|
4375
4895
|
Avatar,
|
|
4376
4896
|
Badge,
|
|
4377
4897
|
BarChart,
|
|
4898
|
+
BarList,
|
|
4378
4899
|
Breadcrumb,
|
|
4379
4900
|
Button,
|
|
4380
4901
|
Card,
|
|
4381
4902
|
Checkbox,
|
|
4903
|
+
ChoiceCardGroup,
|
|
4382
4904
|
ComboBox,
|
|
4383
4905
|
CommandPalette,
|
|
4384
4906
|
ConfirmDialog,
|
|
@@ -4427,8 +4949,11 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4427
4949
|
PireIntlProvider,
|
|
4428
4950
|
Popover,
|
|
4429
4951
|
ProgressBar,
|
|
4952
|
+
QuantityStepper,
|
|
4430
4953
|
Radio,
|
|
4431
4954
|
RadioGroup,
|
|
4955
|
+
RecordCard,
|
|
4956
|
+
Ribbon,
|
|
4432
4957
|
RouterProvider,
|
|
4433
4958
|
SectionHeader,
|
|
4434
4959
|
SegmentedControl,
|
|
@@ -4456,6 +4981,7 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4456
4981
|
VIZ_SLOT_COUNT,
|
|
4457
4982
|
ValueHelpDialog,
|
|
4458
4983
|
ValueHelpField,
|
|
4984
|
+
ViewSwitcher,
|
|
4459
4985
|
configureIcons,
|
|
4460
4986
|
enMessages,
|
|
4461
4987
|
esMessages,
|