@jirawatpyk/aura-react 5.69.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.
@@ -1,4 +1,4 @@
1
- /* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
1
+ /* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Spinner"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
2
2
  window.Aura = (() => {
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -101,6 +101,7 @@ window.Aura = (() => {
101
101
  SideNav: () => SideNav,
102
102
  Skeleton: () => Skeleton,
103
103
  Sparkline: () => Sparkline,
104
+ Spinner: () => Spinner,
104
105
  Stack: () => Stack,
105
106
  Stat: () => Stat,
106
107
  StatusPill: () => StatusPill,
@@ -490,6 +491,11 @@ window.Aura = (() => {
490
491
  ["circle", { cx: "19", cy: "12", r: "1" }],
491
492
  ["circle", { cx: "5", cy: "12", r: "1" }]
492
493
  ]);
494
+ var IconUpload = /* @__PURE__ */ defineIcon("upload", [
495
+ ["path", { d: "M12 3v12" }],
496
+ ["path", { d: "m17 8-5-5-5 5" }],
497
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]
498
+ ]);
493
499
  var IconCalendar = /* @__PURE__ */ defineIcon("calendar", [
494
500
  ["path", { d: "M8 2v3" }],
495
501
  ["path", { d: "M16 2v3" }],
@@ -739,7 +745,7 @@ window.Aura = (() => {
739
745
  };
740
746
  function statusPillElement(props, ref) {
741
747
  const tone2 = props.tone || toneFor(props.children);
742
- const rest = omit(props, ["tone", "className", "children", "wrap"]);
748
+ const rest = omit(props, ["tone", "className", "children", "wrap", "busy"]);
743
749
  return /* @__PURE__ */ React4.createElement(
744
750
  "span",
745
751
  {
@@ -747,10 +753,26 @@ window.Aura = (() => {
747
753
  ref,
748
754
  className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
749
755
  },
750
- /* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
756
+ props.busy ? /* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: 12, className: "aura-spin" }) : /* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
751
757
  props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
752
758
  );
753
759
  }
760
+ function spinnerElement(props, ref) {
761
+ const rest = omit(props, ["size", "label", "className"]);
762
+ const label = props.label;
763
+ return /* @__PURE__ */ React4.createElement(
764
+ "span",
765
+ {
766
+ ...rest,
767
+ ref,
768
+ className: cx("aura-spinner", "aura-spinner--" + (props.size || "md"), props.className),
769
+ role: label ? "status" : void 0,
770
+ "aria-hidden": label ? void 0 : true
771
+ },
772
+ /* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: props.size || "md", className: "aura-spin" }),
773
+ label ? /* @__PURE__ */ React4.createElement("span", { className: "aura-sr-only" }, label) : null
774
+ );
775
+ }
754
776
  function badgeElement(props, ref) {
755
777
  const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
756
778
  return /* @__PURE__ */ React4.createElement(
@@ -1039,6 +1061,7 @@ window.Aura = (() => {
1039
1061
  statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
1040
1062
  opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
1041
1063
  required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
1064
+ firstPage: "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",
1042
1065
  filtersApplied: function(n3) {
1043
1066
  return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
1044
1067
  },
@@ -1181,6 +1204,7 @@ window.Aura = (() => {
1181
1204
  statusUnknown: "Ingen data",
1182
1205
  opensInNewTab: "\xF6ppnas i en ny flik",
1183
1206
  required: "obligatoriskt",
1207
+ firstPage: "F\xF6rsta sidan",
1184
1208
  filtersApplied: function(n3) {
1185
1209
  return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
1186
1210
  },
@@ -1324,6 +1348,7 @@ window.Aura = (() => {
1324
1348
  statusUnknown: "No data",
1325
1349
  opensInNewTab: "opens in a new tab",
1326
1350
  required: "required",
1351
+ firstPage: "First page",
1327
1352
  filtersApplied: function(n3) {
1328
1353
  return "Filters, " + n3.toLocaleString("en") + " applied";
1329
1354
  },
@@ -1384,6 +1409,8 @@ window.Aura = (() => {
1384
1409
  function ButtonLink(props, ref, Link) {
1385
1410
  const variant = props.variant || "primary";
1386
1411
  const disabled = !!props.disabled;
1412
+ const ad = props["aria-disabled"];
1413
+ const gated = !disabled && (ad === true || ad === "true");
1387
1414
  const rest = omit(props, [
1388
1415
  "variant",
1389
1416
  "className",
@@ -1405,7 +1432,7 @@ window.Aura = (() => {
1405
1432
  ref,
1406
1433
  href: disabled ? void 0 : props.href,
1407
1434
  role: disabled ? "link" : void 0,
1408
- "aria-disabled": disabled || void 0,
1435
+ "aria-disabled": disabled || gated || void 0,
1409
1436
  tabIndex: disabled ? -1 : props.tabIndex,
1410
1437
  className: buttonClass({
1411
1438
  variant,
@@ -1414,7 +1441,9 @@ window.Aura = (() => {
1414
1441
  touchHeight: props.touchHeight,
1415
1442
  className: props.className
1416
1443
  }),
1417
- onClick: disabled ? void 0 : props.onClick
1444
+ onClick: disabled ? void 0 : gated ? function(e) {
1445
+ e.preventDefault();
1446
+ } : props.onClick
1418
1447
  },
1419
1448
  props.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: props.icon }) : null,
1420
1449
  props.children,
@@ -1432,6 +1461,8 @@ window.Aura = (() => {
1432
1461
  const loading = !!props.loading;
1433
1462
  const ad = props["aria-disabled"];
1434
1463
  const blocked = loading || ad === true || ad === "true";
1464
+ const ab = props["aria-busy"];
1465
+ const busy = loading || ab === true || ab === "true";
1435
1466
  const rest = omit(props, [
1436
1467
  "variant",
1437
1468
  "className",
@@ -1459,7 +1490,7 @@ window.Aura = (() => {
1459
1490
  loading,
1460
1491
  className: props.className
1461
1492
  }),
1462
- "aria-busy": loading || void 0,
1493
+ "aria-busy": busy || void 0,
1463
1494
  "aria-disabled": blocked || void 0,
1464
1495
  onClick: blocked ? function(e) {
1465
1496
  e.preventDefault();
@@ -1664,6 +1695,8 @@ window.Aura = (() => {
1664
1695
  const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
1665
1696
  useAutoTip();
1666
1697
  const own = props.title !== void 0;
1698
+ const ad = props["aria-disabled"];
1699
+ const blocked = ad === true || ad === "true";
1667
1700
  return /* @__PURE__ */ React8.createElement(
1668
1701
  "button",
1669
1702
  {
@@ -1673,6 +1706,9 @@ window.Aura = (() => {
1673
1706
  "aria-label": props.label,
1674
1707
  "aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
1675
1708
  "data-aura-tip": own ? void 0 : props.label,
1709
+ onClick: blocked ? function(e) {
1710
+ e.preventDefault();
1711
+ } : props.onClick,
1676
1712
  className: cx(
1677
1713
  "aura-icon-btn",
1678
1714
  props.tone === "danger" && "aura-icon-btn--danger",
@@ -9191,8 +9227,39 @@ window.Aura = (() => {
9191
9227
  );
9192
9228
  }
9193
9229
  var Th = React53.forwardRef(function Th2(props, ref) {
9194
- const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
9230
+ const {
9231
+ align,
9232
+ numeric,
9233
+ mono,
9234
+ className,
9235
+ scope,
9236
+ label,
9237
+ card,
9238
+ skeleton,
9239
+ skeletonWidth,
9240
+ wrap,
9241
+ sort,
9242
+ onSort,
9243
+ sortHref,
9244
+ linkComponent,
9245
+ ...rest
9246
+ } = props;
9195
9247
  const stacked = React53.useContext(StackLabels) != null;
9248
+ const Link = useLinkComponent(linkComponent);
9249
+ const sortable = !!onSort || sortHref != null;
9250
+ const ariaSort = sort || (sortable ? "none" : void 0);
9251
+ let children = props.children;
9252
+ if (sortable) {
9253
+ const icon = /* @__PURE__ */ React53.createElement(
9254
+ Icon,
9255
+ {
9256
+ name: sort === "ascending" ? /* @__PURE__ */ React53.createElement(IconArrowUp, null) : sort === "descending" ? /* @__PURE__ */ React53.createElement(IconArrowDown, null) : /* @__PURE__ */ React53.createElement(IconArrowUpDown, null),
9257
+ size: 12
9258
+ }
9259
+ );
9260
+ const cls = cx("aura-table__sort", sort && sort !== "none" && "is-active");
9261
+ children = sortHref != null ? /* @__PURE__ */ React53.createElement(Link, { href: sortHref, className: cls }, props.children, icon) : /* @__PURE__ */ React53.createElement("button", { type: "button", className: cls, onClick: onSort }, props.children, icon);
9262
+ }
9196
9263
  return /* @__PURE__ */ React53.createElement(
9197
9264
  "th",
9198
9265
  {
@@ -9201,8 +9268,10 @@ window.Aura = (() => {
9201
9268
  className: cellClass("aura-tbl__th", props),
9202
9269
  role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
9203
9270
  "data-card": stacked && (card === "title" || card === "action") ? card : void 0,
9271
+ "aria-sort": ariaSort,
9204
9272
  ...rest
9205
- }
9273
+ },
9274
+ children
9206
9275
  );
9207
9276
  });
9208
9277
  var Td = React53.forwardRef(function Td2(props, ref) {
@@ -9668,7 +9737,59 @@ window.Aura = (() => {
9668
9737
  });
9669
9738
 
9670
9739
  // src/FileUpload.tsx
9740
+ var React59 = __toESM(require_react(), 1);
9741
+
9742
+ // src/Progress.tsx
9671
9743
  var React58 = __toESM(require_react(), 1);
9744
+ var Progress = React58.forwardRef(function Progress2(props, ref) {
9745
+ const t = useStrings();
9746
+ const auto = uid(), id = props.id || auto;
9747
+ const max = props.max || 100, det = props.value != null;
9748
+ const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
9749
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
9750
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
9751
+ const keyed = !!props.legend && spct > 0;
9752
+ const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
9753
+ const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
9754
+ return /* @__PURE__ */ React58.createElement(
9755
+ "div",
9756
+ {
9757
+ ref,
9758
+ className: cx(
9759
+ "aura-progress",
9760
+ "aura-progress--" + tone(props.tone || "accent"),
9761
+ props.size === "sm" && "is-sm",
9762
+ props.className
9763
+ )
9764
+ },
9765
+ props.label || props.showValue && shown ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React58.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
9766
+ /* @__PURE__ */ React58.createElement(
9767
+ "div",
9768
+ {
9769
+ className: cx("aura-progress__track", !det && "is-indeterminate"),
9770
+ role: "progressbar",
9771
+ "aria-labelledby": props.label ? id + "-label" : void 0,
9772
+ "aria-label": props.label ? void 0 : props["aria-label"],
9773
+ "aria-valuemin": det ? 0 : void 0,
9774
+ "aria-valuemax": det ? max : void 0,
9775
+ "aria-valuenow": det ? props.value : void 0,
9776
+ "aria-valuetext": det ? valueText : void 0
9777
+ },
9778
+ /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
9779
+ sec ? /* @__PURE__ */ React58.createElement(
9780
+ "span",
9781
+ {
9782
+ className: "aura-progress__bar aura-progress__bar--reserved",
9783
+ style: { left: pct + "%", width: spct + "%" }
9784
+ }
9785
+ ) : null
9786
+ ),
9787
+ keyed ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
9788
+ props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
9789
+ );
9790
+ });
9791
+
9792
+ // src/FileUpload.tsx
9672
9793
  function matches(file, accept) {
9673
9794
  if (!accept) return true;
9674
9795
  const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
@@ -9692,24 +9813,40 @@ window.Aura = (() => {
9692
9813
  }).join(", ");
9693
9814
  }
9694
9815
  var seq = 0;
9695
- var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
9816
+ var FileUpload = React59.forwardRef(function FileUpload2(props, ref) {
9696
9817
  const t = useStrings();
9697
9818
  const auto = uid(), id = props.id || auto;
9698
9819
  const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
9699
9820
  const items2 = st[0] || [];
9700
- const dragState = React58.useState(false), over = dragState[0];
9701
- const inputRef = React58.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9702
- const urls = React58.useRef({});
9821
+ const dragState = React59.useState(false), over = dragState[0];
9822
+ const inputRef = React59.useRef(null), inputMerged = useMergedRef(ref, inputRef);
9823
+ const urls = React59.useRef({});
9703
9824
  const maxFiles = props.multiple ? props.maxFiles : 1;
9704
9825
  const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
9705
- React58.useEffect(function() {
9826
+ const pickState = React59.useState(null);
9827
+ const buttonRef = React59.useRef(null);
9828
+ const buttonMode = props.variant === "button";
9829
+ React59.useEffect(
9830
+ function() {
9831
+ const el = inputRef.current;
9832
+ if (!buttonMode || !el) return;
9833
+ el.focus = function(o) {
9834
+ if (buttonRef.current) buttonRef.current.focus(o);
9835
+ };
9836
+ return function() {
9837
+ delete el.focus;
9838
+ };
9839
+ },
9840
+ [buttonMode]
9841
+ );
9842
+ React59.useEffect(function() {
9706
9843
  return function() {
9707
9844
  Object.keys(urls.current).forEach(function(k) {
9708
9845
  URL.revokeObjectURL(urls.current[k]);
9709
9846
  });
9710
9847
  };
9711
9848
  }, []);
9712
- React58.useEffect(
9849
+ React59.useEffect(
9713
9850
  function() {
9714
9851
  const el = inputRef.current;
9715
9852
  if (!el || !props.name || typeof DataTransfer === "undefined") return;
@@ -9769,7 +9906,96 @@ window.Aura = (() => {
9769
9906
  if (inputRef.current) inputRef.current.focus();
9770
9907
  }
9771
9908
  const error = props.error;
9772
- return /* @__PURE__ */ React58.createElement(
9909
+ if (props.variant === "button") {
9910
+ const err = error || pickState[0];
9911
+ const desc = [err ? id + "-error" : props.hint ? id + "-hint" : null, note ? id + "-note" : null].filter(Boolean).join(" ") || void 0;
9912
+ return /* @__PURE__ */ React59.createElement(
9913
+ Field,
9914
+ {
9915
+ id,
9916
+ label: props.label,
9917
+ labelAs: "span",
9918
+ labelId: id + "-label",
9919
+ hint: props.hint,
9920
+ error: err,
9921
+ required: props.required,
9922
+ optional: props.optional,
9923
+ disabled: props.disabled,
9924
+ className: cx("aura-upload-field", props.className)
9925
+ },
9926
+ /* @__PURE__ */ React59.createElement("div", { className: "aura-upload-button" }, /* @__PURE__ */ React59.createElement(
9927
+ Button,
9928
+ {
9929
+ ref: buttonRef,
9930
+ id: id + "-button",
9931
+ variant: "secondary",
9932
+ icon: /* @__PURE__ */ React59.createElement(IconUpload, null),
9933
+ touchHeight: props.touchHeight,
9934
+ disabled: props.disabled,
9935
+ "aria-labelledby": props.label ? id + "-label " + id + "-button" : void 0,
9936
+ "aria-describedby": desc,
9937
+ onClick: function() {
9938
+ if (inputRef.current) inputRef.current.click();
9939
+ }
9940
+ },
9941
+ props.buttonLabel != null ? props.buttonLabel : props.multiple ? t.browse : t.browseOne
9942
+ ), /* @__PURE__ */ React59.createElement(
9943
+ "input",
9944
+ {
9945
+ ref: inputMerged,
9946
+ id,
9947
+ type: "file",
9948
+ className: "aura-upload__input",
9949
+ tabIndex: -1,
9950
+ "aria-hidden": true,
9951
+ accept: props.accept,
9952
+ multiple: !!props.multiple,
9953
+ disabled: props.disabled,
9954
+ name: props.name,
9955
+ required: props.name ? props.required : void 0,
9956
+ onInvalid: function(e) {
9957
+ e.preventDefault();
9958
+ pickState[1](props.multiple ? t.browse : t.browseOne);
9959
+ if (buttonRef.current) buttonRef.current.focus();
9960
+ },
9961
+ onChange: function(e) {
9962
+ const files = Array.prototype.slice.call(e.target.files || []);
9963
+ if (!files.length) return;
9964
+ let refused = null;
9965
+ const ok = files.filter(function(f) {
9966
+ const why = !matches(f, props.accept) ? t.fileWrongType : props.maxSize && f.size > props.maxSize ? t.fileTooBig(formatBytes(props.maxSize)) : null;
9967
+ if (why && !refused) refused = why;
9968
+ return !why;
9969
+ });
9970
+ pickState[1](refused);
9971
+ if (!props.name) e.target.value = "";
9972
+ else if (refused) {
9973
+ try {
9974
+ const dt = new DataTransfer();
9975
+ ok.forEach(function(f) {
9976
+ dt.items.add(f);
9977
+ });
9978
+ e.target.files = dt.files;
9979
+ } catch (x) {
9980
+ e.target.value = "";
9981
+ }
9982
+ }
9983
+ if (ok.length && props.onSelect) props.onSelect(ok);
9984
+ }
9985
+ }
9986
+ ), note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null),
9987
+ props.progress !== void 0 ? /* @__PURE__ */ React59.createElement(
9988
+ Progress,
9989
+ {
9990
+ className: "aura-upload-button__progress",
9991
+ size: "sm",
9992
+ value: props.progress == null ? void 0 : props.progress,
9993
+ label: t.uploading
9994
+ }
9995
+ ) : null
9996
+ );
9997
+ }
9998
+ return /* @__PURE__ */ React59.createElement(
9773
9999
  Field,
9774
10000
  {
9775
10001
  id,
@@ -9781,7 +10007,7 @@ window.Aura = (() => {
9781
10007
  disabled: props.disabled,
9782
10008
  className: props.className
9783
10009
  },
9784
- /* @__PURE__ */ React58.createElement(
10010
+ /* @__PURE__ */ React59.createElement(
9785
10011
  "div",
9786
10012
  {
9787
10013
  className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
@@ -9802,9 +10028,9 @@ window.Aura = (() => {
9802
10028
  add(e.dataTransfer && e.dataTransfer.files);
9803
10029
  }
9804
10030
  },
9805
- /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
9806
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
9807
- /* @__PURE__ */ React58.createElement(
10031
+ /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
10032
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
10033
+ /* @__PURE__ */ React59.createElement(
9808
10034
  "input",
9809
10035
  {
9810
10036
  ref: inputMerged,
@@ -9826,12 +10052,12 @@ window.Aura = (() => {
9826
10052
  }
9827
10053
  }
9828
10054
  ),
9829
- /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
9830
- note ? /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
10055
+ /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
10056
+ note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
9831
10057
  ),
9832
- items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
10058
+ items2.length ? /* @__PURE__ */ React59.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
9833
10059
  const src = thumb(it);
9834
- 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(
10060
+ return /* @__PURE__ */ React59.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React59.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React59.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React59.createElement(IconImage, null) : /* @__PURE__ */ React59.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React59.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React59.createElement(
9835
10061
  "span",
9836
10062
  {
9837
10063
  className: "aura-upload__bar",
@@ -9841,11 +10067,11 @@ window.Aura = (() => {
9841
10067
  "aria-valuemax": 100,
9842
10068
  "aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
9843
10069
  },
9844
- /* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
9845
- ) : null), /* @__PURE__ */ React58.createElement(
10070
+ /* @__PURE__ */ React59.createElement("span", { style: { width: (it.progress || 0) + "%" } })
10071
+ ) : null), /* @__PURE__ */ React59.createElement(
9846
10072
  IconButton,
9847
10073
  {
9848
- icon: /* @__PURE__ */ React58.createElement(IconX, null),
10074
+ icon: /* @__PURE__ */ React59.createElement(IconX, null),
9849
10075
  label: t.remove(it.name),
9850
10076
  onClick: function() {
9851
10077
  remove(it);
@@ -10161,9 +10387,9 @@ window.Aura = (() => {
10161
10387
  }
10162
10388
 
10163
10389
  // src/ThemeStyle.tsx
10164
- var React59 = __toESM(require_react(), 1);
10390
+ var React60 = __toESM(require_react(), 1);
10165
10391
  function ThemeStyle(props) {
10166
- const css = React59.useMemo(
10392
+ const css = React60.useMemo(
10167
10393
  function() {
10168
10394
  try {
10169
10395
  return createTheme({
@@ -10180,11 +10406,11 @@ window.Aura = (() => {
10180
10406
  [props.brand, props.signal, props.primary, props.name, props.selector]
10181
10407
  );
10182
10408
  if (css === null) return null;
10183
- return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10409
+ return /* @__PURE__ */ React60.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
10184
10410
  }
10185
10411
 
10186
10412
  // src/colorScheme.tsx
10187
- var React60 = __toESM(require_react(), 1);
10413
+ var React61 = __toESM(require_react(), 1);
10188
10414
 
10189
10415
  // src/colorSchemeScript.ts
10190
10416
  var DEFAULT_KEY = "aura-color-scheme";
@@ -10201,7 +10427,7 @@ window.Aura = (() => {
10201
10427
 
10202
10428
  // src/colorScheme.tsx
10203
10429
  function ColorSchemeScript(props) {
10204
- return /* @__PURE__ */ React60.createElement(
10430
+ return /* @__PURE__ */ React61.createElement(
10205
10431
  "script",
10206
10432
  {
10207
10433
  "data-aura-color-scheme": "",
@@ -10226,7 +10452,7 @@ window.Aura = (() => {
10226
10452
  function useColorScheme(options) {
10227
10453
  const key = options && options.storageKey || DEFAULT_KEY;
10228
10454
  const fallback = options && options.defaultScheme || "system";
10229
- const subscribe2 = React60.useCallback(
10455
+ const subscribe2 = React61.useCallback(
10230
10456
  function(cb) {
10231
10457
  const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
10232
10458
  function onSystem() {
@@ -10248,7 +10474,7 @@ window.Aura = (() => {
10248
10474
  },
10249
10475
  [fallback, key]
10250
10476
  );
10251
- const snapshot = React60.useSyncExternalStore(
10477
+ const snapshot = React61.useSyncExternalStore(
10252
10478
  subscribe2,
10253
10479
  function() {
10254
10480
  const s = readScheme(fallback);
@@ -10259,7 +10485,7 @@ window.Aura = (() => {
10259
10485
  }
10260
10486
  );
10261
10487
  const parts = snapshot.split("|");
10262
- const setScheme = React60.useCallback(
10488
+ const setScheme = React61.useCallback(
10263
10489
  function(next) {
10264
10490
  if (!valid(next)) return;
10265
10491
  try {
@@ -10278,14 +10504,14 @@ window.Aura = (() => {
10278
10504
  const cs = useColorScheme(props);
10279
10505
  const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
10280
10506
  const label = props.label || t.colorScheme;
10281
- return /* @__PURE__ */ React60.createElement(
10507
+ return /* @__PURE__ */ React61.createElement(
10282
10508
  DropdownMenu,
10283
10509
  {
10284
10510
  label,
10285
- trigger: /* @__PURE__ */ React60.createElement(
10511
+ trigger: /* @__PURE__ */ React61.createElement(
10286
10512
  IconButton,
10287
10513
  {
10288
- icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
10514
+ icon: cs.resolved === "dark" ? /* @__PURE__ */ React61.createElement(IconMoon, null) : /* @__PURE__ */ React61.createElement(IconSun, null),
10289
10515
  label: label + ": " + names[cs.scheme]
10290
10516
  }
10291
10517
  ),
@@ -10303,59 +10529,9 @@ window.Aura = (() => {
10303
10529
  }
10304
10530
 
10305
10531
  // src/Badge.tsx
10306
- var React61 = __toESM(require_react(), 1);
10307
- var Badge = React61.forwardRef(function Badge2(props, ref) {
10308
- return badgeElement(props, ref);
10309
- });
10310
-
10311
- // src/Progress.tsx
10312
10532
  var React62 = __toESM(require_react(), 1);
10313
- var Progress = React62.forwardRef(function Progress2(props, ref) {
10314
- const t = useStrings();
10315
- const auto = uid(), id = props.id || auto;
10316
- const max = props.max || 100, det = props.value != null;
10317
- const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
10318
- const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
10319
- const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
10320
- const keyed = !!props.legend && spct > 0;
10321
- 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;
10322
- const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
10323
- return /* @__PURE__ */ React62.createElement(
10324
- "div",
10325
- {
10326
- ref,
10327
- className: cx(
10328
- "aura-progress",
10329
- "aura-progress--" + tone(props.tone || "accent"),
10330
- props.size === "sm" && "is-sm",
10331
- props.className
10332
- )
10333
- },
10334
- 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,
10335
- /* @__PURE__ */ React62.createElement(
10336
- "div",
10337
- {
10338
- className: cx("aura-progress__track", !det && "is-indeterminate"),
10339
- role: "progressbar",
10340
- "aria-labelledby": props.label ? id + "-label" : void 0,
10341
- "aria-label": props.label ? void 0 : props["aria-label"],
10342
- "aria-valuemin": det ? 0 : void 0,
10343
- "aria-valuemax": det ? max : void 0,
10344
- "aria-valuenow": det ? props.value : void 0,
10345
- "aria-valuetext": det ? valueText : void 0
10346
- },
10347
- /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
10348
- sec ? /* @__PURE__ */ React62.createElement(
10349
- "span",
10350
- {
10351
- className: "aura-progress__bar aura-progress__bar--reserved",
10352
- style: { left: pct + "%", width: spct + "%" }
10353
- }
10354
- ) : null
10355
- ),
10356
- 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,
10357
- props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
10358
- );
10533
+ var Badge = React62.forwardRef(function Badge2(props, ref) {
10534
+ return badgeElement(props, ref);
10359
10535
  });
10360
10536
 
10361
10537
  // src/Skeleton.tsx
@@ -10414,9 +10590,56 @@ window.Aura = (() => {
10414
10590
  if (count > 1) out.push(count);
10415
10591
  return out;
10416
10592
  }
10417
- var Pagination = React65.forwardRef(function Pagination2(props, ref) {
10593
+ function cursorNav(props, ref, Link, t) {
10594
+ const links = props.firstHref != null || props.previousHref != null || props.nextHref != null;
10595
+ function step(key, href, on, has, label, rel, icon, after) {
10596
+ const body = /* @__PURE__ */ React65.createElement(React65.Fragment, null, icon && !after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null, /* @__PURE__ */ React65.createElement("span", null, label), icon && after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null);
10597
+ const cls = "aura-page aura-page--step";
10598
+ if (has === false || !href && !on)
10599
+ return links ? /* @__PURE__ */ React65.createElement("span", { key, className: cls, role: "link", "aria-disabled": true }, body) : /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, disabled: true }, body);
10600
+ if (href != null)
10601
+ return /* @__PURE__ */ React65.createElement(
10602
+ Link,
10603
+ {
10604
+ key,
10605
+ href,
10606
+ rel,
10607
+ className: cls,
10608
+ onClick: function(e) {
10609
+ if (on && plainClick(e)) {
10610
+ e.preventDefault();
10611
+ on();
10612
+ }
10613
+ }
10614
+ },
10615
+ body
10616
+ );
10617
+ return /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, onClick: on }, body);
10618
+ }
10619
+ return /* @__PURE__ */ React65.createElement(
10620
+ "nav",
10621
+ {
10622
+ ref,
10623
+ className: cx("aura-pagination", "aura-pagination--cursor", props.className),
10624
+ "aria-label": props.label || t.pagination
10625
+ },
10626
+ props.status != null && props.status !== false && props.status !== "" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__status" }, props.status) : null,
10627
+ /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__steps" }, props.showFirst === false ? null : step("first", props.firstHref, props.onFirst, props.hasFirst, t.firstPage, void 0, null, false), step(
10628
+ "prev",
10629
+ props.previousHref,
10630
+ props.onPrevious,
10631
+ props.hasPrevious,
10632
+ t.prevPage,
10633
+ "prev",
10634
+ /* @__PURE__ */ React65.createElement(IconChevronLeft, null),
10635
+ false
10636
+ ), step("next", props.nextHref, props.onNext, props.hasNext, t.nextPage, "next", /* @__PURE__ */ React65.createElement(IconChevronRight, null), true))
10637
+ );
10638
+ }
10639
+ var Pagination = React65.forwardRef(function Pagination2(all, ref) {
10418
10640
  const t = useStrings();
10419
10641
  useAutoTip();
10642
+ const props = all;
10420
10643
  const count = Math.max(1, props.pageCount || 1);
10421
10644
  const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
10422
10645
  const page = Math.min(count, Math.max(1, st[0]));
@@ -10425,6 +10648,7 @@ window.Aura = (() => {
10425
10648
  }
10426
10649
  const link = props.getHref;
10427
10650
  const Link = useLinkComponent(props.linkComponent);
10651
+ if (all.mode === "cursor") return cursorNav(all, ref, Link, t);
10428
10652
  function item(p, label, extra) {
10429
10653
  const common = Object.assign(
10430
10654
  {
@@ -10495,9 +10719,15 @@ window.Aura = (() => {
10495
10719
  })), /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React65.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
10496
10720
  });
10497
10721
 
10498
- // src/Accordion.tsx
10722
+ // src/Spinner.tsx
10499
10723
  var React66 = __toESM(require_react(), 1);
10500
- var Accordion = React66.forwardRef(function Accordion2(props, ref) {
10724
+ var Spinner = React66.forwardRef(function Spinner2(props, ref) {
10725
+ return spinnerElement(props, ref);
10726
+ });
10727
+
10728
+ // src/Accordion.tsx
10729
+ var React67 = __toESM(require_react(), 1);
10730
+ var Accordion = React67.forwardRef(function Accordion2(props, ref) {
10501
10731
  const auto = uid(), base = props.id || auto;
10502
10732
  const multiple = props.type === "multiple";
10503
10733
  const st = useMaybeControlled(
@@ -10535,9 +10765,9 @@ window.Aura = (() => {
10535
10765
  n3.focus();
10536
10766
  }
10537
10767
  }
10538
- return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10768
+ return /* @__PURE__ */ React67.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
10539
10769
  const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
10540
- 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(
10770
+ return /* @__PURE__ */ React67.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React67.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React67.createElement(
10541
10771
  "button",
10542
10772
  {
10543
10773
  type: "button",
@@ -10550,10 +10780,10 @@ window.Aura = (() => {
10550
10780
  toggle(it.id);
10551
10781
  }
10552
10782
  },
10553
- it.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10554
- /* @__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),
10555
- /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10556
- )), /* @__PURE__ */ React66.createElement(
10783
+ it.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
10784
+ /* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React67.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
10785
+ /* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
10786
+ )), /* @__PURE__ */ React67.createElement(
10557
10787
  "div",
10558
10788
  {
10559
10789
  id: pid,
@@ -10568,7 +10798,7 @@ window.Aura = (() => {
10568
10798
  });
10569
10799
 
10570
10800
  // src/Popover.tsx
10571
- var React67 = __toESM(require_react(), 1);
10801
+ var React68 = __toESM(require_react(), 1);
10572
10802
  var import_react_dom13 = __toESM(require_react_dom(), 1);
10573
10803
  function position(anchor, pop, placement) {
10574
10804
  const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
@@ -10586,15 +10816,15 @@ window.Aura = (() => {
10586
10816
  const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
10587
10817
  return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
10588
10818
  }
10589
- var Popover = React67.forwardRef(function Popover2(props, ref) {
10819
+ var Popover = React68.forwardRef(function Popover2(props, ref) {
10590
10820
  const t = useStrings();
10591
10821
  const density = useDensity();
10592
10822
  const auto = uid(), id = props.id || auto;
10593
10823
  const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
10594
10824
  const open = !!st[0];
10595
- const wrap = React67.useRef(null), pop = React67.useRef(null), popMerged = useMergedRef(ref, pop);
10596
- const pos = React67.useState(null), mounted = useMounted();
10597
- const inTree = React67.useRef(false);
10825
+ const wrap = React68.useRef(null), pop = React68.useRef(null), popMerged = useMergedRef(ref, pop);
10826
+ const pos = React68.useState(null), mounted = useMounted();
10827
+ const inTree = React68.useRef(false);
10598
10828
  function trigger() {
10599
10829
  return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
10600
10830
  }
@@ -10621,7 +10851,7 @@ window.Aura = (() => {
10621
10851
  },
10622
10852
  [open, mounted, props.placement]
10623
10853
  );
10624
- React67.useEffect(
10854
+ React68.useEffect(
10625
10855
  function() {
10626
10856
  if (!open || !mounted) return;
10627
10857
  if (props.autoFocus !== false && pop.current) {
@@ -10653,9 +10883,9 @@ window.Aura = (() => {
10653
10883
  },
10654
10884
  [open, mounted]
10655
10885
  );
10656
- const child = React67.Children.only(props.trigger);
10886
+ const child = React68.Children.only(props.trigger);
10657
10887
  const panel = open && mounted ? (0, import_react_dom13.createPortal)(
10658
- /* @__PURE__ */ React67.createElement(
10888
+ /* @__PURE__ */ React68.createElement(
10659
10889
  "div",
10660
10890
  {
10661
10891
  ref: popMerged,
@@ -10685,17 +10915,17 @@ window.Aura = (() => {
10685
10915
  } else trapTab(e, pop.current);
10686
10916
  }
10687
10917
  },
10688
- 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(
10918
+ props.title ? /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React68.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React68.createElement(
10689
10919
  IconButton,
10690
10920
  {
10691
- icon: /* @__PURE__ */ React67.createElement(IconX, null),
10921
+ icon: /* @__PURE__ */ React68.createElement(IconX, null),
10692
10922
  label: t.close,
10693
10923
  onClick: function() {
10694
10924
  close(true);
10695
10925
  }
10696
10926
  }
10697
10927
  )) : null,
10698
- /* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10928
+ /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
10699
10929
  close: function() {
10700
10930
  close(true);
10701
10931
  }
@@ -10703,7 +10933,7 @@ window.Aura = (() => {
10703
10933
  ),
10704
10934
  document.body
10705
10935
  ) : null;
10706
- return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
10936
+ return /* @__PURE__ */ React68.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React68.cloneElement(child, {
10707
10937
  onClick: function(e) {
10708
10938
  if (child.props.onClick) child.props.onClick(e);
10709
10939
  st[1](!open);
@@ -10715,7 +10945,7 @@ window.Aura = (() => {
10715
10945
  });
10716
10946
 
10717
10947
  // src/NumberField.tsx
10718
- var React68 = __toESM(require_react(), 1);
10948
+ var React69 = __toESM(require_react(), 1);
10719
10949
  function decimalsOf(n3) {
10720
10950
  const s = String(n3);
10721
10951
  const i = s.indexOf(".");
@@ -10728,7 +10958,7 @@ window.Aura = (() => {
10728
10958
  if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
10729
10959
  return Number(s);
10730
10960
  }
10731
- var NumberField = React68.forwardRef(function NumberField2(props, ref) {
10961
+ var NumberField = React69.forwardRef(function NumberField2(props, ref) {
10732
10962
  const t = useStrings();
10733
10963
  const auto = uid(), id = props.id || auto;
10734
10964
  const step = props.step || 1;
@@ -10739,7 +10969,7 @@ window.Aura = (() => {
10739
10969
  props.onChange
10740
10970
  );
10741
10971
  const value = st[0], setValue = st[1];
10742
- const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
10972
+ const draftState = React69.useState(null), draft = draftState[0], setDraft = draftState[1];
10743
10973
  function fmt2(n3) {
10744
10974
  if (n3 == null || isNaN(n3)) return "";
10745
10975
  return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
@@ -10788,7 +11018,7 @@ window.Aura = (() => {
10788
11018
  };
10789
11019
  const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
10790
11020
  const stepper = props.stepper !== false && !props.readOnly;
10791
- return /* @__PURE__ */ React68.createElement(
11021
+ return /* @__PURE__ */ React69.createElement(
10792
11022
  Field,
10793
11023
  {
10794
11024
  id,
@@ -10800,7 +11030,7 @@ window.Aura = (() => {
10800
11030
  disabled: props.disabled,
10801
11031
  className: cx(touchClass(props.touchHeight), props.className)
10802
11032
  },
10803
- /* @__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(
11033
+ /* @__PURE__ */ React69.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React69.createElement(
10804
11034
  "input",
10805
11035
  {
10806
11036
  ref,
@@ -10847,7 +11077,7 @@ window.Aura = (() => {
10847
11077
  },
10848
11078
  onKeyDown
10849
11079
  }
10850
- ), 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(
11080
+ ), props.suffix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React69.createElement(
10851
11081
  "button",
10852
11082
  {
10853
11083
  type: "button",
@@ -10863,8 +11093,8 @@ window.Aura = (() => {
10863
11093
  nudge(-step);
10864
11094
  }
10865
11095
  },
10866
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
10867
- ), /* @__PURE__ */ React68.createElement(
11096
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconMinus, null) })
11097
+ ), /* @__PURE__ */ React69.createElement(
10868
11098
  "button",
10869
11099
  {
10870
11100
  type: "button",
@@ -10880,14 +11110,14 @@ window.Aura = (() => {
10880
11110
  nudge(step);
10881
11111
  }
10882
11112
  },
10883
- /* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
11113
+ /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconPlus, null) })
10884
11114
  )) : null)
10885
11115
  );
10886
11116
  });
10887
11117
 
10888
11118
  // src/Stepper.tsx
10889
- var React69 = __toESM(require_react(), 1);
10890
- var Stepper = React69.forwardRef(function Stepper2(props, ref) {
11119
+ var React70 = __toESM(require_react(), 1);
11120
+ var Stepper = React70.forwardRef(function Stepper2(props, ref) {
10891
11121
  const t = useStrings();
10892
11122
  const idBase = uid();
10893
11123
  const steps = props.steps || [];
@@ -10898,22 +11128,22 @@ window.Aura = (() => {
10898
11128
  if (at < 0) at = 0;
10899
11129
  const vertical = props.orientation === "vertical";
10900
11130
  const cur2 = steps[at];
10901
- return /* @__PURE__ */ React69.createElement(
11131
+ return /* @__PURE__ */ React70.createElement(
10902
11132
  "nav",
10903
11133
  {
10904
11134
  ref,
10905
11135
  "aria-label": props.label,
10906
11136
  className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
10907
11137
  },
10908
- /* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
11138
+ /* @__PURE__ */ React70.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
10909
11139
  const state = i < at ? "done" : i === at ? "current" : "upcoming";
10910
11140
  const error = s.status === "error";
10911
- 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);
11141
+ const marker = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCheck, null) }) : i + 1);
10912
11142
  const note = error ? t.stepError : state === "done" ? t.stepDone : "";
10913
11143
  const clickable = state === "done" && !!props.onStepClick;
10914
11144
  const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
10915
11145
  const descId = idBase + "-step-" + i;
10916
- 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(
11146
+ const text2 = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React70.createElement(
10917
11147
  "span",
10918
11148
  {
10919
11149
  className: "aura-stepper__desc",
@@ -10922,14 +11152,14 @@ window.Aura = (() => {
10922
11152
  },
10923
11153
  s.description
10924
11154
  ) : null);
10925
- return /* @__PURE__ */ React69.createElement(
11155
+ return /* @__PURE__ */ React70.createElement(
10926
11156
  "li",
10927
11157
  {
10928
11158
  key: s.id,
10929
11159
  className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
10930
11160
  "aria-current": state === "current" ? "step" : void 0
10931
11161
  },
10932
- clickable ? /* @__PURE__ */ React69.createElement(
11162
+ clickable ? /* @__PURE__ */ React70.createElement(
10933
11163
  "button",
10934
11164
  {
10935
11165
  type: "button",
@@ -10941,19 +11171,19 @@ window.Aura = (() => {
10941
11171
  },
10942
11172
  marker,
10943
11173
  text2
10944
- ) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
11174
+ ) : /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__step" }, marker, text2)
10945
11175
  );
10946
11176
  })),
10947
- !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
11177
+ !vertical && cur2 ? /* @__PURE__ */ React70.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
10948
11178
  );
10949
11179
  });
10950
11180
 
10951
11181
  // src/SegmentedControl.tsx
10952
- var React70 = __toESM(require_react(), 1);
11182
+ var React71 = __toESM(require_react(), 1);
10953
11183
  function toOpt2(o) {
10954
11184
  return typeof o === "object" ? o : { value: o, label: o };
10955
11185
  }
10956
- var SegmentedControl = React70.forwardRef(
11186
+ var SegmentedControl = React71.forwardRef(
10957
11187
  function SegmentedControl2(props, ref) {
10958
11188
  const options = (props.options || []).map(toOpt2);
10959
11189
  useAutoTip();
@@ -10967,7 +11197,7 @@ window.Aura = (() => {
10967
11197
  );
10968
11198
  const value = st[0], setValue = st[1];
10969
11199
  const auto = uid(), id = props.id || auto;
10970
- const refs = React70.useRef([]);
11200
+ const refs = React71.useRef([]);
10971
11201
  const selIdx = options.findIndex(function(o) {
10972
11202
  return o.value === value;
10973
11203
  });
@@ -11000,7 +11230,7 @@ window.Aura = (() => {
11000
11230
  move(options.length, -1);
11001
11231
  }
11002
11232
  }
11003
- return /* @__PURE__ */ React70.createElement(
11233
+ return /* @__PURE__ */ React71.createElement(
11004
11234
  "div",
11005
11235
  {
11006
11236
  ref,
@@ -11020,7 +11250,7 @@ window.Aura = (() => {
11020
11250
  options.map(function(o, i) {
11021
11251
  const on = o.value === value;
11022
11252
  const off = props.disabled || o.disabled;
11023
- return /* @__PURE__ */ React70.createElement(
11253
+ return /* @__PURE__ */ React71.createElement(
11024
11254
  "button",
11025
11255
  {
11026
11256
  key: o.value,
@@ -11042,8 +11272,8 @@ window.Aura = (() => {
11042
11272
  onKeyDown(e, i);
11043
11273
  }
11044
11274
  },
11045
- o.icon ? /* @__PURE__ */ React70.createElement(Icon, { name: o.icon }) : null,
11046
- o.iconOnly ? null : /* @__PURE__ */ React70.createElement("span", null, o.label)
11275
+ o.icon ? /* @__PURE__ */ React71.createElement(Icon, { name: o.icon }) : null,
11276
+ o.iconOnly ? null : /* @__PURE__ */ React71.createElement("span", null, o.label)
11047
11277
  );
11048
11278
  })
11049
11279
  );