@jirawatpyk/aura-react 5.69.0 → 5.71.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,
@@ -472,6 +473,11 @@ var IconEllipsis = /* @__PURE__ */ defineIcon("ellipsis", [
472
473
  ["circle", { cx: "19", cy: "12", r: "1" }],
473
474
  ["circle", { cx: "5", cy: "12", r: "1" }]
474
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
+ ]);
475
481
  var IconCalendar = /* @__PURE__ */ defineIcon("calendar", [
476
482
  ["path", { d: "M8 2v3" }],
477
483
  ["path", { d: "M16 2v3" }],
@@ -721,7 +727,7 @@ var PILL_ICON = {
721
727
  };
722
728
  function statusPillElement(props, ref) {
723
729
  const tone2 = props.tone || toneFor(props.children);
724
- const rest = omit(props, ["tone", "className", "children", "wrap"]);
730
+ const rest = omit(props, ["tone", "className", "children", "wrap", "busy"]);
725
731
  return /* @__PURE__ */ React4.createElement(
726
732
  "span",
727
733
  {
@@ -729,10 +735,26 @@ function statusPillElement(props, ref) {
729
735
  ref,
730
736
  className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
731
737
  },
732
- /* @__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 }),
733
739
  props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
734
740
  );
735
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
+ }
736
758
  function badgeElement(props, ref) {
737
759
  const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
738
760
  return /* @__PURE__ */ React4.createElement(
@@ -1021,6 +1043,7 @@ var th = {
1021
1043
  statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
1022
1044
  opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
1023
1045
  required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
1046
+ firstPage: "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",
1024
1047
  filtersApplied: function(n3) {
1025
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";
1026
1049
  },
@@ -1163,6 +1186,7 @@ var sv = {
1163
1186
  statusUnknown: "Ingen data",
1164
1187
  opensInNewTab: "\xF6ppnas i en ny flik",
1165
1188
  required: "obligatoriskt",
1189
+ firstPage: "F\xF6rsta sidan",
1166
1190
  filtersApplied: function(n3) {
1167
1191
  return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
1168
1192
  },
@@ -1306,6 +1330,7 @@ var STRINGS = {
1306
1330
  statusUnknown: "No data",
1307
1331
  opensInNewTab: "opens in a new tab",
1308
1332
  required: "required",
1333
+ firstPage: "First page",
1309
1334
  filtersApplied: function(n3) {
1310
1335
  return "Filters, " + n3.toLocaleString("en") + " applied";
1311
1336
  },
@@ -1366,6 +1391,8 @@ function useStrings() {
1366
1391
  function ButtonLink(props, ref, Link) {
1367
1392
  const variant = props.variant || "primary";
1368
1393
  const disabled = !!props.disabled;
1394
+ const ad = props["aria-disabled"];
1395
+ const gated = !disabled && (ad === true || ad === "true");
1369
1396
  const rest = omit(props, [
1370
1397
  "variant",
1371
1398
  "className",
@@ -1387,7 +1414,7 @@ function ButtonLink(props, ref, Link) {
1387
1414
  ref,
1388
1415
  href: disabled ? void 0 : props.href,
1389
1416
  role: disabled ? "link" : void 0,
1390
- "aria-disabled": disabled || void 0,
1417
+ "aria-disabled": disabled || gated || void 0,
1391
1418
  tabIndex: disabled ? -1 : props.tabIndex,
1392
1419
  className: buttonClass({
1393
1420
  variant,
@@ -1396,7 +1423,9 @@ function ButtonLink(props, ref, Link) {
1396
1423
  touchHeight: props.touchHeight,
1397
1424
  className: props.className
1398
1425
  }),
1399
- onClick: disabled ? void 0 : props.onClick
1426
+ onClick: disabled ? void 0 : gated ? function(e) {
1427
+ e.preventDefault();
1428
+ } : props.onClick
1400
1429
  },
1401
1430
  props.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: props.icon }) : null,
1402
1431
  props.children,
@@ -1414,6 +1443,8 @@ var Button = React6.forwardRef(
1414
1443
  const loading = !!props.loading;
1415
1444
  const ad = props["aria-disabled"];
1416
1445
  const blocked = loading || ad === true || ad === "true";
1446
+ const ab = props["aria-busy"];
1447
+ const busy = loading || ab === true || ab === "true";
1417
1448
  const rest = omit(props, [
1418
1449
  "variant",
1419
1450
  "className",
@@ -1441,7 +1472,7 @@ var Button = React6.forwardRef(
1441
1472
  loading,
1442
1473
  className: props.className
1443
1474
  }),
1444
- "aria-busy": loading || void 0,
1475
+ "aria-busy": busy || void 0,
1445
1476
  "aria-disabled": blocked || void 0,
1446
1477
  onClick: blocked ? function(e) {
1447
1478
  e.preventDefault();
@@ -1646,6 +1677,8 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1646
1677
  const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
1647
1678
  useAutoTip();
1648
1679
  const own = props.title !== void 0;
1680
+ const ad = props["aria-disabled"];
1681
+ const blocked = ad === true || ad === "true";
1649
1682
  return /* @__PURE__ */ React8.createElement(
1650
1683
  "button",
1651
1684
  {
@@ -1655,6 +1688,9 @@ var IconButton = React8.forwardRef(function IconButton2(props, ref) {
1655
1688
  "aria-label": props.label,
1656
1689
  "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
1657
1690
  "data-aura-tip": own ? void 0 : props.label,
1691
+ onClick: blocked ? function(e) {
1692
+ e.preventDefault();
1693
+ } : props.onClick,
1658
1694
  className: cx(
1659
1695
  "aura-icon-btn",
1660
1696
  props.tone === "danger" && "aura-icon-btn--danger",
@@ -8059,7 +8095,10 @@ var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
8059
8095
  props.title
8060
8096
  );
8061
8097
  const hasActions = props.actions != null && props.actions !== false;
8062
- const bar = hasActions && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
8098
+ const hasBarActions = props.actionsBar != null && props.actionsBar !== false;
8099
+ const bar = (hasActions || hasBarActions) && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
8100
+ const split = !!bar && hasBarActions;
8101
+ const status = bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null;
8063
8102
  return h8(
8064
8103
  "div",
8065
8104
  Object.assign(attrs2, {
@@ -8091,12 +8130,12 @@ var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
8091
8130
  shown(props.subtitle) ? h8("div", { className: "aura-page-header__subtitle" }, props.subtitle) : null,
8092
8131
  props.meta != null && props.meta !== false ? h8("div", { className: cx("aura-page-header__meta", richMeta && "aura-page-header__meta--rich") }, props.meta) : null
8093
8132
  ),
8094
- props.actions != null && props.actions !== false ? h8(
8133
+ hasActions || hasBarActions ? split ? h8(
8095
8134
  "div",
8096
- { className: "aura-page-header__actions" },
8097
- bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null,
8098
- props.actions
8099
- ) : null
8135
+ { className: "aura-page-header__actions is-split" },
8136
+ props.actions,
8137
+ h8("div", { className: "aura-page-header__bar" }, status, props.actionsBar)
8138
+ ) : h8("div", { className: "aura-page-header__actions" }, status, props.actions, props.actionsBar) : null
8100
8139
  );
8101
8140
  });
8102
8141
 
@@ -8107,11 +8146,14 @@ var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
8107
8146
  const own = React45.useRef(null);
8108
8147
  const merged = useMergedRef(ref, own);
8109
8148
  const bar = props.actionsBarBelow;
8110
- const hasActions = props.actions != null && props.actions !== false;
8149
+ const hasActions = props.actions != null && props.actions !== false || props.actionsBar != null && props.actionsBar !== false;
8150
+ const split = props.actionsBar != null && props.actionsBar !== false;
8111
8151
  React45.useEffect(
8112
8152
  function() {
8113
8153
  if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
8114
- const el = own.current.querySelector(":scope > .aura-page-header__actions");
8154
+ const el = own.current.querySelector(
8155
+ split ? ":scope > .aura-page-header__actions > .aura-page-header__bar" : ":scope > .aura-page-header__actions"
8156
+ );
8115
8157
  if (!el) return;
8116
8158
  const root = document.documentElement;
8117
8159
  let checked = false;
@@ -8144,7 +8186,7 @@ var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
8144
8186
  else root.style.removeProperty(NAME);
8145
8187
  };
8146
8188
  },
8147
- [bar, hasActions]
8189
+ [bar, hasActions, split]
8148
8190
  );
8149
8191
  const focusTitle = !!props.focusTitleOnMount;
8150
8192
  React45.useEffect(function() {
@@ -9173,8 +9215,39 @@ function cellClass(base, p) {
9173
9215
  );
9174
9216
  }
9175
9217
  var Th = React53.forwardRef(function Th2(props, ref) {
9176
- const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
9218
+ const {
9219
+ align,
9220
+ numeric,
9221
+ mono,
9222
+ className,
9223
+ scope,
9224
+ label,
9225
+ card,
9226
+ skeleton,
9227
+ skeletonWidth,
9228
+ wrap,
9229
+ sort,
9230
+ onSort,
9231
+ sortHref,
9232
+ linkComponent,
9233
+ ...rest
9234
+ } = props;
9177
9235
  const stacked = React53.useContext(StackLabels) != null;
9236
+ const Link = useLinkComponent(linkComponent);
9237
+ const sortable = !!onSort || sortHref != null;
9238
+ const ariaSort = sort || (sortable ? "none" : void 0);
9239
+ let children = props.children;
9240
+ if (sortable) {
9241
+ const icon = /* @__PURE__ */ React53.createElement(
9242
+ Icon,
9243
+ {
9244
+ name: sort === "ascending" ? /* @__PURE__ */ React53.createElement(IconArrowUp, null) : sort === "descending" ? /* @__PURE__ */ React53.createElement(IconArrowDown, null) : /* @__PURE__ */ React53.createElement(IconArrowUpDown, null),
9245
+ size: 12
9246
+ }
9247
+ );
9248
+ const cls = cx("aura-table__sort", sort && sort !== "none" && "is-active");
9249
+ 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);
9250
+ }
9178
9251
  return /* @__PURE__ */ React53.createElement(
9179
9252
  "th",
9180
9253
  {
@@ -9183,8 +9256,10 @@ var Th = React53.forwardRef(function Th2(props, ref) {
9183
9256
  className: cellClass("aura-tbl__th", props),
9184
9257
  role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
9185
9258
  "data-card": stacked && (card === "title" || card === "action") ? card : void 0,
9259
+ "aria-sort": ariaSort,
9186
9260
  ...rest
9187
- }
9261
+ },
9262
+ children
9188
9263
  );
9189
9264
  });
9190
9265
  var Td = React53.forwardRef(function Td2(props, ref) {
@@ -9650,7 +9725,59 @@ var TimePicker = React57.forwardRef(function TimePicker2(props, ref) {
9650
9725
  });
9651
9726
 
9652
9727
  // src/FileUpload.tsx
9728
+ var React59 = __toESM(require("react"), 1);
9729
+
9730
+ // src/Progress.tsx
9653
9731
  var React58 = __toESM(require("react"), 1);
9732
+ var Progress = React58.forwardRef(function Progress2(props, ref) {
9733
+ const t = useStrings();
9734
+ const auto = uid(), id = props.id || auto;
9735
+ const max = props.max || 100, det = props.value != null;
9736
+ const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
9737
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
9738
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
9739
+ const keyed = !!props.legend && spct > 0;
9740
+ 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;
9741
+ const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
9742
+ return /* @__PURE__ */ React58.createElement(
9743
+ "div",
9744
+ {
9745
+ ref,
9746
+ className: cx(
9747
+ "aura-progress",
9748
+ "aura-progress--" + tone(props.tone || "accent"),
9749
+ props.size === "sm" && "is-sm",
9750
+ props.className
9751
+ )
9752
+ },
9753
+ 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,
9754
+ /* @__PURE__ */ React58.createElement(
9755
+ "div",
9756
+ {
9757
+ className: cx("aura-progress__track", !det && "is-indeterminate"),
9758
+ role: "progressbar",
9759
+ "aria-labelledby": props.label ? id + "-label" : void 0,
9760
+ "aria-label": props.label ? void 0 : props["aria-label"],
9761
+ "aria-valuemin": det ? 0 : void 0,
9762
+ "aria-valuemax": det ? max : void 0,
9763
+ "aria-valuenow": det ? props.value : void 0,
9764
+ "aria-valuetext": det ? valueText : void 0
9765
+ },
9766
+ /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
9767
+ sec ? /* @__PURE__ */ React58.createElement(
9768
+ "span",
9769
+ {
9770
+ className: "aura-progress__bar aura-progress__bar--reserved",
9771
+ style: { left: pct + "%", width: spct + "%" }
9772
+ }
9773
+ ) : null
9774
+ ),
9775
+ 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,
9776
+ props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
9777
+ );
9778
+ });
9779
+
9780
+ // src/FileUpload.tsx
9654
9781
  function matches(file, accept) {
9655
9782
  if (!accept) return true;
9656
9783
  const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
@@ -9674,24 +9801,40 @@ function describeAccept(accept, t) {
9674
9801
  }).join(", ");
9675
9802
  }
9676
9803
  var seq = 0;
9677
- var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9804
+ var FileUpload = React59.forwardRef(function FileUpload2(props, ref) {
9678
9805
  const t = useStrings();
9679
9806
  const auto = uid(), id = props.id || auto;
9680
9807
  const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
9681
9808
  const items2 = st[0] || [];
9682
- const dragState = React58.useState(false), over = dragState[0];
9683
- const inputRef = React58.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9684
- const urls = React58.useRef({});
9809
+ const dragState = React59.useState(false), over = dragState[0];
9810
+ const inputRef = React59.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9811
+ const urls = React59.useRef({});
9685
9812
  const maxFiles = props.multiple ? props.maxFiles : 1;
9686
9813
  const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
9687
- React58.useEffect(function() {
9814
+ const pickState = React59.useState(null);
9815
+ const buttonRef = React59.useRef(null);
9816
+ const buttonMode = props.variant === "button";
9817
+ React59.useEffect(
9818
+ function() {
9819
+ const el = inputRef.current;
9820
+ if (!buttonMode || !el) return;
9821
+ el.focus = function(o) {
9822
+ if (buttonRef.current) buttonRef.current.focus(o);
9823
+ };
9824
+ return function() {
9825
+ delete el.focus;
9826
+ };
9827
+ },
9828
+ [buttonMode]
9829
+ );
9830
+ React59.useEffect(function() {
9688
9831
  return function() {
9689
9832
  Object.keys(urls.current).forEach(function(k) {
9690
9833
  URL.revokeObjectURL(urls.current[k]);
9691
9834
  });
9692
9835
  };
9693
9836
  }, []);
9694
- React58.useEffect(
9837
+ React59.useEffect(
9695
9838
  function() {
9696
9839
  const el = inputRef.current;
9697
9840
  if (!el || !props.name || typeof DataTransfer === "undefined") return;
@@ -9751,7 +9894,96 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9751
9894
  if (inputRef.current) inputRef.current.focus();
9752
9895
  }
9753
9896
  const error = props.error;
9754
- return /* @__PURE__ */ React58.createElement(
9897
+ if (props.variant === "button") {
9898
+ const err = error || pickState[0];
9899
+ const desc = [err ? id + "-error" : props.hint ? id + "-hint" : null, note ? id + "-note" : null].filter(Boolean).join(" ") || void 0;
9900
+ return /* @__PURE__ */ React59.createElement(
9901
+ Field,
9902
+ {
9903
+ id,
9904
+ label: props.label,
9905
+ labelAs: "span",
9906
+ labelId: id + "-label",
9907
+ hint: props.hint,
9908
+ error: err,
9909
+ required: props.required,
9910
+ optional: props.optional,
9911
+ disabled: props.disabled,
9912
+ className: cx("aura-upload-field", props.className)
9913
+ },
9914
+ /* @__PURE__ */ React59.createElement("div", { className: "aura-upload-button" }, /* @__PURE__ */ React59.createElement(
9915
+ Button,
9916
+ {
9917
+ ref: buttonRef,
9918
+ id: id + "-button",
9919
+ variant: "secondary",
9920
+ icon: /* @__PURE__ */ React59.createElement(IconUpload, null),
9921
+ touchHeight: props.touchHeight,
9922
+ disabled: props.disabled,
9923
+ "aria-labelledby": props.label ? id + "-label " + id + "-button" : void 0,
9924
+ "aria-describedby": desc,
9925
+ onClick: function() {
9926
+ if (inputRef.current) inputRef.current.click();
9927
+ }
9928
+ },
9929
+ props.buttonLabel != null ? props.buttonLabel : props.multiple ? t.browse : t.browseOne
9930
+ ), /* @__PURE__ */ React59.createElement(
9931
+ "input",
9932
+ {
9933
+ ref: inputMerged,
9934
+ id,
9935
+ type: "file",
9936
+ className: "aura-upload__input",
9937
+ tabIndex: -1,
9938
+ "aria-hidden": true,
9939
+ accept: props.accept,
9940
+ multiple: !!props.multiple,
9941
+ disabled: props.disabled,
9942
+ name: props.name,
9943
+ required: props.name ? props.required : void 0,
9944
+ onInvalid: function(e) {
9945
+ e.preventDefault();
9946
+ pickState[1](props.multiple ? t.browse : t.browseOne);
9947
+ if (buttonRef.current) buttonRef.current.focus();
9948
+ },
9949
+ onChange: function(e) {
9950
+ const files = Array.prototype.slice.call(e.target.files || []);
9951
+ if (!files.length) return;
9952
+ let refused = null;
9953
+ const ok = files.filter(function(f) {
9954
+ const why = !matches(f, props.accept) ? t.fileWrongType : props.maxSize && f.size > props.maxSize ? t.fileTooBig(formatBytes(props.maxSize)) : null;
9955
+ if (why && !refused) refused = why;
9956
+ return !why;
9957
+ });
9958
+ pickState[1](refused);
9959
+ if (!props.name) e.target.value = "";
9960
+ else if (refused) {
9961
+ try {
9962
+ const dt = new DataTransfer();
9963
+ ok.forEach(function(f) {
9964
+ dt.items.add(f);
9965
+ });
9966
+ e.target.files = dt.files;
9967
+ } catch (x) {
9968
+ e.target.value = "";
9969
+ }
9970
+ }
9971
+ if (ok.length && props.onSelect) props.onSelect(ok);
9972
+ }
9973
+ }
9974
+ ), note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null),
9975
+ props.progress !== void 0 ? /* @__PURE__ */ React59.createElement(
9976
+ Progress,
9977
+ {
9978
+ className: "aura-upload-button__progress",
9979
+ size: "sm",
9980
+ value: props.progress == null ? void 0 : props.progress,
9981
+ label: t.uploading
9982
+ }
9983
+ ) : null
9984
+ );
9985
+ }
9986
+ return /* @__PURE__ */ React59.createElement(
9755
9987
  Field,
9756
9988
  {
9757
9989
  id,
@@ -9763,7 +9995,7 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9763
9995
  disabled: props.disabled,
9764
9996
  className: props.className
9765
9997
  },
9766
- /* @__PURE__ */ React58.createElement(
9998
+ /* @__PURE__ */ React59.createElement(
9767
9999
  "div",
9768
10000
  {
9769
10001
  className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
@@ -9784,9 +10016,9 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9784
10016
  add(e.dataTransfer && e.dataTransfer.files);
9785
10017
  }
9786
10018
  },
9787
- /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
9788
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
9789
- /* @__PURE__ */ React58.createElement(
10019
+ /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
10020
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
10021
+ /* @__PURE__ */ React59.createElement(
9790
10022
  "input",
9791
10023
  {
9792
10024
  ref: inputMerged,
@@ -9808,12 +10040,12 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9808
10040
  }
9809
10041
  }
9810
10042
  ),
9811
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
9812
- note ? /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
10043
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
10044
+ note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
9813
10045
  ),
9814
- items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
10046
+ items2.length ? /* @__PURE__ */ React59.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
9815
10047
  const src = thumb(it);
9816
- 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(
10048
+ 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(
9817
10049
  "span",
9818
10050
  {
9819
10051
  className: "aura-upload__bar",
@@ -9823,11 +10055,11 @@ var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9823
10055
  "aria-valuemax": 100,
9824
10056
  "aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
9825
10057
  },
9826
- /* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
9827
- ) : null), /* @__PURE__ */ React58.createElement(
10058
+ /* @__PURE__ */ React59.createElement("span", { style: { width: (it.progress || 0) + "%" } })
10059
+ ) : null), /* @__PURE__ */ React59.createElement(
9828
10060
  IconButton,
9829
10061
  {
9830
- icon: /* @__PURE__ */ React58.createElement(IconX, null),
10062
+ icon: /* @__PURE__ */ React59.createElement(IconX, null),
9831
10063
  label: t.remove(it.name),
9832
10064
  onClick: function() {
9833
10065
  remove(it);
@@ -10143,9 +10375,9 @@ function createTheme(opts) {
10143
10375
  }
10144
10376
 
10145
10377
  // src/ThemeStyle.tsx
10146
- var React59 = __toESM(require("react"), 1);
10378
+ var React60 = __toESM(require("react"), 1);
10147
10379
  function ThemeStyle(props) {
10148
- const css = React59.useMemo(
10380
+ const css = React60.useMemo(
10149
10381
  function() {
10150
10382
  try {
10151
10383
  return createTheme({
@@ -10162,11 +10394,11 @@ function ThemeStyle(props) {
10162
10394
  [props.brand, props.signal, props.primary, props.name, props.selector]
10163
10395
  );
10164
10396
  if (css === null) return null;
10165
- return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10397
+ return /* @__PURE__ */ React60.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10166
10398
  }
10167
10399
 
10168
10400
  // src/colorScheme.tsx
10169
- var React60 = __toESM(require("react"), 1);
10401
+ var React61 = __toESM(require("react"), 1);
10170
10402
 
10171
10403
  // src/colorSchemeScript.ts
10172
10404
  var DEFAULT_KEY = "aura-color-scheme";
@@ -10183,7 +10415,7 @@ function colorSchemeScript(options) {
10183
10415
 
10184
10416
  // src/colorScheme.tsx
10185
10417
  function ColorSchemeScript(props) {
10186
- return /* @__PURE__ */ React60.createElement(
10418
+ return /* @__PURE__ */ React61.createElement(
10187
10419
  "script",
10188
10420
  {
10189
10421
  "data-aura-color-scheme": "",
@@ -10208,7 +10440,7 @@ function apply(scheme) {
10208
10440
  function useColorScheme(options) {
10209
10441
  const key = options && options.storageKey || DEFAULT_KEY;
10210
10442
  const fallback = options && options.defaultScheme || "system";
10211
- const subscribe2 = React60.useCallback(
10443
+ const subscribe2 = React61.useCallback(
10212
10444
  function(cb) {
10213
10445
  const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
10214
10446
  function onSystem() {
@@ -10230,7 +10462,7 @@ function useColorScheme(options) {
10230
10462
  },
10231
10463
  [fallback, key]
10232
10464
  );
10233
- const snapshot = React60.useSyncExternalStore(
10465
+ const snapshot = React61.useSyncExternalStore(
10234
10466
  subscribe2,
10235
10467
  function() {
10236
10468
  const s = readScheme(fallback);
@@ -10241,7 +10473,7 @@ function useColorScheme(options) {
10241
10473
  }
10242
10474
  );
10243
10475
  const parts = snapshot.split("|");
10244
- const setScheme = React60.useCallback(
10476
+ const setScheme = React61.useCallback(
10245
10477
  function(next) {
10246
10478
  if (!valid(next)) return;
10247
10479
  try {
@@ -10260,14 +10492,14 @@ function ColorSchemeToggle(props) {
10260
10492
  const cs = useColorScheme(props);
10261
10493
  const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
10262
10494
  const label = props.label || t.colorScheme;
10263
- return /* @__PURE__ */ React60.createElement(
10495
+ return /* @__PURE__ */ React61.createElement(
10264
10496
  DropdownMenu,
10265
10497
  {
10266
10498
  label,
10267
- trigger: /* @__PURE__ */ React60.createElement(
10499
+ trigger: /* @__PURE__ */ React61.createElement(
10268
10500
  IconButton,
10269
10501
  {
10270
- icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
10502
+ icon: cs.resolved === "dark" ? /* @__PURE__ */ React61.createElement(IconMoon, null) : /* @__PURE__ */ React61.createElement(IconSun, null),
10271
10503
  label: label + ": " + names[cs.scheme]
10272
10504
  }
10273
10505
  ),
@@ -10285,59 +10517,9 @@ function ColorSchemeToggle(props) {
10285
10517
  }
10286
10518
 
10287
10519
  // src/Badge.tsx
10288
- var React61 = __toESM(require("react"), 1);
10289
- var Badge = React61.forwardRef(function Badge2(props, ref) {
10290
- return badgeElement(props, ref);
10291
- });
10292
-
10293
- // src/Progress.tsx
10294
10520
  var React62 = __toESM(require("react"), 1);
10295
- var Progress = React62.forwardRef(function Progress2(props, ref) {
10296
- const t = useStrings();
10297
- const auto = uid(), id = props.id || auto;
10298
- const max = props.max || 100, det = props.value != null;
10299
- const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10300
- const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
10301
- const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
10302
- const keyed = !!props.legend && spct > 0;
10303
- 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;
10304
- const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
10305
- return /* @__PURE__ */ React62.createElement(
10306
- "div",
10307
- {
10308
- ref,
10309
- className: cx(
10310
- "aura-progress",
10311
- "aura-progress--" + tone(props.tone || "accent"),
10312
- props.size === "sm" && "is-sm",
10313
- props.className
10314
- )
10315
- },
10316
- 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,
10317
- /* @__PURE__ */ React62.createElement(
10318
- "div",
10319
- {
10320
- className: cx("aura-progress__track", !det && "is-indeterminate"),
10321
- role: "progressbar",
10322
- "aria-labelledby": props.label ? id + "-label" : void 0,
10323
- "aria-label": props.label ? void 0 : props["aria-label"],
10324
- "aria-valuemin": det ? 0 : void 0,
10325
- "aria-valuemax": det ? max : void 0,
10326
- "aria-valuenow": det ? props.value : void 0,
10327
- "aria-valuetext": det ? valueText : void 0
10328
- },
10329
- /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
10330
- sec ? /* @__PURE__ */ React62.createElement(
10331
- "span",
10332
- {
10333
- className: "aura-progress__bar aura-progress__bar--reserved",
10334
- style: { left: pct + "%", width: spct + "%" }
10335
- }
10336
- ) : null
10337
- ),
10338
- 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,
10339
- props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
10340
- );
10521
+ var Badge = React62.forwardRef(function Badge2(props, ref) {
10522
+ return badgeElement(props, ref);
10341
10523
  });
10342
10524
 
10343
10525
  // src/Skeleton.tsx
@@ -10396,9 +10578,56 @@ function pageList(page, count, sib) {
10396
10578
  if (count > 1) out.push(count);
10397
10579
  return out;
10398
10580
  }
10399
- var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10581
+ function cursorNav(props, ref, Link, t) {
10582
+ const links = props.firstHref != null || props.previousHref != null || props.nextHref != null;
10583
+ function step(key, href, on, has, label, rel, icon, after) {
10584
+ 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);
10585
+ const cls = "aura-page aura-page--step";
10586
+ if (has === false || !href && !on)
10587
+ 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);
10588
+ if (href != null)
10589
+ return /* @__PURE__ */ React65.createElement(
10590
+ Link,
10591
+ {
10592
+ key,
10593
+ href,
10594
+ rel,
10595
+ className: cls,
10596
+ onClick: function(e) {
10597
+ if (on && plainClick(e)) {
10598
+ e.preventDefault();
10599
+ on();
10600
+ }
10601
+ }
10602
+ },
10603
+ body
10604
+ );
10605
+ return /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, onClick: on }, body);
10606
+ }
10607
+ return /* @__PURE__ */ React65.createElement(
10608
+ "nav",
10609
+ {
10610
+ ref,
10611
+ className: cx("aura-pagination", "aura-pagination--cursor", props.className),
10612
+ "aria-label": props.label || t.pagination
10613
+ },
10614
+ props.status != null && props.status !== false && props.status !== "" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__status" }, props.status) : null,
10615
+ /* @__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(
10616
+ "prev",
10617
+ props.previousHref,
10618
+ props.onPrevious,
10619
+ props.hasPrevious,
10620
+ t.prevPage,
10621
+ "prev",
10622
+ /* @__PURE__ */ React65.createElement(IconChevronLeft, null),
10623
+ false
10624
+ ), step("next", props.nextHref, props.onNext, props.hasNext, t.nextPage, "next", /* @__PURE__ */ React65.createElement(IconChevronRight, null), true))
10625
+ );
10626
+ }
10627
+ var Pagination = React65.forwardRef(function Pagination2(all, ref) {
10400
10628
  const t = useStrings();
10401
10629
  useAutoTip();
10630
+ const props = all;
10402
10631
  const count = Math.max(1, props.pageCount || 1);
10403
10632
  const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
10404
10633
  const page = Math.min(count, Math.max(1, st[0]));
@@ -10407,6 +10636,7 @@ var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10407
10636
  }
10408
10637
  const link = props.getHref;
10409
10638
  const Link = useLinkComponent(props.linkComponent);
10639
+ if (all.mode === "cursor") return cursorNav(all, ref, Link, t);
10410
10640
  function item(p, label, extra) {
10411
10641
  const common = Object.assign(
10412
10642
  {
@@ -10477,9 +10707,15 @@ var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10477
10707
  })), /* @__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));
10478
10708
  });
10479
10709
 
10480
- // src/Accordion.tsx
10710
+ // src/Spinner.tsx
10481
10711
  var React66 = __toESM(require("react"), 1);
10482
- var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10712
+ var Spinner = React66.forwardRef(function Spinner2(props, ref) {
10713
+ return spinnerElement(props, ref);
10714
+ });
10715
+
10716
+ // src/Accordion.tsx
10717
+ var React67 = __toESM(require("react"), 1);
10718
+ var Accordion = React67.forwardRef(function Accordion2(props, ref) {
10483
10719
  const auto = uid(), base = props.id || auto;
10484
10720
  const multiple = props.type === "multiple";
10485
10721
  const st = useMaybeControlled(
@@ -10517,9 +10753,9 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10517
10753
  n3.focus();
10518
10754
  }
10519
10755
  }
10520
- return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10756
+ return /* @__PURE__ */ React67.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10521
10757
  const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
10522
- 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(
10758
+ 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(
10523
10759
  "button",
10524
10760
  {
10525
10761
  type: "button",
@@ -10532,10 +10768,10 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10532
10768
  toggle(it.id);
10533
10769
  }
10534
10770
  },
10535
- it.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10536
- /* @__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),
10537
- /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10538
- )), /* @__PURE__ */ React66.createElement(
10771
+ it.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10772
+ /* @__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),
10773
+ /* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10774
+ )), /* @__PURE__ */ React67.createElement(
10539
10775
  "div",
10540
10776
  {
10541
10777
  id: pid,
@@ -10550,7 +10786,7 @@ var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10550
10786
  });
10551
10787
 
10552
10788
  // src/Popover.tsx
10553
- var React67 = __toESM(require("react"), 1);
10789
+ var React68 = __toESM(require("react"), 1);
10554
10790
  var import_react_dom13 = require("react-dom");
10555
10791
  function position(anchor, pop, placement) {
10556
10792
  const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
@@ -10568,15 +10804,15 @@ function position(anchor, pop, placement) {
10568
10804
  const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
10569
10805
  return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
10570
10806
  }
10571
- var Popover = React67.forwardRef(function Popover2(props, ref) {
10807
+ var Popover = React68.forwardRef(function Popover2(props, ref) {
10572
10808
  const t = useStrings();
10573
10809
  const density = useDensity();
10574
10810
  const auto = uid(), id = props.id || auto;
10575
10811
  const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
10576
10812
  const open = !!st[0];
10577
- const wrap = React67.useRef(null), pop = React67.useRef(null), popMerged = useMergedRef(ref, pop);
10578
- const pos = React67.useState(null), mounted = useMounted();
10579
- const inTree = React67.useRef(false);
10813
+ const wrap = React68.useRef(null), pop = React68.useRef(null), popMerged = useMergedRef(ref, pop);
10814
+ const pos = React68.useState(null), mounted = useMounted();
10815
+ const inTree = React68.useRef(false);
10580
10816
  function trigger() {
10581
10817
  return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
10582
10818
  }
@@ -10603,7 +10839,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10603
10839
  },
10604
10840
  [open, mounted, props.placement]
10605
10841
  );
10606
- React67.useEffect(
10842
+ React68.useEffect(
10607
10843
  function() {
10608
10844
  if (!open || !mounted) return;
10609
10845
  if (props.autoFocus !== false && pop.current) {
@@ -10635,9 +10871,9 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10635
10871
  },
10636
10872
  [open, mounted]
10637
10873
  );
10638
- const child = React67.Children.only(props.trigger);
10874
+ const child = React68.Children.only(props.trigger);
10639
10875
  const panel = open && mounted ? (0, import_react_dom13.createPortal)(
10640
- /* @__PURE__ */ React67.createElement(
10876
+ /* @__PURE__ */ React68.createElement(
10641
10877
  "div",
10642
10878
  {
10643
10879
  ref: popMerged,
@@ -10667,17 +10903,17 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10667
10903
  } else trapTab(e, pop.current);
10668
10904
  }
10669
10905
  },
10670
- 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(
10906
+ 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(
10671
10907
  IconButton,
10672
10908
  {
10673
- icon: /* @__PURE__ */ React67.createElement(IconX, null),
10909
+ icon: /* @__PURE__ */ React68.createElement(IconX, null),
10674
10910
  label: t.close,
10675
10911
  onClick: function() {
10676
10912
  close(true);
10677
10913
  }
10678
10914
  }
10679
10915
  )) : null,
10680
- /* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10916
+ /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10681
10917
  close: function() {
10682
10918
  close(true);
10683
10919
  }
@@ -10685,7 +10921,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10685
10921
  ),
10686
10922
  document.body
10687
10923
  ) : null;
10688
- return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
10924
+ return /* @__PURE__ */ React68.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React68.cloneElement(child, {
10689
10925
  onClick: function(e) {
10690
10926
  if (child.props.onClick) child.props.onClick(e);
10691
10927
  st[1](!open);
@@ -10697,7 +10933,7 @@ var Popover = React67.forwardRef(function Popover2(props, ref) {
10697
10933
  });
10698
10934
 
10699
10935
  // src/NumberField.tsx
10700
- var React68 = __toESM(require("react"), 1);
10936
+ var React69 = __toESM(require("react"), 1);
10701
10937
  function decimalsOf(n3) {
10702
10938
  const s = String(n3);
10703
10939
  const i = s.indexOf(".");
@@ -10710,7 +10946,7 @@ function parse(text2) {
10710
10946
  if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
10711
10947
  return Number(s);
10712
10948
  }
10713
- var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10949
+ var NumberField = React69.forwardRef(function NumberField2(props, ref) {
10714
10950
  const t = useStrings();
10715
10951
  const auto = uid(), id = props.id || auto;
10716
10952
  const step = props.step || 1;
@@ -10721,7 +10957,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10721
10957
  props.onChange
10722
10958
  );
10723
10959
  const value = st[0], setValue = st[1];
10724
- const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
10960
+ const draftState = React69.useState(null), draft = draftState[0], setDraft = draftState[1];
10725
10961
  function fmt2(n3) {
10726
10962
  if (n3 == null || isNaN(n3)) return "";
10727
10963
  return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
@@ -10770,7 +11006,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10770
11006
  };
10771
11007
  const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
10772
11008
  const stepper = props.stepper !== false && !props.readOnly;
10773
- return /* @__PURE__ */ React68.createElement(
11009
+ return /* @__PURE__ */ React69.createElement(
10774
11010
  Field,
10775
11011
  {
10776
11012
  id,
@@ -10782,7 +11018,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10782
11018
  disabled: props.disabled,
10783
11019
  className: cx(touchClass(props.touchHeight), props.className)
10784
11020
  },
10785
- /* @__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(
11021
+ /* @__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(
10786
11022
  "input",
10787
11023
  {
10788
11024
  ref,
@@ -10829,7 +11065,7 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10829
11065
  },
10830
11066
  onKeyDown
10831
11067
  }
10832
- ), 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(
11068
+ ), 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(
10833
11069
  "button",
10834
11070
  {
10835
11071
  type: "button",
@@ -10845,8 +11081,8 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10845
11081
  nudge(-step);
10846
11082
  }
10847
11083
  },
10848
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
10849
- ), /* @__PURE__ */ React68.createElement(
11084
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconMinus, null) })
11085
+ ), /* @__PURE__ */ React69.createElement(
10850
11086
  "button",
10851
11087
  {
10852
11088
  type: "button",
@@ -10862,14 +11098,14 @@ var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10862
11098
  nudge(step);
10863
11099
  }
10864
11100
  },
10865
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
11101
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconPlus, null) })
10866
11102
  )) : null)
10867
11103
  );
10868
11104
  });
10869
11105
 
10870
11106
  // src/Stepper.tsx
10871
- var React69 = __toESM(require("react"), 1);
10872
- var Stepper = React69.forwardRef(function Stepper2(props, ref) {
11107
+ var React70 = __toESM(require("react"), 1);
11108
+ var Stepper = React70.forwardRef(function Stepper2(props, ref) {
10873
11109
  const t = useStrings();
10874
11110
  const idBase = uid();
10875
11111
  const steps = props.steps || [];
@@ -10880,22 +11116,22 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10880
11116
  if (at < 0) at = 0;
10881
11117
  const vertical = props.orientation === "vertical";
10882
11118
  const cur2 = steps[at];
10883
- return /* @__PURE__ */ React69.createElement(
11119
+ return /* @__PURE__ */ React70.createElement(
10884
11120
  "nav",
10885
11121
  {
10886
11122
  ref,
10887
11123
  "aria-label": props.label,
10888
11124
  className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
10889
11125
  },
10890
- /* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
11126
+ /* @__PURE__ */ React70.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
10891
11127
  const state = i < at ? "done" : i === at ? "current" : "upcoming";
10892
11128
  const error = s.status === "error";
10893
- 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);
11129
+ 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);
10894
11130
  const note = error ? t.stepError : state === "done" ? t.stepDone : "";
10895
11131
  const clickable = state === "done" && !!props.onStepClick;
10896
11132
  const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
10897
11133
  const descId = idBase + "-step-" + i;
10898
- 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(
11134
+ 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(
10899
11135
  "span",
10900
11136
  {
10901
11137
  className: "aura-stepper__desc",
@@ -10904,14 +11140,14 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10904
11140
  },
10905
11141
  s.description
10906
11142
  ) : null);
10907
- return /* @__PURE__ */ React69.createElement(
11143
+ return /* @__PURE__ */ React70.createElement(
10908
11144
  "li",
10909
11145
  {
10910
11146
  key: s.id,
10911
11147
  className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
10912
11148
  "aria-current": state === "current" ? "step" : void 0
10913
11149
  },
10914
- clickable ? /* @__PURE__ */ React69.createElement(
11150
+ clickable ? /* @__PURE__ */ React70.createElement(
10915
11151
  "button",
10916
11152
  {
10917
11153
  type: "button",
@@ -10923,19 +11159,19 @@ var Stepper = React69.forwardRef(function Stepper2(props, ref) {
10923
11159
  },
10924
11160
  marker,
10925
11161
  text2
10926
- ) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
11162
+ ) : /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__step" }, marker, text2)
10927
11163
  );
10928
11164
  })),
10929
- !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
11165
+ !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
10930
11166
  );
10931
11167
  });
10932
11168
 
10933
11169
  // src/SegmentedControl.tsx
10934
- var React70 = __toESM(require("react"), 1);
11170
+ var React71 = __toESM(require("react"), 1);
10935
11171
  function toOpt2(o) {
10936
11172
  return typeof o === "object" ? o : { value: o, label: o };
10937
11173
  }
10938
- var SegmentedControl = React70.forwardRef(
11174
+ var SegmentedControl = React71.forwardRef(
10939
11175
  function SegmentedControl2(props, ref) {
10940
11176
  const options = (props.options || []).map(toOpt2);
10941
11177
  useAutoTip();
@@ -10949,7 +11185,7 @@ var SegmentedControl = React70.forwardRef(
10949
11185
  );
10950
11186
  const value = st[0], setValue = st[1];
10951
11187
  const auto = uid(), id = props.id || auto;
10952
- const refs = React70.useRef([]);
11188
+ const refs = React71.useRef([]);
10953
11189
  const selIdx = options.findIndex(function(o) {
10954
11190
  return o.value === value;
10955
11191
  });
@@ -10982,7 +11218,7 @@ var SegmentedControl = React70.forwardRef(
10982
11218
  move(options.length, -1);
10983
11219
  }
10984
11220
  }
10985
- return /* @__PURE__ */ React70.createElement(
11221
+ return /* @__PURE__ */ React71.createElement(
10986
11222
  "div",
10987
11223
  {
10988
11224
  ref,
@@ -11002,7 +11238,7 @@ var SegmentedControl = React70.forwardRef(
11002
11238
  options.map(function(o, i) {
11003
11239
  const on = o.value === value;
11004
11240
  const off = props.disabled || o.disabled;
11005
- return /* @__PURE__ */ React70.createElement(
11241
+ return /* @__PURE__ */ React71.createElement(
11006
11242
  "button",
11007
11243
  {
11008
11244
  key: o.value,
@@ -11024,8 +11260,8 @@ var SegmentedControl = React70.forwardRef(
11024
11260
  onKeyDown(e, i);
11025
11261
  }
11026
11262
  },
11027
- o.icon ? /* @__PURE__ */ React70.createElement(Icon, { name: o.icon }) : null,
11028
- o.iconOnly ? null : /* @__PURE__ */ React70.createElement("span", null, o.label)
11263
+ o.icon ? /* @__PURE__ */ React71.createElement(Icon, { name: o.icon }) : null,
11264
+ o.iconOnly ? null : /* @__PURE__ */ React71.createElement("span", null, o.label)
11029
11265
  );
11030
11266
  })
11031
11267
  );