@orianatech/pire 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/Tag.d.ts.map +1 -1
- package/dist/components/core/icon-data.generated.d.ts.map +1 -1
- package/dist/components/core/icon-map.d.ts.map +1 -1
- package/dist/components/data/BarList.d.cts +30 -0
- package/dist/components/data/BarList.d.ts +31 -0
- package/dist/components/data/BarList.d.ts.map +1 -0
- package/dist/components/data/DataTable.d.cts +45 -3
- package/dist/components/data/DataTable.d.ts +45 -3
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/data/RecordCard.d.cts +28 -0
- package/dist/components/data/RecordCard.d.ts +29 -0
- package/dist/components/data/RecordCard.d.ts.map +1 -0
- package/dist/components/data/ViewSwitcher.d.cts +32 -0
- package/dist/components/data/ViewSwitcher.d.ts +33 -0
- package/dist/components/data/ViewSwitcher.d.ts.map +1 -0
- package/dist/components/feedback/Tooltip.d.cts +18 -0
- package/dist/components/feedback/Tooltip.d.ts +18 -0
- package/dist/components/feedback/Tooltip.d.ts.map +1 -1
- package/dist/components/forms/ChoiceCardGroup.d.cts +50 -0
- package/dist/components/forms/ChoiceCardGroup.d.ts +51 -0
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +1 -0
- package/dist/components/forms/NumberField.d.cts +18 -1
- package/dist/components/forms/NumberField.d.ts +18 -1
- package/dist/components/forms/NumberField.d.ts.map +1 -1
- package/dist/components/forms/QuantityStepper.d.cts +28 -0
- package/dist/components/forms/QuantityStepper.d.ts +29 -0
- package/dist/components/forms/QuantityStepper.d.ts.map +1 -0
- package/dist/components/navigation/Ribbon.d.cts +75 -0
- package/dist/components/navigation/Ribbon.d.ts +76 -0
- package/dist/components/navigation/Ribbon.d.ts.map +1 -0
- package/dist/components/patterns/ConfirmDialog.d.cts +8 -1
- package/dist/components/patterns/ConfirmDialog.d.ts +8 -1
- package/dist/components/patterns/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/patterns/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 +212 -0
- 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 +1330 -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 +1253 -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,195 @@ 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 barBlocks(tabs) {
|
|
3309
|
+
const blocks = [];
|
|
3310
|
+
for (const tab of tabs) {
|
|
3311
|
+
if (tab.isContextual) continue;
|
|
3312
|
+
for (const group of tab.groups) {
|
|
3313
|
+
const commands = group.commands.filter((c) => c.inBar);
|
|
3314
|
+
if (commands.length) blocks.push({ key: `${tab.key}:${group.key}`, commands });
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
return blocks;
|
|
3318
|
+
}
|
|
3319
|
+
function Ribbon({
|
|
3320
|
+
children,
|
|
3321
|
+
value,
|
|
3322
|
+
defaultValue,
|
|
3323
|
+
onChange,
|
|
3324
|
+
isCollapsed,
|
|
3325
|
+
onCollapsedChange,
|
|
3326
|
+
leading,
|
|
3327
|
+
actions,
|
|
3328
|
+
selectionCount,
|
|
3329
|
+
className,
|
|
3330
|
+
style,
|
|
3331
|
+
...rest
|
|
3332
|
+
}) {
|
|
3333
|
+
const msg = usePireMessages();
|
|
3334
|
+
const tabs = readTabs(children);
|
|
3335
|
+
const count = selectionCount ?? 0;
|
|
3336
|
+
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3337
|
+
const fallback = visible[0]?.id;
|
|
3338
|
+
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3339
|
+
const requested = value ?? ownTab;
|
|
3340
|
+
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3341
|
+
const select = React24.useCallback((id) => {
|
|
3342
|
+
setOwnTab(id);
|
|
3343
|
+
onChange?.(id);
|
|
3344
|
+
}, [onChange]);
|
|
3345
|
+
const hadSelection = React24.useRef(false);
|
|
3346
|
+
React24.useEffect(() => {
|
|
3347
|
+
const has = count > 0;
|
|
3348
|
+
if (has === hadSelection.current) return;
|
|
3349
|
+
hadSelection.current = has;
|
|
3350
|
+
const contextual = tabs.find((tab) => tab.isContextual);
|
|
3351
|
+
if (!contextual) return;
|
|
3352
|
+
if (has) select(contextual.id);
|
|
3353
|
+
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3354
|
+
}, [count, tabs, requested, select]);
|
|
3355
|
+
const [ownCollapsed, setOwnCollapsed] = React24.useState(false);
|
|
3356
|
+
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3357
|
+
const toggleRef = React24.useRef(null);
|
|
3358
|
+
const restoreFocus = React24.useRef(false);
|
|
3359
|
+
React24.useLayoutEffect(() => {
|
|
3360
|
+
if (!restoreFocus.current) return;
|
|
3361
|
+
restoreFocus.current = false;
|
|
3362
|
+
toggleRef.current?.focus();
|
|
3363
|
+
});
|
|
3364
|
+
const bandId = React24.useId();
|
|
3365
|
+
const bandDomId = { id: bandId };
|
|
3366
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3367
|
+
import_react_aria_components31.Button,
|
|
3368
|
+
{
|
|
3369
|
+
ref: toggleRef,
|
|
3370
|
+
className: "pire-ribbon-toggle",
|
|
3371
|
+
"aria-expanded": !collapsed,
|
|
3372
|
+
"aria-controls": bandId,
|
|
3373
|
+
"aria-label": collapsed ? msg.ribbonExpand : msg.ribbonCollapse,
|
|
3374
|
+
onPress: () => {
|
|
3375
|
+
restoreFocus.current = document.activeElement === toggleRef.current;
|
|
3376
|
+
setOwnCollapsed(!collapsed);
|
|
3377
|
+
onCollapsedChange?.(!collapsed);
|
|
3378
|
+
},
|
|
3379
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3380
|
+
}
|
|
3381
|
+
);
|
|
3382
|
+
if (collapsed) {
|
|
3383
|
+
const blocks = barBlocks(tabs);
|
|
3384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { className: "pire-ribbon-bar", "aria-label": rest["aria-label"], children: [
|
|
3385
|
+
leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
3386
|
+
blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(React24.Fragment, { children: [
|
|
3387
|
+
i > 0 || leading ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
3388
|
+
block.commands.map((c) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3389
|
+
] }, block.key)),
|
|
3390
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3391
|
+
actions,
|
|
3392
|
+
toggle
|
|
3393
|
+
] }) });
|
|
3394
|
+
}
|
|
3395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Tabs, { selectedKey: selected, onSelectionChange: (k) => select(String(k)), children: [
|
|
3396
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_aria_components31.TabList, { className: "pire-ribbon-tablist", "aria-label": rest["aria-label"], children: visible.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3397
|
+
import_react_aria_components31.Tab,
|
|
3398
|
+
{
|
|
3399
|
+
id: tab.id,
|
|
3400
|
+
className: "pire-ribbon-tab",
|
|
3401
|
+
"data-contextual": tab.isContextual ? "true" : void 0,
|
|
3402
|
+
children: tab.label
|
|
3403
|
+
},
|
|
3404
|
+
tab.key
|
|
3405
|
+
)) }),
|
|
3406
|
+
visible.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_aria_components31.TabPanel, { id: tab.id, className: "pire-ribbon-panel", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { ...bandDomId, className: "pire-ribbon-band", "aria-label": msg.ribbonLabel, children: [
|
|
3407
|
+
tab.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Group8, { group, selectionCount: count }, group.key)),
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3409
|
+
actions,
|
|
3410
|
+
toggle
|
|
3411
|
+
] }) }, tab.key))
|
|
3412
|
+
] }) });
|
|
3413
|
+
}
|
|
3414
|
+
Ribbon.Tab = RibbonTab;
|
|
3415
|
+
Ribbon.Group = RibbonGroup;
|
|
3416
|
+
Ribbon.Command = RibbonCommand;
|
|
3417
|
+
|
|
3013
3418
|
// src/components/feedback/InlineMessage.tsx
|
|
3014
|
-
var
|
|
3419
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3015
3420
|
var KIND_ICON = {
|
|
3016
3421
|
info: "info",
|
|
3017
3422
|
success: "check-circle-2",
|
|
@@ -3021,7 +3426,7 @@ var KIND_ICON = {
|
|
|
3021
3426
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
3022
3427
|
const msg = usePireMessages();
|
|
3023
3428
|
const assertive = kind === "error" || kind === "warning";
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3025
3430
|
"div",
|
|
3026
3431
|
{
|
|
3027
3432
|
className: cx("pire-msg", className),
|
|
@@ -3030,21 +3435,21 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
3030
3435
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3031
3436
|
...rest,
|
|
3032
3437
|
children: [
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3035
|
-
title ? /* @__PURE__ */ (0,
|
|
3036
|
-
children ? /* @__PURE__ */ (0,
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
3440
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-title", children: title }) : null,
|
|
3441
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "pire-msg-body", children }) : null,
|
|
3037
3442
|
action
|
|
3038
3443
|
] }),
|
|
3039
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3444
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3040
3445
|
]
|
|
3041
3446
|
}
|
|
3042
3447
|
);
|
|
3043
3448
|
}
|
|
3044
3449
|
|
|
3045
3450
|
// src/components/feedback/Toast.tsx
|
|
3046
|
-
var
|
|
3047
|
-
var
|
|
3451
|
+
var React25 = __toESM(require("react"), 1);
|
|
3452
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3048
3453
|
var KIND_ICON2 = {
|
|
3049
3454
|
info: "info",
|
|
3050
3455
|
success: "check-circle-2",
|
|
@@ -3053,7 +3458,7 @@ var KIND_ICON2 = {
|
|
|
3053
3458
|
};
|
|
3054
3459
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
3055
3460
|
const msg = usePireMessages();
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3057
3462
|
"div",
|
|
3058
3463
|
{
|
|
3059
3464
|
className: cx("pire-toast", className),
|
|
@@ -3062,40 +3467,40 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3062
3467
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3063
3468
|
...rest,
|
|
3064
3469
|
children: [
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
onClose ? /* @__PURE__ */ (0,
|
|
3470
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { style: { flex: 1 }, children }),
|
|
3472
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3068
3473
|
]
|
|
3069
3474
|
}
|
|
3070
3475
|
);
|
|
3071
3476
|
}
|
|
3072
|
-
var ToastContext =
|
|
3477
|
+
var ToastContext = React25.createContext(null);
|
|
3073
3478
|
function ToastProvider({ children, timeout = 6e3 }) {
|
|
3074
3479
|
const msg = usePireMessages();
|
|
3075
|
-
const [toasts, setToasts] =
|
|
3076
|
-
const close =
|
|
3077
|
-
const add =
|
|
3480
|
+
const [toasts, setToasts] = React25.useState([]);
|
|
3481
|
+
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3482
|
+
const add = React25.useCallback((toast) => {
|
|
3078
3483
|
const id = Math.random().toString(36).slice(2);
|
|
3079
3484
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
3080
3485
|
const ms = toast.timeout ?? timeout;
|
|
3081
3486
|
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3082
3487
|
return id;
|
|
3083
3488
|
}, [close, timeout]);
|
|
3084
|
-
const value =
|
|
3085
|
-
return /* @__PURE__ */ (0,
|
|
3489
|
+
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToastContext.Provider, { value, children: [
|
|
3086
3491
|
children,
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3492
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
3088
3493
|
] });
|
|
3089
3494
|
}
|
|
3090
3495
|
function useToast() {
|
|
3091
|
-
const ctx =
|
|
3496
|
+
const ctx = React25.useContext(ToastContext);
|
|
3092
3497
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3093
3498
|
return ctx;
|
|
3094
3499
|
}
|
|
3095
3500
|
|
|
3096
3501
|
// src/components/data/KpiTile.tsx
|
|
3097
|
-
var
|
|
3098
|
-
var
|
|
3502
|
+
var import_react_aria_components32 = require("react-aria-components");
|
|
3503
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3099
3504
|
function KpiTile({
|
|
3100
3505
|
label,
|
|
3101
3506
|
value,
|
|
@@ -3111,50 +3516,50 @@ function KpiTile({
|
|
|
3111
3516
|
style
|
|
3112
3517
|
}) {
|
|
3113
3518
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3114
|
-
const body = /* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
icon ? /* @__PURE__ */ (0,
|
|
3519
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
3520
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-label", children: [
|
|
3521
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: icon, size: 16 }) : null,
|
|
3117
3522
|
label
|
|
3118
3523
|
] }),
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3524
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-value", children: [
|
|
3120
3525
|
value,
|
|
3121
|
-
unit ? /* @__PURE__ */ (0,
|
|
3526
|
+
unit ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3122
3527
|
] }),
|
|
3123
|
-
delta ? /* @__PURE__ */ (0,
|
|
3124
|
-
deltaDirection ? /* @__PURE__ */ (0,
|
|
3528
|
+
delta ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
3529
|
+
deltaDirection ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3125
3530
|
delta
|
|
3126
3531
|
] }) : null,
|
|
3127
|
-
footnote ? /* @__PURE__ */ (0,
|
|
3532
|
+
footnote ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3128
3533
|
] });
|
|
3129
3534
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3130
|
-
return onPress ? /* @__PURE__ */ (0,
|
|
3535
|
+
return onPress ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_aria_components32.Button, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { ...props, children: body });
|
|
3131
3536
|
}
|
|
3132
3537
|
|
|
3133
3538
|
// src/components/data/ObjectHeader.tsx
|
|
3134
|
-
var
|
|
3539
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3135
3540
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
3136
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3137
3542
|
breadcrumb,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
/* @__PURE__ */ (0,
|
|
3141
|
-
subtitle || id ? /* @__PURE__ */ (0,
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h1", { className: "pire-objheader-title", children: title }),
|
|
3546
|
+
subtitle || id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-sub", children: [
|
|
3142
3547
|
subtitle,
|
|
3143
|
-
id ? /* @__PURE__ */ (0,
|
|
3548
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-objheader-id", children: id }) : null
|
|
3144
3549
|
] }) : null
|
|
3145
3550
|
] }),
|
|
3146
3551
|
badge,
|
|
3147
|
-
actions ? /* @__PURE__ */ (0,
|
|
3552
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3148
3553
|
] }),
|
|
3149
|
-
facts?.length ? /* @__PURE__ */ (0,
|
|
3150
|
-
/* @__PURE__ */ (0,
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3554
|
+
facts?.length ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
3555
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3556
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
3152
3557
|
] }, fact.label)) }) : null
|
|
3153
3558
|
] });
|
|
3154
3559
|
}
|
|
3155
3560
|
|
|
3156
3561
|
// src/components/data/FilterBar.tsx
|
|
3157
|
-
var
|
|
3562
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3158
3563
|
function FilterBar({
|
|
3159
3564
|
children,
|
|
3160
3565
|
activeFilters = [],
|
|
@@ -3171,49 +3576,49 @@ function FilterBar({
|
|
|
3171
3576
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3172
3577
|
const go = useMessage("filterBarGo", goLabel);
|
|
3173
3578
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3174
|
-
return /* @__PURE__ */ (0,
|
|
3175
|
-
/* @__PURE__ */ (0,
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-controls", children: [
|
|
3176
3581
|
children,
|
|
3177
|
-
onGo ? /* @__PURE__ */ (0,
|
|
3582
|
+
onGo ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3178
3583
|
] }),
|
|
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,
|
|
3584
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-filterbar-foot", children: [
|
|
3585
|
+
activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
3586
|
+
activeFilters.length && onClear ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
3587
|
+
resultLabel ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
3588
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3184
3589
|
] }) : null
|
|
3185
3590
|
] });
|
|
3186
3591
|
}
|
|
3187
3592
|
|
|
3188
3593
|
// src/components/data/DescriptionList.tsx
|
|
3189
|
-
var
|
|
3594
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3190
3595
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
3191
|
-
return /* @__PURE__ */ (0,
|
|
3596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3192
3597
|
"dl",
|
|
3193
3598
|
{
|
|
3194
3599
|
className: cx("pire-dl", className),
|
|
3195
3600
|
"data-layout": layout,
|
|
3196
3601
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
3197
3602
|
...rest,
|
|
3198
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
3199
|
-
/* @__PURE__ */ (0,
|
|
3603
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("dt", { className: "pire-dl-term", children: [
|
|
3200
3605
|
item.label,
|
|
3201
3606
|
item.hint
|
|
3202
3607
|
] }),
|
|
3203
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
3204
3609
|
] }, i))
|
|
3205
3610
|
}
|
|
3206
3611
|
);
|
|
3207
3612
|
}
|
|
3208
3613
|
|
|
3209
3614
|
// src/components/data/Timeline.tsx
|
|
3210
|
-
var
|
|
3615
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3211
3616
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
3212
3617
|
const list = reverse ? [...entries].reverse() : entries;
|
|
3213
|
-
return /* @__PURE__ */ (0,
|
|
3214
|
-
/* @__PURE__ */ (0,
|
|
3215
|
-
/* @__PURE__ */ (0,
|
|
3216
|
-
entry.actor ? /* @__PURE__ */ (0,
|
|
3618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("li", { className: "pire-timeline-item", children: [
|
|
3619
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-time", children: entry.time }),
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-text", children: entry.event }),
|
|
3621
|
+
entry.actor ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
3217
3622
|
] }, entry.id ?? i)) });
|
|
3218
3623
|
}
|
|
3219
3624
|
|
|
@@ -3259,10 +3664,10 @@ function seriesColor(series, index) {
|
|
|
3259
3664
|
const slot = series.colorIndex ?? index + 1;
|
|
3260
3665
|
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
3261
3666
|
}
|
|
3262
|
-
var
|
|
3667
|
+
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
3263
3668
|
var warnedCharts = /* @__PURE__ */ new Set();
|
|
3264
3669
|
function warnOnSlotOverflow(series, chartLabel) {
|
|
3265
|
-
if (!
|
|
3670
|
+
if (!IS_DEV3 || warnedCharts.has(chartLabel)) return;
|
|
3266
3671
|
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
3267
3672
|
warnedCharts.add(chartLabel);
|
|
3268
3673
|
console.warn(
|
|
@@ -3270,7 +3675,7 @@ function warnOnSlotOverflow(series, chartLabel) {
|
|
|
3270
3675
|
);
|
|
3271
3676
|
}
|
|
3272
3677
|
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
3273
|
-
if (!
|
|
3678
|
+
if (!IS_DEV3 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
3274
3679
|
const complaints = [];
|
|
3275
3680
|
if (series.length > 1) {
|
|
3276
3681
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
@@ -3296,7 +3701,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
3296
3701
|
}
|
|
3297
3702
|
|
|
3298
3703
|
// src/components/data/ChartFrame.tsx
|
|
3299
|
-
var
|
|
3704
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3300
3705
|
function seriesLegend(series) {
|
|
3301
3706
|
return series.map((one, index) => ({
|
|
3302
3707
|
key: one.id,
|
|
@@ -3319,29 +3724,29 @@ function ChartFrame({
|
|
|
3319
3724
|
children
|
|
3320
3725
|
}) {
|
|
3321
3726
|
const msg = usePireMessages();
|
|
3322
|
-
return /* @__PURE__ */ (0,
|
|
3323
|
-
title || description ? /* @__PURE__ */ (0,
|
|
3324
|
-
title ? /* @__PURE__ */ (0,
|
|
3325
|
-
description ? /* @__PURE__ */ (0,
|
|
3727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figure", { className: cx("pire-chart", className), style, children: [
|
|
3728
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("figcaption", { className: "pire-chart-head", children: [
|
|
3729
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-title", children: title }) : null,
|
|
3730
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-desc", children: description }) : null
|
|
3326
3731
|
] }) : null,
|
|
3327
|
-
legend && legend.length > 1 ? /* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3732
|
+
legend && legend.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("li", { className: "pire-chart-legend-item", children: [
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
3329
3734
|
item.label
|
|
3330
3735
|
] }, item.key)) }) : null,
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
/* @__PURE__ */ (0,
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
series.map((one) => /* @__PURE__ */ (0,
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
3737
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("table", { children: [
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("caption", { children: label }),
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
3741
|
+
series.map((one) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "col", children: one.label }, one.id))
|
|
3337
3742
|
] }) }),
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3743
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tbody", { children: categories.map((category, categoryIndex) => (
|
|
3339
3744
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3340
|
-
/* @__PURE__ */ (0,
|
|
3341
|
-
/* @__PURE__ */ (0,
|
|
3745
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("tr", { children: [
|
|
3746
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { scope: "row", children: category }),
|
|
3342
3747
|
series.map((one) => {
|
|
3343
3748
|
const value = one.values[categoryIndex];
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
3345
3750
|
})
|
|
3346
3751
|
] }, categoryIndex)
|
|
3347
3752
|
)) })
|
|
@@ -3350,7 +3755,7 @@ function ChartFrame({
|
|
|
3350
3755
|
}
|
|
3351
3756
|
|
|
3352
3757
|
// src/components/data/BarChart.tsx
|
|
3353
|
-
var
|
|
3758
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3354
3759
|
function BarChart({
|
|
3355
3760
|
categories,
|
|
3356
3761
|
series: rawSeries,
|
|
@@ -3382,7 +3787,7 @@ function BarChart({
|
|
|
3382
3787
|
const value = series[0].values[categoryIndex];
|
|
3383
3788
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
3384
3789
|
};
|
|
3385
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3386
3791
|
ChartFrame,
|
|
3387
3792
|
{
|
|
3388
3793
|
label,
|
|
@@ -3395,7 +3800,7 @@ function BarChart({
|
|
|
3395
3800
|
showDataTable,
|
|
3396
3801
|
className,
|
|
3397
3802
|
style,
|
|
3398
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3803
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3399
3804
|
"div",
|
|
3400
3805
|
{
|
|
3401
3806
|
className: "pire-chart-bars",
|
|
@@ -3404,12 +3809,12 @@ function BarChart({
|
|
|
3404
3809
|
style: { "--pire-chart-height": `${height}px` },
|
|
3405
3810
|
children: categories.map((category, categoryIndex) => (
|
|
3406
3811
|
// 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,
|
|
3812
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "pire-chart-group", children: [
|
|
3813
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-cat", children: category }),
|
|
3814
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
3410
3815
|
const value = one.values[categoryIndex];
|
|
3411
3816
|
if (value == null) return null;
|
|
3412
|
-
return /* @__PURE__ */ (0,
|
|
3817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3413
3818
|
"div",
|
|
3414
3819
|
{
|
|
3415
3820
|
className: "pire-chart-bar",
|
|
@@ -3418,8 +3823,8 @@ function BarChart({
|
|
|
3418
3823
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
3419
3824
|
},
|
|
3420
3825
|
children: [
|
|
3421
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3826
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
3827
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3423
3828
|
series.length > 1 ? `${one.label}: ` : "",
|
|
3424
3829
|
formatValue(value)
|
|
3425
3830
|
] })
|
|
@@ -3428,7 +3833,7 @@ function BarChart({
|
|
|
3428
3833
|
one.id
|
|
3429
3834
|
);
|
|
3430
3835
|
}) }),
|
|
3431
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0,
|
|
3836
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
3432
3837
|
] }, categoryIndex)
|
|
3433
3838
|
))
|
|
3434
3839
|
}
|
|
@@ -3438,14 +3843,14 @@ function BarChart({
|
|
|
3438
3843
|
}
|
|
3439
3844
|
|
|
3440
3845
|
// src/components/data/LineChart.tsx
|
|
3441
|
-
var
|
|
3442
|
-
var
|
|
3846
|
+
var React26 = __toESM(require("react"), 1);
|
|
3847
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3443
3848
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
3444
3849
|
var MARKER_LIMIT = 20;
|
|
3445
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
3850
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React26.useEffect : React26.useLayoutEffect;
|
|
3446
3851
|
function useMeasuredWidth() {
|
|
3447
|
-
const ref =
|
|
3448
|
-
const [width, setWidth] =
|
|
3852
|
+
const ref = React26.useRef(null);
|
|
3853
|
+
const [width, setWidth] = React26.useState(0);
|
|
3449
3854
|
useIsomorphicLayoutEffect2(() => {
|
|
3450
3855
|
const element = ref.current;
|
|
3451
3856
|
if (!element) return;
|
|
@@ -3506,7 +3911,7 @@ function LineChart({
|
|
|
3506
3911
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
3507
3912
|
};
|
|
3508
3913
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
3509
|
-
return /* @__PURE__ */ (0,
|
|
3914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3510
3915
|
ChartFrame,
|
|
3511
3916
|
{
|
|
3512
3917
|
label,
|
|
@@ -3519,8 +3924,8 @@ function LineChart({
|
|
|
3519
3924
|
showDataTable,
|
|
3520
3925
|
className,
|
|
3521
3926
|
style,
|
|
3522
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3523
|
-
width > 0 ? /* @__PURE__ */ (0,
|
|
3927
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
3928
|
+
width > 0 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3524
3929
|
"svg",
|
|
3525
3930
|
{
|
|
3526
3931
|
width,
|
|
@@ -3529,7 +3934,7 @@ function LineChart({
|
|
|
3529
3934
|
"aria-hidden": "true",
|
|
3530
3935
|
focusable: "false",
|
|
3531
3936
|
children: [
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3937
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3533
3938
|
"line",
|
|
3534
3939
|
{
|
|
3535
3940
|
x1: PLOT_INSET.left,
|
|
@@ -3539,8 +3944,8 @@ function LineChart({
|
|
|
3539
3944
|
},
|
|
3540
3945
|
tick
|
|
3541
3946
|
)) }),
|
|
3542
|
-
/* @__PURE__ */ (0,
|
|
3543
|
-
scale.ticks.map((tick) => /* @__PURE__ */ (0,
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("g", { className: "pire-chart-tick", children: [
|
|
3948
|
+
scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3544
3949
|
"text",
|
|
3545
3950
|
{
|
|
3546
3951
|
x: PLOT_INSET.left - 8,
|
|
@@ -3553,10 +3958,10 @@ function LineChart({
|
|
|
3553
3958
|
)),
|
|
3554
3959
|
categories.map((category, index) => index % labelEvery === 0 ? (
|
|
3555
3960
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3556
|
-
/* @__PURE__ */ (0,
|
|
3961
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
3557
3962
|
) : null)
|
|
3558
3963
|
] }),
|
|
3559
|
-
showArea && series[0] ? /* @__PURE__ */ (0,
|
|
3964
|
+
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3560
3965
|
"path",
|
|
3561
3966
|
{
|
|
3562
3967
|
d: areaFor(series[0].values),
|
|
@@ -3564,10 +3969,10 @@ function LineChart({
|
|
|
3564
3969
|
style: { fill: seriesColor(series[0], 0) }
|
|
3565
3970
|
}
|
|
3566
3971
|
) : null,
|
|
3567
|
-
/* @__PURE__ */ (0,
|
|
3568
|
-
withMarkers ? /* @__PURE__ */ (0,
|
|
3972
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
3973
|
+
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map((one, seriesIndex) => one.values.map((value, index) => value == null ? null : (
|
|
3569
3974
|
// biome-ignore lint/suspicious/noArrayIndexKey: a series is positional — the index is the point's identity, and category labels repeat.
|
|
3570
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3571
3976
|
"circle",
|
|
3572
3977
|
{
|
|
3573
3978
|
cx: xAt(index),
|
|
@@ -3581,18 +3986,18 @@ function LineChart({
|
|
|
3581
3986
|
]
|
|
3582
3987
|
}
|
|
3583
3988
|
) : null,
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
3989
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3585
3990
|
"div",
|
|
3586
3991
|
{
|
|
3587
3992
|
className: "pire-chart-hover",
|
|
3588
3993
|
style: { inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px` },
|
|
3589
3994
|
children: categories.map((category, categoryIndex) => (
|
|
3590
3995
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3591
|
-
/* @__PURE__ */ (0,
|
|
3592
|
-
/* @__PURE__ */ (0,
|
|
3996
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-band", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3997
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: category }),
|
|
3593
3998
|
series.map((one) => {
|
|
3594
3999
|
const value = one.values[categoryIndex];
|
|
3595
|
-
return /* @__PURE__ */ (0,
|
|
4000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip-row", children: [
|
|
3596
4001
|
one.label,
|
|
3597
4002
|
": ",
|
|
3598
4003
|
value == null ? "No data" : formatValue(value)
|
|
@@ -3608,8 +4013,8 @@ function LineChart({
|
|
|
3608
4013
|
}
|
|
3609
4014
|
|
|
3610
4015
|
// src/components/data/DonutChart.tsx
|
|
3611
|
-
var
|
|
3612
|
-
var
|
|
4016
|
+
var React27 = __toESM(require("react"), 1);
|
|
4017
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3613
4018
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
3614
4019
|
function DonutChart({
|
|
3615
4020
|
categories,
|
|
@@ -3629,7 +4034,7 @@ function DonutChart({
|
|
|
3629
4034
|
}) {
|
|
3630
4035
|
const label = rest["aria-label"];
|
|
3631
4036
|
const msg = usePireMessages();
|
|
3632
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4037
|
+
const [hoveredIndex, setHoveredIndex] = React27.useState(null);
|
|
3633
4038
|
warnOnDonutShape(series, categories.length, label);
|
|
3634
4039
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
3635
4040
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -3646,7 +4051,7 @@ function DonutChart({
|
|
|
3646
4051
|
}));
|
|
3647
4052
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
3648
4053
|
let arcStart = 0;
|
|
3649
|
-
return /* @__PURE__ */ (0,
|
|
4054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3650
4055
|
ChartFrame,
|
|
3651
4056
|
{
|
|
3652
4057
|
label,
|
|
@@ -3659,8 +4064,8 @@ function DonutChart({
|
|
|
3659
4064
|
showDataTable,
|
|
3660
4065
|
className,
|
|
3661
4066
|
style,
|
|
3662
|
-
children: !hasData ? /* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
4067
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3664
4069
|
"svg",
|
|
3665
4070
|
{
|
|
3666
4071
|
width: size,
|
|
@@ -3668,13 +4073,13 @@ function DonutChart({
|
|
|
3668
4073
|
"aria-hidden": "true",
|
|
3669
4074
|
focusable: "false",
|
|
3670
4075
|
onMouseLeave: () => setHoveredIndex(null),
|
|
3671
|
-
children: /* @__PURE__ */ (0,
|
|
4076
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
3672
4077
|
const arcLength = segment.value / total * circumference;
|
|
3673
4078
|
const offset = arcStart;
|
|
3674
4079
|
arcStart += arcLength;
|
|
3675
4080
|
return (
|
|
3676
4081
|
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only enhancement inside an aria-hidden plot — the arcs carry nothing the data table does not, so there is nothing here for a keyboard to reach.
|
|
3677
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3678
4083
|
"circle",
|
|
3679
4084
|
{
|
|
3680
4085
|
className: "pire-chart-arc",
|
|
@@ -3694,9 +4099,9 @@ function DonutChart({
|
|
|
3694
4099
|
}) })
|
|
3695
4100
|
}
|
|
3696
4101
|
),
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3698
|
-
/* @__PURE__ */ (0,
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4103
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
3700
4105
|
] })
|
|
3701
4106
|
] })
|
|
3702
4107
|
}
|
|
@@ -3707,15 +4112,15 @@ function colorForSegment(index) {
|
|
|
3707
4112
|
}
|
|
3708
4113
|
|
|
3709
4114
|
// src/components/data/LinkList.tsx
|
|
3710
|
-
var
|
|
3711
|
-
var
|
|
4115
|
+
var import_react_aria_components33 = require("react-aria-components");
|
|
4116
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3712
4117
|
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,
|
|
4118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4119
|
+
const keySlot = item.key ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4120
|
+
const textSlot = item.text ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
3716
4121
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
3717
|
-
return /* @__PURE__ */ (0,
|
|
3718
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { role: "listitem", className: "pire-linklist-row", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_react_aria_components33.Button, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
4123
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
3719
4124
|
first,
|
|
3720
4125
|
second,
|
|
3721
4126
|
item.trailing
|
|
@@ -3723,8 +4128,73 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
3723
4128
|
}) });
|
|
3724
4129
|
}
|
|
3725
4130
|
|
|
4131
|
+
// src/components/data/RecordCard.tsx
|
|
4132
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4133
|
+
function RecordCard({ title, subtitle, icon, action, isDisabled, className, ...rest }) {
|
|
4134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cx("pire-recordcard", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
4135
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: icon, size: 20 }) }) : null,
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pire-recordcard-body", children: [
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-title", children: title }),
|
|
4138
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4139
|
+
] }),
|
|
4140
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4141
|
+
] });
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
// src/components/data/ViewSwitcher.tsx
|
|
4145
|
+
var import_react_aria_components34 = require("react-aria-components");
|
|
4146
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4147
|
+
function ViewSwitcher({
|
|
4148
|
+
name,
|
|
4149
|
+
isDirty,
|
|
4150
|
+
icon = "star",
|
|
4151
|
+
onPress,
|
|
4152
|
+
isDisabled,
|
|
4153
|
+
"aria-label": ariaLabel,
|
|
4154
|
+
className,
|
|
4155
|
+
style
|
|
4156
|
+
}) {
|
|
4157
|
+
const msg = usePireMessages();
|
|
4158
|
+
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4160
|
+
import_react_aria_components34.Button,
|
|
4161
|
+
{
|
|
4162
|
+
className: cx("pire-viewswitcher", className),
|
|
4163
|
+
style,
|
|
4164
|
+
"aria-label": label,
|
|
4165
|
+
isDisabled,
|
|
4166
|
+
onPress,
|
|
4167
|
+
children: [
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: icon, size: 16 }),
|
|
4169
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4170
|
+
isDirty ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
4172
|
+
]
|
|
4173
|
+
}
|
|
4174
|
+
);
|
|
4175
|
+
}
|
|
4176
|
+
|
|
4177
|
+
// src/components/data/BarList.tsx
|
|
4178
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4179
|
+
function BarList({ items, max, className, ...rest }) {
|
|
4180
|
+
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4182
|
+
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-main", children: [
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-label", children: item.label }),
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-track", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-fill", style: { width: `${pct}%` } }) })
|
|
4187
|
+
] }),
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { className: "pire-barlist-figure", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4190
|
+
item.hint ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4191
|
+
] })
|
|
4192
|
+
] }, item.id);
|
|
4193
|
+
}) });
|
|
4194
|
+
}
|
|
4195
|
+
|
|
3726
4196
|
// src/components/layout/PageBand.tsx
|
|
3727
|
-
var
|
|
4197
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3728
4198
|
function PageBand({
|
|
3729
4199
|
surface = "card",
|
|
3730
4200
|
hasBorder = true,
|
|
@@ -3732,7 +4202,7 @@ function PageBand({
|
|
|
3732
4202
|
className,
|
|
3733
4203
|
...rest
|
|
3734
4204
|
}) {
|
|
3735
|
-
return /* @__PURE__ */ (0,
|
|
4205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3736
4206
|
"div",
|
|
3737
4207
|
{
|
|
3738
4208
|
className: cx("pire-pageband", className),
|
|
@@ -3745,56 +4215,56 @@ function PageBand({
|
|
|
3745
4215
|
}
|
|
3746
4216
|
|
|
3747
4217
|
// src/components/layout/PageHeader.tsx
|
|
3748
|
-
var
|
|
4218
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3749
4219
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
3750
|
-
return /* @__PURE__ */ (0,
|
|
3751
|
-
/* @__PURE__ */ (0,
|
|
3752
|
-
/* @__PURE__ */ (0,
|
|
3753
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h1", { className: "pire-pageheader-title", children: title }),
|
|
4223
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
3754
4224
|
] }),
|
|
3755
|
-
actions ? /* @__PURE__ */ (0,
|
|
4225
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
3756
4226
|
] });
|
|
3757
4227
|
}
|
|
3758
4228
|
|
|
3759
4229
|
// src/components/layout/SectionHeader.tsx
|
|
3760
|
-
var
|
|
4230
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3761
4231
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
3762
|
-
return /* @__PURE__ */ (0,
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
-
meta ? /* @__PURE__ */ (0,
|
|
3765
|
-
actions ? /* @__PURE__ */ (0,
|
|
4232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "pire-eyebrow", children: title }),
|
|
4234
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
4235
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
3766
4236
|
] });
|
|
3767
4237
|
}
|
|
3768
4238
|
|
|
3769
4239
|
// src/components/layout/SelectionBar.tsx
|
|
3770
|
-
var
|
|
4240
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3771
4241
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
3772
4242
|
if (!count) return null;
|
|
3773
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
-
/* @__PURE__ */ (0,
|
|
4243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4244
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
3775
4245
|
count.toLocaleString(),
|
|
3776
4246
|
" ",
|
|
3777
4247
|
noun,
|
|
3778
4248
|
count === 1 ? "" : "s",
|
|
3779
4249
|
" selected"
|
|
3780
4250
|
] }),
|
|
3781
|
-
children ? /* @__PURE__ */ (0,
|
|
3782
|
-
actions ? /* @__PURE__ */ (0,
|
|
4251
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
4252
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
3783
4253
|
] });
|
|
3784
4254
|
}
|
|
3785
4255
|
|
|
3786
4256
|
// src/components/layout/FooterBar.tsx
|
|
3787
|
-
var
|
|
4257
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3788
4258
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
3789
|
-
return /* @__PURE__ */ (0,
|
|
3790
|
-
note ? /* @__PURE__ */ (0,
|
|
4259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
4260
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
3791
4261
|
children,
|
|
3792
|
-
actions ? /* @__PURE__ */ (0,
|
|
4262
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
3793
4263
|
] });
|
|
3794
4264
|
}
|
|
3795
4265
|
|
|
3796
4266
|
// src/components/layout/SplitPane.tsx
|
|
3797
|
-
var
|
|
4267
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3798
4268
|
function SplitPane({
|
|
3799
4269
|
list,
|
|
3800
4270
|
detail,
|
|
@@ -3810,7 +4280,7 @@ function SplitPane({
|
|
|
3810
4280
|
}) {
|
|
3811
4281
|
const msg = usePireMessages();
|
|
3812
4282
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
3813
|
-
return /* @__PURE__ */ (0,
|
|
4283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3814
4284
|
"div",
|
|
3815
4285
|
{
|
|
3816
4286
|
className: cx("pire-split", className),
|
|
@@ -3818,10 +4288,10 @@ function SplitPane({
|
|
|
3818
4288
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
3819
4289
|
...rest,
|
|
3820
4290
|
children: [
|
|
3821
|
-
/* @__PURE__ */ (0,
|
|
3822
|
-
/* @__PURE__ */ (0,
|
|
3823
|
-
onBack ? /* @__PURE__ */ (0,
|
|
3824
|
-
detail ?? /* @__PURE__ */ (0,
|
|
4291
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
4292
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
4293
|
+
onBack ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pire-split-back", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Button, { variant: "tertiary", size: "sm", icon: "arrow-left", onPress: onBack, children: backLabel ?? msg.splitPaneBack }) }) : null,
|
|
4294
|
+
detail ?? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pire-split-empty", children: emptyDetail })
|
|
3825
4295
|
] })
|
|
3826
4296
|
]
|
|
3827
4297
|
}
|
|
@@ -3829,11 +4299,12 @@ function SplitPane({
|
|
|
3829
4299
|
}
|
|
3830
4300
|
|
|
3831
4301
|
// src/components/patterns/ConfirmDialog.tsx
|
|
3832
|
-
var
|
|
4302
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3833
4303
|
function ConfirmDialog({
|
|
3834
4304
|
isOpen,
|
|
3835
4305
|
title,
|
|
3836
4306
|
subtitle,
|
|
4307
|
+
facts,
|
|
3837
4308
|
consequence,
|
|
3838
4309
|
children,
|
|
3839
4310
|
confirmLabel = "Confirm",
|
|
@@ -3843,7 +4314,8 @@ function ConfirmDialog({
|
|
|
3843
4314
|
onConfirm,
|
|
3844
4315
|
onCancel
|
|
3845
4316
|
}) {
|
|
3846
|
-
|
|
4317
|
+
const msg = usePireMessages();
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3847
4319
|
Dialog,
|
|
3848
4320
|
{
|
|
3849
4321
|
isOpen,
|
|
@@ -3853,12 +4325,19 @@ function ConfirmDialog({
|
|
|
3853
4325
|
onClose: onCancel,
|
|
3854
4326
|
isDismissable: !isBusy,
|
|
3855
4327
|
showClose: false,
|
|
3856
|
-
footer: /* @__PURE__ */ (0,
|
|
3857
|
-
/* @__PURE__ */ (0,
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
4328
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
3859
4331
|
] }),
|
|
3860
4332
|
children: [
|
|
3861
|
-
|
|
4333
|
+
facts?.length ? (
|
|
4334
|
+
// The role is what makes the name stick. A bare <div> resolves to `generic`, which
|
|
4335
|
+
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4336
|
+
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4337
|
+
// pairs with an explicit role for the same reason.
|
|
4338
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DescriptionList, { layout: "rows", items: facts }) })
|
|
4339
|
+
) : null,
|
|
4340
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
3862
4341
|
children
|
|
3863
4342
|
]
|
|
3864
4343
|
}
|
|
@@ -3866,9 +4345,9 @@ function ConfirmDialog({
|
|
|
3866
4345
|
}
|
|
3867
4346
|
|
|
3868
4347
|
// src/components/patterns/CommandPalette.tsx
|
|
3869
|
-
var
|
|
3870
|
-
var
|
|
3871
|
-
var
|
|
4348
|
+
var React28 = __toESM(require("react"), 1);
|
|
4349
|
+
var import_react_aria_components35 = require("react-aria-components");
|
|
4350
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3872
4351
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
3873
4352
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
3874
4353
|
function CommandPalette({
|
|
@@ -3889,17 +4368,17 @@ function CommandPalette({
|
|
|
3889
4368
|
style
|
|
3890
4369
|
}) {
|
|
3891
4370
|
const msg = usePireMessages();
|
|
3892
|
-
const [query, setQuery] =
|
|
3893
|
-
const { contains } = (0,
|
|
3894
|
-
|
|
4371
|
+
const [query, setQuery] = React28.useState("");
|
|
4372
|
+
const { contains } = (0, import_react_aria_components35.useFilter)({ sensitivity: "base" });
|
|
4373
|
+
React28.useEffect(() => {
|
|
3895
4374
|
if (isOpen) setQuery("");
|
|
3896
4375
|
}, [isOpen]);
|
|
3897
|
-
const searchableById =
|
|
4376
|
+
const searchableById = React28.useMemo(() => {
|
|
3898
4377
|
const byId = /* @__PURE__ */ new Map();
|
|
3899
4378
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
3900
4379
|
return byId;
|
|
3901
4380
|
}, [groups]);
|
|
3902
|
-
const filter =
|
|
4381
|
+
const filter = React28.useCallback((textValue, inputValue, node) => {
|
|
3903
4382
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
3904
4383
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
3905
4384
|
}, [contains, searchableById]);
|
|
@@ -3909,8 +4388,8 @@ function CommandPalette({
|
|
|
3909
4388
|
};
|
|
3910
4389
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
3911
4390
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
3912
|
-
return /* @__PURE__ */ (0,
|
|
3913
|
-
|
|
4391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4392
|
+
import_react_aria_components35.ModalOverlay,
|
|
3914
4393
|
{
|
|
3915
4394
|
className: "pire-cp-overlay",
|
|
3916
4395
|
isOpen,
|
|
@@ -3918,12 +4397,12 @@ function CommandPalette({
|
|
|
3918
4397
|
onOpenChange: (open) => {
|
|
3919
4398
|
if (!open) onOpenChange?.(false);
|
|
3920
4399
|
},
|
|
3921
|
-
children: /* @__PURE__ */ (0,
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3923
|
-
/* @__PURE__ */ (0,
|
|
3924
|
-
/* @__PURE__ */ (0,
|
|
3925
|
-
/* @__PURE__ */ (0,
|
|
3926
|
-
|
|
4400
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_aria_components35.Modal, { className: cx("pire-cp-modal", className), style, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.Dialog, { className: "pire-cp-dialog", "aria-label": ariaLabel ?? msg.commandPaletteLabel, children: [
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4405
|
+
import_react_aria_components35.Input,
|
|
3927
4406
|
{
|
|
3928
4407
|
className: "pire-cp-input",
|
|
3929
4408
|
autoFocus: true,
|
|
@@ -3931,16 +4410,16 @@ function CommandPalette({
|
|
|
3931
4410
|
}
|
|
3932
4411
|
)
|
|
3933
4412
|
] }),
|
|
3934
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
3936
|
-
|
|
4413
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4415
|
+
import_react_aria_components35.Menu,
|
|
3937
4416
|
{
|
|
3938
4417
|
className: "pire-cp-list",
|
|
3939
4418
|
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,
|
|
4419
|
+
renderEmptyState: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-status", children: status }),
|
|
4420
|
+
children: sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react_aria_components35.MenuSection, { id: section.id, className: "pire-cp-section", children: [
|
|
4421
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react_aria_components35.Header, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
4422
|
+
section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3944
4423
|
MenuItem,
|
|
3945
4424
|
{
|
|
3946
4425
|
id: item.id,
|
|
@@ -3961,18 +4440,18 @@ function CommandPalette({
|
|
|
3961
4440
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
3962
4441
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
3963
4442
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
3966
|
-
/* @__PURE__ */ (0,
|
|
3967
|
-
/* @__PURE__ */ (0,
|
|
4443
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "pire-cp-foot", "aria-hidden": "true", children: footer ?? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
4444
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2191" }),
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u2193" }),
|
|
3968
4447
|
msg.commandPaletteHintNavigate
|
|
3969
4448
|
] }),
|
|
3970
|
-
/* @__PURE__ */ (0,
|
|
3971
|
-
/* @__PURE__ */ (0,
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4450
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "\u21B5" }),
|
|
3972
4451
|
msg.commandPaletteHintSelect
|
|
3973
4452
|
] }),
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "pire-cp-hint", children: [
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Kbd, { children: "esc" }),
|
|
3976
4455
|
msg.commandPaletteHintClose
|
|
3977
4456
|
] })
|
|
3978
4457
|
] }) })
|
|
@@ -3982,9 +4461,9 @@ function CommandPalette({
|
|
|
3982
4461
|
);
|
|
3983
4462
|
}
|
|
3984
4463
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
3985
|
-
const handler =
|
|
4464
|
+
const handler = React28.useRef(onTrigger);
|
|
3986
4465
|
handler.current = onTrigger;
|
|
3987
|
-
|
|
4466
|
+
React28.useEffect(() => {
|
|
3988
4467
|
if (isDisabled) return;
|
|
3989
4468
|
const onKeyDown = (event) => {
|
|
3990
4469
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -3998,9 +4477,9 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
3998
4477
|
}
|
|
3999
4478
|
|
|
4000
4479
|
// src/components/patterns/AppLauncher.tsx
|
|
4001
|
-
var
|
|
4002
|
-
var
|
|
4003
|
-
var
|
|
4480
|
+
var React29 = __toESM(require("react"), 1);
|
|
4481
|
+
var import_react_aria_components36 = require("react-aria-components");
|
|
4482
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4004
4483
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4005
4484
|
function AppLauncher({
|
|
4006
4485
|
sections,
|
|
@@ -4019,13 +4498,13 @@ function AppLauncher({
|
|
|
4019
4498
|
className
|
|
4020
4499
|
}) {
|
|
4021
4500
|
const msg = usePireMessages();
|
|
4022
|
-
const [query, setQuery] =
|
|
4023
|
-
const { contains } = (0,
|
|
4501
|
+
const [query, setQuery] = React29.useState("");
|
|
4502
|
+
const { contains } = (0, import_react_aria_components36.useFilter)({ sensitivity: "base" });
|
|
4024
4503
|
const handleSearch = (next) => {
|
|
4025
4504
|
setQuery(next);
|
|
4026
4505
|
onSearchChange?.(next);
|
|
4027
4506
|
};
|
|
4028
|
-
const visible =
|
|
4507
|
+
const visible = React29.useMemo(() => {
|
|
4029
4508
|
if (isFilteredExternally) return sections;
|
|
4030
4509
|
const q = query.trim();
|
|
4031
4510
|
if (!q) return sections;
|
|
@@ -4033,25 +4512,25 @@ function AppLauncher({
|
|
|
4033
4512
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4034
4513
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4035
4514
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4036
|
-
return /* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4039
|
-
|
|
4515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_aria_components36.DialogTrigger, { children: [
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react_aria_components36.Button, { className: "pire-launcher-trigger", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { name: icon, size: 20 }) }),
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4518
|
+
import_react_aria_components36.Popover,
|
|
4040
4519
|
{
|
|
4041
4520
|
className: cx("pire-launcher-popover", className),
|
|
4042
4521
|
placement: "bottom start",
|
|
4043
4522
|
offset: 0,
|
|
4044
4523
|
crossOffset: 0,
|
|
4045
4524
|
containerPadding: 0,
|
|
4046
|
-
children: /* @__PURE__ */ (0,
|
|
4047
|
-
/* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
meta ? /* @__PURE__ */ (0,
|
|
4525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react_aria_components36.Dialog, { className: "pire-launcher", "aria-label": label, children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-head", children: [
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
4528
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
4050
4529
|
] }),
|
|
4051
4530
|
isSearchable ? (
|
|
4052
4531
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
4053
4532
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
4054
|
-
/* @__PURE__ */ (0,
|
|
4533
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4055
4534
|
Input,
|
|
4056
4535
|
{
|
|
4057
4536
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -4065,18 +4544,18 @@ function AppLauncher({
|
|
|
4065
4544
|
}
|
|
4066
4545
|
)
|
|
4067
4546
|
) : null,
|
|
4068
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
4069
|
-
isEmpty ? /* @__PURE__ */ (0,
|
|
4547
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
4548
|
+
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
4070
4549
|
visible.map((section, si) => (
|
|
4071
4550
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
4072
4551
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4074
|
-
section.label ? /* @__PURE__ */ (0,
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "pire-launcher-section", children: [
|
|
4553
|
+
section.label ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
4554
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
4076
4555
|
const isCurrent = item.id === value;
|
|
4077
4556
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
4078
|
-
return /* @__PURE__ */ (0,
|
|
4079
|
-
|
|
4557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
4558
|
+
import_react_aria_components36.Button,
|
|
4080
4559
|
{
|
|
4081
4560
|
className: "pire-launcher-item",
|
|
4082
4561
|
"data-selected": isCurrent ? "true" : void 0,
|
|
@@ -4086,10 +4565,10 @@ function AppLauncher({
|
|
|
4086
4565
|
onAction?.(item.id);
|
|
4087
4566
|
},
|
|
4088
4567
|
children: [
|
|
4089
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
showsDescription ? /* @__PURE__ */ (0,
|
|
4568
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Icon, { name: item.icon, size: (section.variant ?? "tile") === "tile" ? 20 : 16 }) }) : null,
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "pire-launcher-item-text", children: [
|
|
4570
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4571
|
+
showsDescription ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
4093
4572
|
] })
|
|
4094
4573
|
]
|
|
4095
4574
|
},
|
|
@@ -4105,12 +4584,12 @@ function AppLauncher({
|
|
|
4105
4584
|
}
|
|
4106
4585
|
|
|
4107
4586
|
// src/components/patterns/SidePanel.tsx
|
|
4108
|
-
var
|
|
4109
|
-
var
|
|
4587
|
+
var import_react_aria_components37 = require("react-aria-components");
|
|
4588
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4110
4589
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
4111
4590
|
const msg = usePireMessages();
|
|
4112
|
-
return /* @__PURE__ */ (0,
|
|
4113
|
-
|
|
4591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4592
|
+
import_react_aria_components37.ModalOverlay,
|
|
4114
4593
|
{
|
|
4115
4594
|
className: "pire-sidepanel-overlay",
|
|
4116
4595
|
isOpen,
|
|
@@ -4118,35 +4597,35 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4118
4597
|
onOpenChange: (o) => {
|
|
4119
4598
|
if (!o) onClose?.();
|
|
4120
4599
|
},
|
|
4121
|
-
children: /* @__PURE__ */ (0,
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4125
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
4600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components37.Modal, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react_aria_components37.Dialog, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
4601
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
4602
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react_aria_components37.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
4604
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
4126
4605
|
] }),
|
|
4127
|
-
/* @__PURE__ */ (0,
|
|
4606
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
4128
4607
|
] }),
|
|
4129
|
-
/* @__PURE__ */ (0,
|
|
4130
|
-
footer ? /* @__PURE__ */ (0,
|
|
4608
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
4609
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
4131
4610
|
] }) })
|
|
4132
4611
|
}
|
|
4133
4612
|
);
|
|
4134
4613
|
}
|
|
4135
4614
|
|
|
4136
4615
|
// src/components/patterns/EmptyState.tsx
|
|
4137
|
-
var
|
|
4616
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4138
4617
|
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,
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4620
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
4621
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
4143
4622
|
action
|
|
4144
4623
|
] });
|
|
4145
4624
|
}
|
|
4146
4625
|
|
|
4147
4626
|
// src/components/patterns/NumPad.tsx
|
|
4148
|
-
var
|
|
4149
|
-
var
|
|
4627
|
+
var React30 = __toESM(require("react"), 1);
|
|
4628
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4150
4629
|
var BASE_KEYS = [
|
|
4151
4630
|
{ value: "7" },
|
|
4152
4631
|
{ value: "8" },
|
|
@@ -4163,9 +4642,9 @@ var BASE_KEYS = [
|
|
|
4163
4642
|
];
|
|
4164
4643
|
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
4165
4644
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
4166
|
-
const handler =
|
|
4645
|
+
const handler = React30.useRef(onKey);
|
|
4167
4646
|
handler.current = onKey;
|
|
4168
|
-
|
|
4647
|
+
React30.useEffect(() => {
|
|
4169
4648
|
if (isDisabled) return;
|
|
4170
4649
|
const isEditingElsewhere = () => {
|
|
4171
4650
|
const el = document.activeElement;
|
|
@@ -4207,8 +4686,8 @@ function NumPad({
|
|
|
4207
4686
|
style
|
|
4208
4687
|
}) {
|
|
4209
4688
|
const msg = usePireMessages();
|
|
4210
|
-
const containerRef =
|
|
4211
|
-
const applyKey =
|
|
4689
|
+
const containerRef = React30.useRef(null);
|
|
4690
|
+
const applyKey = React30.useCallback((key) => {
|
|
4212
4691
|
if (isDisabled) return;
|
|
4213
4692
|
if (key.value === "backspace") {
|
|
4214
4693
|
onChange(value.slice(0, -1));
|
|
@@ -4226,7 +4705,7 @@ function NumPad({
|
|
|
4226
4705
|
}, [isDisabled, value, onChange, onAction]);
|
|
4227
4706
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4228
4707
|
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4229
|
-
return /* @__PURE__ */ (0,
|
|
4708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
4230
4709
|
"div",
|
|
4231
4710
|
{
|
|
4232
4711
|
ref: containerRef,
|
|
@@ -4235,10 +4714,10 @@ function NumPad({
|
|
|
4235
4714
|
"data-size": size,
|
|
4236
4715
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
4237
4716
|
children: [
|
|
4238
|
-
target !== void 0 ? /* @__PURE__ */ (0,
|
|
4239
|
-
/* @__PURE__ */ (0,
|
|
4717
|
+
target !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
4240
4719
|
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
4241
|
-
return /* @__PURE__ */ (0,
|
|
4720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4242
4721
|
Button,
|
|
4243
4722
|
{
|
|
4244
4723
|
variant: "secondary",
|
|
@@ -4260,9 +4739,9 @@ function NumPad({
|
|
|
4260
4739
|
}
|
|
4261
4740
|
|
|
4262
4741
|
// src/components/patterns/FileDropZone.tsx
|
|
4263
|
-
var
|
|
4264
|
-
var
|
|
4265
|
-
var
|
|
4742
|
+
var React31 = __toESM(require("react"), 1);
|
|
4743
|
+
var import_react_aria_components38 = require("react-aria-components");
|
|
4744
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4266
4745
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
4267
4746
|
function FileDropZone({
|
|
4268
4747
|
label,
|
|
@@ -4290,10 +4769,10 @@ function FileDropZone({
|
|
|
4290
4769
|
...rest
|
|
4291
4770
|
}) {
|
|
4292
4771
|
const msg = usePireMessages();
|
|
4293
|
-
const [uncontrolled, setUncontrolled] =
|
|
4772
|
+
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4294
4773
|
const files = value ?? uncontrolled;
|
|
4295
|
-
const created =
|
|
4296
|
-
|
|
4774
|
+
const created = React31.useRef([]);
|
|
4775
|
+
React31.useEffect(() => () => {
|
|
4297
4776
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
4298
4777
|
}, []);
|
|
4299
4778
|
const commit = (next) => {
|
|
@@ -4313,13 +4792,13 @@ function FileDropZone({
|
|
|
4313
4792
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
4314
4793
|
};
|
|
4315
4794
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
4316
|
-
return /* @__PURE__ */ (0,
|
|
4317
|
-
label ? /* @__PURE__ */ (0,
|
|
4795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
4796
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("span", { className: "pire-field-label", children: [
|
|
4318
4797
|
label,
|
|
4319
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
4798
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
4320
4799
|
] }) : null,
|
|
4321
|
-
/* @__PURE__ */ (0,
|
|
4322
|
-
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
4801
|
+
import_react_aria_components38.DropZone,
|
|
4323
4802
|
{
|
|
4324
4803
|
className: "pire-dropzone",
|
|
4325
4804
|
"aria-label": ariaLabel,
|
|
@@ -4327,30 +4806,30 @@ function FileDropZone({
|
|
|
4327
4806
|
isDisabled: isDisabled || isReadOnly,
|
|
4328
4807
|
onDrop: async (e) => {
|
|
4329
4808
|
const dropped = await Promise.all(
|
|
4330
|
-
e.items.filter(
|
|
4809
|
+
e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile())
|
|
4331
4810
|
);
|
|
4332
4811
|
accept(dropped);
|
|
4333
4812
|
},
|
|
4334
4813
|
children: [
|
|
4335
|
-
/* @__PURE__ */ (0,
|
|
4336
|
-
/* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4338
|
-
|
|
4814
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
4816
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4817
|
+
import_react_aria_components38.FileTrigger,
|
|
4339
4818
|
{
|
|
4340
4819
|
acceptedFileTypes,
|
|
4341
4820
|
allowsMultiple,
|
|
4342
4821
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
4343
|
-
children: /* @__PURE__ */ (0,
|
|
4822
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
4344
4823
|
}
|
|
4345
4824
|
)
|
|
4346
4825
|
]
|
|
4347
4826
|
}
|
|
4348
4827
|
),
|
|
4349
|
-
files.length ? /* @__PURE__ */ (0,
|
|
4350
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
4351
|
-
/* @__PURE__ */ (0,
|
|
4352
|
-
/* @__PURE__ */ (0,
|
|
4353
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
4828
|
+
files.length ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("li", { className: "pire-fileupload-item", children: [
|
|
4829
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
4830
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
4832
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4354
4833
|
IconButton,
|
|
4355
4834
|
{
|
|
4356
4835
|
icon: "x",
|
|
@@ -4360,25 +4839,27 @@ function FileDropZone({
|
|
|
4360
4839
|
}
|
|
4361
4840
|
)
|
|
4362
4841
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
4363
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
4364
|
-
description ? /* @__PURE__ */ (0,
|
|
4365
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
4842
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
4843
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-hint", children: description }) : null,
|
|
4844
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
4366
4845
|
] });
|
|
4367
4846
|
}
|
|
4368
4847
|
|
|
4369
4848
|
// src/index.ts
|
|
4370
|
-
var
|
|
4371
|
-
var
|
|
4849
|
+
var import_react_aria_components39 = require("react-aria-components");
|
|
4850
|
+
var import_react_aria_components40 = require("react-aria-components");
|
|
4372
4851
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4373
4852
|
0 && (module.exports = {
|
|
4374
4853
|
AppLauncher,
|
|
4375
4854
|
Avatar,
|
|
4376
4855
|
Badge,
|
|
4377
4856
|
BarChart,
|
|
4857
|
+
BarList,
|
|
4378
4858
|
Breadcrumb,
|
|
4379
4859
|
Button,
|
|
4380
4860
|
Card,
|
|
4381
4861
|
Checkbox,
|
|
4862
|
+
ChoiceCardGroup,
|
|
4382
4863
|
ComboBox,
|
|
4383
4864
|
CommandPalette,
|
|
4384
4865
|
ConfirmDialog,
|
|
@@ -4427,8 +4908,11 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4427
4908
|
PireIntlProvider,
|
|
4428
4909
|
Popover,
|
|
4429
4910
|
ProgressBar,
|
|
4911
|
+
QuantityStepper,
|
|
4430
4912
|
Radio,
|
|
4431
4913
|
RadioGroup,
|
|
4914
|
+
RecordCard,
|
|
4915
|
+
Ribbon,
|
|
4432
4916
|
RouterProvider,
|
|
4433
4917
|
SectionHeader,
|
|
4434
4918
|
SegmentedControl,
|
|
@@ -4456,6 +4940,7 @@ var import_react_aria_components37 = require("react-aria-components");
|
|
|
4456
4940
|
VIZ_SLOT_COUNT,
|
|
4457
4941
|
ValueHelpDialog,
|
|
4458
4942
|
ValueHelpField,
|
|
4943
|
+
ViewSwitcher,
|
|
4459
4944
|
configureIcons,
|
|
4460
4945
|
enMessages,
|
|
4461
4946
|
esMessages,
|