@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.js
CHANGED
|
@@ -95,6 +95,7 @@ var ICON_MARKUP = {
|
|
|
95
95
|
"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"/>',
|
|
96
96
|
"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"/>',
|
|
97
97
|
"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"/>',
|
|
98
|
+
"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"/>',
|
|
98
99
|
"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"/>',
|
|
99
100
|
"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"/>',
|
|
100
101
|
"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"/>',
|
|
@@ -130,6 +131,7 @@ var ICON_MARKUP = {
|
|
|
130
131
|
"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"/>',
|
|
131
132
|
"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"/>',
|
|
132
133
|
"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"/>',
|
|
134
|
+
"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"/>',
|
|
133
135
|
"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"/>',
|
|
134
136
|
"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"/>',
|
|
135
137
|
"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"/>',
|
|
@@ -155,6 +157,11 @@ var CARBON_MAP = {
|
|
|
155
157
|
"file-text": "document",
|
|
156
158
|
"clipboard-list": "list--checked",
|
|
157
159
|
"building-2": "building",
|
|
160
|
+
/* Ribbon and import commands. `task--complete` is Carbon's ticked-list glyph; `check-square`
|
|
161
|
+
already points at it, and the generator de-duplicates by slug, so this costs no bytes. */
|
|
162
|
+
"list-checks": "task--complete",
|
|
163
|
+
"pin": "pin",
|
|
164
|
+
"upload": "upload",
|
|
158
165
|
"boxes": "box",
|
|
159
166
|
"truck": "delivery-truck",
|
|
160
167
|
"stamp": "checkmark--outline",
|
|
@@ -418,7 +425,9 @@ import * as React2 from "react";
|
|
|
418
425
|
import { TooltipTrigger, Tooltip as AriaTooltip, OverlayArrow, Focusable } from "react-aria-components";
|
|
419
426
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
420
427
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
421
|
-
const
|
|
428
|
+
const props = React2.isValidElement(children) ? children.props : void 0;
|
|
429
|
+
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
430
|
+
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? /* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children }) : /* @__PURE__ */ jsx3("span", { className: "pire-tooltip-target", children });
|
|
422
431
|
return /* @__PURE__ */ jsxs2(TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
423
432
|
/* @__PURE__ */ jsx3(Focusable, { children: target }),
|
|
424
433
|
/* @__PURE__ */ jsxs2(AriaTooltip, { className: "pire-tooltip", placement, offset: 6, children: [
|
|
@@ -483,50 +492,244 @@ var Badge = React4.forwardRef(function Badge2({ children, status = "neutral", sh
|
|
|
483
492
|
});
|
|
484
493
|
|
|
485
494
|
// src/components/core/Tag.tsx
|
|
486
|
-
import * as
|
|
495
|
+
import * as React6 from "react";
|
|
487
496
|
import { Button as AriaButton3 } from "react-aria-components";
|
|
488
|
-
|
|
489
|
-
|
|
497
|
+
|
|
498
|
+
// src/i18n/PireIntlProvider.tsx
|
|
499
|
+
import * as React5 from "react";
|
|
500
|
+
|
|
501
|
+
// src/i18n/messages.ts
|
|
502
|
+
var enMessages = {
|
|
503
|
+
filterBarLabel: "Filters",
|
|
504
|
+
filterBarGo: "Go",
|
|
505
|
+
filterBarClearAll: "Clear all",
|
|
506
|
+
dataTableSelectAll: "Select all rows",
|
|
507
|
+
dataTableSelectRow: "Select row",
|
|
508
|
+
dataTableSelectionColumn: "Selection",
|
|
509
|
+
dataTableLoading: "Loading records",
|
|
510
|
+
dataTableSummaryRow: "Summary",
|
|
511
|
+
dataTableEmpty: "No records match the current filters.",
|
|
512
|
+
dialogClose: "Close",
|
|
513
|
+
sidePanelClose: "Close panel",
|
|
514
|
+
inlineMessageDismiss: "Dismiss message",
|
|
515
|
+
toastDismiss: "Dismiss",
|
|
516
|
+
toastRegionLabel: "Notifications",
|
|
517
|
+
selectEmpty: "No options available",
|
|
518
|
+
comboBoxShowSuggestions: "Show suggestions",
|
|
519
|
+
comboBoxLoading: "Searching\u2026",
|
|
520
|
+
datePickerOpenCalendar: "Open calendar",
|
|
521
|
+
datePickerPreviousMonth: "Previous month",
|
|
522
|
+
datePickerNextMonth: "Next month",
|
|
523
|
+
dateRangePresetsLabel: "Date range shortcuts",
|
|
524
|
+
numberFieldIncrease: "Increase",
|
|
525
|
+
numberFieldDecrease: "Decrease",
|
|
526
|
+
inputClear: "Clear",
|
|
527
|
+
valueHelpFieldPlaceholder: "Not selected",
|
|
528
|
+
valueHelpFieldClear: "Clear selection",
|
|
529
|
+
valueHelpFieldOpenNamed: "Select {label}",
|
|
530
|
+
valueHelpFieldOpen: "Open value help",
|
|
531
|
+
valueHelpDialogSearch: "Search records",
|
|
532
|
+
valueHelpDialogTitle: "Select a record",
|
|
533
|
+
valueHelpDialogSearchPlaceholder: "Search by ID or name",
|
|
534
|
+
valueHelpDialogEmpty: "No records found",
|
|
535
|
+
valueHelpDialogCancel: "Cancel",
|
|
536
|
+
paginationLabel: "Pagination",
|
|
537
|
+
paginationRange: "{from}\u2013{to} of {total}",
|
|
538
|
+
paginationPageOf: "Page {page} of {pages}",
|
|
539
|
+
paginationPrevious: "Previous page",
|
|
540
|
+
paginationNext: "Next page",
|
|
541
|
+
paginationRowsPerPage: "Rows per page",
|
|
542
|
+
sideNavLabel: "Main navigation",
|
|
543
|
+
shellRailLabel: "Applications",
|
|
544
|
+
appLauncherLabel: "All applications",
|
|
545
|
+
appLauncherTitle: "All applications",
|
|
546
|
+
appLauncherSearch: "Search for an application",
|
|
547
|
+
appLauncherEmpty: "No application matches that search.",
|
|
548
|
+
appLauncherLoading: "Loading applications\u2026",
|
|
549
|
+
splitPaneList: "List",
|
|
550
|
+
splitPaneDetail: "Detail",
|
|
551
|
+
splitPaneBack: "Back to list",
|
|
552
|
+
fileUploadChoose: "Choose files",
|
|
553
|
+
fileUploadRemoveNamed: "Remove {name}",
|
|
554
|
+
fileUploadUploading: "Uploading",
|
|
555
|
+
fileDropZonePrompt: "Drag files here, or choose them",
|
|
556
|
+
shellBarUserMenu: "Account menu for {user}",
|
|
557
|
+
commandPaletteLabel: "Command palette",
|
|
558
|
+
commandPaletteSearchLabel: "Search commands and records",
|
|
559
|
+
commandPalettePlaceholder: "Search for a screen, an action or a record\u2026",
|
|
560
|
+
commandPaletteEmpty: "Nothing matches that",
|
|
561
|
+
commandPaletteLoading: "Searching\u2026",
|
|
562
|
+
commandPaletteHintNavigate: "navigate",
|
|
563
|
+
commandPaletteHintSelect: "open",
|
|
564
|
+
commandPaletteHintClose: "close",
|
|
565
|
+
chartCategoryHeader: "Category",
|
|
566
|
+
chartNoValue: "No data",
|
|
567
|
+
chartEmpty: "No data for this period",
|
|
568
|
+
numPadClear: "Clear",
|
|
569
|
+
numPadBackspace: "Remove last digit",
|
|
570
|
+
viewSwitcherName: "Saved views: {view}",
|
|
571
|
+
viewSwitcherNameModified: "Saved views: {view}, modified",
|
|
572
|
+
viewSwitcherModifiedMark: "\xB7 modified",
|
|
573
|
+
quantityStepperIncrease: "Increase quantity",
|
|
574
|
+
quantityStepperDecrease: "Decrease quantity",
|
|
575
|
+
confirmDialogFactsLabel: "Summary",
|
|
576
|
+
valueHelpSelectAllCount: "Select all ({count})",
|
|
577
|
+
valueHelpClearSelection: "Clear selection",
|
|
578
|
+
valueHelpSelectedCount: "Selected: {count}",
|
|
579
|
+
valueHelpConfirm: "Apply selection",
|
|
580
|
+
tagRemoveNamed: "Remove {name}",
|
|
581
|
+
tagRemove: "Remove",
|
|
582
|
+
ribbonLabel: "Commands",
|
|
583
|
+
ribbonCollapse: "Collapse the ribbon",
|
|
584
|
+
ribbonExpand: "Expand the ribbon"
|
|
585
|
+
};
|
|
586
|
+
var esMessages = {
|
|
587
|
+
filterBarLabel: "Filtros",
|
|
588
|
+
filterBarGo: "Buscar",
|
|
589
|
+
filterBarClearAll: "Limpiar todo",
|
|
590
|
+
dataTableSelectAll: "Seleccionar todas las filas",
|
|
591
|
+
dataTableSelectRow: "Seleccionar fila",
|
|
592
|
+
dataTableSelectionColumn: "Selecci\xF3n",
|
|
593
|
+
dataTableLoading: "Cargando registros",
|
|
594
|
+
dataTableSummaryRow: "Resumen",
|
|
595
|
+
dataTableEmpty: "Ning\xFAn registro coincide con los filtros actuales.",
|
|
596
|
+
dialogClose: "Cerrar",
|
|
597
|
+
sidePanelClose: "Cerrar panel",
|
|
598
|
+
inlineMessageDismiss: "Descartar mensaje",
|
|
599
|
+
toastDismiss: "Descartar",
|
|
600
|
+
toastRegionLabel: "Notificaciones",
|
|
601
|
+
selectEmpty: "Sin opciones disponibles",
|
|
602
|
+
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
603
|
+
comboBoxLoading: "Buscando\u2026",
|
|
604
|
+
datePickerOpenCalendar: "Abrir calendario",
|
|
605
|
+
datePickerPreviousMonth: "Mes anterior",
|
|
606
|
+
datePickerNextMonth: "Mes siguiente",
|
|
607
|
+
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
608
|
+
numberFieldIncrease: "Aumentar",
|
|
609
|
+
numberFieldDecrease: "Disminuir",
|
|
610
|
+
inputClear: "Limpiar",
|
|
611
|
+
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
612
|
+
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
613
|
+
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
614
|
+
valueHelpFieldOpen: "Abrir ayuda de valores",
|
|
615
|
+
valueHelpDialogSearch: "Buscar registros",
|
|
616
|
+
valueHelpDialogTitle: "Seleccionar un registro",
|
|
617
|
+
valueHelpDialogSearchPlaceholder: "Buscar por c\xF3digo o nombre",
|
|
618
|
+
valueHelpDialogEmpty: "No se encontraron registros",
|
|
619
|
+
valueHelpDialogCancel: "Cancelar",
|
|
620
|
+
paginationLabel: "Paginaci\xF3n",
|
|
621
|
+
paginationRange: "{from}\u2013{to} de {total}",
|
|
622
|
+
paginationPageOf: "P\xE1gina {page} de {pages}",
|
|
623
|
+
paginationPrevious: "P\xE1gina anterior",
|
|
624
|
+
paginationNext: "P\xE1gina siguiente",
|
|
625
|
+
paginationRowsPerPage: "Filas por p\xE1gina",
|
|
626
|
+
sideNavLabel: "Navegaci\xF3n principal",
|
|
627
|
+
shellRailLabel: "Aplicaciones",
|
|
628
|
+
appLauncherLabel: "Todas las aplicaciones",
|
|
629
|
+
appLauncherTitle: "Todas las aplicaciones",
|
|
630
|
+
appLauncherSearch: "Busc\xE1 una aplicaci\xF3n",
|
|
631
|
+
appLauncherEmpty: "Ninguna aplicaci\xF3n coincide con esa b\xFAsqueda.",
|
|
632
|
+
appLauncherLoading: "Cargando aplicaciones\u2026",
|
|
633
|
+
splitPaneList: "Lista",
|
|
634
|
+
splitPaneDetail: "Detalle",
|
|
635
|
+
splitPaneBack: "Volver a la lista",
|
|
636
|
+
fileUploadChoose: "Elegir archivos",
|
|
637
|
+
fileUploadRemoveNamed: "Quitar {name}",
|
|
638
|
+
fileUploadUploading: "Subiendo",
|
|
639
|
+
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
640
|
+
shellBarUserMenu: "Men\xFA de cuenta de {user}",
|
|
641
|
+
commandPaletteLabel: "Paleta de comandos",
|
|
642
|
+
commandPaletteSearchLabel: "Buscar comandos y registros",
|
|
643
|
+
commandPalettePlaceholder: "Busc\xE1 una pantalla, una acci\xF3n o un registro\u2026",
|
|
644
|
+
commandPaletteEmpty: "No hay coincidencias",
|
|
645
|
+
commandPaletteLoading: "Buscando\u2026",
|
|
646
|
+
commandPaletteHintNavigate: "navegar",
|
|
647
|
+
commandPaletteHintSelect: "abrir",
|
|
648
|
+
commandPaletteHintClose: "cerrar",
|
|
649
|
+
chartCategoryHeader: "Categor\xEDa",
|
|
650
|
+
chartNoValue: "Sin datos",
|
|
651
|
+
chartEmpty: "Sin datos para este per\xEDodo",
|
|
652
|
+
numPadClear: "Limpiar",
|
|
653
|
+
numPadBackspace: "Borrar \xFAltimo d\xEDgito",
|
|
654
|
+
viewSwitcherName: "Vistas guardadas: {view}",
|
|
655
|
+
viewSwitcherNameModified: "Vistas guardadas: {view}, modificada",
|
|
656
|
+
viewSwitcherModifiedMark: "\xB7 modificada",
|
|
657
|
+
quantityStepperIncrease: "Aumentar cantidad",
|
|
658
|
+
quantityStepperDecrease: "Disminuir cantidad",
|
|
659
|
+
confirmDialogFactsLabel: "Resumen",
|
|
660
|
+
valueHelpSelectAllCount: "Seleccionar todo ({count})",
|
|
661
|
+
valueHelpClearSelection: "Limpiar selecci\xF3n",
|
|
662
|
+
valueHelpSelectedCount: "Seleccionadas: {count}",
|
|
663
|
+
valueHelpConfirm: "Aplicar selecci\xF3n",
|
|
664
|
+
tagRemoveNamed: "Quitar {name}",
|
|
665
|
+
tagRemove: "Quitar",
|
|
666
|
+
ribbonLabel: "Comandos",
|
|
667
|
+
ribbonCollapse: "Contraer la cinta",
|
|
668
|
+
ribbonExpand: "Expandir la cinta"
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
// src/i18n/PireIntlProvider.tsx
|
|
672
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
673
|
+
var MessagesContext = React5.createContext(enMessages);
|
|
674
|
+
function PireIntlProvider({ messages, children }) {
|
|
675
|
+
const value = React5.useMemo(
|
|
676
|
+
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
677
|
+
[messages]
|
|
678
|
+
);
|
|
679
|
+
return /* @__PURE__ */ jsx6(MessagesContext.Provider, { value, children });
|
|
680
|
+
}
|
|
681
|
+
function usePireMessages() {
|
|
682
|
+
return React5.useContext(MessagesContext);
|
|
683
|
+
}
|
|
684
|
+
function useMessage(key, override) {
|
|
685
|
+
const messages = React5.useContext(MessagesContext);
|
|
686
|
+
return override ?? messages[key];
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// src/components/core/Tag.tsx
|
|
690
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
691
|
+
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
692
|
+
const msg = usePireMessages();
|
|
490
693
|
return /* @__PURE__ */ jsxs5("span", { ref, className: cx("pire-tag", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
491
|
-
category ? /* @__PURE__ */
|
|
694
|
+
category ? /* @__PURE__ */ jsx7("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
492
695
|
children,
|
|
493
|
-
onRemove ? /* @__PURE__ */
|
|
696
|
+
onRemove ? /* @__PURE__ */ jsx7(
|
|
494
697
|
AriaButton3,
|
|
495
698
|
{
|
|
496
699
|
className: "pire-tag-remove",
|
|
497
700
|
isDisabled,
|
|
498
701
|
onPress: onRemove,
|
|
499
|
-
"aria-label":
|
|
500
|
-
children: /* @__PURE__ */
|
|
702
|
+
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
703
|
+
children: /* @__PURE__ */ jsx7(Icon, { name: "x", size: 12 })
|
|
501
704
|
}
|
|
502
705
|
) : null
|
|
503
706
|
] });
|
|
504
707
|
});
|
|
505
708
|
|
|
506
709
|
// src/components/core/Card.tsx
|
|
507
|
-
import { jsx as
|
|
710
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
508
711
|
function Card({ title, subtitle, icon, actions, footer, interactive, children, className, ...rest }) {
|
|
509
712
|
return /* @__PURE__ */ jsxs6("section", { className: cx("pire-card", className), "data-interactive": interactive ? "true" : void 0, ...rest, children: [
|
|
510
713
|
title || actions ? /* @__PURE__ */ jsxs6("header", { className: "pire-card-head", children: [
|
|
511
|
-
icon ? /* @__PURE__ */
|
|
714
|
+
icon ? /* @__PURE__ */ jsx8(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
512
715
|
/* @__PURE__ */ jsxs6("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
subtitle ? /* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ jsx8("h3", { className: "pire-card-title", children: title }),
|
|
717
|
+
subtitle ? /* @__PURE__ */ jsx8("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
515
718
|
] }),
|
|
516
|
-
actions ? /* @__PURE__ */
|
|
719
|
+
actions ? /* @__PURE__ */ jsx8("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
517
720
|
] }) : null,
|
|
518
|
-
children ? /* @__PURE__ */
|
|
519
|
-
footer ? /* @__PURE__ */
|
|
721
|
+
children ? /* @__PURE__ */ jsx8("div", { className: "pire-card-body", children }) : null,
|
|
722
|
+
footer ? /* @__PURE__ */ jsx8("footer", { className: "pire-card-foot", children: footer }) : null
|
|
520
723
|
] });
|
|
521
724
|
}
|
|
522
725
|
|
|
523
726
|
// src/components/core/Avatar.tsx
|
|
524
|
-
import * as
|
|
525
|
-
import { jsx as
|
|
727
|
+
import * as React7 from "react";
|
|
728
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
526
729
|
var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
527
730
|
function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
528
|
-
const [failed, setFailed] =
|
|
529
|
-
return /* @__PURE__ */
|
|
731
|
+
const [failed, setFailed] = React7.useState(false);
|
|
732
|
+
return /* @__PURE__ */ jsx9("span", { className: cx("pire-avatar", className), "data-size": size, role: "img", "aria-label": name, ...rest, children: src && !failed ? /* @__PURE__ */ jsx9(
|
|
530
733
|
"img",
|
|
531
734
|
{
|
|
532
735
|
src,
|
|
@@ -538,9 +741,9 @@ function Avatar({ name, size = "md", src, className, ...rest }) {
|
|
|
538
741
|
}
|
|
539
742
|
|
|
540
743
|
// src/components/core/SegmentedControl.tsx
|
|
541
|
-
import * as
|
|
744
|
+
import * as React8 from "react";
|
|
542
745
|
import { ToggleButtonGroup, ToggleButton } from "react-aria-components";
|
|
543
|
-
import { jsx as
|
|
746
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
544
747
|
function SegmentedControl({
|
|
545
748
|
options,
|
|
546
749
|
value,
|
|
@@ -552,8 +755,8 @@ function SegmentedControl({
|
|
|
552
755
|
style,
|
|
553
756
|
...rest
|
|
554
757
|
}) {
|
|
555
|
-
const selected =
|
|
556
|
-
return /* @__PURE__ */
|
|
758
|
+
const selected = React8.useMemo(() => new Set(value ? [value] : defaultValue ? [defaultValue] : []), [value, defaultValue]);
|
|
759
|
+
return /* @__PURE__ */ jsx10(
|
|
557
760
|
ToggleButtonGroup,
|
|
558
761
|
{
|
|
559
762
|
className: cx("pire-segmented", className),
|
|
@@ -575,7 +778,7 @@ function SegmentedControl({
|
|
|
575
778
|
isDisabled: option.isDisabled,
|
|
576
779
|
"aria-label": iconOnly ? option.label : void 0,
|
|
577
780
|
children: [
|
|
578
|
-
option.icon ? /* @__PURE__ */
|
|
781
|
+
option.icon ? /* @__PURE__ */ jsx10(Icon, { name: option.icon, size: 16 }) : null,
|
|
579
782
|
iconOnly ? null : option.label
|
|
580
783
|
]
|
|
581
784
|
},
|
|
@@ -586,9 +789,9 @@ function SegmentedControl({
|
|
|
586
789
|
}
|
|
587
790
|
|
|
588
791
|
// src/components/core/Text.tsx
|
|
589
|
-
import * as
|
|
590
|
-
import { jsx as
|
|
591
|
-
var Text =
|
|
792
|
+
import * as React9 from "react";
|
|
793
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
794
|
+
var Text = React9.forwardRef(function Text2({
|
|
592
795
|
size = "body",
|
|
593
796
|
color = "primary",
|
|
594
797
|
weight = "regular",
|
|
@@ -602,7 +805,7 @@ var Text = React8.forwardRef(function Text2({
|
|
|
602
805
|
}, ref) {
|
|
603
806
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
604
807
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
605
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ jsx11(
|
|
606
809
|
Wrapper,
|
|
607
810
|
{
|
|
608
811
|
ref,
|
|
@@ -618,13 +821,13 @@ var Text = React8.forwardRef(function Text2({
|
|
|
618
821
|
}
|
|
619
822
|
);
|
|
620
823
|
});
|
|
621
|
-
var Strong =
|
|
622
|
-
return /* @__PURE__ */
|
|
824
|
+
var Strong = React9.forwardRef(function Strong2({ className, ...rest }, ref) {
|
|
825
|
+
return /* @__PURE__ */ jsx11(Text, { ref, elementType: "span", weight: "strong", className, ...rest });
|
|
623
826
|
});
|
|
624
827
|
|
|
625
828
|
// src/components/core/Heading.tsx
|
|
626
829
|
import { Heading as AriaHeading } from "react-aria-components";
|
|
627
|
-
import { jsx as
|
|
830
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
628
831
|
function Heading({
|
|
629
832
|
level = 2,
|
|
630
833
|
size,
|
|
@@ -636,7 +839,7 @@ function Heading({
|
|
|
636
839
|
}) {
|
|
637
840
|
const lineClamp = typeof truncate === "number" ? truncate : truncate ? 1 : void 0;
|
|
638
841
|
const clampStyle = lineClamp == null ? style : { ["--pire-text-clamp"]: lineClamp, ...style };
|
|
639
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ jsx12(
|
|
640
843
|
AriaHeading,
|
|
641
844
|
{
|
|
642
845
|
level,
|
|
@@ -652,7 +855,7 @@ function Heading({
|
|
|
652
855
|
|
|
653
856
|
// src/components/core/Link.tsx
|
|
654
857
|
import { Link as AriaLink } from "react-aria-components";
|
|
655
|
-
import { jsx as
|
|
858
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
656
859
|
function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
657
860
|
return /* @__PURE__ */ jsxs8(
|
|
658
861
|
AriaLink,
|
|
@@ -664,7 +867,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
664
867
|
...rest,
|
|
665
868
|
children: [
|
|
666
869
|
children,
|
|
667
|
-
isExternal ? /* @__PURE__ */
|
|
870
|
+
isExternal ? /* @__PURE__ */ jsx13(Icon, { name: "external-link", size: 12, className: "pire-link-external" }) : null
|
|
668
871
|
]
|
|
669
872
|
}
|
|
670
873
|
);
|
|
@@ -672,7 +875,7 @@ function Link({ children, size, isExternal, className, rel, ...rest }) {
|
|
|
672
875
|
|
|
673
876
|
// src/components/core/Separator.tsx
|
|
674
877
|
import { Separator as AriaSeparator } from "react-aria-components";
|
|
675
|
-
import { jsx as
|
|
878
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
676
879
|
function Separator({
|
|
677
880
|
orientation = "horizontal",
|
|
678
881
|
emphasis = "default",
|
|
@@ -680,7 +883,7 @@ function Separator({
|
|
|
680
883
|
className,
|
|
681
884
|
...rest
|
|
682
885
|
}) {
|
|
683
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ jsx14(
|
|
684
887
|
AriaSeparator,
|
|
685
888
|
{
|
|
686
889
|
orientation,
|
|
@@ -694,24 +897,24 @@ function Separator({
|
|
|
694
897
|
}
|
|
695
898
|
|
|
696
899
|
// src/components/core/Kbd.tsx
|
|
697
|
-
import { jsx as
|
|
900
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
698
901
|
function Kbd({ children, size = "md", className, ...rest }) {
|
|
699
|
-
return /* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ jsx15("kbd", { className: cx("pire-kbd", className), "data-size": size, ...rest, children });
|
|
700
903
|
}
|
|
701
904
|
|
|
702
905
|
// src/components/forms/FormField.tsx
|
|
703
|
-
import { jsx as
|
|
906
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
704
907
|
function FormField({ label, htmlFor, isRequired, hint, error, layout = "stacked", children, className, ...rest }) {
|
|
705
908
|
return /* @__PURE__ */ jsxs9("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
706
909
|
/* @__PURE__ */ jsxs9("label", { className: "pire-field-label", htmlFor, children: [
|
|
707
910
|
label,
|
|
708
|
-
isRequired ? /* @__PURE__ */
|
|
911
|
+
isRequired ? /* @__PURE__ */ jsx16("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
709
912
|
] }),
|
|
710
913
|
children,
|
|
711
914
|
error ? /* @__PURE__ */ jsxs9("span", { className: "pire-field-error", role: "alert", children: [
|
|
712
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx16(Icon, { name: "alert-circle", size: 12 }),
|
|
713
916
|
error
|
|
714
|
-
] }) : hint ? /* @__PURE__ */
|
|
917
|
+
] }) : hint ? /* @__PURE__ */ jsx16("span", { className: "pire-field-hint", children: hint }) : null
|
|
715
918
|
] });
|
|
716
919
|
}
|
|
717
920
|
|
|
@@ -727,165 +930,6 @@ import {
|
|
|
727
930
|
Button as AriaButton4
|
|
728
931
|
} from "react-aria-components";
|
|
729
932
|
|
|
730
|
-
// src/i18n/PireIntlProvider.tsx
|
|
731
|
-
import * as React9 from "react";
|
|
732
|
-
|
|
733
|
-
// src/i18n/messages.ts
|
|
734
|
-
var enMessages = {
|
|
735
|
-
filterBarLabel: "Filters",
|
|
736
|
-
filterBarGo: "Go",
|
|
737
|
-
filterBarClearAll: "Clear all",
|
|
738
|
-
dataTableSelectAll: "Select all rows",
|
|
739
|
-
dataTableSelectRow: "Select row",
|
|
740
|
-
dataTableLoading: "Loading records",
|
|
741
|
-
dataTableSummaryRow: "Summary",
|
|
742
|
-
dataTableEmpty: "No records match the current filters.",
|
|
743
|
-
dialogClose: "Close",
|
|
744
|
-
sidePanelClose: "Close panel",
|
|
745
|
-
inlineMessageDismiss: "Dismiss message",
|
|
746
|
-
toastDismiss: "Dismiss",
|
|
747
|
-
toastRegionLabel: "Notifications",
|
|
748
|
-
selectEmpty: "No options available",
|
|
749
|
-
comboBoxShowSuggestions: "Show suggestions",
|
|
750
|
-
comboBoxLoading: "Searching\u2026",
|
|
751
|
-
datePickerOpenCalendar: "Open calendar",
|
|
752
|
-
datePickerPreviousMonth: "Previous month",
|
|
753
|
-
datePickerNextMonth: "Next month",
|
|
754
|
-
dateRangePresetsLabel: "Date range shortcuts",
|
|
755
|
-
numberFieldIncrease: "Increase",
|
|
756
|
-
numberFieldDecrease: "Decrease",
|
|
757
|
-
inputClear: "Clear",
|
|
758
|
-
valueHelpFieldPlaceholder: "Not selected",
|
|
759
|
-
valueHelpFieldClear: "Clear selection",
|
|
760
|
-
valueHelpFieldOpenNamed: "Select {label}",
|
|
761
|
-
valueHelpFieldOpen: "Open value help",
|
|
762
|
-
valueHelpDialogSearch: "Search records",
|
|
763
|
-
valueHelpDialogTitle: "Select a record",
|
|
764
|
-
valueHelpDialogSearchPlaceholder: "Search by ID or name",
|
|
765
|
-
valueHelpDialogEmpty: "No records found",
|
|
766
|
-
valueHelpDialogCancel: "Cancel",
|
|
767
|
-
paginationLabel: "Pagination",
|
|
768
|
-
paginationRange: "{from}\u2013{to} of {total}",
|
|
769
|
-
paginationPageOf: "Page {page} of {pages}",
|
|
770
|
-
paginationPrevious: "Previous page",
|
|
771
|
-
paginationNext: "Next page",
|
|
772
|
-
paginationRowsPerPage: "Rows per page",
|
|
773
|
-
sideNavLabel: "Main navigation",
|
|
774
|
-
shellRailLabel: "Applications",
|
|
775
|
-
appLauncherLabel: "All applications",
|
|
776
|
-
appLauncherTitle: "All applications",
|
|
777
|
-
appLauncherSearch: "Search for an application",
|
|
778
|
-
appLauncherEmpty: "No application matches that search.",
|
|
779
|
-
appLauncherLoading: "Loading applications\u2026",
|
|
780
|
-
splitPaneList: "List",
|
|
781
|
-
splitPaneDetail: "Detail",
|
|
782
|
-
splitPaneBack: "Back to list",
|
|
783
|
-
fileUploadChoose: "Choose files",
|
|
784
|
-
fileUploadRemoveNamed: "Remove {name}",
|
|
785
|
-
fileUploadUploading: "Uploading",
|
|
786
|
-
fileDropZonePrompt: "Drag files here, or choose them",
|
|
787
|
-
shellBarUserMenu: "Account menu for {user}",
|
|
788
|
-
commandPaletteLabel: "Command palette",
|
|
789
|
-
commandPaletteSearchLabel: "Search commands and records",
|
|
790
|
-
commandPalettePlaceholder: "Search for a screen, an action or a record\u2026",
|
|
791
|
-
commandPaletteEmpty: "Nothing matches that",
|
|
792
|
-
commandPaletteLoading: "Searching\u2026",
|
|
793
|
-
commandPaletteHintNavigate: "navigate",
|
|
794
|
-
commandPaletteHintSelect: "open",
|
|
795
|
-
commandPaletteHintClose: "close",
|
|
796
|
-
chartCategoryHeader: "Category",
|
|
797
|
-
chartNoValue: "No data",
|
|
798
|
-
chartEmpty: "No data for this period",
|
|
799
|
-
numPadClear: "Clear",
|
|
800
|
-
numPadBackspace: "Remove last digit"
|
|
801
|
-
};
|
|
802
|
-
var esMessages = {
|
|
803
|
-
filterBarLabel: "Filtros",
|
|
804
|
-
filterBarGo: "Buscar",
|
|
805
|
-
filterBarClearAll: "Limpiar todo",
|
|
806
|
-
dataTableSelectAll: "Seleccionar todas las filas",
|
|
807
|
-
dataTableSelectRow: "Seleccionar fila",
|
|
808
|
-
dataTableLoading: "Cargando registros",
|
|
809
|
-
dataTableSummaryRow: "Resumen",
|
|
810
|
-
dataTableEmpty: "Ning\xFAn registro coincide con los filtros actuales.",
|
|
811
|
-
dialogClose: "Cerrar",
|
|
812
|
-
sidePanelClose: "Cerrar panel",
|
|
813
|
-
inlineMessageDismiss: "Descartar mensaje",
|
|
814
|
-
toastDismiss: "Descartar",
|
|
815
|
-
toastRegionLabel: "Notificaciones",
|
|
816
|
-
selectEmpty: "Sin opciones disponibles",
|
|
817
|
-
comboBoxShowSuggestions: "Mostrar sugerencias",
|
|
818
|
-
comboBoxLoading: "Buscando\u2026",
|
|
819
|
-
datePickerOpenCalendar: "Abrir calendario",
|
|
820
|
-
datePickerPreviousMonth: "Mes anterior",
|
|
821
|
-
datePickerNextMonth: "Mes siguiente",
|
|
822
|
-
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
823
|
-
numberFieldIncrease: "Aumentar",
|
|
824
|
-
numberFieldDecrease: "Disminuir",
|
|
825
|
-
inputClear: "Limpiar",
|
|
826
|
-
valueHelpFieldPlaceholder: "Sin seleccionar",
|
|
827
|
-
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
828
|
-
valueHelpFieldOpenNamed: "Seleccionar {label}",
|
|
829
|
-
valueHelpFieldOpen: "Abrir ayuda de valores",
|
|
830
|
-
valueHelpDialogSearch: "Buscar registros",
|
|
831
|
-
valueHelpDialogTitle: "Seleccionar un registro",
|
|
832
|
-
valueHelpDialogSearchPlaceholder: "Buscar por c\xF3digo o nombre",
|
|
833
|
-
valueHelpDialogEmpty: "No se encontraron registros",
|
|
834
|
-
valueHelpDialogCancel: "Cancelar",
|
|
835
|
-
paginationLabel: "Paginaci\xF3n",
|
|
836
|
-
paginationRange: "{from}\u2013{to} de {total}",
|
|
837
|
-
paginationPageOf: "P\xE1gina {page} de {pages}",
|
|
838
|
-
paginationPrevious: "P\xE1gina anterior",
|
|
839
|
-
paginationNext: "P\xE1gina siguiente",
|
|
840
|
-
paginationRowsPerPage: "Filas por p\xE1gina",
|
|
841
|
-
sideNavLabel: "Navegaci\xF3n principal",
|
|
842
|
-
shellRailLabel: "Aplicaciones",
|
|
843
|
-
appLauncherLabel: "Todas las aplicaciones",
|
|
844
|
-
appLauncherTitle: "Todas las aplicaciones",
|
|
845
|
-
appLauncherSearch: "Busc\xE1 una aplicaci\xF3n",
|
|
846
|
-
appLauncherEmpty: "Ninguna aplicaci\xF3n coincide con esa b\xFAsqueda.",
|
|
847
|
-
appLauncherLoading: "Cargando aplicaciones\u2026",
|
|
848
|
-
splitPaneList: "Lista",
|
|
849
|
-
splitPaneDetail: "Detalle",
|
|
850
|
-
splitPaneBack: "Volver a la lista",
|
|
851
|
-
fileUploadChoose: "Elegir archivos",
|
|
852
|
-
fileUploadRemoveNamed: "Quitar {name}",
|
|
853
|
-
fileUploadUploading: "Subiendo",
|
|
854
|
-
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
855
|
-
shellBarUserMenu: "Men\xFA de cuenta de {user}",
|
|
856
|
-
commandPaletteLabel: "Paleta de comandos",
|
|
857
|
-
commandPaletteSearchLabel: "Buscar comandos y registros",
|
|
858
|
-
commandPalettePlaceholder: "Busc\xE1 una pantalla, una acci\xF3n o un registro\u2026",
|
|
859
|
-
commandPaletteEmpty: "No hay coincidencias",
|
|
860
|
-
commandPaletteLoading: "Buscando\u2026",
|
|
861
|
-
commandPaletteHintNavigate: "navegar",
|
|
862
|
-
commandPaletteHintSelect: "abrir",
|
|
863
|
-
commandPaletteHintClose: "cerrar",
|
|
864
|
-
chartCategoryHeader: "Categor\xEDa",
|
|
865
|
-
chartNoValue: "Sin datos",
|
|
866
|
-
chartEmpty: "Sin datos para este per\xEDodo",
|
|
867
|
-
numPadClear: "Limpiar",
|
|
868
|
-
numPadBackspace: "Borrar \xFAltimo d\xEDgito"
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
// src/i18n/PireIntlProvider.tsx
|
|
872
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
873
|
-
var MessagesContext = React9.createContext(enMessages);
|
|
874
|
-
function PireIntlProvider({ messages, children }) {
|
|
875
|
-
const value = React9.useMemo(
|
|
876
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
877
|
-
[messages]
|
|
878
|
-
);
|
|
879
|
-
return /* @__PURE__ */ jsx16(MessagesContext.Provider, { value, children });
|
|
880
|
-
}
|
|
881
|
-
function usePireMessages() {
|
|
882
|
-
return React9.useContext(MessagesContext);
|
|
883
|
-
}
|
|
884
|
-
function useMessage(key, override) {
|
|
885
|
-
const messages = React9.useContext(MessagesContext);
|
|
886
|
-
return override ?? messages[key];
|
|
887
|
-
}
|
|
888
|
-
|
|
889
933
|
// src/components/utils/focusField.ts
|
|
890
934
|
function focusFieldOf(button) {
|
|
891
935
|
const control = button?.closest?.(".pire-control");
|
|
@@ -1182,21 +1226,69 @@ function Switch({ label, children, className, ...rest }) {
|
|
|
1182
1226
|
] });
|
|
1183
1227
|
}
|
|
1184
1228
|
|
|
1229
|
+
// src/components/forms/ChoiceCardGroup.tsx
|
|
1230
|
+
import { RadioGroup as AriaRadioGroup2, Radio as AriaRadio2, Label as Label5, Text as Text7, FieldError as FieldError5 } from "react-aria-components";
|
|
1231
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1232
|
+
function ChoiceCardGroup({
|
|
1233
|
+
label,
|
|
1234
|
+
description,
|
|
1235
|
+
errorMessage,
|
|
1236
|
+
options,
|
|
1237
|
+
value,
|
|
1238
|
+
defaultValue,
|
|
1239
|
+
onChange,
|
|
1240
|
+
columns = 2,
|
|
1241
|
+
isDisabled,
|
|
1242
|
+
isRequired,
|
|
1243
|
+
className,
|
|
1244
|
+
style,
|
|
1245
|
+
...rest
|
|
1246
|
+
}) {
|
|
1247
|
+
return /* @__PURE__ */ jsxs16(
|
|
1248
|
+
AriaRadioGroup2,
|
|
1249
|
+
{
|
|
1250
|
+
className: cx("pire-field", className),
|
|
1251
|
+
style,
|
|
1252
|
+
validationBehavior: "aria",
|
|
1253
|
+
"aria-label": label ? void 0 : rest["aria-label"],
|
|
1254
|
+
value,
|
|
1255
|
+
defaultValue,
|
|
1256
|
+
onChange,
|
|
1257
|
+
isDisabled,
|
|
1258
|
+
isRequired,
|
|
1259
|
+
children: [
|
|
1260
|
+
label ? /* @__PURE__ */ jsxs16(Label5, { className: "pire-field-label", children: [
|
|
1261
|
+
label,
|
|
1262
|
+
isRequired ? /* @__PURE__ */ jsx23("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1263
|
+
] }) : null,
|
|
1264
|
+
/* @__PURE__ */ jsx23("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ jsxs16(AriaRadio2, { value: option.id, className: "pire-choicecard", isDisabled: option.isDisabled, children: [
|
|
1265
|
+
option.icon ? /* @__PURE__ */ jsx23(Icon, { name: option.icon, size: 20 }) : null,
|
|
1266
|
+
/* @__PURE__ */ jsx23("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1267
|
+
option.description ? /* @__PURE__ */ jsx23("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1268
|
+
option.preview ? /* @__PURE__ */ jsx23("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1269
|
+
] }, option.id)) }),
|
|
1270
|
+
description ? /* @__PURE__ */ jsx23(Text7, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1271
|
+
/* @__PURE__ */ jsx23(FieldError5, { className: "pire-field-error", children: errorMessage })
|
|
1272
|
+
]
|
|
1273
|
+
}
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1185
1277
|
// src/components/forms/ComboBox.tsx
|
|
1186
1278
|
import * as React12 from "react";
|
|
1187
1279
|
import {
|
|
1188
1280
|
ComboBox as AriaComboBox,
|
|
1189
|
-
Label as
|
|
1281
|
+
Label as Label6,
|
|
1190
1282
|
Input as AriaInput2,
|
|
1191
1283
|
Button as AriaButton6,
|
|
1192
1284
|
Group as Group3,
|
|
1193
1285
|
Popover as Popover2,
|
|
1194
1286
|
ListBox as ListBox2,
|
|
1195
1287
|
ListBoxItem as ListBoxItem2,
|
|
1196
|
-
Text as
|
|
1197
|
-
FieldError as
|
|
1288
|
+
Text as Text8,
|
|
1289
|
+
FieldError as FieldError6
|
|
1198
1290
|
} from "react-aria-components";
|
|
1199
|
-
import { jsx as
|
|
1291
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1200
1292
|
var norm2 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1201
1293
|
function ComboBox({
|
|
1202
1294
|
label,
|
|
@@ -1242,7 +1334,7 @@ function ComboBox({
|
|
|
1242
1334
|
};
|
|
1243
1335
|
const collection = isFilteredExternally ? { items } : { defaultItems: items };
|
|
1244
1336
|
const showsStatus = isLoading || isFilteredExternally && items.length === 0 && emptyLabel != null;
|
|
1245
|
-
return /* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ jsxs17(
|
|
1246
1338
|
AriaComboBox,
|
|
1247
1339
|
{
|
|
1248
1340
|
className: cx("pire-field", className),
|
|
@@ -1263,11 +1355,11 @@ function ComboBox({
|
|
|
1263
1355
|
validationBehavior: "aria",
|
|
1264
1356
|
...rest,
|
|
1265
1357
|
children: [
|
|
1266
|
-
label ? /* @__PURE__ */
|
|
1358
|
+
label ? /* @__PURE__ */ jsxs17(Label6, { className: "pire-field-label", children: [
|
|
1267
1359
|
label,
|
|
1268
|
-
rest.isRequired ? /* @__PURE__ */
|
|
1360
|
+
rest.isRequired ? /* @__PURE__ */ jsx24("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1269
1361
|
] }) : null,
|
|
1270
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsxs17(
|
|
1271
1363
|
Group3,
|
|
1272
1364
|
{
|
|
1273
1365
|
className: "pire-control",
|
|
@@ -1275,9 +1367,9 @@ function ComboBox({
|
|
|
1275
1367
|
"data-full-width": String(fullWidth),
|
|
1276
1368
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1277
1369
|
children: [
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
showsClear ? /* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ jsx24(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1371
|
+
/* @__PURE__ */ jsx24(AriaInput2, { className: "pire-input", placeholder: rest.placeholder }),
|
|
1372
|
+
showsClear ? /* @__PURE__ */ jsx24(
|
|
1281
1373
|
AriaButton6,
|
|
1282
1374
|
{
|
|
1283
1375
|
className: "pire-input-clear",
|
|
@@ -1289,13 +1381,13 @@ function ComboBox({
|
|
|
1289
1381
|
children: clearLabel ?? msg.inputClear
|
|
1290
1382
|
}
|
|
1291
1383
|
) : null,
|
|
1292
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ jsx24(AriaButton6, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.comboBoxShowSuggestions, style: { width: 20, height: 20 }, children: /* @__PURE__ */ jsx24(Icon, { name: "chevron-down", size: 16 }) })
|
|
1293
1385
|
]
|
|
1294
1386
|
}
|
|
1295
1387
|
),
|
|
1296
|
-
description ? /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1388
|
+
description ? /* @__PURE__ */ jsx24(Text8, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1389
|
+
/* @__PURE__ */ jsx24(FieldError6, { className: "pire-field-error", children: errorMessage }),
|
|
1390
|
+
/* @__PURE__ */ jsx24(Popover2, { className: "pire-popover", children: /* @__PURE__ */ jsx24(
|
|
1299
1391
|
ListBox2,
|
|
1300
1392
|
{
|
|
1301
1393
|
className: "pire-listbox",
|
|
@@ -1303,10 +1395,10 @@ function ComboBox({
|
|
|
1303
1395
|
const el = e.currentTarget;
|
|
1304
1396
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1305
1397
|
} : void 0,
|
|
1306
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1307
|
-
children: (item) => /* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
item.secondary ? /* @__PURE__ */
|
|
1398
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx24("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1399
|
+
children: (item) => /* @__PURE__ */ jsxs17(ListBoxItem2, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
1400
|
+
/* @__PURE__ */ jsx24("span", { className: "pire-option-label", children: item.label }),
|
|
1401
|
+
item.secondary ? /* @__PURE__ */ jsx24("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1310
1402
|
] })
|
|
1311
1403
|
}
|
|
1312
1404
|
) })
|
|
@@ -1319,7 +1411,7 @@ function ComboBox({
|
|
|
1319
1411
|
import * as React13 from "react";
|
|
1320
1412
|
import {
|
|
1321
1413
|
ComboBox as AriaComboBox2,
|
|
1322
|
-
Label as
|
|
1414
|
+
Label as Label7,
|
|
1323
1415
|
Input as AriaInput3,
|
|
1324
1416
|
Button as AriaButton7,
|
|
1325
1417
|
ButtonContext,
|
|
@@ -1327,11 +1419,11 @@ import {
|
|
|
1327
1419
|
Popover as Popover3,
|
|
1328
1420
|
ListBox as ListBox3,
|
|
1329
1421
|
ListBoxItem as ListBoxItem3,
|
|
1330
|
-
Text as
|
|
1331
|
-
FieldError as
|
|
1422
|
+
Text as Text9,
|
|
1423
|
+
FieldError as FieldError7,
|
|
1332
1424
|
VisuallyHidden
|
|
1333
1425
|
} from "react-aria-components";
|
|
1334
|
-
import { jsx as
|
|
1426
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1335
1427
|
var norm3 = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
1336
1428
|
function MultiComboBox({
|
|
1337
1429
|
label,
|
|
@@ -1396,7 +1488,7 @@ function MultiComboBox({
|
|
|
1396
1488
|
e.stopPropagation();
|
|
1397
1489
|
if (!values.includes(next)) commit([...values, next]);
|
|
1398
1490
|
};
|
|
1399
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ jsxs18(
|
|
1400
1492
|
AriaComboBox2,
|
|
1401
1493
|
{
|
|
1402
1494
|
className: cx("pire-field", className),
|
|
@@ -1413,11 +1505,11 @@ function MultiComboBox({
|
|
|
1413
1505
|
validationBehavior: "aria",
|
|
1414
1506
|
...rest,
|
|
1415
1507
|
children: [
|
|
1416
|
-
label ? /* @__PURE__ */
|
|
1508
|
+
label ? /* @__PURE__ */ jsxs18(Label7, { className: "pire-field-label", children: [
|
|
1417
1509
|
label,
|
|
1418
|
-
rest.isRequired ? /* @__PURE__ */
|
|
1510
|
+
rest.isRequired ? /* @__PURE__ */ jsx25("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1419
1511
|
] }) : null,
|
|
1420
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ jsxs18(
|
|
1421
1513
|
Group4,
|
|
1422
1514
|
{
|
|
1423
1515
|
className: "pire-control",
|
|
@@ -1427,14 +1519,14 @@ function MultiComboBox({
|
|
|
1427
1519
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1428
1520
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1429
1521
|
children: [
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ jsx25(Icon, { name: "search", size: 16, className: "pire-leading-icon" }),
|
|
1523
|
+
/* @__PURE__ */ jsxs18("div", { className: "pire-chipfield", children: [
|
|
1524
|
+
/* @__PURE__ */ jsx25(ButtonContext.Provider, { value: null, children: values.map((v) => (
|
|
1433
1525
|
/* Disabled follows the field, not `isEditable`: a read-only field's chips are
|
|
1434
1526
|
real, current values and should read as such — they simply lose the × . */
|
|
1435
|
-
/* @__PURE__ */
|
|
1527
|
+
/* @__PURE__ */ jsx25(Tag, { isDisabled: rest.isDisabled, onRemove: isEditable ? () => remove(v) : void 0, children: labelOf(v) }, v)
|
|
1436
1528
|
)) }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ jsx25(
|
|
1438
1530
|
AriaInput3,
|
|
1439
1531
|
{
|
|
1440
1532
|
ref: inputRef,
|
|
@@ -1444,14 +1536,14 @@ function MultiComboBox({
|
|
|
1444
1536
|
}
|
|
1445
1537
|
)
|
|
1446
1538
|
] }),
|
|
1447
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsx25(AriaButton7, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.comboBoxShowSuggestions, style: { width: 20, height: 20 }, children: /* @__PURE__ */ jsx25(Icon, { name: "chevron-down", size: 16 }) })
|
|
1448
1540
|
]
|
|
1449
1541
|
}
|
|
1450
1542
|
),
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
description ? /* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ jsx25(VisuallyHidden, { children: /* @__PURE__ */ jsx25("span", { "aria-live": "polite", children: announcement }) }),
|
|
1544
|
+
description ? /* @__PURE__ */ jsx25(Text9, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1545
|
+
/* @__PURE__ */ jsx25(FieldError7, { className: "pire-field-error", children: errorMessage }),
|
|
1546
|
+
/* @__PURE__ */ jsx25(Popover3, { className: "pire-popover", children: /* @__PURE__ */ jsx25(
|
|
1455
1547
|
ListBox3,
|
|
1456
1548
|
{
|
|
1457
1549
|
className: "pire-listbox",
|
|
@@ -1459,10 +1551,10 @@ function MultiComboBox({
|
|
|
1459
1551
|
const el = e.currentTarget;
|
|
1460
1552
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1461
1553
|
} : void 0,
|
|
1462
|
-
renderEmptyState: showsStatus ? () => /* @__PURE__ */
|
|
1463
|
-
children: (item) => /* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
item.secondary ? /* @__PURE__ */
|
|
1554
|
+
renderEmptyState: showsStatus ? () => /* @__PURE__ */ jsx25("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1555
|
+
children: (item) => /* @__PURE__ */ jsxs18(ListBoxItem3, { className: "pire-option", id: item.value, textValue: item.label, isDisabled: item.isDisabled, children: [
|
|
1556
|
+
/* @__PURE__ */ jsx25("span", { className: "pire-option-label", children: item.label }),
|
|
1557
|
+
item.secondary ? /* @__PURE__ */ jsx25("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1466
1558
|
] })
|
|
1467
1559
|
}
|
|
1468
1560
|
) })
|
|
@@ -1475,16 +1567,16 @@ function MultiComboBox({
|
|
|
1475
1567
|
import * as React14 from "react";
|
|
1476
1568
|
import {
|
|
1477
1569
|
NumberField as AriaNumberField,
|
|
1478
|
-
Label as
|
|
1570
|
+
Label as Label8,
|
|
1479
1571
|
Input as AriaInput4,
|
|
1480
1572
|
Group as Group5,
|
|
1481
1573
|
Button as AriaButton8,
|
|
1482
|
-
Text as
|
|
1483
|
-
FieldError as
|
|
1574
|
+
Text as Text10,
|
|
1575
|
+
FieldError as FieldError8,
|
|
1484
1576
|
useLocale,
|
|
1485
1577
|
NumberFieldStateContext
|
|
1486
1578
|
} from "react-aria-components";
|
|
1487
|
-
import { jsx as
|
|
1579
|
+
import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1488
1580
|
function decimalSeparatorFor(locale) {
|
|
1489
1581
|
return new Intl.NumberFormat(locale).formatToParts(1.1).find((part) => part.type === "decimal")?.value ?? ".";
|
|
1490
1582
|
}
|
|
@@ -1522,7 +1614,7 @@ function ClearButton({ label, onClear }) {
|
|
|
1522
1614
|
if (!state?.inputValue) {
|
|
1523
1615
|
return null;
|
|
1524
1616
|
}
|
|
1525
|
-
return /* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ jsx26(
|
|
1526
1618
|
AriaButton8,
|
|
1527
1619
|
{
|
|
1528
1620
|
className: "pire-input-clear",
|
|
@@ -1541,6 +1633,9 @@ function NumberField({
|
|
|
1541
1633
|
description,
|
|
1542
1634
|
errorMessage,
|
|
1543
1635
|
hideStepper,
|
|
1636
|
+
stepperLayout = "stacked",
|
|
1637
|
+
incrementLabel,
|
|
1638
|
+
decrementLabel,
|
|
1544
1639
|
size = "md",
|
|
1545
1640
|
fullWidth = true,
|
|
1546
1641
|
className,
|
|
@@ -1606,7 +1701,7 @@ function NumberField({
|
|
|
1606
1701
|
event.stopPropagation();
|
|
1607
1702
|
typeIntoInput(event.currentTarget, localised);
|
|
1608
1703
|
};
|
|
1609
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ jsxs19(
|
|
1610
1705
|
AriaNumberField,
|
|
1611
1706
|
{
|
|
1612
1707
|
className: cx("pire-field", className),
|
|
@@ -1616,11 +1711,11 @@ function NumberField({
|
|
|
1616
1711
|
...rest,
|
|
1617
1712
|
...valueProps,
|
|
1618
1713
|
children: [
|
|
1619
|
-
label ? /* @__PURE__ */
|
|
1714
|
+
label ? /* @__PURE__ */ jsxs19(Label8, { className: "pire-field-label", children: [
|
|
1620
1715
|
label,
|
|
1621
|
-
rest.isRequired ? /* @__PURE__ */
|
|
1716
|
+
rest.isRequired ? /* @__PURE__ */ jsx26("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1622
1717
|
] }) : null,
|
|
1623
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsxs19(
|
|
1624
1719
|
Group5,
|
|
1625
1720
|
{
|
|
1626
1721
|
className: "pire-control",
|
|
@@ -1628,8 +1723,10 @@ function NumberField({
|
|
|
1628
1723
|
"data-full-width": String(fullWidth),
|
|
1629
1724
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1630
1725
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1726
|
+
"data-stepper": stepperLayout,
|
|
1631
1727
|
children: [
|
|
1632
|
-
/* @__PURE__ */
|
|
1728
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(AriaButton8, { slot: "decrement", className: "pire-qty-btn", "aria-label": decrementLabel ?? msg.numberFieldDecrease, children: /* @__PURE__ */ jsx26(Icon, { name: "minus", size: 16 }) }) : null,
|
|
1729
|
+
/* @__PURE__ */ jsx26(
|
|
1633
1730
|
AriaInput4,
|
|
1634
1731
|
{
|
|
1635
1732
|
className: "pire-input",
|
|
@@ -1638,27 +1735,45 @@ function NumberField({
|
|
|
1638
1735
|
onPasteCapture: handlePaste
|
|
1639
1736
|
}
|
|
1640
1737
|
),
|
|
1641
|
-
suffix ? /* @__PURE__ */
|
|
1642
|
-
showsClear ? /* @__PURE__ */
|
|
1643
|
-
hideStepper
|
|
1644
|
-
|
|
1645
|
-
/* @__PURE__ */
|
|
1738
|
+
suffix ? /* @__PURE__ */ jsx26("span", { className: "pire-affix", children: suffix }) : null,
|
|
1739
|
+
showsClear ? /* @__PURE__ */ jsx26(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1740
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ jsx26(AriaButton8, { slot: "increment", className: "pire-qty-btn", "aria-label": incrementLabel ?? msg.numberFieldIncrease, children: /* @__PURE__ */ jsx26(Icon, { name: "plus", size: 16 }) }) : null,
|
|
1741
|
+
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ jsxs19("span", { className: "pire-stepper", children: [
|
|
1742
|
+
/* @__PURE__ */ jsx26(AriaButton8, { slot: "increment", className: "pire-stepper-btn", "aria-label": incrementLabel ?? msg.numberFieldIncrease, children: /* @__PURE__ */ jsx26(Icon, { name: "plus", size: 10 }) }),
|
|
1743
|
+
/* @__PURE__ */ jsx26(AriaButton8, { slot: "decrement", className: "pire-stepper-btn", "aria-label": decrementLabel ?? msg.numberFieldDecrease, children: /* @__PURE__ */ jsx26(Icon, { name: "minus", size: 10 }) })
|
|
1646
1744
|
] })
|
|
1647
1745
|
]
|
|
1648
1746
|
}
|
|
1649
1747
|
),
|
|
1650
|
-
description ? /* @__PURE__ */
|
|
1651
|
-
/* @__PURE__ */
|
|
1748
|
+
description ? /* @__PURE__ */ jsx26(Text10, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1749
|
+
/* @__PURE__ */ jsx26(FieldError8, { className: "pire-field-error", children: errorMessage })
|
|
1652
1750
|
]
|
|
1653
1751
|
}
|
|
1654
1752
|
);
|
|
1655
1753
|
}
|
|
1656
1754
|
|
|
1755
|
+
// src/components/forms/QuantityStepper.tsx
|
|
1756
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1757
|
+
function QuantityStepper({ size = "md", ...rest }) {
|
|
1758
|
+
const msg = usePireMessages();
|
|
1759
|
+
return /* @__PURE__ */ jsx27(
|
|
1760
|
+
NumberField,
|
|
1761
|
+
{
|
|
1762
|
+
...rest,
|
|
1763
|
+
size,
|
|
1764
|
+
stepperLayout: "inline",
|
|
1765
|
+
emptyValue: null,
|
|
1766
|
+
incrementLabel: msg.quantityStepperIncrease,
|
|
1767
|
+
decrementLabel: msg.quantityStepperDecrease
|
|
1768
|
+
}
|
|
1769
|
+
);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1657
1772
|
// src/components/forms/DatePicker.tsx
|
|
1658
1773
|
import * as React15 from "react";
|
|
1659
1774
|
import {
|
|
1660
1775
|
DatePicker as AriaDatePicker,
|
|
1661
|
-
Label as
|
|
1776
|
+
Label as Label9,
|
|
1662
1777
|
Group as Group6,
|
|
1663
1778
|
DateInput,
|
|
1664
1779
|
DateSegment,
|
|
@@ -1672,8 +1787,8 @@ import {
|
|
|
1672
1787
|
CalendarGridBody,
|
|
1673
1788
|
CalendarCell,
|
|
1674
1789
|
Heading as Heading2,
|
|
1675
|
-
Text as
|
|
1676
|
-
FieldError as
|
|
1790
|
+
Text as Text11,
|
|
1791
|
+
FieldError as FieldError9,
|
|
1677
1792
|
DatePickerStateContext
|
|
1678
1793
|
} from "react-aria-components";
|
|
1679
1794
|
|
|
@@ -1705,13 +1820,13 @@ function coerceBound(value) {
|
|
|
1705
1820
|
}
|
|
1706
1821
|
|
|
1707
1822
|
// src/components/forms/DatePicker.tsx
|
|
1708
|
-
import { jsx as
|
|
1823
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1709
1824
|
function ClearButton2({ label }) {
|
|
1710
1825
|
const state = React15.useContext(DatePickerStateContext);
|
|
1711
1826
|
if (!state?.value) {
|
|
1712
1827
|
return null;
|
|
1713
1828
|
}
|
|
1714
|
-
return /* @__PURE__ */
|
|
1829
|
+
return /* @__PURE__ */ jsx28(
|
|
1715
1830
|
AriaButton9,
|
|
1716
1831
|
{
|
|
1717
1832
|
className: "pire-input-clear",
|
|
@@ -1747,7 +1862,7 @@ function DatePicker({
|
|
|
1747
1862
|
const handleChange = (next) => onChange?.(
|
|
1748
1863
|
valueFormat === "iso" && next ? next.toString() : next
|
|
1749
1864
|
);
|
|
1750
|
-
return /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsxs20(
|
|
1751
1866
|
AriaDatePicker,
|
|
1752
1867
|
{
|
|
1753
1868
|
className: cx("pire-field", className),
|
|
@@ -1760,11 +1875,11 @@ function DatePicker({
|
|
|
1760
1875
|
onChange: handleChange,
|
|
1761
1876
|
...rest,
|
|
1762
1877
|
children: [
|
|
1763
|
-
label ? /* @__PURE__ */
|
|
1878
|
+
label ? /* @__PURE__ */ jsxs20(Label9, { className: "pire-field-label", children: [
|
|
1764
1879
|
label,
|
|
1765
|
-
rest.isRequired ? /* @__PURE__ */
|
|
1880
|
+
rest.isRequired ? /* @__PURE__ */ jsx28("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1766
1881
|
] }) : null,
|
|
1767
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsxs20(
|
|
1768
1883
|
Group6,
|
|
1769
1884
|
{
|
|
1770
1885
|
className: "pire-control",
|
|
@@ -1773,23 +1888,23 @@ function DatePicker({
|
|
|
1773
1888
|
"data-invalid": rest.isInvalid ? "true" : void 0,
|
|
1774
1889
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1775
1890
|
children: [
|
|
1776
|
-
/* @__PURE__ */
|
|
1777
|
-
showsClear ? /* @__PURE__ */
|
|
1778
|
-
/* @__PURE__ */
|
|
1891
|
+
/* @__PURE__ */ jsx28(DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx28(DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1892
|
+
showsClear ? /* @__PURE__ */ jsx28(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
1893
|
+
/* @__PURE__ */ jsx28(AriaButton9, { className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerOpenCalendar, style: { width: 24, height: 24 }, children: /* @__PURE__ */ jsx28(Icon, { name: "calendar", size: 16 }) })
|
|
1779
1894
|
]
|
|
1780
1895
|
}
|
|
1781
1896
|
),
|
|
1782
|
-
description ? /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1897
|
+
description ? /* @__PURE__ */ jsx28(Text11, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1898
|
+
/* @__PURE__ */ jsx28(FieldError9, { className: "pire-field-error", children: errorMessage }),
|
|
1899
|
+
/* @__PURE__ */ jsx28(Popover4, { className: "pire-popover", children: /* @__PURE__ */ jsx28(AriaDialog, { children: /* @__PURE__ */ jsxs20(Calendar, { className: "pire-calendar", children: [
|
|
1900
|
+
/* @__PURE__ */ jsxs20("header", { className: "pire-calendar-head", children: [
|
|
1901
|
+
/* @__PURE__ */ jsx28(AriaButton9, { slot: "previous", className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerPreviousMonth, children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-left", size: 16 }) }),
|
|
1902
|
+
/* @__PURE__ */ jsx28(Heading2, { className: "pire-calendar-title" }),
|
|
1903
|
+
/* @__PURE__ */ jsx28(AriaButton9, { slot: "next", className: "pire-iconbtn", "data-size": "sm", "aria-label": msg.datePickerNextMonth, children: /* @__PURE__ */ jsx28(Icon, { name: "chevron-right", size: 16 }) })
|
|
1789
1904
|
] }),
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsxs20(CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1906
|
+
/* @__PURE__ */ jsx28(CalendarGridHeader, { children: (day) => /* @__PURE__ */ jsx28(CalendarHeaderCell, { children: day }) }),
|
|
1907
|
+
/* @__PURE__ */ jsx28(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx28(CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
1793
1908
|
] })
|
|
1794
1909
|
] }) }) })
|
|
1795
1910
|
]
|
|
@@ -1801,7 +1916,7 @@ function DatePicker({
|
|
|
1801
1916
|
import * as React16 from "react";
|
|
1802
1917
|
import {
|
|
1803
1918
|
DateRangePicker as AriaDateRangePicker,
|
|
1804
|
-
Label as
|
|
1919
|
+
Label as Label10,
|
|
1805
1920
|
Group as Group7,
|
|
1806
1921
|
DateInput as DateInput2,
|
|
1807
1922
|
DateSegment as DateSegment2,
|
|
@@ -1815,11 +1930,11 @@ import {
|
|
|
1815
1930
|
CalendarGridBody as CalendarGridBody2,
|
|
1816
1931
|
CalendarCell as CalendarCell2,
|
|
1817
1932
|
Heading as Heading3,
|
|
1818
|
-
Text as
|
|
1819
|
-
FieldError as
|
|
1933
|
+
Text as Text12,
|
|
1934
|
+
FieldError as FieldError10,
|
|
1820
1935
|
DateRangePickerStateContext
|
|
1821
1936
|
} from "react-aria-components";
|
|
1822
|
-
import { jsx as
|
|
1937
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1823
1938
|
function coerceRange(range) {
|
|
1824
1939
|
if (range === void 0) {
|
|
1825
1940
|
return void 0;
|
|
@@ -1844,7 +1959,7 @@ function ClearButton3({ label }) {
|
|
|
1844
1959
|
if (!state?.value?.start && !state?.value?.end) {
|
|
1845
1960
|
return null;
|
|
1846
1961
|
}
|
|
1847
|
-
return /* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsx29(
|
|
1848
1963
|
AriaButton10,
|
|
1849
1964
|
{
|
|
1850
1965
|
className: "pire-input-clear",
|
|
@@ -1893,7 +2008,7 @@ function DateRangePicker({
|
|
|
1893
2008
|
}
|
|
1894
2009
|
onChange(valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end });
|
|
1895
2010
|
};
|
|
1896
|
-
return /* @__PURE__ */
|
|
2011
|
+
return /* @__PURE__ */ jsxs21(
|
|
1897
2012
|
AriaDateRangePicker,
|
|
1898
2013
|
{
|
|
1899
2014
|
className: cx("pire-field", className),
|
|
@@ -1909,11 +2024,11 @@ function DateRangePicker({
|
|
|
1909
2024
|
...rest,
|
|
1910
2025
|
isInvalid: rest.isInvalid || tooLong || void 0,
|
|
1911
2026
|
children: [
|
|
1912
|
-
label ? /* @__PURE__ */
|
|
2027
|
+
label ? /* @__PURE__ */ jsxs21(Label10, { className: "pire-field-label", children: [
|
|
1913
2028
|
label,
|
|
1914
|
-
rest.isRequired ? /* @__PURE__ */
|
|
2029
|
+
rest.isRequired ? /* @__PURE__ */ jsx29("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1915
2030
|
] }) : null,
|
|
1916
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ jsxs21(
|
|
1917
2032
|
Group7,
|
|
1918
2033
|
{
|
|
1919
2034
|
className: "pire-control pire-daterange-control",
|
|
@@ -1922,30 +2037,30 @@ function DateRangePicker({
|
|
|
1922
2037
|
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
1923
2038
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1924
2039
|
children: [
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ jsx29(DateInput2, { slot: "start", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx29(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2041
|
+
/* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "pire-daterange-dash", children: "\u2013" }),
|
|
2042
|
+
/* @__PURE__ */ jsx29(DateInput2, { slot: "end", className: "pire-datefield", children: (segment) => /* @__PURE__ */ jsx29(DateSegment2, { segment, className: "pire-datesegment" }) }),
|
|
2043
|
+
isClearable && !rest.isDisabled && !rest.isReadOnly ? /* @__PURE__ */ jsx29(ClearButton3, { label: clearLabel ?? msg.inputClear }) : null,
|
|
2044
|
+
/* @__PURE__ */ jsx29(
|
|
1930
2045
|
AriaButton10,
|
|
1931
2046
|
{
|
|
1932
2047
|
className: "pire-iconbtn",
|
|
1933
2048
|
"data-size": "sm",
|
|
1934
2049
|
"aria-label": msg.datePickerOpenCalendar,
|
|
1935
2050
|
style: { width: 24, height: 24 },
|
|
1936
|
-
children: /* @__PURE__ */
|
|
2051
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "calendar", size: 16 })
|
|
1937
2052
|
}
|
|
1938
2053
|
)
|
|
1939
2054
|
]
|
|
1940
2055
|
}
|
|
1941
2056
|
),
|
|
1942
|
-
description ? /* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
2057
|
+
description ? /* @__PURE__ */ jsx29(Text12, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
2058
|
+
/* @__PURE__ */ jsx29(FieldError10, { className: "pire-field-error", children: errorMessage }),
|
|
2059
|
+
/* @__PURE__ */ jsx29(Popover5, { className: "pire-popover", children: /* @__PURE__ */ jsxs21(AriaDialog2, { className: "pire-daterange-dialog", children: [
|
|
1945
2060
|
presets?.length ? (
|
|
1946
2061
|
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
1947
2062
|
// arrowing through a month first.
|
|
1948
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ jsx29("div", { className: "pire-daterange-presets", role: "group", "aria-label": msg.dateRangePresetsLabel, children: presets.map((preset) => /* @__PURE__ */ jsx29(
|
|
1949
2064
|
AriaButton10,
|
|
1950
2065
|
{
|
|
1951
2066
|
className: "pire-daterange-preset",
|
|
@@ -1955,33 +2070,33 @@ function DateRangePicker({
|
|
|
1955
2070
|
preset.id
|
|
1956
2071
|
)) })
|
|
1957
2072
|
) : null,
|
|
1958
|
-
/* @__PURE__ */
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ jsxs21(RangeCalendar, { className: "pire-calendar", children: [
|
|
2074
|
+
/* @__PURE__ */ jsxs21("header", { className: "pire-calendar-head", children: [
|
|
2075
|
+
/* @__PURE__ */ jsx29(
|
|
1961
2076
|
AriaButton10,
|
|
1962
2077
|
{
|
|
1963
2078
|
slot: "previous",
|
|
1964
2079
|
className: "pire-iconbtn",
|
|
1965
2080
|
"data-size": "sm",
|
|
1966
2081
|
"aria-label": msg.datePickerPreviousMonth,
|
|
1967
|
-
children: /* @__PURE__ */
|
|
2082
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "chevron-left", size: 16 })
|
|
1968
2083
|
}
|
|
1969
2084
|
),
|
|
1970
|
-
/* @__PURE__ */
|
|
1971
|
-
/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ jsx29(Heading3, { className: "pire-calendar-title" }),
|
|
2086
|
+
/* @__PURE__ */ jsx29(
|
|
1972
2087
|
AriaButton10,
|
|
1973
2088
|
{
|
|
1974
2089
|
slot: "next",
|
|
1975
2090
|
className: "pire-iconbtn",
|
|
1976
2091
|
"data-size": "sm",
|
|
1977
2092
|
"aria-label": msg.datePickerNextMonth,
|
|
1978
|
-
children: /* @__PURE__ */
|
|
2093
|
+
children: /* @__PURE__ */ jsx29(Icon, { name: "chevron-right", size: 16 })
|
|
1979
2094
|
}
|
|
1980
2095
|
)
|
|
1981
2096
|
] }),
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
/* @__PURE__ */
|
|
1984
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ jsxs21(CalendarGrid2, { className: "pire-calendar-grid", children: [
|
|
2098
|
+
/* @__PURE__ */ jsx29(CalendarGridHeader2, { children: (day) => /* @__PURE__ */ jsx29(CalendarHeaderCell2, { children: day }) }),
|
|
2099
|
+
/* @__PURE__ */ jsx29(CalendarGridBody2, { children: (date) => /* @__PURE__ */ jsx29(CalendarCell2, { date, className: "pire-calendar-cell" }) })
|
|
1985
2100
|
] })
|
|
1986
2101
|
] })
|
|
1987
2102
|
] }) })
|
|
@@ -1991,26 +2106,26 @@ function DateRangePicker({
|
|
|
1991
2106
|
}
|
|
1992
2107
|
|
|
1993
2108
|
// src/components/forms/ValueHelpField.tsx
|
|
1994
|
-
import * as
|
|
2109
|
+
import * as React20 from "react";
|
|
1995
2110
|
|
|
1996
2111
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
1997
|
-
import * as
|
|
2112
|
+
import * as React19 from "react";
|
|
1998
2113
|
|
|
1999
2114
|
// src/components/feedback/Dialog.tsx
|
|
2000
2115
|
import * as React17 from "react";
|
|
2001
2116
|
import { ModalOverlay, Modal, Dialog as AriaDialog3, Heading as Heading4 } from "react-aria-components";
|
|
2002
|
-
import { jsx as
|
|
2117
|
+
import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2003
2118
|
function DialogTitle({ children, className }) {
|
|
2004
|
-
return /* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ jsx30(Heading4, { slot: "title", className: cx("pire-dialog-title", className), children });
|
|
2005
2120
|
}
|
|
2006
2121
|
function DialogDescription({ children, className }) {
|
|
2007
|
-
return /* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ jsx30("p", { className: cx("pire-dialog-sub", className), style: { margin: 0 }, children });
|
|
2008
2123
|
}
|
|
2009
2124
|
function DialogBody({ children, className }) {
|
|
2010
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ jsx30("div", { className: cx("pire-dialog-body", className), children });
|
|
2011
2126
|
}
|
|
2012
2127
|
function DialogActions({ children, className }) {
|
|
2013
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ jsx30("footer", { className: cx("pire-dialog-foot", className), children });
|
|
2014
2129
|
}
|
|
2015
2130
|
function Dialog({
|
|
2016
2131
|
isOpen,
|
|
@@ -2039,11 +2154,11 @@ function Dialog({
|
|
|
2039
2154
|
const actionsSlot = slotOf(DialogActions);
|
|
2040
2155
|
const slots = [titleSlot, descriptionSlot, bodySlot, actionsSlot];
|
|
2041
2156
|
const loose = parts.filter((node) => !slots.includes(node));
|
|
2042
|
-
const heading = titleSlot ?? (title ? /* @__PURE__ */
|
|
2043
|
-
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */
|
|
2044
|
-
const actions = actionsSlot ?? (footer ? /* @__PURE__ */
|
|
2045
|
-
const body = bodySlot ?? (loose.length ? /* @__PURE__ */
|
|
2046
|
-
return /* @__PURE__ */
|
|
2157
|
+
const heading = titleSlot ?? (title ? /* @__PURE__ */ jsx30(Heading4, { slot: "title", className: "pire-dialog-title", children: title }) : null);
|
|
2158
|
+
const description = descriptionSlot ?? (subtitle ? /* @__PURE__ */ jsx30("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null);
|
|
2159
|
+
const actions = actionsSlot ?? (footer ? /* @__PURE__ */ jsx30("footer", { className: "pire-dialog-foot", children: footer }) : null);
|
|
2160
|
+
const body = bodySlot ?? (loose.length ? /* @__PURE__ */ jsx30("div", { className: "pire-dialog-body", children: loose }) : null);
|
|
2161
|
+
return /* @__PURE__ */ jsx30(
|
|
2047
2162
|
ModalOverlay,
|
|
2048
2163
|
{
|
|
2049
2164
|
className: "pire-modal-overlay",
|
|
@@ -2052,13 +2167,13 @@ function Dialog({
|
|
|
2052
2167
|
onOpenChange: (o) => {
|
|
2053
2168
|
if (!o) close();
|
|
2054
2169
|
},
|
|
2055
|
-
children: /* @__PURE__ */
|
|
2056
|
-
heading || description ? /* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2170
|
+
children: /* @__PURE__ */ jsx30(Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ jsxs22(AriaDialog3, { className: "pire-dialog", children: [
|
|
2171
|
+
heading || description ? /* @__PURE__ */ jsxs22("header", { className: "pire-dialog-head", children: [
|
|
2172
|
+
/* @__PURE__ */ jsxs22("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2058
2173
|
heading,
|
|
2059
2174
|
description
|
|
2060
2175
|
] }),
|
|
2061
|
-
showClose ? /* @__PURE__ */
|
|
2176
|
+
showClose ? /* @__PURE__ */ jsx30(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
2062
2177
|
] }) : null,
|
|
2063
2178
|
body,
|
|
2064
2179
|
actions
|
|
@@ -2068,6 +2183,7 @@ function Dialog({
|
|
|
2068
2183
|
}
|
|
2069
2184
|
|
|
2070
2185
|
// src/components/data/DataTable.tsx
|
|
2186
|
+
import * as React18 from "react";
|
|
2071
2187
|
import {
|
|
2072
2188
|
Table,
|
|
2073
2189
|
TableHeader,
|
|
@@ -2079,9 +2195,9 @@ import {
|
|
|
2079
2195
|
} from "react-aria-components";
|
|
2080
2196
|
|
|
2081
2197
|
// src/components/feedback/Skeleton.tsx
|
|
2082
|
-
import { jsx as
|
|
2198
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2083
2199
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
2084
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ jsx31(
|
|
2085
2201
|
"div",
|
|
2086
2202
|
{
|
|
2087
2203
|
className: cx("pire-skeleton", className),
|
|
@@ -2095,7 +2211,7 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2095
2211
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2096
2212
|
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
2097
2213
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2098
|
-
return /* @__PURE__ */
|
|
2214
|
+
return /* @__PURE__ */ jsx31(
|
|
2099
2215
|
"div",
|
|
2100
2216
|
{
|
|
2101
2217
|
className: cx("pire-skeleton-row", className),
|
|
@@ -2107,13 +2223,13 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2107
2223
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2108
2224
|
return (
|
|
2109
2225
|
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
2110
|
-
/* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ jsx31(
|
|
2111
2227
|
"div",
|
|
2112
2228
|
{
|
|
2113
2229
|
className: "pire-skeleton-cell",
|
|
2114
2230
|
"data-align": align,
|
|
2115
2231
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2116
|
-
children: /* @__PURE__ */
|
|
2232
|
+
children: /* @__PURE__ */ jsx31(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2117
2233
|
},
|
|
2118
2234
|
i
|
|
2119
2235
|
)
|
|
@@ -2124,7 +2240,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2124
2240
|
}
|
|
2125
2241
|
|
|
2126
2242
|
// src/components/data/DataTable.tsx
|
|
2127
|
-
import { jsx as
|
|
2243
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2244
|
+
var IS_DEV2 = process.env.NODE_ENV !== "production";
|
|
2245
|
+
var warned2 = /* @__PURE__ */ new Set();
|
|
2246
|
+
function warnOnce2(key, message) {
|
|
2247
|
+
if (warned2.has(key)) return;
|
|
2248
|
+
warned2.add(key);
|
|
2249
|
+
console.warn(`[pire] ${message}`);
|
|
2250
|
+
}
|
|
2251
|
+
var CHECKBOX_W = 44;
|
|
2128
2252
|
function DataTable({
|
|
2129
2253
|
columns,
|
|
2130
2254
|
rows,
|
|
@@ -2132,6 +2256,7 @@ function DataTable({
|
|
|
2132
2256
|
selectable,
|
|
2133
2257
|
selected,
|
|
2134
2258
|
onSelectionChange,
|
|
2259
|
+
hideSelectAll,
|
|
2135
2260
|
sort,
|
|
2136
2261
|
onSortChange,
|
|
2137
2262
|
onRowAction,
|
|
@@ -2151,14 +2276,53 @@ function DataTable({
|
|
|
2151
2276
|
const msg = usePireMessages();
|
|
2152
2277
|
const selectionMode = selectable === true || selectable === "multiple" ? "multiple" : selectable === "single" ? "single" : "none";
|
|
2153
2278
|
const hasCheckboxColumn = selectionMode === "multiple";
|
|
2279
|
+
const pinnedGeometry = React18.useMemo(() => {
|
|
2280
|
+
const geometry = /* @__PURE__ */ new Map();
|
|
2281
|
+
let x = hasCheckboxColumn ? CHECKBOX_W : 0;
|
|
2282
|
+
let broke = null;
|
|
2283
|
+
for (const column of columns) {
|
|
2284
|
+
if (!column.pinned) {
|
|
2285
|
+
broke = "unpinned";
|
|
2286
|
+
break;
|
|
2287
|
+
}
|
|
2288
|
+
if (typeof column.width !== "number") {
|
|
2289
|
+
if (IS_DEV2) warnOnce2(
|
|
2290
|
+
`pin-width:${column.key}`,
|
|
2291
|
+
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2292
|
+
);
|
|
2293
|
+
broke = "width";
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2296
|
+
geometry.set(column.key, { left: x, width: column.width });
|
|
2297
|
+
x += column.width;
|
|
2298
|
+
}
|
|
2299
|
+
if (IS_DEV2 && broke === "unpinned") {
|
|
2300
|
+
const stranded = columns.slice(geometry.size).find((c) => c.pinned);
|
|
2301
|
+
if (stranded) {
|
|
2302
|
+
warnOnce2(
|
|
2303
|
+
`pin-gap:${stranded.key}`,
|
|
2304
|
+
`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.`
|
|
2305
|
+
);
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
return geometry;
|
|
2309
|
+
}, [columns, hasCheckboxColumn]);
|
|
2310
|
+
const hasPinned = pinnedGeometry.size > 0;
|
|
2311
|
+
const lastPinnedKey = hasPinned ? [...pinnedGeometry.keys()][pinnedGeometry.size - 1] : void 0;
|
|
2154
2312
|
const sortDescriptor = sort ? { column: sort.key, direction: sort.dir === "asc" ? "ascending" : "descending" } : void 0;
|
|
2155
2313
|
const handleSelection = (keys) => {
|
|
2156
|
-
if (keys === "all")
|
|
2314
|
+
if (keys === "all") {
|
|
2315
|
+
const inCollection = new Set(rows.map((r) => r.id));
|
|
2316
|
+
return onSelectionChange?.([
|
|
2317
|
+
...rows.map((r) => r.id),
|
|
2318
|
+
...(selected ?? []).filter((id) => !inCollection.has(id))
|
|
2319
|
+
]);
|
|
2320
|
+
}
|
|
2157
2321
|
onSelectionChange?.([...keys]);
|
|
2158
2322
|
};
|
|
2159
2323
|
const skeletonRows = loadingRowCount ?? (rows.length || 5);
|
|
2160
2324
|
const skeletonColumns = [
|
|
2161
|
-
...hasCheckboxColumn ? [{ width:
|
|
2325
|
+
...hasCheckboxColumn ? [{ width: CHECKBOX_W }] : [],
|
|
2162
2326
|
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
2163
2327
|
];
|
|
2164
2328
|
const body = isLoading ? [] : rows;
|
|
@@ -2167,19 +2331,30 @@ function DataTable({
|
|
|
2167
2331
|
const expanded = new Set((expandedIds ?? []).map(String));
|
|
2168
2332
|
const spanAll = columns.length + (hasCheckboxColumn ? 1 : 0);
|
|
2169
2333
|
const expandedKey = (id) => `${id}::__pire_expanded__`;
|
|
2170
|
-
|
|
2334
|
+
const pinProps = (key) => {
|
|
2335
|
+
if (!hasPinned) return {};
|
|
2336
|
+
const box = key === null ? { left: 0, width: CHECKBOX_W } : pinnedGeometry.get(key);
|
|
2337
|
+
if (!box) return {};
|
|
2338
|
+
return {
|
|
2339
|
+
"data-pinned": "true",
|
|
2340
|
+
"data-pinned-last": key !== null && key === lastPinnedKey ? "true" : void 0,
|
|
2341
|
+
style: { left: box.left, width: box.width, minWidth: box.width, maxWidth: box.width }
|
|
2342
|
+
};
|
|
2343
|
+
};
|
|
2344
|
+
return /* @__PURE__ */ jsx32(
|
|
2171
2345
|
"div",
|
|
2172
2346
|
{
|
|
2173
2347
|
className: cx("pire-table-wrap", className),
|
|
2174
2348
|
style,
|
|
2175
2349
|
"data-loading": isLoading ? "true" : void 0,
|
|
2176
2350
|
"aria-busy": isLoading ? "true" : void 0,
|
|
2177
|
-
children: /* @__PURE__ */
|
|
2351
|
+
children: /* @__PURE__ */ jsxs23(
|
|
2178
2352
|
Table,
|
|
2179
2353
|
{
|
|
2180
2354
|
className: "pire-table",
|
|
2181
2355
|
"data-density": density,
|
|
2182
2356
|
"data-sticky": String(stickyHeader),
|
|
2357
|
+
"data-pinned": hasPinned ? "true" : void 0,
|
|
2183
2358
|
"aria-label": rest["aria-label"],
|
|
2184
2359
|
disabledKeys: disabledKeys.length ? new Set(disabledKeys) : void 0,
|
|
2185
2360
|
selectionMode,
|
|
@@ -2192,78 +2367,95 @@ function DataTable({
|
|
|
2192
2367
|
if (row) onRowAction(row);
|
|
2193
2368
|
} : void 0,
|
|
2194
2369
|
children: [
|
|
2195
|
-
/* @__PURE__ */
|
|
2196
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2197
|
-
columns.map((c, i) =>
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2370
|
+
/* @__PURE__ */ jsxs23(TableHeader, { className: "pire-thead-row", children: [
|
|
2371
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx32(Column, { className: "pire-th", ...pinProps(null), children: hideSelectAll ? /* @__PURE__ */ jsx32("span", { className: "pire-sr-only", children: msg.dataTableSelectionColumn }) : /* @__PURE__ */ jsx32(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
2372
|
+
columns.map((c, i) => (
|
|
2373
|
+
// The checkbox column is never the row header — a selection control does not identify
|
|
2374
|
+
// the record — so the first *data* column carries it regardless of whether a checkbox
|
|
2375
|
+
// column precedes it. Conditioning this on `hasCheckboxColumn` left every selectable
|
|
2376
|
+
// table with no row header at all: invisible on first paint, and a hard crash from
|
|
2377
|
+
// React Aria's own "table must have a row header" invariant the moment `rows` changes
|
|
2378
|
+
// under it (search, sort, a paginated load).
|
|
2379
|
+
/* @__PURE__ */ jsx32(
|
|
2380
|
+
Column,
|
|
2381
|
+
{
|
|
2382
|
+
id: c.key,
|
|
2383
|
+
className: "pire-th",
|
|
2384
|
+
isRowHeader: i === 0,
|
|
2385
|
+
allowsSorting: c.sortable,
|
|
2386
|
+
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
2387
|
+
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
2388
|
+
...pinProps(c.key),
|
|
2389
|
+
children: /* @__PURE__ */ jsxs23("span", { className: c.hideLabel ? "pire-sr-only" : "pire-th-inner", children: [
|
|
2390
|
+
c.label,
|
|
2391
|
+
c.sortable ? /* @__PURE__ */ jsx32(
|
|
2392
|
+
Icon,
|
|
2393
|
+
{
|
|
2394
|
+
size: 12,
|
|
2395
|
+
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
2396
|
+
style: { color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)" }
|
|
2397
|
+
}
|
|
2398
|
+
) : null
|
|
2399
|
+
] })
|
|
2400
|
+
},
|
|
2401
|
+
c.key
|
|
2402
|
+
)
|
|
2220
2403
|
))
|
|
2221
2404
|
] }),
|
|
2222
|
-
/* @__PURE__ */
|
|
2223
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsx32(TableBody, { renderEmptyState: () => isLoading ? /* @__PURE__ */ jsxs23("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2406
|
+
/* @__PURE__ */ jsx32("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2224
2407
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2225
2408
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2226
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx32(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2227
2410
|
))
|
|
2228
|
-
] }) : /* @__PURE__ */
|
|
2411
|
+
] }) : /* @__PURE__ */ jsx32("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }), children: body.flatMap((row) => {
|
|
2229
2412
|
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2230
|
-
const record = /* @__PURE__ */
|
|
2413
|
+
const record = /* @__PURE__ */ jsxs23(
|
|
2231
2414
|
Row,
|
|
2232
2415
|
{
|
|
2233
2416
|
id: row.id,
|
|
2234
2417
|
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2235
2418
|
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2236
2419
|
children: [
|
|
2237
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2238
|
-
columns.map((c) =>
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2420
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx32(Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ jsx32(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2421
|
+
columns.map((c) => {
|
|
2422
|
+
const pin = pinProps(c.key);
|
|
2423
|
+
return /* @__PURE__ */ jsx32(
|
|
2424
|
+
Cell,
|
|
2425
|
+
{
|
|
2426
|
+
className: "pire-td",
|
|
2427
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2428
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2429
|
+
...pin,
|
|
2430
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2431
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
2432
|
+
},
|
|
2433
|
+
c.key
|
|
2434
|
+
);
|
|
2435
|
+
})
|
|
2248
2436
|
]
|
|
2249
2437
|
},
|
|
2250
2438
|
row.id
|
|
2251
2439
|
);
|
|
2252
2440
|
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2253
|
-
return [record, /* @__PURE__ */
|
|
2441
|
+
return [record, /* @__PURE__ */ jsx32(Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ jsx32(Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))];
|
|
2254
2442
|
}) }),
|
|
2255
|
-
footer && !isLoading ? /* @__PURE__ */
|
|
2256
|
-
hasCheckboxColumn ? /* @__PURE__ */
|
|
2257
|
-
columns.map((c, i) =>
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2443
|
+
footer && !isLoading ? /* @__PURE__ */ jsx32(TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ jsxs23(Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2444
|
+
hasCheckboxColumn ? /* @__PURE__ */ jsx32(Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2445
|
+
columns.map((c, i) => {
|
|
2446
|
+
const pin = pinProps(c.key);
|
|
2447
|
+
return /* @__PURE__ */ jsx32(
|
|
2448
|
+
Cell,
|
|
2449
|
+
{
|
|
2450
|
+
className: "pire-tf",
|
|
2451
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2452
|
+
...pin,
|
|
2453
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2454
|
+
children: footer[c.key] ?? (i === 0 ? /* @__PURE__ */ jsx32("span", { className: "pire-sr-only", children: msg.dataTableSummaryRow }) : null)
|
|
2455
|
+
},
|
|
2456
|
+
c.key
|
|
2457
|
+
);
|
|
2458
|
+
})
|
|
2267
2459
|
] }) }) : null
|
|
2268
2460
|
]
|
|
2269
2461
|
}
|
|
@@ -2273,7 +2465,7 @@ function DataTable({
|
|
|
2273
2465
|
}
|
|
2274
2466
|
|
|
2275
2467
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
2276
|
-
import { jsx as
|
|
2468
|
+
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2277
2469
|
function ValueHelpDialog({
|
|
2278
2470
|
isOpen,
|
|
2279
2471
|
title,
|
|
@@ -2286,14 +2478,19 @@ function ValueHelpDialog({
|
|
|
2286
2478
|
isLoading,
|
|
2287
2479
|
onLoadMore,
|
|
2288
2480
|
onSelect,
|
|
2289
|
-
onClose
|
|
2481
|
+
onClose,
|
|
2482
|
+
selectionMode = "single",
|
|
2483
|
+
selectedKeys,
|
|
2484
|
+
onSelectionChange,
|
|
2485
|
+
onConfirm
|
|
2290
2486
|
}) {
|
|
2291
2487
|
const msg = usePireMessages();
|
|
2292
|
-
const [query, setQuery] =
|
|
2293
|
-
|
|
2488
|
+
const [query, setQuery] = React19.useState("");
|
|
2489
|
+
React19.useEffect(() => {
|
|
2294
2490
|
if (isOpen) setQuery("");
|
|
2295
2491
|
}, [isOpen]);
|
|
2296
|
-
const
|
|
2492
|
+
const isMultiple = selectionMode === "multiple";
|
|
2493
|
+
const filtered = React19.useMemo(() => {
|
|
2297
2494
|
if (isFilteredExternally) return rows;
|
|
2298
2495
|
const q = query.trim().toLowerCase();
|
|
2299
2496
|
if (!q) return rows;
|
|
@@ -2303,16 +2500,22 @@ function ValueHelpDialog({
|
|
|
2303
2500
|
setQuery(value);
|
|
2304
2501
|
onSearch?.(value);
|
|
2305
2502
|
};
|
|
2306
|
-
return /* @__PURE__ */
|
|
2503
|
+
return /* @__PURE__ */ jsx33(
|
|
2307
2504
|
Dialog,
|
|
2308
2505
|
{
|
|
2309
2506
|
isOpen,
|
|
2310
2507
|
size: "lg",
|
|
2311
2508
|
title: title ?? msg.valueHelpDialogTitle,
|
|
2312
2509
|
onClose,
|
|
2313
|
-
footer: /* @__PURE__ */
|
|
2314
|
-
|
|
2315
|
-
/* @__PURE__ */
|
|
2510
|
+
footer: /* @__PURE__ */ jsxs24(Fragment2, { children: [
|
|
2511
|
+
/* @__PURE__ */ jsx33(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2512
|
+
isMultiple ? /* @__PURE__ */ jsx33(Button, { variant: "primary", onPress: () => {
|
|
2513
|
+
onConfirm?.(selectedKeys ?? []);
|
|
2514
|
+
onClose?.();
|
|
2515
|
+
}, children: msg.valueHelpConfirm }) : null
|
|
2516
|
+
] }),
|
|
2517
|
+
children: /* @__PURE__ */ jsxs24("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2518
|
+
/* @__PURE__ */ jsx33(
|
|
2316
2519
|
Input,
|
|
2317
2520
|
{
|
|
2318
2521
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -2325,10 +2528,15 @@ function ValueHelpDialog({
|
|
|
2325
2528
|
autoFocus: true
|
|
2326
2529
|
}
|
|
2327
2530
|
),
|
|
2328
|
-
/* @__PURE__ */
|
|
2531
|
+
isMultiple ? /* @__PURE__ */ jsxs24("div", { className: "pire-valuehelp-selectionbar", children: [
|
|
2532
|
+
/* @__PURE__ */ jsx33(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.(rows.map((r) => r.id)), children: msg.valueHelpSelectAllCount.replace("{count}", String(rows.length)) }),
|
|
2533
|
+
/* @__PURE__ */ jsx33(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2534
|
+
/* @__PURE__ */ jsx33("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2535
|
+
] }) : null,
|
|
2536
|
+
/* @__PURE__ */ jsx33("div", { onScroll: onLoadMore ? (event) => {
|
|
2329
2537
|
const el = event.currentTarget;
|
|
2330
2538
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2331
|
-
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */
|
|
2539
|
+
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ jsx33(
|
|
2332
2540
|
DataTable,
|
|
2333
2541
|
{
|
|
2334
2542
|
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
@@ -2337,7 +2545,11 @@ function ValueHelpDialog({
|
|
|
2337
2545
|
rows: filtered,
|
|
2338
2546
|
isLoading,
|
|
2339
2547
|
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2340
|
-
|
|
2548
|
+
selectable: isMultiple ? "multiple" : void 0,
|
|
2549
|
+
hideSelectAll: isMultiple,
|
|
2550
|
+
selected: isMultiple ? selectedKeys : void 0,
|
|
2551
|
+
onSelectionChange: isMultiple ? onSelectionChange : void 0,
|
|
2552
|
+
onRowAction: isMultiple ? void 0 : (row) => {
|
|
2341
2553
|
onSelect?.(row);
|
|
2342
2554
|
onClose?.();
|
|
2343
2555
|
}
|
|
@@ -2349,7 +2561,7 @@ function ValueHelpDialog({
|
|
|
2349
2561
|
}
|
|
2350
2562
|
|
|
2351
2563
|
// src/components/forms/ValueHelpField.tsx
|
|
2352
|
-
import { jsx as
|
|
2564
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2353
2565
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
2354
2566
|
function ValueHelpField({
|
|
2355
2567
|
label,
|
|
@@ -2375,9 +2587,9 @@ function ValueHelpField({
|
|
|
2375
2587
|
style
|
|
2376
2588
|
}) {
|
|
2377
2589
|
const msg = usePireMessages();
|
|
2378
|
-
const [open, setOpen] =
|
|
2379
|
-
return /* @__PURE__ */
|
|
2380
|
-
/* @__PURE__ */
|
|
2590
|
+
const [open, setOpen] = React20.useState(false);
|
|
2591
|
+
return /* @__PURE__ */ jsxs25("div", { className: cx(className), style, children: [
|
|
2592
|
+
/* @__PURE__ */ jsx34(
|
|
2381
2593
|
Input,
|
|
2382
2594
|
{
|
|
2383
2595
|
label,
|
|
@@ -2389,8 +2601,8 @@ function ValueHelpField({
|
|
|
2389
2601
|
placeholder: placeholder ?? msg.valueHelpFieldPlaceholder,
|
|
2390
2602
|
description,
|
|
2391
2603
|
errorMessage,
|
|
2392
|
-
suffix: /* @__PURE__ */
|
|
2393
|
-
allowsClear && value ? /* @__PURE__ */
|
|
2604
|
+
suffix: /* @__PURE__ */ jsxs25("span", { className: "pire-valuehelp-actions", children: [
|
|
2605
|
+
allowsClear && value ? /* @__PURE__ */ jsx34(
|
|
2394
2606
|
IconButton,
|
|
2395
2607
|
{
|
|
2396
2608
|
icon: "x",
|
|
@@ -2399,7 +2611,7 @@ function ValueHelpField({
|
|
|
2399
2611
|
onPress: () => onChange?.(null)
|
|
2400
2612
|
}
|
|
2401
2613
|
) : null,
|
|
2402
|
-
/* @__PURE__ */
|
|
2614
|
+
/* @__PURE__ */ jsx34(
|
|
2403
2615
|
IconButton,
|
|
2404
2616
|
{
|
|
2405
2617
|
icon: "search",
|
|
@@ -2411,7 +2623,7 @@ function ValueHelpField({
|
|
|
2411
2623
|
] })
|
|
2412
2624
|
}
|
|
2413
2625
|
),
|
|
2414
|
-
/* @__PURE__ */
|
|
2626
|
+
/* @__PURE__ */ jsx34(
|
|
2415
2627
|
ValueHelpDialog,
|
|
2416
2628
|
{
|
|
2417
2629
|
isOpen: open,
|
|
@@ -2431,12 +2643,12 @@ function ValueHelpField({
|
|
|
2431
2643
|
}
|
|
2432
2644
|
|
|
2433
2645
|
// src/components/forms/FileUpload.tsx
|
|
2434
|
-
import * as
|
|
2435
|
-
import { FileTrigger, Text as
|
|
2646
|
+
import * as React21 from "react";
|
|
2647
|
+
import { FileTrigger, Text as Text13 } from "react-aria-components";
|
|
2436
2648
|
|
|
2437
2649
|
// src/components/feedback/ProgressBar.tsx
|
|
2438
|
-
import { ProgressBar as AriaProgressBar, Label as
|
|
2439
|
-
import { Fragment as
|
|
2650
|
+
import { ProgressBar as AriaProgressBar, Label as Label11 } from "react-aria-components";
|
|
2651
|
+
import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2440
2652
|
function ProgressBar({
|
|
2441
2653
|
value = 0,
|
|
2442
2654
|
minValue = 0,
|
|
@@ -2449,7 +2661,7 @@ function ProgressBar({
|
|
|
2449
2661
|
className,
|
|
2450
2662
|
style
|
|
2451
2663
|
}) {
|
|
2452
|
-
return /* @__PURE__ */
|
|
2664
|
+
return /* @__PURE__ */ jsx35(
|
|
2453
2665
|
AriaProgressBar,
|
|
2454
2666
|
{
|
|
2455
2667
|
className: cx("pire-progress", className),
|
|
@@ -2460,19 +2672,19 @@ function ProgressBar({
|
|
|
2460
2672
|
maxValue,
|
|
2461
2673
|
isIndeterminate,
|
|
2462
2674
|
style,
|
|
2463
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */
|
|
2464
|
-
label || showValue ? /* @__PURE__ */
|
|
2465
|
-
label ? /* @__PURE__ */
|
|
2466
|
-
showValue && !isIndeterminate ? /* @__PURE__ */
|
|
2675
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
2676
|
+
label || showValue ? /* @__PURE__ */ jsxs26("div", { className: "pire-progress-head", children: [
|
|
2677
|
+
label ? /* @__PURE__ */ jsx35(Label11, { children: label }) : /* @__PURE__ */ jsx35("span", {}),
|
|
2678
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ jsx35("span", { className: "pire-numeric", children: valueText }) : null
|
|
2467
2679
|
] }) : null,
|
|
2468
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ jsx35("div", { className: "pire-progress-track", children: /* @__PURE__ */ jsx35("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
2469
2681
|
] })
|
|
2470
2682
|
}
|
|
2471
2683
|
);
|
|
2472
2684
|
}
|
|
2473
2685
|
|
|
2474
2686
|
// src/components/forms/FileUpload.tsx
|
|
2475
|
-
import { jsx as
|
|
2687
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2476
2688
|
var isImage = (file) => file.type.startsWith("image/");
|
|
2477
2689
|
function formatFileSize(bytes) {
|
|
2478
2690
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -2522,10 +2734,10 @@ function FileUpload({
|
|
|
2522
2734
|
...rest
|
|
2523
2735
|
}) {
|
|
2524
2736
|
const msg = usePireMessages();
|
|
2525
|
-
const [uncontrolled, setUncontrolled] =
|
|
2737
|
+
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2526
2738
|
const files = value ?? uncontrolled;
|
|
2527
|
-
const created =
|
|
2528
|
-
|
|
2739
|
+
const created = React21.useRef([]);
|
|
2740
|
+
React21.useEffect(() => () => {
|
|
2529
2741
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2530
2742
|
}, []);
|
|
2531
2743
|
const commit = (next) => {
|
|
@@ -2545,7 +2757,7 @@ function FileUpload({
|
|
|
2545
2757
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
2546
2758
|
};
|
|
2547
2759
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
2548
|
-
return /* @__PURE__ */
|
|
2760
|
+
return /* @__PURE__ */ jsxs27(
|
|
2549
2761
|
"div",
|
|
2550
2762
|
{
|
|
2551
2763
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -2554,24 +2766,24 @@ function FileUpload({
|
|
|
2554
2766
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
2555
2767
|
...rest,
|
|
2556
2768
|
children: [
|
|
2557
|
-
label ? /* @__PURE__ */
|
|
2769
|
+
label ? /* @__PURE__ */ jsxs27("span", { className: "pire-field-label", children: [
|
|
2558
2770
|
label,
|
|
2559
|
-
isRequired ? /* @__PURE__ */
|
|
2771
|
+
isRequired ? /* @__PURE__ */ jsx36("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2560
2772
|
] }) : null,
|
|
2561
|
-
/* @__PURE__ */
|
|
2773
|
+
/* @__PURE__ */ jsx36(
|
|
2562
2774
|
FileTrigger,
|
|
2563
2775
|
{
|
|
2564
2776
|
acceptedFileTypes,
|
|
2565
2777
|
allowsMultiple,
|
|
2566
2778
|
onSelect: accept,
|
|
2567
|
-
children: /* @__PURE__ */
|
|
2779
|
+
children: /* @__PURE__ */ jsx36(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
2568
2780
|
}
|
|
2569
2781
|
),
|
|
2570
|
-
files.length ? /* @__PURE__ */
|
|
2571
|
-
previewUrl ? /* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
2782
|
+
files.length ? /* @__PURE__ */ jsx36("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs27("li", { className: "pire-fileupload-item", children: [
|
|
2783
|
+
previewUrl ? /* @__PURE__ */ jsx36("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx36(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
2784
|
+
/* @__PURE__ */ jsx36("span", { className: "pire-fileupload-name", children: file.name }),
|
|
2785
|
+
/* @__PURE__ */ jsx36("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
2786
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx36(
|
|
2575
2787
|
IconButton,
|
|
2576
2788
|
{
|
|
2577
2789
|
icon: "x",
|
|
@@ -2581,9 +2793,9 @@ function FileUpload({
|
|
|
2581
2793
|
}
|
|
2582
2794
|
)
|
|
2583
2795
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
2584
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
2585
|
-
description ? /* @__PURE__ */
|
|
2586
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
2796
|
+
uploadProgress != null ? /* @__PURE__ */ jsx36(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
2797
|
+
description ? /* @__PURE__ */ jsx36(Text13, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
2798
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx36("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
2587
2799
|
]
|
|
2588
2800
|
}
|
|
2589
2801
|
);
|
|
@@ -2591,7 +2803,7 @@ function FileUpload({
|
|
|
2591
2803
|
|
|
2592
2804
|
// src/components/navigation/ShellBar.tsx
|
|
2593
2805
|
import { MenuTrigger, Button as AriaButton11, Popover as Popover6 } from "react-aria-components";
|
|
2594
|
-
import { jsx as
|
|
2806
|
+
import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2595
2807
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
2596
2808
|
function ShellBar({
|
|
2597
2809
|
launcher,
|
|
@@ -2610,21 +2822,21 @@ function ShellBar({
|
|
|
2610
2822
|
...rest
|
|
2611
2823
|
}) {
|
|
2612
2824
|
const msg = usePireMessages();
|
|
2613
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ jsxs28("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
2614
2826
|
launcher,
|
|
2615
|
-
onMenu ? /* @__PURE__ */
|
|
2616
|
-
monogram ? /* @__PURE__ */
|
|
2617
|
-
product ? /* @__PURE__ */
|
|
2618
|
-
title ? /* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
onSearch ? /* @__PURE__ */
|
|
2827
|
+
onMenu ? /* @__PURE__ */ jsx37(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
2828
|
+
monogram ? /* @__PURE__ */ jsx37("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
2829
|
+
product ? /* @__PURE__ */ jsx37("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
2830
|
+
title ? /* @__PURE__ */ jsx37("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
2831
|
+
/* @__PURE__ */ jsx37("span", { className: "pire-shellbar-spacer" }),
|
|
2832
|
+
onSearch ? /* @__PURE__ */ jsx37(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
2621
2833
|
actions,
|
|
2622
2834
|
user && userMenu ? (
|
|
2623
2835
|
// A real button, not the img-role span: the avatar is where "my profile", "switch company"
|
|
2624
2836
|
// and "sign out" live in any ERP, and a span accepts neither focus nor onPress. Popover is
|
|
2625
2837
|
// rendered here rather than expected from the consumer so the panel keeps shell placement.
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ jsxs28(MenuTrigger, { children: [
|
|
2839
|
+
/* @__PURE__ */ jsx37(
|
|
2628
2840
|
AriaButton11,
|
|
2629
2841
|
{
|
|
2630
2842
|
className: "pire-avatar pire-avatar-trigger",
|
|
@@ -2632,14 +2844,14 @@ function ShellBar({
|
|
|
2632
2844
|
children: initials2(user)
|
|
2633
2845
|
}
|
|
2634
2846
|
),
|
|
2635
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsx37(Popover6, { className: "pire-popover", children: userMenu })
|
|
2636
2848
|
] })
|
|
2637
|
-
) : user ? /* @__PURE__ */
|
|
2849
|
+
) : user ? /* @__PURE__ */ jsx37("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
2638
2850
|
] });
|
|
2639
2851
|
}
|
|
2640
2852
|
|
|
2641
2853
|
// src/components/navigation/SideNav.tsx
|
|
2642
|
-
import * as
|
|
2854
|
+
import * as React22 from "react";
|
|
2643
2855
|
import {
|
|
2644
2856
|
Button as AriaButton12,
|
|
2645
2857
|
Disclosure,
|
|
@@ -2657,11 +2869,11 @@ import {
|
|
|
2657
2869
|
Separator as AriaSeparator2,
|
|
2658
2870
|
Header
|
|
2659
2871
|
} from "react-aria-components";
|
|
2660
|
-
import { jsx as
|
|
2872
|
+
import { jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2661
2873
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2662
2874
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2663
2875
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2664
|
-
return /* @__PURE__ */
|
|
2876
|
+
return /* @__PURE__ */ jsx38(
|
|
2665
2877
|
AriaMenu,
|
|
2666
2878
|
{
|
|
2667
2879
|
className: cx("pire-menu", className),
|
|
@@ -2685,35 +2897,35 @@ function MenuItem({
|
|
|
2685
2897
|
...rest
|
|
2686
2898
|
}) {
|
|
2687
2899
|
const keys = shortcutKeys(shortcut);
|
|
2688
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ jsxs29(
|
|
2689
2901
|
AriaMenuItem,
|
|
2690
2902
|
{
|
|
2691
2903
|
className: cx("pire-menu-item", className),
|
|
2692
2904
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
2693
2905
|
...rest,
|
|
2694
2906
|
children: [
|
|
2695
|
-
icon ? /* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2698
|
-
description ? /* @__PURE__ */
|
|
2907
|
+
icon ? /* @__PURE__ */ jsx38(Icon, { name: icon, size: 16, className: "pire-menu-item-icon" }) : null,
|
|
2908
|
+
/* @__PURE__ */ jsxs29("span", { className: "pire-menu-item-body", children: [
|
|
2909
|
+
/* @__PURE__ */ jsx38("span", { className: "pire-menu-item-label", children }),
|
|
2910
|
+
description ? /* @__PURE__ */ jsx38("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
2699
2911
|
] }),
|
|
2700
|
-
keys.length ? /* @__PURE__ */
|
|
2912
|
+
keys.length ? /* @__PURE__ */ jsx38("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ jsx38(Kbd, { size: "sm", children: cap }, `${cap}-${index}`)) }) : null
|
|
2701
2913
|
]
|
|
2702
2914
|
}
|
|
2703
2915
|
);
|
|
2704
2916
|
}
|
|
2705
2917
|
function MenuSection({ title, children, className, ...rest }) {
|
|
2706
|
-
return /* @__PURE__ */
|
|
2707
|
-
title ? /* @__PURE__ */
|
|
2918
|
+
return /* @__PURE__ */ jsxs29(AriaMenuSection, { className: cx("pire-menu-section", className), ...rest, children: [
|
|
2919
|
+
title ? /* @__PURE__ */ jsx38(Header, { className: "pire-menu-section-title", children: title }) : null,
|
|
2708
2920
|
children
|
|
2709
2921
|
] });
|
|
2710
2922
|
}
|
|
2711
2923
|
function MenuSeparator({ className }) {
|
|
2712
|
-
return /* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ jsx38(AriaSeparator2, { className: cx("pire-menu-separator", className) });
|
|
2713
2925
|
}
|
|
2714
2926
|
|
|
2715
2927
|
// src/components/navigation/SideNav.tsx
|
|
2716
|
-
import { jsx as
|
|
2928
|
+
import { jsx as jsx39, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2717
2929
|
function findActiveParent(groups, value) {
|
|
2718
2930
|
if (value == null) return void 0;
|
|
2719
2931
|
for (const group of groups) {
|
|
@@ -2739,10 +2951,10 @@ function SideNav({
|
|
|
2739
2951
|
const msg = usePireMessages();
|
|
2740
2952
|
const activeParent = findActiveParent(groups, value);
|
|
2741
2953
|
const isControlled = expandedIds != null;
|
|
2742
|
-
const [ownExpanded, setOwnExpanded] =
|
|
2954
|
+
const [ownExpanded, setOwnExpanded] = React22.useState(
|
|
2743
2955
|
() => new Set(defaultExpandedIds ?? (activeParent ? [activeParent] : []))
|
|
2744
2956
|
);
|
|
2745
|
-
const [lastValue, setLastValue] =
|
|
2957
|
+
const [lastValue, setLastValue] = React22.useState(value);
|
|
2746
2958
|
if (value !== lastValue) {
|
|
2747
2959
|
setLastValue(value);
|
|
2748
2960
|
if (!isControlled && activeParent && !ownExpanded.has(activeParent)) {
|
|
@@ -2762,7 +2974,7 @@ function SideNav({
|
|
|
2762
2974
|
};
|
|
2763
2975
|
const renderRow = (item, onPress, isGroup) => {
|
|
2764
2976
|
const selected = !isGroup && item.id === value;
|
|
2765
|
-
const button = /* @__PURE__ */
|
|
2977
|
+
const button = /* @__PURE__ */ jsxs30(
|
|
2766
2978
|
AriaButton12,
|
|
2767
2979
|
{
|
|
2768
2980
|
className: "pire-sidenav-item",
|
|
@@ -2772,37 +2984,37 @@ function SideNav({
|
|
|
2772
2984
|
"aria-label": collapsed ? item.label : void 0,
|
|
2773
2985
|
onPress,
|
|
2774
2986
|
children: [
|
|
2775
|
-
item.icon ? /* @__PURE__ */
|
|
2776
|
-
collapsed ? null : /* @__PURE__ */
|
|
2777
|
-
item.count != null && !collapsed ? /* @__PURE__ */
|
|
2987
|
+
item.icon ? /* @__PURE__ */ jsx39(Icon, { name: item.icon, size: 16 }) : null,
|
|
2988
|
+
collapsed ? null : /* @__PURE__ */ jsx39("span", { children: item.label }),
|
|
2989
|
+
item.count != null && !collapsed ? /* @__PURE__ */ jsx39("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
2778
2990
|
]
|
|
2779
2991
|
},
|
|
2780
2992
|
item.id
|
|
2781
2993
|
);
|
|
2782
|
-
return collapsed ? /* @__PURE__ */
|
|
2994
|
+
return collapsed ? /* @__PURE__ */ jsx39(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
2783
2995
|
};
|
|
2784
|
-
const renderRailFlyout = (item) => /* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2996
|
+
const renderRailFlyout = (item) => /* @__PURE__ */ jsxs30(MenuTrigger2, { children: [
|
|
2997
|
+
/* @__PURE__ */ jsx39(
|
|
2786
2998
|
AriaButton12,
|
|
2787
2999
|
{
|
|
2788
3000
|
className: "pire-sidenav-item",
|
|
2789
3001
|
"aria-label": item.label,
|
|
2790
3002
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2791
|
-
children: item.icon ? /* @__PURE__ */
|
|
3003
|
+
children: item.icon ? /* @__PURE__ */ jsx39(Icon, { name: item.icon, size: 16 }) : null
|
|
2792
3004
|
}
|
|
2793
3005
|
),
|
|
2794
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ jsx39(Popover7, { className: "pire-popover", placement: "right top", offset: 4, children: /* @__PURE__ */ jsx39(
|
|
2795
3007
|
Menu,
|
|
2796
3008
|
{
|
|
2797
3009
|
"aria-label": item.label,
|
|
2798
3010
|
className: "pire-sidenav-flyout",
|
|
2799
3011
|
onAction: (key) => onChange?.(String(key)),
|
|
2800
|
-
children: (item.items ?? []).map((child) => /* @__PURE__ */
|
|
3012
|
+
children: (item.items ?? []).map((child) => /* @__PURE__ */ jsx39(MenuItem, { id: child.id, children: child.label }, child.id))
|
|
2801
3013
|
}
|
|
2802
3014
|
) })
|
|
2803
3015
|
] }, item.id);
|
|
2804
|
-
const renderSection = (item) => /* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
3016
|
+
const renderSection = (item) => /* @__PURE__ */ jsxs30(Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
3017
|
+
/* @__PURE__ */ jsxs30(
|
|
2806
3018
|
AriaButton12,
|
|
2807
3019
|
{
|
|
2808
3020
|
slot: "trigger",
|
|
@@ -2810,16 +3022,16 @@ function SideNav({
|
|
|
2810
3022
|
"data-kind": "group",
|
|
2811
3023
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
2812
3024
|
children: [
|
|
2813
|
-
item.icon ? /* @__PURE__ */
|
|
2814
|
-
/* @__PURE__ */
|
|
2815
|
-
item.count != null ? /* @__PURE__ */
|
|
2816
|
-
/* @__PURE__ */
|
|
3025
|
+
item.icon ? /* @__PURE__ */ jsx39(Icon, { name: item.icon, size: 16 }) : null,
|
|
3026
|
+
/* @__PURE__ */ jsx39("span", { children: item.label }),
|
|
3027
|
+
item.count != null ? /* @__PURE__ */ jsx39("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
3028
|
+
/* @__PURE__ */ jsx39(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
2817
3029
|
]
|
|
2818
3030
|
}
|
|
2819
3031
|
),
|
|
2820
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsx39(DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
2821
3033
|
const selected = child.id === value;
|
|
2822
|
-
return /* @__PURE__ */
|
|
3034
|
+
return /* @__PURE__ */ jsxs30(
|
|
2823
3035
|
AriaButton12,
|
|
2824
3036
|
{
|
|
2825
3037
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
@@ -2827,15 +3039,15 @@ function SideNav({
|
|
|
2827
3039
|
"aria-current": selected ? "page" : void 0,
|
|
2828
3040
|
onPress: () => onChange?.(child.id),
|
|
2829
3041
|
children: [
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
child.count != null ? /* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsx39("span", { children: child.label }),
|
|
3043
|
+
child.count != null ? /* @__PURE__ */ jsx39("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
2832
3044
|
]
|
|
2833
3045
|
},
|
|
2834
3046
|
child.id
|
|
2835
3047
|
);
|
|
2836
3048
|
}) })
|
|
2837
3049
|
] }, item.id);
|
|
2838
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsxs30(
|
|
2839
3051
|
"nav",
|
|
2840
3052
|
{
|
|
2841
3053
|
className: cx("pire-sidenav", className),
|
|
@@ -2851,9 +3063,9 @@ function SideNav({
|
|
|
2851
3063
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
2852
3064
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
2853
3065
|
});
|
|
2854
|
-
return /* @__PURE__ */
|
|
2855
|
-
group.label && !collapsed ? /* @__PURE__ */
|
|
2856
|
-
hasSections ? /* @__PURE__ */
|
|
3066
|
+
return /* @__PURE__ */ jsxs30("div", { className: "pire-sidenav-group", children: [
|
|
3067
|
+
group.label && !collapsed ? /* @__PURE__ */ jsx39("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
3068
|
+
hasSections ? /* @__PURE__ */ jsx39(
|
|
2857
3069
|
DisclosureGroup,
|
|
2858
3070
|
{
|
|
2859
3071
|
className: "pire-sidenav-tree",
|
|
@@ -2865,24 +3077,24 @@ function SideNav({
|
|
|
2865
3077
|
) : rows
|
|
2866
3078
|
] }, group.label ?? gi);
|
|
2867
3079
|
}),
|
|
2868
|
-
footer ? /* @__PURE__ */
|
|
3080
|
+
footer ? /* @__PURE__ */ jsx39("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
2869
3081
|
]
|
|
2870
3082
|
}
|
|
2871
3083
|
);
|
|
2872
3084
|
}
|
|
2873
3085
|
|
|
2874
3086
|
// src/components/navigation/ShellRail.tsx
|
|
2875
|
-
import * as
|
|
3087
|
+
import * as React23 from "react";
|
|
2876
3088
|
import { Button as AriaButton13 } from "react-aria-components";
|
|
2877
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2878
3090
|
function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
2879
3091
|
const msg = usePireMessages();
|
|
2880
|
-
return /* @__PURE__ */
|
|
3092
|
+
return /* @__PURE__ */ jsx40("nav", { className: cx("pire-shellrail", className), "aria-label": msg.shellRailLabel, ...rest, children: groups.map((group, gi) => (
|
|
2881
3093
|
// The divider is a sibling of the groups rather than a pseudo-element on one, because the
|
|
2882
3094
|
// scrolling zone would carry its own rule out of view on the first wheel event.
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
gi > 0 ? /* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
3095
|
+
/* @__PURE__ */ jsxs31(React23.Fragment, { children: [
|
|
3096
|
+
gi > 0 ? /* @__PURE__ */ jsx40("div", { className: "pire-shellrail-divider" }) : null,
|
|
3097
|
+
/* @__PURE__ */ jsx40("div", { className: "pire-shellrail-group", "data-scroll": group.isScrollable ? "true" : void 0, children: group.items.map((item) => /* @__PURE__ */ jsx40(Tooltip, { label: item.label, placement: "right", children: /* @__PURE__ */ jsx40(
|
|
2886
3098
|
AriaButton13,
|
|
2887
3099
|
{
|
|
2888
3100
|
className: "pire-shellrail-item",
|
|
@@ -2890,7 +3102,7 @@ function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
|
2890
3102
|
"data-selected": item.id === value ? "true" : void 0,
|
|
2891
3103
|
"aria-current": item.id === value ? "true" : void 0,
|
|
2892
3104
|
onPress: () => onChange?.(item.id),
|
|
2893
|
-
children: /* @__PURE__ */
|
|
3105
|
+
children: /* @__PURE__ */ jsx40("span", { className: "pire-shellrail-tile", children: /* @__PURE__ */ jsx40(Icon, { name: item.icon, size: 20 }) })
|
|
2894
3106
|
}
|
|
2895
3107
|
) }, item.id)) })
|
|
2896
3108
|
] }, group.items[0]?.id ?? gi)
|
|
@@ -2899,9 +3111,9 @@ function ShellRail({ groups, value, onChange, className, ...rest }) {
|
|
|
2899
3111
|
|
|
2900
3112
|
// src/components/navigation/Tabs.tsx
|
|
2901
3113
|
import { Tabs as AriaTabs, TabList, Tab as AriaTab, TabPanel } from "react-aria-components";
|
|
2902
|
-
import { jsx as
|
|
3114
|
+
import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2903
3115
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
2904
|
-
return /* @__PURE__ */
|
|
3116
|
+
return /* @__PURE__ */ jsxs32(
|
|
2905
3117
|
AriaTabs,
|
|
2906
3118
|
{
|
|
2907
3119
|
className,
|
|
@@ -2910,12 +3122,12 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
2910
3122
|
defaultSelectedKey: defaultValue,
|
|
2911
3123
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
2912
3124
|
children: [
|
|
2913
|
-
/* @__PURE__ */
|
|
2914
|
-
item.icon ? /* @__PURE__ */
|
|
3125
|
+
/* @__PURE__ */ jsx41(TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ jsxs32(AriaTab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
3126
|
+
item.icon ? /* @__PURE__ */ jsx41(Icon, { name: item.icon, size: 16 }) : null,
|
|
2915
3127
|
item.label,
|
|
2916
|
-
item.count != null ? /* @__PURE__ */
|
|
3128
|
+
item.count != null ? /* @__PURE__ */ jsx41("span", { className: "pire-tab-count", children: item.count }) : null
|
|
2917
3129
|
] }) }),
|
|
2918
|
-
items.map((item) => /* @__PURE__ */
|
|
3130
|
+
items.map((item) => /* @__PURE__ */ jsx41(TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
2919
3131
|
]
|
|
2920
3132
|
}
|
|
2921
3133
|
);
|
|
@@ -2923,9 +3135,9 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
2923
3135
|
|
|
2924
3136
|
// src/components/navigation/Breadcrumb.tsx
|
|
2925
3137
|
import { Breadcrumbs as AriaBreadcrumbs, Breadcrumb as AriaBreadcrumb, Link as Link2 } from "react-aria-components";
|
|
2926
|
-
import { jsx as
|
|
3138
|
+
import { jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2927
3139
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
2928
|
-
return /* @__PURE__ */
|
|
3140
|
+
return /* @__PURE__ */ jsx42(
|
|
2929
3141
|
AriaBreadcrumbs,
|
|
2930
3142
|
{
|
|
2931
3143
|
className: cx("pire-breadcrumbs", className),
|
|
@@ -2934,9 +3146,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2934
3146
|
onAction: (key) => onNavigate?.(String(key)),
|
|
2935
3147
|
children: (item) => {
|
|
2936
3148
|
const last = items[items.length - 1] === item;
|
|
2937
|
-
return /* @__PURE__ */
|
|
2938
|
-
last ? item.label : /* @__PURE__ */
|
|
2939
|
-
last ? null : /* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ jsxs33(AriaBreadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
3150
|
+
last ? item.label : /* @__PURE__ */ jsx42(Link2, { href: item.href, children: item.label }),
|
|
3151
|
+
last ? null : /* @__PURE__ */ jsx42(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
2940
3152
|
] });
|
|
2941
3153
|
}
|
|
2942
3154
|
}
|
|
@@ -2944,7 +3156,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2944
3156
|
}
|
|
2945
3157
|
|
|
2946
3158
|
// src/components/navigation/Pagination.tsx
|
|
2947
|
-
import { jsx as
|
|
3159
|
+
import { jsx as jsx43, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2948
3160
|
function Pagination({
|
|
2949
3161
|
page = 1,
|
|
2950
3162
|
pageSize = 25,
|
|
@@ -2959,9 +3171,9 @@ function Pagination({
|
|
|
2959
3171
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2960
3172
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
2961
3173
|
const to = Math.min(total, page * pageSize);
|
|
2962
|
-
return /* @__PURE__ */
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsxs34("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
3175
|
+
/* @__PURE__ */ jsx43("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
3176
|
+
/* @__PURE__ */ jsx43(
|
|
2965
3177
|
IconButton,
|
|
2966
3178
|
{
|
|
2967
3179
|
icon: "chevron-left",
|
|
@@ -2972,8 +3184,8 @@ function Pagination({
|
|
|
2972
3184
|
onPress: () => onPageChange?.(page - 1)
|
|
2973
3185
|
}
|
|
2974
3186
|
),
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ jsx43("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
3188
|
+
/* @__PURE__ */ jsx43(
|
|
2977
3189
|
IconButton,
|
|
2978
3190
|
{
|
|
2979
3191
|
icon: "chevron-right",
|
|
@@ -2984,7 +3196,7 @@ function Pagination({
|
|
|
2984
3196
|
onPress: () => onPageChange?.(page + 1)
|
|
2985
3197
|
}
|
|
2986
3198
|
),
|
|
2987
|
-
onPageSizeChange ? /* @__PURE__ */
|
|
3199
|
+
onPageSizeChange ? /* @__PURE__ */ jsx43(
|
|
2988
3200
|
Select,
|
|
2989
3201
|
{
|
|
2990
3202
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -2999,8 +3211,195 @@ function Pagination({
|
|
|
2999
3211
|
] });
|
|
3000
3212
|
}
|
|
3001
3213
|
|
|
3214
|
+
// src/components/navigation/Ribbon.tsx
|
|
3215
|
+
import * as React24 from "react";
|
|
3216
|
+
import { Tabs as AriaTabs2, TabList as TabList2, Tab as AriaTab2, TabPanel as TabPanel2, Toolbar, Button as Button3 } from "react-aria-components";
|
|
3217
|
+
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3218
|
+
var outside = (what, parent) => {
|
|
3219
|
+
const Config = () => {
|
|
3220
|
+
throw new Error(`[pire] ${what} must be a child of ${parent}.`);
|
|
3221
|
+
};
|
|
3222
|
+
Object.defineProperty(Config, "name", { value: what });
|
|
3223
|
+
Config.displayName = what;
|
|
3224
|
+
return Config;
|
|
3225
|
+
};
|
|
3226
|
+
var RibbonTab = outside("Ribbon.Tab", "Ribbon");
|
|
3227
|
+
var RibbonGroup = outside("Ribbon.Group", "Ribbon.Tab");
|
|
3228
|
+
var RibbonCommand = outside("Ribbon.Command", "Ribbon.Group");
|
|
3229
|
+
var CONFIG_ELEMENTS = /* @__PURE__ */ new Set([RibbonTab, RibbonGroup, RibbonCommand]);
|
|
3230
|
+
function describe(child) {
|
|
3231
|
+
if (!React24.isValidElement(child)) return JSON.stringify(child);
|
|
3232
|
+
if (typeof child.type === "string") return `<${child.type}>`;
|
|
3233
|
+
const type = child.type;
|
|
3234
|
+
return type?.displayName || type?.name || "a component";
|
|
3235
|
+
}
|
|
3236
|
+
function childrenOfType(children, type, what, parent) {
|
|
3237
|
+
const out = [];
|
|
3238
|
+
const walk = (nodes, path) => {
|
|
3239
|
+
React24.Children.forEach(nodes, (child, i) => {
|
|
3240
|
+
if (child == null || typeof child === "boolean") return;
|
|
3241
|
+
if (React24.isValidElement(child) && child.type === React24.Fragment) {
|
|
3242
|
+
return walk(child.props.children, `${path}${i}.`);
|
|
3243
|
+
}
|
|
3244
|
+
if (!React24.isValidElement(child) || child.type !== type) {
|
|
3245
|
+
const isWrapper = React24.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3246
|
+
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.` : ""));
|
|
3247
|
+
}
|
|
3248
|
+
out.push({ ...child.props, key: child.key != null ? String(child.key) : `${path}${i}` });
|
|
3249
|
+
});
|
|
3250
|
+
};
|
|
3251
|
+
walk(children, "");
|
|
3252
|
+
return out;
|
|
3253
|
+
}
|
|
3254
|
+
function readTabs(children) {
|
|
3255
|
+
return childrenOfType(children, RibbonTab, "Ribbon.Tab", "Ribbon").map((tab) => ({
|
|
3256
|
+
...tab,
|
|
3257
|
+
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map((group) => ({
|
|
3258
|
+
...group,
|
|
3259
|
+
commands: childrenOfType(group.children, RibbonCommand, "Ribbon.Command", "Ribbon.Group")
|
|
3260
|
+
}))
|
|
3261
|
+
}));
|
|
3262
|
+
}
|
|
3263
|
+
function Command({ command, selectionCount, inBar }) {
|
|
3264
|
+
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3265
|
+
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3266
|
+
return /* @__PURE__ */ jsxs35(
|
|
3267
|
+
Button3,
|
|
3268
|
+
{
|
|
3269
|
+
className: "pire-ribbon-command",
|
|
3270
|
+
"data-size": size,
|
|
3271
|
+
isDisabled,
|
|
3272
|
+
onPress: command.onPress,
|
|
3273
|
+
children: [
|
|
3274
|
+
command.icon ? /* @__PURE__ */ jsx44(Icon, { name: command.icon, size: size === "lg" ? 20 : 16 }) : null,
|
|
3275
|
+
/* @__PURE__ */ jsx44("span", { className: "pire-ribbon-command-label", children: command.label })
|
|
3276
|
+
]
|
|
3277
|
+
}
|
|
3278
|
+
);
|
|
3279
|
+
}
|
|
3280
|
+
function Group8({ group, selectionCount }) {
|
|
3281
|
+
const large = group.commands.filter((c) => (c.size ?? "sm") === "lg");
|
|
3282
|
+
const small = group.commands.filter((c) => (c.size ?? "sm") !== "lg");
|
|
3283
|
+
return /* @__PURE__ */ jsxs35("div", { className: "pire-ribbon-group", role: "group", "aria-label": group.caption, children: [
|
|
3284
|
+
/* @__PURE__ */ jsxs35("div", { className: "pire-ribbon-group-body", children: [
|
|
3285
|
+
large.map((c) => /* @__PURE__ */ jsx44(Command, { command: c, selectionCount }, c.key)),
|
|
3286
|
+
small.length ? /* @__PURE__ */ jsx44("div", { className: "pire-ribbon-stack", children: small.map((c) => /* @__PURE__ */ jsx44(Command, { command: c, selectionCount }, c.key)) }) : null
|
|
3287
|
+
] }),
|
|
3288
|
+
/* @__PURE__ */ jsx44("div", { className: "pire-ribbon-caption", "aria-hidden": "true", children: group.caption })
|
|
3289
|
+
] });
|
|
3290
|
+
}
|
|
3291
|
+
function barBlocks(tabs) {
|
|
3292
|
+
const blocks = [];
|
|
3293
|
+
for (const tab of tabs) {
|
|
3294
|
+
if (tab.isContextual) continue;
|
|
3295
|
+
for (const group of tab.groups) {
|
|
3296
|
+
const commands = group.commands.filter((c) => c.inBar);
|
|
3297
|
+
if (commands.length) blocks.push({ key: `${tab.key}:${group.key}`, commands });
|
|
3298
|
+
}
|
|
3299
|
+
}
|
|
3300
|
+
return blocks;
|
|
3301
|
+
}
|
|
3302
|
+
function Ribbon({
|
|
3303
|
+
children,
|
|
3304
|
+
value,
|
|
3305
|
+
defaultValue,
|
|
3306
|
+
onChange,
|
|
3307
|
+
isCollapsed,
|
|
3308
|
+
onCollapsedChange,
|
|
3309
|
+
leading,
|
|
3310
|
+
actions,
|
|
3311
|
+
selectionCount,
|
|
3312
|
+
className,
|
|
3313
|
+
style,
|
|
3314
|
+
...rest
|
|
3315
|
+
}) {
|
|
3316
|
+
const msg = usePireMessages();
|
|
3317
|
+
const tabs = readTabs(children);
|
|
3318
|
+
const count = selectionCount ?? 0;
|
|
3319
|
+
const visible = tabs.filter((tab) => !tab.isContextual || count > 0);
|
|
3320
|
+
const fallback = visible[0]?.id;
|
|
3321
|
+
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3322
|
+
const requested = value ?? ownTab;
|
|
3323
|
+
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3324
|
+
const select = React24.useCallback((id) => {
|
|
3325
|
+
setOwnTab(id);
|
|
3326
|
+
onChange?.(id);
|
|
3327
|
+
}, [onChange]);
|
|
3328
|
+
const hadSelection = React24.useRef(false);
|
|
3329
|
+
React24.useEffect(() => {
|
|
3330
|
+
const has = count > 0;
|
|
3331
|
+
if (has === hadSelection.current) return;
|
|
3332
|
+
hadSelection.current = has;
|
|
3333
|
+
const contextual = tabs.find((tab) => tab.isContextual);
|
|
3334
|
+
if (!contextual) return;
|
|
3335
|
+
if (has) select(contextual.id);
|
|
3336
|
+
else if (requested === contextual.id) select(tabs.find((tab) => !tab.isContextual)?.id ?? "");
|
|
3337
|
+
}, [count, tabs, requested, select]);
|
|
3338
|
+
const [ownCollapsed, setOwnCollapsed] = React24.useState(false);
|
|
3339
|
+
const collapsed = isCollapsed ?? ownCollapsed;
|
|
3340
|
+
const toggleRef = React24.useRef(null);
|
|
3341
|
+
const restoreFocus = React24.useRef(false);
|
|
3342
|
+
React24.useLayoutEffect(() => {
|
|
3343
|
+
if (!restoreFocus.current) return;
|
|
3344
|
+
restoreFocus.current = false;
|
|
3345
|
+
toggleRef.current?.focus();
|
|
3346
|
+
});
|
|
3347
|
+
const bandId = React24.useId();
|
|
3348
|
+
const bandDomId = { id: bandId };
|
|
3349
|
+
const toggle = /* @__PURE__ */ jsx44(
|
|
3350
|
+
Button3,
|
|
3351
|
+
{
|
|
3352
|
+
ref: toggleRef,
|
|
3353
|
+
className: "pire-ribbon-toggle",
|
|
3354
|
+
"aria-expanded": !collapsed,
|
|
3355
|
+
"aria-controls": bandId,
|
|
3356
|
+
"aria-label": collapsed ? msg.ribbonExpand : msg.ribbonCollapse,
|
|
3357
|
+
onPress: () => {
|
|
3358
|
+
restoreFocus.current = document.activeElement === toggleRef.current;
|
|
3359
|
+
setOwnCollapsed(!collapsed);
|
|
3360
|
+
onCollapsedChange?.(!collapsed);
|
|
3361
|
+
},
|
|
3362
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: collapsed ? "chevron-down" : "chevron-up", size: 16 })
|
|
3363
|
+
}
|
|
3364
|
+
);
|
|
3365
|
+
if (collapsed) {
|
|
3366
|
+
const blocks = barBlocks(tabs);
|
|
3367
|
+
return /* @__PURE__ */ jsx44("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs35(Toolbar, { className: "pire-ribbon-bar", "aria-label": rest["aria-label"], children: [
|
|
3368
|
+
leading ? /* @__PURE__ */ jsx44("div", { className: "pire-ribbon-leading", children: leading }) : null,
|
|
3369
|
+
blocks.map((block, i) => /* @__PURE__ */ jsxs35(React24.Fragment, { children: [
|
|
3370
|
+
i > 0 || leading ? /* @__PURE__ */ jsx44("span", { className: "pire-ribbon-bar-sep" }) : null,
|
|
3371
|
+
block.commands.map((c) => /* @__PURE__ */ jsx44(Command, { command: c, selectionCount: count, inBar: true }, c.key))
|
|
3372
|
+
] }, block.key)),
|
|
3373
|
+
/* @__PURE__ */ jsx44("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3374
|
+
actions,
|
|
3375
|
+
toggle
|
|
3376
|
+
] }) });
|
|
3377
|
+
}
|
|
3378
|
+
return /* @__PURE__ */ jsx44("div", { className: cx("pire-ribbon", className), style, children: /* @__PURE__ */ jsxs35(AriaTabs2, { selectedKey: selected, onSelectionChange: (k) => select(String(k)), children: [
|
|
3379
|
+
/* @__PURE__ */ jsx44(TabList2, { className: "pire-ribbon-tablist", "aria-label": rest["aria-label"], children: visible.map((tab) => /* @__PURE__ */ jsx44(
|
|
3380
|
+
AriaTab2,
|
|
3381
|
+
{
|
|
3382
|
+
id: tab.id,
|
|
3383
|
+
className: "pire-ribbon-tab",
|
|
3384
|
+
"data-contextual": tab.isContextual ? "true" : void 0,
|
|
3385
|
+
children: tab.label
|
|
3386
|
+
},
|
|
3387
|
+
tab.key
|
|
3388
|
+
)) }),
|
|
3389
|
+
visible.map((tab) => /* @__PURE__ */ jsx44(TabPanel2, { id: tab.id, className: "pire-ribbon-panel", children: /* @__PURE__ */ jsxs35(Toolbar, { ...bandDomId, className: "pire-ribbon-band", "aria-label": msg.ribbonLabel, children: [
|
|
3390
|
+
tab.groups.map((group) => /* @__PURE__ */ jsx44(Group8, { group, selectionCount: count }, group.key)),
|
|
3391
|
+
/* @__PURE__ */ jsx44("span", { className: "pire-ribbon-bar-spacer" }),
|
|
3392
|
+
actions,
|
|
3393
|
+
toggle
|
|
3394
|
+
] }) }, tab.key))
|
|
3395
|
+
] }) });
|
|
3396
|
+
}
|
|
3397
|
+
Ribbon.Tab = RibbonTab;
|
|
3398
|
+
Ribbon.Group = RibbonGroup;
|
|
3399
|
+
Ribbon.Command = RibbonCommand;
|
|
3400
|
+
|
|
3002
3401
|
// src/components/feedback/InlineMessage.tsx
|
|
3003
|
-
import { jsx as
|
|
3402
|
+
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3004
3403
|
var KIND_ICON = {
|
|
3005
3404
|
info: "info",
|
|
3006
3405
|
success: "check-circle-2",
|
|
@@ -3010,7 +3409,7 @@ var KIND_ICON = {
|
|
|
3010
3409
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
3011
3410
|
const msg = usePireMessages();
|
|
3012
3411
|
const assertive = kind === "error" || kind === "warning";
|
|
3013
|
-
return /* @__PURE__ */
|
|
3412
|
+
return /* @__PURE__ */ jsxs36(
|
|
3014
3413
|
"div",
|
|
3015
3414
|
{
|
|
3016
3415
|
className: cx("pire-msg", className),
|
|
@@ -3019,21 +3418,21 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
3019
3418
|
"aria-live": assertive ? "assertive" : "polite",
|
|
3020
3419
|
...rest,
|
|
3021
3420
|
children: [
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
title ? /* @__PURE__ */
|
|
3025
|
-
children ? /* @__PURE__ */
|
|
3421
|
+
/* @__PURE__ */ jsx45(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
3422
|
+
/* @__PURE__ */ jsxs36("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
3423
|
+
title ? /* @__PURE__ */ jsx45("span", { className: "pire-msg-title", children: title }) : null,
|
|
3424
|
+
children ? /* @__PURE__ */ jsx45("span", { className: "pire-msg-body", children }) : null,
|
|
3026
3425
|
action
|
|
3027
3426
|
] }),
|
|
3028
|
-
onClose ? /* @__PURE__ */
|
|
3427
|
+
onClose ? /* @__PURE__ */ jsx45(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
3029
3428
|
]
|
|
3030
3429
|
}
|
|
3031
3430
|
);
|
|
3032
3431
|
}
|
|
3033
3432
|
|
|
3034
3433
|
// src/components/feedback/Toast.tsx
|
|
3035
|
-
import * as
|
|
3036
|
-
import { jsx as
|
|
3434
|
+
import * as React25 from "react";
|
|
3435
|
+
import { jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3037
3436
|
var KIND_ICON2 = {
|
|
3038
3437
|
info: "info",
|
|
3039
3438
|
success: "check-circle-2",
|
|
@@ -3042,7 +3441,7 @@ var KIND_ICON2 = {
|
|
|
3042
3441
|
};
|
|
3043
3442
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
3044
3443
|
const msg = usePireMessages();
|
|
3045
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ jsxs37(
|
|
3046
3445
|
"div",
|
|
3047
3446
|
{
|
|
3048
3447
|
className: cx("pire-toast", className),
|
|
@@ -3051,40 +3450,40 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3051
3450
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
3052
3451
|
...rest,
|
|
3053
3452
|
children: [
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3056
|
-
onClose ? /* @__PURE__ */
|
|
3453
|
+
/* @__PURE__ */ jsx46(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
3454
|
+
/* @__PURE__ */ jsx46("span", { style: { flex: 1 }, children }),
|
|
3455
|
+
onClose ? /* @__PURE__ */ jsx46(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
3057
3456
|
]
|
|
3058
3457
|
}
|
|
3059
3458
|
);
|
|
3060
3459
|
}
|
|
3061
|
-
var ToastContext =
|
|
3460
|
+
var ToastContext = React25.createContext(null);
|
|
3062
3461
|
function ToastProvider({ children, timeout = 6e3 }) {
|
|
3063
3462
|
const msg = usePireMessages();
|
|
3064
|
-
const [toasts, setToasts] =
|
|
3065
|
-
const close =
|
|
3066
|
-
const add =
|
|
3463
|
+
const [toasts, setToasts] = React25.useState([]);
|
|
3464
|
+
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3465
|
+
const add = React25.useCallback((toast) => {
|
|
3067
3466
|
const id = Math.random().toString(36).slice(2);
|
|
3068
3467
|
setToasts((t) => [...t, { ...toast, id }]);
|
|
3069
3468
|
const ms = toast.timeout ?? timeout;
|
|
3070
3469
|
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3071
3470
|
return id;
|
|
3072
3471
|
}, [close, timeout]);
|
|
3073
|
-
const value =
|
|
3074
|
-
return /* @__PURE__ */
|
|
3472
|
+
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3473
|
+
return /* @__PURE__ */ jsxs37(ToastContext.Provider, { value, children: [
|
|
3075
3474
|
children,
|
|
3076
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ jsx46("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ jsx46(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
3077
3476
|
] });
|
|
3078
3477
|
}
|
|
3079
3478
|
function useToast() {
|
|
3080
|
-
const ctx =
|
|
3479
|
+
const ctx = React25.useContext(ToastContext);
|
|
3081
3480
|
if (!ctx) throw new Error("useToast must be used inside <ToastProvider>");
|
|
3082
3481
|
return ctx;
|
|
3083
3482
|
}
|
|
3084
3483
|
|
|
3085
3484
|
// src/components/data/KpiTile.tsx
|
|
3086
3485
|
import { Button as AriaButton14 } from "react-aria-components";
|
|
3087
|
-
import { Fragment as
|
|
3486
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3088
3487
|
function KpiTile({
|
|
3089
3488
|
label,
|
|
3090
3489
|
value,
|
|
@@ -3100,50 +3499,50 @@ function KpiTile({
|
|
|
3100
3499
|
style
|
|
3101
3500
|
}) {
|
|
3102
3501
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
3103
|
-
const body = /* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3105
|
-
icon ? /* @__PURE__ */
|
|
3502
|
+
const body = /* @__PURE__ */ jsxs38(Fragment6, { children: [
|
|
3503
|
+
/* @__PURE__ */ jsxs38("span", { className: "pire-kpi-label", children: [
|
|
3504
|
+
icon ? /* @__PURE__ */ jsx47(Icon, { name: icon, size: 16 }) : null,
|
|
3106
3505
|
label
|
|
3107
3506
|
] }),
|
|
3108
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ jsxs38("span", { className: "pire-kpi-value", children: [
|
|
3109
3508
|
value,
|
|
3110
|
-
unit ? /* @__PURE__ */
|
|
3509
|
+
unit ? /* @__PURE__ */ jsx47("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
3111
3510
|
] }),
|
|
3112
|
-
delta ? /* @__PURE__ */
|
|
3113
|
-
deltaDirection ? /* @__PURE__ */
|
|
3511
|
+
delta ? /* @__PURE__ */ jsxs38("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
3512
|
+
deltaDirection ? /* @__PURE__ */ jsx47(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
3114
3513
|
delta
|
|
3115
3514
|
] }) : null,
|
|
3116
|
-
footnote ? /* @__PURE__ */
|
|
3515
|
+
footnote ? /* @__PURE__ */ jsx47("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
3117
3516
|
] });
|
|
3118
3517
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
3119
|
-
return onPress ? /* @__PURE__ */
|
|
3518
|
+
return onPress ? /* @__PURE__ */ jsx47(AriaButton14, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ jsx47("div", { ...props, children: body });
|
|
3120
3519
|
}
|
|
3121
3520
|
|
|
3122
3521
|
// src/components/data/ObjectHeader.tsx
|
|
3123
|
-
import { jsx as
|
|
3522
|
+
import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3124
3523
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
3125
|
-
return /* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ jsxs39("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3126
3525
|
breadcrumb,
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
/* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
subtitle || id ? /* @__PURE__ */
|
|
3526
|
+
/* @__PURE__ */ jsxs39("div", { className: "pire-objheader-row", children: [
|
|
3527
|
+
/* @__PURE__ */ jsxs39("div", { style: { minWidth: 0 }, children: [
|
|
3528
|
+
/* @__PURE__ */ jsx48("h1", { className: "pire-objheader-title", children: title }),
|
|
3529
|
+
subtitle || id ? /* @__PURE__ */ jsxs39("div", { className: "pire-objheader-sub", children: [
|
|
3131
3530
|
subtitle,
|
|
3132
|
-
id ? /* @__PURE__ */
|
|
3531
|
+
id ? /* @__PURE__ */ jsx48("span", { className: "pire-objheader-id", children: id }) : null
|
|
3133
3532
|
] }) : null
|
|
3134
3533
|
] }),
|
|
3135
3534
|
badge,
|
|
3136
|
-
actions ? /* @__PURE__ */
|
|
3535
|
+
actions ? /* @__PURE__ */ jsx48("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
3137
3536
|
] }),
|
|
3138
|
-
facts?.length ? /* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3140
|
-
/* @__PURE__ */
|
|
3537
|
+
facts?.length ? /* @__PURE__ */ jsx48("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ jsxs39("div", { children: [
|
|
3538
|
+
/* @__PURE__ */ jsx48("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3539
|
+
/* @__PURE__ */ jsx48("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
3141
3540
|
] }, fact.label)) }) : null
|
|
3142
3541
|
] });
|
|
3143
3542
|
}
|
|
3144
3543
|
|
|
3145
3544
|
// src/components/data/FilterBar.tsx
|
|
3146
|
-
import { jsx as
|
|
3545
|
+
import { jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3147
3546
|
function FilterBar({
|
|
3148
3547
|
children,
|
|
3149
3548
|
activeFilters = [],
|
|
@@ -3160,49 +3559,49 @@ function FilterBar({
|
|
|
3160
3559
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
3161
3560
|
const go = useMessage("filterBarGo", goLabel);
|
|
3162
3561
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
3163
|
-
return /* @__PURE__ */
|
|
3164
|
-
/* @__PURE__ */
|
|
3562
|
+
return /* @__PURE__ */ jsxs40("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
3563
|
+
/* @__PURE__ */ jsxs40("div", { className: "pire-filterbar-controls", children: [
|
|
3165
3564
|
children,
|
|
3166
|
-
onGo ? /* @__PURE__ */
|
|
3565
|
+
onGo ? /* @__PURE__ */ jsx49(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
3167
3566
|
] }),
|
|
3168
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */
|
|
3169
|
-
activeFilters.map((filter) => /* @__PURE__ */
|
|
3170
|
-
activeFilters.length && onClear ? /* @__PURE__ */
|
|
3171
|
-
resultLabel ? /* @__PURE__ */
|
|
3172
|
-
actions ? /* @__PURE__ */
|
|
3567
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ jsxs40("div", { className: "pire-filterbar-foot", children: [
|
|
3568
|
+
activeFilters.map((filter) => /* @__PURE__ */ jsx49(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
3569
|
+
activeFilters.length && onClear ? /* @__PURE__ */ jsx49(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
3570
|
+
resultLabel ? /* @__PURE__ */ jsx49("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
3571
|
+
actions ? /* @__PURE__ */ jsx49("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
3173
3572
|
] }) : null
|
|
3174
3573
|
] });
|
|
3175
3574
|
}
|
|
3176
3575
|
|
|
3177
3576
|
// src/components/data/DescriptionList.tsx
|
|
3178
|
-
import { jsx as
|
|
3577
|
+
import { jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3179
3578
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
3180
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ jsx50(
|
|
3181
3580
|
"dl",
|
|
3182
3581
|
{
|
|
3183
3582
|
className: cx("pire-dl", className),
|
|
3184
3583
|
"data-layout": layout,
|
|
3185
3584
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
3186
3585
|
...rest,
|
|
3187
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3586
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs41("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
3587
|
+
/* @__PURE__ */ jsxs41("dt", { className: "pire-dl-term", children: [
|
|
3189
3588
|
item.label,
|
|
3190
3589
|
item.hint
|
|
3191
3590
|
] }),
|
|
3192
|
-
/* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ jsx50("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
3193
3592
|
] }, i))
|
|
3194
3593
|
}
|
|
3195
3594
|
);
|
|
3196
3595
|
}
|
|
3197
3596
|
|
|
3198
3597
|
// src/components/data/Timeline.tsx
|
|
3199
|
-
import { jsx as
|
|
3598
|
+
import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3200
3599
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
3201
3600
|
const list = reverse ? [...entries].reverse() : entries;
|
|
3202
|
-
return /* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3204
|
-
/* @__PURE__ */
|
|
3205
|
-
entry.actor ? /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ jsx51("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ jsxs42("li", { className: "pire-timeline-item", children: [
|
|
3602
|
+
/* @__PURE__ */ jsx51("span", { className: "pire-timeline-time", children: entry.time }),
|
|
3603
|
+
/* @__PURE__ */ jsx51("span", { className: "pire-timeline-text", children: entry.event }),
|
|
3604
|
+
entry.actor ? /* @__PURE__ */ jsx51("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
3206
3605
|
] }, entry.id ?? i)) });
|
|
3207
3606
|
}
|
|
3208
3607
|
|
|
@@ -3248,10 +3647,10 @@ function seriesColor(series, index) {
|
|
|
3248
3647
|
const slot = series.colorIndex ?? index + 1;
|
|
3249
3648
|
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
3250
3649
|
}
|
|
3251
|
-
var
|
|
3650
|
+
var IS_DEV3 = process.env.NODE_ENV !== "production";
|
|
3252
3651
|
var warnedCharts = /* @__PURE__ */ new Set();
|
|
3253
3652
|
function warnOnSlotOverflow(series, chartLabel) {
|
|
3254
|
-
if (!
|
|
3653
|
+
if (!IS_DEV3 || warnedCharts.has(chartLabel)) return;
|
|
3255
3654
|
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
3256
3655
|
warnedCharts.add(chartLabel);
|
|
3257
3656
|
console.warn(
|
|
@@ -3259,7 +3658,7 @@ function warnOnSlotOverflow(series, chartLabel) {
|
|
|
3259
3658
|
);
|
|
3260
3659
|
}
|
|
3261
3660
|
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
3262
|
-
if (!
|
|
3661
|
+
if (!IS_DEV3 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
3263
3662
|
const complaints = [];
|
|
3264
3663
|
if (series.length > 1) {
|
|
3265
3664
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
@@ -3285,7 +3684,7 @@ function alignToCategories(series, categoryCount) {
|
|
|
3285
3684
|
}
|
|
3286
3685
|
|
|
3287
3686
|
// src/components/data/ChartFrame.tsx
|
|
3288
|
-
import { jsx as
|
|
3687
|
+
import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3289
3688
|
function seriesLegend(series) {
|
|
3290
3689
|
return series.map((one, index) => ({
|
|
3291
3690
|
key: one.id,
|
|
@@ -3308,29 +3707,29 @@ function ChartFrame({
|
|
|
3308
3707
|
children
|
|
3309
3708
|
}) {
|
|
3310
3709
|
const msg = usePireMessages();
|
|
3311
|
-
return /* @__PURE__ */
|
|
3312
|
-
title || description ? /* @__PURE__ */
|
|
3313
|
-
title ? /* @__PURE__ */
|
|
3314
|
-
description ? /* @__PURE__ */
|
|
3710
|
+
return /* @__PURE__ */ jsxs43("figure", { className: cx("pire-chart", className), style, children: [
|
|
3711
|
+
title || description ? /* @__PURE__ */ jsxs43("figcaption", { className: "pire-chart-head", children: [
|
|
3712
|
+
title ? /* @__PURE__ */ jsx52("span", { className: "pire-chart-title", children: title }) : null,
|
|
3713
|
+
description ? /* @__PURE__ */ jsx52("span", { className: "pire-chart-desc", children: description }) : null
|
|
3315
3714
|
] }) : null,
|
|
3316
|
-
legend && legend.length > 1 ? /* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3715
|
+
legend && legend.length > 1 ? /* @__PURE__ */ jsx52("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ jsxs43("li", { className: "pire-chart-legend-item", children: [
|
|
3716
|
+
/* @__PURE__ */ jsx52("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
3318
3717
|
item.label
|
|
3319
3718
|
] }, item.key)) }) : null,
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
3325
|
-
series.map((one) => /* @__PURE__ */
|
|
3719
|
+
/* @__PURE__ */ jsx52("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
3720
|
+
/* @__PURE__ */ jsx52("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ jsxs43("table", { children: [
|
|
3721
|
+
/* @__PURE__ */ jsx52("caption", { children: label }),
|
|
3722
|
+
/* @__PURE__ */ jsx52("thead", { children: /* @__PURE__ */ jsxs43("tr", { children: [
|
|
3723
|
+
/* @__PURE__ */ jsx52("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
3724
|
+
series.map((one) => /* @__PURE__ */ jsx52("th", { scope: "col", children: one.label }, one.id))
|
|
3326
3725
|
] }) }),
|
|
3327
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ jsx52("tbody", { children: categories.map((category, categoryIndex) => (
|
|
3328
3727
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3728
|
+
/* @__PURE__ */ jsxs43("tr", { children: [
|
|
3729
|
+
/* @__PURE__ */ jsx52("th", { scope: "row", children: category }),
|
|
3331
3730
|
series.map((one) => {
|
|
3332
3731
|
const value = one.values[categoryIndex];
|
|
3333
|
-
return /* @__PURE__ */
|
|
3732
|
+
return /* @__PURE__ */ jsx52("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
3334
3733
|
})
|
|
3335
3734
|
] }, categoryIndex)
|
|
3336
3735
|
)) })
|
|
@@ -3339,7 +3738,7 @@ function ChartFrame({
|
|
|
3339
3738
|
}
|
|
3340
3739
|
|
|
3341
3740
|
// src/components/data/BarChart.tsx
|
|
3342
|
-
import { jsx as
|
|
3741
|
+
import { jsx as jsx53, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3343
3742
|
function BarChart({
|
|
3344
3743
|
categories,
|
|
3345
3744
|
series: rawSeries,
|
|
@@ -3371,7 +3770,7 @@ function BarChart({
|
|
|
3371
3770
|
const value = series[0].values[categoryIndex];
|
|
3372
3771
|
return value == null ? msg.chartNoValue : formatValue(value);
|
|
3373
3772
|
};
|
|
3374
|
-
return /* @__PURE__ */
|
|
3773
|
+
return /* @__PURE__ */ jsx53(
|
|
3375
3774
|
ChartFrame,
|
|
3376
3775
|
{
|
|
3377
3776
|
label,
|
|
@@ -3384,7 +3783,7 @@ function BarChart({
|
|
|
3384
3783
|
showDataTable,
|
|
3385
3784
|
className,
|
|
3386
3785
|
style,
|
|
3387
|
-
children: !hasData ? /* @__PURE__ */
|
|
3786
|
+
children: !hasData ? /* @__PURE__ */ jsx53("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsx53(
|
|
3388
3787
|
"div",
|
|
3389
3788
|
{
|
|
3390
3789
|
className: "pire-chart-bars",
|
|
@@ -3393,12 +3792,12 @@ function BarChart({
|
|
|
3393
3792
|
style: { "--pire-chart-height": `${height}px` },
|
|
3394
3793
|
children: categories.map((category, categoryIndex) => (
|
|
3395
3794
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3396
|
-
/* @__PURE__ */
|
|
3397
|
-
/* @__PURE__ */
|
|
3398
|
-
/* @__PURE__ */
|
|
3795
|
+
/* @__PURE__ */ jsxs44("div", { className: "pire-chart-group", children: [
|
|
3796
|
+
/* @__PURE__ */ jsx53("span", { className: "pire-chart-cat", children: category }),
|
|
3797
|
+
/* @__PURE__ */ jsx53("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
3399
3798
|
const value = one.values[categoryIndex];
|
|
3400
3799
|
if (value == null) return null;
|
|
3401
|
-
return /* @__PURE__ */
|
|
3800
|
+
return /* @__PURE__ */ jsxs44(
|
|
3402
3801
|
"div",
|
|
3403
3802
|
{
|
|
3404
3803
|
className: "pire-chart-bar",
|
|
@@ -3407,8 +3806,8 @@ function BarChart({
|
|
|
3407
3806
|
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
3408
3807
|
},
|
|
3409
3808
|
children: [
|
|
3410
|
-
withValues && orientation === "vertical" ? /* @__PURE__ */
|
|
3411
|
-
/* @__PURE__ */
|
|
3809
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ jsx53("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
3810
|
+
/* @__PURE__ */ jsxs44("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3412
3811
|
series.length > 1 ? `${one.label}: ` : "",
|
|
3413
3812
|
formatValue(value)
|
|
3414
3813
|
] })
|
|
@@ -3417,7 +3816,7 @@ function BarChart({
|
|
|
3417
3816
|
one.id
|
|
3418
3817
|
);
|
|
3419
3818
|
}) }),
|
|
3420
|
-
withValues && orientation === "horizontal" ? /* @__PURE__ */
|
|
3819
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ jsx53("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
3421
3820
|
] }, categoryIndex)
|
|
3422
3821
|
))
|
|
3423
3822
|
}
|
|
@@ -3427,14 +3826,14 @@ function BarChart({
|
|
|
3427
3826
|
}
|
|
3428
3827
|
|
|
3429
3828
|
// src/components/data/LineChart.tsx
|
|
3430
|
-
import * as
|
|
3431
|
-
import { jsx as
|
|
3829
|
+
import * as React26 from "react";
|
|
3830
|
+
import { jsx as jsx54, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3432
3831
|
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
3433
3832
|
var MARKER_LIMIT = 20;
|
|
3434
|
-
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ?
|
|
3833
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React26.useEffect : React26.useLayoutEffect;
|
|
3435
3834
|
function useMeasuredWidth() {
|
|
3436
|
-
const ref =
|
|
3437
|
-
const [width, setWidth] =
|
|
3835
|
+
const ref = React26.useRef(null);
|
|
3836
|
+
const [width, setWidth] = React26.useState(0);
|
|
3438
3837
|
useIsomorphicLayoutEffect2(() => {
|
|
3439
3838
|
const element = ref.current;
|
|
3440
3839
|
if (!element) return;
|
|
@@ -3495,7 +3894,7 @@ function LineChart({
|
|
|
3495
3894
|
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
3496
3895
|
};
|
|
3497
3896
|
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
3498
|
-
return /* @__PURE__ */
|
|
3897
|
+
return /* @__PURE__ */ jsx54(
|
|
3499
3898
|
ChartFrame,
|
|
3500
3899
|
{
|
|
3501
3900
|
label,
|
|
@@ -3508,8 +3907,8 @@ function LineChart({
|
|
|
3508
3907
|
showDataTable,
|
|
3509
3908
|
className,
|
|
3510
3909
|
style,
|
|
3511
|
-
children: !hasData ? /* @__PURE__ */
|
|
3512
|
-
width > 0 ? /* @__PURE__ */
|
|
3910
|
+
children: !hasData ? /* @__PURE__ */ jsx54("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs45("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
3911
|
+
width > 0 ? /* @__PURE__ */ jsxs45(
|
|
3513
3912
|
"svg",
|
|
3514
3913
|
{
|
|
3515
3914
|
width,
|
|
@@ -3518,7 +3917,7 @@ function LineChart({
|
|
|
3518
3917
|
"aria-hidden": "true",
|
|
3519
3918
|
focusable: "false",
|
|
3520
3919
|
children: [
|
|
3521
|
-
/* @__PURE__ */
|
|
3920
|
+
/* @__PURE__ */ jsx54("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ jsx54(
|
|
3522
3921
|
"line",
|
|
3523
3922
|
{
|
|
3524
3923
|
x1: PLOT_INSET.left,
|
|
@@ -3528,8 +3927,8 @@ function LineChart({
|
|
|
3528
3927
|
},
|
|
3529
3928
|
tick
|
|
3530
3929
|
)) }),
|
|
3531
|
-
/* @__PURE__ */
|
|
3532
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ jsxs45("g", { className: "pire-chart-tick", children: [
|
|
3931
|
+
scale.ticks.map((tick) => /* @__PURE__ */ jsx54(
|
|
3533
3932
|
"text",
|
|
3534
3933
|
{
|
|
3535
3934
|
x: PLOT_INSET.left - 8,
|
|
@@ -3542,10 +3941,10 @@ function LineChart({
|
|
|
3542
3941
|
)),
|
|
3543
3942
|
categories.map((category, index) => index % labelEvery === 0 ? (
|
|
3544
3943
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3545
|
-
/* @__PURE__ */
|
|
3944
|
+
/* @__PURE__ */ jsx54("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
3546
3945
|
) : null)
|
|
3547
3946
|
] }),
|
|
3548
|
-
showArea && series[0] ? /* @__PURE__ */
|
|
3947
|
+
showArea && series[0] ? /* @__PURE__ */ jsx54(
|
|
3549
3948
|
"path",
|
|
3550
3949
|
{
|
|
3551
3950
|
d: areaFor(series[0].values),
|
|
@@ -3553,10 +3952,10 @@ function LineChart({
|
|
|
3553
3952
|
style: { fill: seriesColor(series[0], 0) }
|
|
3554
3953
|
}
|
|
3555
3954
|
) : null,
|
|
3556
|
-
/* @__PURE__ */
|
|
3557
|
-
withMarkers ? /* @__PURE__ */
|
|
3955
|
+
/* @__PURE__ */ jsx54("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ jsx54("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
3956
|
+
withMarkers ? /* @__PURE__ */ jsx54("g", { className: "pire-chart-marker", children: series.map((one, seriesIndex) => one.values.map((value, index) => value == null ? null : (
|
|
3558
3957
|
// biome-ignore lint/suspicious/noArrayIndexKey: a series is positional — the index is the point's identity, and category labels repeat.
|
|
3559
|
-
/* @__PURE__ */
|
|
3958
|
+
/* @__PURE__ */ jsx54(
|
|
3560
3959
|
"circle",
|
|
3561
3960
|
{
|
|
3562
3961
|
cx: xAt(index),
|
|
@@ -3570,18 +3969,18 @@ function LineChart({
|
|
|
3570
3969
|
]
|
|
3571
3970
|
}
|
|
3572
3971
|
) : null,
|
|
3573
|
-
/* @__PURE__ */
|
|
3972
|
+
/* @__PURE__ */ jsx54(
|
|
3574
3973
|
"div",
|
|
3575
3974
|
{
|
|
3576
3975
|
className: "pire-chart-hover",
|
|
3577
3976
|
style: { inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px` },
|
|
3578
3977
|
children: categories.map((category, categoryIndex) => (
|
|
3579
3978
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
3580
|
-
/* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3979
|
+
/* @__PURE__ */ jsx54("div", { className: "pire-chart-band", children: /* @__PURE__ */ jsxs45("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
3980
|
+
/* @__PURE__ */ jsx54("strong", { children: category }),
|
|
3582
3981
|
series.map((one) => {
|
|
3583
3982
|
const value = one.values[categoryIndex];
|
|
3584
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ jsxs45("span", { className: "pire-chart-tip-row", children: [
|
|
3585
3984
|
one.label,
|
|
3586
3985
|
": ",
|
|
3587
3986
|
value == null ? "No data" : formatValue(value)
|
|
@@ -3597,8 +3996,8 @@ function LineChart({
|
|
|
3597
3996
|
}
|
|
3598
3997
|
|
|
3599
3998
|
// src/components/data/DonutChart.tsx
|
|
3600
|
-
import * as
|
|
3601
|
-
import { jsx as
|
|
3999
|
+
import * as React27 from "react";
|
|
4000
|
+
import { jsx as jsx55, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3602
4001
|
var SEGMENT_GAP_DEGREES = 1.5;
|
|
3603
4002
|
function DonutChart({
|
|
3604
4003
|
categories,
|
|
@@ -3618,7 +4017,7 @@ function DonutChart({
|
|
|
3618
4017
|
}) {
|
|
3619
4018
|
const label = rest["aria-label"];
|
|
3620
4019
|
const msg = usePireMessages();
|
|
3621
|
-
const [hoveredIndex, setHoveredIndex] =
|
|
4020
|
+
const [hoveredIndex, setHoveredIndex] = React27.useState(null);
|
|
3622
4021
|
warnOnDonutShape(series, categories.length, label);
|
|
3623
4022
|
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
3624
4023
|
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
@@ -3635,7 +4034,7 @@ function DonutChart({
|
|
|
3635
4034
|
}));
|
|
3636
4035
|
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
3637
4036
|
let arcStart = 0;
|
|
3638
|
-
return /* @__PURE__ */
|
|
4037
|
+
return /* @__PURE__ */ jsx55(
|
|
3639
4038
|
ChartFrame,
|
|
3640
4039
|
{
|
|
3641
4040
|
label,
|
|
@@ -3648,8 +4047,8 @@ function DonutChart({
|
|
|
3648
4047
|
showDataTable,
|
|
3649
4048
|
className,
|
|
3650
4049
|
style,
|
|
3651
|
-
children: !hasData ? /* @__PURE__ */
|
|
3652
|
-
/* @__PURE__ */
|
|
4050
|
+
children: !hasData ? /* @__PURE__ */ jsx55("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ jsxs46("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
4051
|
+
/* @__PURE__ */ jsx55(
|
|
3653
4052
|
"svg",
|
|
3654
4053
|
{
|
|
3655
4054
|
width: size,
|
|
@@ -3657,13 +4056,13 @@ function DonutChart({
|
|
|
3657
4056
|
"aria-hidden": "true",
|
|
3658
4057
|
focusable: "false",
|
|
3659
4058
|
onMouseLeave: () => setHoveredIndex(null),
|
|
3660
|
-
children: /* @__PURE__ */
|
|
4059
|
+
children: /* @__PURE__ */ jsx55("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
3661
4060
|
const arcLength = segment.value / total * circumference;
|
|
3662
4061
|
const offset = arcStart;
|
|
3663
4062
|
arcStart += arcLength;
|
|
3664
4063
|
return (
|
|
3665
4064
|
// 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.
|
|
3666
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ jsx55(
|
|
3667
4066
|
"circle",
|
|
3668
4067
|
{
|
|
3669
4068
|
className: "pire-chart-arc",
|
|
@@ -3683,9 +4082,9 @@ function DonutChart({
|
|
|
3683
4082
|
}) })
|
|
3684
4083
|
}
|
|
3685
4084
|
),
|
|
3686
|
-
/* @__PURE__ */
|
|
3687
|
-
/* @__PURE__ */
|
|
3688
|
-
/* @__PURE__ */
|
|
4085
|
+
/* @__PURE__ */ jsxs46("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
4086
|
+
/* @__PURE__ */ jsx55("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
4087
|
+
/* @__PURE__ */ jsx55("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
3689
4088
|
] })
|
|
3690
4089
|
] })
|
|
3691
4090
|
}
|
|
@@ -3697,14 +4096,14 @@ function colorForSegment(index) {
|
|
|
3697
4096
|
|
|
3698
4097
|
// src/components/data/LinkList.tsx
|
|
3699
4098
|
import { Button as AriaButton15 } from "react-aria-components";
|
|
3700
|
-
import { jsx as
|
|
4099
|
+
import { jsx as jsx56, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
3701
4100
|
function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
3702
|
-
return /* @__PURE__ */
|
|
3703
|
-
const keySlot = item.key ? /* @__PURE__ */
|
|
3704
|
-
const textSlot = item.text ? /* @__PURE__ */
|
|
4101
|
+
return /* @__PURE__ */ jsx56("div", { className: cx("pire-linklist", className), role: "list", "data-emphasis": emphasis, ...rest, children: items.map((item) => {
|
|
4102
|
+
const keySlot = item.key ? /* @__PURE__ */ jsx56("span", { className: "pire-linklist-key", children: item.key }) : null;
|
|
4103
|
+
const textSlot = item.text ? /* @__PURE__ */ jsx56("span", { className: "pire-linklist-text", children: item.text }) : null;
|
|
3705
4104
|
const [first, second] = emphasis === "text" ? [textSlot, keySlot] : [keySlot, textSlot];
|
|
3706
|
-
return /* @__PURE__ */
|
|
3707
|
-
item.icon ? /* @__PURE__ */
|
|
4105
|
+
return /* @__PURE__ */ jsx56("div", { role: "listitem", className: "pire-linklist-row", children: /* @__PURE__ */ jsxs47(AriaButton15, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
4106
|
+
item.icon ? /* @__PURE__ */ jsx56(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
3708
4107
|
first,
|
|
3709
4108
|
second,
|
|
3710
4109
|
item.trailing
|
|
@@ -3712,8 +4111,73 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
3712
4111
|
}) });
|
|
3713
4112
|
}
|
|
3714
4113
|
|
|
4114
|
+
// src/components/data/RecordCard.tsx
|
|
4115
|
+
import { jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4116
|
+
function RecordCard({ title, subtitle, icon, action, isDisabled, className, ...rest }) {
|
|
4117
|
+
return /* @__PURE__ */ jsxs48("div", { className: cx("pire-recordcard", className), "data-disabled": isDisabled ? "true" : void 0, ...rest, children: [
|
|
4118
|
+
icon ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ jsx57(Icon, { name: icon, size: 20 }) }) : null,
|
|
4119
|
+
/* @__PURE__ */ jsxs48("span", { className: "pire-recordcard-body", children: [
|
|
4120
|
+
/* @__PURE__ */ jsx57("span", { className: "pire-recordcard-title", children: title }),
|
|
4121
|
+
subtitle ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4122
|
+
] }),
|
|
4123
|
+
action ? /* @__PURE__ */ jsx57("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4124
|
+
] });
|
|
4125
|
+
}
|
|
4126
|
+
|
|
4127
|
+
// src/components/data/ViewSwitcher.tsx
|
|
4128
|
+
import { Button as AriaButton16 } from "react-aria-components";
|
|
4129
|
+
import { jsx as jsx58, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4130
|
+
function ViewSwitcher({
|
|
4131
|
+
name,
|
|
4132
|
+
isDirty,
|
|
4133
|
+
icon = "star",
|
|
4134
|
+
onPress,
|
|
4135
|
+
isDisabled,
|
|
4136
|
+
"aria-label": ariaLabel,
|
|
4137
|
+
className,
|
|
4138
|
+
style
|
|
4139
|
+
}) {
|
|
4140
|
+
const msg = usePireMessages();
|
|
4141
|
+
const label = ariaLabel ?? (isDirty ? msg.viewSwitcherNameModified.replace("{view}", name) : msg.viewSwitcherName.replace("{view}", name));
|
|
4142
|
+
return /* @__PURE__ */ jsxs49(
|
|
4143
|
+
AriaButton16,
|
|
4144
|
+
{
|
|
4145
|
+
className: cx("pire-viewswitcher", className),
|
|
4146
|
+
style,
|
|
4147
|
+
"aria-label": label,
|
|
4148
|
+
isDisabled,
|
|
4149
|
+
onPress,
|
|
4150
|
+
children: [
|
|
4151
|
+
/* @__PURE__ */ jsx58(Icon, { name: icon, size: 16 }),
|
|
4152
|
+
/* @__PURE__ */ jsx58("span", { className: "pire-viewswitcher-name", children: name }),
|
|
4153
|
+
isDirty ? /* @__PURE__ */ jsx58("span", { className: "pire-viewswitcher-dirty", "aria-hidden": "true", children: msg.viewSwitcherModifiedMark }) : null,
|
|
4154
|
+
/* @__PURE__ */ jsx58(Icon, { name: "chevron-down", size: 16 })
|
|
4155
|
+
]
|
|
4156
|
+
}
|
|
4157
|
+
);
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
// src/components/data/BarList.tsx
|
|
4161
|
+
import { jsx as jsx59, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4162
|
+
function BarList({ items, max, className, ...rest }) {
|
|
4163
|
+
const scale = max ?? Math.max(0, ...items.map((i) => i.value));
|
|
4164
|
+
return /* @__PURE__ */ jsx59("ul", { ...rest, className: cx("pire-barlist", className), children: items.map((item) => {
|
|
4165
|
+
const pct = scale > 0 ? Math.max(0, Math.min(100, item.value / scale * 100)) : 0;
|
|
4166
|
+
return /* @__PURE__ */ jsxs50("li", { className: "pire-barlist-row", "data-tone": item.tone, children: [
|
|
4167
|
+
/* @__PURE__ */ jsxs50("span", { className: "pire-barlist-main", children: [
|
|
4168
|
+
/* @__PURE__ */ jsx59("span", { className: "pire-barlist-label", children: item.label }),
|
|
4169
|
+
/* @__PURE__ */ jsx59("span", { className: "pire-barlist-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx59("span", { className: "pire-barlist-fill", style: { width: `${pct}%` } }) })
|
|
4170
|
+
] }),
|
|
4171
|
+
/* @__PURE__ */ jsxs50("span", { className: "pire-barlist-figure", children: [
|
|
4172
|
+
/* @__PURE__ */ jsx59("span", { className: "pire-barlist-value", children: item.valueLabel ?? String(item.value) }),
|
|
4173
|
+
item.hint ? /* @__PURE__ */ jsx59("span", { className: "pire-barlist-hint", children: item.hint }) : null
|
|
4174
|
+
] })
|
|
4175
|
+
] }, item.id);
|
|
4176
|
+
}) });
|
|
4177
|
+
}
|
|
4178
|
+
|
|
3715
4179
|
// src/components/layout/PageBand.tsx
|
|
3716
|
-
import { jsx as
|
|
4180
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3717
4181
|
function PageBand({
|
|
3718
4182
|
surface = "card",
|
|
3719
4183
|
hasBorder = true,
|
|
@@ -3721,7 +4185,7 @@ function PageBand({
|
|
|
3721
4185
|
className,
|
|
3722
4186
|
...rest
|
|
3723
4187
|
}) {
|
|
3724
|
-
return /* @__PURE__ */
|
|
4188
|
+
return /* @__PURE__ */ jsx60(
|
|
3725
4189
|
"div",
|
|
3726
4190
|
{
|
|
3727
4191
|
className: cx("pire-pageband", className),
|
|
@@ -3734,56 +4198,56 @@ function PageBand({
|
|
|
3734
4198
|
}
|
|
3735
4199
|
|
|
3736
4200
|
// src/components/layout/PageHeader.tsx
|
|
3737
|
-
import { jsx as
|
|
4201
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
3738
4202
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
3739
|
-
return /* @__PURE__ */
|
|
3740
|
-
/* @__PURE__ */
|
|
3741
|
-
/* @__PURE__ */
|
|
3742
|
-
subtitle ? /* @__PURE__ */
|
|
4203
|
+
return /* @__PURE__ */ jsxs51("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
4204
|
+
/* @__PURE__ */ jsxs51("div", { style: { minWidth: 0 }, children: [
|
|
4205
|
+
/* @__PURE__ */ jsx61("h1", { className: "pire-pageheader-title", children: title }),
|
|
4206
|
+
subtitle ? /* @__PURE__ */ jsx61("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
3743
4207
|
] }),
|
|
3744
|
-
actions ? /* @__PURE__ */
|
|
4208
|
+
actions ? /* @__PURE__ */ jsx61("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
3745
4209
|
] });
|
|
3746
4210
|
}
|
|
3747
4211
|
|
|
3748
4212
|
// src/components/layout/SectionHeader.tsx
|
|
3749
|
-
import { jsx as
|
|
4213
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
3750
4214
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
3751
|
-
return /* @__PURE__ */
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
meta ? /* @__PURE__ */
|
|
3754
|
-
actions ? /* @__PURE__ */
|
|
4215
|
+
return /* @__PURE__ */ jsxs52("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
4216
|
+
/* @__PURE__ */ jsx62("span", { className: "pire-eyebrow", children: title }),
|
|
4217
|
+
meta ? /* @__PURE__ */ jsx62("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
4218
|
+
actions ? /* @__PURE__ */ jsx62("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
3755
4219
|
] });
|
|
3756
4220
|
}
|
|
3757
4221
|
|
|
3758
4222
|
// src/components/layout/SelectionBar.tsx
|
|
3759
|
-
import { jsx as
|
|
4223
|
+
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
3760
4224
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
3761
4225
|
if (!count) return null;
|
|
3762
|
-
return /* @__PURE__ */
|
|
3763
|
-
/* @__PURE__ */
|
|
4226
|
+
return /* @__PURE__ */ jsxs53("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4227
|
+
/* @__PURE__ */ jsxs53("span", { className: "pire-selectionbar-count", children: [
|
|
3764
4228
|
count.toLocaleString(),
|
|
3765
4229
|
" ",
|
|
3766
4230
|
noun,
|
|
3767
4231
|
count === 1 ? "" : "s",
|
|
3768
4232
|
" selected"
|
|
3769
4233
|
] }),
|
|
3770
|
-
children ? /* @__PURE__ */
|
|
3771
|
-
actions ? /* @__PURE__ */
|
|
4234
|
+
children ? /* @__PURE__ */ jsx63("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
4235
|
+
actions ? /* @__PURE__ */ jsx63("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
3772
4236
|
] });
|
|
3773
4237
|
}
|
|
3774
4238
|
|
|
3775
4239
|
// src/components/layout/FooterBar.tsx
|
|
3776
|
-
import { jsx as
|
|
4240
|
+
import { jsx as jsx64, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
3777
4241
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
3778
|
-
return /* @__PURE__ */
|
|
3779
|
-
note ? /* @__PURE__ */
|
|
4242
|
+
return /* @__PURE__ */ jsxs54("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
4243
|
+
note ? /* @__PURE__ */ jsx64("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
3780
4244
|
children,
|
|
3781
|
-
actions ? /* @__PURE__ */
|
|
4245
|
+
actions ? /* @__PURE__ */ jsx64("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
3782
4246
|
] });
|
|
3783
4247
|
}
|
|
3784
4248
|
|
|
3785
4249
|
// src/components/layout/SplitPane.tsx
|
|
3786
|
-
import { jsx as
|
|
4250
|
+
import { jsx as jsx65, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
3787
4251
|
function SplitPane({
|
|
3788
4252
|
list,
|
|
3789
4253
|
detail,
|
|
@@ -3799,7 +4263,7 @@ function SplitPane({
|
|
|
3799
4263
|
}) {
|
|
3800
4264
|
const msg = usePireMessages();
|
|
3801
4265
|
const width = typeof listWidth === "number" ? `${listWidth}px` : listWidth;
|
|
3802
|
-
return /* @__PURE__ */
|
|
4266
|
+
return /* @__PURE__ */ jsxs55(
|
|
3803
4267
|
"div",
|
|
3804
4268
|
{
|
|
3805
4269
|
className: cx("pire-split", className),
|
|
@@ -3807,10 +4271,10 @@ function SplitPane({
|
|
|
3807
4271
|
style: { ["--pire-split-list-w"]: width, ...style },
|
|
3808
4272
|
...rest,
|
|
3809
4273
|
children: [
|
|
3810
|
-
/* @__PURE__ */
|
|
3811
|
-
/* @__PURE__ */
|
|
3812
|
-
onBack ? /* @__PURE__ */
|
|
3813
|
-
detail ?? /* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ jsx65("section", { className: "pire-split-list", "aria-label": listLabel ?? msg.splitPaneList, children: list }),
|
|
4275
|
+
/* @__PURE__ */ jsxs55("section", { className: "pire-split-detail", "aria-label": detailLabel ?? msg.splitPaneDetail, children: [
|
|
4276
|
+
onBack ? /* @__PURE__ */ jsx65("div", { className: "pire-split-back", children: /* @__PURE__ */ jsx65(Button, { variant: "tertiary", size: "sm", icon: "arrow-left", onPress: onBack, children: backLabel ?? msg.splitPaneBack }) }) : null,
|
|
4277
|
+
detail ?? /* @__PURE__ */ jsx65("div", { className: "pire-split-empty", children: emptyDetail })
|
|
3814
4278
|
] })
|
|
3815
4279
|
]
|
|
3816
4280
|
}
|
|
@@ -3818,11 +4282,12 @@ function SplitPane({
|
|
|
3818
4282
|
}
|
|
3819
4283
|
|
|
3820
4284
|
// src/components/patterns/ConfirmDialog.tsx
|
|
3821
|
-
import { Fragment as
|
|
4285
|
+
import { Fragment as Fragment7, jsx as jsx66, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
3822
4286
|
function ConfirmDialog({
|
|
3823
4287
|
isOpen,
|
|
3824
4288
|
title,
|
|
3825
4289
|
subtitle,
|
|
4290
|
+
facts,
|
|
3826
4291
|
consequence,
|
|
3827
4292
|
children,
|
|
3828
4293
|
confirmLabel = "Confirm",
|
|
@@ -3832,7 +4297,8 @@ function ConfirmDialog({
|
|
|
3832
4297
|
onConfirm,
|
|
3833
4298
|
onCancel
|
|
3834
4299
|
}) {
|
|
3835
|
-
|
|
4300
|
+
const msg = usePireMessages();
|
|
4301
|
+
return /* @__PURE__ */ jsxs56(
|
|
3836
4302
|
Dialog,
|
|
3837
4303
|
{
|
|
3838
4304
|
isOpen,
|
|
@@ -3842,12 +4308,19 @@ function ConfirmDialog({
|
|
|
3842
4308
|
onClose: onCancel,
|
|
3843
4309
|
isDismissable: !isBusy,
|
|
3844
4310
|
showClose: false,
|
|
3845
|
-
footer: /* @__PURE__ */
|
|
3846
|
-
/* @__PURE__ */
|
|
3847
|
-
/* @__PURE__ */
|
|
4311
|
+
footer: /* @__PURE__ */ jsxs56(Fragment7, { children: [
|
|
4312
|
+
/* @__PURE__ */ jsx66(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
4313
|
+
/* @__PURE__ */ jsx66(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
3848
4314
|
] }),
|
|
3849
4315
|
children: [
|
|
3850
|
-
|
|
4316
|
+
facts?.length ? (
|
|
4317
|
+
// The role is what makes the name stick. A bare <div> resolves to `generic`, which
|
|
4318
|
+
// *prohibits* `aria-label` — the label named nothing at all, and axe's
|
|
4319
|
+
// `aria-prohibited-attr` fails it on sight. Every other labelled div/span in this library
|
|
4320
|
+
// pairs with an explicit role for the same reason.
|
|
4321
|
+
/* @__PURE__ */ jsx66("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ jsx66(DescriptionList, { layout: "rows", items: facts }) })
|
|
4322
|
+
) : null,
|
|
4323
|
+
consequence ? /* @__PURE__ */ jsx66(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
3851
4324
|
children
|
|
3852
4325
|
]
|
|
3853
4326
|
}
|
|
@@ -3855,7 +4328,7 @@ function ConfirmDialog({
|
|
|
3855
4328
|
}
|
|
3856
4329
|
|
|
3857
4330
|
// src/components/patterns/CommandPalette.tsx
|
|
3858
|
-
import * as
|
|
4331
|
+
import * as React28 from "react";
|
|
3859
4332
|
import {
|
|
3860
4333
|
Autocomplete,
|
|
3861
4334
|
ModalOverlay as ModalOverlay2,
|
|
@@ -3868,7 +4341,7 @@ import {
|
|
|
3868
4341
|
Header as Header2,
|
|
3869
4342
|
useFilter
|
|
3870
4343
|
} from "react-aria-components";
|
|
3871
|
-
import { Fragment as
|
|
4344
|
+
import { Fragment as Fragment8, jsx as jsx67, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
3872
4345
|
var RESULTS_SECTION_KEY = "__pire_results__";
|
|
3873
4346
|
var searchableText = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
3874
4347
|
function CommandPalette({
|
|
@@ -3889,17 +4362,17 @@ function CommandPalette({
|
|
|
3889
4362
|
style
|
|
3890
4363
|
}) {
|
|
3891
4364
|
const msg = usePireMessages();
|
|
3892
|
-
const [query, setQuery] =
|
|
4365
|
+
const [query, setQuery] = React28.useState("");
|
|
3893
4366
|
const { contains } = useFilter({ sensitivity: "base" });
|
|
3894
|
-
|
|
4367
|
+
React28.useEffect(() => {
|
|
3895
4368
|
if (isOpen) setQuery("");
|
|
3896
4369
|
}, [isOpen]);
|
|
3897
|
-
const searchableById =
|
|
4370
|
+
const searchableById = React28.useMemo(() => {
|
|
3898
4371
|
const byId = /* @__PURE__ */ new Map();
|
|
3899
4372
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
3900
4373
|
return byId;
|
|
3901
4374
|
}, [groups]);
|
|
3902
|
-
const filter =
|
|
4375
|
+
const filter = React28.useCallback((textValue, inputValue, node) => {
|
|
3903
4376
|
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
3904
4377
|
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
3905
4378
|
}, [contains, searchableById]);
|
|
@@ -3909,7 +4382,7 @@ function CommandPalette({
|
|
|
3909
4382
|
};
|
|
3910
4383
|
const sections = [...groups, ...resultsGroup ? [{ ...resultsGroup, id: RESULTS_SECTION_KEY }] : []];
|
|
3911
4384
|
const status = isLoading ? loadingLabel ?? msg.commandPaletteLoading : emptyLabel ?? msg.commandPaletteEmpty;
|
|
3912
|
-
return /* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ jsx67(
|
|
3913
4386
|
ModalOverlay2,
|
|
3914
4387
|
{
|
|
3915
4388
|
className: "pire-cp-overlay",
|
|
@@ -3918,11 +4391,11 @@ function CommandPalette({
|
|
|
3918
4391
|
onOpenChange: (open) => {
|
|
3919
4392
|
if (!open) onOpenChange?.(false);
|
|
3920
4393
|
},
|
|
3921
|
-
children: /* @__PURE__ */
|
|
3922
|
-
/* @__PURE__ */
|
|
3923
|
-
/* @__PURE__ */
|
|
3924
|
-
/* @__PURE__ */
|
|
3925
|
-
/* @__PURE__ */
|
|
4394
|
+
children: /* @__PURE__ */ jsx67(Modal2, { className: cx("pire-cp-modal", className), style, children: /* @__PURE__ */ jsxs57(AriaDialog4, { className: "pire-cp-dialog", "aria-label": ariaLabel ?? msg.commandPaletteLabel, children: [
|
|
4395
|
+
/* @__PURE__ */ jsxs57(Autocomplete, { filter, inputValue: query, onInputChange: handleInputChange, children: [
|
|
4396
|
+
/* @__PURE__ */ jsxs57(SearchField, { className: "pire-cp-search", "aria-label": msg.commandPaletteSearchLabel, children: [
|
|
4397
|
+
/* @__PURE__ */ jsx67(Icon, { name: "search", size: 18, className: "pire-cp-search-icon" }),
|
|
4398
|
+
/* @__PURE__ */ jsx67(
|
|
3926
4399
|
AriaInput5,
|
|
3927
4400
|
{
|
|
3928
4401
|
className: "pire-cp-input",
|
|
@@ -3931,16 +4404,16 @@ function CommandPalette({
|
|
|
3931
4404
|
}
|
|
3932
4405
|
)
|
|
3933
4406
|
] }),
|
|
3934
|
-
isLoading ? /* @__PURE__ */
|
|
3935
|
-
/* @__PURE__ */
|
|
4407
|
+
isLoading ? /* @__PURE__ */ jsx67("div", { className: "pire-cp-loading", role: "status", "aria-live": "polite", children: loadingLabel ?? msg.commandPaletteLoading }) : null,
|
|
4408
|
+
/* @__PURE__ */ jsx67(
|
|
3936
4409
|
AriaMenu2,
|
|
3937
4410
|
{
|
|
3938
4411
|
className: "pire-cp-list",
|
|
3939
4412
|
onAction: (key) => onAction?.(String(key)),
|
|
3940
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
3941
|
-
children: sections.map((section) => /* @__PURE__ */
|
|
3942
|
-
section.label ? /* @__PURE__ */
|
|
3943
|
-
section.items.map((item) => /* @__PURE__ */
|
|
4413
|
+
renderEmptyState: () => /* @__PURE__ */ jsx67("div", { className: "pire-cp-status", children: status }),
|
|
4414
|
+
children: sections.map((section) => /* @__PURE__ */ jsxs57(AriaMenuSection2, { id: section.id, className: "pire-cp-section", children: [
|
|
4415
|
+
section.label ? /* @__PURE__ */ jsx67(Header2, { className: "pire-cp-section-title", children: section.label }) : null,
|
|
4416
|
+
section.items.map((item) => /* @__PURE__ */ jsx67(
|
|
3944
4417
|
MenuItem,
|
|
3945
4418
|
{
|
|
3946
4419
|
id: item.id,
|
|
@@ -3961,18 +4434,18 @@ function CommandPalette({
|
|
|
3961
4434
|
// aria-hidden: the glyphs are a sighted affordance for discovering the keys. A screen
|
|
3962
4435
|
// reader already announces the listbox semantics that make those keys work, so reading
|
|
3963
4436
|
// "up arrow down arrow navigate" out loud is noise on every open.
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
3966
|
-
/* @__PURE__ */
|
|
3967
|
-
/* @__PURE__ */
|
|
4437
|
+
/* @__PURE__ */ jsx67("div", { className: "pire-cp-foot", "aria-hidden": "true", children: footer ?? /* @__PURE__ */ jsxs57(Fragment8, { children: [
|
|
4438
|
+
/* @__PURE__ */ jsxs57("span", { className: "pire-cp-hint", children: [
|
|
4439
|
+
/* @__PURE__ */ jsx67(Kbd, { children: "\u2191" }),
|
|
4440
|
+
/* @__PURE__ */ jsx67(Kbd, { children: "\u2193" }),
|
|
3968
4441
|
msg.commandPaletteHintNavigate
|
|
3969
4442
|
] }),
|
|
3970
|
-
/* @__PURE__ */
|
|
3971
|
-
/* @__PURE__ */
|
|
4443
|
+
/* @__PURE__ */ jsxs57("span", { className: "pire-cp-hint", children: [
|
|
4444
|
+
/* @__PURE__ */ jsx67(Kbd, { children: "\u21B5" }),
|
|
3972
4445
|
msg.commandPaletteHintSelect
|
|
3973
4446
|
] }),
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
4447
|
+
/* @__PURE__ */ jsxs57("span", { className: "pire-cp-hint", children: [
|
|
4448
|
+
/* @__PURE__ */ jsx67(Kbd, { children: "esc" }),
|
|
3976
4449
|
msg.commandPaletteHintClose
|
|
3977
4450
|
] })
|
|
3978
4451
|
] }) })
|
|
@@ -3982,9 +4455,9 @@ function CommandPalette({
|
|
|
3982
4455
|
);
|
|
3983
4456
|
}
|
|
3984
4457
|
function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
3985
|
-
const handler =
|
|
4458
|
+
const handler = React28.useRef(onTrigger);
|
|
3986
4459
|
handler.current = onTrigger;
|
|
3987
|
-
|
|
4460
|
+
React28.useEffect(() => {
|
|
3988
4461
|
if (isDisabled) return;
|
|
3989
4462
|
const onKeyDown = (event) => {
|
|
3990
4463
|
if (!(event.metaKey || event.ctrlKey) || event.altKey) return;
|
|
@@ -3998,15 +4471,15 @@ function useCommandPaletteShortcut(onTrigger, { key = "k", isDisabled } = {}) {
|
|
|
3998
4471
|
}
|
|
3999
4472
|
|
|
4000
4473
|
// src/components/patterns/AppLauncher.tsx
|
|
4001
|
-
import * as
|
|
4474
|
+
import * as React29 from "react";
|
|
4002
4475
|
import {
|
|
4003
4476
|
DialogTrigger,
|
|
4004
|
-
Button as
|
|
4477
|
+
Button as AriaButton17,
|
|
4005
4478
|
Popover as Popover8,
|
|
4006
4479
|
Dialog as AriaDialog5,
|
|
4007
4480
|
useFilter as useFilter2
|
|
4008
4481
|
} from "react-aria-components";
|
|
4009
|
-
import { Fragment as
|
|
4482
|
+
import { Fragment as Fragment9, jsx as jsx68, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4010
4483
|
var searchableText2 = (item) => [item.label, item.description, item.keywords].filter(Boolean).join(" ");
|
|
4011
4484
|
function AppLauncher({
|
|
4012
4485
|
sections,
|
|
@@ -4025,13 +4498,13 @@ function AppLauncher({
|
|
|
4025
4498
|
className
|
|
4026
4499
|
}) {
|
|
4027
4500
|
const msg = usePireMessages();
|
|
4028
|
-
const [query, setQuery] =
|
|
4501
|
+
const [query, setQuery] = React29.useState("");
|
|
4029
4502
|
const { contains } = useFilter2({ sensitivity: "base" });
|
|
4030
4503
|
const handleSearch = (next) => {
|
|
4031
4504
|
setQuery(next);
|
|
4032
4505
|
onSearchChange?.(next);
|
|
4033
4506
|
};
|
|
4034
|
-
const visible =
|
|
4507
|
+
const visible = React29.useMemo(() => {
|
|
4035
4508
|
if (isFilteredExternally) return sections;
|
|
4036
4509
|
const q = query.trim();
|
|
4037
4510
|
if (!q) return sections;
|
|
@@ -4039,9 +4512,9 @@ function AppLauncher({
|
|
|
4039
4512
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4040
4513
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4041
4514
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
4042
|
-
return /* @__PURE__ */
|
|
4043
|
-
/* @__PURE__ */
|
|
4044
|
-
/* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsxs58(DialogTrigger, { children: [
|
|
4516
|
+
/* @__PURE__ */ jsx68(AriaButton17, { className: "pire-launcher-trigger", "aria-label": label, children: /* @__PURE__ */ jsx68(Icon, { name: icon, size: 20 }) }),
|
|
4517
|
+
/* @__PURE__ */ jsx68(
|
|
4045
4518
|
Popover8,
|
|
4046
4519
|
{
|
|
4047
4520
|
className: cx("pire-launcher-popover", className),
|
|
@@ -4049,15 +4522,15 @@ function AppLauncher({
|
|
|
4049
4522
|
offset: 0,
|
|
4050
4523
|
crossOffset: 0,
|
|
4051
4524
|
containerPadding: 0,
|
|
4052
|
-
children: /* @__PURE__ */
|
|
4053
|
-
/* @__PURE__ */
|
|
4054
|
-
/* @__PURE__ */
|
|
4055
|
-
meta ? /* @__PURE__ */
|
|
4525
|
+
children: /* @__PURE__ */ jsx68(AriaDialog5, { className: "pire-launcher", "aria-label": label, children: ({ close }) => /* @__PURE__ */ jsxs58(Fragment9, { children: [
|
|
4526
|
+
/* @__PURE__ */ jsxs58("div", { className: "pire-launcher-head", children: [
|
|
4527
|
+
/* @__PURE__ */ jsx68("span", { className: "pire-launcher-title", children: title ?? msg.appLauncherTitle }),
|
|
4528
|
+
meta ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-meta", children: meta }) : null
|
|
4056
4529
|
] }),
|
|
4057
4530
|
isSearchable ? (
|
|
4058
4531
|
// autoFocus is right here specifically: the panel exists to be searched, and the
|
|
4059
4532
|
// user just chose to open it, so taking the caret is what they asked for.
|
|
4060
|
-
/* @__PURE__ */
|
|
4533
|
+
/* @__PURE__ */ jsx68(
|
|
4061
4534
|
Input,
|
|
4062
4535
|
{
|
|
4063
4536
|
"aria-label": msg.appLauncherSearch,
|
|
@@ -4071,18 +4544,18 @@ function AppLauncher({
|
|
|
4071
4544
|
}
|
|
4072
4545
|
)
|
|
4073
4546
|
) : null,
|
|
4074
|
-
isLoading ? /* @__PURE__ */
|
|
4075
|
-
isEmpty ? /* @__PURE__ */
|
|
4547
|
+
isLoading ? /* @__PURE__ */ jsx68("div", { className: "pire-launcher-empty", role: "status", "aria-live": "polite", children: msg.appLauncherLoading }) : null,
|
|
4548
|
+
isEmpty ? /* @__PURE__ */ jsx68("div", { className: "pire-launcher-empty", children: emptyLabel ?? msg.appLauncherEmpty }) : null,
|
|
4076
4549
|
visible.map((section, si) => (
|
|
4077
4550
|
// Sections are positional zones with no record identity, so the heading is the key
|
|
4078
4551
|
// where there is one. Same reasoning as ShellRail's groups.
|
|
4079
|
-
/* @__PURE__ */
|
|
4080
|
-
section.label ? /* @__PURE__ */
|
|
4081
|
-
/* @__PURE__ */
|
|
4552
|
+
/* @__PURE__ */ jsxs58("div", { className: "pire-launcher-section", children: [
|
|
4553
|
+
section.label ? /* @__PURE__ */ jsx68("div", { className: "pire-eyebrow", children: section.label }) : null,
|
|
4554
|
+
/* @__PURE__ */ jsx68("div", { className: "pire-launcher-grid", "data-variant": section.variant ?? "tile", children: section.items.map((item) => {
|
|
4082
4555
|
const isCurrent = item.id === value;
|
|
4083
4556
|
const showsDescription = (section.variant ?? "tile") === "tile" && Boolean(item.description);
|
|
4084
|
-
return /* @__PURE__ */
|
|
4085
|
-
|
|
4557
|
+
return /* @__PURE__ */ jsxs58(
|
|
4558
|
+
AriaButton17,
|
|
4086
4559
|
{
|
|
4087
4560
|
className: "pire-launcher-item",
|
|
4088
4561
|
"data-selected": isCurrent ? "true" : void 0,
|
|
@@ -4092,10 +4565,10 @@ function AppLauncher({
|
|
|
4092
4565
|
onAction?.(item.id);
|
|
4093
4566
|
},
|
|
4094
4567
|
children: [
|
|
4095
|
-
item.icon ? /* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
showsDescription ? /* @__PURE__ */
|
|
4568
|
+
item.icon ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ jsx68(Icon, { name: item.icon, size: (section.variant ?? "tile") === "tile" ? 20 : 16 }) }) : null,
|
|
4569
|
+
/* @__PURE__ */ jsxs58("span", { className: "pire-launcher-item-text", children: [
|
|
4570
|
+
/* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4571
|
+
showsDescription ? /* @__PURE__ */ jsx68("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
4099
4572
|
] })
|
|
4100
4573
|
]
|
|
4101
4574
|
},
|
|
@@ -4112,10 +4585,10 @@ function AppLauncher({
|
|
|
4112
4585
|
|
|
4113
4586
|
// src/components/patterns/SidePanel.tsx
|
|
4114
4587
|
import { ModalOverlay as ModalOverlay3, Modal as Modal3, Dialog as AriaDialog6, Heading as Heading5 } from "react-aria-components";
|
|
4115
|
-
import { jsx as
|
|
4588
|
+
import { jsx as jsx69, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4116
4589
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
4117
4590
|
const msg = usePireMessages();
|
|
4118
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ jsx69(
|
|
4119
4592
|
ModalOverlay3,
|
|
4120
4593
|
{
|
|
4121
4594
|
className: "pire-sidepanel-overlay",
|
|
@@ -4124,35 +4597,35 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4124
4597
|
onOpenChange: (o) => {
|
|
4125
4598
|
if (!o) onClose?.();
|
|
4126
4599
|
},
|
|
4127
|
-
children: /* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4131
|
-
subtitle ? /* @__PURE__ */
|
|
4600
|
+
children: /* @__PURE__ */ jsx69(Modal3, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ jsxs59(AriaDialog6, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
4601
|
+
/* @__PURE__ */ jsxs59("header", { className: "pire-dialog-head", children: [
|
|
4602
|
+
/* @__PURE__ */ jsxs59("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4603
|
+
/* @__PURE__ */ jsx69(Heading5, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
4604
|
+
subtitle ? /* @__PURE__ */ jsx69("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
4132
4605
|
] }),
|
|
4133
|
-
/* @__PURE__ */
|
|
4606
|
+
/* @__PURE__ */ jsx69(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
4134
4607
|
] }),
|
|
4135
|
-
/* @__PURE__ */
|
|
4136
|
-
footer ? /* @__PURE__ */
|
|
4608
|
+
/* @__PURE__ */ jsx69("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
4609
|
+
footer ? /* @__PURE__ */ jsx69("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
4137
4610
|
] }) })
|
|
4138
4611
|
}
|
|
4139
4612
|
);
|
|
4140
4613
|
}
|
|
4141
4614
|
|
|
4142
4615
|
// src/components/patterns/EmptyState.tsx
|
|
4143
|
-
import { jsx as
|
|
4616
|
+
import { jsx as jsx70, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
4144
4617
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
4145
|
-
return /* @__PURE__ */
|
|
4146
|
-
/* @__PURE__ */
|
|
4147
|
-
title ? /* @__PURE__ */
|
|
4148
|
-
children ? /* @__PURE__ */
|
|
4618
|
+
return /* @__PURE__ */ jsxs60("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4619
|
+
/* @__PURE__ */ jsx70(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4620
|
+
title ? /* @__PURE__ */ jsx70("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
4621
|
+
children ? /* @__PURE__ */ jsx70("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
4149
4622
|
action
|
|
4150
4623
|
] });
|
|
4151
4624
|
}
|
|
4152
4625
|
|
|
4153
4626
|
// src/components/patterns/NumPad.tsx
|
|
4154
|
-
import * as
|
|
4155
|
-
import { jsx as
|
|
4627
|
+
import * as React30 from "react";
|
|
4628
|
+
import { jsx as jsx71, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
4156
4629
|
var BASE_KEYS = [
|
|
4157
4630
|
{ value: "7" },
|
|
4158
4631
|
{ value: "8" },
|
|
@@ -4169,9 +4642,9 @@ var BASE_KEYS = [
|
|
|
4169
4642
|
];
|
|
4170
4643
|
var isInsertable = (value) => /^[0-9]+$/.test(value);
|
|
4171
4644
|
function useNumPadKeyboard(onKey, isDisabled, containerRef) {
|
|
4172
|
-
const handler =
|
|
4645
|
+
const handler = React30.useRef(onKey);
|
|
4173
4646
|
handler.current = onKey;
|
|
4174
|
-
|
|
4647
|
+
React30.useEffect(() => {
|
|
4175
4648
|
if (isDisabled) return;
|
|
4176
4649
|
const isEditingElsewhere = () => {
|
|
4177
4650
|
const el = document.activeElement;
|
|
@@ -4213,8 +4686,8 @@ function NumPad({
|
|
|
4213
4686
|
style
|
|
4214
4687
|
}) {
|
|
4215
4688
|
const msg = usePireMessages();
|
|
4216
|
-
const containerRef =
|
|
4217
|
-
const applyKey =
|
|
4689
|
+
const containerRef = React30.useRef(null);
|
|
4690
|
+
const applyKey = React30.useCallback((key) => {
|
|
4218
4691
|
if (isDisabled) return;
|
|
4219
4692
|
if (key.value === "backspace") {
|
|
4220
4693
|
onChange(value.slice(0, -1));
|
|
@@ -4232,7 +4705,7 @@ function NumPad({
|
|
|
4232
4705
|
}, [isDisabled, value, onChange, onAction]);
|
|
4233
4706
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4234
4707
|
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4235
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsxs61(
|
|
4236
4709
|
"div",
|
|
4237
4710
|
{
|
|
4238
4711
|
ref: containerRef,
|
|
@@ -4241,10 +4714,10 @@ function NumPad({
|
|
|
4241
4714
|
"data-size": size,
|
|
4242
4715
|
"data-disabled": isDisabled ? "true" : void 0,
|
|
4243
4716
|
children: [
|
|
4244
|
-
target !== void 0 ? /* @__PURE__ */
|
|
4245
|
-
/* @__PURE__ */
|
|
4717
|
+
target !== void 0 ? /* @__PURE__ */ jsx71("div", { className: "pire-numpad-target", role: "status", "aria-live": "polite", children: target }) : null,
|
|
4718
|
+
/* @__PURE__ */ jsx71("div", { className: "pire-numpad-grid", role: "group", "aria-label": ariaLabel, children: keys.map((key) => {
|
|
4246
4719
|
const accessibleLabel = key.value === "backspace" ? msg.numPadBackspace : key.value === "clear" ? msg.numPadClear : void 0;
|
|
4247
|
-
return /* @__PURE__ */
|
|
4720
|
+
return /* @__PURE__ */ jsx71(
|
|
4248
4721
|
Button,
|
|
4249
4722
|
{
|
|
4250
4723
|
variant: "secondary",
|
|
@@ -4266,9 +4739,9 @@ function NumPad({
|
|
|
4266
4739
|
}
|
|
4267
4740
|
|
|
4268
4741
|
// src/components/patterns/FileDropZone.tsx
|
|
4269
|
-
import * as
|
|
4742
|
+
import * as React31 from "react";
|
|
4270
4743
|
import { DropZone, FileTrigger as FileTrigger2, isFileDropItem } from "react-aria-components";
|
|
4271
|
-
import { jsx as
|
|
4744
|
+
import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
4272
4745
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
4273
4746
|
function FileDropZone({
|
|
4274
4747
|
label,
|
|
@@ -4296,10 +4769,10 @@ function FileDropZone({
|
|
|
4296
4769
|
...rest
|
|
4297
4770
|
}) {
|
|
4298
4771
|
const msg = usePireMessages();
|
|
4299
|
-
const [uncontrolled, setUncontrolled] =
|
|
4772
|
+
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4300
4773
|
const files = value ?? uncontrolled;
|
|
4301
|
-
const created =
|
|
4302
|
-
|
|
4774
|
+
const created = React31.useRef([]);
|
|
4775
|
+
React31.useEffect(() => () => {
|
|
4303
4776
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
4304
4777
|
}, []);
|
|
4305
4778
|
const commit = (next) => {
|
|
@@ -4319,12 +4792,12 @@ function FileDropZone({
|
|
|
4319
4792
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
4320
4793
|
};
|
|
4321
4794
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
4322
|
-
return /* @__PURE__ */
|
|
4323
|
-
label ? /* @__PURE__ */
|
|
4795
|
+
return /* @__PURE__ */ jsxs62("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), ...rest, children: [
|
|
4796
|
+
label ? /* @__PURE__ */ jsxs62("span", { className: "pire-field-label", children: [
|
|
4324
4797
|
label,
|
|
4325
|
-
isRequired ? /* @__PURE__ */
|
|
4798
|
+
isRequired ? /* @__PURE__ */ jsx72("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
4326
4799
|
] }) : null,
|
|
4327
|
-
/* @__PURE__ */
|
|
4800
|
+
/* @__PURE__ */ jsxs62(
|
|
4328
4801
|
DropZone,
|
|
4329
4802
|
{
|
|
4330
4803
|
className: "pire-dropzone",
|
|
@@ -4338,25 +4811,25 @@ function FileDropZone({
|
|
|
4338
4811
|
accept(dropped);
|
|
4339
4812
|
},
|
|
4340
4813
|
children: [
|
|
4341
|
-
/* @__PURE__ */
|
|
4342
|
-
/* @__PURE__ */
|
|
4343
|
-
/* @__PURE__ */
|
|
4814
|
+
/* @__PURE__ */ jsx72(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
4815
|
+
/* @__PURE__ */ jsx72("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
4816
|
+
/* @__PURE__ */ jsx72(
|
|
4344
4817
|
FileTrigger2,
|
|
4345
4818
|
{
|
|
4346
4819
|
acceptedFileTypes,
|
|
4347
4820
|
allowsMultiple,
|
|
4348
4821
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
4349
|
-
children: /* @__PURE__ */
|
|
4822
|
+
children: /* @__PURE__ */ jsx72(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
4350
4823
|
}
|
|
4351
4824
|
)
|
|
4352
4825
|
]
|
|
4353
4826
|
}
|
|
4354
4827
|
),
|
|
4355
|
-
files.length ? /* @__PURE__ */
|
|
4356
|
-
previewUrl ? /* @__PURE__ */
|
|
4357
|
-
/* @__PURE__ */
|
|
4358
|
-
/* @__PURE__ */
|
|
4359
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */
|
|
4828
|
+
files.length ? /* @__PURE__ */ jsx72("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ jsxs62("li", { className: "pire-fileupload-item", children: [
|
|
4829
|
+
previewUrl ? /* @__PURE__ */ jsx72("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ jsx72(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
4830
|
+
/* @__PURE__ */ jsx72("span", { className: "pire-fileupload-name", children: file.name }),
|
|
4831
|
+
/* @__PURE__ */ jsx72("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
4832
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ jsx72(
|
|
4360
4833
|
IconButton,
|
|
4361
4834
|
{
|
|
4362
4835
|
icon: "x",
|
|
@@ -4366,9 +4839,9 @@ function FileDropZone({
|
|
|
4366
4839
|
}
|
|
4367
4840
|
)
|
|
4368
4841
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
4369
|
-
uploadProgress != null ? /* @__PURE__ */
|
|
4370
|
-
description ? /* @__PURE__ */
|
|
4371
|
-
isInvalid && errorMessage ? /* @__PURE__ */
|
|
4842
|
+
uploadProgress != null ? /* @__PURE__ */ jsx72(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
4843
|
+
description ? /* @__PURE__ */ jsx72("span", { className: "pire-field-hint", children: description }) : null,
|
|
4844
|
+
isInvalid && errorMessage ? /* @__PURE__ */ jsx72("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
4372
4845
|
] });
|
|
4373
4846
|
}
|
|
4374
4847
|
|
|
@@ -4380,10 +4853,12 @@ export {
|
|
|
4380
4853
|
Avatar,
|
|
4381
4854
|
Badge,
|
|
4382
4855
|
BarChart,
|
|
4856
|
+
BarList,
|
|
4383
4857
|
Breadcrumb,
|
|
4384
4858
|
Button,
|
|
4385
4859
|
Card,
|
|
4386
4860
|
Checkbox,
|
|
4861
|
+
ChoiceCardGroup,
|
|
4387
4862
|
ComboBox,
|
|
4388
4863
|
CommandPalette,
|
|
4389
4864
|
ConfirmDialog,
|
|
@@ -4432,8 +4907,11 @@ export {
|
|
|
4432
4907
|
PireIntlProvider,
|
|
4433
4908
|
Popover9 as Popover,
|
|
4434
4909
|
ProgressBar,
|
|
4910
|
+
QuantityStepper,
|
|
4435
4911
|
Radio,
|
|
4436
4912
|
RadioGroup,
|
|
4913
|
+
RecordCard,
|
|
4914
|
+
Ribbon,
|
|
4437
4915
|
RouterProvider,
|
|
4438
4916
|
SectionHeader,
|
|
4439
4917
|
SegmentedControl,
|
|
@@ -4461,6 +4939,7 @@ export {
|
|
|
4461
4939
|
VIZ_SLOT_COUNT,
|
|
4462
4940
|
ValueHelpDialog,
|
|
4463
4941
|
ValueHelpField,
|
|
4942
|
+
ViewSwitcher,
|
|
4464
4943
|
configureIcons,
|
|
4465
4944
|
enMessages,
|
|
4466
4945
|
esMessages,
|