@jirawatpyk/aura-react 5.68.0 → 5.70.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 +14 -0
- package/dist/aura.bundle.js +421 -145
- package/dist/cjs/index.cjs +420 -144
- package/dist/esm/ActionBar.js +47 -1
- package/dist/esm/Button.js +9 -3
- package/dist/esm/FileUpload.js +108 -1
- package/dist/esm/IconButton.js +5 -0
- package/dist/esm/PageHeaderClient.js +1 -9
- package/dist/esm/Pagination.js +49 -1
- package/dist/esm/Spinner.js +9 -0
- package/dist/esm/Table.js +38 -3
- package/dist/esm/display.js +24 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/internal.js +9 -0
- package/dist/esm/strings.js +1 -0
- package/dist/esm/strings.sv.js +1 -0
- package/dist/esm/strings.th.js +1 -0
- package/dist/index.d.cts +84 -3
- package/dist/index.d.ts +84 -3
- package/dist/locales/sv.cjs +1 -0
- package/dist/locales/sv.d.cts +2 -0
- package/dist/locales/sv.d.ts +2 -0
- package/dist/locales/th.cjs +1 -0
- package/dist/locales/th.d.cts +2 -0
- package/dist/locales/th.d.ts +2 -0
- package/dist/server/index.cjs +28 -2
- package/dist/server/index.d.cts +18 -0
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.js +28 -2
- package/dist/styles.css +49 -0
- package/dist/styles.layer.css +49 -0
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
1
|
+
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Spinner"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -101,6 +101,7 @@ window.Aura = (() => {
|
|
|
101
101
|
SideNav: () => SideNav,
|
|
102
102
|
Skeleton: () => Skeleton,
|
|
103
103
|
Sparkline: () => Sparkline,
|
|
104
|
+
Spinner: () => Spinner,
|
|
104
105
|
Stack: () => Stack,
|
|
105
106
|
Stat: () => Stat,
|
|
106
107
|
StatusPill: () => StatusPill,
|
|
@@ -409,6 +410,14 @@ window.Aura = (() => {
|
|
|
409
410
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
410
411
|
}
|
|
411
412
|
var FilterSheet = React3.createContext(false);
|
|
413
|
+
function fixedTrapped(el) {
|
|
414
|
+
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
415
|
+
const s = getComputedStyle(p);
|
|
416
|
+
if (s.transform !== "none" || s.filter !== "none" || (s.backdropFilter || "none") !== "none" || s.contentVisibility === "auto" || s.perspective !== "none" || /transform|filter|perspective/.test(s.willChange) || /paint|layout|strict|content/.test(s.contain))
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
412
421
|
|
|
413
422
|
// src/display.tsx
|
|
414
423
|
var React4 = __toESM(require_react(), 1);
|
|
@@ -482,6 +491,11 @@ window.Aura = (() => {
|
|
|
482
491
|
["circle", { cx: "19", cy: "12", r: "1" }],
|
|
483
492
|
["circle", { cx: "5", cy: "12", r: "1" }]
|
|
484
493
|
]);
|
|
494
|
+
var IconUpload = /* @__PURE__ */ defineIcon("upload", [
|
|
495
|
+
["path", { d: "M12 3v12" }],
|
|
496
|
+
["path", { d: "m17 8-5-5-5 5" }],
|
|
497
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]
|
|
498
|
+
]);
|
|
485
499
|
var IconCalendar = /* @__PURE__ */ defineIcon("calendar", [
|
|
486
500
|
["path", { d: "M8 2v3" }],
|
|
487
501
|
["path", { d: "M16 2v3" }],
|
|
@@ -731,7 +745,7 @@ window.Aura = (() => {
|
|
|
731
745
|
};
|
|
732
746
|
function statusPillElement(props, ref) {
|
|
733
747
|
const tone2 = props.tone || toneFor(props.children);
|
|
734
|
-
const rest = omit(props, ["tone", "className", "children", "wrap"]);
|
|
748
|
+
const rest = omit(props, ["tone", "className", "children", "wrap", "busy"]);
|
|
735
749
|
return /* @__PURE__ */ React4.createElement(
|
|
736
750
|
"span",
|
|
737
751
|
{
|
|
@@ -739,10 +753,26 @@ window.Aura = (() => {
|
|
|
739
753
|
ref,
|
|
740
754
|
className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
|
|
741
755
|
},
|
|
742
|
-
/* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
|
|
756
|
+
props.busy ? /* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: 12, className: "aura-spin" }) : /* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
|
|
743
757
|
props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
|
|
744
758
|
);
|
|
745
759
|
}
|
|
760
|
+
function spinnerElement(props, ref) {
|
|
761
|
+
const rest = omit(props, ["size", "label", "className"]);
|
|
762
|
+
const label = props.label;
|
|
763
|
+
return /* @__PURE__ */ React4.createElement(
|
|
764
|
+
"span",
|
|
765
|
+
{
|
|
766
|
+
...rest,
|
|
767
|
+
ref,
|
|
768
|
+
className: cx("aura-spinner", "aura-spinner--" + (props.size || "md"), props.className),
|
|
769
|
+
role: label ? "status" : void 0,
|
|
770
|
+
"aria-hidden": label ? void 0 : true
|
|
771
|
+
},
|
|
772
|
+
/* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: props.size || "md", className: "aura-spin" }),
|
|
773
|
+
label ? /* @__PURE__ */ React4.createElement("span", { className: "aura-sr-only" }, label) : null
|
|
774
|
+
);
|
|
775
|
+
}
|
|
746
776
|
function badgeElement(props, ref) {
|
|
747
777
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
748
778
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -1031,6 +1061,7 @@ window.Aura = (() => {
|
|
|
1031
1061
|
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
1032
1062
|
opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
|
|
1033
1063
|
required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
|
|
1064
|
+
firstPage: "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",
|
|
1034
1065
|
filtersApplied: function(n3) {
|
|
1035
1066
|
return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
|
|
1036
1067
|
},
|
|
@@ -1173,6 +1204,7 @@ window.Aura = (() => {
|
|
|
1173
1204
|
statusUnknown: "Ingen data",
|
|
1174
1205
|
opensInNewTab: "\xF6ppnas i en ny flik",
|
|
1175
1206
|
required: "obligatoriskt",
|
|
1207
|
+
firstPage: "F\xF6rsta sidan",
|
|
1176
1208
|
filtersApplied: function(n3) {
|
|
1177
1209
|
return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
|
|
1178
1210
|
},
|
|
@@ -1316,6 +1348,7 @@ window.Aura = (() => {
|
|
|
1316
1348
|
statusUnknown: "No data",
|
|
1317
1349
|
opensInNewTab: "opens in a new tab",
|
|
1318
1350
|
required: "required",
|
|
1351
|
+
firstPage: "First page",
|
|
1319
1352
|
filtersApplied: function(n3) {
|
|
1320
1353
|
return "Filters, " + n3.toLocaleString("en") + " applied";
|
|
1321
1354
|
},
|
|
@@ -1376,6 +1409,8 @@ window.Aura = (() => {
|
|
|
1376
1409
|
function ButtonLink(props, ref, Link) {
|
|
1377
1410
|
const variant = props.variant || "primary";
|
|
1378
1411
|
const disabled = !!props.disabled;
|
|
1412
|
+
const ad = props["aria-disabled"];
|
|
1413
|
+
const gated = !disabled && (ad === true || ad === "true");
|
|
1379
1414
|
const rest = omit(props, [
|
|
1380
1415
|
"variant",
|
|
1381
1416
|
"className",
|
|
@@ -1397,7 +1432,7 @@ window.Aura = (() => {
|
|
|
1397
1432
|
ref,
|
|
1398
1433
|
href: disabled ? void 0 : props.href,
|
|
1399
1434
|
role: disabled ? "link" : void 0,
|
|
1400
|
-
"aria-disabled": disabled || void 0,
|
|
1435
|
+
"aria-disabled": disabled || gated || void 0,
|
|
1401
1436
|
tabIndex: disabled ? -1 : props.tabIndex,
|
|
1402
1437
|
className: buttonClass({
|
|
1403
1438
|
variant,
|
|
@@ -1406,7 +1441,9 @@ window.Aura = (() => {
|
|
|
1406
1441
|
touchHeight: props.touchHeight,
|
|
1407
1442
|
className: props.className
|
|
1408
1443
|
}),
|
|
1409
|
-
onClick: disabled ? void 0 :
|
|
1444
|
+
onClick: disabled ? void 0 : gated ? function(e) {
|
|
1445
|
+
e.preventDefault();
|
|
1446
|
+
} : props.onClick
|
|
1410
1447
|
},
|
|
1411
1448
|
props.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: props.icon }) : null,
|
|
1412
1449
|
props.children,
|
|
@@ -1424,6 +1461,8 @@ window.Aura = (() => {
|
|
|
1424
1461
|
const loading = !!props.loading;
|
|
1425
1462
|
const ad = props["aria-disabled"];
|
|
1426
1463
|
const blocked = loading || ad === true || ad === "true";
|
|
1464
|
+
const ab = props["aria-busy"];
|
|
1465
|
+
const busy = loading || ab === true || ab === "true";
|
|
1427
1466
|
const rest = omit(props, [
|
|
1428
1467
|
"variant",
|
|
1429
1468
|
"className",
|
|
@@ -1451,7 +1490,7 @@ window.Aura = (() => {
|
|
|
1451
1490
|
loading,
|
|
1452
1491
|
className: props.className
|
|
1453
1492
|
}),
|
|
1454
|
-
"aria-busy":
|
|
1493
|
+
"aria-busy": busy || void 0,
|
|
1455
1494
|
"aria-disabled": blocked || void 0,
|
|
1456
1495
|
onClick: blocked ? function(e) {
|
|
1457
1496
|
e.preventDefault();
|
|
@@ -1656,6 +1695,8 @@ window.Aura = (() => {
|
|
|
1656
1695
|
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
|
|
1657
1696
|
useAutoTip();
|
|
1658
1697
|
const own = props.title !== void 0;
|
|
1698
|
+
const ad = props["aria-disabled"];
|
|
1699
|
+
const blocked = ad === true || ad === "true";
|
|
1659
1700
|
return /* @__PURE__ */ React8.createElement(
|
|
1660
1701
|
"button",
|
|
1661
1702
|
{
|
|
@@ -1665,6 +1706,9 @@ window.Aura = (() => {
|
|
|
1665
1706
|
"aria-label": props.label,
|
|
1666
1707
|
"aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
|
|
1667
1708
|
"data-aura-tip": own ? void 0 : props.label,
|
|
1709
|
+
onClick: blocked ? function(e) {
|
|
1710
|
+
e.preventDefault();
|
|
1711
|
+
} : props.onClick,
|
|
1668
1712
|
className: cx(
|
|
1669
1713
|
"aura-icon-btn",
|
|
1670
1714
|
props.tone === "danger" && "aura-icon-btn--danger",
|
|
@@ -8113,14 +8157,6 @@ window.Aura = (() => {
|
|
|
8113
8157
|
// src/PageHeaderClient.tsx
|
|
8114
8158
|
var NAME = "--aura-page-actions-height";
|
|
8115
8159
|
var bars = [];
|
|
8116
|
-
function trapped(el) {
|
|
8117
|
-
for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
|
|
8118
|
-
const s = getComputedStyle(p);
|
|
8119
|
-
if (s.transform !== "none" || s.filter !== "none" || (s.backdropFilter || "none") !== "none" || s.contentVisibility === "auto" || s.perspective !== "none" || /transform|filter|perspective/.test(s.willChange) || /paint|layout|strict|content/.test(s.contain))
|
|
8120
|
-
return true;
|
|
8121
|
-
}
|
|
8122
|
-
return false;
|
|
8123
|
-
}
|
|
8124
8160
|
var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
|
|
8125
8161
|
const own = React45.useRef(null);
|
|
8126
8162
|
const merged = useMergedRef(ref, own);
|
|
@@ -8137,7 +8173,7 @@ window.Aura = (() => {
|
|
|
8137
8173
|
if (bars[bars.length - 1] !== sync) return;
|
|
8138
8174
|
if (getComputedStyle(el).position === "fixed") {
|
|
8139
8175
|
root.style.setProperty(NAME, el.offsetHeight + "px");
|
|
8140
|
-
if (!checked && (checked = true,
|
|
8176
|
+
if (!checked && (checked = true, fixedTrapped(el)))
|
|
8141
8177
|
devWarnOnce(
|
|
8142
8178
|
"pageheader-bar-trapped",
|
|
8143
8179
|
"PageHeader actionsBarBelow: an ancestor has a transform, filter, will-change or paint containment, so the fixed bar is placed against it instead of the screen. Remove it from the page header's ancestors."
|
|
@@ -8680,6 +8716,17 @@ window.Aura = (() => {
|
|
|
8680
8716
|
|
|
8681
8717
|
// src/ActionBar.tsx
|
|
8682
8718
|
var React50 = __toESM(require_react(), 1);
|
|
8719
|
+
var HEIGHT = "--aura-actionbar-height";
|
|
8720
|
+
var edges = [];
|
|
8721
|
+
function writeHeight() {
|
|
8722
|
+
const root = document.documentElement;
|
|
8723
|
+
for (let i = edges.length - 1; i >= 0; i--)
|
|
8724
|
+
if (getComputedStyle(edges[i]).position === "fixed") {
|
|
8725
|
+
root.style.setProperty(HEIGHT, edges[i].offsetHeight + "px");
|
|
8726
|
+
return;
|
|
8727
|
+
}
|
|
8728
|
+
root.style.removeProperty(HEIGHT);
|
|
8729
|
+
}
|
|
8683
8730
|
var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
|
|
8684
8731
|
const t = useStrings();
|
|
8685
8732
|
const bulk = props.selected != null;
|
|
@@ -8690,6 +8737,40 @@ window.Aura = (() => {
|
|
|
8690
8737
|
});
|
|
8691
8738
|
const cameFrom = React50.useRef(null);
|
|
8692
8739
|
const own = React50.useRef(null);
|
|
8740
|
+
const viewport = (props.position || "viewport") === "viewport";
|
|
8741
|
+
const edge = !viewport ? null : props.look === "edge" ? "all" : props.edgeBelow || null;
|
|
8742
|
+
if (props.look === "edge" && props.edgeBelow && viewport)
|
|
8743
|
+
devWarnOnce(
|
|
8744
|
+
"actionbar-edge-both",
|
|
8745
|
+
'ActionBar: look="edge" draws the edge strip at every width, so edgeBelow does nothing. Pass edgeBelow alone for a strip on a phone and the floating card above it.'
|
|
8746
|
+
);
|
|
8747
|
+
React50.useEffect(
|
|
8748
|
+
function() {
|
|
8749
|
+
const el = own.current;
|
|
8750
|
+
if (!edge || !el) return;
|
|
8751
|
+
let checked = false;
|
|
8752
|
+
function sync() {
|
|
8753
|
+
writeHeight();
|
|
8754
|
+
if (!checked && getComputedStyle(el).position === "fixed" && (checked = true, fixedTrapped(el)))
|
|
8755
|
+
devWarnOnce(
|
|
8756
|
+
"actionbar-edge-trapped",
|
|
8757
|
+
`ActionBar look="edge": an ancestor has a transform, filter, will-change or paint containment, so the fixed strip is placed against it instead of the screen. Remove it from the bar's ancestors.`
|
|
8758
|
+
);
|
|
8759
|
+
}
|
|
8760
|
+
edges.push(el);
|
|
8761
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
8762
|
+
if (ro) ro.observe(el, { box: "border-box" });
|
|
8763
|
+
window.addEventListener("resize", sync);
|
|
8764
|
+
sync();
|
|
8765
|
+
return function() {
|
|
8766
|
+
if (ro) ro.disconnect();
|
|
8767
|
+
window.removeEventListener("resize", sync);
|
|
8768
|
+
edges.splice(edges.indexOf(el), 1);
|
|
8769
|
+
writeHeight();
|
|
8770
|
+
};
|
|
8771
|
+
},
|
|
8772
|
+
[edge, idle]
|
|
8773
|
+
);
|
|
8693
8774
|
function clear() {
|
|
8694
8775
|
props.onClearSelection();
|
|
8695
8776
|
setTimeout(function() {
|
|
@@ -8716,6 +8797,7 @@ window.Aura = (() => {
|
|
|
8716
8797
|
className: cx(
|
|
8717
8798
|
"aura-actionbar",
|
|
8718
8799
|
"aura-actionbar--" + (props.position || "viewport"),
|
|
8800
|
+
edge && (edge === "all" ? "aura-actionbar--edge" : "aura-actionbar--edge-below-" + edge),
|
|
8719
8801
|
idle && "is-idle",
|
|
8720
8802
|
props.className
|
|
8721
8803
|
)
|
|
@@ -9145,8 +9227,39 @@ window.Aura = (() => {
|
|
|
9145
9227
|
);
|
|
9146
9228
|
}
|
|
9147
9229
|
var Th = React53.forwardRef(function Th2(props, ref) {
|
|
9148
|
-
const {
|
|
9230
|
+
const {
|
|
9231
|
+
align,
|
|
9232
|
+
numeric,
|
|
9233
|
+
mono,
|
|
9234
|
+
className,
|
|
9235
|
+
scope,
|
|
9236
|
+
label,
|
|
9237
|
+
card,
|
|
9238
|
+
skeleton,
|
|
9239
|
+
skeletonWidth,
|
|
9240
|
+
wrap,
|
|
9241
|
+
sort,
|
|
9242
|
+
onSort,
|
|
9243
|
+
sortHref,
|
|
9244
|
+
linkComponent,
|
|
9245
|
+
...rest
|
|
9246
|
+
} = props;
|
|
9149
9247
|
const stacked = React53.useContext(StackLabels) != null;
|
|
9248
|
+
const Link = useLinkComponent(linkComponent);
|
|
9249
|
+
const sortable = !!onSort || sortHref != null;
|
|
9250
|
+
const ariaSort = sort || (sortable ? "none" : void 0);
|
|
9251
|
+
let children = props.children;
|
|
9252
|
+
if (sortable) {
|
|
9253
|
+
const icon = /* @__PURE__ */ React53.createElement(
|
|
9254
|
+
Icon,
|
|
9255
|
+
{
|
|
9256
|
+
name: sort === "ascending" ? /* @__PURE__ */ React53.createElement(IconArrowUp, null) : sort === "descending" ? /* @__PURE__ */ React53.createElement(IconArrowDown, null) : /* @__PURE__ */ React53.createElement(IconArrowUpDown, null),
|
|
9257
|
+
size: 12
|
|
9258
|
+
}
|
|
9259
|
+
);
|
|
9260
|
+
const cls = cx("aura-table__sort", sort && sort !== "none" && "is-active");
|
|
9261
|
+
children = sortHref != null ? /* @__PURE__ */ React53.createElement(Link, { href: sortHref, className: cls }, props.children, icon) : /* @__PURE__ */ React53.createElement("button", { type: "button", className: cls, onClick: onSort }, props.children, icon);
|
|
9262
|
+
}
|
|
9150
9263
|
return /* @__PURE__ */ React53.createElement(
|
|
9151
9264
|
"th",
|
|
9152
9265
|
{
|
|
@@ -9155,8 +9268,10 @@ window.Aura = (() => {
|
|
|
9155
9268
|
className: cellClass("aura-tbl__th", props),
|
|
9156
9269
|
role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
|
|
9157
9270
|
"data-card": stacked && (card === "title" || card === "action") ? card : void 0,
|
|
9271
|
+
"aria-sort": ariaSort,
|
|
9158
9272
|
...rest
|
|
9159
|
-
}
|
|
9273
|
+
},
|
|
9274
|
+
children
|
|
9160
9275
|
);
|
|
9161
9276
|
});
|
|
9162
9277
|
var Td = React53.forwardRef(function Td2(props, ref) {
|
|
@@ -9622,7 +9737,59 @@ window.Aura = (() => {
|
|
|
9622
9737
|
});
|
|
9623
9738
|
|
|
9624
9739
|
// src/FileUpload.tsx
|
|
9740
|
+
var React59 = __toESM(require_react(), 1);
|
|
9741
|
+
|
|
9742
|
+
// src/Progress.tsx
|
|
9625
9743
|
var React58 = __toESM(require_react(), 1);
|
|
9744
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9745
|
+
const t = useStrings();
|
|
9746
|
+
const auto = uid(), id = props.id || auto;
|
|
9747
|
+
const max = props.max || 100, det = props.value != null;
|
|
9748
|
+
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
9749
|
+
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
9750
|
+
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9751
|
+
const keyed = !!props.legend && spct > 0;
|
|
9752
|
+
const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9753
|
+
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9754
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9755
|
+
"div",
|
|
9756
|
+
{
|
|
9757
|
+
ref,
|
|
9758
|
+
className: cx(
|
|
9759
|
+
"aura-progress",
|
|
9760
|
+
"aura-progress--" + tone(props.tone || "accent"),
|
|
9761
|
+
props.size === "sm" && "is-sm",
|
|
9762
|
+
props.className
|
|
9763
|
+
)
|
|
9764
|
+
},
|
|
9765
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React58.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9766
|
+
/* @__PURE__ */ React58.createElement(
|
|
9767
|
+
"div",
|
|
9768
|
+
{
|
|
9769
|
+
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
9770
|
+
role: "progressbar",
|
|
9771
|
+
"aria-labelledby": props.label ? id + "-label" : void 0,
|
|
9772
|
+
"aria-label": props.label ? void 0 : props["aria-label"],
|
|
9773
|
+
"aria-valuemin": det ? 0 : void 0,
|
|
9774
|
+
"aria-valuemax": det ? max : void 0,
|
|
9775
|
+
"aria-valuenow": det ? props.value : void 0,
|
|
9776
|
+
"aria-valuetext": det ? valueText : void 0
|
|
9777
|
+
},
|
|
9778
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9779
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9780
|
+
"span",
|
|
9781
|
+
{
|
|
9782
|
+
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
9783
|
+
style: { left: pct + "%", width: spct + "%" }
|
|
9784
|
+
}
|
|
9785
|
+
) : null
|
|
9786
|
+
),
|
|
9787
|
+
keyed ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
|
|
9788
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9789
|
+
);
|
|
9790
|
+
});
|
|
9791
|
+
|
|
9792
|
+
// src/FileUpload.tsx
|
|
9626
9793
|
function matches(file, accept) {
|
|
9627
9794
|
if (!accept) return true;
|
|
9628
9795
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9646,24 +9813,40 @@ window.Aura = (() => {
|
|
|
9646
9813
|
}).join(", ");
|
|
9647
9814
|
}
|
|
9648
9815
|
var seq = 0;
|
|
9649
|
-
var FileUpload =
|
|
9816
|
+
var FileUpload = React59.forwardRef(function FileUpload2(props, ref) {
|
|
9650
9817
|
const t = useStrings();
|
|
9651
9818
|
const auto = uid(), id = props.id || auto;
|
|
9652
9819
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9653
9820
|
const items2 = st[0] || [];
|
|
9654
|
-
const dragState =
|
|
9655
|
-
const inputRef =
|
|
9656
|
-
const urls =
|
|
9821
|
+
const dragState = React59.useState(false), over = dragState[0];
|
|
9822
|
+
const inputRef = React59.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9823
|
+
const urls = React59.useRef({});
|
|
9657
9824
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9658
9825
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9659
|
-
|
|
9826
|
+
const pickState = React59.useState(null);
|
|
9827
|
+
const buttonRef = React59.useRef(null);
|
|
9828
|
+
const buttonMode = props.variant === "button";
|
|
9829
|
+
React59.useEffect(
|
|
9830
|
+
function() {
|
|
9831
|
+
const el = inputRef.current;
|
|
9832
|
+
if (!buttonMode || !el) return;
|
|
9833
|
+
el.focus = function(o) {
|
|
9834
|
+
if (buttonRef.current) buttonRef.current.focus(o);
|
|
9835
|
+
};
|
|
9836
|
+
return function() {
|
|
9837
|
+
delete el.focus;
|
|
9838
|
+
};
|
|
9839
|
+
},
|
|
9840
|
+
[buttonMode]
|
|
9841
|
+
);
|
|
9842
|
+
React59.useEffect(function() {
|
|
9660
9843
|
return function() {
|
|
9661
9844
|
Object.keys(urls.current).forEach(function(k) {
|
|
9662
9845
|
URL.revokeObjectURL(urls.current[k]);
|
|
9663
9846
|
});
|
|
9664
9847
|
};
|
|
9665
9848
|
}, []);
|
|
9666
|
-
|
|
9849
|
+
React59.useEffect(
|
|
9667
9850
|
function() {
|
|
9668
9851
|
const el = inputRef.current;
|
|
9669
9852
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9723,7 +9906,96 @@ window.Aura = (() => {
|
|
|
9723
9906
|
if (inputRef.current) inputRef.current.focus();
|
|
9724
9907
|
}
|
|
9725
9908
|
const error = props.error;
|
|
9726
|
-
|
|
9909
|
+
if (props.variant === "button") {
|
|
9910
|
+
const err = error || pickState[0];
|
|
9911
|
+
const desc = [err ? id + "-error" : props.hint ? id + "-hint" : null, note ? id + "-note" : null].filter(Boolean).join(" ") || void 0;
|
|
9912
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9913
|
+
Field,
|
|
9914
|
+
{
|
|
9915
|
+
id,
|
|
9916
|
+
label: props.label,
|
|
9917
|
+
labelAs: "span",
|
|
9918
|
+
labelId: id + "-label",
|
|
9919
|
+
hint: props.hint,
|
|
9920
|
+
error: err,
|
|
9921
|
+
required: props.required,
|
|
9922
|
+
optional: props.optional,
|
|
9923
|
+
disabled: props.disabled,
|
|
9924
|
+
className: cx("aura-upload-field", props.className)
|
|
9925
|
+
},
|
|
9926
|
+
/* @__PURE__ */ React59.createElement("div", { className: "aura-upload-button" }, /* @__PURE__ */ React59.createElement(
|
|
9927
|
+
Button,
|
|
9928
|
+
{
|
|
9929
|
+
ref: buttonRef,
|
|
9930
|
+
id: id + "-button",
|
|
9931
|
+
variant: "secondary",
|
|
9932
|
+
icon: /* @__PURE__ */ React59.createElement(IconUpload, null),
|
|
9933
|
+
touchHeight: props.touchHeight,
|
|
9934
|
+
disabled: props.disabled,
|
|
9935
|
+
"aria-labelledby": props.label ? id + "-label " + id + "-button" : void 0,
|
|
9936
|
+
"aria-describedby": desc,
|
|
9937
|
+
onClick: function() {
|
|
9938
|
+
if (inputRef.current) inputRef.current.click();
|
|
9939
|
+
}
|
|
9940
|
+
},
|
|
9941
|
+
props.buttonLabel != null ? props.buttonLabel : props.multiple ? t.browse : t.browseOne
|
|
9942
|
+
), /* @__PURE__ */ React59.createElement(
|
|
9943
|
+
"input",
|
|
9944
|
+
{
|
|
9945
|
+
ref: inputMerged,
|
|
9946
|
+
id,
|
|
9947
|
+
type: "file",
|
|
9948
|
+
className: "aura-upload__input",
|
|
9949
|
+
tabIndex: -1,
|
|
9950
|
+
"aria-hidden": true,
|
|
9951
|
+
accept: props.accept,
|
|
9952
|
+
multiple: !!props.multiple,
|
|
9953
|
+
disabled: props.disabled,
|
|
9954
|
+
name: props.name,
|
|
9955
|
+
required: props.name ? props.required : void 0,
|
|
9956
|
+
onInvalid: function(e) {
|
|
9957
|
+
e.preventDefault();
|
|
9958
|
+
pickState[1](props.multiple ? t.browse : t.browseOne);
|
|
9959
|
+
if (buttonRef.current) buttonRef.current.focus();
|
|
9960
|
+
},
|
|
9961
|
+
onChange: function(e) {
|
|
9962
|
+
const files = Array.prototype.slice.call(e.target.files || []);
|
|
9963
|
+
if (!files.length) return;
|
|
9964
|
+
let refused = null;
|
|
9965
|
+
const ok = files.filter(function(f) {
|
|
9966
|
+
const why = !matches(f, props.accept) ? t.fileWrongType : props.maxSize && f.size > props.maxSize ? t.fileTooBig(formatBytes(props.maxSize)) : null;
|
|
9967
|
+
if (why && !refused) refused = why;
|
|
9968
|
+
return !why;
|
|
9969
|
+
});
|
|
9970
|
+
pickState[1](refused);
|
|
9971
|
+
if (!props.name) e.target.value = "";
|
|
9972
|
+
else if (refused) {
|
|
9973
|
+
try {
|
|
9974
|
+
const dt = new DataTransfer();
|
|
9975
|
+
ok.forEach(function(f) {
|
|
9976
|
+
dt.items.add(f);
|
|
9977
|
+
});
|
|
9978
|
+
e.target.files = dt.files;
|
|
9979
|
+
} catch (x) {
|
|
9980
|
+
e.target.value = "";
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
9983
|
+
if (ok.length && props.onSelect) props.onSelect(ok);
|
|
9984
|
+
}
|
|
9985
|
+
}
|
|
9986
|
+
), note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null),
|
|
9987
|
+
props.progress !== void 0 ? /* @__PURE__ */ React59.createElement(
|
|
9988
|
+
Progress,
|
|
9989
|
+
{
|
|
9990
|
+
className: "aura-upload-button__progress",
|
|
9991
|
+
size: "sm",
|
|
9992
|
+
value: props.progress == null ? void 0 : props.progress,
|
|
9993
|
+
label: t.uploading
|
|
9994
|
+
}
|
|
9995
|
+
) : null
|
|
9996
|
+
);
|
|
9997
|
+
}
|
|
9998
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9727
9999
|
Field,
|
|
9728
10000
|
{
|
|
9729
10001
|
id,
|
|
@@ -9735,7 +10007,7 @@ window.Aura = (() => {
|
|
|
9735
10007
|
disabled: props.disabled,
|
|
9736
10008
|
className: props.className
|
|
9737
10009
|
},
|
|
9738
|
-
/* @__PURE__ */
|
|
10010
|
+
/* @__PURE__ */ React59.createElement(
|
|
9739
10011
|
"div",
|
|
9740
10012
|
{
|
|
9741
10013
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9756,9 +10028,9 @@ window.Aura = (() => {
|
|
|
9756
10028
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9757
10029
|
}
|
|
9758
10030
|
},
|
|
9759
|
-
/* @__PURE__ */
|
|
9760
|
-
/* @__PURE__ */
|
|
9761
|
-
/* @__PURE__ */
|
|
10031
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
10032
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
10033
|
+
/* @__PURE__ */ React59.createElement(
|
|
9762
10034
|
"input",
|
|
9763
10035
|
{
|
|
9764
10036
|
ref: inputMerged,
|
|
@@ -9780,12 +10052,12 @@ window.Aura = (() => {
|
|
|
9780
10052
|
}
|
|
9781
10053
|
}
|
|
9782
10054
|
),
|
|
9783
|
-
/* @__PURE__ */
|
|
9784
|
-
note ? /* @__PURE__ */
|
|
10055
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
10056
|
+
note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9785
10057
|
),
|
|
9786
|
-
items2.length ? /* @__PURE__ */
|
|
10058
|
+
items2.length ? /* @__PURE__ */ React59.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9787
10059
|
const src = thumb(it);
|
|
9788
|
-
return /* @__PURE__ */
|
|
10060
|
+
return /* @__PURE__ */ React59.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React59.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React59.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React59.createElement(IconImage, null) : /* @__PURE__ */ React59.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React59.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React59.createElement(
|
|
9789
10061
|
"span",
|
|
9790
10062
|
{
|
|
9791
10063
|
className: "aura-upload__bar",
|
|
@@ -9795,11 +10067,11 @@ window.Aura = (() => {
|
|
|
9795
10067
|
"aria-valuemax": 100,
|
|
9796
10068
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9797
10069
|
},
|
|
9798
|
-
/* @__PURE__ */
|
|
9799
|
-
) : null), /* @__PURE__ */
|
|
10070
|
+
/* @__PURE__ */ React59.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
10071
|
+
) : null), /* @__PURE__ */ React59.createElement(
|
|
9800
10072
|
IconButton,
|
|
9801
10073
|
{
|
|
9802
|
-
icon: /* @__PURE__ */
|
|
10074
|
+
icon: /* @__PURE__ */ React59.createElement(IconX, null),
|
|
9803
10075
|
label: t.remove(it.name),
|
|
9804
10076
|
onClick: function() {
|
|
9805
10077
|
remove(it);
|
|
@@ -10115,9 +10387,9 @@ window.Aura = (() => {
|
|
|
10115
10387
|
}
|
|
10116
10388
|
|
|
10117
10389
|
// src/ThemeStyle.tsx
|
|
10118
|
-
var
|
|
10390
|
+
var React60 = __toESM(require_react(), 1);
|
|
10119
10391
|
function ThemeStyle(props) {
|
|
10120
|
-
const css =
|
|
10392
|
+
const css = React60.useMemo(
|
|
10121
10393
|
function() {
|
|
10122
10394
|
try {
|
|
10123
10395
|
return createTheme({
|
|
@@ -10134,11 +10406,11 @@ window.Aura = (() => {
|
|
|
10134
10406
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
10135
10407
|
);
|
|
10136
10408
|
if (css === null) return null;
|
|
10137
|
-
return /* @__PURE__ */
|
|
10409
|
+
return /* @__PURE__ */ React60.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
10138
10410
|
}
|
|
10139
10411
|
|
|
10140
10412
|
// src/colorScheme.tsx
|
|
10141
|
-
var
|
|
10413
|
+
var React61 = __toESM(require_react(), 1);
|
|
10142
10414
|
|
|
10143
10415
|
// src/colorSchemeScript.ts
|
|
10144
10416
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -10155,7 +10427,7 @@ window.Aura = (() => {
|
|
|
10155
10427
|
|
|
10156
10428
|
// src/colorScheme.tsx
|
|
10157
10429
|
function ColorSchemeScript(props) {
|
|
10158
|
-
return /* @__PURE__ */
|
|
10430
|
+
return /* @__PURE__ */ React61.createElement(
|
|
10159
10431
|
"script",
|
|
10160
10432
|
{
|
|
10161
10433
|
"data-aura-color-scheme": "",
|
|
@@ -10180,7 +10452,7 @@ window.Aura = (() => {
|
|
|
10180
10452
|
function useColorScheme(options) {
|
|
10181
10453
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
10182
10454
|
const fallback = options && options.defaultScheme || "system";
|
|
10183
|
-
const subscribe2 =
|
|
10455
|
+
const subscribe2 = React61.useCallback(
|
|
10184
10456
|
function(cb) {
|
|
10185
10457
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
10186
10458
|
function onSystem() {
|
|
@@ -10202,7 +10474,7 @@ window.Aura = (() => {
|
|
|
10202
10474
|
},
|
|
10203
10475
|
[fallback, key]
|
|
10204
10476
|
);
|
|
10205
|
-
const snapshot =
|
|
10477
|
+
const snapshot = React61.useSyncExternalStore(
|
|
10206
10478
|
subscribe2,
|
|
10207
10479
|
function() {
|
|
10208
10480
|
const s = readScheme(fallback);
|
|
@@ -10213,7 +10485,7 @@ window.Aura = (() => {
|
|
|
10213
10485
|
}
|
|
10214
10486
|
);
|
|
10215
10487
|
const parts = snapshot.split("|");
|
|
10216
|
-
const setScheme =
|
|
10488
|
+
const setScheme = React61.useCallback(
|
|
10217
10489
|
function(next) {
|
|
10218
10490
|
if (!valid(next)) return;
|
|
10219
10491
|
try {
|
|
@@ -10232,14 +10504,14 @@ window.Aura = (() => {
|
|
|
10232
10504
|
const cs = useColorScheme(props);
|
|
10233
10505
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
10234
10506
|
const label = props.label || t.colorScheme;
|
|
10235
|
-
return /* @__PURE__ */
|
|
10507
|
+
return /* @__PURE__ */ React61.createElement(
|
|
10236
10508
|
DropdownMenu,
|
|
10237
10509
|
{
|
|
10238
10510
|
label,
|
|
10239
|
-
trigger: /* @__PURE__ */
|
|
10511
|
+
trigger: /* @__PURE__ */ React61.createElement(
|
|
10240
10512
|
IconButton,
|
|
10241
10513
|
{
|
|
10242
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10514
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React61.createElement(IconMoon, null) : /* @__PURE__ */ React61.createElement(IconSun, null),
|
|
10243
10515
|
label: label + ": " + names[cs.scheme]
|
|
10244
10516
|
}
|
|
10245
10517
|
),
|
|
@@ -10257,59 +10529,9 @@ window.Aura = (() => {
|
|
|
10257
10529
|
}
|
|
10258
10530
|
|
|
10259
10531
|
// src/Badge.tsx
|
|
10260
|
-
var React61 = __toESM(require_react(), 1);
|
|
10261
|
-
var Badge = React61.forwardRef(function Badge2(props, ref) {
|
|
10262
|
-
return badgeElement(props, ref);
|
|
10263
|
-
});
|
|
10264
|
-
|
|
10265
|
-
// src/Progress.tsx
|
|
10266
10532
|
var React62 = __toESM(require_react(), 1);
|
|
10267
|
-
var
|
|
10268
|
-
|
|
10269
|
-
const auto = uid(), id = props.id || auto;
|
|
10270
|
-
const max = props.max || 100, det = props.value != null;
|
|
10271
|
-
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
10272
|
-
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
10273
|
-
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
10274
|
-
const keyed = !!props.legend && spct > 0;
|
|
10275
|
-
const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
10276
|
-
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
10277
|
-
return /* @__PURE__ */ React62.createElement(
|
|
10278
|
-
"div",
|
|
10279
|
-
{
|
|
10280
|
-
ref,
|
|
10281
|
-
className: cx(
|
|
10282
|
-
"aura-progress",
|
|
10283
|
-
"aura-progress--" + tone(props.tone || "accent"),
|
|
10284
|
-
props.size === "sm" && "is-sm",
|
|
10285
|
-
props.className
|
|
10286
|
-
)
|
|
10287
|
-
},
|
|
10288
|
-
props.label || props.showValue && shown ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React62.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
10289
|
-
/* @__PURE__ */ React62.createElement(
|
|
10290
|
-
"div",
|
|
10291
|
-
{
|
|
10292
|
-
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
10293
|
-
role: "progressbar",
|
|
10294
|
-
"aria-labelledby": props.label ? id + "-label" : void 0,
|
|
10295
|
-
"aria-label": props.label ? void 0 : props["aria-label"],
|
|
10296
|
-
"aria-valuemin": det ? 0 : void 0,
|
|
10297
|
-
"aria-valuemax": det ? max : void 0,
|
|
10298
|
-
"aria-valuenow": det ? props.value : void 0,
|
|
10299
|
-
"aria-valuetext": det ? valueText : void 0
|
|
10300
|
-
},
|
|
10301
|
-
/* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10302
|
-
sec ? /* @__PURE__ */ React62.createElement(
|
|
10303
|
-
"span",
|
|
10304
|
-
{
|
|
10305
|
-
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
10306
|
-
style: { left: pct + "%", width: spct + "%" }
|
|
10307
|
-
}
|
|
10308
|
-
) : null
|
|
10309
|
-
),
|
|
10310
|
-
keyed ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
|
|
10311
|
-
props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
10312
|
-
);
|
|
10533
|
+
var Badge = React62.forwardRef(function Badge2(props, ref) {
|
|
10534
|
+
return badgeElement(props, ref);
|
|
10313
10535
|
});
|
|
10314
10536
|
|
|
10315
10537
|
// src/Skeleton.tsx
|
|
@@ -10368,9 +10590,56 @@ window.Aura = (() => {
|
|
|
10368
10590
|
if (count > 1) out.push(count);
|
|
10369
10591
|
return out;
|
|
10370
10592
|
}
|
|
10371
|
-
|
|
10593
|
+
function cursorNav(props, ref, Link, t) {
|
|
10594
|
+
const links = props.firstHref != null || props.previousHref != null || props.nextHref != null;
|
|
10595
|
+
function step(key, href, on, has, label, rel, icon, after) {
|
|
10596
|
+
const body = /* @__PURE__ */ React65.createElement(React65.Fragment, null, icon && !after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null, /* @__PURE__ */ React65.createElement("span", null, label), icon && after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null);
|
|
10597
|
+
const cls = "aura-page aura-page--step";
|
|
10598
|
+
if (has === false || !href && !on)
|
|
10599
|
+
return links ? /* @__PURE__ */ React65.createElement("span", { key, className: cls, role: "link", "aria-disabled": true }, body) : /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, disabled: true }, body);
|
|
10600
|
+
if (href != null)
|
|
10601
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10602
|
+
Link,
|
|
10603
|
+
{
|
|
10604
|
+
key,
|
|
10605
|
+
href,
|
|
10606
|
+
rel,
|
|
10607
|
+
className: cls,
|
|
10608
|
+
onClick: function(e) {
|
|
10609
|
+
if (on && plainClick(e)) {
|
|
10610
|
+
e.preventDefault();
|
|
10611
|
+
on();
|
|
10612
|
+
}
|
|
10613
|
+
}
|
|
10614
|
+
},
|
|
10615
|
+
body
|
|
10616
|
+
);
|
|
10617
|
+
return /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, onClick: on }, body);
|
|
10618
|
+
}
|
|
10619
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10620
|
+
"nav",
|
|
10621
|
+
{
|
|
10622
|
+
ref,
|
|
10623
|
+
className: cx("aura-pagination", "aura-pagination--cursor", props.className),
|
|
10624
|
+
"aria-label": props.label || t.pagination
|
|
10625
|
+
},
|
|
10626
|
+
props.status != null && props.status !== false && props.status !== "" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__status" }, props.status) : null,
|
|
10627
|
+
/* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__steps" }, props.showFirst === false ? null : step("first", props.firstHref, props.onFirst, props.hasFirst, t.firstPage, void 0, null, false), step(
|
|
10628
|
+
"prev",
|
|
10629
|
+
props.previousHref,
|
|
10630
|
+
props.onPrevious,
|
|
10631
|
+
props.hasPrevious,
|
|
10632
|
+
t.prevPage,
|
|
10633
|
+
"prev",
|
|
10634
|
+
/* @__PURE__ */ React65.createElement(IconChevronLeft, null),
|
|
10635
|
+
false
|
|
10636
|
+
), step("next", props.nextHref, props.onNext, props.hasNext, t.nextPage, "next", /* @__PURE__ */ React65.createElement(IconChevronRight, null), true))
|
|
10637
|
+
);
|
|
10638
|
+
}
|
|
10639
|
+
var Pagination = React65.forwardRef(function Pagination2(all, ref) {
|
|
10372
10640
|
const t = useStrings();
|
|
10373
10641
|
useAutoTip();
|
|
10642
|
+
const props = all;
|
|
10374
10643
|
const count = Math.max(1, props.pageCount || 1);
|
|
10375
10644
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
10376
10645
|
const page = Math.min(count, Math.max(1, st[0]));
|
|
@@ -10379,6 +10648,7 @@ window.Aura = (() => {
|
|
|
10379
10648
|
}
|
|
10380
10649
|
const link = props.getHref;
|
|
10381
10650
|
const Link = useLinkComponent(props.linkComponent);
|
|
10651
|
+
if (all.mode === "cursor") return cursorNav(all, ref, Link, t);
|
|
10382
10652
|
function item(p, label, extra) {
|
|
10383
10653
|
const common = Object.assign(
|
|
10384
10654
|
{
|
|
@@ -10449,9 +10719,15 @@ window.Aura = (() => {
|
|
|
10449
10719
|
})), /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React65.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
10450
10720
|
});
|
|
10451
10721
|
|
|
10452
|
-
// src/
|
|
10722
|
+
// src/Spinner.tsx
|
|
10453
10723
|
var React66 = __toESM(require_react(), 1);
|
|
10454
|
-
var
|
|
10724
|
+
var Spinner = React66.forwardRef(function Spinner2(props, ref) {
|
|
10725
|
+
return spinnerElement(props, ref);
|
|
10726
|
+
});
|
|
10727
|
+
|
|
10728
|
+
// src/Accordion.tsx
|
|
10729
|
+
var React67 = __toESM(require_react(), 1);
|
|
10730
|
+
var Accordion = React67.forwardRef(function Accordion2(props, ref) {
|
|
10455
10731
|
const auto = uid(), base = props.id || auto;
|
|
10456
10732
|
const multiple = props.type === "multiple";
|
|
10457
10733
|
const st = useMaybeControlled(
|
|
@@ -10489,9 +10765,9 @@ window.Aura = (() => {
|
|
|
10489
10765
|
n3.focus();
|
|
10490
10766
|
}
|
|
10491
10767
|
}
|
|
10492
|
-
return /* @__PURE__ */
|
|
10768
|
+
return /* @__PURE__ */ React67.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10493
10769
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10494
|
-
return /* @__PURE__ */
|
|
10770
|
+
return /* @__PURE__ */ React67.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React67.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React67.createElement(
|
|
10495
10771
|
"button",
|
|
10496
10772
|
{
|
|
10497
10773
|
type: "button",
|
|
@@ -10504,10 +10780,10 @@ window.Aura = (() => {
|
|
|
10504
10780
|
toggle(it.id);
|
|
10505
10781
|
}
|
|
10506
10782
|
},
|
|
10507
|
-
it.icon ? /* @__PURE__ */
|
|
10508
|
-
/* @__PURE__ */
|
|
10509
|
-
/* @__PURE__ */
|
|
10510
|
-
)), /* @__PURE__ */
|
|
10783
|
+
it.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10784
|
+
/* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React67.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
10785
|
+
/* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10786
|
+
)), /* @__PURE__ */ React67.createElement(
|
|
10511
10787
|
"div",
|
|
10512
10788
|
{
|
|
10513
10789
|
id: pid,
|
|
@@ -10522,7 +10798,7 @@ window.Aura = (() => {
|
|
|
10522
10798
|
});
|
|
10523
10799
|
|
|
10524
10800
|
// src/Popover.tsx
|
|
10525
|
-
var
|
|
10801
|
+
var React68 = __toESM(require_react(), 1);
|
|
10526
10802
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
10527
10803
|
function position(anchor, pop, placement) {
|
|
10528
10804
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10540,15 +10816,15 @@ window.Aura = (() => {
|
|
|
10540
10816
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10541
10817
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10542
10818
|
}
|
|
10543
|
-
var Popover =
|
|
10819
|
+
var Popover = React68.forwardRef(function Popover2(props, ref) {
|
|
10544
10820
|
const t = useStrings();
|
|
10545
10821
|
const density = useDensity();
|
|
10546
10822
|
const auto = uid(), id = props.id || auto;
|
|
10547
10823
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10548
10824
|
const open = !!st[0];
|
|
10549
|
-
const wrap =
|
|
10550
|
-
const pos =
|
|
10551
|
-
const inTree =
|
|
10825
|
+
const wrap = React68.useRef(null), pop = React68.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10826
|
+
const pos = React68.useState(null), mounted = useMounted();
|
|
10827
|
+
const inTree = React68.useRef(false);
|
|
10552
10828
|
function trigger() {
|
|
10553
10829
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10554
10830
|
}
|
|
@@ -10575,7 +10851,7 @@ window.Aura = (() => {
|
|
|
10575
10851
|
},
|
|
10576
10852
|
[open, mounted, props.placement]
|
|
10577
10853
|
);
|
|
10578
|
-
|
|
10854
|
+
React68.useEffect(
|
|
10579
10855
|
function() {
|
|
10580
10856
|
if (!open || !mounted) return;
|
|
10581
10857
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10607,9 +10883,9 @@ window.Aura = (() => {
|
|
|
10607
10883
|
},
|
|
10608
10884
|
[open, mounted]
|
|
10609
10885
|
);
|
|
10610
|
-
const child =
|
|
10886
|
+
const child = React68.Children.only(props.trigger);
|
|
10611
10887
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10612
|
-
/* @__PURE__ */
|
|
10888
|
+
/* @__PURE__ */ React68.createElement(
|
|
10613
10889
|
"div",
|
|
10614
10890
|
{
|
|
10615
10891
|
ref: popMerged,
|
|
@@ -10639,17 +10915,17 @@ window.Aura = (() => {
|
|
|
10639
10915
|
} else trapTab(e, pop.current);
|
|
10640
10916
|
}
|
|
10641
10917
|
},
|
|
10642
|
-
props.title ? /* @__PURE__ */
|
|
10918
|
+
props.title ? /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React68.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React68.createElement(
|
|
10643
10919
|
IconButton,
|
|
10644
10920
|
{
|
|
10645
|
-
icon: /* @__PURE__ */
|
|
10921
|
+
icon: /* @__PURE__ */ React68.createElement(IconX, null),
|
|
10646
10922
|
label: t.close,
|
|
10647
10923
|
onClick: function() {
|
|
10648
10924
|
close(true);
|
|
10649
10925
|
}
|
|
10650
10926
|
}
|
|
10651
10927
|
)) : null,
|
|
10652
|
-
/* @__PURE__ */
|
|
10928
|
+
/* @__PURE__ */ React68.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10653
10929
|
close: function() {
|
|
10654
10930
|
close(true);
|
|
10655
10931
|
}
|
|
@@ -10657,7 +10933,7 @@ window.Aura = (() => {
|
|
|
10657
10933
|
),
|
|
10658
10934
|
document.body
|
|
10659
10935
|
) : null;
|
|
10660
|
-
return /* @__PURE__ */
|
|
10936
|
+
return /* @__PURE__ */ React68.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React68.cloneElement(child, {
|
|
10661
10937
|
onClick: function(e) {
|
|
10662
10938
|
if (child.props.onClick) child.props.onClick(e);
|
|
10663
10939
|
st[1](!open);
|
|
@@ -10669,7 +10945,7 @@ window.Aura = (() => {
|
|
|
10669
10945
|
});
|
|
10670
10946
|
|
|
10671
10947
|
// src/NumberField.tsx
|
|
10672
|
-
var
|
|
10948
|
+
var React69 = __toESM(require_react(), 1);
|
|
10673
10949
|
function decimalsOf(n3) {
|
|
10674
10950
|
const s = String(n3);
|
|
10675
10951
|
const i = s.indexOf(".");
|
|
@@ -10682,7 +10958,7 @@ window.Aura = (() => {
|
|
|
10682
10958
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10683
10959
|
return Number(s);
|
|
10684
10960
|
}
|
|
10685
|
-
var NumberField =
|
|
10961
|
+
var NumberField = React69.forwardRef(function NumberField2(props, ref) {
|
|
10686
10962
|
const t = useStrings();
|
|
10687
10963
|
const auto = uid(), id = props.id || auto;
|
|
10688
10964
|
const step = props.step || 1;
|
|
@@ -10693,7 +10969,7 @@ window.Aura = (() => {
|
|
|
10693
10969
|
props.onChange
|
|
10694
10970
|
);
|
|
10695
10971
|
const value = st[0], setValue = st[1];
|
|
10696
|
-
const draftState =
|
|
10972
|
+
const draftState = React69.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10697
10973
|
function fmt2(n3) {
|
|
10698
10974
|
if (n3 == null || isNaN(n3)) return "";
|
|
10699
10975
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10742,7 +11018,7 @@ window.Aura = (() => {
|
|
|
10742
11018
|
};
|
|
10743
11019
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10744
11020
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10745
|
-
return /* @__PURE__ */
|
|
11021
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10746
11022
|
Field,
|
|
10747
11023
|
{
|
|
10748
11024
|
id,
|
|
@@ -10754,7 +11030,7 @@ window.Aura = (() => {
|
|
|
10754
11030
|
disabled: props.disabled,
|
|
10755
11031
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10756
11032
|
},
|
|
10757
|
-
/* @__PURE__ */
|
|
11033
|
+
/* @__PURE__ */ React69.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React69.createElement(
|
|
10758
11034
|
"input",
|
|
10759
11035
|
{
|
|
10760
11036
|
ref,
|
|
@@ -10801,7 +11077,7 @@ window.Aura = (() => {
|
|
|
10801
11077
|
},
|
|
10802
11078
|
onKeyDown
|
|
10803
11079
|
}
|
|
10804
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
11080
|
+
), props.suffix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React69.createElement(
|
|
10805
11081
|
"button",
|
|
10806
11082
|
{
|
|
10807
11083
|
type: "button",
|
|
@@ -10817,8 +11093,8 @@ window.Aura = (() => {
|
|
|
10817
11093
|
nudge(-step);
|
|
10818
11094
|
}
|
|
10819
11095
|
},
|
|
10820
|
-
/* @__PURE__ */
|
|
10821
|
-
), /* @__PURE__ */
|
|
11096
|
+
/* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconMinus, null) })
|
|
11097
|
+
), /* @__PURE__ */ React69.createElement(
|
|
10822
11098
|
"button",
|
|
10823
11099
|
{
|
|
10824
11100
|
type: "button",
|
|
@@ -10834,14 +11110,14 @@ window.Aura = (() => {
|
|
|
10834
11110
|
nudge(step);
|
|
10835
11111
|
}
|
|
10836
11112
|
},
|
|
10837
|
-
/* @__PURE__ */
|
|
11113
|
+
/* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconPlus, null) })
|
|
10838
11114
|
)) : null)
|
|
10839
11115
|
);
|
|
10840
11116
|
});
|
|
10841
11117
|
|
|
10842
11118
|
// src/Stepper.tsx
|
|
10843
|
-
var
|
|
10844
|
-
var Stepper =
|
|
11119
|
+
var React70 = __toESM(require_react(), 1);
|
|
11120
|
+
var Stepper = React70.forwardRef(function Stepper2(props, ref) {
|
|
10845
11121
|
const t = useStrings();
|
|
10846
11122
|
const idBase = uid();
|
|
10847
11123
|
const steps = props.steps || [];
|
|
@@ -10852,22 +11128,22 @@ window.Aura = (() => {
|
|
|
10852
11128
|
if (at < 0) at = 0;
|
|
10853
11129
|
const vertical = props.orientation === "vertical";
|
|
10854
11130
|
const cur2 = steps[at];
|
|
10855
|
-
return /* @__PURE__ */
|
|
11131
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10856
11132
|
"nav",
|
|
10857
11133
|
{
|
|
10858
11134
|
ref,
|
|
10859
11135
|
"aria-label": props.label,
|
|
10860
11136
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10861
11137
|
},
|
|
10862
|
-
/* @__PURE__ */
|
|
11138
|
+
/* @__PURE__ */ React70.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10863
11139
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10864
11140
|
const error = s.status === "error";
|
|
10865
|
-
const marker = /* @__PURE__ */
|
|
11141
|
+
const marker = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCheck, null) }) : i + 1);
|
|
10866
11142
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10867
11143
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10868
11144
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10869
11145
|
const descId = idBase + "-step-" + i;
|
|
10870
|
-
const text2 = /* @__PURE__ */
|
|
11146
|
+
const text2 = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React70.createElement(
|
|
10871
11147
|
"span",
|
|
10872
11148
|
{
|
|
10873
11149
|
className: "aura-stepper__desc",
|
|
@@ -10876,14 +11152,14 @@ window.Aura = (() => {
|
|
|
10876
11152
|
},
|
|
10877
11153
|
s.description
|
|
10878
11154
|
) : null);
|
|
10879
|
-
return /* @__PURE__ */
|
|
11155
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10880
11156
|
"li",
|
|
10881
11157
|
{
|
|
10882
11158
|
key: s.id,
|
|
10883
11159
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10884
11160
|
"aria-current": state === "current" ? "step" : void 0
|
|
10885
11161
|
},
|
|
10886
|
-
clickable ? /* @__PURE__ */
|
|
11162
|
+
clickable ? /* @__PURE__ */ React70.createElement(
|
|
10887
11163
|
"button",
|
|
10888
11164
|
{
|
|
10889
11165
|
type: "button",
|
|
@@ -10895,19 +11171,19 @@ window.Aura = (() => {
|
|
|
10895
11171
|
},
|
|
10896
11172
|
marker,
|
|
10897
11173
|
text2
|
|
10898
|
-
) : /* @__PURE__ */
|
|
11174
|
+
) : /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10899
11175
|
);
|
|
10900
11176
|
})),
|
|
10901
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
11177
|
+
!vertical && cur2 ? /* @__PURE__ */ React70.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10902
11178
|
);
|
|
10903
11179
|
});
|
|
10904
11180
|
|
|
10905
11181
|
// src/SegmentedControl.tsx
|
|
10906
|
-
var
|
|
11182
|
+
var React71 = __toESM(require_react(), 1);
|
|
10907
11183
|
function toOpt2(o) {
|
|
10908
11184
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10909
11185
|
}
|
|
10910
|
-
var SegmentedControl =
|
|
11186
|
+
var SegmentedControl = React71.forwardRef(
|
|
10911
11187
|
function SegmentedControl2(props, ref) {
|
|
10912
11188
|
const options = (props.options || []).map(toOpt2);
|
|
10913
11189
|
useAutoTip();
|
|
@@ -10921,7 +11197,7 @@ window.Aura = (() => {
|
|
|
10921
11197
|
);
|
|
10922
11198
|
const value = st[0], setValue = st[1];
|
|
10923
11199
|
const auto = uid(), id = props.id || auto;
|
|
10924
|
-
const refs =
|
|
11200
|
+
const refs = React71.useRef([]);
|
|
10925
11201
|
const selIdx = options.findIndex(function(o) {
|
|
10926
11202
|
return o.value === value;
|
|
10927
11203
|
});
|
|
@@ -10954,7 +11230,7 @@ window.Aura = (() => {
|
|
|
10954
11230
|
move(options.length, -1);
|
|
10955
11231
|
}
|
|
10956
11232
|
}
|
|
10957
|
-
return /* @__PURE__ */
|
|
11233
|
+
return /* @__PURE__ */ React71.createElement(
|
|
10958
11234
|
"div",
|
|
10959
11235
|
{
|
|
10960
11236
|
ref,
|
|
@@ -10974,7 +11250,7 @@ window.Aura = (() => {
|
|
|
10974
11250
|
options.map(function(o, i) {
|
|
10975
11251
|
const on = o.value === value;
|
|
10976
11252
|
const off = props.disabled || o.disabled;
|
|
10977
|
-
return /* @__PURE__ */
|
|
11253
|
+
return /* @__PURE__ */ React71.createElement(
|
|
10978
11254
|
"button",
|
|
10979
11255
|
{
|
|
10980
11256
|
key: o.value,
|
|
@@ -10996,8 +11272,8 @@ window.Aura = (() => {
|
|
|
10996
11272
|
onKeyDown(e, i);
|
|
10997
11273
|
}
|
|
10998
11274
|
},
|
|
10999
|
-
o.icon ? /* @__PURE__ */
|
|
11000
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
11275
|
+
o.icon ? /* @__PURE__ */ React71.createElement(Icon, { name: o.icon }) : null,
|
|
11276
|
+
o.iconOnly ? null : /* @__PURE__ */ React71.createElement("span", null, o.label)
|
|
11001
11277
|
);
|
|
11002
11278
|
})
|
|
11003
11279
|
);
|