@orianatech/pire 0.9.0 → 0.11.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/data/BarChart.d.cts +32 -0
- package/dist/components/data/BarChart.d.ts +33 -0
- package/dist/components/data/BarChart.d.ts.map +1 -0
- package/dist/components/data/ChartFrame.d.cts +62 -0
- package/dist/components/data/ChartFrame.d.ts +63 -0
- package/dist/components/data/ChartFrame.d.ts.map +1 -0
- package/dist/components/data/DonutChart.d.cts +26 -0
- package/dist/components/data/DonutChart.d.ts +27 -0
- package/dist/components/data/DonutChart.d.ts.map +1 -0
- package/dist/components/data/LineChart.d.cts +29 -0
- package/dist/components/data/LineChart.d.ts +30 -0
- package/dist/components/data/LineChart.d.ts.map +1 -0
- package/dist/components/data/chartGeometry.d.cts +67 -0
- package/dist/components/data/chartGeometry.d.ts +68 -0
- package/dist/components/data/chartGeometry.d.ts.map +1 -0
- package/dist/components/forms/DateRangePicker.d.cts +55 -0
- package/dist/components/forms/DateRangePicker.d.ts +56 -0
- package/dist/components/forms/DateRangePicker.d.ts.map +1 -0
- package/dist/components/forms/Input.d.cts +5 -0
- package/dist/components/forms/Input.d.ts +5 -0
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components.css +108 -0
- package/dist/i18n/messages.d.cts +8 -0
- package/dist/i18n/messages.d.ts +8 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +913 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +901 -266
- package/dist/index.js.map +1 -1
- package/dist/tokens/colors.css +36 -3
- package/dist/tokens/themes.css +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var src_exports = {};
|
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
Avatar: () => Avatar,
|
|
34
34
|
Badge: () => Badge,
|
|
35
|
+
BarChart: () => BarChart,
|
|
35
36
|
Breadcrumb: () => Breadcrumb,
|
|
36
37
|
Button: () => Button,
|
|
37
38
|
Card: () => Card,
|
|
@@ -40,9 +41,11 @@ __export(src_exports, {
|
|
|
40
41
|
ConfirmDialog: () => ConfirmDialog,
|
|
41
42
|
DataTable: () => DataTable,
|
|
42
43
|
DatePicker: () => DatePicker,
|
|
44
|
+
DateRangePicker: () => DateRangePicker,
|
|
43
45
|
DescriptionList: () => DescriptionList,
|
|
44
46
|
Dialog: () => Dialog,
|
|
45
|
-
DialogTrigger: () =>
|
|
47
|
+
DialogTrigger: () => import_react_aria_components32.DialogTrigger,
|
|
48
|
+
DonutChart: () => DonutChart,
|
|
46
49
|
EmptyState: () => EmptyState,
|
|
47
50
|
FileDropZone: () => FileDropZone,
|
|
48
51
|
FileUpload: () => FileUpload,
|
|
@@ -50,19 +53,20 @@ __export(src_exports, {
|
|
|
50
53
|
FooterBar: () => FooterBar,
|
|
51
54
|
FormField: () => FormField,
|
|
52
55
|
Heading: () => Heading,
|
|
53
|
-
I18nProvider: () =>
|
|
56
|
+
I18nProvider: () => import_react_aria_components32.I18nProvider,
|
|
54
57
|
Icon: () => Icon,
|
|
55
58
|
IconButton: () => IconButton,
|
|
56
59
|
InlineMessage: () => InlineMessage,
|
|
57
60
|
Input: () => Input,
|
|
58
61
|
KpiTile: () => KpiTile,
|
|
62
|
+
LineChart: () => LineChart,
|
|
59
63
|
Link: () => Link,
|
|
60
64
|
LinkList: () => LinkList,
|
|
61
65
|
Menu: () => Menu,
|
|
62
66
|
MenuItem: () => MenuItem,
|
|
63
67
|
MenuSection: () => MenuSection,
|
|
64
68
|
MenuSeparator: () => MenuSeparator,
|
|
65
|
-
MenuTrigger: () =>
|
|
69
|
+
MenuTrigger: () => import_react_aria_components32.MenuTrigger,
|
|
66
70
|
MultiComboBox: () => MultiComboBox,
|
|
67
71
|
NumberField: () => NumberField,
|
|
68
72
|
ObjectHeader: () => ObjectHeader,
|
|
@@ -70,11 +74,11 @@ __export(src_exports, {
|
|
|
70
74
|
PageHeader: () => PageHeader,
|
|
71
75
|
Pagination: () => Pagination,
|
|
72
76
|
PireIntlProvider: () => PireIntlProvider,
|
|
73
|
-
Popover: () =>
|
|
77
|
+
Popover: () => import_react_aria_components32.Popover,
|
|
74
78
|
ProgressBar: () => ProgressBar,
|
|
75
79
|
Radio: () => Radio,
|
|
76
80
|
RadioGroup: () => RadioGroup,
|
|
77
|
-
RouterProvider: () =>
|
|
81
|
+
RouterProvider: () => import_react_aria_components32.RouterProvider,
|
|
78
82
|
SectionHeader: () => SectionHeader,
|
|
79
83
|
SegmentedControl: () => SegmentedControl,
|
|
80
84
|
Select: () => Select,
|
|
@@ -86,7 +90,7 @@ __export(src_exports, {
|
|
|
86
90
|
Skeleton: () => Skeleton,
|
|
87
91
|
SkeletonTableRow: () => SkeletonTableRow,
|
|
88
92
|
Strong: () => Strong,
|
|
89
|
-
SubmenuTrigger: () =>
|
|
93
|
+
SubmenuTrigger: () => import_react_aria_components32.SubmenuTrigger,
|
|
90
94
|
Switch: () => Switch,
|
|
91
95
|
Tabs: () => Tabs,
|
|
92
96
|
Tag: () => Tag,
|
|
@@ -96,12 +100,14 @@ __export(src_exports, {
|
|
|
96
100
|
Toast: () => Toast,
|
|
97
101
|
ToastProvider: () => ToastProvider,
|
|
98
102
|
Tooltip: () => Tooltip,
|
|
103
|
+
VIZ_SLOT_COUNT: () => VIZ_SLOT_COUNT,
|
|
99
104
|
ValueHelpDialog: () => ValueHelpDialog,
|
|
100
105
|
ValueHelpField: () => ValueHelpField,
|
|
101
106
|
configureIcons: () => configureIcons,
|
|
102
107
|
enMessages: () => enMessages,
|
|
103
108
|
esMessages: () => esMessages,
|
|
104
109
|
formatFileSize: () => formatFileSize,
|
|
110
|
+
rangeLengthInDays: () => rangeLengthInDays,
|
|
105
111
|
usePireMessages: () => usePireMessages,
|
|
106
112
|
useToast: () => useToast
|
|
107
113
|
});
|
|
@@ -899,6 +905,7 @@ var enMessages = {
|
|
|
899
905
|
datePickerOpenCalendar: "Open calendar",
|
|
900
906
|
datePickerPreviousMonth: "Previous month",
|
|
901
907
|
datePickerNextMonth: "Next month",
|
|
908
|
+
dateRangePresetsLabel: "Date range shortcuts",
|
|
902
909
|
numberFieldIncrease: "Increase",
|
|
903
910
|
numberFieldDecrease: "Decrease",
|
|
904
911
|
valueHelpFieldClear: "Clear selection",
|
|
@@ -916,7 +923,10 @@ var enMessages = {
|
|
|
916
923
|
fileUploadChoose: "Choose files",
|
|
917
924
|
fileUploadRemoveNamed: "Remove {name}",
|
|
918
925
|
fileUploadUploading: "Uploading",
|
|
919
|
-
fileDropZonePrompt: "Drag files here, or choose them"
|
|
926
|
+
fileDropZonePrompt: "Drag files here, or choose them",
|
|
927
|
+
chartCategoryHeader: "Category",
|
|
928
|
+
chartNoValue: "No data",
|
|
929
|
+
chartEmpty: "No data for this period"
|
|
920
930
|
};
|
|
921
931
|
var esMessages = {
|
|
922
932
|
filterBarLabel: "Filtros",
|
|
@@ -935,6 +945,7 @@ var esMessages = {
|
|
|
935
945
|
datePickerOpenCalendar: "Abrir calendario",
|
|
936
946
|
datePickerPreviousMonth: "Mes anterior",
|
|
937
947
|
datePickerNextMonth: "Mes siguiente",
|
|
948
|
+
dateRangePresetsLabel: "Atajos de rango de fechas",
|
|
938
949
|
numberFieldIncrease: "Aumentar",
|
|
939
950
|
numberFieldDecrease: "Disminuir",
|
|
940
951
|
valueHelpFieldClear: "Limpiar selecci\xF3n",
|
|
@@ -952,7 +963,10 @@ var esMessages = {
|
|
|
952
963
|
fileUploadChoose: "Elegir archivos",
|
|
953
964
|
fileUploadRemoveNamed: "Quitar {name}",
|
|
954
965
|
fileUploadUploading: "Subiendo",
|
|
955
|
-
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos"
|
|
966
|
+
fileDropZonePrompt: "Arrastr\xE1 archivos ac\xE1, o elegilos",
|
|
967
|
+
chartCategoryHeader: "Categor\xEDa",
|
|
968
|
+
chartNoValue: "Sin datos",
|
|
969
|
+
chartEmpty: "Sin datos para este per\xEDodo"
|
|
956
970
|
};
|
|
957
971
|
|
|
958
972
|
// src/i18n/PireIntlProvider.tsx
|
|
@@ -1294,6 +1308,120 @@ function DatePicker({
|
|
|
1294
1308
|
] });
|
|
1295
1309
|
}
|
|
1296
1310
|
|
|
1311
|
+
// src/components/forms/DateRangePicker.tsx
|
|
1312
|
+
var import_react_aria_components19 = require("react-aria-components");
|
|
1313
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1314
|
+
function rangeLengthInDays(range) {
|
|
1315
|
+
return range.end.toDate("UTC").getTime() / 864e5 - range.start.toDate("UTC").getTime() / 864e5 + 1;
|
|
1316
|
+
}
|
|
1317
|
+
function DateRangePicker({
|
|
1318
|
+
label,
|
|
1319
|
+
description,
|
|
1320
|
+
errorMessage,
|
|
1321
|
+
maxRangeDays,
|
|
1322
|
+
presets,
|
|
1323
|
+
size = "md",
|
|
1324
|
+
fullWidth = true,
|
|
1325
|
+
startName,
|
|
1326
|
+
endName,
|
|
1327
|
+
className,
|
|
1328
|
+
style,
|
|
1329
|
+
...rest
|
|
1330
|
+
}) {
|
|
1331
|
+
const msg = usePireMessages();
|
|
1332
|
+
const current = rest.value ?? rest.defaultValue ?? null;
|
|
1333
|
+
const tooLong = maxRangeDays != null && current != null && rangeLengthInDays(current) > maxRangeDays;
|
|
1334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1335
|
+
import_react_aria_components19.DateRangePicker,
|
|
1336
|
+
{
|
|
1337
|
+
className: cx("pire-field", className),
|
|
1338
|
+
style,
|
|
1339
|
+
startName,
|
|
1340
|
+
endName,
|
|
1341
|
+
validationBehavior: "aria",
|
|
1342
|
+
...rest,
|
|
1343
|
+
isInvalid: rest.isInvalid || tooLong,
|
|
1344
|
+
children: [
|
|
1345
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components19.Label, { className: "pire-field-label", children: [
|
|
1346
|
+
label,
|
|
1347
|
+
rest.isRequired ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1348
|
+
] }) : null,
|
|
1349
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1350
|
+
import_react_aria_components19.Group,
|
|
1351
|
+
{
|
|
1352
|
+
className: "pire-control pire-daterange-control",
|
|
1353
|
+
"data-size": size,
|
|
1354
|
+
"data-full-width": String(fullWidth),
|
|
1355
|
+
"data-invalid": rest.isInvalid || tooLong ? "true" : void 0,
|
|
1356
|
+
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1357
|
+
children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.DateInput, { slot: "start", className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true", className: "pire-daterange-dash", children: "\u2013" }),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.DateInput, { slot: "end", className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1362
|
+
import_react_aria_components19.Button,
|
|
1363
|
+
{
|
|
1364
|
+
className: "pire-iconbtn",
|
|
1365
|
+
"data-size": "sm",
|
|
1366
|
+
"aria-label": msg.datePickerOpenCalendar,
|
|
1367
|
+
style: { width: 24, height: 24 },
|
|
1368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "calendar", size: 16 })
|
|
1369
|
+
}
|
|
1370
|
+
)
|
|
1371
|
+
]
|
|
1372
|
+
}
|
|
1373
|
+
),
|
|
1374
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components19.Dialog, { className: "pire-daterange-dialog", children: [
|
|
1377
|
+
presets?.length ? (
|
|
1378
|
+
// Before the calendar in the DOM, so keyboard users reach the shortcut without
|
|
1379
|
+
// arrowing through a month first.
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "pire-daterange-presets", role: "group", "aria-label": msg.dateRangePresetsLabel, children: presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1381
|
+
import_react_aria_components19.Button,
|
|
1382
|
+
{
|
|
1383
|
+
className: "pire-daterange-preset",
|
|
1384
|
+
onPress: () => rest.onChange?.(preset.range()),
|
|
1385
|
+
children: preset.label
|
|
1386
|
+
},
|
|
1387
|
+
preset.id
|
|
1388
|
+
)) })
|
|
1389
|
+
) : null,
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components19.RangeCalendar, { className: "pire-calendar", children: [
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("header", { className: "pire-calendar-head", children: [
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1393
|
+
import_react_aria_components19.Button,
|
|
1394
|
+
{
|
|
1395
|
+
slot: "previous",
|
|
1396
|
+
className: "pire-iconbtn",
|
|
1397
|
+
"data-size": "sm",
|
|
1398
|
+
"aria-label": msg.datePickerPreviousMonth,
|
|
1399
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "chevron-left", size: 16 })
|
|
1400
|
+
}
|
|
1401
|
+
),
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.Heading, { className: "pire-calendar-title" }),
|
|
1403
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1404
|
+
import_react_aria_components19.Button,
|
|
1405
|
+
{
|
|
1406
|
+
slot: "next",
|
|
1407
|
+
className: "pire-iconbtn",
|
|
1408
|
+
"data-size": "sm",
|
|
1409
|
+
"aria-label": msg.datePickerNextMonth,
|
|
1410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "chevron-right", size: 16 })
|
|
1411
|
+
}
|
|
1412
|
+
)
|
|
1413
|
+
] }),
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react_aria_components19.CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.CalendarHeaderCell, { children: day }) }),
|
|
1416
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.CalendarGridBody, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_aria_components19.CalendarCell, { date, className: "pire-calendar-cell" }) })
|
|
1417
|
+
] })
|
|
1418
|
+
] })
|
|
1419
|
+
] }) })
|
|
1420
|
+
]
|
|
1421
|
+
}
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1297
1425
|
// src/components/forms/ValueHelpField.tsx
|
|
1298
1426
|
var React9 = __toESM(require("react"), 1);
|
|
1299
1427
|
|
|
@@ -1301,8 +1429,8 @@ var React9 = __toESM(require("react"), 1);
|
|
|
1301
1429
|
var React8 = __toESM(require("react"), 1);
|
|
1302
1430
|
|
|
1303
1431
|
// src/components/feedback/Dialog.tsx
|
|
1304
|
-
var
|
|
1305
|
-
var
|
|
1432
|
+
var import_react_aria_components20 = require("react-aria-components");
|
|
1433
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1306
1434
|
function Dialog({
|
|
1307
1435
|
isOpen,
|
|
1308
1436
|
onOpenChange,
|
|
@@ -1322,8 +1450,8 @@ function Dialog({
|
|
|
1322
1450
|
onClose?.();
|
|
1323
1451
|
onOpenChange?.(false);
|
|
1324
1452
|
};
|
|
1325
|
-
return /* @__PURE__ */ (0,
|
|
1326
|
-
|
|
1453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1454
|
+
import_react_aria_components20.ModalOverlay,
|
|
1327
1455
|
{
|
|
1328
1456
|
className: "pire-modal-overlay",
|
|
1329
1457
|
isOpen,
|
|
@@ -1331,28 +1459,28 @@ function Dialog({
|
|
|
1331
1459
|
onOpenChange: (o) => {
|
|
1332
1460
|
if (!o) close();
|
|
1333
1461
|
},
|
|
1334
|
-
children: /* @__PURE__ */ (0,
|
|
1335
|
-
title ? /* @__PURE__ */ (0,
|
|
1336
|
-
/* @__PURE__ */ (0,
|
|
1337
|
-
/* @__PURE__ */ (0,
|
|
1338
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
1462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_aria_components20.Modal, { className: cx("pire-modal", className), "data-size": size, style, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react_aria_components20.Dialog, { className: "pire-dialog", children: [
|
|
1463
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_aria_components20.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
1466
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
1339
1467
|
] }),
|
|
1340
|
-
showClose ? /* @__PURE__ */ (0,
|
|
1468
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { icon: "x", label: msg.dialogClose, size: "sm", onPress: close }) : null
|
|
1341
1469
|
] }) : null,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
footer ? /* @__PURE__ */ (0,
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pire-dialog-body", children }),
|
|
1471
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
1344
1472
|
] }) })
|
|
1345
1473
|
}
|
|
1346
1474
|
);
|
|
1347
1475
|
}
|
|
1348
1476
|
|
|
1349
1477
|
// src/components/data/DataTable.tsx
|
|
1350
|
-
var
|
|
1478
|
+
var import_react_aria_components21 = require("react-aria-components");
|
|
1351
1479
|
|
|
1352
1480
|
// src/components/feedback/Skeleton.tsx
|
|
1353
|
-
var
|
|
1481
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1354
1482
|
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
1355
|
-
return /* @__PURE__ */ (0,
|
|
1483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1356
1484
|
"div",
|
|
1357
1485
|
{
|
|
1358
1486
|
className: cx("pire-skeleton", className),
|
|
@@ -1366,7 +1494,7 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
1366
1494
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
1367
1495
|
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
1368
1496
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
1369
|
-
return /* @__PURE__ */ (0,
|
|
1497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1370
1498
|
"div",
|
|
1371
1499
|
{
|
|
1372
1500
|
className: cx("pire-skeleton-row", className),
|
|
@@ -1378,13 +1506,13 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
1378
1506
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
1379
1507
|
return (
|
|
1380
1508
|
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
1381
|
-
/* @__PURE__ */ (0,
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1382
1510
|
"div",
|
|
1383
1511
|
{
|
|
1384
1512
|
className: "pire-skeleton-cell",
|
|
1385
1513
|
"data-align": align,
|
|
1386
1514
|
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
1387
|
-
children: /* @__PURE__ */ (0,
|
|
1515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
1388
1516
|
},
|
|
1389
1517
|
i
|
|
1390
1518
|
)
|
|
@@ -1395,7 +1523,7 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
1395
1523
|
}
|
|
1396
1524
|
|
|
1397
1525
|
// src/components/data/DataTable.tsx
|
|
1398
|
-
var
|
|
1526
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1399
1527
|
function DataTable({
|
|
1400
1528
|
columns,
|
|
1401
1529
|
rows,
|
|
@@ -1427,15 +1555,15 @@ function DataTable({
|
|
|
1427
1555
|
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
1428
1556
|
];
|
|
1429
1557
|
const body = isLoading ? [] : rows;
|
|
1430
|
-
return /* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1431
1559
|
"div",
|
|
1432
1560
|
{
|
|
1433
1561
|
className: cx("pire-table-wrap", className),
|
|
1434
1562
|
style,
|
|
1435
1563
|
"data-loading": isLoading ? "true" : void 0,
|
|
1436
1564
|
"aria-busy": isLoading ? "true" : void 0,
|
|
1437
|
-
children: /* @__PURE__ */ (0,
|
|
1438
|
-
|
|
1565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1566
|
+
import_react_aria_components21.Table,
|
|
1439
1567
|
{
|
|
1440
1568
|
className: "pire-table",
|
|
1441
1569
|
"data-density": density,
|
|
@@ -1451,10 +1579,10 @@ function DataTable({
|
|
|
1451
1579
|
if (row) onRowAction(row);
|
|
1452
1580
|
} : void 0,
|
|
1453
1581
|
children: [
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1455
|
-
selectable ? /* @__PURE__ */ (0,
|
|
1456
|
-
columns.map((c, i) => /* @__PURE__ */ (0,
|
|
1457
|
-
|
|
1582
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components21.TableHeader, { className: "pire-thead-row", children: [
|
|
1583
|
+
selectable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components21.Column, { className: "pire-th", width: 44, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
1584
|
+
columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1585
|
+
import_react_aria_components21.Column,
|
|
1458
1586
|
{
|
|
1459
1587
|
id: c.key,
|
|
1460
1588
|
className: "pire-th",
|
|
@@ -1463,9 +1591,9 @@ function DataTable({
|
|
|
1463
1591
|
width: c.width,
|
|
1464
1592
|
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
1465
1593
|
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
1466
|
-
children: /* @__PURE__ */ (0,
|
|
1594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "pire-th-inner", children: [
|
|
1467
1595
|
c.label,
|
|
1468
|
-
c.sortable ? /* @__PURE__ */ (0,
|
|
1596
|
+
c.sortable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1469
1597
|
Icon,
|
|
1470
1598
|
{
|
|
1471
1599
|
size: 12,
|
|
@@ -1478,16 +1606,16 @@ function DataTable({
|
|
|
1478
1606
|
c.key
|
|
1479
1607
|
))
|
|
1480
1608
|
] }),
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components21.TableBody, { renderEmptyState: () => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
1483
1611
|
Array.from({ length: skeletonRows }, (_, i) => (
|
|
1484
1612
|
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
1485
|
-
/* @__PURE__ */ (0,
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
1486
1614
|
))
|
|
1487
|
-
] }) : /* @__PURE__ */ (0,
|
|
1488
|
-
selectable ? /* @__PURE__ */ (0,
|
|
1489
|
-
columns.map((c) => /* @__PURE__ */ (0,
|
|
1490
|
-
|
|
1615
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "pire-table-empty", children: emptyLabel }), children: body.map((row) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_aria_components21.Row, { id: row.id, className: "pire-tr", "data-pressable": onRowAction ? "true" : void 0, children: [
|
|
1616
|
+
selectable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components21.Cell, { className: "pire-td", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
1617
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1618
|
+
import_react_aria_components21.Cell,
|
|
1491
1619
|
{
|
|
1492
1620
|
className: "pire-td",
|
|
1493
1621
|
"data-numeric": c.numeric ? "true" : void 0,
|
|
@@ -1505,7 +1633,7 @@ function DataTable({
|
|
|
1505
1633
|
}
|
|
1506
1634
|
|
|
1507
1635
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
1508
|
-
var
|
|
1636
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1509
1637
|
function ValueHelpDialog({
|
|
1510
1638
|
isOpen,
|
|
1511
1639
|
title = "Select a record",
|
|
@@ -1526,16 +1654,16 @@ function ValueHelpDialog({
|
|
|
1526
1654
|
if (!q) return rows;
|
|
1527
1655
|
return rows.filter((row) => Object.values(row).some((v) => String(v).toLowerCase().includes(q)));
|
|
1528
1656
|
}, [rows, query]);
|
|
1529
|
-
return /* @__PURE__ */ (0,
|
|
1657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1530
1658
|
Dialog,
|
|
1531
1659
|
{
|
|
1532
1660
|
isOpen,
|
|
1533
1661
|
size: "lg",
|
|
1534
1662
|
title,
|
|
1535
1663
|
onClose,
|
|
1536
|
-
footer: /* @__PURE__ */ (0,
|
|
1537
|
-
children: /* @__PURE__ */ (0,
|
|
1538
|
-
/* @__PURE__ */ (0,
|
|
1664
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
1665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1539
1667
|
Input,
|
|
1540
1668
|
{
|
|
1541
1669
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -1547,7 +1675,7 @@ function ValueHelpDialog({
|
|
|
1547
1675
|
autoFocus: true
|
|
1548
1676
|
}
|
|
1549
1677
|
),
|
|
1550
|
-
/* @__PURE__ */ (0,
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1551
1679
|
DataTable,
|
|
1552
1680
|
{
|
|
1553
1681
|
"aria-label": typeof title === "string" ? title : "Records",
|
|
@@ -1567,7 +1695,7 @@ function ValueHelpDialog({
|
|
|
1567
1695
|
}
|
|
1568
1696
|
|
|
1569
1697
|
// src/components/forms/ValueHelpField.tsx
|
|
1570
|
-
var
|
|
1698
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1571
1699
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
1572
1700
|
function ValueHelpField({
|
|
1573
1701
|
label,
|
|
@@ -1589,9 +1717,9 @@ function ValueHelpField({
|
|
|
1589
1717
|
}) {
|
|
1590
1718
|
const msg = usePireMessages();
|
|
1591
1719
|
const [open, setOpen] = React9.useState(false);
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1593
|
-
/* @__PURE__ */ (0,
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cx(className), style, children: [
|
|
1721
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { style: { display: "flex", gap: "var(--sp-2)", alignItems: "flex-end" }, children: [
|
|
1722
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1595
1723
|
Input,
|
|
1596
1724
|
{
|
|
1597
1725
|
label,
|
|
@@ -1605,7 +1733,7 @@ function ValueHelpField({
|
|
|
1605
1733
|
errorMessage
|
|
1606
1734
|
}
|
|
1607
1735
|
),
|
|
1608
|
-
allowsClear && value ? /* @__PURE__ */ (0,
|
|
1736
|
+
allowsClear && value ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1609
1737
|
IconButton,
|
|
1610
1738
|
{
|
|
1611
1739
|
icon: "x",
|
|
@@ -1615,7 +1743,7 @@ function ValueHelpField({
|
|
|
1615
1743
|
onPress: () => onChange?.(null)
|
|
1616
1744
|
}
|
|
1617
1745
|
) : null,
|
|
1618
|
-
/* @__PURE__ */ (0,
|
|
1746
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1619
1747
|
IconButton,
|
|
1620
1748
|
{
|
|
1621
1749
|
icon: "search",
|
|
@@ -1626,7 +1754,7 @@ function ValueHelpField({
|
|
|
1626
1754
|
}
|
|
1627
1755
|
)
|
|
1628
1756
|
] }),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1757
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1630
1758
|
ValueHelpDialog,
|
|
1631
1759
|
{
|
|
1632
1760
|
isOpen: open,
|
|
@@ -1642,11 +1770,11 @@ function ValueHelpField({
|
|
|
1642
1770
|
|
|
1643
1771
|
// src/components/forms/FileUpload.tsx
|
|
1644
1772
|
var React10 = __toESM(require("react"), 1);
|
|
1645
|
-
var
|
|
1773
|
+
var import_react_aria_components23 = require("react-aria-components");
|
|
1646
1774
|
|
|
1647
1775
|
// src/components/feedback/ProgressBar.tsx
|
|
1648
|
-
var
|
|
1649
|
-
var
|
|
1776
|
+
var import_react_aria_components22 = require("react-aria-components");
|
|
1777
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1650
1778
|
function ProgressBar({
|
|
1651
1779
|
value = 0,
|
|
1652
1780
|
minValue = 0,
|
|
@@ -1659,8 +1787,8 @@ function ProgressBar({
|
|
|
1659
1787
|
className,
|
|
1660
1788
|
style
|
|
1661
1789
|
}) {
|
|
1662
|
-
return /* @__PURE__ */ (0,
|
|
1663
|
-
|
|
1790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1791
|
+
import_react_aria_components22.ProgressBar,
|
|
1664
1792
|
{
|
|
1665
1793
|
className: cx("pire-progress", className),
|
|
1666
1794
|
"data-status": status,
|
|
@@ -1670,19 +1798,19 @@ function ProgressBar({
|
|
|
1670
1798
|
maxValue,
|
|
1671
1799
|
isIndeterminate,
|
|
1672
1800
|
style,
|
|
1673
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */ (0,
|
|
1674
|
-
label || showValue ? /* @__PURE__ */ (0,
|
|
1675
|
-
label ? /* @__PURE__ */ (0,
|
|
1676
|
-
showValue && !isIndeterminate ? /* @__PURE__ */ (0,
|
|
1801
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
1802
|
+
label || showValue ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "pire-progress-head", children: [
|
|
1803
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Label, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {}),
|
|
1804
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-numeric", children: valueText }) : null
|
|
1677
1805
|
] }) : null,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1806
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
1679
1807
|
] })
|
|
1680
1808
|
}
|
|
1681
1809
|
);
|
|
1682
1810
|
}
|
|
1683
1811
|
|
|
1684
1812
|
// src/components/forms/FileUpload.tsx
|
|
1685
|
-
var
|
|
1813
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1686
1814
|
var isImage = (file) => file.type.startsWith("image/");
|
|
1687
1815
|
function formatFileSize(bytes) {
|
|
1688
1816
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -1754,7 +1882,7 @@ function FileUpload({
|
|
|
1754
1882
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
1755
1883
|
};
|
|
1756
1884
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
1757
|
-
return /* @__PURE__ */ (0,
|
|
1885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1758
1886
|
"div",
|
|
1759
1887
|
{
|
|
1760
1888
|
className: cx("pire-field", "pire-fileupload", className),
|
|
@@ -1762,24 +1890,24 @@ function FileUpload({
|
|
|
1762
1890
|
"data-full-width": String(fullWidth),
|
|
1763
1891
|
"data-invalid": isInvalid ? "true" : void 0,
|
|
1764
1892
|
children: [
|
|
1765
|
-
label ? /* @__PURE__ */ (0,
|
|
1893
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "pire-field-label", children: [
|
|
1766
1894
|
label,
|
|
1767
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
1895
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1768
1896
|
] }) : null,
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1898
|
+
import_react_aria_components23.FileTrigger,
|
|
1771
1899
|
{
|
|
1772
1900
|
acceptedFileTypes,
|
|
1773
1901
|
allowsMultiple,
|
|
1774
1902
|
onSelect: accept,
|
|
1775
|
-
children: /* @__PURE__ */ (0,
|
|
1903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { icon: "paperclip", isDisabled: isDisabled || isReadOnly, children: chooseLabel ?? msg.fileUploadChoose })
|
|
1776
1904
|
}
|
|
1777
1905
|
),
|
|
1778
|
-
files.length ? /* @__PURE__ */ (0,
|
|
1779
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1781
|
-
/* @__PURE__ */ (0,
|
|
1782
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
1906
|
+
files.length ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { className: "pire-fileupload-item", children: [
|
|
1907
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
1908
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
1909
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
1910
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1783
1911
|
IconButton,
|
|
1784
1912
|
{
|
|
1785
1913
|
icon: "x",
|
|
@@ -1789,16 +1917,16 @@ function FileUpload({
|
|
|
1789
1917
|
}
|
|
1790
1918
|
)
|
|
1791
1919
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
1792
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
1793
|
-
description ? /* @__PURE__ */ (0,
|
|
1794
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
1920
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
1921
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components23.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1922
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
1795
1923
|
]
|
|
1796
1924
|
}
|
|
1797
1925
|
);
|
|
1798
1926
|
}
|
|
1799
1927
|
|
|
1800
1928
|
// src/components/navigation/ShellBar.tsx
|
|
1801
|
-
var
|
|
1929
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1802
1930
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
1803
1931
|
function ShellBar({
|
|
1804
1932
|
product,
|
|
@@ -1813,30 +1941,30 @@ function ShellBar({
|
|
|
1813
1941
|
className,
|
|
1814
1942
|
...rest
|
|
1815
1943
|
}) {
|
|
1816
|
-
return /* @__PURE__ */ (0,
|
|
1817
|
-
onMenu ? /* @__PURE__ */ (0,
|
|
1818
|
-
monogram ? /* @__PURE__ */ (0,
|
|
1819
|
-
product ? /* @__PURE__ */ (0,
|
|
1820
|
-
title ? /* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1822
|
-
onSearch ? /* @__PURE__ */ (0,
|
|
1944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
1945
|
+
onMenu ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
1946
|
+
monogram ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
1947
|
+
product ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
1948
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "pire-shellbar-spacer" }),
|
|
1950
|
+
onSearch ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
1823
1951
|
actions,
|
|
1824
|
-
user ? /* @__PURE__ */ (0,
|
|
1952
|
+
user ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
1825
1953
|
] });
|
|
1826
1954
|
}
|
|
1827
1955
|
|
|
1828
1956
|
// src/components/navigation/SideNav.tsx
|
|
1829
1957
|
var React11 = __toESM(require("react"), 1);
|
|
1830
|
-
var
|
|
1958
|
+
var import_react_aria_components25 = require("react-aria-components");
|
|
1831
1959
|
|
|
1832
1960
|
// src/components/navigation/Menu.tsx
|
|
1833
|
-
var
|
|
1834
|
-
var
|
|
1961
|
+
var import_react_aria_components24 = require("react-aria-components");
|
|
1962
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1835
1963
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
1836
1964
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
1837
1965
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
1838
|
-
return /* @__PURE__ */ (0,
|
|
1839
|
-
|
|
1966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1967
|
+
import_react_aria_components24.Menu,
|
|
1840
1968
|
{
|
|
1841
1969
|
className: cx("pire-menu", className),
|
|
1842
1970
|
style: menuStyle,
|
|
@@ -1853,35 +1981,35 @@ function MenuItem({
|
|
|
1853
1981
|
className,
|
|
1854
1982
|
...rest
|
|
1855
1983
|
}) {
|
|
1856
|
-
return /* @__PURE__ */ (0,
|
|
1857
|
-
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1985
|
+
import_react_aria_components24.MenuItem,
|
|
1858
1986
|
{
|
|
1859
1987
|
className: cx("pire-menu-item", className),
|
|
1860
1988
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
1861
1989
|
...rest,
|
|
1862
1990
|
children: [
|
|
1863
|
-
icon ? /* @__PURE__ */ (0,
|
|
1864
|
-
/* @__PURE__ */ (0,
|
|
1865
|
-
/* @__PURE__ */ (0,
|
|
1866
|
-
description ? /* @__PURE__ */ (0,
|
|
1991
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon, { name: icon, size: 16, className: "pire-menu-item-icon" }) : null,
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "pire-menu-item-body", children: [
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pire-menu-item-label", children }),
|
|
1994
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
1867
1995
|
] }),
|
|
1868
|
-
shortcut ? /* @__PURE__ */ (0,
|
|
1996
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("kbd", { className: "pire-menu-item-shortcut", children: shortcut }) : null
|
|
1869
1997
|
]
|
|
1870
1998
|
}
|
|
1871
1999
|
);
|
|
1872
2000
|
}
|
|
1873
2001
|
function MenuSection({ title, children, className, ...rest }) {
|
|
1874
|
-
return /* @__PURE__ */ (0,
|
|
1875
|
-
title ? /* @__PURE__ */ (0,
|
|
2002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_aria_components24.MenuSection, { className: cx("pire-menu-section", className), ...rest, children: [
|
|
2003
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_aria_components24.Header, { className: "pire-menu-section-title", children: title }) : null,
|
|
1876
2004
|
children
|
|
1877
2005
|
] });
|
|
1878
2006
|
}
|
|
1879
2007
|
function MenuSeparator({ className }) {
|
|
1880
|
-
return /* @__PURE__ */ (0,
|
|
2008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_aria_components24.Separator, { className: cx("pire-menu-separator", className) });
|
|
1881
2009
|
}
|
|
1882
2010
|
|
|
1883
2011
|
// src/components/navigation/SideNav.tsx
|
|
1884
|
-
var
|
|
2012
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1885
2013
|
function findActiveParent(groups, value) {
|
|
1886
2014
|
if (value == null) return void 0;
|
|
1887
2015
|
for (const group of groups) {
|
|
@@ -1930,8 +2058,8 @@ function SideNav({
|
|
|
1930
2058
|
};
|
|
1931
2059
|
const renderRow = (item, onPress, isGroup) => {
|
|
1932
2060
|
const selected = !isGroup && item.id === value;
|
|
1933
|
-
const button = /* @__PURE__ */ (0,
|
|
1934
|
-
|
|
2061
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2062
|
+
import_react_aria_components25.Button,
|
|
1935
2063
|
{
|
|
1936
2064
|
className: "pire-sidenav-item",
|
|
1937
2065
|
"data-selected": selected ? "true" : void 0,
|
|
@@ -1940,70 +2068,70 @@ function SideNav({
|
|
|
1940
2068
|
"aria-label": collapsed ? item.label : void 0,
|
|
1941
2069
|
onPress,
|
|
1942
2070
|
children: [
|
|
1943
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1944
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
1945
|
-
item.count != null && !collapsed ? /* @__PURE__ */ (0,
|
|
2071
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
2072
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: item.label }),
|
|
2073
|
+
item.count != null && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
1946
2074
|
]
|
|
1947
2075
|
},
|
|
1948
2076
|
item.id
|
|
1949
2077
|
);
|
|
1950
|
-
return collapsed ? /* @__PURE__ */ (0,
|
|
2078
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
1951
2079
|
};
|
|
1952
|
-
const renderRailFlyout = (item) => /* @__PURE__ */ (0,
|
|
1953
|
-
/* @__PURE__ */ (0,
|
|
1954
|
-
|
|
2080
|
+
const renderRailFlyout = (item) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react_aria_components25.MenuTrigger, { children: [
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2082
|
+
import_react_aria_components25.Button,
|
|
1955
2083
|
{
|
|
1956
2084
|
className: "pire-sidenav-item",
|
|
1957
2085
|
"aria-label": item.label,
|
|
1958
2086
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
1959
|
-
children: item.icon ? /* @__PURE__ */ (0,
|
|
2087
|
+
children: item.icon ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: item.icon, size: 16 }) : null
|
|
1960
2088
|
}
|
|
1961
2089
|
),
|
|
1962
|
-
/* @__PURE__ */ (0,
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_aria_components25.Popover, { className: "pire-popover", placement: "right top", offset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1963
2091
|
Menu,
|
|
1964
2092
|
{
|
|
1965
2093
|
"aria-label": item.label,
|
|
1966
2094
|
className: "pire-sidenav-flyout",
|
|
1967
2095
|
onAction: (key) => onChange?.(String(key)),
|
|
1968
|
-
children: (item.items ?? []).map((child) => /* @__PURE__ */ (0,
|
|
2096
|
+
children: (item.items ?? []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MenuItem, { id: child.id, children: child.label }, child.id))
|
|
1969
2097
|
}
|
|
1970
2098
|
) })
|
|
1971
2099
|
] }, item.id);
|
|
1972
|
-
const renderSection = (item) => /* @__PURE__ */ (0,
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
1974
|
-
|
|
2100
|
+
const renderSection = (item) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react_aria_components25.Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2102
|
+
import_react_aria_components25.Button,
|
|
1975
2103
|
{
|
|
1976
2104
|
slot: "trigger",
|
|
1977
2105
|
className: "pire-sidenav-item",
|
|
1978
2106
|
"data-kind": "group",
|
|
1979
2107
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
1980
2108
|
children: [
|
|
1981
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
2109
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
2110
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: item.label }),
|
|
2111
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
2112
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
1985
2113
|
]
|
|
1986
2114
|
}
|
|
1987
2115
|
),
|
|
1988
|
-
/* @__PURE__ */ (0,
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_aria_components25.DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
1989
2117
|
const selected = child.id === value;
|
|
1990
|
-
return /* @__PURE__ */ (0,
|
|
1991
|
-
|
|
2118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2119
|
+
import_react_aria_components25.Button,
|
|
1992
2120
|
{
|
|
1993
2121
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
1994
2122
|
"data-selected": selected ? "true" : void 0,
|
|
1995
2123
|
"aria-current": selected ? "page" : void 0,
|
|
1996
2124
|
onPress: () => onChange?.(child.id),
|
|
1997
2125
|
children: [
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
child.count != null ? /* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: child.label }),
|
|
2127
|
+
child.count != null ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
2000
2128
|
]
|
|
2001
2129
|
},
|
|
2002
2130
|
child.id
|
|
2003
2131
|
);
|
|
2004
2132
|
}) })
|
|
2005
2133
|
] }, item.id);
|
|
2006
|
-
return /* @__PURE__ */ (0,
|
|
2134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2007
2135
|
"nav",
|
|
2008
2136
|
{
|
|
2009
2137
|
className: cx("pire-sidenav", className),
|
|
@@ -2019,10 +2147,10 @@ function SideNav({
|
|
|
2019
2147
|
if (isGroup && collapsed && railFlyout) return renderRailFlyout(item);
|
|
2020
2148
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
2021
2149
|
});
|
|
2022
|
-
return /* @__PURE__ */ (0,
|
|
2023
|
-
group.label && !collapsed ? /* @__PURE__ */ (0,
|
|
2024
|
-
hasSections ? /* @__PURE__ */ (0,
|
|
2025
|
-
|
|
2150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "pire-sidenav-group", children: [
|
|
2151
|
+
group.label && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
2152
|
+
hasSections ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2153
|
+
import_react_aria_components25.DisclosureGroup,
|
|
2026
2154
|
{
|
|
2027
2155
|
className: "pire-sidenav-tree",
|
|
2028
2156
|
allowsMultipleExpanded: true,
|
|
@@ -2033,18 +2161,18 @@ function SideNav({
|
|
|
2033
2161
|
) : rows
|
|
2034
2162
|
] }, group.label ?? gi);
|
|
2035
2163
|
}),
|
|
2036
|
-
footer ? /* @__PURE__ */ (0,
|
|
2164
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
2037
2165
|
]
|
|
2038
2166
|
}
|
|
2039
2167
|
);
|
|
2040
2168
|
}
|
|
2041
2169
|
|
|
2042
2170
|
// src/components/navigation/Tabs.tsx
|
|
2043
|
-
var
|
|
2044
|
-
var
|
|
2171
|
+
var import_react_aria_components26 = require("react-aria-components");
|
|
2172
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2045
2173
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
2046
|
-
return /* @__PURE__ */ (0,
|
|
2047
|
-
|
|
2174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2175
|
+
import_react_aria_components26.Tabs,
|
|
2048
2176
|
{
|
|
2049
2177
|
className,
|
|
2050
2178
|
style,
|
|
@@ -2052,23 +2180,23 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
2052
2180
|
defaultSelectedKey: defaultValue,
|
|
2053
2181
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
2054
2182
|
children: [
|
|
2055
|
-
/* @__PURE__ */ (0,
|
|
2056
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_aria_components26.TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_aria_components26.Tab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
2184
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
2057
2185
|
item.label,
|
|
2058
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
2186
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-tab-count", children: item.count }) : null
|
|
2059
2187
|
] }) }),
|
|
2060
|
-
items.map((item) => /* @__PURE__ */ (0,
|
|
2188
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_aria_components26.TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
2061
2189
|
]
|
|
2062
2190
|
}
|
|
2063
2191
|
);
|
|
2064
2192
|
}
|
|
2065
2193
|
|
|
2066
2194
|
// src/components/navigation/Breadcrumb.tsx
|
|
2067
|
-
var
|
|
2068
|
-
var
|
|
2195
|
+
var import_react_aria_components27 = require("react-aria-components");
|
|
2196
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2069
2197
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
2070
|
-
return /* @__PURE__ */ (0,
|
|
2071
|
-
|
|
2198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2199
|
+
import_react_aria_components27.Breadcrumbs,
|
|
2072
2200
|
{
|
|
2073
2201
|
className: cx("pire-breadcrumbs", className),
|
|
2074
2202
|
style,
|
|
@@ -2076,9 +2204,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2076
2204
|
onAction: (key) => onNavigate?.(String(key)),
|
|
2077
2205
|
children: (item) => {
|
|
2078
2206
|
const last = items[items.length - 1] === item;
|
|
2079
|
-
return /* @__PURE__ */ (0,
|
|
2080
|
-
last ? item.label : /* @__PURE__ */ (0,
|
|
2081
|
-
last ? null : /* @__PURE__ */ (0,
|
|
2207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react_aria_components27.Breadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
2208
|
+
last ? item.label : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components27.Link, { href: item.href, children: item.label }),
|
|
2209
|
+
last ? null : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
2082
2210
|
] });
|
|
2083
2211
|
}
|
|
2084
2212
|
}
|
|
@@ -2086,7 +2214,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
2086
2214
|
}
|
|
2087
2215
|
|
|
2088
2216
|
// src/components/navigation/Pagination.tsx
|
|
2089
|
-
var
|
|
2217
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2090
2218
|
function Pagination({
|
|
2091
2219
|
page = 1,
|
|
2092
2220
|
pageSize = 25,
|
|
@@ -2101,9 +2229,9 @@ function Pagination({
|
|
|
2101
2229
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
2102
2230
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
2103
2231
|
const to = Math.min(total, page * pageSize);
|
|
2104
|
-
return /* @__PURE__ */ (0,
|
|
2105
|
-
/* @__PURE__ */ (0,
|
|
2106
|
-
/* @__PURE__ */ (0,
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2107
2235
|
IconButton,
|
|
2108
2236
|
{
|
|
2109
2237
|
icon: "chevron-left",
|
|
@@ -2114,8 +2242,8 @@ function Pagination({
|
|
|
2114
2242
|
onPress: () => onPageChange?.(page - 1)
|
|
2115
2243
|
}
|
|
2116
2244
|
),
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2245
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2119
2247
|
IconButton,
|
|
2120
2248
|
{
|
|
2121
2249
|
icon: "chevron-right",
|
|
@@ -2126,7 +2254,7 @@ function Pagination({
|
|
|
2126
2254
|
onPress: () => onPageChange?.(page + 1)
|
|
2127
2255
|
}
|
|
2128
2256
|
),
|
|
2129
|
-
onPageSizeChange ? /* @__PURE__ */ (0,
|
|
2257
|
+
onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2130
2258
|
Select,
|
|
2131
2259
|
{
|
|
2132
2260
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -2142,7 +2270,7 @@ function Pagination({
|
|
|
2142
2270
|
}
|
|
2143
2271
|
|
|
2144
2272
|
// src/components/feedback/InlineMessage.tsx
|
|
2145
|
-
var
|
|
2273
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2146
2274
|
var KIND_ICON = {
|
|
2147
2275
|
info: "info",
|
|
2148
2276
|
success: "check-circle-2",
|
|
@@ -2152,7 +2280,7 @@ var KIND_ICON = {
|
|
|
2152
2280
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
2153
2281
|
const msg = usePireMessages();
|
|
2154
2282
|
const assertive = kind === "error" || kind === "warning";
|
|
2155
|
-
return /* @__PURE__ */ (0,
|
|
2283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2156
2284
|
"div",
|
|
2157
2285
|
{
|
|
2158
2286
|
className: cx("pire-msg", className),
|
|
@@ -2161,13 +2289,13 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
2161
2289
|
"aria-live": assertive ? "assertive" : "polite",
|
|
2162
2290
|
...rest,
|
|
2163
2291
|
children: [
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2166
|
-
title ? /* @__PURE__ */ (0,
|
|
2167
|
-
children ? /* @__PURE__ */ (0,
|
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
2293
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
2294
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "pire-msg-title", children: title }) : null,
|
|
2295
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "pire-msg-body", children }) : null,
|
|
2168
2296
|
action
|
|
2169
2297
|
] }),
|
|
2170
|
-
onClose ? /* @__PURE__ */ (0,
|
|
2298
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
2171
2299
|
]
|
|
2172
2300
|
}
|
|
2173
2301
|
);
|
|
@@ -2175,7 +2303,7 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
2175
2303
|
|
|
2176
2304
|
// src/components/feedback/Toast.tsx
|
|
2177
2305
|
var React12 = __toESM(require("react"), 1);
|
|
2178
|
-
var
|
|
2306
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2179
2307
|
var KIND_ICON2 = {
|
|
2180
2308
|
info: "info",
|
|
2181
2309
|
success: "check-circle-2",
|
|
@@ -2184,7 +2312,7 @@ var KIND_ICON2 = {
|
|
|
2184
2312
|
};
|
|
2185
2313
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
2186
2314
|
const msg = usePireMessages();
|
|
2187
|
-
return /* @__PURE__ */ (0,
|
|
2315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
2188
2316
|
"div",
|
|
2189
2317
|
{
|
|
2190
2318
|
className: cx("pire-toast", className),
|
|
@@ -2193,9 +2321,9 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
2193
2321
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
2194
2322
|
...rest,
|
|
2195
2323
|
children: [
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
onClose ? /* @__PURE__ */ (0,
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { style: { flex: 1 }, children }),
|
|
2326
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
2199
2327
|
]
|
|
2200
2328
|
}
|
|
2201
2329
|
);
|
|
@@ -2213,9 +2341,9 @@ function ToastProvider({ children, timeout = 6e3 }) {
|
|
|
2213
2341
|
return id;
|
|
2214
2342
|
}, [close, timeout]);
|
|
2215
2343
|
const value = React12.useMemo(() => ({ add, close }), [add, close]);
|
|
2216
|
-
return /* @__PURE__ */ (0,
|
|
2344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(ToastContext.Provider, { value, children: [
|
|
2217
2345
|
children,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2346
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
2219
2347
|
] });
|
|
2220
2348
|
}
|
|
2221
2349
|
function useToast() {
|
|
@@ -2225,8 +2353,8 @@ function useToast() {
|
|
|
2225
2353
|
}
|
|
2226
2354
|
|
|
2227
2355
|
// src/components/data/KpiTile.tsx
|
|
2228
|
-
var
|
|
2229
|
-
var
|
|
2356
|
+
var import_react_aria_components28 = require("react-aria-components");
|
|
2357
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2230
2358
|
function KpiTile({
|
|
2231
2359
|
label,
|
|
2232
2360
|
value,
|
|
@@ -2242,50 +2370,50 @@ function KpiTile({
|
|
|
2242
2370
|
style
|
|
2243
2371
|
}) {
|
|
2244
2372
|
const tone = deltaTone ?? (deltaDirection === "down" ? "negative" : "positive");
|
|
2245
|
-
const body = /* @__PURE__ */ (0,
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2247
|
-
icon ? /* @__PURE__ */ (0,
|
|
2373
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "pire-kpi-label", children: [
|
|
2375
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: icon, size: 16 }) : null,
|
|
2248
2376
|
label
|
|
2249
2377
|
] }),
|
|
2250
|
-
/* @__PURE__ */ (0,
|
|
2378
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "pire-kpi-value", children: [
|
|
2251
2379
|
value,
|
|
2252
|
-
unit ? /* @__PURE__ */ (0,
|
|
2380
|
+
unit ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "pire-kpi-unit", children: unit }) : null
|
|
2253
2381
|
] }),
|
|
2254
|
-
delta ? /* @__PURE__ */ (0,
|
|
2255
|
-
deltaDirection ? /* @__PURE__ */ (0,
|
|
2382
|
+
delta ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "pire-kpi-delta", "data-tone": tone, children: [
|
|
2383
|
+
deltaDirection ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { name: deltaDirection === "up" ? "trending-up" : "trending-down", size: 12 }) : null,
|
|
2256
2384
|
delta
|
|
2257
2385
|
] }) : null,
|
|
2258
|
-
footnote ? /* @__PURE__ */ (0,
|
|
2386
|
+
footnote ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "pire-kpi-foot", children: footnote }) : null
|
|
2259
2387
|
] });
|
|
2260
2388
|
const props = { className: cx("pire-kpi", className), "data-status": status, style };
|
|
2261
|
-
return onPress ? /* @__PURE__ */ (0,
|
|
2389
|
+
return onPress ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_aria_components28.Button, { ...props, "data-pressable": "true", onPress, children: body }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { ...props, children: body });
|
|
2262
2390
|
}
|
|
2263
2391
|
|
|
2264
2392
|
// src/components/data/ObjectHeader.tsx
|
|
2265
|
-
var
|
|
2393
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2266
2394
|
function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions, className, ...rest }) {
|
|
2267
|
-
return /* @__PURE__ */ (0,
|
|
2395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
2268
2396
|
breadcrumb,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
subtitle || id ? /* @__PURE__ */ (0,
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
2398
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h1", { className: "pire-objheader-title", children: title }),
|
|
2400
|
+
subtitle || id ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "pire-objheader-sub", children: [
|
|
2273
2401
|
subtitle,
|
|
2274
|
-
id ? /* @__PURE__ */ (0,
|
|
2402
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "pire-objheader-id", children: id }) : null
|
|
2275
2403
|
] }) : null
|
|
2276
2404
|
] }),
|
|
2277
2405
|
badge,
|
|
2278
|
-
actions ? /* @__PURE__ */ (0,
|
|
2406
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "pire-objheader-actions", children: actions }) : null
|
|
2279
2407
|
] }),
|
|
2280
|
-
facts?.length ? /* @__PURE__ */ (0,
|
|
2281
|
-
/* @__PURE__ */ (0,
|
|
2282
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
facts?.length ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dd", { className: "pire-fact-value", "data-numeric": fact.numeric ? "true" : void 0, style: { margin: 0 }, children: fact.value })
|
|
2283
2411
|
] }, fact.label)) }) : null
|
|
2284
2412
|
] });
|
|
2285
2413
|
}
|
|
2286
2414
|
|
|
2287
2415
|
// src/components/data/FilterBar.tsx
|
|
2288
|
-
var
|
|
2416
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2289
2417
|
function FilterBar({
|
|
2290
2418
|
children,
|
|
2291
2419
|
activeFilters = [],
|
|
@@ -2302,66 +2430,555 @@ function FilterBar({
|
|
|
2302
2430
|
const label = useMessage("filterBarLabel", rest["aria-label"]);
|
|
2303
2431
|
const go = useMessage("filterBarGo", goLabel);
|
|
2304
2432
|
const clearAll = useMessage("filterBarClearAll", clearAllLabel);
|
|
2305
|
-
return /* @__PURE__ */ (0,
|
|
2306
|
-
/* @__PURE__ */ (0,
|
|
2433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: cx("pire-filterbar", className), ...rest, "aria-label": label, children: [
|
|
2434
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "pire-filterbar-controls", children: [
|
|
2307
2435
|
children,
|
|
2308
|
-
onGo ? /* @__PURE__ */ (0,
|
|
2436
|
+
onGo ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "primary", onPress: onGo, children: go }) : null
|
|
2309
2437
|
] }),
|
|
2310
|
-
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0,
|
|
2311
|
-
activeFilters.map((filter) => /* @__PURE__ */ (0,
|
|
2312
|
-
activeFilters.length && onClear ? /* @__PURE__ */ (0,
|
|
2313
|
-
resultLabel ? /* @__PURE__ */ (0,
|
|
2314
|
-
actions ? /* @__PURE__ */ (0,
|
|
2438
|
+
activeFilters.length || resultLabel || actions ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "pire-filterbar-foot", children: [
|
|
2439
|
+
activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Tag, { onRemove: onRemoveFilter ? () => onRemoveFilter(filter.id) : void 0, children: filter.label }, filter.id)),
|
|
2440
|
+
activeFilters.length && onClear ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Button, { variant: "tertiary", size: "sm", onPress: onClear, children: clearAll }) : null,
|
|
2441
|
+
resultLabel ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "pire-filterbar-result", "aria-live": "polite", children: resultLabel }) : null,
|
|
2442
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "pire-filterbar-actions", children: actions }) : null
|
|
2315
2443
|
] }) : null
|
|
2316
2444
|
] });
|
|
2317
2445
|
}
|
|
2318
2446
|
|
|
2319
2447
|
// src/components/data/DescriptionList.tsx
|
|
2320
|
-
var
|
|
2448
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2321
2449
|
function DescriptionList({ items, layout = "rows", columns = 3, className, style, ...rest }) {
|
|
2322
|
-
return /* @__PURE__ */ (0,
|
|
2450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2323
2451
|
"dl",
|
|
2324
2452
|
{
|
|
2325
2453
|
className: cx("pire-dl", className),
|
|
2326
2454
|
"data-layout": layout,
|
|
2327
2455
|
style: { ...layout === "grid" ? { "--pire-dl-cols": columns } : null, ...style },
|
|
2328
2456
|
...rest,
|
|
2329
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2457
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "pire-dl-row", "data-emphasis": item.emphasis ? "true" : void 0, children: [
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("dt", { className: "pire-dl-term", children: [
|
|
2331
2459
|
item.label,
|
|
2332
2460
|
item.hint
|
|
2333
2461
|
] }),
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("dd", { className: "pire-dl-value", "data-numeric": item.numeric ? "true" : void 0, children: item.value })
|
|
2335
2463
|
] }, i))
|
|
2336
2464
|
}
|
|
2337
2465
|
);
|
|
2338
2466
|
}
|
|
2339
2467
|
|
|
2340
2468
|
// src/components/data/Timeline.tsx
|
|
2341
|
-
var
|
|
2469
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2342
2470
|
function Timeline({ entries, reverse = false, className, ...rest }) {
|
|
2343
2471
|
const list = reverse ? [...entries].reverse() : entries;
|
|
2344
|
-
return /* @__PURE__ */ (0,
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2346
|
-
/* @__PURE__ */ (0,
|
|
2347
|
-
entry.actor ? /* @__PURE__ */ (0,
|
|
2472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ol", { className: cx("pire-timeline", className), ...rest, children: list.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("li", { className: "pire-timeline-item", children: [
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "pire-timeline-time", children: entry.time }),
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "pire-timeline-text", children: entry.event }),
|
|
2475
|
+
entry.actor ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "pire-timeline-actor", children: entry.actor }) : null
|
|
2348
2476
|
] }, entry.id ?? i)) });
|
|
2349
2477
|
}
|
|
2350
2478
|
|
|
2479
|
+
// src/components/data/chartGeometry.ts
|
|
2480
|
+
var VIZ_SLOT_COUNT = 6;
|
|
2481
|
+
var NICE_STEPS = [1, 2, 2.5, 5, 10];
|
|
2482
|
+
function niceStep(rough) {
|
|
2483
|
+
if (!(rough > 0)) return 1;
|
|
2484
|
+
const magnitude = 10 ** Math.floor(Math.log10(rough));
|
|
2485
|
+
const normalized = rough / magnitude;
|
|
2486
|
+
return (NICE_STEPS.find((candidate) => candidate >= normalized) ?? 10) * magnitude;
|
|
2487
|
+
}
|
|
2488
|
+
function linearScale(values, tickCount = 4, startAtZero = true) {
|
|
2489
|
+
const present = values.filter((value) => value != null && Number.isFinite(value));
|
|
2490
|
+
if (present.length === 0) return { min: 0, max: 1, ticks: [0, 1] };
|
|
2491
|
+
let low = Math.min(...present);
|
|
2492
|
+
let high = Math.max(...present);
|
|
2493
|
+
if (startAtZero) {
|
|
2494
|
+
low = Math.min(0, low);
|
|
2495
|
+
high = Math.max(0, high);
|
|
2496
|
+
}
|
|
2497
|
+
if (low === high) {
|
|
2498
|
+
high = low === 0 ? 1 : low + Math.abs(low);
|
|
2499
|
+
}
|
|
2500
|
+
const step = niceStep((high - low) / Math.max(1, tickCount));
|
|
2501
|
+
const EDGE_TOLERANCE = 1e-9;
|
|
2502
|
+
const decimals = Math.max(0, 1 - Math.floor(Math.log10(step)));
|
|
2503
|
+
const toStepPrecision = (value) => Number(value.toFixed(decimals));
|
|
2504
|
+
const min = toStepPrecision(Math.floor(low / step + EDGE_TOLERANCE) * step);
|
|
2505
|
+
const max = toStepPrecision(Math.ceil(high / step - EDGE_TOLERANCE) * step);
|
|
2506
|
+
const stepCount = Math.round((max - min) / step);
|
|
2507
|
+
const ticks = Array.from(
|
|
2508
|
+
{ length: stepCount + 1 },
|
|
2509
|
+
(_, index) => toStepPrecision(min + index * step)
|
|
2510
|
+
);
|
|
2511
|
+
return { min, max, ticks };
|
|
2512
|
+
}
|
|
2513
|
+
function scalePosition(value, scale) {
|
|
2514
|
+
const span = scale.max - scale.min;
|
|
2515
|
+
return span === 0 ? 0 : (value - scale.min) / span;
|
|
2516
|
+
}
|
|
2517
|
+
function seriesColor(series, index) {
|
|
2518
|
+
const slot = series.colorIndex ?? index + 1;
|
|
2519
|
+
return slot >= 1 && slot <= VIZ_SLOT_COUNT ? `var(--viz-${slot})` : "var(--viz-other)";
|
|
2520
|
+
}
|
|
2521
|
+
var IS_DEV2 = process.env.NODE_ENV !== "production";
|
|
2522
|
+
var warnedCharts = /* @__PURE__ */ new Set();
|
|
2523
|
+
function warnOnSlotOverflow(series, chartLabel) {
|
|
2524
|
+
if (!IS_DEV2 || warnedCharts.has(chartLabel)) return;
|
|
2525
|
+
if (series.length <= VIZ_SLOT_COUNT) return;
|
|
2526
|
+
warnedCharts.add(chartLabel);
|
|
2527
|
+
console.warn(
|
|
2528
|
+
`[pire] "${chartLabel}" has ${series.length} series but the palette defines ${VIZ_SLOT_COUNT} distinguishable colours. The extras render in one shared neutral. Group the tail into an "Other" series, or split the chart into small multiples.`
|
|
2529
|
+
);
|
|
2530
|
+
}
|
|
2531
|
+
function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
2532
|
+
if (!IS_DEV2 || warnedCharts.has(`donut:${chartLabel}`)) return;
|
|
2533
|
+
const complaints = [];
|
|
2534
|
+
if (series.length > 1) {
|
|
2535
|
+
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
2536
|
+
}
|
|
2537
|
+
if (categoryCount > VIZ_SLOT_COUNT) {
|
|
2538
|
+
complaints.push(`it has ${categoryCount} segments and the palette defines ${VIZ_SLOT_COUNT}; past about four, slices stop being readable at all \u2014 group the tail into "Other"`);
|
|
2539
|
+
}
|
|
2540
|
+
if (series[0]?.values.some((value) => value != null && value < 0)) {
|
|
2541
|
+
complaints.push("it contains negative values, which have no part-to-whole meaning \u2014 a signed measure belongs in a bar chart");
|
|
2542
|
+
}
|
|
2543
|
+
if (complaints.length === 0) return;
|
|
2544
|
+
warnedCharts.add(`donut:${chartLabel}`);
|
|
2545
|
+
console.warn(`[pire] DonutChart "${chartLabel}": ${complaints.join("; ")}.`);
|
|
2546
|
+
}
|
|
2547
|
+
function stackTotal(series, categoryIndex) {
|
|
2548
|
+
return series.reduce((total, one) => total + (one.values[categoryIndex] ?? 0), 0);
|
|
2549
|
+
}
|
|
2550
|
+
function flatValues(series) {
|
|
2551
|
+
return series.flatMap((one) => one.values);
|
|
2552
|
+
}
|
|
2553
|
+
function alignToCategories(series, categoryCount) {
|
|
2554
|
+
return series.map((one) => one.values.length <= categoryCount ? one : { ...one, values: one.values.slice(0, categoryCount) });
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
// src/components/data/ChartFrame.tsx
|
|
2558
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2559
|
+
function seriesLegend(series) {
|
|
2560
|
+
return series.map((one, index) => ({
|
|
2561
|
+
key: one.id,
|
|
2562
|
+
label: one.label,
|
|
2563
|
+
color: seriesColor(one, index)
|
|
2564
|
+
}));
|
|
2565
|
+
}
|
|
2566
|
+
var defaultFormatValue = (value) => value.toLocaleString();
|
|
2567
|
+
function ChartFrame({
|
|
2568
|
+
label,
|
|
2569
|
+
title,
|
|
2570
|
+
description,
|
|
2571
|
+
categories,
|
|
2572
|
+
series,
|
|
2573
|
+
formatValue,
|
|
2574
|
+
legend,
|
|
2575
|
+
showDataTable,
|
|
2576
|
+
className,
|
|
2577
|
+
style,
|
|
2578
|
+
children
|
|
2579
|
+
}) {
|
|
2580
|
+
const msg = usePireMessages();
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("figure", { className: cx("pire-chart", className), style, children: [
|
|
2582
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("figcaption", { className: "pire-chart-head", children: [
|
|
2583
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-chart-title", children: title }) : null,
|
|
2584
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-chart-desc", children: description }) : null
|
|
2585
|
+
] }) : null,
|
|
2586
|
+
legend && legend.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ul", { className: "pire-chart-legend", children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("li", { className: "pire-chart-legend-item", children: [
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "pire-chart-swatch", style: { background: item.color } }),
|
|
2588
|
+
item.label
|
|
2589
|
+
] }, item.key)) }) : null,
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "pire-chart-plot", "aria-hidden": "true", children }),
|
|
2591
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: showDataTable ? "pire-chart-table" : "pire-sr-only", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("table", { children: [
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("caption", { children: label }),
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("tr", { children: [
|
|
2594
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("th", { scope: "col", children: msg.chartCategoryHeader }),
|
|
2595
|
+
series.map((one) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("th", { scope: "col", children: one.label }, one.id))
|
|
2596
|
+
] }) }),
|
|
2597
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("tbody", { children: categories.map((category, categoryIndex) => (
|
|
2598
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
2599
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("tr", { children: [
|
|
2600
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("th", { scope: "row", children: category }),
|
|
2601
|
+
series.map((one) => {
|
|
2602
|
+
const value = one.values[categoryIndex];
|
|
2603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("td", { children: value == null ? msg.chartNoValue : formatValue(value) }, one.id);
|
|
2604
|
+
})
|
|
2605
|
+
] }, categoryIndex)
|
|
2606
|
+
)) })
|
|
2607
|
+
] }) })
|
|
2608
|
+
] });
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
// src/components/data/BarChart.tsx
|
|
2612
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2613
|
+
function BarChart({
|
|
2614
|
+
categories,
|
|
2615
|
+
series: rawSeries,
|
|
2616
|
+
title,
|
|
2617
|
+
description,
|
|
2618
|
+
formatValue = defaultFormatValue,
|
|
2619
|
+
height = 260,
|
|
2620
|
+
emptyState,
|
|
2621
|
+
showDataTable,
|
|
2622
|
+
orientation = "horizontal",
|
|
2623
|
+
stacked = false,
|
|
2624
|
+
showValues,
|
|
2625
|
+
className,
|
|
2626
|
+
style,
|
|
2627
|
+
...rest
|
|
2628
|
+
}) {
|
|
2629
|
+
const label = rest["aria-label"];
|
|
2630
|
+
const msg = usePireMessages();
|
|
2631
|
+
warnOnSlotOverflow(rawSeries, label);
|
|
2632
|
+
const series = alignToCategories(rawSeries, categories.length);
|
|
2633
|
+
const hasData = categories.length > 0 && series.length > 0;
|
|
2634
|
+
const withValues = showValues ?? series.length === 1;
|
|
2635
|
+
const scale = linearScale(
|
|
2636
|
+
stacked ? categories.map((_, index) => stackTotal(series, index)) : flatValues(series)
|
|
2637
|
+
);
|
|
2638
|
+
const sizeOf = (value) => `${scalePosition(value, scale) * 100}%`;
|
|
2639
|
+
const horizontalLabelFor = (categoryIndex) => {
|
|
2640
|
+
if (stacked) return formatValue(stackTotal(series, categoryIndex));
|
|
2641
|
+
const value = series[0].values[categoryIndex];
|
|
2642
|
+
return value == null ? msg.chartNoValue : formatValue(value);
|
|
2643
|
+
};
|
|
2644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2645
|
+
ChartFrame,
|
|
2646
|
+
{
|
|
2647
|
+
label,
|
|
2648
|
+
title,
|
|
2649
|
+
description,
|
|
2650
|
+
categories,
|
|
2651
|
+
series,
|
|
2652
|
+
formatValue,
|
|
2653
|
+
legend: seriesLegend(series),
|
|
2654
|
+
showDataTable,
|
|
2655
|
+
className,
|
|
2656
|
+
style,
|
|
2657
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2658
|
+
"div",
|
|
2659
|
+
{
|
|
2660
|
+
className: "pire-chart-bars",
|
|
2661
|
+
"data-orientation": orientation,
|
|
2662
|
+
"data-stacked": String(stacked),
|
|
2663
|
+
style: { "--pire-chart-height": `${height}px` },
|
|
2664
|
+
children: categories.map((category, categoryIndex) => (
|
|
2665
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
2666
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-chart-group", children: [
|
|
2667
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-chart-cat", children: category }),
|
|
2668
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-chart-track", children: series.map((one, seriesIndex) => {
|
|
2669
|
+
const value = one.values[categoryIndex];
|
|
2670
|
+
if (value == null) return null;
|
|
2671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2672
|
+
"div",
|
|
2673
|
+
{
|
|
2674
|
+
className: "pire-chart-bar",
|
|
2675
|
+
style: {
|
|
2676
|
+
"--pire-bar-size": sizeOf(value),
|
|
2677
|
+
"--pire-bar-color": seriesColor(one, seriesIndex)
|
|
2678
|
+
},
|
|
2679
|
+
children: [
|
|
2680
|
+
withValues && orientation === "vertical" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-chart-barval", children: formatValue(value) }) : null,
|
|
2681
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
2682
|
+
series.length > 1 ? `${one.label}: ` : "",
|
|
2683
|
+
formatValue(value)
|
|
2684
|
+
] })
|
|
2685
|
+
]
|
|
2686
|
+
},
|
|
2687
|
+
one.id
|
|
2688
|
+
);
|
|
2689
|
+
}) }),
|
|
2690
|
+
withValues && orientation === "horizontal" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-chart-val", children: horizontalLabelFor(categoryIndex) }) : null
|
|
2691
|
+
] }, categoryIndex)
|
|
2692
|
+
))
|
|
2693
|
+
}
|
|
2694
|
+
)
|
|
2695
|
+
}
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/components/data/LineChart.tsx
|
|
2700
|
+
var React13 = __toESM(require("react"), 1);
|
|
2701
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2702
|
+
var PLOT_INSET = { top: 10, right: 14, bottom: 24, left: 58 };
|
|
2703
|
+
var MARKER_LIMIT = 20;
|
|
2704
|
+
var useIsomorphicLayoutEffect2 = typeof window === "undefined" ? React13.useEffect : React13.useLayoutEffect;
|
|
2705
|
+
function useMeasuredWidth() {
|
|
2706
|
+
const ref = React13.useRef(null);
|
|
2707
|
+
const [width, setWidth] = React13.useState(0);
|
|
2708
|
+
useIsomorphicLayoutEffect2(() => {
|
|
2709
|
+
const element = ref.current;
|
|
2710
|
+
if (!element) return;
|
|
2711
|
+
setWidth(element.getBoundingClientRect().width);
|
|
2712
|
+
const observer = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width));
|
|
2713
|
+
observer.observe(element);
|
|
2714
|
+
return () => observer.disconnect();
|
|
2715
|
+
}, []);
|
|
2716
|
+
return [ref, width];
|
|
2717
|
+
}
|
|
2718
|
+
function LineChart({
|
|
2719
|
+
categories,
|
|
2720
|
+
series: rawSeries,
|
|
2721
|
+
title,
|
|
2722
|
+
description,
|
|
2723
|
+
formatValue = defaultFormatValue,
|
|
2724
|
+
height = 260,
|
|
2725
|
+
emptyState,
|
|
2726
|
+
showDataTable,
|
|
2727
|
+
showArea = false,
|
|
2728
|
+
showMarkers,
|
|
2729
|
+
zoomToData = false,
|
|
2730
|
+
className,
|
|
2731
|
+
style,
|
|
2732
|
+
...rest
|
|
2733
|
+
}) {
|
|
2734
|
+
const label = rest["aria-label"];
|
|
2735
|
+
const msg = usePireMessages();
|
|
2736
|
+
warnOnSlotOverflow(rawSeries, label);
|
|
2737
|
+
const [plotRef, width] = useMeasuredWidth();
|
|
2738
|
+
const series = alignToCategories(rawSeries, categories.length);
|
|
2739
|
+
const hasData = categories.length > 0 && series.length > 0;
|
|
2740
|
+
const withMarkers = showMarkers ?? categories.length <= MARKER_LIMIT;
|
|
2741
|
+
const scale = linearScale(flatValues(series), 4, !zoomToData);
|
|
2742
|
+
const innerWidth = Math.max(0, width - PLOT_INSET.left - PLOT_INSET.right);
|
|
2743
|
+
const innerHeight = Math.max(0, height - PLOT_INSET.top - PLOT_INSET.bottom);
|
|
2744
|
+
const xAt = (index) => PLOT_INSET.left + (categories.length <= 1 ? innerWidth / 2 : index / (categories.length - 1) * innerWidth);
|
|
2745
|
+
const yAt = (value) => PLOT_INSET.top + innerHeight - scalePosition(value, scale) * innerHeight;
|
|
2746
|
+
const pathFor = (values) => {
|
|
2747
|
+
let path = "";
|
|
2748
|
+
let penIsDown = false;
|
|
2749
|
+
values.forEach((value, index) => {
|
|
2750
|
+
if (value == null) {
|
|
2751
|
+
penIsDown = false;
|
|
2752
|
+
return;
|
|
2753
|
+
}
|
|
2754
|
+
path += `${penIsDown ? "L" : "M"}${xAt(index)} ${yAt(value)} `;
|
|
2755
|
+
penIsDown = true;
|
|
2756
|
+
});
|
|
2757
|
+
return path.trim();
|
|
2758
|
+
};
|
|
2759
|
+
const areaFor = (values) => {
|
|
2760
|
+
const present = values.map((value, index) => ({ value, index })).filter((point) => point.value != null);
|
|
2761
|
+
if (present.length < 2) return "";
|
|
2762
|
+
const baseline = PLOT_INSET.top + innerHeight;
|
|
2763
|
+
const line = present.map((point) => `${xAt(point.index)} ${yAt(point.value)}`).join(" L");
|
|
2764
|
+
const last = present[present.length - 1];
|
|
2765
|
+
return `M${xAt(present[0].index)} ${baseline} L${line} L${xAt(last.index)} ${baseline} Z`;
|
|
2766
|
+
};
|
|
2767
|
+
const labelEvery = Math.max(1, Math.ceil(categories.length / Math.max(2, Math.floor(innerWidth / 64))));
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2769
|
+
ChartFrame,
|
|
2770
|
+
{
|
|
2771
|
+
label,
|
|
2772
|
+
title,
|
|
2773
|
+
description,
|
|
2774
|
+
categories,
|
|
2775
|
+
series,
|
|
2776
|
+
formatValue,
|
|
2777
|
+
legend: seriesLegend(series),
|
|
2778
|
+
showDataTable,
|
|
2779
|
+
className,
|
|
2780
|
+
style,
|
|
2781
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "pire-chart-lines", ref: plotRef, style: { height }, children: [
|
|
2782
|
+
width > 0 ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2783
|
+
"svg",
|
|
2784
|
+
{
|
|
2785
|
+
width,
|
|
2786
|
+
height,
|
|
2787
|
+
className: "pire-chart-svg",
|
|
2788
|
+
"aria-hidden": "true",
|
|
2789
|
+
focusable: "false",
|
|
2790
|
+
children: [
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { className: "pire-chart-grid", children: scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2792
|
+
"line",
|
|
2793
|
+
{
|
|
2794
|
+
x1: PLOT_INSET.left,
|
|
2795
|
+
x2: width - PLOT_INSET.right,
|
|
2796
|
+
y1: yAt(tick),
|
|
2797
|
+
y2: yAt(tick)
|
|
2798
|
+
},
|
|
2799
|
+
tick
|
|
2800
|
+
)) }),
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("g", { className: "pire-chart-tick", children: [
|
|
2802
|
+
scale.ticks.map((tick) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2803
|
+
"text",
|
|
2804
|
+
{
|
|
2805
|
+
x: PLOT_INSET.left - 8,
|
|
2806
|
+
y: yAt(tick),
|
|
2807
|
+
textAnchor: "end",
|
|
2808
|
+
dominantBaseline: "middle",
|
|
2809
|
+
children: formatValue(tick)
|
|
2810
|
+
},
|
|
2811
|
+
tick
|
|
2812
|
+
)),
|
|
2813
|
+
categories.map((category, index) => index % labelEvery === 0 ? (
|
|
2814
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
2816
|
+
) : null)
|
|
2817
|
+
] }),
|
|
2818
|
+
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2819
|
+
"path",
|
|
2820
|
+
{
|
|
2821
|
+
d: areaFor(series[0].values),
|
|
2822
|
+
className: "pire-chart-area",
|
|
2823
|
+
style: { fill: seriesColor(series[0], 0) }
|
|
2824
|
+
}
|
|
2825
|
+
) : null,
|
|
2826
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
2827
|
+
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { className: "pire-chart-marker", children: series.map((one, seriesIndex) => one.values.map((value, index) => value == null ? null : (
|
|
2828
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: a series is positional — the index is the point's identity, and category labels repeat.
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2830
|
+
"circle",
|
|
2831
|
+
{
|
|
2832
|
+
cx: xAt(index),
|
|
2833
|
+
cy: yAt(value),
|
|
2834
|
+
r: 4,
|
|
2835
|
+
fill: seriesColor(one, seriesIndex)
|
|
2836
|
+
},
|
|
2837
|
+
`${one.id}-${index}`
|
|
2838
|
+
)
|
|
2839
|
+
))) }) : null
|
|
2840
|
+
]
|
|
2841
|
+
}
|
|
2842
|
+
) : null,
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2844
|
+
"div",
|
|
2845
|
+
{
|
|
2846
|
+
className: "pire-chart-hover",
|
|
2847
|
+
style: { inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px` },
|
|
2848
|
+
children: categories.map((category, categoryIndex) => (
|
|
2849
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
2850
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-chart-band", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
2851
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: category }),
|
|
2852
|
+
series.map((one) => {
|
|
2853
|
+
const value = one.values[categoryIndex];
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "pire-chart-tip-row", children: [
|
|
2855
|
+
one.label,
|
|
2856
|
+
": ",
|
|
2857
|
+
value == null ? "No data" : formatValue(value)
|
|
2858
|
+
] }, one.id);
|
|
2859
|
+
})
|
|
2860
|
+
] }) }, categoryIndex)
|
|
2861
|
+
))
|
|
2862
|
+
}
|
|
2863
|
+
)
|
|
2864
|
+
] })
|
|
2865
|
+
}
|
|
2866
|
+
);
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
// src/components/data/DonutChart.tsx
|
|
2870
|
+
var React14 = __toESM(require("react"), 1);
|
|
2871
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2872
|
+
var SEGMENT_GAP_DEGREES = 1.5;
|
|
2873
|
+
function DonutChart({
|
|
2874
|
+
categories,
|
|
2875
|
+
series,
|
|
2876
|
+
title,
|
|
2877
|
+
description,
|
|
2878
|
+
formatValue = defaultFormatValue,
|
|
2879
|
+
height = 220,
|
|
2880
|
+
emptyState,
|
|
2881
|
+
showDataTable,
|
|
2882
|
+
centerLabel,
|
|
2883
|
+
centerCaption,
|
|
2884
|
+
thickness = 28,
|
|
2885
|
+
className,
|
|
2886
|
+
style,
|
|
2887
|
+
...rest
|
|
2888
|
+
}) {
|
|
2889
|
+
const label = rest["aria-label"];
|
|
2890
|
+
const msg = usePireMessages();
|
|
2891
|
+
const [hoveredIndex, setHoveredIndex] = React14.useState(null);
|
|
2892
|
+
warnOnDonutShape(series, categories.length, label);
|
|
2893
|
+
const values = (series[0]?.values ?? []).slice(0, categories.length);
|
|
2894
|
+
const segments = categories.map((category, index) => ({ category, index, value: values[index] ?? 0 })).filter((segment) => segment.value > 0);
|
|
2895
|
+
const total = segments.reduce((sum, segment) => sum + segment.value, 0);
|
|
2896
|
+
const hasData = segments.length > 0 && total > 0;
|
|
2897
|
+
const size = height;
|
|
2898
|
+
const radius = (size - thickness) / 2;
|
|
2899
|
+
const circumference = 2 * Math.PI * radius;
|
|
2900
|
+
const gapLength = SEGMENT_GAP_DEGREES / 360 * circumference;
|
|
2901
|
+
const legend = segments.map((segment) => ({
|
|
2902
|
+
key: segment.category,
|
|
2903
|
+
label: segment.category,
|
|
2904
|
+
color: colorForSegment(segment.index)
|
|
2905
|
+
}));
|
|
2906
|
+
const hovered = hoveredIndex == null ? null : segments.find((segment) => segment.index === hoveredIndex) ?? null;
|
|
2907
|
+
let arcStart = 0;
|
|
2908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2909
|
+
ChartFrame,
|
|
2910
|
+
{
|
|
2911
|
+
label,
|
|
2912
|
+
title,
|
|
2913
|
+
description,
|
|
2914
|
+
categories,
|
|
2915
|
+
series,
|
|
2916
|
+
formatValue,
|
|
2917
|
+
legend,
|
|
2918
|
+
showDataTable,
|
|
2919
|
+
className,
|
|
2920
|
+
style,
|
|
2921
|
+
children: !hasData ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pire-chart-empty", children: emptyState ?? msg.chartEmpty }) : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pire-chart-donut", style: { height: size }, children: [
|
|
2922
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2923
|
+
"svg",
|
|
2924
|
+
{
|
|
2925
|
+
width: size,
|
|
2926
|
+
height: size,
|
|
2927
|
+
"aria-hidden": "true",
|
|
2928
|
+
focusable: "false",
|
|
2929
|
+
onMouseLeave: () => setHoveredIndex(null),
|
|
2930
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("g", { transform: `rotate(-90 ${size / 2} ${size / 2})`, children: segments.map((segment) => {
|
|
2931
|
+
const arcLength = segment.value / total * circumference;
|
|
2932
|
+
const offset = arcStart;
|
|
2933
|
+
arcStart += arcLength;
|
|
2934
|
+
return (
|
|
2935
|
+
// 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.
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2937
|
+
"circle",
|
|
2938
|
+
{
|
|
2939
|
+
className: "pire-chart-arc",
|
|
2940
|
+
cx: size / 2,
|
|
2941
|
+
cy: size / 2,
|
|
2942
|
+
r: radius,
|
|
2943
|
+
stroke: colorForSegment(segment.index),
|
|
2944
|
+
strokeWidth: thickness,
|
|
2945
|
+
strokeDasharray: `${Math.max(0, arcLength - gapLength)} ${circumference}`,
|
|
2946
|
+
strokeDashoffset: -offset,
|
|
2947
|
+
"data-hovered": hoveredIndex === segment.index ? "true" : void 0,
|
|
2948
|
+
onMouseEnter: () => setHoveredIndex(segment.index)
|
|
2949
|
+
},
|
|
2950
|
+
segment.category
|
|
2951
|
+
)
|
|
2952
|
+
);
|
|
2953
|
+
}) })
|
|
2954
|
+
}
|
|
2955
|
+
),
|
|
2956
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "pire-chart-donut-center", style: { width: size - thickness * 2 - 8 }, children: [
|
|
2957
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "pire-chart-donut-value", children: hovered ? formatValue(hovered.value) : centerLabel ?? formatValue(total) }),
|
|
2958
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "pire-chart-donut-caption", children: hovered ? hovered.category : centerCaption })
|
|
2959
|
+
] })
|
|
2960
|
+
] })
|
|
2961
|
+
}
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
function colorForSegment(index) {
|
|
2965
|
+
return index < VIZ_SLOT_COUNT ? `var(--viz-${index + 1})` : "var(--viz-other)";
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2351
2968
|
// src/components/data/LinkList.tsx
|
|
2352
|
-
var
|
|
2353
|
-
var
|
|
2969
|
+
var import_react_aria_components29 = require("react-aria-components");
|
|
2970
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2354
2971
|
function LinkList({ items, onSelect, className, ...rest }) {
|
|
2355
|
-
return /* @__PURE__ */ (0,
|
|
2356
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2357
|
-
item.key ? /* @__PURE__ */ (0,
|
|
2358
|
-
item.text ? /* @__PURE__ */ (0,
|
|
2972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cx("pire-linklist", className), role: "list", ...rest, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_react_aria_components29.Button, { className: "pire-linklist-item", onPress: () => onSelect?.(item.id), children: [
|
|
2973
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { name: item.icon, size: 16, style: { color: "var(--text-secondary)" } }) : null,
|
|
2974
|
+
item.key ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-linklist-key", children: item.key }) : null,
|
|
2975
|
+
item.text ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "pire-linklist-text", children: item.text }) : null,
|
|
2359
2976
|
item.trailing
|
|
2360
2977
|
] }, item.id)) });
|
|
2361
2978
|
}
|
|
2362
2979
|
|
|
2363
2980
|
// src/components/layout/PageBand.tsx
|
|
2364
|
-
var
|
|
2981
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2365
2982
|
function PageBand({
|
|
2366
2983
|
surface = "card",
|
|
2367
2984
|
hasBorder = true,
|
|
@@ -2369,7 +2986,7 @@ function PageBand({
|
|
|
2369
2986
|
className,
|
|
2370
2987
|
...rest
|
|
2371
2988
|
}) {
|
|
2372
|
-
return /* @__PURE__ */ (0,
|
|
2989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2373
2990
|
"div",
|
|
2374
2991
|
{
|
|
2375
2992
|
className: cx("pire-pageband", className),
|
|
@@ -2382,56 +2999,56 @@ function PageBand({
|
|
|
2382
2999
|
}
|
|
2383
3000
|
|
|
2384
3001
|
// src/components/layout/PageHeader.tsx
|
|
2385
|
-
var
|
|
3002
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2386
3003
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
2387
|
-
return /* @__PURE__ */ (0,
|
|
2388
|
-
/* @__PURE__ */ (0,
|
|
2389
|
-
/* @__PURE__ */ (0,
|
|
2390
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
3005
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
3006
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { className: "pire-pageheader-title", children: title }),
|
|
3007
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
2391
3008
|
] }),
|
|
2392
|
-
actions ? /* @__PURE__ */ (0,
|
|
3009
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
2393
3010
|
] });
|
|
2394
3011
|
}
|
|
2395
3012
|
|
|
2396
3013
|
// src/components/layout/SectionHeader.tsx
|
|
2397
|
-
var
|
|
3014
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2398
3015
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
meta ? /* @__PURE__ */ (0,
|
|
2402
|
-
actions ? /* @__PURE__ */ (0,
|
|
3016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "pire-eyebrow", children: title }),
|
|
3018
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
3019
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
2403
3020
|
] });
|
|
2404
3021
|
}
|
|
2405
3022
|
|
|
2406
3023
|
// src/components/layout/SelectionBar.tsx
|
|
2407
|
-
var
|
|
3024
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2408
3025
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
2409
3026
|
if (!count) return null;
|
|
2410
|
-
return /* @__PURE__ */ (0,
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
3027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
2412
3029
|
count.toLocaleString(),
|
|
2413
3030
|
" ",
|
|
2414
3031
|
noun,
|
|
2415
3032
|
count === 1 ? "" : "s",
|
|
2416
3033
|
" selected"
|
|
2417
3034
|
] }),
|
|
2418
|
-
children ? /* @__PURE__ */ (0,
|
|
2419
|
-
actions ? /* @__PURE__ */ (0,
|
|
3035
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
3036
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
2420
3037
|
] });
|
|
2421
3038
|
}
|
|
2422
3039
|
|
|
2423
3040
|
// src/components/layout/FooterBar.tsx
|
|
2424
|
-
var
|
|
3041
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2425
3042
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
2426
|
-
return /* @__PURE__ */ (0,
|
|
2427
|
-
note ? /* @__PURE__ */ (0,
|
|
3043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
3044
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
2428
3045
|
children,
|
|
2429
|
-
actions ? /* @__PURE__ */ (0,
|
|
3046
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
2430
3047
|
] });
|
|
2431
3048
|
}
|
|
2432
3049
|
|
|
2433
3050
|
// src/components/patterns/ConfirmDialog.tsx
|
|
2434
|
-
var
|
|
3051
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2435
3052
|
function ConfirmDialog({
|
|
2436
3053
|
isOpen,
|
|
2437
3054
|
title,
|
|
@@ -2445,7 +3062,7 @@ function ConfirmDialog({
|
|
|
2445
3062
|
onConfirm,
|
|
2446
3063
|
onCancel
|
|
2447
3064
|
}) {
|
|
2448
|
-
return /* @__PURE__ */ (0,
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
2449
3066
|
Dialog,
|
|
2450
3067
|
{
|
|
2451
3068
|
isOpen,
|
|
@@ -2455,12 +3072,12 @@ function ConfirmDialog({
|
|
|
2455
3072
|
onClose: onCancel,
|
|
2456
3073
|
isDismissable: !isBusy,
|
|
2457
3074
|
showClose: false,
|
|
2458
|
-
footer: /* @__PURE__ */ (0,
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2460
|
-
/* @__PURE__ */ (0,
|
|
3075
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
3076
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
3077
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
2461
3078
|
] }),
|
|
2462
3079
|
children: [
|
|
2463
|
-
consequence ? /* @__PURE__ */ (0,
|
|
3080
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
2464
3081
|
children
|
|
2465
3082
|
]
|
|
2466
3083
|
}
|
|
@@ -2468,12 +3085,12 @@ function ConfirmDialog({
|
|
|
2468
3085
|
}
|
|
2469
3086
|
|
|
2470
3087
|
// src/components/patterns/SidePanel.tsx
|
|
2471
|
-
var
|
|
2472
|
-
var
|
|
3088
|
+
var import_react_aria_components30 = require("react-aria-components");
|
|
3089
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2473
3090
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
2474
3091
|
const msg = usePireMessages();
|
|
2475
|
-
return /* @__PURE__ */ (0,
|
|
2476
|
-
|
|
3092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3093
|
+
import_react_aria_components30.ModalOverlay,
|
|
2477
3094
|
{
|
|
2478
3095
|
className: "pire-sidepanel-overlay",
|
|
2479
3096
|
isOpen,
|
|
@@ -2481,36 +3098,36 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
2481
3098
|
onOpenChange: (o) => {
|
|
2482
3099
|
if (!o) onClose?.();
|
|
2483
3100
|
},
|
|
2484
|
-
children: /* @__PURE__ */ (0,
|
|
2485
|
-
/* @__PURE__ */ (0,
|
|
2486
|
-
/* @__PURE__ */ (0,
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2488
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
3101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_aria_components30.Modal, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_react_aria_components30.Dialog, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react_aria_components30.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
3105
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
2489
3106
|
] }),
|
|
2490
|
-
/* @__PURE__ */ (0,
|
|
3107
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
2491
3108
|
] }),
|
|
2492
|
-
/* @__PURE__ */ (0,
|
|
2493
|
-
footer ? /* @__PURE__ */ (0,
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
3110
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
2494
3111
|
] }) })
|
|
2495
3112
|
}
|
|
2496
3113
|
);
|
|
2497
3114
|
}
|
|
2498
3115
|
|
|
2499
3116
|
// src/components/patterns/EmptyState.tsx
|
|
2500
|
-
var
|
|
3117
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2501
3118
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
2502
|
-
return /* @__PURE__ */ (0,
|
|
2503
|
-
/* @__PURE__ */ (0,
|
|
2504
|
-
title ? /* @__PURE__ */ (0,
|
|
2505
|
-
children ? /* @__PURE__ */ (0,
|
|
3119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
3120
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
3121
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
3122
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
2506
3123
|
action
|
|
2507
3124
|
] });
|
|
2508
3125
|
}
|
|
2509
3126
|
|
|
2510
3127
|
// src/components/patterns/FileDropZone.tsx
|
|
2511
|
-
var
|
|
2512
|
-
var
|
|
2513
|
-
var
|
|
3128
|
+
var React15 = __toESM(require("react"), 1);
|
|
3129
|
+
var import_react_aria_components31 = require("react-aria-components");
|
|
3130
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2514
3131
|
var isImage2 = (file) => file.type.startsWith("image/");
|
|
2515
3132
|
function FileDropZone({
|
|
2516
3133
|
label,
|
|
@@ -2536,10 +3153,10 @@ function FileDropZone({
|
|
|
2536
3153
|
style
|
|
2537
3154
|
}) {
|
|
2538
3155
|
const msg = usePireMessages();
|
|
2539
|
-
const [uncontrolled, setUncontrolled] =
|
|
3156
|
+
const [uncontrolled, setUncontrolled] = React15.useState(defaultValue ?? []);
|
|
2540
3157
|
const files = value ?? uncontrolled;
|
|
2541
|
-
const created =
|
|
2542
|
-
|
|
3158
|
+
const created = React15.useRef([]);
|
|
3159
|
+
React15.useEffect(() => () => {
|
|
2543
3160
|
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2544
3161
|
}, []);
|
|
2545
3162
|
const commit = (next) => {
|
|
@@ -2559,43 +3176,43 @@ function FileDropZone({
|
|
|
2559
3176
|
commit(allowsMultiple ? [...files, ...wrapped] : wrapped.slice(0, 1));
|
|
2560
3177
|
};
|
|
2561
3178
|
const remove = (target) => commit(files.filter((f) => f.file !== target));
|
|
2562
|
-
return /* @__PURE__ */ (0,
|
|
2563
|
-
label ? /* @__PURE__ */ (0,
|
|
3179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: cx("pire-field", className), style, "data-full-width": String(fullWidth), children: [
|
|
3180
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { className: "pire-field-label", children: [
|
|
2564
3181
|
label,
|
|
2565
|
-
isRequired ? /* @__PURE__ */ (0,
|
|
3182
|
+
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
2566
3183
|
] }) : null,
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
|
|
3184
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
3185
|
+
import_react_aria_components31.DropZone,
|
|
2569
3186
|
{
|
|
2570
3187
|
className: "pire-dropzone",
|
|
2571
3188
|
"data-height": height,
|
|
2572
3189
|
isDisabled: isDisabled || isReadOnly,
|
|
2573
3190
|
onDrop: async (e) => {
|
|
2574
3191
|
const dropped = await Promise.all(
|
|
2575
|
-
e.items.filter(
|
|
3192
|
+
e.items.filter(import_react_aria_components31.isFileDropItem).map((item) => item.getFile())
|
|
2576
3193
|
);
|
|
2577
3194
|
accept(dropped);
|
|
2578
3195
|
},
|
|
2579
3196
|
children: [
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2583
|
-
|
|
3197
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "download", size: 24, className: "pire-dropzone-icon" }),
|
|
3198
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-dropzone-prompt", children: promptLabel ?? msg.fileDropZonePrompt }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3200
|
+
import_react_aria_components31.FileTrigger,
|
|
2584
3201
|
{
|
|
2585
3202
|
acceptedFileTypes,
|
|
2586
3203
|
allowsMultiple,
|
|
2587
3204
|
onSelect: (list) => accept(list ? [...list] : []),
|
|
2588
|
-
children: /* @__PURE__ */ (0,
|
|
3205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Button, { variant: "secondary", isDisabled: isDisabled || isReadOnly, children: msg.fileUploadChoose })
|
|
2589
3206
|
}
|
|
2590
3207
|
)
|
|
2591
3208
|
]
|
|
2592
3209
|
}
|
|
2593
3210
|
),
|
|
2594
|
-
files.length ? /* @__PURE__ */ (0,
|
|
2595
|
-
previewUrl ? /* @__PURE__ */ (0,
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
2598
|
-
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0,
|
|
3211
|
+
files.length ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "pire-fileupload-list", children: files.map(({ file, previewUrl }) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("li", { className: "pire-fileupload-item", children: [
|
|
3212
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("img", { className: "pire-fileupload-thumb", src: previewUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "file-text", size: 16, className: "pire-fileupload-icon" }),
|
|
3213
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-fileupload-name", children: file.name }),
|
|
3214
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-fileupload-size", children: formatFileSize(file.size) }),
|
|
3215
|
+
isDisabled || isReadOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2599
3216
|
IconButton,
|
|
2600
3217
|
{
|
|
2601
3218
|
icon: "x",
|
|
@@ -2605,18 +3222,19 @@ function FileDropZone({
|
|
|
2605
3222
|
}
|
|
2606
3223
|
)
|
|
2607
3224
|
] }, `${file.name}-${file.size}-${file.lastModified}`)) }) : null,
|
|
2608
|
-
uploadProgress != null ? /* @__PURE__ */ (0,
|
|
2609
|
-
description ? /* @__PURE__ */ (0,
|
|
2610
|
-
isInvalid && errorMessage ? /* @__PURE__ */ (0,
|
|
3225
|
+
uploadProgress != null ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ProgressBar, { value: uploadProgress, label: msg.fileUploadUploading }) : null,
|
|
3226
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-field-hint", children: description }) : null,
|
|
3227
|
+
isInvalid && errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "pire-field-error", children: errorMessage }) : null
|
|
2611
3228
|
] });
|
|
2612
3229
|
}
|
|
2613
3230
|
|
|
2614
3231
|
// src/index.ts
|
|
2615
|
-
var
|
|
3232
|
+
var import_react_aria_components32 = require("react-aria-components");
|
|
2616
3233
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2617
3234
|
0 && (module.exports = {
|
|
2618
3235
|
Avatar,
|
|
2619
3236
|
Badge,
|
|
3237
|
+
BarChart,
|
|
2620
3238
|
Breadcrumb,
|
|
2621
3239
|
Button,
|
|
2622
3240
|
Card,
|
|
@@ -2625,9 +3243,11 @@ var import_react_aria_components31 = require("react-aria-components");
|
|
|
2625
3243
|
ConfirmDialog,
|
|
2626
3244
|
DataTable,
|
|
2627
3245
|
DatePicker,
|
|
3246
|
+
DateRangePicker,
|
|
2628
3247
|
DescriptionList,
|
|
2629
3248
|
Dialog,
|
|
2630
3249
|
DialogTrigger,
|
|
3250
|
+
DonutChart,
|
|
2631
3251
|
EmptyState,
|
|
2632
3252
|
FileDropZone,
|
|
2633
3253
|
FileUpload,
|
|
@@ -2641,6 +3261,7 @@ var import_react_aria_components31 = require("react-aria-components");
|
|
|
2641
3261
|
InlineMessage,
|
|
2642
3262
|
Input,
|
|
2643
3263
|
KpiTile,
|
|
3264
|
+
LineChart,
|
|
2644
3265
|
Link,
|
|
2645
3266
|
LinkList,
|
|
2646
3267
|
Menu,
|
|
@@ -2681,12 +3302,14 @@ var import_react_aria_components31 = require("react-aria-components");
|
|
|
2681
3302
|
Toast,
|
|
2682
3303
|
ToastProvider,
|
|
2683
3304
|
Tooltip,
|
|
3305
|
+
VIZ_SLOT_COUNT,
|
|
2684
3306
|
ValueHelpDialog,
|
|
2685
3307
|
ValueHelpField,
|
|
2686
3308
|
configureIcons,
|
|
2687
3309
|
enMessages,
|
|
2688
3310
|
esMessages,
|
|
2689
3311
|
formatFileSize,
|
|
3312
|
+
rangeLengthInDays,
|
|
2690
3313
|
usePireMessages,
|
|
2691
3314
|
useToast
|
|
2692
3315
|
});
|