@orianatech/pire 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/IconButton.d.cts +12 -0
- package/dist/components/core/IconButton.d.ts +12 -0
- package/dist/components/core/IconButton.d.ts.map +1 -1
- package/dist/components/data/DataTable.d.cts +7 -1
- package/dist/components/data/DataTable.d.ts +7 -1
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/layout/PageBand.d.cts +15 -0
- package/dist/components/layout/PageBand.d.ts +16 -0
- package/dist/components/layout/PageBand.d.ts.map +1 -0
- package/dist/components.css +18 -0
- package/dist/i18n/messages.d.cts +2 -0
- package/dist/i18n/messages.d.ts +2 -0
- package/dist/i18n/messages.d.ts.map +1 -1
- package/dist/index.cjs +308 -240
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +394 -327
- package/dist/index.js.map +1 -1
- package/dist/tokens/base.css +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,7 @@ __export(src_exports, {
|
|
|
64
64
|
MultiComboBox: () => MultiComboBox,
|
|
65
65
|
NumberField: () => NumberField,
|
|
66
66
|
ObjectHeader: () => ObjectHeader,
|
|
67
|
+
PageBand: () => PageBand,
|
|
67
68
|
PageHeader: () => PageHeader,
|
|
68
69
|
Pagination: () => Pagination,
|
|
69
70
|
PireIntlProvider: () => PireIntlProvider,
|
|
@@ -358,8 +359,21 @@ function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
|
358
359
|
|
|
359
360
|
// src/components/core/IconButton.tsx
|
|
360
361
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
361
|
-
var IconButton = React2.forwardRef(function IconButton2({
|
|
362
|
-
|
|
362
|
+
var IconButton = React2.forwardRef(function IconButton2({
|
|
363
|
+
icon,
|
|
364
|
+
label,
|
|
365
|
+
size = "md",
|
|
366
|
+
variant = "tertiary",
|
|
367
|
+
selected,
|
|
368
|
+
hideTooltip,
|
|
369
|
+
count,
|
|
370
|
+
countMax = 9,
|
|
371
|
+
countVariant = "number",
|
|
372
|
+
className,
|
|
373
|
+
...rest
|
|
374
|
+
}, ref) {
|
|
375
|
+
const showsCount = count != null && count > 0;
|
|
376
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
363
377
|
import_react_aria_components3.Button,
|
|
364
378
|
{
|
|
365
379
|
ref,
|
|
@@ -369,8 +383,12 @@ var IconButton = React2.forwardRef(function IconButton2({ icon, label, size = "m
|
|
|
369
383
|
"data-size": size,
|
|
370
384
|
"data-variant": variant,
|
|
371
385
|
"data-selected": selected ? "true" : void 0,
|
|
386
|
+
"data-has-count": showsCount ? "true" : void 0,
|
|
372
387
|
...rest,
|
|
373
|
-
children:
|
|
388
|
+
children: [
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: icon, size: size === "lg" ? 20 : 16 }),
|
|
390
|
+
showsCount ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "pire-iconbtn-count", "data-variant": countVariant, "aria-hidden": "true", children: countVariant === "number" ? count > countMax ? `${countMax}+` : count : null }) : null
|
|
391
|
+
]
|
|
374
392
|
}
|
|
375
393
|
);
|
|
376
394
|
return hideTooltip ? button : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { label, children: button });
|
|
@@ -867,6 +885,7 @@ var enMessages = {
|
|
|
867
885
|
filterBarClearAll: "Clear all",
|
|
868
886
|
dataTableSelectAll: "Select all rows",
|
|
869
887
|
dataTableSelectRow: "Select row",
|
|
888
|
+
dataTableLoading: "Loading records",
|
|
870
889
|
dialogClose: "Close",
|
|
871
890
|
sidePanelClose: "Close panel",
|
|
872
891
|
inlineMessageDismiss: "Dismiss message",
|
|
@@ -897,6 +916,7 @@ var esMessages = {
|
|
|
897
916
|
filterBarClearAll: "Limpiar todo",
|
|
898
917
|
dataTableSelectAll: "Seleccionar todas las filas",
|
|
899
918
|
dataTableSelectRow: "Seleccionar fila",
|
|
919
|
+
dataTableLoading: "Cargando registros",
|
|
900
920
|
dialogClose: "Cerrar",
|
|
901
921
|
sidePanelClose: "Cerrar panel",
|
|
902
922
|
inlineMessageDismiss: "Descartar mensaje",
|
|
@@ -1272,7 +1292,54 @@ function Dialog({
|
|
|
1272
1292
|
|
|
1273
1293
|
// src/components/data/DataTable.tsx
|
|
1274
1294
|
var import_react_aria_components20 = require("react-aria-components");
|
|
1295
|
+
|
|
1296
|
+
// src/components/feedback/Skeleton.tsx
|
|
1275
1297
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1298
|
+
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1300
|
+
"div",
|
|
1301
|
+
{
|
|
1302
|
+
className: cx("pire-skeleton", className),
|
|
1303
|
+
"data-shape": shape,
|
|
1304
|
+
"aria-hidden": "true",
|
|
1305
|
+
style: { width, height, ...style },
|
|
1306
|
+
...rest
|
|
1307
|
+
}
|
|
1308
|
+
);
|
|
1309
|
+
}
|
|
1310
|
+
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
1311
|
+
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
1312
|
+
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
1313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1314
|
+
"div",
|
|
1315
|
+
{
|
|
1316
|
+
className: cx("pire-skeleton-row", className),
|
|
1317
|
+
"data-density": density,
|
|
1318
|
+
"aria-hidden": "true",
|
|
1319
|
+
style,
|
|
1320
|
+
...rest,
|
|
1321
|
+
children: cells.map((c, i) => {
|
|
1322
|
+
const align = c.numeric ? "right" : c.align ?? "left";
|
|
1323
|
+
return (
|
|
1324
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
1325
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1326
|
+
"div",
|
|
1327
|
+
{
|
|
1328
|
+
className: "pire-skeleton-cell",
|
|
1329
|
+
"data-align": align,
|
|
1330
|
+
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
1331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
1332
|
+
},
|
|
1333
|
+
i
|
|
1334
|
+
)
|
|
1335
|
+
);
|
|
1336
|
+
})
|
|
1337
|
+
}
|
|
1338
|
+
);
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// src/components/data/DataTable.tsx
|
|
1342
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1276
1343
|
function DataTable({
|
|
1277
1344
|
columns,
|
|
1278
1345
|
rows,
|
|
@@ -1285,6 +1352,9 @@ function DataTable({
|
|
|
1285
1352
|
onRowAction,
|
|
1286
1353
|
stickyHeader = true,
|
|
1287
1354
|
emptyLabel = "No records match the current filters.",
|
|
1355
|
+
isLoading,
|
|
1356
|
+
loadingRowCount,
|
|
1357
|
+
loadingLabel,
|
|
1288
1358
|
className,
|
|
1289
1359
|
style,
|
|
1290
1360
|
...rest
|
|
@@ -1295,70 +1365,91 @@ function DataTable({
|
|
|
1295
1365
|
if (keys === "all") return onSelectionChange?.(rows.map((r) => r.id));
|
|
1296
1366
|
onSelectionChange?.([...keys]);
|
|
1297
1367
|
};
|
|
1298
|
-
|
|
1299
|
-
|
|
1368
|
+
const skeletonRows = loadingRowCount ?? (rows.length || 5);
|
|
1369
|
+
const skeletonColumns = [
|
|
1370
|
+
...selectable ? [{ width: 44 }] : [],
|
|
1371
|
+
...columns.map((c) => ({ width: c.width, align: c.align, numeric: c.numeric }))
|
|
1372
|
+
];
|
|
1373
|
+
const body = isLoading ? [] : rows;
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1375
|
+
"div",
|
|
1300
1376
|
{
|
|
1301
|
-
className: "pire-table",
|
|
1302
|
-
|
|
1303
|
-
"data-
|
|
1304
|
-
"aria-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1377
|
+
className: cx("pire-table-wrap", className),
|
|
1378
|
+
style,
|
|
1379
|
+
"data-loading": isLoading ? "true" : void 0,
|
|
1380
|
+
"aria-busy": isLoading ? "true" : void 0,
|
|
1381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1382
|
+
import_react_aria_components20.Table,
|
|
1383
|
+
{
|
|
1384
|
+
className: "pire-table",
|
|
1385
|
+
"data-density": density,
|
|
1386
|
+
"data-sticky": String(stickyHeader),
|
|
1387
|
+
"aria-label": rest["aria-label"],
|
|
1388
|
+
selectionMode: selectable ? "multiple" : "none",
|
|
1389
|
+
selectedKeys: selected ? new Set(selected) : void 0,
|
|
1390
|
+
onSelectionChange: handleSelection,
|
|
1391
|
+
sortDescriptor,
|
|
1392
|
+
onSortChange: (d) => onSortChange?.({ key: String(d.column), dir: d.direction === "ascending" ? "asc" : "desc" }),
|
|
1393
|
+
onRowAction: onRowAction ? (key) => {
|
|
1394
|
+
const row = rows.find((r) => String(r.id) === String(key));
|
|
1395
|
+
if (row) onRowAction(row);
|
|
1396
|
+
} : void 0,
|
|
1397
|
+
children: [
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components20.TableHeader, { className: "pire-thead-row", children: [
|
|
1399
|
+
selectable ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components20.Column, { className: "pire-th", width: 44, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectAll }) }) : null,
|
|
1400
|
+
columns.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1401
|
+
import_react_aria_components20.Column,
|
|
1402
|
+
{
|
|
1403
|
+
id: c.key,
|
|
1404
|
+
className: "pire-th",
|
|
1405
|
+
isRowHeader: i === 0 && !selectable,
|
|
1406
|
+
allowsSorting: c.sortable,
|
|
1407
|
+
width: c.width,
|
|
1408
|
+
"data-align": c.numeric || c.align === "right" ? "right" : c.align,
|
|
1409
|
+
"data-allows-sorting": c.sortable ? "true" : void 0,
|
|
1410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "pire-th-inner", children: [
|
|
1411
|
+
c.label,
|
|
1412
|
+
c.sortable ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1413
|
+
Icon,
|
|
1414
|
+
{
|
|
1415
|
+
size: 12,
|
|
1416
|
+
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
1417
|
+
style: { color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)" }
|
|
1418
|
+
}
|
|
1419
|
+
) : null
|
|
1420
|
+
] })
|
|
1421
|
+
},
|
|
1422
|
+
c.key
|
|
1423
|
+
))
|
|
1424
|
+
] }),
|
|
1425
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components20.TableBody, { renderEmptyState: () => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
1427
|
+
Array.from({ length: skeletonRows }, (_, i) => (
|
|
1428
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
1429
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
1430
|
+
))
|
|
1431
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pire-table-empty", children: emptyLabel }), children: body.map((row) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components20.Row, { id: row.id, className: "pire-tr", "data-pressable": onRowAction ? "true" : void 0, children: [
|
|
1432
|
+
selectable ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components20.Cell, { className: "pire-td", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
1433
|
+
columns.map((c) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1434
|
+
import_react_aria_components20.Cell,
|
|
1435
|
+
{
|
|
1436
|
+
className: "pire-td",
|
|
1437
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
1438
|
+
style: { textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
1439
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
1440
|
+
},
|
|
1441
|
+
c.key
|
|
1442
|
+
))
|
|
1443
|
+
] }, row.id)) })
|
|
1444
|
+
]
|
|
1445
|
+
}
|
|
1446
|
+
)
|
|
1356
1447
|
}
|
|
1357
|
-
)
|
|
1448
|
+
);
|
|
1358
1449
|
}
|
|
1359
1450
|
|
|
1360
1451
|
// src/components/patterns/ValueHelpDialog.tsx
|
|
1361
|
-
var
|
|
1452
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1362
1453
|
function ValueHelpDialog({
|
|
1363
1454
|
isOpen,
|
|
1364
1455
|
title = "Select a record",
|
|
@@ -1379,16 +1470,16 @@ function ValueHelpDialog({
|
|
|
1379
1470
|
if (!q) return rows;
|
|
1380
1471
|
return rows.filter((row) => Object.values(row).some((v) => String(v).toLowerCase().includes(q)));
|
|
1381
1472
|
}, [rows, query]);
|
|
1382
|
-
return /* @__PURE__ */ (0,
|
|
1473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1383
1474
|
Dialog,
|
|
1384
1475
|
{
|
|
1385
1476
|
isOpen,
|
|
1386
1477
|
size: "lg",
|
|
1387
1478
|
title,
|
|
1388
1479
|
onClose,
|
|
1389
|
-
footer: /* @__PURE__ */ (0,
|
|
1390
|
-
children: /* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1480
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
1481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1392
1483
|
Input,
|
|
1393
1484
|
{
|
|
1394
1485
|
"aria-label": msg.valueHelpDialogSearch,
|
|
@@ -1400,7 +1491,7 @@ function ValueHelpDialog({
|
|
|
1400
1491
|
autoFocus: true
|
|
1401
1492
|
}
|
|
1402
1493
|
),
|
|
1403
|
-
/* @__PURE__ */ (0,
|
|
1494
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1404
1495
|
DataTable,
|
|
1405
1496
|
{
|
|
1406
1497
|
"aria-label": typeof title === "string" ? title : "Records",
|
|
@@ -1420,7 +1511,7 @@ function ValueHelpDialog({
|
|
|
1420
1511
|
}
|
|
1421
1512
|
|
|
1422
1513
|
// src/components/forms/ValueHelpField.tsx
|
|
1423
|
-
var
|
|
1514
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1424
1515
|
var defaultFormat = (row) => [row.id, row.name ?? row.label ?? row.text].filter(Boolean).join(" \u2014 ");
|
|
1425
1516
|
function ValueHelpField({
|
|
1426
1517
|
label,
|
|
@@ -1442,9 +1533,9 @@ function ValueHelpField({
|
|
|
1442
1533
|
}) {
|
|
1443
1534
|
const msg = usePireMessages();
|
|
1444
1535
|
const [open, setOpen] = React9.useState(false);
|
|
1445
|
-
return /* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cx(className), style, children: [
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { style: { display: "flex", gap: "var(--sp-2)", alignItems: "flex-end" }, children: [
|
|
1538
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1448
1539
|
Input,
|
|
1449
1540
|
{
|
|
1450
1541
|
label,
|
|
@@ -1458,7 +1549,7 @@ function ValueHelpField({
|
|
|
1458
1549
|
errorMessage
|
|
1459
1550
|
}
|
|
1460
1551
|
),
|
|
1461
|
-
allowsClear && value ? /* @__PURE__ */ (0,
|
|
1552
|
+
allowsClear && value ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1462
1553
|
IconButton,
|
|
1463
1554
|
{
|
|
1464
1555
|
icon: "x",
|
|
@@ -1468,7 +1559,7 @@ function ValueHelpField({
|
|
|
1468
1559
|
onPress: () => onChange?.(null)
|
|
1469
1560
|
}
|
|
1470
1561
|
) : null,
|
|
1471
|
-
/* @__PURE__ */ (0,
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1472
1563
|
IconButton,
|
|
1473
1564
|
{
|
|
1474
1565
|
icon: "search",
|
|
@@ -1479,7 +1570,7 @@ function ValueHelpField({
|
|
|
1479
1570
|
}
|
|
1480
1571
|
)
|
|
1481
1572
|
] }),
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
1573
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1483
1574
|
ValueHelpDialog,
|
|
1484
1575
|
{
|
|
1485
1576
|
isOpen: open,
|
|
@@ -1494,7 +1585,7 @@ function ValueHelpField({
|
|
|
1494
1585
|
}
|
|
1495
1586
|
|
|
1496
1587
|
// src/components/navigation/ShellBar.tsx
|
|
1497
|
-
var
|
|
1588
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1498
1589
|
var initials2 = (name) => name.trim().split(/\s+/).slice(0, 2).map((p) => p[0]).join("").toUpperCase();
|
|
1499
1590
|
function ShellBar({
|
|
1500
1591
|
product,
|
|
@@ -1509,22 +1600,22 @@ function ShellBar({
|
|
|
1509
1600
|
className,
|
|
1510
1601
|
...rest
|
|
1511
1602
|
}) {
|
|
1512
|
-
return /* @__PURE__ */ (0,
|
|
1513
|
-
onMenu ? /* @__PURE__ */ (0,
|
|
1514
|
-
monogram ? /* @__PURE__ */ (0,
|
|
1515
|
-
product ? /* @__PURE__ */ (0,
|
|
1516
|
-
title ? /* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
onSearch ? /* @__PURE__ */ (0,
|
|
1603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { className: cx("pire-shellbar", className), ...rest, children: [
|
|
1604
|
+
onMenu ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconButton, { icon: "menu", label: menuLabel, variant: "inverse", size: "sm", onPress: onMenu }) : null,
|
|
1605
|
+
monogram ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "pire-shellbar-mono", "aria-hidden": "true", children: monogram }) : null,
|
|
1606
|
+
product ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "pire-shellbar-product", children: product }) : null,
|
|
1607
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "pire-shellbar-title", children: title }) : null,
|
|
1608
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "pire-shellbar-spacer" }),
|
|
1609
|
+
onSearch ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(IconButton, { icon: "search", label: searchLabel, variant: "inverse", size: "sm", onPress: onSearch }) : null,
|
|
1519
1610
|
actions,
|
|
1520
|
-
user ? /* @__PURE__ */ (0,
|
|
1611
|
+
user ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "pire-avatar", title: user, "aria-label": user, role: "img", children: initials2(user) }) : null
|
|
1521
1612
|
] });
|
|
1522
1613
|
}
|
|
1523
1614
|
|
|
1524
1615
|
// src/components/navigation/SideNav.tsx
|
|
1525
1616
|
var React10 = __toESM(require("react"), 1);
|
|
1526
1617
|
var import_react_aria_components21 = require("react-aria-components");
|
|
1527
|
-
var
|
|
1618
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1528
1619
|
function findActiveParent(groups, value) {
|
|
1529
1620
|
if (value == null) return void 0;
|
|
1530
1621
|
for (const group of groups) {
|
|
@@ -1572,7 +1663,7 @@ function SideNav({
|
|
|
1572
1663
|
};
|
|
1573
1664
|
const renderRow = (item, onPress, isGroup) => {
|
|
1574
1665
|
const selected = !isGroup && item.id === value;
|
|
1575
|
-
const button = /* @__PURE__ */ (0,
|
|
1666
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1576
1667
|
import_react_aria_components21.Button,
|
|
1577
1668
|
{
|
|
1578
1669
|
className: "pire-sidenav-item",
|
|
@@ -1582,17 +1673,17 @@ function SideNav({
|
|
|
1582
1673
|
"aria-label": collapsed ? item.label : void 0,
|
|
1583
1674
|
onPress,
|
|
1584
1675
|
children: [
|
|
1585
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1586
|
-
collapsed ? null : /* @__PURE__ */ (0,
|
|
1587
|
-
item.count != null && !collapsed ? /* @__PURE__ */ (0,
|
|
1676
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
1677
|
+
collapsed ? null : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: item.label }),
|
|
1678
|
+
item.count != null && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null
|
|
1588
1679
|
]
|
|
1589
1680
|
},
|
|
1590
1681
|
item.id
|
|
1591
1682
|
);
|
|
1592
|
-
return collapsed ? /* @__PURE__ */ (0,
|
|
1683
|
+
return collapsed ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Tooltip, { label: item.label, placement: "right", children: button }, item.id) : button;
|
|
1593
1684
|
};
|
|
1594
|
-
const renderSection = (item) => /* @__PURE__ */ (0,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1685
|
+
const renderSection = (item) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_aria_components21.Disclosure, { id: item.id, className: "pire-sidenav-section", children: [
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1596
1687
|
import_react_aria_components21.Button,
|
|
1597
1688
|
{
|
|
1598
1689
|
slot: "trigger",
|
|
@@ -1600,16 +1691,16 @@ function SideNav({
|
|
|
1600
1691
|
"data-kind": "group",
|
|
1601
1692
|
"data-active-child": item.id === activeParent ? "true" : void 0,
|
|
1602
1693
|
children: [
|
|
1603
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1605
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1694
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
1695
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: item.label }),
|
|
1696
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sidenav-count", children: item.count }) : null,
|
|
1697
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: "chevron-down", size: 16, className: "pire-sidenav-chevron" })
|
|
1607
1698
|
]
|
|
1608
1699
|
}
|
|
1609
1700
|
),
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components21.DisclosurePanel, { className: "pire-sidenav-subnav", children: item.items?.map((child) => {
|
|
1611
1702
|
const selected = child.id === value;
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1613
1704
|
import_react_aria_components21.Button,
|
|
1614
1705
|
{
|
|
1615
1706
|
className: "pire-sidenav-item pire-sidenav-subitem",
|
|
@@ -1617,15 +1708,15 @@ function SideNav({
|
|
|
1617
1708
|
"aria-current": selected ? "page" : void 0,
|
|
1618
1709
|
onPress: () => onChange?.(child.id),
|
|
1619
1710
|
children: [
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1621
|
-
child.count != null ? /* @__PURE__ */ (0,
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: child.label }),
|
|
1712
|
+
child.count != null ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sidenav-count", children: child.count }) : null
|
|
1622
1713
|
]
|
|
1623
1714
|
},
|
|
1624
1715
|
child.id
|
|
1625
1716
|
);
|
|
1626
1717
|
}) })
|
|
1627
1718
|
] }, item.id);
|
|
1628
|
-
return /* @__PURE__ */ (0,
|
|
1719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1629
1720
|
"nav",
|
|
1630
1721
|
{
|
|
1631
1722
|
className: cx("pire-sidenav", className),
|
|
@@ -1640,9 +1731,9 @@ function SideNav({
|
|
|
1640
1731
|
if (isGroup && !collapsed) return renderSection(item);
|
|
1641
1732
|
return renderRow(item, () => isGroup ? toggleExpanded(item.id) : onChange?.(item.id), isGroup);
|
|
1642
1733
|
});
|
|
1643
|
-
return /* @__PURE__ */ (0,
|
|
1644
|
-
group.label && !collapsed ? /* @__PURE__ */ (0,
|
|
1645
|
-
hasSections ? /* @__PURE__ */ (0,
|
|
1734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "pire-sidenav-group", children: [
|
|
1735
|
+
group.label && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-sidenav-label", children: group.label }) : null,
|
|
1736
|
+
hasSections ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1646
1737
|
import_react_aria_components21.DisclosureGroup,
|
|
1647
1738
|
{
|
|
1648
1739
|
className: "pire-sidenav-tree",
|
|
@@ -1654,7 +1745,7 @@ function SideNav({
|
|
|
1654
1745
|
) : rows
|
|
1655
1746
|
] }, group.label ?? gi);
|
|
1656
1747
|
}),
|
|
1657
|
-
footer ? /* @__PURE__ */ (0,
|
|
1748
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-sidenav-footer", children: footer }) : null
|
|
1658
1749
|
]
|
|
1659
1750
|
}
|
|
1660
1751
|
);
|
|
@@ -1662,9 +1753,9 @@ function SideNav({
|
|
|
1662
1753
|
|
|
1663
1754
|
// src/components/navigation/Tabs.tsx
|
|
1664
1755
|
var import_react_aria_components22 = require("react-aria-components");
|
|
1665
|
-
var
|
|
1756
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1666
1757
|
function Tabs({ items, value, defaultValue, onChange, panels, className, style, ...rest }) {
|
|
1667
|
-
return /* @__PURE__ */ (0,
|
|
1758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1668
1759
|
import_react_aria_components22.Tabs,
|
|
1669
1760
|
{
|
|
1670
1761
|
className,
|
|
@@ -1673,12 +1764,12 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
1673
1764
|
defaultSelectedKey: defaultValue,
|
|
1674
1765
|
onSelectionChange: (k) => onChange?.(String(k)),
|
|
1675
1766
|
children: [
|
|
1676
|
-
/* @__PURE__ */ (0,
|
|
1677
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components22.TabList, { className: "pire-tablist", items, "aria-label": rest["aria-label"] ?? "Views", children: (item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_aria_components22.Tab, { className: cx("pire-tab"), id: item.id, isDisabled: item.isDisabled, children: [
|
|
1768
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: item.icon, size: 16 }) : null,
|
|
1678
1769
|
item.label,
|
|
1679
|
-
item.count != null ? /* @__PURE__ */ (0,
|
|
1770
|
+
item.count != null ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-tab-count", children: item.count }) : null
|
|
1680
1771
|
] }) }),
|
|
1681
|
-
items.map((item) => /* @__PURE__ */ (0,
|
|
1772
|
+
items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components22.TabPanel, { id: item.id, className: panels ? "pire-tabpanel" : void 0, children: panels?.[item.id] }, item.id))
|
|
1682
1773
|
]
|
|
1683
1774
|
}
|
|
1684
1775
|
);
|
|
@@ -1686,9 +1777,9 @@ function Tabs({ items, value, defaultValue, onChange, panels, className, style,
|
|
|
1686
1777
|
|
|
1687
1778
|
// src/components/navigation/Breadcrumb.tsx
|
|
1688
1779
|
var import_react_aria_components23 = require("react-aria-components");
|
|
1689
|
-
var
|
|
1780
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1690
1781
|
function Breadcrumb({ items, onNavigate, className, style }) {
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1692
1783
|
import_react_aria_components23.Breadcrumbs,
|
|
1693
1784
|
{
|
|
1694
1785
|
className: cx("pire-breadcrumbs", className),
|
|
@@ -1697,9 +1788,9 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
1697
1788
|
onAction: (key) => onNavigate?.(String(key)),
|
|
1698
1789
|
children: (item) => {
|
|
1699
1790
|
const last = items[items.length - 1] === item;
|
|
1700
|
-
return /* @__PURE__ */ (0,
|
|
1701
|
-
last ? item.label : /* @__PURE__ */ (0,
|
|
1702
|
-
last ? null : /* @__PURE__ */ (0,
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_aria_components23.Breadcrumb, { className: "pire-breadcrumb", id: item.id ?? item.label, children: [
|
|
1792
|
+
last ? item.label : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_aria_components23.Link, { href: item.href, children: item.label }),
|
|
1793
|
+
last ? null : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "chevron-right", size: 12, style: { color: "var(--text-tertiary)" } })
|
|
1703
1794
|
] });
|
|
1704
1795
|
}
|
|
1705
1796
|
}
|
|
@@ -1707,7 +1798,7 @@ function Breadcrumb({ items, onNavigate, className, style }) {
|
|
|
1707
1798
|
}
|
|
1708
1799
|
|
|
1709
1800
|
// src/components/navigation/Pagination.tsx
|
|
1710
|
-
var
|
|
1801
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1711
1802
|
function Pagination({
|
|
1712
1803
|
page = 1,
|
|
1713
1804
|
pageSize = 25,
|
|
@@ -1722,9 +1813,9 @@ function Pagination({
|
|
|
1722
1813
|
const pages = Math.max(1, Math.ceil(total / pageSize));
|
|
1723
1814
|
const from = total === 0 ? 0 : (page - 1) * pageSize + 1;
|
|
1724
1815
|
const to = Math.min(total, page * pageSize);
|
|
1725
|
-
return /* @__PURE__ */ (0,
|
|
1726
|
-
/* @__PURE__ */ (0,
|
|
1727
|
-
/* @__PURE__ */ (0,
|
|
1816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("nav", { className: cx("pire-pagination", className), style, "aria-label": msg.paginationLabel, children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pire-pagination-count", children: msg.paginationRange.replace("{from}", from.toLocaleString()).replace("{to}", to.toLocaleString()).replace("{total}", total.toLocaleString()) }),
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1728
1819
|
IconButton,
|
|
1729
1820
|
{
|
|
1730
1821
|
icon: "chevron-left",
|
|
@@ -1735,8 +1826,8 @@ function Pagination({
|
|
|
1735
1826
|
onPress: () => onPageChange?.(page - 1)
|
|
1736
1827
|
}
|
|
1737
1828
|
),
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1739
|
-
/* @__PURE__ */ (0,
|
|
1829
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "pire-pagination-count", "aria-live": "polite", children: msg.paginationPageOf.replace("{page}", String(page)).replace("{pages}", String(pages)) }),
|
|
1830
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1740
1831
|
IconButton,
|
|
1741
1832
|
{
|
|
1742
1833
|
icon: "chevron-right",
|
|
@@ -1747,7 +1838,7 @@ function Pagination({
|
|
|
1747
1838
|
onPress: () => onPageChange?.(page + 1)
|
|
1748
1839
|
}
|
|
1749
1840
|
),
|
|
1750
|
-
onPageSizeChange ? /* @__PURE__ */ (0,
|
|
1841
|
+
onPageSizeChange ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1751
1842
|
Select,
|
|
1752
1843
|
{
|
|
1753
1844
|
"aria-label": msg.paginationRowsPerPage,
|
|
@@ -1764,11 +1855,11 @@ function Pagination({
|
|
|
1764
1855
|
|
|
1765
1856
|
// src/components/navigation/Menu.tsx
|
|
1766
1857
|
var import_react_aria_components24 = require("react-aria-components");
|
|
1767
|
-
var
|
|
1858
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1768
1859
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
1769
1860
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
1770
1861
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
1771
|
-
return /* @__PURE__ */ (0,
|
|
1862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1772
1863
|
import_react_aria_components24.Menu,
|
|
1773
1864
|
{
|
|
1774
1865
|
className: cx("pire-menu", className),
|
|
@@ -1786,35 +1877,35 @@ function MenuItem({
|
|
|
1786
1877
|
className,
|
|
1787
1878
|
...rest
|
|
1788
1879
|
}) {
|
|
1789
|
-
return /* @__PURE__ */ (0,
|
|
1880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
1790
1881
|
import_react_aria_components24.MenuItem,
|
|
1791
1882
|
{
|
|
1792
1883
|
className: cx("pire-menu-item", className),
|
|
1793
1884
|
"data-tone": tone === "danger" ? "danger" : void 0,
|
|
1794
1885
|
...rest,
|
|
1795
1886
|
children: [
|
|
1796
|
-
icon ? /* @__PURE__ */ (0,
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
1798
|
-
/* @__PURE__ */ (0,
|
|
1799
|
-
description ? /* @__PURE__ */ (0,
|
|
1887
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon, { name: icon, size: 16, className: "pire-menu-item-icon" }) : null,
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "pire-menu-item-body", children: [
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-menu-item-label", children }),
|
|
1890
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
1800
1891
|
] }),
|
|
1801
|
-
shortcut ? /* @__PURE__ */ (0,
|
|
1892
|
+
shortcut ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("kbd", { className: "pire-menu-item-shortcut", children: shortcut }) : null
|
|
1802
1893
|
]
|
|
1803
1894
|
}
|
|
1804
1895
|
);
|
|
1805
1896
|
}
|
|
1806
1897
|
function MenuSection({ title, children, className, ...rest }) {
|
|
1807
|
-
return /* @__PURE__ */ (0,
|
|
1808
|
-
title ? /* @__PURE__ */ (0,
|
|
1898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react_aria_components24.MenuSection, { className: cx("pire-menu-section", className), ...rest, children: [
|
|
1899
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_aria_components24.Header, { className: "pire-menu-section-title", children: title }) : null,
|
|
1809
1900
|
children
|
|
1810
1901
|
] });
|
|
1811
1902
|
}
|
|
1812
1903
|
function MenuSeparator({ className }) {
|
|
1813
|
-
return /* @__PURE__ */ (0,
|
|
1904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_aria_components24.Separator, { className: cx("pire-menu-separator", className) });
|
|
1814
1905
|
}
|
|
1815
1906
|
|
|
1816
1907
|
// src/components/feedback/InlineMessage.tsx
|
|
1817
|
-
var
|
|
1908
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1818
1909
|
var KIND_ICON = {
|
|
1819
1910
|
info: "info",
|
|
1820
1911
|
success: "check-circle-2",
|
|
@@ -1824,7 +1915,7 @@ var KIND_ICON = {
|
|
|
1824
1915
|
function InlineMessage({ kind = "info", title, action, onClose, children, className, ...rest }) {
|
|
1825
1916
|
const msg = usePireMessages();
|
|
1826
1917
|
const assertive = kind === "error" || kind === "warning";
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1828
1919
|
"div",
|
|
1829
1920
|
{
|
|
1830
1921
|
className: cx("pire-msg", className),
|
|
@@ -1833,13 +1924,13 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
1833
1924
|
"aria-live": assertive ? "assertive" : "polite",
|
|
1834
1925
|
...rest,
|
|
1835
1926
|
children: [
|
|
1836
|
-
/* @__PURE__ */ (0,
|
|
1837
|
-
/* @__PURE__ */ (0,
|
|
1838
|
-
title ? /* @__PURE__ */ (0,
|
|
1839
|
-
children ? /* @__PURE__ */ (0,
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { name: KIND_ICON[kind], size: 16, style: { marginTop: 2 } }),
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--sp-1)" }, children: [
|
|
1929
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-msg-title", children: title }) : null,
|
|
1930
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "pire-msg-body", children }) : null,
|
|
1840
1931
|
action
|
|
1841
1932
|
] }),
|
|
1842
|
-
onClose ? /* @__PURE__ */ (0,
|
|
1933
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(IconButton, { icon: "x", label: msg.inlineMessageDismiss, size: "sm", onPress: onClose }) : null
|
|
1843
1934
|
]
|
|
1844
1935
|
}
|
|
1845
1936
|
);
|
|
@@ -1847,7 +1938,7 @@ function InlineMessage({ kind = "info", title, action, onClose, children, classN
|
|
|
1847
1938
|
|
|
1848
1939
|
// src/components/feedback/ProgressBar.tsx
|
|
1849
1940
|
var import_react_aria_components25 = require("react-aria-components");
|
|
1850
|
-
var
|
|
1941
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1851
1942
|
function ProgressBar({
|
|
1852
1943
|
value = 0,
|
|
1853
1944
|
minValue = 0,
|
|
@@ -1860,7 +1951,7 @@ function ProgressBar({
|
|
|
1860
1951
|
className,
|
|
1861
1952
|
style
|
|
1862
1953
|
}) {
|
|
1863
|
-
return /* @__PURE__ */ (0,
|
|
1954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1864
1955
|
import_react_aria_components25.ProgressBar,
|
|
1865
1956
|
{
|
|
1866
1957
|
className: cx("pire-progress", className),
|
|
@@ -1871,12 +1962,12 @@ function ProgressBar({
|
|
|
1871
1962
|
maxValue,
|
|
1872
1963
|
isIndeterminate,
|
|
1873
1964
|
style,
|
|
1874
|
-
children: ({ percentage, valueText }) => /* @__PURE__ */ (0,
|
|
1875
|
-
label || showValue ? /* @__PURE__ */ (0,
|
|
1876
|
-
label ? /* @__PURE__ */ (0,
|
|
1877
|
-
showValue && !isIndeterminate ? /* @__PURE__ */ (0,
|
|
1965
|
+
children: ({ percentage, valueText }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
1966
|
+
label || showValue ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "pire-progress-head", children: [
|
|
1967
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components25.Label, { children: label }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", {}),
|
|
1968
|
+
showValue && !isIndeterminate ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-numeric", children: valueText }) : null
|
|
1878
1969
|
] }) : null,
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "pire-progress-track", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "pire-progress-fill", style: { width: `${isIndeterminate ? 40 : percentage}%` } }) })
|
|
1880
1971
|
] })
|
|
1881
1972
|
}
|
|
1882
1973
|
);
|
|
@@ -1884,7 +1975,7 @@ function ProgressBar({
|
|
|
1884
1975
|
|
|
1885
1976
|
// src/components/feedback/Toast.tsx
|
|
1886
1977
|
var React11 = __toESM(require("react"), 1);
|
|
1887
|
-
var
|
|
1978
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1888
1979
|
var KIND_ICON2 = {
|
|
1889
1980
|
info: "info",
|
|
1890
1981
|
success: "check-circle-2",
|
|
@@ -1893,7 +1984,7 @@ var KIND_ICON2 = {
|
|
|
1893
1984
|
};
|
|
1894
1985
|
function Toast({ kind = "success", onClose, position = "bottom-center", children, className, ...rest }) {
|
|
1895
1986
|
const msg = usePireMessages();
|
|
1896
|
-
return /* @__PURE__ */ (0,
|
|
1987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1897
1988
|
"div",
|
|
1898
1989
|
{
|
|
1899
1990
|
className: cx("pire-toast", className),
|
|
@@ -1902,9 +1993,9 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
1902
1993
|
"aria-live": kind === "error" ? "assertive" : "polite",
|
|
1903
1994
|
...rest,
|
|
1904
1995
|
children: [
|
|
1905
|
-
/* @__PURE__ */ (0,
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
onClose ? /* @__PURE__ */ (0,
|
|
1996
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: KIND_ICON2[kind], size: 16 }),
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { style: { flex: 1 }, children }),
|
|
1998
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(IconButton, { icon: "x", label: msg.toastDismiss, size: "sm", variant: "inverse", onPress: onClose }) : null
|
|
1908
1999
|
]
|
|
1909
2000
|
}
|
|
1910
2001
|
);
|
|
@@ -1922,9 +2013,9 @@ function ToastProvider({ children, timeout = 6e3 }) {
|
|
|
1922
2013
|
return id;
|
|
1923
2014
|
}, [close, timeout]);
|
|
1924
2015
|
const value = React11.useMemo(() => ({ add, close }), [add, close]);
|
|
1925
|
-
return /* @__PURE__ */ (0,
|
|
2016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(ToastContext.Provider, { value, children: [
|
|
1926
2017
|
children,
|
|
1927
|
-
/* @__PURE__ */ (0,
|
|
2018
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Toast, { kind: t.kind, onClose: () => close(t.id), style: { position: "static", transform: "none" }, children: t.message }, t.id)) })
|
|
1928
2019
|
] });
|
|
1929
2020
|
}
|
|
1930
2021
|
function useToast() {
|
|
@@ -1933,51 +2024,6 @@ function useToast() {
|
|
|
1933
2024
|
return ctx;
|
|
1934
2025
|
}
|
|
1935
2026
|
|
|
1936
|
-
// src/components/feedback/Skeleton.tsx
|
|
1937
|
-
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1938
|
-
function Skeleton({ shape = "text", width, height, className, style, ...rest }) {
|
|
1939
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1940
|
-
"div",
|
|
1941
|
-
{
|
|
1942
|
-
className: cx("pire-skeleton", className),
|
|
1943
|
-
"data-shape": shape,
|
|
1944
|
-
"aria-hidden": "true",
|
|
1945
|
-
style: { width, height, ...style },
|
|
1946
|
-
...rest
|
|
1947
|
-
}
|
|
1948
|
-
);
|
|
1949
|
-
}
|
|
1950
|
-
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
1951
|
-
function SkeletonTableRow({ columns, density = "regular", className, style, ...rest }) {
|
|
1952
|
-
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
1953
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1954
|
-
"div",
|
|
1955
|
-
{
|
|
1956
|
-
className: cx("pire-skeleton-row", className),
|
|
1957
|
-
"data-density": density,
|
|
1958
|
-
"aria-hidden": "true",
|
|
1959
|
-
style,
|
|
1960
|
-
...rest,
|
|
1961
|
-
children: cells.map((c, i) => {
|
|
1962
|
-
const align = c.numeric ? "right" : c.align ?? "left";
|
|
1963
|
-
return (
|
|
1964
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: columns are positional and never reordered.
|
|
1965
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1966
|
-
"div",
|
|
1967
|
-
{
|
|
1968
|
-
className: "pire-skeleton-cell",
|
|
1969
|
-
"data-align": align,
|
|
1970
|
-
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
1971
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
1972
|
-
},
|
|
1973
|
-
i
|
|
1974
|
-
)
|
|
1975
|
-
);
|
|
1976
|
-
})
|
|
1977
|
-
}
|
|
1978
|
-
);
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
2027
|
// src/components/data/KpiTile.tsx
|
|
1982
2028
|
var import_react_aria_components26 = require("react-aria-components");
|
|
1983
2029
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -2114,57 +2160,78 @@ function LinkList({ items, onSelect, className, ...rest }) {
|
|
|
2114
2160
|
] }, item.id)) });
|
|
2115
2161
|
}
|
|
2116
2162
|
|
|
2117
|
-
// src/components/layout/
|
|
2163
|
+
// src/components/layout/PageBand.tsx
|
|
2118
2164
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2165
|
+
function PageBand({
|
|
2166
|
+
surface = "card",
|
|
2167
|
+
hasBorder = true,
|
|
2168
|
+
children,
|
|
2169
|
+
className,
|
|
2170
|
+
...rest
|
|
2171
|
+
}) {
|
|
2172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2173
|
+
"div",
|
|
2174
|
+
{
|
|
2175
|
+
className: cx("pire-pageband", className),
|
|
2176
|
+
"data-surface": surface,
|
|
2177
|
+
"data-border": hasBorder ? "true" : void 0,
|
|
2178
|
+
...rest,
|
|
2179
|
+
children
|
|
2180
|
+
}
|
|
2181
|
+
);
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
// src/components/layout/PageHeader.tsx
|
|
2185
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2119
2186
|
function PageHeader({ title, subtitle, actions, className, ...rest }) {
|
|
2120
|
-
return /* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2122
|
-
/* @__PURE__ */ (0,
|
|
2123
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
2187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: cx("pire-pageheader", className), ...rest, children: [
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h1", { className: "pire-pageheader-title", children: title }),
|
|
2190
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "pire-pageheader-sub", children: subtitle }) : null
|
|
2124
2191
|
] }),
|
|
2125
|
-
actions ? /* @__PURE__ */ (0,
|
|
2192
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "pire-pageheader-actions", children: actions }) : null
|
|
2126
2193
|
] });
|
|
2127
2194
|
}
|
|
2128
2195
|
|
|
2129
2196
|
// src/components/layout/SectionHeader.tsx
|
|
2130
|
-
var
|
|
2197
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2131
2198
|
function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
2132
|
-
return /* @__PURE__ */ (0,
|
|
2133
|
-
/* @__PURE__ */ (0,
|
|
2134
|
-
meta ? /* @__PURE__ */ (0,
|
|
2135
|
-
actions ? /* @__PURE__ */ (0,
|
|
2199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cx("pire-sectionhead", className), ...rest, children: [
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "pire-eyebrow", children: title }),
|
|
2201
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { style: { font: "var(--type-caption)", color: "var(--text-tertiary)" }, children: meta }) : null,
|
|
2202
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pire-sectionhead-actions", children: actions }) : null
|
|
2136
2203
|
] });
|
|
2137
2204
|
}
|
|
2138
2205
|
|
|
2139
2206
|
// src/components/layout/SelectionBar.tsx
|
|
2140
|
-
var
|
|
2207
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2141
2208
|
function SelectionBar({ count, noun = "record", children, actions, className, ...rest }) {
|
|
2142
2209
|
if (!count) return null;
|
|
2143
|
-
return /* @__PURE__ */ (0,
|
|
2144
|
-
/* @__PURE__ */ (0,
|
|
2210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
2145
2212
|
count.toLocaleString(),
|
|
2146
2213
|
" ",
|
|
2147
2214
|
noun,
|
|
2148
2215
|
count === 1 ? "" : "s",
|
|
2149
2216
|
" selected"
|
|
2150
2217
|
] }),
|
|
2151
|
-
children ? /* @__PURE__ */ (0,
|
|
2152
|
-
actions ? /* @__PURE__ */ (0,
|
|
2218
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { style: { color: "var(--text-secondary)", font: "var(--type-caption)" }, children }) : null,
|
|
2219
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "pire-selectionbar-actions", children: actions }) : null
|
|
2153
2220
|
] });
|
|
2154
2221
|
}
|
|
2155
2222
|
|
|
2156
2223
|
// src/components/layout/FooterBar.tsx
|
|
2157
|
-
var
|
|
2224
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2158
2225
|
function FooterBar({ note, actions, children, className, ...rest }) {
|
|
2159
|
-
return /* @__PURE__ */ (0,
|
|
2160
|
-
note ? /* @__PURE__ */ (0,
|
|
2226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("footer", { className: cx("pire-footerbar", className), ...rest, children: [
|
|
2227
|
+
note ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "pire-footerbar-note", children: note }) : null,
|
|
2161
2228
|
children,
|
|
2162
|
-
actions ? /* @__PURE__ */ (0,
|
|
2229
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "pire-footerbar-actions", children: actions }) : null
|
|
2163
2230
|
] });
|
|
2164
2231
|
}
|
|
2165
2232
|
|
|
2166
2233
|
// src/components/patterns/ConfirmDialog.tsx
|
|
2167
|
-
var
|
|
2234
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2168
2235
|
function ConfirmDialog({
|
|
2169
2236
|
isOpen,
|
|
2170
2237
|
title,
|
|
@@ -2178,7 +2245,7 @@ function ConfirmDialog({
|
|
|
2178
2245
|
onConfirm,
|
|
2179
2246
|
onCancel
|
|
2180
2247
|
}) {
|
|
2181
|
-
return /* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2182
2249
|
Dialog,
|
|
2183
2250
|
{
|
|
2184
2251
|
isOpen,
|
|
@@ -2188,12 +2255,12 @@ function ConfirmDialog({
|
|
|
2188
2255
|
onClose: onCancel,
|
|
2189
2256
|
isDismissable: !isBusy,
|
|
2190
2257
|
showClose: false,
|
|
2191
|
-
footer: /* @__PURE__ */ (0,
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2258
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Button, { variant: "tertiary", isDisabled: isBusy, onPress: onCancel, children: cancelLabel }),
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Button, { variant: tone === "danger" ? "danger" : "primary", isDisabled: isBusy, onPress: onConfirm, children: isBusy ? "Working\u2026" : confirmLabel })
|
|
2194
2261
|
] }),
|
|
2195
2262
|
children: [
|
|
2196
|
-
consequence ? /* @__PURE__ */ (0,
|
|
2263
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(InlineMessage, { kind: tone === "danger" ? "error" : "warning", style: { marginBottom: children ? "var(--sp-3)" : 0 }, children: consequence }) : null,
|
|
2197
2264
|
children
|
|
2198
2265
|
]
|
|
2199
2266
|
}
|
|
@@ -2202,10 +2269,10 @@ function ConfirmDialog({
|
|
|
2202
2269
|
|
|
2203
2270
|
// src/components/patterns/SidePanel.tsx
|
|
2204
2271
|
var import_react_aria_components28 = require("react-aria-components");
|
|
2205
|
-
var
|
|
2272
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2206
2273
|
function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onClose, className }) {
|
|
2207
2274
|
const msg = usePireMessages();
|
|
2208
|
-
return /* @__PURE__ */ (0,
|
|
2275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
2209
2276
|
import_react_aria_components28.ModalOverlay,
|
|
2210
2277
|
{
|
|
2211
2278
|
className: "pire-sidepanel-overlay",
|
|
@@ -2214,28 +2281,28 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
2214
2281
|
onOpenChange: (o) => {
|
|
2215
2282
|
if (!o) onClose?.();
|
|
2216
2283
|
},
|
|
2217
|
-
children: /* @__PURE__ */ (0,
|
|
2218
|
-
/* @__PURE__ */ (0,
|
|
2219
|
-
/* @__PURE__ */ (0,
|
|
2220
|
-
/* @__PURE__ */ (0,
|
|
2221
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
2284
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_aria_components28.Modal, { className: cx("pire-sidepanel", className), style: { width }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react_aria_components28.Dialog, { className: "pire-dialog", style: { height: "100%" }, children: [
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { className: "pire-dialog-head", children: [
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
2287
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_aria_components28.Heading, { slot: "title", className: "pire-dialog-title", children: title }),
|
|
2288
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "pire-dialog-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
2222
2289
|
] }),
|
|
2223
|
-
/* @__PURE__ */ (0,
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IconButton, { icon: "x", label: msg.sidePanelClose, size: "sm", onPress: onClose })
|
|
2224
2291
|
] }),
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
footer ? /* @__PURE__ */ (0,
|
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "pire-dialog-body", style: { flex: 1 }, children }),
|
|
2293
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("footer", { className: "pire-dialog-foot", children: footer }) : null
|
|
2227
2294
|
] }) })
|
|
2228
2295
|
}
|
|
2229
2296
|
);
|
|
2230
2297
|
}
|
|
2231
2298
|
|
|
2232
2299
|
// src/components/patterns/EmptyState.tsx
|
|
2233
|
-
var
|
|
2300
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2234
2301
|
function EmptyState({ icon = "file-text", title, action, compact, children, className, ...rest }) {
|
|
2235
|
-
return /* @__PURE__ */ (0,
|
|
2236
|
-
/* @__PURE__ */ (0,
|
|
2237
|
-
title ? /* @__PURE__ */ (0,
|
|
2238
|
-
children ? /* @__PURE__ */ (0,
|
|
2302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
2304
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
2305
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "pire-empty-body", style: { margin: 0 }, children }) : null,
|
|
2239
2306
|
action
|
|
2240
2307
|
] });
|
|
2241
2308
|
}
|
|
@@ -2278,6 +2345,7 @@ var import_react_aria_components29 = require("react-aria-components");
|
|
|
2278
2345
|
MultiComboBox,
|
|
2279
2346
|
NumberField,
|
|
2280
2347
|
ObjectHeader,
|
|
2348
|
+
PageBand,
|
|
2281
2349
|
PageHeader,
|
|
2282
2350
|
Pagination,
|
|
2283
2351
|
PireIntlProvider,
|