@jirawatpyk/aura-react 5.50.0 → 5.52.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/README.md +33 -0
- package/dist/aura.bundle.js +438 -208
- package/dist/cjs/index.cjs +437 -207
- package/dist/esm/DataTable.js +23 -10
- package/dist/esm/Table.js +52 -7
- package/dist/esm/TableSkeleton.js +170 -0
- package/dist/esm/display.js +11 -2
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/server/index.cjs +221 -50
- package/dist/server/index.d.cts +43 -0
- package/dist/server/index.d.ts +43 -0
- package/dist/server/index.js +221 -50
- package/dist/styles.css +31 -4
- package/dist/styles.layer.css +31 -4
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -92,6 +92,7 @@ __export(index_exports, {
|
|
|
92
92
|
TFoot: () => TFoot,
|
|
93
93
|
THead: () => THead,
|
|
94
94
|
Table: () => Table,
|
|
95
|
+
TableSkeleton: () => TableSkeleton,
|
|
95
96
|
Tabs: () => Tabs,
|
|
96
97
|
Tag: () => Tag,
|
|
97
98
|
Td: () => Td,
|
|
@@ -666,8 +667,17 @@ var PILL_ICON = {
|
|
|
666
667
|
};
|
|
667
668
|
function statusPillElement(props, ref) {
|
|
668
669
|
const tone2 = props.tone || toneFor(props.children);
|
|
669
|
-
const rest = omit(props, ["tone", "className", "children"]);
|
|
670
|
-
return /* @__PURE__ */ React4.createElement(
|
|
670
|
+
const rest = omit(props, ["tone", "className", "children", "wrap"]);
|
|
671
|
+
return /* @__PURE__ */ React4.createElement(
|
|
672
|
+
"span",
|
|
673
|
+
{
|
|
674
|
+
...rest,
|
|
675
|
+
ref,
|
|
676
|
+
className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
|
|
677
|
+
},
|
|
678
|
+
/* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
|
|
679
|
+
props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
|
|
680
|
+
);
|
|
671
681
|
}
|
|
672
682
|
function badgeElement(props, ref) {
|
|
673
683
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
@@ -5741,6 +5751,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5741
5751
|
const refreshing = busy && manual && rows.length > 0;
|
|
5742
5752
|
const loading = busy && !refreshing;
|
|
5743
5753
|
const selectable = !!props.selectable;
|
|
5754
|
+
const tabMode = props.keyboard === "tab";
|
|
5755
|
+
const tabIdx = tabMode ? void 0 : -1;
|
|
5744
5756
|
const reorderable = props.reorderable !== false && !!props.columnControls;
|
|
5745
5757
|
const controls = !!props.columnControls;
|
|
5746
5758
|
const oneCallback = !!props.onStateChange;
|
|
@@ -5933,13 +5945,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5933
5945
|
const pending = React33.useRef(null);
|
|
5934
5946
|
const resizing = React33.useRef(false);
|
|
5935
5947
|
useIsoLayoutEffect(function() {
|
|
5936
|
-
if (!gridRef.current) return;
|
|
5948
|
+
if (!gridRef.current || tabMode) return;
|
|
5937
5949
|
const els = gridRef.current.querySelectorAll(
|
|
5938
5950
|
'.aura-table__td button, .aura-table__td a[href], .aura-table__td input, .aura-table__td select, .aura-table__td textarea, .aura-table__td [tabindex="0"]'
|
|
5939
5951
|
);
|
|
5940
5952
|
for (let i = 0; i < els.length; i++) if (els[i].tabIndex !== -1) els[i].tabIndex = -1;
|
|
5941
5953
|
});
|
|
5942
|
-
function
|
|
5954
|
+
function widthOf2(c) {
|
|
5943
5955
|
return widths[c.key] != null ? widths[c.key] : c.width;
|
|
5944
5956
|
}
|
|
5945
5957
|
const order = orderState[0].filter(function(k) {
|
|
@@ -6013,11 +6025,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6013
6025
|
return p === "field" || p === "wide";
|
|
6014
6026
|
});
|
|
6015
6027
|
const hasFlex = vis.some(function(c) {
|
|
6016
|
-
return
|
|
6028
|
+
return widthOf2(c) == null;
|
|
6017
6029
|
});
|
|
6018
6030
|
let fixedSum = 0, hideTerms = "";
|
|
6019
6031
|
vis.forEach(function(c) {
|
|
6020
|
-
const w =
|
|
6032
|
+
const w = widthOf2(c) != null ? widthOf2(c) : c.minWidth || FLEX_MIN, lv = hideLevel(c);
|
|
6021
6033
|
if (lv && boxWidth[0] == null) hideTerms += " + " + w + "px * var(--aura-h" + lv + "-on, 1)";
|
|
6022
6034
|
else fixedSum += w;
|
|
6023
6035
|
});
|
|
@@ -6026,16 +6038,24 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6026
6038
|
if (isPinned(c)) {
|
|
6027
6039
|
pinOffsets[c.key] = acc;
|
|
6028
6040
|
const lv = hideLevel(c);
|
|
6029
|
-
acc += " + " +
|
|
6041
|
+
acc += " + " + widthOf2(c) + "px" + (lv && boxWidth[0] == null ? " * var(--aura-h" + lv + "-on, 1)" : "");
|
|
6030
6042
|
}
|
|
6031
6043
|
});
|
|
6044
|
+
if (vis.filter(function(c) {
|
|
6045
|
+
return !!c.sortDirection;
|
|
6046
|
+
}).length > 1)
|
|
6047
|
+
devWarnOnce(
|
|
6048
|
+
"datatable-sortdirection-twice",
|
|
6049
|
+
"DataTable: more than one column has sortDirection. The order follows one column; give it to that one."
|
|
6050
|
+
);
|
|
6032
6051
|
const selW = selectable ? " + var(--aura-table-select-width)" : "";
|
|
6033
6052
|
const gutterR = controls ? "var(--aura-space-12)" : "var(--aura-space-6)";
|
|
6034
6053
|
const rowMinWidth = "calc(" + fixedSum + "px" + hideTerms + " + var(--aura-space-6) + " + gutterR + selW + ")";
|
|
6035
6054
|
function cellStyle(c, i) {
|
|
6036
|
-
const w =
|
|
6055
|
+
const w = widthOf2(c), s = {};
|
|
6037
6056
|
if (w == null) {
|
|
6038
|
-
|
|
6057
|
+
const g = typeof c.grow === "number" && c.grow >= 0 && isFinite(c.grow) ? c.grow : 1;
|
|
6058
|
+
s["--aura-cell-flex"] = g + " 1 0";
|
|
6039
6059
|
s["--aura-cell-min"] = (c.minWidth || FLEX_MIN) + "px";
|
|
6040
6060
|
} else {
|
|
6041
6061
|
s["--aura-cell-flex"] = !hasFlex && i === vis.length - 1 ? "1 0 auto" : "none";
|
|
@@ -6212,6 +6232,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6212
6232
|
[stacked]
|
|
6213
6233
|
);
|
|
6214
6234
|
function tabFor(r2, c) {
|
|
6235
|
+
if (tabMode) return -1;
|
|
6215
6236
|
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6216
6237
|
return r2 === ar && c === acShown ? 0 : -1;
|
|
6217
6238
|
}
|
|
@@ -6234,7 +6255,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6234
6255
|
const el = gridRef.current.querySelector('[data-rc="' + p.r + ":" + c + '"]');
|
|
6235
6256
|
if (el) {
|
|
6236
6257
|
pending.current = null;
|
|
6237
|
-
el.focus();
|
|
6258
|
+
(p.menuBtn && el.querySelector(".aura-table__menu-btn") || el).focus();
|
|
6238
6259
|
}
|
|
6239
6260
|
});
|
|
6240
6261
|
function focusCell(r2, c, dir) {
|
|
@@ -6346,7 +6367,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6346
6367
|
e.preventDefault();
|
|
6347
6368
|
e.stopPropagation();
|
|
6348
6369
|
resizing.current = true;
|
|
6349
|
-
let x0 = e.clientX, w0 =
|
|
6370
|
+
let x0 = e.clientX, w0 = widthOf2(c), last = w0;
|
|
6350
6371
|
const el = e.currentTarget;
|
|
6351
6372
|
el.classList.add("is-dragging");
|
|
6352
6373
|
document.body.style.cursor = "col-resize";
|
|
@@ -6510,7 +6531,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6510
6531
|
const m = menu;
|
|
6511
6532
|
setMenu(null);
|
|
6512
6533
|
if (restore && m) {
|
|
6513
|
-
if (m.kind === "col") pending.current = { r: 0, key: m.key, c: m.rc ? m.rc.c : 0 };
|
|
6534
|
+
if (m.kind === "col") pending.current = { r: 0, key: m.key, c: m.rc ? m.rc.c : 0, menuBtn: tabMode };
|
|
6514
6535
|
else if (m.anchor) m.anchor.focus();
|
|
6515
6536
|
}
|
|
6516
6537
|
}
|
|
@@ -6530,7 +6551,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6530
6551
|
const row = r2 > 0 && r2 <= nRows ? pageRows[r2 - 1] : null, isTotal = hasTotal && r2 === T;
|
|
6531
6552
|
let handled = true;
|
|
6532
6553
|
if (r2 === 0 && col && e.altKey && (k === "ArrowLeft" || k === "ArrowRight") && canResize(col))
|
|
6533
|
-
setW(col,
|
|
6554
|
+
setW(col, widthOf2(col) + (k === "ArrowLeft" ? -1 : 1) * (e.shiftKey ? 48 : 16), true);
|
|
6534
6555
|
else if (r2 === 0 && col && e.ctrlKey && e.shiftKey && (k === "ArrowLeft" || k === "ArrowRight") && reorderable) {
|
|
6535
6556
|
if (moveCol(col.key, k === "ArrowLeft" ? -1 : 1)) pending.current = { r: 0, key: col.key, c };
|
|
6536
6557
|
} else if (r2 === 0 && col && (e.altKey && k === "ArrowDown" || k === "ContextMenu" || e.shiftKey && k === "F10") && controls)
|
|
@@ -6598,10 +6619,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6598
6619
|
pageKeys.length ? /* @__PURE__ */ React33.createElement(
|
|
6599
6620
|
Checkbox,
|
|
6600
6621
|
{
|
|
6622
|
+
ref: props.selectAllRef,
|
|
6601
6623
|
hideLabel: true,
|
|
6602
6624
|
checked: all,
|
|
6603
6625
|
indeterminate: nSel > 0 && !all,
|
|
6604
|
-
tabIndex:
|
|
6626
|
+
tabIndex: tabIdx,
|
|
6605
6627
|
label: all ? t.deselectAllRows : t.selectAllRows,
|
|
6606
6628
|
onChange: toggleAll
|
|
6607
6629
|
}
|
|
@@ -6613,7 +6635,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6613
6635
|
const ci = i + (selectable ? 1 : 0);
|
|
6614
6636
|
const isSorted = sort && sort.key === c.key;
|
|
6615
6637
|
const canSort = c.sortable && canSortAny;
|
|
6616
|
-
const
|
|
6638
|
+
const own = c.sortDirection === "ascending" || c.sortDirection === "descending" ? c.sortDirection : void 0;
|
|
6639
|
+
const ariaSort = sort && canSortAny ? isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0 : own || (canSort ? "none" : void 0);
|
|
6617
6640
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
6618
6641
|
head.push(
|
|
6619
6642
|
/* @__PURE__ */ React33.createElement(
|
|
@@ -6671,7 +6694,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6671
6694
|
"button",
|
|
6672
6695
|
{
|
|
6673
6696
|
type: "button",
|
|
6674
|
-
tabIndex:
|
|
6697
|
+
tabIndex: tabIdx,
|
|
6675
6698
|
className: cx("aura-table__sort", isSorted && "is-active"),
|
|
6676
6699
|
onClick: function() {
|
|
6677
6700
|
sortBy(c.key);
|
|
@@ -6690,7 +6713,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6690
6713
|
"button",
|
|
6691
6714
|
{
|
|
6692
6715
|
type: "button",
|
|
6693
|
-
tabIndex:
|
|
6716
|
+
tabIndex: tabIdx,
|
|
6694
6717
|
className: "aura-table__menu-btn",
|
|
6695
6718
|
"aria-label": t.columnOptions(c.label),
|
|
6696
6719
|
"aria-haspopup": "menu",
|
|
@@ -6765,7 +6788,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6765
6788
|
{
|
|
6766
6789
|
hideLabel: true,
|
|
6767
6790
|
checked: isSel,
|
|
6768
|
-
tabIndex:
|
|
6791
|
+
tabIndex: tabIdx,
|
|
6769
6792
|
label: selLabel,
|
|
6770
6793
|
onChange: function(on) {
|
|
6771
6794
|
const shift = shiftClick.current;
|
|
@@ -8346,9 +8369,9 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8346
8369
|
const root = rootRef.current, bar = barRef.current;
|
|
8347
8370
|
if (!root || !bar) return;
|
|
8348
8371
|
function sync() {
|
|
8349
|
-
const
|
|
8350
|
-
root.style.setProperty("--aura-shell-bar-height", awayRef.current || !pinned(bar) ? "0px" :
|
|
8351
|
-
if (
|
|
8372
|
+
const h12 = bar.getBoundingClientRect().height;
|
|
8373
|
+
root.style.setProperty("--aura-shell-bar-height", awayRef.current || !pinned(bar) ? "0px" : h12 + "px");
|
|
8374
|
+
if (h12 > 0) barH[1](Math.round(h12));
|
|
8352
8375
|
}
|
|
8353
8376
|
sync();
|
|
8354
8377
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -8515,13 +8538,176 @@ var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
|
8515
8538
|
});
|
|
8516
8539
|
|
|
8517
8540
|
// src/Table.tsx
|
|
8541
|
+
var React52 = __toESM(require("react"), 1);
|
|
8542
|
+
|
|
8543
|
+
// src/TableSkeleton.tsx
|
|
8518
8544
|
var React51 = __toESM(require("react"), 1);
|
|
8519
|
-
var
|
|
8520
|
-
|
|
8545
|
+
var h10 = React51.createElement;
|
|
8546
|
+
function inertProps() {
|
|
8547
|
+
return { inert: parseInt(React51.version, 10) >= 19 ? true : "", "aria-hidden": true };
|
|
8548
|
+
}
|
|
8549
|
+
function widthOf(w) {
|
|
8550
|
+
return w == null || w === "" ? void 0 : typeof w === "number" ? w + "px" : w;
|
|
8551
|
+
}
|
|
8552
|
+
function skeletonColgroup(cols) {
|
|
8553
|
+
return h10(
|
|
8554
|
+
"colgroup",
|
|
8555
|
+
null,
|
|
8556
|
+
cols.map(function(c, i) {
|
|
8557
|
+
const w = widthOf(c.width);
|
|
8558
|
+
return h10("col", { key: i, style: w ? { width: w } : void 0 });
|
|
8559
|
+
})
|
|
8560
|
+
);
|
|
8561
|
+
}
|
|
8562
|
+
function placeholder(c) {
|
|
8563
|
+
const s = c.skeleton || {};
|
|
8564
|
+
if (s.kind === "pill") return h10("span", { className: "aura-skel aura-skel--pill" });
|
|
8565
|
+
if (s.kind === "action") return h10("span", { className: cx("aura-skel aura-skel--action", s.touch && "is-touch") });
|
|
8566
|
+
if (s.lines === 2)
|
|
8567
|
+
return h10(
|
|
8568
|
+
"span",
|
|
8569
|
+
{ className: "aura-skel-lines" },
|
|
8570
|
+
h10("span", { className: "aura-skel aura-skel--text", style: { width: "100%" } }),
|
|
8571
|
+
h10("span", { className: "aura-skel aura-skel--text", style: { width: "60%" } })
|
|
8572
|
+
);
|
|
8573
|
+
return h10("span", { className: "aura-skel aura-skel--text", style: { width: "80%" } });
|
|
8574
|
+
}
|
|
8575
|
+
function cellCls(base, c) {
|
|
8576
|
+
const align = c.align || (c.numeric ? "end" : void 0);
|
|
8577
|
+
return cx(base, align === "end" && "is-end", align === "center" && "is-center", c.numeric && "is-numeric");
|
|
8578
|
+
}
|
|
8579
|
+
function skeletonBody(cols, n3, stacked) {
|
|
8580
|
+
const rows = [];
|
|
8581
|
+
for (let r2 = 0; r2 < n3; r2++)
|
|
8582
|
+
rows.push(
|
|
8583
|
+
h10(
|
|
8584
|
+
"tr",
|
|
8585
|
+
{ key: r2, className: "aura-tbl__row aura-tbl__row--skeleton", role: stacked ? "row" : void 0 },
|
|
8586
|
+
cols.map(function(c, i) {
|
|
8587
|
+
const slot = stacked && (c.card === "title" || c.card === "action") ? c.card : void 0;
|
|
8588
|
+
return h10(
|
|
8589
|
+
"td",
|
|
8590
|
+
{
|
|
8591
|
+
key: i,
|
|
8592
|
+
className: cellCls("aura-tbl__td", c),
|
|
8593
|
+
role: stacked ? "cell" : void 0,
|
|
8594
|
+
"data-label": stacked && !slot && c.label ? c.label : void 0,
|
|
8595
|
+
"data-card": slot
|
|
8596
|
+
},
|
|
8597
|
+
placeholder(c)
|
|
8598
|
+
);
|
|
8599
|
+
})
|
|
8600
|
+
)
|
|
8601
|
+
);
|
|
8602
|
+
return h10(
|
|
8603
|
+
"tbody",
|
|
8604
|
+
{ key: "aura-skeleton", className: "aura-tbl__body", role: stacked ? "rowgroup" : void 0 },
|
|
8605
|
+
rows
|
|
8606
|
+
);
|
|
8607
|
+
}
|
|
8608
|
+
function tableWrapClass(p) {
|
|
8609
|
+
return cx(
|
|
8610
|
+
"aura-tbl-wrap",
|
|
8611
|
+
p.stackBelow && "is-stackable",
|
|
8612
|
+
p.bordered === false && "is-flush",
|
|
8613
|
+
p.bleed && "aura-bleed-frame",
|
|
8614
|
+
p.bleed && !p.cards && "aura-bleed",
|
|
8615
|
+
p.bleed && p.bleedEnd && !p.cards && "aura-bleed-end"
|
|
8616
|
+
);
|
|
8617
|
+
}
|
|
8618
|
+
function tableClass(p) {
|
|
8619
|
+
return cx(
|
|
8620
|
+
"aura-tbl",
|
|
8621
|
+
p.stackBelow && "aura-tbl--stack-" + p.stackBelow,
|
|
8622
|
+
(p.align === "middle" || p.rowHeight === "density" && p.align !== "top") && "aura-tbl--middle",
|
|
8623
|
+
p.rowHeight === "density" && "aura-tbl--row-density",
|
|
8624
|
+
p.cards && "aura-tbl--cards",
|
|
8625
|
+
p.className
|
|
8626
|
+
);
|
|
8627
|
+
}
|
|
8628
|
+
function cardsFrame(el, p) {
|
|
8629
|
+
return p.cards ? h10(
|
|
8630
|
+
"div",
|
|
8631
|
+
{
|
|
8632
|
+
className: cx(
|
|
8633
|
+
"aura-tbl-cards aura-tbl-cards--" + p.stackBelow,
|
|
8634
|
+
p.bleed && "aura-bleed",
|
|
8635
|
+
p.bleed && p.bleedEnd && "aura-bleed-end"
|
|
8636
|
+
)
|
|
8637
|
+
},
|
|
8638
|
+
el
|
|
8639
|
+
) : el;
|
|
8640
|
+
}
|
|
8641
|
+
function TableSkeleton(props) {
|
|
8642
|
+
const cols = props.columns || [];
|
|
8643
|
+
const n3 = props.rows != null ? Math.max(0, props.rows) : 5;
|
|
8644
|
+
const stacked = !!props.stackBelow;
|
|
8645
|
+
const cards = stacked && props.stackStyle === "cards";
|
|
8646
|
+
const head = h10(
|
|
8647
|
+
"thead",
|
|
8648
|
+
{ className: "aura-tbl__head", role: stacked ? "rowgroup" : void 0 },
|
|
8649
|
+
h10(
|
|
8650
|
+
"tr",
|
|
8651
|
+
{ className: "aura-tbl__row", role: stacked ? "row" : void 0 },
|
|
8652
|
+
cols.map(function(c, i) {
|
|
8653
|
+
return h10(
|
|
8654
|
+
"th",
|
|
8655
|
+
{ key: i, scope: "col", className: cellCls("aura-tbl__th", c), role: stacked ? "columnheader" : void 0 },
|
|
8656
|
+
c.label
|
|
8657
|
+
);
|
|
8658
|
+
})
|
|
8659
|
+
)
|
|
8660
|
+
);
|
|
8661
|
+
const table = h10(
|
|
8662
|
+
"div",
|
|
8663
|
+
Object.assign(
|
|
8664
|
+
{
|
|
8665
|
+
className: tableWrapClass({
|
|
8666
|
+
stackBelow: props.stackBelow,
|
|
8667
|
+
bordered: props.bordered,
|
|
8668
|
+
bleed: props.bleed,
|
|
8669
|
+
bleedEnd: props.bleedEnd,
|
|
8670
|
+
cards
|
|
8671
|
+
}),
|
|
8672
|
+
"data-density": props.density || "comfortable"
|
|
8673
|
+
},
|
|
8674
|
+
inertProps()
|
|
8675
|
+
),
|
|
8676
|
+
h10(
|
|
8677
|
+
"table",
|
|
8678
|
+
{
|
|
8679
|
+
className: cx(
|
|
8680
|
+
tableClass({
|
|
8681
|
+
stackBelow: props.stackBelow,
|
|
8682
|
+
align: props.align,
|
|
8683
|
+
rowHeight: props.rowHeight,
|
|
8684
|
+
cards,
|
|
8685
|
+
className: props.className
|
|
8686
|
+
}),
|
|
8687
|
+
"aura-tbl--skeleton"
|
|
8688
|
+
),
|
|
8689
|
+
role: stacked ? "table" : void 0
|
|
8690
|
+
},
|
|
8691
|
+
skeletonColgroup(cols),
|
|
8692
|
+
head,
|
|
8693
|
+
skeletonBody(cols, n3, stacked)
|
|
8694
|
+
)
|
|
8695
|
+
);
|
|
8696
|
+
return cardsFrame(table, {
|
|
8697
|
+
stackBelow: props.stackBelow,
|
|
8698
|
+
bleed: props.bleed,
|
|
8699
|
+
bleedEnd: props.bleedEnd,
|
|
8700
|
+
cards
|
|
8701
|
+
});
|
|
8702
|
+
}
|
|
8703
|
+
|
|
8704
|
+
// src/Table.tsx
|
|
8705
|
+
var StackLabels = React52.createContext(null);
|
|
8706
|
+
var ColumnIndex = React52.createContext(-1);
|
|
8521
8707
|
function flat2(children) {
|
|
8522
8708
|
const out = [];
|
|
8523
|
-
|
|
8524
|
-
if (
|
|
8709
|
+
React52.Children.toArray(children).forEach(function(c) {
|
|
8710
|
+
if (React52.isValidElement(c) && c.type === React52.Fragment)
|
|
8525
8711
|
out.push.apply(out, flat2(c.props.children));
|
|
8526
8712
|
else out.push(c);
|
|
8527
8713
|
});
|
|
@@ -8535,7 +8721,7 @@ function text(node) {
|
|
|
8535
8721
|
});
|
|
8536
8722
|
return parts.length ? parts.join("") : void 0;
|
|
8537
8723
|
}
|
|
8538
|
-
if (
|
|
8724
|
+
if (React52.isValidElement(node)) {
|
|
8539
8725
|
const p = node.props;
|
|
8540
8726
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8541
8727
|
return text(p.children);
|
|
@@ -8545,13 +8731,13 @@ function text(node) {
|
|
|
8545
8731
|
function headerLabels(children) {
|
|
8546
8732
|
let out = [];
|
|
8547
8733
|
flat2(children).forEach(function(c) {
|
|
8548
|
-
if (out.length || !
|
|
8734
|
+
if (out.length || !React52.isValidElement(c) || c.type !== THead) return;
|
|
8549
8735
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8550
|
-
return
|
|
8736
|
+
return React52.isValidElement(r2);
|
|
8551
8737
|
});
|
|
8552
8738
|
if (!row) return;
|
|
8553
8739
|
flat2(row.props.children).forEach(function(cell) {
|
|
8554
|
-
if (!
|
|
8740
|
+
if (!React52.isValidElement(cell)) return;
|
|
8555
8741
|
const p = cell.props;
|
|
8556
8742
|
const t = text(p.children);
|
|
8557
8743
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8561,7 +8747,34 @@ function headerLabels(children) {
|
|
|
8561
8747
|
});
|
|
8562
8748
|
return out;
|
|
8563
8749
|
}
|
|
8564
|
-
|
|
8750
|
+
function headerColumns(children) {
|
|
8751
|
+
const out = [];
|
|
8752
|
+
flat2(children).forEach(function(c) {
|
|
8753
|
+
if (out.length || !React52.isValidElement(c) || c.type !== THead) return;
|
|
8754
|
+
const row = flat2(c.props.children).find(function(r2) {
|
|
8755
|
+
return React52.isValidElement(r2);
|
|
8756
|
+
});
|
|
8757
|
+
if (!row) return;
|
|
8758
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8759
|
+
if (!React52.isValidElement(cell)) return;
|
|
8760
|
+
const p = cell.props;
|
|
8761
|
+
const t = text(p.children);
|
|
8762
|
+
const style = p.style;
|
|
8763
|
+
const span = Math.max(1, Number(p.colSpan) || 1);
|
|
8764
|
+
for (let i = 0; i < span; i++)
|
|
8765
|
+
out.push({
|
|
8766
|
+
label: p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0,
|
|
8767
|
+
width: span > 1 ? void 0 : p.skeletonWidth != null ? p.skeletonWidth : p.width != null ? p.width : style && style.width,
|
|
8768
|
+
align: p.align,
|
|
8769
|
+
numeric: p.numeric,
|
|
8770
|
+
card: p.card,
|
|
8771
|
+
skeleton: p.skeleton
|
|
8772
|
+
});
|
|
8773
|
+
});
|
|
8774
|
+
});
|
|
8775
|
+
return out;
|
|
8776
|
+
}
|
|
8777
|
+
var Table = React52.forwardRef(function Table2(props, ref) {
|
|
8565
8778
|
const {
|
|
8566
8779
|
caption,
|
|
8567
8780
|
captionHidden,
|
|
@@ -8575,10 +8788,24 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8575
8788
|
maxHeight,
|
|
8576
8789
|
stackStyle,
|
|
8577
8790
|
rowHeight,
|
|
8791
|
+
loading,
|
|
8792
|
+
loadingRows,
|
|
8578
8793
|
className,
|
|
8579
8794
|
children,
|
|
8580
8795
|
...rest
|
|
8581
8796
|
} = props;
|
|
8797
|
+
const skeletonCols = loading ? headerColumns(children) : null;
|
|
8798
|
+
if (skeletonCols && !skeletonCols.length)
|
|
8799
|
+
devWarnOnce(
|
|
8800
|
+
"tbl-loading-cols",
|
|
8801
|
+
"Table loading: no THead > Tr > Th found among its children, so there are no columns to draw. Put the THead directly inside Table (a function call, not your own component)."
|
|
8802
|
+
);
|
|
8803
|
+
const shownChildren = skeletonCols ? [
|
|
8804
|
+
flat2(children).filter(function(c) {
|
|
8805
|
+
return React52.isValidElement(c) && c.type === THead;
|
|
8806
|
+
}),
|
|
8807
|
+
skeletonBody(skeletonCols, loadingRows != null ? Math.max(0, loadingRows) : 5, !!stackBelow)
|
|
8808
|
+
] : children;
|
|
8582
8809
|
const cards = !!stackBelow && stackStyle === "cards";
|
|
8583
8810
|
if (maxHeight != null && caption == null && !rest["aria-label"] && !rest["aria-labelledby"])
|
|
8584
8811
|
devWarnOnce(
|
|
@@ -8591,12 +8818,12 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8591
8818
|
"tbl-stack-labels",
|
|
8592
8819
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8593
8820
|
);
|
|
8594
|
-
const outer =
|
|
8821
|
+
const outer = React52.useContext(StackLabels);
|
|
8595
8822
|
const pageDensity = useDensity();
|
|
8596
8823
|
const capId = uid();
|
|
8597
|
-
const wrap =
|
|
8598
|
-
const sc =
|
|
8599
|
-
const wide =
|
|
8824
|
+
const wrap = React52.useRef(null);
|
|
8825
|
+
const sc = React52.useState(false), scrolls = sc[0];
|
|
8826
|
+
const wide = React52.useState(false);
|
|
8600
8827
|
useIsoLayoutEffect(function() {
|
|
8601
8828
|
const el = wrap.current;
|
|
8602
8829
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8613,7 +8840,7 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8613
8840
|
ro.disconnect();
|
|
8614
8841
|
};
|
|
8615
8842
|
}, []);
|
|
8616
|
-
const table = /* @__PURE__ */
|
|
8843
|
+
const table = /* @__PURE__ */ React52.createElement(
|
|
8617
8844
|
"div",
|
|
8618
8845
|
{
|
|
8619
8846
|
ref: wrap,
|
|
@@ -8632,12 +8859,13 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8632
8859
|
),
|
|
8633
8860
|
style: maxHeight != null ? { maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight } : void 0,
|
|
8634
8861
|
"data-density": density || pageDensity,
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
"aria-
|
|
8862
|
+
...loading ? inertProps() : null,
|
|
8863
|
+
tabIndex: scrolls && !loading ? 0 : void 0,
|
|
8864
|
+
role: scrolls && !loading && (caption != null || rest["aria-label"] || rest["aria-labelledby"]) ? "region" : void 0,
|
|
8865
|
+
"aria-labelledby": scrolls && !loading ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8866
|
+
"aria-label": scrolls && !loading && caption == null ? rest["aria-label"] : void 0
|
|
8639
8867
|
},
|
|
8640
|
-
/* @__PURE__ */
|
|
8868
|
+
/* @__PURE__ */ React52.createElement(
|
|
8641
8869
|
"table",
|
|
8642
8870
|
{
|
|
8643
8871
|
ref,
|
|
@@ -8648,16 +8876,18 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8648
8876
|
(align === "middle" || rowHeight === "density" && align !== "top") && "aura-tbl--middle",
|
|
8649
8877
|
rowHeight === "density" && "aura-tbl--row-density",
|
|
8650
8878
|
cards && "aura-tbl--cards",
|
|
8879
|
+
loading && "aura-tbl--skeleton",
|
|
8651
8880
|
className
|
|
8652
8881
|
),
|
|
8653
8882
|
role: stackBelow ? "table" : void 0,
|
|
8654
8883
|
...rest
|
|
8655
8884
|
},
|
|
8656
|
-
caption != null ? /* @__PURE__ */
|
|
8657
|
-
|
|
8885
|
+
caption != null ? /* @__PURE__ */ React52.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8886
|
+
skeletonCols ? skeletonColgroup(skeletonCols) : null,
|
|
8887
|
+
labels ? /* @__PURE__ */ React52.createElement(StackLabels.Provider, { value: labels }, shownChildren) : outer ? /* @__PURE__ */ React52.createElement(StackLabels.Provider, { value: null }, shownChildren) : shownChildren
|
|
8658
8888
|
)
|
|
8659
8889
|
);
|
|
8660
|
-
return cards ? /* @__PURE__ */
|
|
8890
|
+
return cards ? /* @__PURE__ */ React52.createElement(
|
|
8661
8891
|
"div",
|
|
8662
8892
|
{
|
|
8663
8893
|
className: cx(
|
|
@@ -8670,10 +8900,10 @@ var Table = React51.forwardRef(function Table2(props, ref) {
|
|
|
8670
8900
|
) : table;
|
|
8671
8901
|
});
|
|
8672
8902
|
function section(tag, cls) {
|
|
8673
|
-
const C =
|
|
8903
|
+
const C = React52.forwardRef(function TableSection(props, ref) {
|
|
8674
8904
|
const { className, ...rest } = props;
|
|
8675
|
-
const stacked =
|
|
8676
|
-
return
|
|
8905
|
+
const stacked = React52.useContext(StackLabels) != null;
|
|
8906
|
+
return React52.createElement(
|
|
8677
8907
|
tag,
|
|
8678
8908
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8679
8909
|
);
|
|
@@ -8686,14 +8916,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
8686
8916
|
TBody.displayName = "TBody";
|
|
8687
8917
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8688
8918
|
TFoot.displayName = "TFoot";
|
|
8689
|
-
var Tr =
|
|
8919
|
+
var Tr = React52.forwardRef(function Tr2(props, ref) {
|
|
8690
8920
|
const { className, children, ...rest } = props;
|
|
8691
|
-
const stacked =
|
|
8921
|
+
const stacked = React52.useContext(StackLabels) != null;
|
|
8692
8922
|
let col = 0;
|
|
8693
|
-
return /* @__PURE__ */
|
|
8923
|
+
return /* @__PURE__ */ React52.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8694
8924
|
const at = col;
|
|
8695
|
-
if (
|
|
8696
|
-
return /* @__PURE__ */
|
|
8925
|
+
if (React52.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8926
|
+
return /* @__PURE__ */ React52.createElement(ColumnIndex.Provider, { key: React52.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8697
8927
|
}) : children);
|
|
8698
8928
|
});
|
|
8699
8929
|
function cellClass(base, p) {
|
|
@@ -8707,10 +8937,10 @@ function cellClass(base, p) {
|
|
|
8707
8937
|
p.className
|
|
8708
8938
|
);
|
|
8709
8939
|
}
|
|
8710
|
-
var Th =
|
|
8711
|
-
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8712
|
-
const stacked =
|
|
8713
|
-
return /* @__PURE__ */
|
|
8940
|
+
var Th = React52.forwardRef(function Th2(props, ref) {
|
|
8941
|
+
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, ...rest } = props;
|
|
8942
|
+
const stacked = React52.useContext(StackLabels) != null;
|
|
8943
|
+
return /* @__PURE__ */ React52.createElement(
|
|
8714
8944
|
"th",
|
|
8715
8945
|
{
|
|
8716
8946
|
ref,
|
|
@@ -8722,12 +8952,12 @@ var Th = React51.forwardRef(function Th2(props, ref) {
|
|
|
8722
8952
|
}
|
|
8723
8953
|
);
|
|
8724
8954
|
});
|
|
8725
|
-
var Td =
|
|
8726
|
-
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8727
|
-
const labels =
|
|
8955
|
+
var Td = React52.forwardRef(function Td2(props, ref) {
|
|
8956
|
+
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, ...rest } = props;
|
|
8957
|
+
const labels = React52.useContext(StackLabels), col = React52.useContext(ColumnIndex);
|
|
8728
8958
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8729
8959
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8730
|
-
return /* @__PURE__ */
|
|
8960
|
+
return /* @__PURE__ */ React52.createElement(
|
|
8731
8961
|
"td",
|
|
8732
8962
|
{
|
|
8733
8963
|
ref,
|
|
@@ -8741,8 +8971,8 @@ var Td = React51.forwardRef(function Td2(props, ref) {
|
|
|
8741
8971
|
});
|
|
8742
8972
|
|
|
8743
8973
|
// src/BottomNav.tsx
|
|
8744
|
-
var
|
|
8745
|
-
var BottomNav =
|
|
8974
|
+
var React53 = __toESM(require("react"), 1);
|
|
8975
|
+
var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
8746
8976
|
const t = useStrings();
|
|
8747
8977
|
const Link = useLinkComponent(props.linkComponent);
|
|
8748
8978
|
const st = useMaybeControlled(
|
|
@@ -8752,7 +8982,7 @@ var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
|
8752
8982
|
);
|
|
8753
8983
|
const active = st[0];
|
|
8754
8984
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8755
|
-
const own =
|
|
8985
|
+
const own = React53.useRef(null);
|
|
8756
8986
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8757
8987
|
const away = useHideOnScroll(
|
|
8758
8988
|
!!props.hideOnScroll,
|
|
@@ -8760,7 +8990,7 @@ var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
|
8760
8990
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8761
8991
|
64
|
|
8762
8992
|
);
|
|
8763
|
-
const setRef =
|
|
8993
|
+
const setRef = React53.useCallback(
|
|
8764
8994
|
function(el) {
|
|
8765
8995
|
own.current = el;
|
|
8766
8996
|
if (typeof ref === "function") ref(el);
|
|
@@ -8768,7 +8998,7 @@ var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
|
8768
8998
|
},
|
|
8769
8999
|
[ref]
|
|
8770
9000
|
);
|
|
8771
|
-
return /* @__PURE__ */
|
|
9001
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React53.createElement(
|
|
8772
9002
|
"nav",
|
|
8773
9003
|
{
|
|
8774
9004
|
ref: setRef,
|
|
@@ -8781,7 +9011,7 @@ var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
|
8781
9011
|
),
|
|
8782
9012
|
"aria-label": props.label || t.mainNav
|
|
8783
9013
|
},
|
|
8784
|
-
/* @__PURE__ */
|
|
9014
|
+
/* @__PURE__ */ React53.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8785
9015
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8786
9016
|
devWarnOnce(
|
|
8787
9017
|
"bottomnav-label-" + it.id,
|
|
@@ -8802,23 +9032,23 @@ var BottomNav = React52.forwardRef(function BottomNav2(props, ref) {
|
|
|
8802
9032
|
}
|
|
8803
9033
|
};
|
|
8804
9034
|
const inner = [
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8807
|
-
/* @__PURE__ */
|
|
8808
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
9035
|
+
/* @__PURE__ */ React53.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React53.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React53.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React53.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
9036
|
+
it.ariaLabel ? /* @__PURE__ */ React53.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
9037
|
+
/* @__PURE__ */ React53.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
9038
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React53.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8809
9039
|
];
|
|
8810
|
-
return /* @__PURE__ */
|
|
9040
|
+
return /* @__PURE__ */ React53.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React53.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React53.createElement("button", { type: "button", ...common }, inner));
|
|
8811
9041
|
}))
|
|
8812
9042
|
));
|
|
8813
9043
|
});
|
|
8814
9044
|
|
|
8815
9045
|
// src/Surface.tsx
|
|
8816
|
-
var
|
|
8817
|
-
var
|
|
8818
|
-
var Surface =
|
|
9046
|
+
var React54 = __toESM(require("react"), 1);
|
|
9047
|
+
var h11 = React54.createElement;
|
|
9048
|
+
var Surface = React54.forwardRef(function Surface2(props, ref) {
|
|
8819
9049
|
const t = props.texture || "mesh";
|
|
8820
9050
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8821
|
-
return
|
|
9051
|
+
return h11(
|
|
8822
9052
|
props.as || "div",
|
|
8823
9053
|
Object.assign({}, rest, {
|
|
8824
9054
|
ref,
|
|
@@ -8836,14 +9066,14 @@ var Surface = React53.forwardRef(function Surface2(props, ref) {
|
|
|
8836
9066
|
});
|
|
8837
9067
|
|
|
8838
9068
|
// src/Stat.tsx
|
|
8839
|
-
var
|
|
8840
|
-
var Stat =
|
|
9069
|
+
var React55 = __toESM(require("react"), 1);
|
|
9070
|
+
var Stat = React55.forwardRef(function Stat2(props, ref) {
|
|
8841
9071
|
const Link = useLinkComponent(props.linkComponent);
|
|
8842
9072
|
return statElement(props, ref, Link);
|
|
8843
9073
|
});
|
|
8844
9074
|
|
|
8845
9075
|
// src/TimePicker.tsx
|
|
8846
|
-
var
|
|
9076
|
+
var React56 = __toESM(require("react"), 1);
|
|
8847
9077
|
var import_react_dom12 = require("react-dom");
|
|
8848
9078
|
|
|
8849
9079
|
// src/text.ts
|
|
@@ -8885,7 +9115,7 @@ function toMin(t) {
|
|
|
8885
9115
|
function fromMin(n3) {
|
|
8886
9116
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8887
9117
|
}
|
|
8888
|
-
var TimePicker =
|
|
9118
|
+
var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
8889
9119
|
const t = useStrings();
|
|
8890
9120
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8891
9121
|
const st = useMaybeControlled(
|
|
@@ -8895,7 +9125,7 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
8895
9125
|
);
|
|
8896
9126
|
const value = st[0];
|
|
8897
9127
|
const step = props.step || 30, lo = toMin(props.min) != null ? toMin(props.min) : 0, hi = toMin(props.max) != null ? toMin(props.max) : 24 * 60 - 1;
|
|
8898
|
-
const slots =
|
|
9128
|
+
const slots = React56.useMemo(
|
|
8899
9129
|
function() {
|
|
8900
9130
|
const out = [];
|
|
8901
9131
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8907,12 +9137,12 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
8907
9137
|
const n3 = toMin(v);
|
|
8908
9138
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8909
9139
|
}
|
|
8910
|
-
const openState =
|
|
8911
|
-
const editState =
|
|
8912
|
-
const aState =
|
|
8913
|
-
const errState =
|
|
8914
|
-
const pos =
|
|
8915
|
-
const boxRef =
|
|
9140
|
+
const openState = React56.useState(false), open = openState[0], setOpen = openState[1];
|
|
9141
|
+
const editState = React56.useState(null), editing = editState[0], setEditing = editState[1];
|
|
9142
|
+
const aState = React56.useState(0), active = aState[0], setActive = aState[1];
|
|
9143
|
+
const errState = React56.useState(null);
|
|
9144
|
+
const pos = React56.useState(null);
|
|
9145
|
+
const boxRef = React56.useRef(null), inputRef = React56.useRef(null), listRef = React56.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8916
9146
|
const mounted = useMounted();
|
|
8917
9147
|
function nearest(v) {
|
|
8918
9148
|
const n3 = toMin(v);
|
|
@@ -8940,7 +9170,7 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
8940
9170
|
},
|
|
8941
9171
|
[open]
|
|
8942
9172
|
);
|
|
8943
|
-
|
|
9173
|
+
React56.useEffect(
|
|
8944
9174
|
function() {
|
|
8945
9175
|
if (!open) return;
|
|
8946
9176
|
function outside(e) {
|
|
@@ -8962,7 +9192,7 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
8962
9192
|
},
|
|
8963
9193
|
[open]
|
|
8964
9194
|
);
|
|
8965
|
-
|
|
9195
|
+
React56.useEffect(
|
|
8966
9196
|
function() {
|
|
8967
9197
|
if (!open || !listRef.current) return;
|
|
8968
9198
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -9061,9 +9291,9 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9061
9291
|
}
|
|
9062
9292
|
const error = errState[0] || props.error;
|
|
9063
9293
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
9064
|
-
/* @__PURE__ */
|
|
9294
|
+
/* @__PURE__ */ React56.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React56.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
9065
9295
|
const dis = blocked(s), sel = s === value;
|
|
9066
|
-
return /* @__PURE__ */
|
|
9296
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9067
9297
|
"li",
|
|
9068
9298
|
{
|
|
9069
9299
|
key: s,
|
|
@@ -9088,13 +9318,13 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9088
9318
|
if (active !== i) setActive(i);
|
|
9089
9319
|
}
|
|
9090
9320
|
},
|
|
9091
|
-
/* @__PURE__ */
|
|
9092
|
-
sel ? /* @__PURE__ */
|
|
9321
|
+
/* @__PURE__ */ React56.createElement("span", { className: "aura-combo__label" }, s),
|
|
9322
|
+
sel ? /* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
9093
9323
|
);
|
|
9094
9324
|
}))),
|
|
9095
9325
|
document.body
|
|
9096
9326
|
) : null;
|
|
9097
|
-
return /* @__PURE__ */
|
|
9327
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9098
9328
|
Field,
|
|
9099
9329
|
{
|
|
9100
9330
|
id,
|
|
@@ -9106,7 +9336,7 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9106
9336
|
disabled: props.disabled,
|
|
9107
9337
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9108
9338
|
},
|
|
9109
|
-
/* @__PURE__ */
|
|
9339
|
+
/* @__PURE__ */ React56.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React56.createElement(
|
|
9110
9340
|
"input",
|
|
9111
9341
|
{
|
|
9112
9342
|
ref: inputMerged,
|
|
@@ -9146,7 +9376,7 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9146
9376
|
}, 0);
|
|
9147
9377
|
}
|
|
9148
9378
|
}
|
|
9149
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9379
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React56.createElement(
|
|
9150
9380
|
"button",
|
|
9151
9381
|
{
|
|
9152
9382
|
type: "button",
|
|
@@ -9159,8 +9389,8 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9159
9389
|
if (inputRef.current) inputRef.current.focus();
|
|
9160
9390
|
}
|
|
9161
9391
|
},
|
|
9162
|
-
/* @__PURE__ */
|
|
9163
|
-
) : null, /* @__PURE__ */
|
|
9392
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconX, null) })
|
|
9393
|
+
) : null, /* @__PURE__ */ React56.createElement(
|
|
9164
9394
|
"button",
|
|
9165
9395
|
{
|
|
9166
9396
|
type: "button",
|
|
@@ -9178,14 +9408,14 @@ var TimePicker = React55.forwardRef(function TimePicker2(props, ref) {
|
|
|
9178
9408
|
}
|
|
9179
9409
|
}
|
|
9180
9410
|
},
|
|
9181
|
-
/* @__PURE__ */
|
|
9411
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: /* @__PURE__ */ React56.createElement(IconChevronDown, null) })
|
|
9182
9412
|
)),
|
|
9183
9413
|
list
|
|
9184
9414
|
);
|
|
9185
9415
|
});
|
|
9186
9416
|
|
|
9187
9417
|
// src/FileUpload.tsx
|
|
9188
|
-
var
|
|
9418
|
+
var React57 = __toESM(require("react"), 1);
|
|
9189
9419
|
function matches(file, accept) {
|
|
9190
9420
|
if (!accept) return true;
|
|
9191
9421
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9209,24 +9439,24 @@ function describeAccept(accept, t) {
|
|
|
9209
9439
|
}).join(", ");
|
|
9210
9440
|
}
|
|
9211
9441
|
var seq = 0;
|
|
9212
|
-
var FileUpload =
|
|
9442
|
+
var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
9213
9443
|
const t = useStrings();
|
|
9214
9444
|
const auto = uid(), id = props.id || auto;
|
|
9215
9445
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9216
9446
|
const items2 = st[0] || [];
|
|
9217
|
-
const dragState =
|
|
9218
|
-
const inputRef =
|
|
9219
|
-
const urls =
|
|
9447
|
+
const dragState = React57.useState(false), over = dragState[0];
|
|
9448
|
+
const inputRef = React57.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9449
|
+
const urls = React57.useRef({});
|
|
9220
9450
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9221
9451
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9222
|
-
|
|
9452
|
+
React57.useEffect(function() {
|
|
9223
9453
|
return function() {
|
|
9224
9454
|
Object.keys(urls.current).forEach(function(k) {
|
|
9225
9455
|
URL.revokeObjectURL(urls.current[k]);
|
|
9226
9456
|
});
|
|
9227
9457
|
};
|
|
9228
9458
|
}, []);
|
|
9229
|
-
|
|
9459
|
+
React57.useEffect(
|
|
9230
9460
|
function() {
|
|
9231
9461
|
const el = inputRef.current;
|
|
9232
9462
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9286,7 +9516,7 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9286
9516
|
if (inputRef.current) inputRef.current.focus();
|
|
9287
9517
|
}
|
|
9288
9518
|
const error = props.error;
|
|
9289
|
-
return /* @__PURE__ */
|
|
9519
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9290
9520
|
Field,
|
|
9291
9521
|
{
|
|
9292
9522
|
id,
|
|
@@ -9298,7 +9528,7 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9298
9528
|
disabled: props.disabled,
|
|
9299
9529
|
className: props.className
|
|
9300
9530
|
},
|
|
9301
|
-
/* @__PURE__ */
|
|
9531
|
+
/* @__PURE__ */ React57.createElement(
|
|
9302
9532
|
"div",
|
|
9303
9533
|
{
|
|
9304
9534
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9319,9 +9549,9 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9319
9549
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9320
9550
|
}
|
|
9321
9551
|
},
|
|
9322
|
-
/* @__PURE__ */
|
|
9323
|
-
/* @__PURE__ */
|
|
9324
|
-
/* @__PURE__ */
|
|
9552
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9553
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9554
|
+
/* @__PURE__ */ React57.createElement(
|
|
9325
9555
|
"input",
|
|
9326
9556
|
{
|
|
9327
9557
|
ref: inputMerged,
|
|
@@ -9343,12 +9573,12 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9343
9573
|
}
|
|
9344
9574
|
}
|
|
9345
9575
|
),
|
|
9346
|
-
/* @__PURE__ */
|
|
9347
|
-
note ? /* @__PURE__ */
|
|
9576
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9577
|
+
note ? /* @__PURE__ */ React57.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9348
9578
|
),
|
|
9349
|
-
items2.length ? /* @__PURE__ */
|
|
9579
|
+
items2.length ? /* @__PURE__ */ React57.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9350
9580
|
const src = thumb(it);
|
|
9351
|
-
return /* @__PURE__ */
|
|
9581
|
+
return /* @__PURE__ */ React57.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React57.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React57.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React57.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React57.createElement(IconImage, null) : /* @__PURE__ */ React57.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React57.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React57.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React57.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React57.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React57.createElement(
|
|
9352
9582
|
"span",
|
|
9353
9583
|
{
|
|
9354
9584
|
className: "aura-upload__bar",
|
|
@@ -9358,11 +9588,11 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9358
9588
|
"aria-valuemax": 100,
|
|
9359
9589
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9360
9590
|
},
|
|
9361
|
-
/* @__PURE__ */
|
|
9362
|
-
) : null), /* @__PURE__ */
|
|
9591
|
+
/* @__PURE__ */ React57.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9592
|
+
) : null), /* @__PURE__ */ React57.createElement(
|
|
9363
9593
|
IconButton,
|
|
9364
9594
|
{
|
|
9365
|
-
icon: /* @__PURE__ */
|
|
9595
|
+
icon: /* @__PURE__ */ React57.createElement(IconX, null),
|
|
9366
9596
|
label: t.remove(it.name),
|
|
9367
9597
|
onClick: function() {
|
|
9368
9598
|
remove(it);
|
|
@@ -9375,14 +9605,14 @@ var FileUpload = React56.forwardRef(function FileUpload2(props, ref) {
|
|
|
9375
9605
|
|
|
9376
9606
|
// src/theme.ts
|
|
9377
9607
|
function hexToRgb(hex) {
|
|
9378
|
-
let
|
|
9379
|
-
if (
|
|
9380
|
-
|
|
9608
|
+
let h12 = String(hex).trim().replace("#", "");
|
|
9609
|
+
if (h12.length === 3)
|
|
9610
|
+
h12 = h12.split("").map(function(c) {
|
|
9381
9611
|
return c + c;
|
|
9382
9612
|
}).join("");
|
|
9383
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
9613
|
+
if (!/^[0-9a-f]{6}$/i.test(h12)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
9384
9614
|
return [0, 2, 4].map(function(i) {
|
|
9385
|
-
return parseInt(
|
|
9615
|
+
return parseInt(h12.slice(i, i + 2), 16) / 255;
|
|
9386
9616
|
});
|
|
9387
9617
|
}
|
|
9388
9618
|
function rgbToHex(rgb) {
|
|
@@ -9678,9 +9908,9 @@ function createTheme(opts) {
|
|
|
9678
9908
|
}
|
|
9679
9909
|
|
|
9680
9910
|
// src/ThemeStyle.tsx
|
|
9681
|
-
var
|
|
9911
|
+
var React58 = __toESM(require("react"), 1);
|
|
9682
9912
|
function ThemeStyle(props) {
|
|
9683
|
-
const css =
|
|
9913
|
+
const css = React58.useMemo(
|
|
9684
9914
|
function() {
|
|
9685
9915
|
try {
|
|
9686
9916
|
return createTheme({
|
|
@@ -9697,11 +9927,11 @@ function ThemeStyle(props) {
|
|
|
9697
9927
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
9698
9928
|
);
|
|
9699
9929
|
if (css === null) return null;
|
|
9700
|
-
return /* @__PURE__ */
|
|
9930
|
+
return /* @__PURE__ */ React58.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9701
9931
|
}
|
|
9702
9932
|
|
|
9703
9933
|
// src/colorScheme.tsx
|
|
9704
|
-
var
|
|
9934
|
+
var React59 = __toESM(require("react"), 1);
|
|
9705
9935
|
|
|
9706
9936
|
// src/colorSchemeScript.ts
|
|
9707
9937
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9718,7 +9948,7 @@ function colorSchemeScript(options) {
|
|
|
9718
9948
|
|
|
9719
9949
|
// src/colorScheme.tsx
|
|
9720
9950
|
function ColorSchemeScript(props) {
|
|
9721
|
-
return /* @__PURE__ */
|
|
9951
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9722
9952
|
"script",
|
|
9723
9953
|
{
|
|
9724
9954
|
"data-aura-color-scheme": "",
|
|
@@ -9743,7 +9973,7 @@ function apply(scheme) {
|
|
|
9743
9973
|
function useColorScheme(options) {
|
|
9744
9974
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9745
9975
|
const fallback = options && options.defaultScheme || "system";
|
|
9746
|
-
const subscribe2 =
|
|
9976
|
+
const subscribe2 = React59.useCallback(
|
|
9747
9977
|
function(cb) {
|
|
9748
9978
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9749
9979
|
function onSystem() {
|
|
@@ -9765,7 +9995,7 @@ function useColorScheme(options) {
|
|
|
9765
9995
|
},
|
|
9766
9996
|
[fallback, key]
|
|
9767
9997
|
);
|
|
9768
|
-
const snapshot =
|
|
9998
|
+
const snapshot = React59.useSyncExternalStore(
|
|
9769
9999
|
subscribe2,
|
|
9770
10000
|
function() {
|
|
9771
10001
|
const s = readScheme(fallback);
|
|
@@ -9776,7 +10006,7 @@ function useColorScheme(options) {
|
|
|
9776
10006
|
}
|
|
9777
10007
|
);
|
|
9778
10008
|
const parts = snapshot.split("|");
|
|
9779
|
-
const setScheme =
|
|
10009
|
+
const setScheme = React59.useCallback(
|
|
9780
10010
|
function(next) {
|
|
9781
10011
|
if (!valid(next)) return;
|
|
9782
10012
|
try {
|
|
@@ -9795,14 +10025,14 @@ function ColorSchemeToggle(props) {
|
|
|
9795
10025
|
const cs = useColorScheme(props);
|
|
9796
10026
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9797
10027
|
const label = props.label || t.colorScheme;
|
|
9798
|
-
return /* @__PURE__ */
|
|
10028
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9799
10029
|
DropdownMenu,
|
|
9800
10030
|
{
|
|
9801
10031
|
label,
|
|
9802
|
-
trigger: /* @__PURE__ */
|
|
10032
|
+
trigger: /* @__PURE__ */ React59.createElement(
|
|
9803
10033
|
IconButton,
|
|
9804
10034
|
{
|
|
9805
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10035
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React59.createElement(IconMoon, null) : /* @__PURE__ */ React59.createElement(IconSun, null),
|
|
9806
10036
|
label: label + ": " + names[cs.scheme]
|
|
9807
10037
|
}
|
|
9808
10038
|
),
|
|
@@ -9820,14 +10050,14 @@ function ColorSchemeToggle(props) {
|
|
|
9820
10050
|
}
|
|
9821
10051
|
|
|
9822
10052
|
// src/Badge.tsx
|
|
9823
|
-
var
|
|
9824
|
-
var Badge =
|
|
10053
|
+
var React60 = __toESM(require("react"), 1);
|
|
10054
|
+
var Badge = React60.forwardRef(function Badge2(props, ref) {
|
|
9825
10055
|
return badgeElement(props, ref);
|
|
9826
10056
|
});
|
|
9827
10057
|
|
|
9828
10058
|
// src/Progress.tsx
|
|
9829
|
-
var
|
|
9830
|
-
var Progress =
|
|
10059
|
+
var React61 = __toESM(require("react"), 1);
|
|
10060
|
+
var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
9831
10061
|
const t = useStrings();
|
|
9832
10062
|
const auto = uid(), id = props.id || auto;
|
|
9833
10063
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9836,7 +10066,7 @@ var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
|
9836
10066
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9837
10067
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9838
10068
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9839
|
-
return /* @__PURE__ */
|
|
10069
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9840
10070
|
"div",
|
|
9841
10071
|
{
|
|
9842
10072
|
ref,
|
|
@@ -9847,8 +10077,8 @@ var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
|
9847
10077
|
props.className
|
|
9848
10078
|
)
|
|
9849
10079
|
},
|
|
9850
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9851
|
-
/* @__PURE__ */
|
|
10080
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React61.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React61.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React61.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
10081
|
+
/* @__PURE__ */ React61.createElement(
|
|
9852
10082
|
"div",
|
|
9853
10083
|
{
|
|
9854
10084
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9860,8 +10090,8 @@ var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
|
9860
10090
|
"aria-valuenow": det ? props.value : void 0,
|
|
9861
10091
|
"aria-valuetext": det ? valueText : void 0
|
|
9862
10092
|
},
|
|
9863
|
-
/* @__PURE__ */
|
|
9864
|
-
sec ? /* @__PURE__ */
|
|
10093
|
+
/* @__PURE__ */ React61.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10094
|
+
sec ? /* @__PURE__ */ React61.createElement(
|
|
9865
10095
|
"span",
|
|
9866
10096
|
{
|
|
9867
10097
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9869,19 +10099,19 @@ var Progress = React60.forwardRef(function Progress2(props, ref) {
|
|
|
9869
10099
|
}
|
|
9870
10100
|
) : null
|
|
9871
10101
|
),
|
|
9872
|
-
props.hint ? /* @__PURE__ */
|
|
10102
|
+
props.hint ? /* @__PURE__ */ React61.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9873
10103
|
);
|
|
9874
10104
|
});
|
|
9875
10105
|
|
|
9876
10106
|
// src/Skeleton.tsx
|
|
9877
|
-
var
|
|
9878
|
-
var Skeleton =
|
|
10107
|
+
var React62 = __toESM(require("react"), 1);
|
|
10108
|
+
var Skeleton = React62.forwardRef(function Skeleton2(props, ref) {
|
|
9879
10109
|
const v = props.variant || "text";
|
|
9880
10110
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9881
10111
|
const n3 = props.lines, rows = [];
|
|
9882
10112
|
for (let i = 0; i < n3; i++)
|
|
9883
|
-
rows.push(/* @__PURE__ */
|
|
9884
|
-
return /* @__PURE__ */
|
|
10113
|
+
rows.push(/* @__PURE__ */ React62.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
10114
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9885
10115
|
"span",
|
|
9886
10116
|
{
|
|
9887
10117
|
ref,
|
|
@@ -9899,17 +10129,17 @@ var Skeleton = React61.forwardRef(function Skeleton2(props, ref) {
|
|
|
9899
10129
|
if (v === "circle") {
|
|
9900
10130
|
style.width = style.height = props.size || props.width || 40;
|
|
9901
10131
|
}
|
|
9902
|
-
return /* @__PURE__ */
|
|
10132
|
+
return /* @__PURE__ */ React62.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9903
10133
|
});
|
|
9904
10134
|
|
|
9905
10135
|
// src/EmptyState.tsx
|
|
9906
|
-
var
|
|
9907
|
-
var EmptyState =
|
|
10136
|
+
var React63 = __toESM(require("react"), 1);
|
|
10137
|
+
var EmptyState = React63.forwardRef(function EmptyState2(props, ref) {
|
|
9908
10138
|
return emptyStateElement(props, ref);
|
|
9909
10139
|
});
|
|
9910
10140
|
|
|
9911
10141
|
// src/Pagination.tsx
|
|
9912
|
-
var
|
|
10142
|
+
var React64 = __toESM(require("react"), 1);
|
|
9913
10143
|
function pageList(page, count, sib) {
|
|
9914
10144
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9915
10145
|
if (page - sib <= 3) {
|
|
@@ -9929,7 +10159,7 @@ function pageList(page, count, sib) {
|
|
|
9929
10159
|
if (count > 1) out.push(count);
|
|
9930
10160
|
return out;
|
|
9931
10161
|
}
|
|
9932
|
-
var Pagination =
|
|
10162
|
+
var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
9933
10163
|
const t = useStrings();
|
|
9934
10164
|
useAutoTip();
|
|
9935
10165
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9949,7 +10179,7 @@ var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
|
9949
10179
|
},
|
|
9950
10180
|
extra
|
|
9951
10181
|
);
|
|
9952
|
-
return link ? /* @__PURE__ */
|
|
10182
|
+
return link ? /* @__PURE__ */ React64.createElement(
|
|
9953
10183
|
Link,
|
|
9954
10184
|
{
|
|
9955
10185
|
href: link(p),
|
|
@@ -9962,7 +10192,7 @@ var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
|
9962
10192
|
...common
|
|
9963
10193
|
},
|
|
9964
10194
|
label
|
|
9965
|
-
) : /* @__PURE__ */
|
|
10195
|
+
) : /* @__PURE__ */ React64.createElement(
|
|
9966
10196
|
"button",
|
|
9967
10197
|
{
|
|
9968
10198
|
type: "button",
|
|
@@ -9976,7 +10206,7 @@ var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
|
9976
10206
|
}
|
|
9977
10207
|
function arrow(p, icon, label, rel, disabled) {
|
|
9978
10208
|
if (!link || disabled)
|
|
9979
|
-
return /* @__PURE__ */
|
|
10209
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9980
10210
|
IconButton,
|
|
9981
10211
|
{
|
|
9982
10212
|
icon,
|
|
@@ -9987,7 +10217,7 @@ var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
|
9987
10217
|
}
|
|
9988
10218
|
}
|
|
9989
10219
|
);
|
|
9990
|
-
return /* @__PURE__ */
|
|
10220
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9991
10221
|
Link,
|
|
9992
10222
|
{
|
|
9993
10223
|
href: link(p),
|
|
@@ -10002,17 +10232,17 @@ var Pagination = React63.forwardRef(function Pagination2(props, ref) {
|
|
|
10002
10232
|
}
|
|
10003
10233
|
}
|
|
10004
10234
|
},
|
|
10005
|
-
/* @__PURE__ */
|
|
10235
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: icon, size: "sm" })
|
|
10006
10236
|
);
|
|
10007
10237
|
}
|
|
10008
|
-
return /* @__PURE__ */
|
|
10009
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
10010
|
-
})), /* @__PURE__ */
|
|
10238
|
+
return /* @__PURE__ */ React64.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React64.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React64.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
10239
|
+
return typeof p === "number" ? /* @__PURE__ */ React64.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React64.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
10240
|
+
})), /* @__PURE__ */ React64.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React64.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
10011
10241
|
});
|
|
10012
10242
|
|
|
10013
10243
|
// src/Accordion.tsx
|
|
10014
|
-
var
|
|
10015
|
-
var Accordion =
|
|
10244
|
+
var React65 = __toESM(require("react"), 1);
|
|
10245
|
+
var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
10016
10246
|
const auto = uid(), base = props.id || auto;
|
|
10017
10247
|
const multiple = props.type === "multiple";
|
|
10018
10248
|
const st = useMaybeControlled(
|
|
@@ -10050,9 +10280,9 @@ var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
|
10050
10280
|
n3.focus();
|
|
10051
10281
|
}
|
|
10052
10282
|
}
|
|
10053
|
-
return /* @__PURE__ */
|
|
10283
|
+
return /* @__PURE__ */ React65.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10054
10284
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10055
|
-
return /* @__PURE__ */
|
|
10285
|
+
return /* @__PURE__ */ React65.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React65.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React65.createElement(
|
|
10056
10286
|
"button",
|
|
10057
10287
|
{
|
|
10058
10288
|
type: "button",
|
|
@@ -10065,10 +10295,10 @@ var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
|
10065
10295
|
toggle(it.id);
|
|
10066
10296
|
}
|
|
10067
10297
|
},
|
|
10068
|
-
it.icon ? /* @__PURE__ */
|
|
10069
|
-
/* @__PURE__ */
|
|
10070
|
-
/* @__PURE__ */
|
|
10071
|
-
)), /* @__PURE__ */
|
|
10298
|
+
it.icon ? /* @__PURE__ */ React65.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10299
|
+
/* @__PURE__ */ React65.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React65.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React65.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
10300
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10301
|
+
)), /* @__PURE__ */ React65.createElement(
|
|
10072
10302
|
"div",
|
|
10073
10303
|
{
|
|
10074
10304
|
id: pid,
|
|
@@ -10083,7 +10313,7 @@ var Accordion = React64.forwardRef(function Accordion2(props, ref) {
|
|
|
10083
10313
|
});
|
|
10084
10314
|
|
|
10085
10315
|
// src/Popover.tsx
|
|
10086
|
-
var
|
|
10316
|
+
var React66 = __toESM(require("react"), 1);
|
|
10087
10317
|
var import_react_dom13 = require("react-dom");
|
|
10088
10318
|
function position(anchor, pop, placement) {
|
|
10089
10319
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10096,20 +10326,20 @@ function position(anchor, pop, placement) {
|
|
|
10096
10326
|
side = above > below2 ? "top" : "bottom";
|
|
10097
10327
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
10098
10328
|
}
|
|
10099
|
-
const
|
|
10100
|
-
const top = side === "top" ? r2.top - gap -
|
|
10329
|
+
const h12 = maxHeight ? Math.min(ph, maxHeight) : ph;
|
|
10330
|
+
const top = side === "top" ? r2.top - gap - h12 : r2.bottom + gap;
|
|
10101
10331
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10102
10332
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10103
10333
|
}
|
|
10104
|
-
var Popover =
|
|
10334
|
+
var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
10105
10335
|
const t = useStrings();
|
|
10106
10336
|
const density = useDensity();
|
|
10107
10337
|
const auto = uid(), id = props.id || auto;
|
|
10108
10338
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10109
10339
|
const open = !!st[0];
|
|
10110
|
-
const wrap =
|
|
10111
|
-
const pos =
|
|
10112
|
-
const inTree =
|
|
10340
|
+
const wrap = React66.useRef(null), pop = React66.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10341
|
+
const pos = React66.useState(null), mounted = useMounted();
|
|
10342
|
+
const inTree = React66.useRef(false);
|
|
10113
10343
|
function trigger() {
|
|
10114
10344
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10115
10345
|
}
|
|
@@ -10136,7 +10366,7 @@ var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
|
10136
10366
|
},
|
|
10137
10367
|
[open, mounted, props.placement]
|
|
10138
10368
|
);
|
|
10139
|
-
|
|
10369
|
+
React66.useEffect(
|
|
10140
10370
|
function() {
|
|
10141
10371
|
if (!open || !mounted) return;
|
|
10142
10372
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10161,9 +10391,9 @@ var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
|
10161
10391
|
},
|
|
10162
10392
|
[open, mounted]
|
|
10163
10393
|
);
|
|
10164
|
-
const child =
|
|
10394
|
+
const child = React66.Children.only(props.trigger);
|
|
10165
10395
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10166
|
-
/* @__PURE__ */
|
|
10396
|
+
/* @__PURE__ */ React66.createElement(
|
|
10167
10397
|
"div",
|
|
10168
10398
|
{
|
|
10169
10399
|
ref: popMerged,
|
|
@@ -10193,17 +10423,17 @@ var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
|
10193
10423
|
} else trapTab(e, pop.current);
|
|
10194
10424
|
}
|
|
10195
10425
|
},
|
|
10196
|
-
props.title ? /* @__PURE__ */
|
|
10426
|
+
props.title ? /* @__PURE__ */ React66.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React66.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React66.createElement(
|
|
10197
10427
|
IconButton,
|
|
10198
10428
|
{
|
|
10199
|
-
icon: /* @__PURE__ */
|
|
10429
|
+
icon: /* @__PURE__ */ React66.createElement(IconX, null),
|
|
10200
10430
|
label: t.close,
|
|
10201
10431
|
onClick: function() {
|
|
10202
10432
|
close(true);
|
|
10203
10433
|
}
|
|
10204
10434
|
}
|
|
10205
10435
|
)) : null,
|
|
10206
|
-
/* @__PURE__ */
|
|
10436
|
+
/* @__PURE__ */ React66.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10207
10437
|
close: function() {
|
|
10208
10438
|
close(true);
|
|
10209
10439
|
}
|
|
@@ -10211,7 +10441,7 @@ var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
|
10211
10441
|
),
|
|
10212
10442
|
document.body
|
|
10213
10443
|
) : null;
|
|
10214
|
-
return /* @__PURE__ */
|
|
10444
|
+
return /* @__PURE__ */ React66.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React66.cloneElement(child, {
|
|
10215
10445
|
onClick: function(e) {
|
|
10216
10446
|
if (child.props.onClick) child.props.onClick(e);
|
|
10217
10447
|
st[1](!open);
|
|
@@ -10223,7 +10453,7 @@ var Popover = React65.forwardRef(function Popover2(props, ref) {
|
|
|
10223
10453
|
});
|
|
10224
10454
|
|
|
10225
10455
|
// src/NumberField.tsx
|
|
10226
|
-
var
|
|
10456
|
+
var React67 = __toESM(require("react"), 1);
|
|
10227
10457
|
function decimalsOf(n3) {
|
|
10228
10458
|
const s = String(n3);
|
|
10229
10459
|
const i = s.indexOf(".");
|
|
@@ -10236,7 +10466,7 @@ function parse(text2) {
|
|
|
10236
10466
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10237
10467
|
return Number(s);
|
|
10238
10468
|
}
|
|
10239
|
-
var NumberField =
|
|
10469
|
+
var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
10240
10470
|
const t = useStrings();
|
|
10241
10471
|
const auto = uid(), id = props.id || auto;
|
|
10242
10472
|
const step = props.step || 1;
|
|
@@ -10247,7 +10477,7 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10247
10477
|
props.onChange
|
|
10248
10478
|
);
|
|
10249
10479
|
const value = st[0], setValue = st[1];
|
|
10250
|
-
const draftState =
|
|
10480
|
+
const draftState = React67.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10251
10481
|
function fmt2(n3) {
|
|
10252
10482
|
if (n3 == null || isNaN(n3)) return "";
|
|
10253
10483
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10296,7 +10526,7 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10296
10526
|
};
|
|
10297
10527
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10298
10528
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10299
|
-
return /* @__PURE__ */
|
|
10529
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10300
10530
|
Field,
|
|
10301
10531
|
{
|
|
10302
10532
|
id,
|
|
@@ -10308,7 +10538,7 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10308
10538
|
disabled: props.disabled,
|
|
10309
10539
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10310
10540
|
},
|
|
10311
|
-
/* @__PURE__ */
|
|
10541
|
+
/* @__PURE__ */ React67.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React67.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React67.createElement(
|
|
10312
10542
|
"input",
|
|
10313
10543
|
{
|
|
10314
10544
|
ref,
|
|
@@ -10355,7 +10585,7 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10355
10585
|
},
|
|
10356
10586
|
onKeyDown
|
|
10357
10587
|
}
|
|
10358
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10588
|
+
), props.suffix != null ? /* @__PURE__ */ React67.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React67.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React67.createElement(
|
|
10359
10589
|
"button",
|
|
10360
10590
|
{
|
|
10361
10591
|
type: "button",
|
|
@@ -10371,8 +10601,8 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10371
10601
|
nudge(-step);
|
|
10372
10602
|
}
|
|
10373
10603
|
},
|
|
10374
|
-
/* @__PURE__ */
|
|
10375
|
-
), /* @__PURE__ */
|
|
10604
|
+
/* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconMinus, null) })
|
|
10605
|
+
), /* @__PURE__ */ React67.createElement(
|
|
10376
10606
|
"button",
|
|
10377
10607
|
{
|
|
10378
10608
|
type: "button",
|
|
@@ -10388,14 +10618,14 @@ var NumberField = React66.forwardRef(function NumberField2(props, ref) {
|
|
|
10388
10618
|
nudge(step);
|
|
10389
10619
|
}
|
|
10390
10620
|
},
|
|
10391
|
-
/* @__PURE__ */
|
|
10621
|
+
/* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconPlus, null) })
|
|
10392
10622
|
)) : null)
|
|
10393
10623
|
);
|
|
10394
10624
|
});
|
|
10395
10625
|
|
|
10396
10626
|
// src/Stepper.tsx
|
|
10397
|
-
var
|
|
10398
|
-
var Stepper =
|
|
10627
|
+
var React68 = __toESM(require("react"), 1);
|
|
10628
|
+
var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
10399
10629
|
const t = useStrings();
|
|
10400
10630
|
const idBase = uid();
|
|
10401
10631
|
const steps = props.steps || [];
|
|
@@ -10406,22 +10636,22 @@ var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
|
10406
10636
|
if (at < 0) at = 0;
|
|
10407
10637
|
const vertical = props.orientation === "vertical";
|
|
10408
10638
|
const cur2 = steps[at];
|
|
10409
|
-
return /* @__PURE__ */
|
|
10639
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10410
10640
|
"nav",
|
|
10411
10641
|
{
|
|
10412
10642
|
ref,
|
|
10413
10643
|
"aria-label": props.label,
|
|
10414
10644
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10415
10645
|
},
|
|
10416
|
-
/* @__PURE__ */
|
|
10646
|
+
/* @__PURE__ */ React68.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10417
10647
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10418
10648
|
const error = s.status === "error";
|
|
10419
|
-
const marker = /* @__PURE__ */
|
|
10649
|
+
const marker = /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconCheck, null) }) : i + 1);
|
|
10420
10650
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10421
10651
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10422
10652
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10423
10653
|
const descId = idBase + "-step-" + i;
|
|
10424
|
-
const text2 = /* @__PURE__ */
|
|
10654
|
+
const text2 = /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React68.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React68.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React68.createElement(
|
|
10425
10655
|
"span",
|
|
10426
10656
|
{
|
|
10427
10657
|
className: "aura-stepper__desc",
|
|
@@ -10430,14 +10660,14 @@ var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
|
10430
10660
|
},
|
|
10431
10661
|
s.description
|
|
10432
10662
|
) : null);
|
|
10433
|
-
return /* @__PURE__ */
|
|
10663
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10434
10664
|
"li",
|
|
10435
10665
|
{
|
|
10436
10666
|
key: s.id,
|
|
10437
10667
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10438
10668
|
"aria-current": state === "current" ? "step" : void 0
|
|
10439
10669
|
},
|
|
10440
|
-
clickable ? /* @__PURE__ */
|
|
10670
|
+
clickable ? /* @__PURE__ */ React68.createElement(
|
|
10441
10671
|
"button",
|
|
10442
10672
|
{
|
|
10443
10673
|
type: "button",
|
|
@@ -10449,19 +10679,19 @@ var Stepper = React67.forwardRef(function Stepper2(props, ref) {
|
|
|
10449
10679
|
},
|
|
10450
10680
|
marker,
|
|
10451
10681
|
text2
|
|
10452
|
-
) : /* @__PURE__ */
|
|
10682
|
+
) : /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10453
10683
|
);
|
|
10454
10684
|
})),
|
|
10455
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10685
|
+
!vertical && cur2 ? /* @__PURE__ */ React68.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React68.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10456
10686
|
);
|
|
10457
10687
|
});
|
|
10458
10688
|
|
|
10459
10689
|
// src/SegmentedControl.tsx
|
|
10460
|
-
var
|
|
10690
|
+
var React69 = __toESM(require("react"), 1);
|
|
10461
10691
|
function toOpt2(o) {
|
|
10462
10692
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10463
10693
|
}
|
|
10464
|
-
var SegmentedControl =
|
|
10694
|
+
var SegmentedControl = React69.forwardRef(
|
|
10465
10695
|
function SegmentedControl2(props, ref) {
|
|
10466
10696
|
const options = (props.options || []).map(toOpt2);
|
|
10467
10697
|
useAutoTip();
|
|
@@ -10475,7 +10705,7 @@ var SegmentedControl = React68.forwardRef(
|
|
|
10475
10705
|
);
|
|
10476
10706
|
const value = st[0], setValue = st[1];
|
|
10477
10707
|
const auto = uid(), id = props.id || auto;
|
|
10478
|
-
const refs =
|
|
10708
|
+
const refs = React69.useRef([]);
|
|
10479
10709
|
const selIdx = options.findIndex(function(o) {
|
|
10480
10710
|
return o.value === value;
|
|
10481
10711
|
});
|
|
@@ -10508,7 +10738,7 @@ var SegmentedControl = React68.forwardRef(
|
|
|
10508
10738
|
move(options.length, -1);
|
|
10509
10739
|
}
|
|
10510
10740
|
}
|
|
10511
|
-
return /* @__PURE__ */
|
|
10741
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10512
10742
|
"div",
|
|
10513
10743
|
{
|
|
10514
10744
|
ref,
|
|
@@ -10528,7 +10758,7 @@ var SegmentedControl = React68.forwardRef(
|
|
|
10528
10758
|
options.map(function(o, i) {
|
|
10529
10759
|
const on = o.value === value;
|
|
10530
10760
|
const off = props.disabled || o.disabled;
|
|
10531
|
-
return /* @__PURE__ */
|
|
10761
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10532
10762
|
"button",
|
|
10533
10763
|
{
|
|
10534
10764
|
key: o.value,
|
|
@@ -10550,8 +10780,8 @@ var SegmentedControl = React68.forwardRef(
|
|
|
10550
10780
|
onKeyDown(e, i);
|
|
10551
10781
|
}
|
|
10552
10782
|
},
|
|
10553
|
-
o.icon ? /* @__PURE__ */
|
|
10554
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10783
|
+
o.icon ? /* @__PURE__ */ React69.createElement(Icon, { name: o.icon }) : null,
|
|
10784
|
+
o.iconOnly ? null : /* @__PURE__ */ React69.createElement("span", null, o.label)
|
|
10555
10785
|
);
|
|
10556
10786
|
})
|
|
10557
10787
|
);
|