@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.
@@ -82,6 +82,7 @@ __export(index_exports, {
82
82
  SideNav: () => SideNav,
83
83
  Skeleton: () => Skeleton,
84
84
  Sparkline: () => Sparkline,
85
+ Spinner: () => Spinner,
85
86
  Stack: () => Stack,
86
87
  Stat: () => Stat,
87
88
  StatusPill: () => StatusPill,
@@ -391,6 +392,14 @@ function plainClick(e) {
391
392
  return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
392
393
  }
393
394
  var FilterSheet = React3.createContext(false);
395
+ function fixedTrapped(el) {
396
+ for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
397
+ const s = getComputedStyle(p);
398
+ 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))
399
+ return true;
400
+ }
401
+ return false;
402
+ }
394
403
 
395
404
  // src/display.tsx
396
405
  var React4 = __toESM(require("react"), 1);
@@ -464,6 +473,11 @@ var IconEllipsis = /* @__PURE__ */ defineIcon("ellipsis", [
464
473
  ["circle", { cx: "19", cy: "12", r: "1" }],
465
474
  ["circle", { cx: "5", cy: "12", r: "1" }]
466
475
  ]);
476
+ var IconUpload = /* @__PURE__ */ defineIcon("upload", [
477
+ ["path", { d: "M12 3v12" }],
478
+ ["path", { d: "m17 8-5-5-5 5" }],
479
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]
480
+ ]);
467
481
  var IconCalendar = /* @__PURE__ */ defineIcon("calendar", [
468
482
  ["path", { d: "M8 2v3" }],
469
483
  ["path", { d: "M16 2v3" }],
@@ -713,7 +727,7 @@ var PILL_ICON = {
713
727
  };
714
728
  function statusPillElement(props, ref) {
715
729
  const tone2 = props.tone || toneFor(props.children);
716
- const rest = omit(props, ["tone", "className", "children", "wrap"]);
730
+ const rest = omit(props, ["tone", "className", "children", "wrap", "busy"]);
717
731
  return /* @__PURE__ */ React4.createElement(
718
732
  "span",
719
733
  {
@@ -721,10 +735,26 @@ function statusPillElement(props, ref) {
721
735
  ref,
722
736
  className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
723
737
  },
724
- /* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
738
+ 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 }),
725
739
  props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
726
740
  );
727
741
  }
742
+ function spinnerElement(props, ref) {
743
+ const rest = omit(props, ["size", "label", "className"]);
744
+ const label = props.label;
745
+ return /* @__PURE__ */ React4.createElement(
746
+ "span",
747
+ {
748
+ ...rest,
749
+ ref,
750
+ className: cx("aura-spinner", "aura-spinner--" + (props.size || "md"), props.className),
751
+ role: label ? "status" : void 0,
752
+ "aria-hidden": label ? void 0 : true
753
+ },
754
+ /* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: props.size || "md", className: "aura-spin" }),
755
+ label ? /* @__PURE__ */ React4.createElement("span", { className: "aura-sr-only" }, label) : null
756
+ );
757
+ }
728
758
  function badgeElement(props, ref) {
729
759
  const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
730
760
  return /* @__PURE__ */ React4.createElement(
@@ -1013,6 +1043,7 @@ var th = {
1013
1043
  statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
1014
1044
  opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
1015
1045
  required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
1046
+ firstPage: "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",
1016
1047
  filtersApplied: function(n3) {
1017
1048
  return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
1018
1049
  },
@@ -1155,6 +1186,7 @@ var sv = {
1155
1186
  statusUnknown: "Ingen data",
1156
1187
  opensInNewTab: "\xF6ppnas i en ny flik",
1157
1188
  required: "obligatoriskt",
1189
+ firstPage: "F\xF6rsta sidan",
1158
1190
  filtersApplied: function(n3) {
1159
1191
  return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
1160
1192
  },
@@ -1298,6 +1330,7 @@ var STRINGS = {
1298
1330
  statusUnknown: "No data",
1299
1331
  opensInNewTab: "opens in a new tab",
1300
1332
  required: "required",
1333
+ firstPage: "First page",
1301
1334
  filtersApplied: function(n3) {
1302
1335
  return "Filters, " + n3.toLocaleString("en") + " applied";
1303
1336
  },
@@ -1358,6 +1391,8 @@ function useStrings() {
1358
1391
  function ButtonLink(props, ref, Link) {
1359
1392
  const variant = props.variant || "primary";
1360
1393
  const disabled = !!props.disabled;
1394
+ const ad = props["aria-disabled"];
1395
+ const gated = !disabled && (ad === true || ad === "true");
1361
1396
  const rest = omit(props, [
1362
1397
  "variant",
1363
1398
  "className",
@@ -1379,7 +1414,7 @@ function ButtonLink(props, ref, Link) {
1379
1414
  ref,
1380
1415
  href: disabled ? void 0 : props.href,
1381
1416
  role: disabled ? "link" : void 0,
1382
- "aria-disabled": disabled || void 0,
1417
+ "aria-disabled": disabled || gated || void 0,
1383
1418
  tabIndex: disabled ? -1 : props.tabIndex,
1384
1419
  className: buttonClass({
1385
1420
  variant,
@@ -1388,7 +1423,9 @@ function ButtonLink(props, ref, Link) {
1388
1423
  touchHeight: props.touchHeight,
1389
1424
  className: props.className
1390
1425
  }),
1391
- onClick: disabled ? void 0 : props.onClick
1426
+ onClick: disabled ? void 0 : gated ? function(e) {
1427
+ e.preventDefault();
1428
+ } : props.onClick
1392
1429
  },
1393
1430
  props.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: props.icon }) : null,
1394
1431
  props.children,
@@ -1406,6 +1443,8 @@ var Button = React6.forwardRef(
1406
1443
  const loading = !!props.loading;
1407
1444
  const ad = props["aria-disabled"];
1408
1445
  const blocked = loading || ad === true || ad === "true";
1446
+ const ab = props["aria-busy"];
1447
+ const busy = loading || ab === true || ab === "true";
1409
1448
  const rest = omit(props, [
1410
1449
  "variant",
1411
1450
  "className",
@@ -1433,7 +1472,7 @@ var Button = React6.forwardRef(
1433
1472
  loading,
1434
1473
  className: props.className
1435
1474
  }),
1436
- "aria-busy": loading || void 0,
1475
+ "aria-busy": busy || void 0,
1437
1476
  "aria-disabled": blocked || void 0,
1438
1477
  onClick: blocked ? function(e) {
1439
1478
  e.preventDefault();
@@ -1638,6 +1677,8 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1638
1677
  const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
1639
1678
  useAutoTip();
1640
1679
  const own = props.title !== void 0;
1680
+ const ad = props["aria-disabled"];
1681
+ const blocked = ad === true || ad === "true";
1641
1682
  return /* @__PURE__ */ React8.createElement(
1642
1683
  "button",
1643
1684
  {
@@ -1647,6 +1688,9 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1647
1688
  "aria-label": props.label,
1648
1689
  "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
1649
1690
  "data-aura-tip": own ? void 0 : props.label,
1691
+ onClick: blocked ? function(e) {
1692
+ e.preventDefault();
1693
+ } : props.onClick,
1650
1694
  className: cx(
1651
1695
  "aura-icon-btn",
1652
1696
  props.tone === "danger" && "aura-icon-btn--danger",
@@ -8095,14 +8139,6 @@ var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
8095
8139
  // src/PageHeaderClient.tsx
8096
8140
  var NAME = "--aura-page-actions-height";
8097
8141
  var bars = [];
8098
- function trapped(el) {
8099
- for (let p = el.parentElement; p && p !== document.documentElement; p = p.parentElement) {
8100
- const s = getComputedStyle(p);
8101
- 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))
8102
- return true;
8103
- }
8104
- return false;
8105
- }
8106
8142
  var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
8107
8143
  const own = React45.useRef(null);
8108
8144
  const merged = useMergedRef(ref, own);
@@ -8119,7 +8155,7 @@ var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
8119
8155
  if (bars[bars.length - 1] !== sync) return;
8120
8156
  if (getComputedStyle(el).position === "fixed") {
8121
8157
  root.style.setProperty(NAME, el.offsetHeight + "px");
8122
- if (!checked && (checked = true, trapped(el)))
8158
+ if (!checked && (checked = true, fixedTrapped(el)))
8123
8159
  devWarnOnce(
8124
8160
  "pageheader-bar-trapped",
8125
8161
  "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."
@@ -8662,6 +8698,17 @@ var AppShell = React49.forwardRef(function AppShell2(props, ref) {
8662
8698
 
8663
8699
  // src/ActionBar.tsx
8664
8700
  var React50 = __toESM(require("react"), 1);
8701
+ var HEIGHT = "--aura-actionbar-height";
8702
+ var edges = [];
8703
+ function writeHeight() {
8704
+ const root = document.documentElement;
8705
+ for (let i = edges.length - 1; i >= 0; i--)
8706
+ if (getComputedStyle(edges[i]).position === "fixed") {
8707
+ root.style.setProperty(HEIGHT, edges[i].offsetHeight + "px");
8708
+ return;
8709
+ }
8710
+ root.style.removeProperty(HEIGHT);
8711
+ }
8665
8712
  var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
8666
8713
  const t = useStrings();
8667
8714
  const bulk = props.selected != null;
@@ -8672,6 +8719,40 @@ var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
8672
8719
  });
8673
8720
  const cameFrom = React50.useRef(null);
8674
8721
  const own = React50.useRef(null);
8722
+ const viewport = (props.position || "viewport") === "viewport";
8723
+ const edge = !viewport ? null : props.look === "edge" ? "all" : props.edgeBelow || null;
8724
+ if (props.look === "edge" && props.edgeBelow && viewport)
8725
+ devWarnOnce(
8726
+ "actionbar-edge-both",
8727
+ '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.'
8728
+ );
8729
+ React50.useEffect(
8730
+ function() {
8731
+ const el = own.current;
8732
+ if (!edge || !el) return;
8733
+ let checked = false;
8734
+ function sync() {
8735
+ writeHeight();
8736
+ if (!checked && getComputedStyle(el).position === "fixed" && (checked = true, fixedTrapped(el)))
8737
+ devWarnOnce(
8738
+ "actionbar-edge-trapped",
8739
+ `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.`
8740
+ );
8741
+ }
8742
+ edges.push(el);
8743
+ const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
8744
+ if (ro) ro.observe(el, { box: "border-box" });
8745
+ window.addEventListener("resize", sync);
8746
+ sync();
8747
+ return function() {
8748
+ if (ro) ro.disconnect();
8749
+ window.removeEventListener("resize", sync);
8750
+ edges.splice(edges.indexOf(el), 1);
8751
+ writeHeight();
8752
+ };
8753
+ },
8754
+ [edge, idle]
8755
+ );
8675
8756
  function clear() {
8676
8757
  props.onClearSelection();
8677
8758
  setTimeout(function() {
@@ -8698,6 +8779,7 @@ var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
8698
8779
  className: cx(
8699
8780
  "aura-actionbar",
8700
8781
  "aura-actionbar--" + (props.position || "viewport"),
8782
+ edge && (edge === "all" ? "aura-actionbar--edge" : "aura-actionbar--edge-below-" + edge),
8701
8783
  idle && "is-idle",
8702
8784
  props.className
8703
8785
  )
@@ -9127,8 +9209,39 @@ function cellClass(base, p) {
9127
9209
  );
9128
9210
  }
9129
9211
  var Th = React53.forwardRef(function Th2(props, ref) {
9130
- const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
9212
+ const {
9213
+ align,
9214
+ numeric,
9215
+ mono,
9216
+ className,
9217
+ scope,
9218
+ label,
9219
+ card,
9220
+ skeleton,
9221
+ skeletonWidth,
9222
+ wrap,
9223
+ sort,
9224
+ onSort,
9225
+ sortHref,
9226
+ linkComponent,
9227
+ ...rest
9228
+ } = props;
9131
9229
  const stacked = React53.useContext(StackLabels) != null;
9230
+ const Link = useLinkComponent(linkComponent);
9231
+ const sortable = !!onSort || sortHref != null;
9232
+ const ariaSort = sort || (sortable ? "none" : void 0);
9233
+ let children = props.children;
9234
+ if (sortable) {
9235
+ const icon = /* @__PURE__ */ React53.createElement(
9236
+ Icon,
9237
+ {
9238
+ name: sort === "ascending" ? /* @__PURE__ */ React53.createElement(IconArrowUp, null) : sort === "descending" ? /* @__PURE__ */ React53.createElement(IconArrowDown, null) : /* @__PURE__ */ React53.createElement(IconArrowUpDown, null),
9239
+ size: 12
9240
+ }
9241
+ );
9242
+ const cls = cx("aura-table__sort", sort && sort !== "none" && "is-active");
9243
+ 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);
9244
+ }
9132
9245
  return /* @__PURE__ */ React53.createElement(
9133
9246
  "th",
9134
9247
  {
@@ -9137,8 +9250,10 @@ var Th = React53.forwardRef(function Th2(props, ref) {
9137
9250
  className: cellClass("aura-tbl__th", props),
9138
9251
  role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
9139
9252
  "data-card": stacked && (card === "title" || card === "action") ? card : void 0,
9253
+ "aria-sort": ariaSort,
9140
9254
  ...rest
9141
- }
9255
+ },
9256
+ children
9142
9257
  );
9143
9258
  });
9144
9259
  var Td = React53.forwardRef(function Td2(props, ref) {
@@ -9604,7 +9719,59 @@ var TimePicker = React57.forwardRef(function TimePicker2(props, ref) {
9604
9719
  });
9605
9720
 
9606
9721
  // src/FileUpload.tsx
9722
+ var React59 = __toESM(require("react"), 1);
9723
+
9724
+ // src/Progress.tsx
9607
9725
  var React58 = __toESM(require("react"), 1);
9726
+ var Progress = React58.forwardRef(function Progress2(props, ref) {
9727
+ const t = useStrings();
9728
+ const auto = uid(), id = props.id || auto;
9729
+ const max = props.max || 100, det = props.value != null;
9730
+ const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
9731
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
9732
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
9733
+ const keyed = !!props.legend && spct > 0;
9734
+ 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;
9735
+ const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
9736
+ return /* @__PURE__ */ React58.createElement(
9737
+ "div",
9738
+ {
9739
+ ref,
9740
+ className: cx(
9741
+ "aura-progress",
9742
+ "aura-progress--" + tone(props.tone || "accent"),
9743
+ props.size === "sm" && "is-sm",
9744
+ props.className
9745
+ )
9746
+ },
9747
+ 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,
9748
+ /* @__PURE__ */ React58.createElement(
9749
+ "div",
9750
+ {
9751
+ className: cx("aura-progress__track", !det && "is-indeterminate"),
9752
+ role: "progressbar",
9753
+ "aria-labelledby": props.label ? id + "-label" : void 0,
9754
+ "aria-label": props.label ? void 0 : props["aria-label"],
9755
+ "aria-valuemin": det ? 0 : void 0,
9756
+ "aria-valuemax": det ? max : void 0,
9757
+ "aria-valuenow": det ? props.value : void 0,
9758
+ "aria-valuetext": det ? valueText : void 0
9759
+ },
9760
+ /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
9761
+ sec ? /* @__PURE__ */ React58.createElement(
9762
+ "span",
9763
+ {
9764
+ className: "aura-progress__bar aura-progress__bar--reserved",
9765
+ style: { left: pct + "%", width: spct + "%" }
9766
+ }
9767
+ ) : null
9768
+ ),
9769
+ 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,
9770
+ props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
9771
+ );
9772
+ });
9773
+
9774
+ // src/FileUpload.tsx
9608
9775
  function matches(file, accept) {
9609
9776
  if (!accept) return true;
9610
9777
  const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
@@ -9628,24 +9795,40 @@ function describeAccept(accept, t) {
9628
9795
  }).join(", ");
9629
9796
  }
9630
9797
  var seq = 0;
9631
- var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9798
+ var FileUpload = React59.forwardRef(function FileUpload2(props, ref) {
9632
9799
  const t = useStrings();
9633
9800
  const auto = uid(), id = props.id || auto;
9634
9801
  const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
9635
9802
  const items2 = st[0] || [];
9636
- const dragState = React58.useState(false), over = dragState[0];
9637
- const inputRef = React58.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9638
- const urls = React58.useRef({});
9803
+ const dragState = React59.useState(false), over = dragState[0];
9804
+ const inputRef = React59.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9805
+ const urls = React59.useRef({});
9639
9806
  const maxFiles = props.multiple ? props.maxFiles : 1;
9640
9807
  const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
9641
- React58.useEffect(function() {
9808
+ const pickState = React59.useState(null);
9809
+ const buttonRef = React59.useRef(null);
9810
+ const buttonMode = props.variant === "button";
9811
+ React59.useEffect(
9812
+ function() {
9813
+ const el = inputRef.current;
9814
+ if (!buttonMode || !el) return;
9815
+ el.focus = function(o) {
9816
+ if (buttonRef.current) buttonRef.current.focus(o);
9817
+ };
9818
+ return function() {
9819
+ delete el.focus;
9820
+ };
9821
+ },
9822
+ [buttonMode]
9823
+ );
9824
+ React59.useEffect(function() {
9642
9825
  return function() {
9643
9826
  Object.keys(urls.current).forEach(function(k) {
9644
9827
  URL.revokeObjectURL(urls.current[k]);
9645
9828
  });
9646
9829
  };
9647
9830
  }, []);
9648
- React58.useEffect(
9831
+ React59.useEffect(
9649
9832
  function() {
9650
9833
  const el = inputRef.current;
9651
9834
  if (!el || !props.name || typeof DataTransfer === "undefined") return;
@@ -9705,7 +9888,96 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9705
9888
  if (inputRef.current) inputRef.current.focus();
9706
9889
  }
9707
9890
  const error = props.error;
9708
- return /* @__PURE__ */ React58.createElement(
9891
+ if (props.variant === "button") {
9892
+ const err = error || pickState[0];
9893
+ const desc = [err ? id + "-error" : props.hint ? id + "-hint" : null, note ? id + "-note" : null].filter(Boolean).join(" ") || void 0;
9894
+ return /* @__PURE__ */ React59.createElement(
9895
+ Field,
9896
+ {
9897
+ id,
9898
+ label: props.label,
9899
+ labelAs: "span",
9900
+ labelId: id + "-label",
9901
+ hint: props.hint,
9902
+ error: err,
9903
+ required: props.required,
9904
+ optional: props.optional,
9905
+ disabled: props.disabled,
9906
+ className: cx("aura-upload-field", props.className)
9907
+ },
9908
+ /* @__PURE__ */ React59.createElement("div", { className: "aura-upload-button" }, /* @__PURE__ */ React59.createElement(
9909
+ Button,
9910
+ {
9911
+ ref: buttonRef,
9912
+ id: id + "-button",
9913
+ variant: "secondary",
9914
+ icon: /* @__PURE__ */ React59.createElement(IconUpload, null),
9915
+ touchHeight: props.touchHeight,
9916
+ disabled: props.disabled,
9917
+ "aria-labelledby": props.label ? id + "-label " + id + "-button" : void 0,
9918
+ "aria-describedby": desc,
9919
+ onClick: function() {
9920
+ if (inputRef.current) inputRef.current.click();
9921
+ }
9922
+ },
9923
+ props.buttonLabel != null ? props.buttonLabel : props.multiple ? t.browse : t.browseOne
9924
+ ), /* @__PURE__ */ React59.createElement(
9925
+ "input",
9926
+ {
9927
+ ref: inputMerged,
9928
+ id,
9929
+ type: "file",
9930
+ className: "aura-upload__input",
9931
+ tabIndex: -1,
9932
+ "aria-hidden": true,
9933
+ accept: props.accept,
9934
+ multiple: !!props.multiple,
9935
+ disabled: props.disabled,
9936
+ name: props.name,
9937
+ required: props.name ? props.required : void 0,
9938
+ onInvalid: function(e) {
9939
+ e.preventDefault();
9940
+ pickState[1](props.multiple ? t.browse : t.browseOne);
9941
+ if (buttonRef.current) buttonRef.current.focus();
9942
+ },
9943
+ onChange: function(e) {
9944
+ const files = Array.prototype.slice.call(e.target.files || []);
9945
+ if (!files.length) return;
9946
+ let refused = null;
9947
+ const ok = files.filter(function(f) {
9948
+ const why = !matches(f, props.accept) ? t.fileWrongType : props.maxSize && f.size > props.maxSize ? t.fileTooBig(formatBytes(props.maxSize)) : null;
9949
+ if (why && !refused) refused = why;
9950
+ return !why;
9951
+ });
9952
+ pickState[1](refused);
9953
+ if (!props.name) e.target.value = "";
9954
+ else if (refused) {
9955
+ try {
9956
+ const dt = new DataTransfer();
9957
+ ok.forEach(function(f) {
9958
+ dt.items.add(f);
9959
+ });
9960
+ e.target.files = dt.files;
9961
+ } catch (x) {
9962
+ e.target.value = "";
9963
+ }
9964
+ }
9965
+ if (ok.length && props.onSelect) props.onSelect(ok);
9966
+ }
9967
+ }
9968
+ ), note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null),
9969
+ props.progress !== void 0 ? /* @__PURE__ */ React59.createElement(
9970
+ Progress,
9971
+ {
9972
+ className: "aura-upload-button__progress",
9973
+ size: "sm",
9974
+ value: props.progress == null ? void 0 : props.progress,
9975
+ label: t.uploading
9976
+ }
9977
+ ) : null
9978
+ );
9979
+ }
9980
+ return /* @__PURE__ */ React59.createElement(
9709
9981
  Field,
9710
9982
  {
9711
9983
  id,
@@ -9717,7 +9989,7 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9717
9989
  disabled: props.disabled,
9718
9990
  className: props.className
9719
9991
  },
9720
- /* @__PURE__ */ React58.createElement(
9992
+ /* @__PURE__ */ React59.createElement(
9721
9993
  "div",
9722
9994
  {
9723
9995
  className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
@@ -9738,9 +10010,9 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9738
10010
  add(e.dataTransfer && e.dataTransfer.files);
9739
10011
  }
9740
10012
  },
9741
- /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
9742
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
9743
- /* @__PURE__ */ React58.createElement(
10013
+ /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
10014
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
10015
+ /* @__PURE__ */ React59.createElement(
9744
10016
  "input",
9745
10017
  {
9746
10018
  ref: inputMerged,
@@ -9762,12 +10034,12 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9762
10034
  }
9763
10035
  }
9764
10036
  ),
9765
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
9766
- note ? /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
10037
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
10038
+ note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
9767
10039
  ),
9768
- items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
10040
+ items2.length ? /* @__PURE__ */ React59.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
9769
10041
  const src = thumb(it);
9770
- return /* @__PURE__ */ React58.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React58.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React58.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React58.createElement(IconImage, null) : /* @__PURE__ */ React58.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React58.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React58.createElement(
10042
+ 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(
9771
10043
  "span",
9772
10044
  {
9773
10045
  className: "aura-upload__bar",
@@ -9777,11 +10049,11 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9777
10049
  "aria-valuemax": 100,
9778
10050
  "aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
9779
10051
  },
9780
- /* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
9781
- ) : null), /* @__PURE__ */ React58.createElement(
10052
+ /* @__PURE__ */ React59.createElement("span", { style: { width: (it.progress || 0) + "%" } })
10053
+ ) : null), /* @__PURE__ */ React59.createElement(
9782
10054
  IconButton,
9783
10055
  {
9784
- icon: /* @__PURE__ */ React58.createElement(IconX, null),
10056
+ icon: /* @__PURE__ */ React59.createElement(IconX, null),
9785
10057
  label: t.remove(it.name),
9786
10058
  onClick: function() {
9787
10059
  remove(it);
@@ -10097,9 +10369,9 @@ function createTheme(opts) {
10097
10369
  }
10098
10370
 
10099
10371
  // src/ThemeStyle.tsx
10100
- var React59 = __toESM(require("react"), 1);
10372
+ var React60 = __toESM(require("react"), 1);
10101
10373
  function ThemeStyle(props) {
10102
- const css = React59.useMemo(
10374
+ const css = React60.useMemo(
10103
10375
  function() {
10104
10376
  try {
10105
10377
  return createTheme({
@@ -10116,11 +10388,11 @@ function ThemeStyle(props) {
10116
10388
  [props.brand, props.signal, props.primary, props.name, props.selector]
10117
10389
  );
10118
10390
  if (css === null) return null;
10119
- return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10391
+ return /* @__PURE__ */ React60.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10120
10392
  }
10121
10393
 
10122
10394
  // src/colorScheme.tsx
10123
- var React60 = __toESM(require("react"), 1);
10395
+ var React61 = __toESM(require("react"), 1);
10124
10396
 
10125
10397
  // src/colorSchemeScript.ts
10126
10398
  var DEFAULT_KEY = "aura-color-scheme";
@@ -10137,7 +10409,7 @@ function colorSchemeScript(options) {
10137
10409
 
10138
10410
  // src/colorScheme.tsx
10139
10411
  function ColorSchemeScript(props) {
10140
- return /* @__PURE__ */ React60.createElement(
10412
+ return /* @__PURE__ */ React61.createElement(
10141
10413
  "script",
10142
10414
  {
10143
10415
  "data-aura-color-scheme": "",
@@ -10162,7 +10434,7 @@ function apply(scheme) {
10162
10434
  function useColorScheme(options) {
10163
10435
  const key = options && options.storageKey || DEFAULT_KEY;
10164
10436
  const fallback = options && options.defaultScheme || "system";
10165
- const subscribe2 = React60.useCallback(
10437
+ const subscribe2 = React61.useCallback(
10166
10438
  function(cb) {
10167
10439
  const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
10168
10440
  function onSystem() {
@@ -10184,7 +10456,7 @@ function useColorScheme(options) {
10184
10456
  },
10185
10457
  [fallback, key]
10186
10458
  );
10187
- const snapshot = React60.useSyncExternalStore(
10459
+ const snapshot = React61.useSyncExternalStore(
10188
10460
  subscribe2,
10189
10461
  function() {
10190
10462
  const s = readScheme(fallback);
@@ -10195,7 +10467,7 @@ function useColorScheme(options) {
10195
10467
  }
10196
10468
  );
10197
10469
  const parts = snapshot.split("|");
10198
- const setScheme = React60.useCallback(
10470
+ const setScheme = React61.useCallback(
10199
10471
  function(next) {
10200
10472
  if (!valid(next)) return;
10201
10473
  try {
@@ -10214,14 +10486,14 @@ function ColorSchemeToggle(props) {
10214
10486
  const cs = useColorScheme(props);
10215
10487
  const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
10216
10488
  const label = props.label || t.colorScheme;
10217
- return /* @__PURE__ */ React60.createElement(
10489
+ return /* @__PURE__ */ React61.createElement(
10218
10490
  DropdownMenu,
10219
10491
  {
10220
10492
  label,
10221
- trigger: /* @__PURE__ */ React60.createElement(
10493
+ trigger: /* @__PURE__ */ React61.createElement(
10222
10494
  IconButton,
10223
10495
  {
10224
- icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
10496
+ icon: cs.resolved === "dark" ? /* @__PURE__ */ React61.createElement(IconMoon, null) : /* @__PURE__ */ React61.createElement(IconSun, null),
10225
10497
  label: label + ": " + names[cs.scheme]
10226
10498
  }
10227
10499
  ),
@@ -10239,59 +10511,9 @@ function ColorSchemeToggle(props) {
10239
10511
  }
10240
10512
 
10241
10513
  // src/Badge.tsx
10242
- var React61 = __toESM(require("react"), 1);
10243
- var Badge = React61.forwardRef(function Badge2(props, ref) {
10244
- return badgeElement(props, ref);
10245
- });
10246
-
10247
- // src/Progress.tsx
10248
10514
  var React62 = __toESM(require("react"), 1);
10249
- var Progress = React62.forwardRef(function Progress2(props, ref) {
10250
- const t = useStrings();
10251
- const auto = uid(), id = props.id || auto;
10252
- const max = props.max || 100, det = props.value != null;
10253
- const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10254
- const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
10255
- const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
10256
- const keyed = !!props.legend && spct > 0;
10257
- 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;
10258
- const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
10259
- return /* @__PURE__ */ React62.createElement(
10260
- "div",
10261
- {
10262
- ref,
10263
- className: cx(
10264
- "aura-progress",
10265
- "aura-progress--" + tone(props.tone || "accent"),
10266
- props.size === "sm" && "is-sm",
10267
- props.className
10268
- )
10269
- },
10270
- 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,
10271
- /* @__PURE__ */ React62.createElement(
10272
- "div",
10273
- {
10274
- className: cx("aura-progress__track", !det && "is-indeterminate"),
10275
- role: "progressbar",
10276
- "aria-labelledby": props.label ? id + "-label" : void 0,
10277
- "aria-label": props.label ? void 0 : props["aria-label"],
10278
- "aria-valuemin": det ? 0 : void 0,
10279
- "aria-valuemax": det ? max : void 0,
10280
- "aria-valuenow": det ? props.value : void 0,
10281
- "aria-valuetext": det ? valueText : void 0
10282
- },
10283
- /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
10284
- sec ? /* @__PURE__ */ React62.createElement(
10285
- "span",
10286
- {
10287
- className: "aura-progress__bar aura-progress__bar--reserved",
10288
- style: { left: pct + "%", width: spct + "%" }
10289
- }
10290
- ) : null
10291
- ),
10292
- 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,
10293
- props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
10294
- );
10515
+ var Badge = React62.forwardRef(function Badge2(props, ref) {
10516
+ return badgeElement(props, ref);
10295
10517
  });
10296
10518
 
10297
10519
  // src/Skeleton.tsx
@@ -10350,9 +10572,56 @@ function pageList(page, count, sib) {
10350
10572
  if (count > 1) out.push(count);
10351
10573
  return out;
10352
10574
  }
10353
- var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10575
+ function cursorNav(props, ref, Link, t) {
10576
+ const links = props.firstHref != null || props.previousHref != null || props.nextHref != null;
10577
+ function step(key, href, on, has, label, rel, icon, after) {
10578
+ 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);
10579
+ const cls = "aura-page aura-page--step";
10580
+ if (has === false || !href && !on)
10581
+ 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);
10582
+ if (href != null)
10583
+ return /* @__PURE__ */ React65.createElement(
10584
+ Link,
10585
+ {
10586
+ key,
10587
+ href,
10588
+ rel,
10589
+ className: cls,
10590
+ onClick: function(e) {
10591
+ if (on && plainClick(e)) {
10592
+ e.preventDefault();
10593
+ on();
10594
+ }
10595
+ }
10596
+ },
10597
+ body
10598
+ );
10599
+ return /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, onClick: on }, body);
10600
+ }
10601
+ return /* @__PURE__ */ React65.createElement(
10602
+ "nav",
10603
+ {
10604
+ ref,
10605
+ className: cx("aura-pagination", "aura-pagination--cursor", props.className),
10606
+ "aria-label": props.label || t.pagination
10607
+ },
10608
+ props.status != null && props.status !== false && props.status !== "" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__status" }, props.status) : null,
10609
+ /* @__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(
10610
+ "prev",
10611
+ props.previousHref,
10612
+ props.onPrevious,
10613
+ props.hasPrevious,
10614
+ t.prevPage,
10615
+ "prev",
10616
+ /* @__PURE__ */ React65.createElement(IconChevronLeft, null),
10617
+ false
10618
+ ), step("next", props.nextHref, props.onNext, props.hasNext, t.nextPage, "next", /* @__PURE__ */ React65.createElement(IconChevronRight, null), true))
10619
+ );
10620
+ }
10621
+ var Pagination = React65.forwardRef(function Pagination2(all, ref) {
10354
10622
  const t = useStrings();
10355
10623
  useAutoTip();
10624
+ const props = all;
10356
10625
  const count = Math.max(1, props.pageCount || 1);
10357
10626
  const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
10358
10627
  const page = Math.min(count, Math.max(1, st[0]));
@@ -10361,6 +10630,7 @@ var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10361
10630
  }
10362
10631
  const link = props.getHref;
10363
10632
  const Link = useLinkComponent(props.linkComponent);
10633
+ if (all.mode === "cursor") return cursorNav(all, ref, Link, t);
10364
10634
  function item(p, label, extra) {
10365
10635
  const common = Object.assign(
10366
10636
  {
@@ -10431,9 +10701,15 @@ var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10431
10701
  })), /* @__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));
10432
10702
  });
10433
10703
 
10434
- // src/Accordion.tsx
10704
+ // src/Spinner.tsx
10435
10705
  var React66 = __toESM(require("react"), 1);
10436
- var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10706
+ var Spinner = React66.forwardRef(function Spinner2(props, ref) {
10707
+ return spinnerElement(props, ref);
10708
+ });
10709
+
10710
+ // src/Accordion.tsx
10711
+ var React67 = __toESM(require("react"), 1);
10712
+ var Accordion = React67.forwardRef(function Accordion2(props, ref) {
10437
10713
  const auto = uid(), base = props.id || auto;
10438
10714
  const multiple = props.type === "multiple";
10439
10715
  const st = useMaybeControlled(
@@ -10471,9 +10747,9 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10471
10747
  n3.focus();
10472
10748
  }
10473
10749
  }
10474
- return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10750
+ return /* @__PURE__ */ React67.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10475
10751
  const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
10476
- return /* @__PURE__ */ React66.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React66.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React66.createElement(
10752
+ 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(
10477
10753
  "button",
10478
10754
  {
10479
10755
  type: "button",
@@ -10486,10 +10762,10 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10486
10762
  toggle(it.id);
10487
10763
  }
10488
10764
  },
10489
- it.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10490
- /* @__PURE__ */ React66.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React66.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React66.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
10491
- /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10492
- )), /* @__PURE__ */ React66.createElement(
10765
+ it.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10766
+ /* @__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),
10767
+ /* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10768
+ )), /* @__PURE__ */ React67.createElement(
10493
10769
  "div",
10494
10770
  {
10495
10771
  id: pid,
@@ -10504,7 +10780,7 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10504
10780
  });
10505
10781
 
10506
10782
  // src/Popover.tsx
10507
- var React67 = __toESM(require("react"), 1);
10783
+ var React68 = __toESM(require("react"), 1);
10508
10784
  var import_react_dom13 = require("react-dom");
10509
10785
  function position(anchor, pop, placement) {
10510
10786
  const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
@@ -10522,15 +10798,15 @@ function position(anchor, pop, placement) {
10522
10798
  const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
10523
10799
  return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
10524
10800
  }
10525
- var Popover = React67.forwardRef(function Popover2(props, ref) {
10801
+ var Popover = React68.forwardRef(function Popover2(props, ref) {
10526
10802
  const t = useStrings();
10527
10803
  const density = useDensity();
10528
10804
  const auto = uid(), id = props.id || auto;
10529
10805
  const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
10530
10806
  const open = !!st[0];
10531
- const wrap = React67.useRef(null), pop = React67.useRef(null), popMerged = useMergedRef(ref, pop);
10532
- const pos = React67.useState(null), mounted = useMounted();
10533
- const inTree = React67.useRef(false);
10807
+ const wrap = React68.useRef(null), pop = React68.useRef(null), popMerged = useMergedRef(ref, pop);
10808
+ const pos = React68.useState(null), mounted = useMounted();
10809
+ const inTree = React68.useRef(false);
10534
10810
  function trigger() {
10535
10811
  return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
10536
10812
  }
@@ -10557,7 +10833,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10557
10833
  },
10558
10834
  [open, mounted, props.placement]
10559
10835
  );
10560
- React67.useEffect(
10836
+ React68.useEffect(
10561
10837
  function() {
10562
10838
  if (!open || !mounted) return;
10563
10839
  if (props.autoFocus !== false && pop.current) {
@@ -10589,9 +10865,9 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10589
10865
  },
10590
10866
  [open, mounted]
10591
10867
  );
10592
- const child = React67.Children.only(props.trigger);
10868
+ const child = React68.Children.only(props.trigger);
10593
10869
  const panel = open && mounted ? (0, import_react_dom13.createPortal)(
10594
- /* @__PURE__ */ React67.createElement(
10870
+ /* @__PURE__ */ React68.createElement(
10595
10871
  "div",
10596
10872
  {
10597
10873
  ref: popMerged,
@@ -10621,17 +10897,17 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10621
10897
  } else trapTab(e, pop.current);
10622
10898
  }
10623
10899
  },
10624
- props.title ? /* @__PURE__ */ React67.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React67.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React67.createElement(
10900
+ 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(
10625
10901
  IconButton,
10626
10902
  {
10627
- icon: /* @__PURE__ */ React67.createElement(IconX, null),
10903
+ icon: /* @__PURE__ */ React68.createElement(IconX, null),
10628
10904
  label: t.close,
10629
10905
  onClick: function() {
10630
10906
  close(true);
10631
10907
  }
10632
10908
  }
10633
10909
  )) : null,
10634
- /* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10910
+ /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10635
10911
  close: function() {
10636
10912
  close(true);
10637
10913
  }
@@ -10639,7 +10915,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10639
10915
  ),
10640
10916
  document.body
10641
10917
  ) : null;
10642
- return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
10918
+ return /* @__PURE__ */ React68.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React68.cloneElement(child, {
10643
10919
  onClick: function(e) {
10644
10920
  if (child.props.onClick) child.props.onClick(e);
10645
10921
  st[1](!open);
@@ -10651,7 +10927,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10651
10927
  });
10652
10928
 
10653
10929
  // src/NumberField.tsx
10654
- var React68 = __toESM(require("react"), 1);
10930
+ var React69 = __toESM(require("react"), 1);
10655
10931
  function decimalsOf(n3) {
10656
10932
  const s = String(n3);
10657
10933
  const i = s.indexOf(".");
@@ -10664,7 +10940,7 @@ function parse(text2) {
10664
10940
  if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
10665
10941
  return Number(s);
10666
10942
  }
10667
- var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10943
+ var NumberField = React69.forwardRef(function NumberField2(props, ref) {
10668
10944
  const t = useStrings();
10669
10945
  const auto = uid(), id = props.id || auto;
10670
10946
  const step = props.step || 1;
@@ -10675,7 +10951,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10675
10951
  props.onChange
10676
10952
  );
10677
10953
  const value = st[0], setValue = st[1];
10678
- const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
10954
+ const draftState = React69.useState(null), draft = draftState[0], setDraft = draftState[1];
10679
10955
  function fmt2(n3) {
10680
10956
  if (n3 == null || isNaN(n3)) return "";
10681
10957
  return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
@@ -10724,7 +11000,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10724
11000
  };
10725
11001
  const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
10726
11002
  const stepper = props.stepper !== false && !props.readOnly;
10727
- return /* @__PURE__ */ React68.createElement(
11003
+ return /* @__PURE__ */ React69.createElement(
10728
11004
  Field,
10729
11005
  {
10730
11006
  id,
@@ -10736,7 +11012,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10736
11012
  disabled: props.disabled,
10737
11013
  className: cx(touchClass(props.touchHeight), props.className)
10738
11014
  },
10739
- /* @__PURE__ */ React68.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React68.createElement(
11015
+ /* @__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(
10740
11016
  "input",
10741
11017
  {
10742
11018
  ref,
@@ -10783,7 +11059,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10783
11059
  },
10784
11060
  onKeyDown
10785
11061
  }
10786
- ), props.suffix != null ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React68.createElement(
11062
+ ), 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(
10787
11063
  "button",
10788
11064
  {
10789
11065
  type: "button",
@@ -10799,8 +11075,8 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10799
11075
  nudge(-step);
10800
11076
  }
10801
11077
  },
10802
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
10803
- ), /* @__PURE__ */ React68.createElement(
11078
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconMinus, null) })
11079
+ ), /* @__PURE__ */ React69.createElement(
10804
11080
  "button",
10805
11081
  {
10806
11082
  type: "button",
@@ -10816,14 +11092,14 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10816
11092
  nudge(step);
10817
11093
  }
10818
11094
  },
10819
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
11095
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconPlus, null) })
10820
11096
  )) : null)
10821
11097
  );
10822
11098
  });
10823
11099
 
10824
11100
  // src/Stepper.tsx
10825
- var React69 = __toESM(require("react"), 1);
10826
- var Stepper = React69.forwardRef(function Stepper2(props, ref) {
11101
+ var React70 = __toESM(require("react"), 1);
11102
+ var Stepper = React70.forwardRef(function Stepper2(props, ref) {
10827
11103
  const t = useStrings();
10828
11104
  const idBase = uid();
10829
11105
  const steps = props.steps || [];
@@ -10834,22 +11110,22 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10834
11110
  if (at < 0) at = 0;
10835
11111
  const vertical = props.orientation === "vertical";
10836
11112
  const cur2 = steps[at];
10837
- return /* @__PURE__ */ React69.createElement(
11113
+ return /* @__PURE__ */ React70.createElement(
10838
11114
  "nav",
10839
11115
  {
10840
11116
  ref,
10841
11117
  "aria-label": props.label,
10842
11118
  className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
10843
11119
  },
10844
- /* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
11120
+ /* @__PURE__ */ React70.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
10845
11121
  const state = i < at ? "done" : i === at ? "current" : "upcoming";
10846
11122
  const error = s.status === "error";
10847
- const marker = /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconCheck, null) }) : i + 1);
11123
+ 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);
10848
11124
  const note = error ? t.stepError : state === "done" ? t.stepDone : "";
10849
11125
  const clickable = state === "done" && !!props.onStepClick;
10850
11126
  const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
10851
11127
  const descId = idBase + "-step-" + i;
10852
- const text2 = /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React69.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React69.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React69.createElement(
11128
+ 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(
10853
11129
  "span",
10854
11130
  {
10855
11131
  className: "aura-stepper__desc",
@@ -10858,14 +11134,14 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10858
11134
  },
10859
11135
  s.description
10860
11136
  ) : null);
10861
- return /* @__PURE__ */ React69.createElement(
11137
+ return /* @__PURE__ */ React70.createElement(
10862
11138
  "li",
10863
11139
  {
10864
11140
  key: s.id,
10865
11141
  className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
10866
11142
  "aria-current": state === "current" ? "step" : void 0
10867
11143
  },
10868
- clickable ? /* @__PURE__ */ React69.createElement(
11144
+ clickable ? /* @__PURE__ */ React70.createElement(
10869
11145
  "button",
10870
11146
  {
10871
11147
  type: "button",
@@ -10877,19 +11153,19 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10877
11153
  },
10878
11154
  marker,
10879
11155
  text2
10880
- ) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
11156
+ ) : /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__step" }, marker, text2)
10881
11157
  );
10882
11158
  })),
10883
- !vertical && cur2 ? /* @__PURE__ */ React69.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
11159
+ !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
10884
11160
  );
10885
11161
  });
10886
11162
 
10887
11163
  // src/SegmentedControl.tsx
10888
- var React70 = __toESM(require("react"), 1);
11164
+ var React71 = __toESM(require("react"), 1);
10889
11165
  function toOpt2(o) {
10890
11166
  return typeof o === "object" ? o : { value: o, label: o };
10891
11167
  }
10892
- var SegmentedControl = React70.forwardRef(
11168
+ var SegmentedControl = React71.forwardRef(
10893
11169
  function SegmentedControl2(props, ref) {
10894
11170
  const options = (props.options || []).map(toOpt2);
10895
11171
  useAutoTip();
@@ -10903,7 +11179,7 @@ var SegmentedControl = React70.forwardRef(
10903
11179
  );
10904
11180
  const value = st[0], setValue = st[1];
10905
11181
  const auto = uid(), id = props.id || auto;
10906
- const refs = React70.useRef([]);
11182
+ const refs = React71.useRef([]);
10907
11183
  const selIdx = options.findIndex(function(o) {
10908
11184
  return o.value === value;
10909
11185
  });
@@ -10936,7 +11212,7 @@ var SegmentedControl = React70.forwardRef(
10936
11212
  move(options.length, -1);
10937
11213
  }
10938
11214
  }
10939
- return /* @__PURE__ */ React70.createElement(
11215
+ return /* @__PURE__ */ React71.createElement(
10940
11216
  "div",
10941
11217
  {
10942
11218
  ref,
@@ -10956,7 +11232,7 @@ var SegmentedControl = React70.forwardRef(
10956
11232
  options.map(function(o, i) {
10957
11233
  const on = o.value === value;
10958
11234
  const off = props.disabled || o.disabled;
10959
- return /* @__PURE__ */ React70.createElement(
11235
+ return /* @__PURE__ */ React71.createElement(
10960
11236
  "button",
10961
11237
  {
10962
11238
  key: o.value,
@@ -10978,8 +11254,8 @@ var SegmentedControl = React70.forwardRef(
10978
11254
  onKeyDown(e, i);
10979
11255
  }
10980
11256
  },
10981
- o.icon ? /* @__PURE__ */ React70.createElement(Icon, { name: o.icon }) : null,
10982
- o.iconOnly ? null : /* @__PURE__ */ React70.createElement("span", null, o.label)
11257
+ o.icon ? /* @__PURE__ */ React71.createElement(Icon, { name: o.icon }) : null,
11258
+ o.iconOnly ? null : /* @__PURE__ */ React71.createElement("span", null, o.label)
10983
11259
  );
10984
11260
  })
10985
11261
  );