@jirawatpyk/aura-react 5.14.0 → 5.16.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.
@@ -138,6 +138,7 @@ window.Aura = (() => {
138
138
  useBreakpoint: () => useBreakpoint,
139
139
  useColorScheme: () => useColorScheme,
140
140
  useDensity: () => useDensity,
141
+ useDialogClose: () => useDialogClose,
141
142
  useFormatDate: () => useFormatDate,
142
143
  useResponsive: () => useResponsive
143
144
  });
@@ -622,8 +623,11 @@ window.Aura = (() => {
622
623
  "interactive",
623
624
  "as",
624
625
  "className",
625
- "titleId"
626
+ "titleId",
627
+ "header",
628
+ "flushBelow"
626
629
  ]);
630
+ const head = props.header !== void 0 && props.header !== null && props.header !== false;
627
631
  return h2(
628
632
  props.as || "section",
629
633
  Object.assign({}, rest, {
@@ -632,12 +636,13 @@ window.Aura = (() => {
632
636
  "aura-card",
633
637
  creative && "aura-card--creative",
634
638
  props.interactive && "is-interactive",
639
+ props.flushBelow && "aura-card--flush-below-" + props.flushBelow,
635
640
  props.className
636
641
  ),
637
642
  /* A titled card is labelled by its title; otherwise the caller's aria-labelledby stays (5.8). */
638
- "aria-labelledby": props.title && props.titleId ? props.titleId : props["aria-labelledby"]
643
+ "aria-labelledby": !head && props.title && props.titleId ? props.titleId : props["aria-labelledby"]
639
644
  }),
640
- props.title || props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React4.createElement("div", { className: "aura-card__heading" }, props.title ? h2("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, props.description ? /* @__PURE__ */ React4.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
645
+ head || props.title || props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React4.createElement("div", { className: "aura-card__heading" }, head ? props.header : null, !head && props.title ? h2("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, !head && props.description ? /* @__PURE__ */ React4.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
641
646
  props.children ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__body" }, props.children) : null,
642
647
  props.footer ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__foot" }, props.footer) : null
643
648
  );
@@ -772,6 +777,7 @@ window.Aura = (() => {
772
777
  "aura-btn--" + (opts.variant || "primary"),
773
778
  opts.size === "sm" && "aura-btn--sm",
774
779
  opts.fullWidth && "aura-btn--full",
780
+ opts.touchHeight && "aura-btn--touch",
775
781
  opts.loading && "is-loading",
776
782
  opts.className
777
783
  );
@@ -901,6 +907,10 @@ window.Aura = (() => {
901
907
  pageN: function(p) {
902
908
  return "\u0E2B\u0E19\u0E49\u0E32 " + p;
903
909
  },
910
+ progressReserved: function(v, r, max) {
911
+ return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r);
912
+ },
913
+ breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
904
914
  accepts: function(list, max) {
905
915
  return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
906
916
  }
@@ -1027,6 +1037,10 @@ window.Aura = (() => {
1027
1037
  pageN: function(p) {
1028
1038
  return "Sida " + p;
1029
1039
  },
1040
+ progressReserved: function(v, r, max) {
1041
+ return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r) + " reserverade";
1042
+ },
1043
+ breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
1030
1044
  accepts: function(list, max) {
1031
1045
  return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
1032
1046
  }
@@ -1154,6 +1168,10 @@ window.Aura = (() => {
1154
1168
  pageN: function(p) {
1155
1169
  return "Page " + p;
1156
1170
  },
1171
+ progressReserved: function(v, r, max) {
1172
+ return n2(v) + " of " + n2(max) + " used, " + n2(r) + " reserved";
1173
+ },
1174
+ breadcrumbMore: "Show the full path",
1157
1175
  accepts: function(list, max) {
1158
1176
  return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
1159
1177
  }
@@ -1220,7 +1238,8 @@ window.Aura = (() => {
1220
1238
  "linkComponent",
1221
1239
  "href",
1222
1240
  "fullWidth",
1223
- "size"
1241
+ "size",
1242
+ "touchHeight"
1224
1243
  ]);
1225
1244
  const Tag3 = disabled ? "a" : Link;
1226
1245
  return /* @__PURE__ */ React6.createElement(
@@ -1236,6 +1255,7 @@ window.Aura = (() => {
1236
1255
  variant,
1237
1256
  size: props.size,
1238
1257
  fullWidth: props.fullWidth,
1258
+ touchHeight: props.touchHeight,
1239
1259
  className: props.className
1240
1260
  }),
1241
1261
  onClick: disabled ? void 0 : props.onClick
@@ -1266,7 +1286,8 @@ window.Aura = (() => {
1266
1286
  "loading",
1267
1287
  "onClick",
1268
1288
  "fullWidth",
1269
- "size"
1289
+ "size",
1290
+ "touchHeight"
1270
1291
  ]);
1271
1292
  return /* @__PURE__ */ React6.createElement(
1272
1293
  "button",
@@ -1278,6 +1299,7 @@ window.Aura = (() => {
1278
1299
  variant,
1279
1300
  size: props.size,
1280
1301
  fullWidth: props.fullWidth,
1302
+ touchHeight: props.touchHeight,
1281
1303
  loading,
1282
1304
  className: props.className
1283
1305
  }),
@@ -1297,7 +1319,7 @@ window.Aura = (() => {
1297
1319
  // src/IconButton.tsx
1298
1320
  var React7 = __toESM(require_react(), 1);
1299
1321
  var IconButton = React7.forwardRef(function IconButton2(props, ref) {
1300
- const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
1322
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
1301
1323
  return /* @__PURE__ */ React7.createElement(
1302
1324
  "button",
1303
1325
  {
@@ -1306,7 +1328,12 @@ window.Aura = (() => {
1306
1328
  type: props.type || "button",
1307
1329
  "aria-label": props.label,
1308
1330
  title: props.label,
1309
- className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
1331
+ className: cx(
1332
+ "aura-icon-btn",
1333
+ props.tone === "danger" && "aura-icon-btn--danger",
1334
+ props.touchHeight && "aura-icon-btn--touch",
1335
+ props.className
1336
+ )
1310
1337
  },
1311
1338
  /* @__PURE__ */ React7.createElement(Icon, { name: props.icon, size: props.size || "sm" })
1312
1339
  );
@@ -1578,7 +1605,8 @@ window.Aura = (() => {
1578
1605
  "description",
1579
1606
  "className",
1580
1607
  "tabIndex",
1581
- "disabled"
1608
+ "disabled",
1609
+ "hitArea"
1582
1610
  ]);
1583
1611
  const text2 = props.children;
1584
1612
  const labelled = text2 != null && text2 !== "";
@@ -1588,10 +1616,19 @@ window.Aura = (() => {
1588
1616
  "Checkbox `label` is only the accessible name: it is not shown. In 6.0 it will be shown beside the box, like Switch and TextField. For visible text now pass it as children; for a bare box (a table row) add `hideLabel`."
1589
1617
  );
1590
1618
  const descId = props.description ? (props.id || auto) + "-desc" : void 0;
1619
+ const ha = props.hitArea;
1620
+ const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
1591
1621
  return /* @__PURE__ */ React10.createElement(
1592
1622
  "label",
1593
1623
  {
1594
- className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
1624
+ className: cx(
1625
+ "aura-check",
1626
+ labelled && "aura-check--labelled",
1627
+ hit && "has-hit",
1628
+ props.disabled && "is-disabled",
1629
+ props.className
1630
+ ),
1631
+ style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
1595
1632
  onClick: function(e) {
1596
1633
  e.stopPropagation();
1597
1634
  }
@@ -2430,6 +2467,13 @@ window.Aura = (() => {
2430
2467
  const density = useDensity();
2431
2468
  const auto = uid(), id = props.id || auto, listId = id + "-list";
2432
2469
  const options = (props.options || []).map(toOpt);
2470
+ const groups = props.groups || [];
2471
+ groups.forEach(function(g, gi) {
2472
+ g.options.forEach(function(o) {
2473
+ options.push(Object.assign({}, toOpt(o), { __g: gi }));
2474
+ });
2475
+ });
2476
+ const custom = !multi && !!props.allowCustomValue;
2433
2477
  const st = useMaybeControlled(
2434
2478
  multi ? mp.value : props.value === void 0 ? void 0 : props.value == null ? [] : [props.value],
2435
2479
  multi ? mp.defaultValue || [] : props.defaultValue == null ? [] : [props.defaultValue],
@@ -2469,7 +2513,9 @@ window.Aura = (() => {
2469
2513
  });
2470
2514
  const more = shown.length > limit;
2471
2515
  shown = shown.slice(0, limit);
2472
- const activeIdx = Math.min(active, shown.length - 1);
2516
+ const activeIdx = active < 0 ? query ? shown.findIndex(function(o) {
2517
+ return !o.disabled && norm(o.label) === norm(query.trim());
2518
+ }) : -1 : Math.min(active, shown.length - 1);
2473
2519
  function place() {
2474
2520
  if (!boxRef.current) return;
2475
2521
  const r = boxRef.current.getBoundingClientRect();
@@ -2494,6 +2540,7 @@ window.Aura = (() => {
2494
2540
  function outside(e) {
2495
2541
  if (boxRef.current && boxRef.current.contains(e.target)) return;
2496
2542
  if (listRef.current && listRef.current.contains(e.target)) return;
2543
+ if (commitRef.current()) return;
2497
2544
  close(false);
2498
2545
  }
2499
2546
  function onScroll(e) {
@@ -2530,6 +2577,27 @@ window.Aura = (() => {
2530
2577
  setOpen(false);
2531
2578
  setQuery(null);
2532
2579
  }
2580
+ const committed = React19.useRef(false);
2581
+ const commitRef = React19.useRef(function() {
2582
+ return false;
2583
+ });
2584
+ function commitTyped() {
2585
+ if (!custom || query == null || committed.current) return false;
2586
+ committed.current = true;
2587
+ const q = query.trim();
2588
+ if (!q) {
2589
+ if (props.clearable !== false) setValue(null);
2590
+ } else {
2591
+ const hit = options.filter(function(o) {
2592
+ return !o.disabled && norm(o.label) === norm(q);
2593
+ })[0];
2594
+ setValue(hit ? hit.value : q);
2595
+ }
2596
+ setQuery(null);
2597
+ setOpen(false);
2598
+ return true;
2599
+ }
2600
+ commitRef.current = commitTyped;
2533
2601
  function choose(o) {
2534
2602
  if (!o || o.disabled) return;
2535
2603
  if (multi) {
@@ -2570,7 +2638,7 @@ window.Aura = (() => {
2570
2638
  if (open && live[activeIdx]) {
2571
2639
  e.preventDefault();
2572
2640
  choose(live[activeIdx]);
2573
- }
2641
+ } else if (commitTyped()) e.preventDefault();
2574
2642
  } else if (k === "Escape") {
2575
2643
  if (open) {
2576
2644
  e.preventDefault();
@@ -2582,58 +2650,95 @@ window.Aura = (() => {
2582
2650
  } else if (k === "Backspace" && multi && !props.readOnly && !text2 && values.length) {
2583
2651
  setValues(values.slice(0, -1));
2584
2652
  } else if (k === "Tab") {
2653
+ if (custom && open && query != null && live[activeIdx]) {
2654
+ choose(live[activeIdx]);
2655
+ return;
2656
+ }
2657
+ if (commitTyped()) return;
2585
2658
  if (open) close();
2586
2659
  }
2587
2660
  }
2588
- const text2 = query != null ? query : selected ? selected.label : "";
2661
+ const text2 = query != null ? query : selected ? selected.label : custom && value != null ? value : "";
2589
2662
  const summaryId = id + "-picked";
2590
2663
  const optId = function(i) {
2591
2664
  return id + "-opt-" + i;
2592
2665
  };
2666
+ function renderOpt(o, i) {
2667
+ const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
2668
+ const blocked = o.disabled || multi && full && !isSel;
2669
+ return /* @__PURE__ */ React19.createElement(
2670
+ "li",
2671
+ {
2672
+ key: o.value,
2673
+ id: optId(i),
2674
+ role: "option",
2675
+ "data-idx": i,
2676
+ "aria-selected": isSel,
2677
+ "aria-disabled": blocked || void 0,
2678
+ className: cx(
2679
+ "aura-combo__option",
2680
+ i === activeIdx && "is-active",
2681
+ isSel && "is-selected",
2682
+ blocked && "is-disabled"
2683
+ ),
2684
+ onPointerDown: function(e) {
2685
+ e.preventDefault();
2686
+ },
2687
+ onClick: function() {
2688
+ if (!blocked || isSel) choose(o);
2689
+ },
2690
+ onPointerMove: function() {
2691
+ if (activeIdx !== i) setActive(i);
2692
+ }
2693
+ },
2694
+ o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
2695
+ /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
2696
+ isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
2697
+ );
2698
+ }
2699
+ function grouped(list2) {
2700
+ const out = [];
2701
+ list2.forEach(function(o, i) {
2702
+ const last = out[out.length - 1];
2703
+ if (last && last.g === o.__g) last.items.push([o, i]);
2704
+ else out.push({ g: o.__g, items: [[o, i]] });
2705
+ });
2706
+ return out;
2707
+ }
2593
2708
  const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
2594
- /* @__PURE__ */ React19.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React19.createElement(
2595
- "ul",
2709
+ /* @__PURE__ */ React19.createElement(
2710
+ "div",
2596
2711
  {
2597
- id: listId,
2598
- role: "listbox",
2599
- "aria-label": props.label,
2600
- "aria-multiselectable": multi || void 0,
2601
- className: "aura-combo__list"
2712
+ ref: listRef,
2713
+ "data-density": density,
2714
+ className: "aura-combo__popover",
2715
+ style: posState[0],
2716
+ onPointerDown: function(e) {
2717
+ e.preventDefault();
2718
+ }
2602
2719
  },
2603
- live.map(function(o, i) {
2604
- const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
2605
- const blocked = o.disabled || multi && full && !isSel;
2606
- return /* @__PURE__ */ React19.createElement(
2607
- "li",
2608
- {
2609
- key: o.value,
2610
- id: optId(i),
2611
- role: "option",
2612
- "data-idx": i,
2613
- "aria-selected": isSel,
2614
- "aria-disabled": blocked || void 0,
2615
- className: cx(
2616
- "aura-combo__option",
2617
- i === activeIdx && "is-active",
2618
- isSel && "is-selected",
2619
- blocked && "is-disabled"
2620
- ),
2621
- onPointerDown: function(e) {
2622
- e.preventDefault();
2623
- },
2624
- onClick: function() {
2625
- if (!blocked || isSel) choose(o);
2626
- },
2627
- onPointerMove: function() {
2628
- if (activeIdx !== i) setActive(i);
2629
- }
2630
- },
2631
- o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
2632
- /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
2633
- isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
2634
- );
2635
- })
2636
- ) : null, props.loading || !live.length || more ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__list", role: "status" }, props.loading ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconLoaderCircle, null), className: "aura-spin" }), props.loadingText || t.searching) : !live.length ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, props.emptyText || t.noMatches) : /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, t.keepTyping((props.options || []).length))) : null),
2720
+ live.length ? /* @__PURE__ */ React19.createElement(
2721
+ "ul",
2722
+ {
2723
+ id: listId,
2724
+ role: "listbox",
2725
+ "aria-label": props.label,
2726
+ "aria-multiselectable": multi || void 0,
2727
+ className: "aura-combo__list"
2728
+ },
2729
+ grouped(live).map(function(seg) {
2730
+ if (seg.g == null)
2731
+ return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: "u" + seg.items[0][1] }, seg.items.map(function(p) {
2732
+ return renderOpt(p[0], p[1]);
2733
+ }));
2734
+ const gid = id + "-group-" + seg.g + "-" + seg.items[0][1];
2735
+ return /* @__PURE__ */ React19.createElement("li", { key: gid, role: "group", "aria-labelledby": gid, className: "aura-combo__group" }, /* @__PURE__ */ React19.createElement("span", { id: gid, role: "presentation", className: "aura-combo__group-label" }, groups[seg.g].label), /* @__PURE__ */ React19.createElement("ul", { role: "none", className: "aura-combo__grouplist" }, seg.items.map(function(p) {
2736
+ return renderOpt(p[0], p[1]);
2737
+ })));
2738
+ })
2739
+ ) : null,
2740
+ props.loading || !live.length || more ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__list", role: "status" }, props.loading ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconLoaderCircle, null), className: "aura-spin" }), props.loadingText || t.searching) : !live.length ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, props.emptyText || t.noMatches) : /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, t.keepTyping(options.length))) : null
2741
+ ),
2637
2742
  document.body
2638
2743
  ) : null;
2639
2744
  return /* @__PURE__ */ React19.createElement(
@@ -2695,8 +2800,9 @@ window.Aura = (() => {
2695
2800
  required: props.required && (!multi || !values.length),
2696
2801
  value: text2,
2697
2802
  onChange: function(e) {
2803
+ committed.current = false;
2698
2804
  setQuery(e.target.value);
2699
- setActive(0);
2805
+ setActive(custom ? -1 : 0);
2700
2806
  if (!open) setOpen(true);
2701
2807
  if (props.onSearch) props.onSearch(e.target.value);
2702
2808
  },
@@ -2705,6 +2811,8 @@ window.Aura = (() => {
2705
2811
  onBlur: function() {
2706
2812
  setTimeout(function() {
2707
2813
  if (listRef.current && listRef.current.contains(document.activeElement)) return;
2814
+ if (custom && document.activeElement === inputRef.current) return;
2815
+ if (commitRef.current()) return;
2708
2816
  setOpen(false);
2709
2817
  setQuery(null);
2710
2818
  }, 0);
@@ -4140,7 +4248,13 @@ window.Aura = (() => {
4140
4248
  ref,
4141
4249
  role: "region",
4142
4250
  "aria-label": props.label || t.filters,
4143
- className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
4251
+ className: cx(
4252
+ "aura-filterbar",
4253
+ props.searchGrow && "aura-filterbar--grow",
4254
+ props.controlsLayout === "fill" && "aura-filterbar--fill",
4255
+ props.stackBelow === "lg" && "aura-filterbar--stack-lg",
4256
+ props.className
4257
+ )
4144
4258
  },
4145
4259
  /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React26.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React26.createElement(Icon, { name: /* @__PURE__ */ React26.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React26.createElement(
4146
4260
  "input",
@@ -4228,6 +4342,8 @@ window.Aura = (() => {
4228
4342
  const mounted = useMounted();
4229
4343
  const prev = React27.useRef(null);
4230
4344
  const o = opts || {};
4345
+ const latest = React27.useRef(o);
4346
+ latest.current = o;
4231
4347
  React27.useEffect(
4232
4348
  function() {
4233
4349
  if (!open || !mounted) return;
@@ -4248,7 +4364,12 @@ window.Aura = (() => {
4248
4364
  if (target && o.autoFocus !== false) target.focus();
4249
4365
  return function() {
4250
4366
  unlock();
4251
- if (prev.current && prev.current.focus) prev.current.focus();
4367
+ const l = latest.current;
4368
+ const ff = l.finalFocus;
4369
+ const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
4370
+ const back = to && to.isConnected ? to : prev.current;
4371
+ if (back && back.focus) back.focus();
4372
+ if (l.onCloseComplete) l.onCloseComplete();
4252
4373
  };
4253
4374
  },
4254
4375
  [open, mounted]
@@ -4630,22 +4751,77 @@ window.Aura = (() => {
4630
4751
  // src/Dialog.tsx
4631
4752
  var React30 = __toESM(require_react(), 1);
4632
4753
  var import_react_dom8 = __toESM(require_react_dom(), 1);
4754
+ var DialogClose = React30.createContext(null);
4755
+ function useDialogClose() {
4756
+ return React30.useContext(DialogClose) || function() {
4757
+ };
4758
+ }
4633
4759
  var Dialog = React30.forwardRef(function Dialog2(props, ref) {
4634
4760
  const t = useStrings();
4635
4761
  const density = useDensity();
4636
4762
  const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
4763
+ const openState = useMaybeControlled(props.open, false, null), open = openState[0];
4764
+ if (props.open === void 0 && !props.trigger)
4765
+ devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
4766
+ const trigId = uid();
4767
+ function closeNow() {
4768
+ if (props.open === void 0) openState[1](false);
4769
+ if (props.onClose) props.onClose();
4770
+ }
4637
4771
  function close() {
4638
- if (props.dismissible !== false && props.onClose) props.onClose();
4772
+ if (props.dismissible === false) return;
4773
+ closeNow();
4639
4774
  }
4640
4775
  const scrimCloses = props.dismissible !== false && (props.dismissOnScrim !== void 0 ? props.dismissOnScrim : props.role !== "alertdialog");
4641
- const modal = useModal(props.open, own, {
4776
+ const modal = useModal(open, own, {
4642
4777
  autoFocus: props.autoFocus,
4643
4778
  onEscape: close,
4644
4779
  bodySelector: ".aura-dialog__body",
4645
- footSelector: ".aura-dialog__foot"
4780
+ footSelector: ".aura-dialog__foot",
4781
+ /* With a trigger, focus goes back to it even where a click doesn't focus buttons (Safari). */
4782
+ finalFocus: props.trigger ? function() {
4783
+ const ff = props.finalFocus;
4784
+ const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
4785
+ return to || document.querySelector('[data-aura-trigger="' + trigId + '"]');
4786
+ } : props.finalFocus,
4787
+ onCloseComplete: props.onCloseComplete
4646
4788
  });
4647
- if (!modal.ready) return null;
4648
- return (0, import_react_dom8.createPortal)(
4789
+ const trig = props.trigger;
4790
+ const trigger = trig && React30.isValidElement(trig) ? React30.cloneElement(trig, {
4791
+ "aria-haspopup": "dialog",
4792
+ "aria-expanded": open,
4793
+ "data-aura-trigger": trigId,
4794
+ onClick: function(e) {
4795
+ const own2 = trig.props.onClick;
4796
+ if (own2) own2(e);
4797
+ if (e.defaultPrevented) return;
4798
+ if (props.open === void 0) openState[1](true);
4799
+ if (props.onOpen) props.onOpen();
4800
+ }
4801
+ }) : null;
4802
+ if (!modal.ready) return trigger;
4803
+ const rest = omit(props, [
4804
+ "open",
4805
+ "onClose",
4806
+ "title",
4807
+ "description",
4808
+ "children",
4809
+ "footer",
4810
+ "size",
4811
+ "dismissible",
4812
+ "dismissOnScrim",
4813
+ "role",
4814
+ "autoFocus",
4815
+ "className",
4816
+ "trigger",
4817
+ "onOpen",
4818
+ "finalFocus",
4819
+ "onCloseComplete",
4820
+ "aria-labelledby",
4821
+ "aria-describedby",
4822
+ "aria-modal"
4823
+ ]);
4824
+ const panel = (0, import_react_dom8.createPortal)(
4649
4825
  /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
4650
4826
  "div",
4651
4827
  {
@@ -4659,21 +4835,22 @@ window.Aura = (() => {
4659
4835
  ), /* @__PURE__ */ React30.createElement(
4660
4836
  "div",
4661
4837
  {
4838
+ ...rest,
4662
4839
  ref: merged,
4663
4840
  role: props.role || "dialog",
4664
4841
  "aria-modal": true,
4665
4842
  "aria-labelledby": titleId,
4666
- "aria-describedby": props.description ? descId : void 0,
4843
+ "aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
4667
4844
  tabIndex: -1,
4668
4845
  className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
4669
4846
  },
4670
4847
  /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React30.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React30.createElement(IconButton, { icon: /* @__PURE__ */ React30.createElement(IconX, null), label: t.close, className: "aura-dialog__close", onClick: close }) : null),
4671
4848
  props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
4672
- props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
4673
- props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
4849
+ /* @__PURE__ */ React30.createElement(DialogClose.Provider, { value: closeNow }, props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null, props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null)
4674
4850
  )),
4675
4851
  document.body
4676
4852
  );
4853
+ return trigger ? /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, panel) : panel;
4677
4854
  });
4678
4855
  var Drawer = React30.forwardRef(function Drawer2(props, ref) {
4679
4856
  const t = useStrings();
@@ -4686,7 +4863,9 @@ window.Aura = (() => {
4686
4863
  autoFocus: props.autoFocus,
4687
4864
  onEscape: close,
4688
4865
  bodySelector: ".aura-drawer__body",
4689
- footSelector: ".aura-drawer__foot"
4866
+ footSelector: ".aura-drawer__foot",
4867
+ finalFocus: props.finalFocus,
4868
+ onCloseComplete: props.onCloseComplete
4690
4869
  });
4691
4870
  if (!modal.ready) return null;
4692
4871
  const side = props.side === "left" ? "left" : "right";
@@ -4707,7 +4886,9 @@ window.Aura = (() => {
4707
4886
  "aria-labelledby",
4708
4887
  "className",
4709
4888
  "closeLabel",
4710
- "closeProps"
4889
+ "closeProps",
4890
+ "finalFocus",
4891
+ "onCloseComplete"
4711
4892
  ]);
4712
4893
  const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
4713
4894
  return (0, import_react_dom8.createPortal)(
@@ -4803,7 +4984,9 @@ window.Aura = (() => {
4803
4984
  oneCallback ? null : props.onSortChange
4804
4985
  );
4805
4986
  const sort = sortState[0], setSort = sortState[1];
4806
- const selState = useMaybeControlled(props.selected, props.defaultSelected || [], props.onSelectionChange);
4987
+ const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
4988
+ const onSel = React31.useRef(props.onSelectionChange);
4989
+ onSel.current = props.onSelectionChange;
4807
4990
  const canSelect = function(r) {
4808
4991
  return !!r && (!props.isRowSelectable || !!props.isRowSelectable(r));
4809
4992
  };
@@ -4814,7 +4997,11 @@ window.Aura = (() => {
4814
4997
  });
4815
4998
  const selected = selState[0].filter(function(k) {
4816
4999
  return !rejected[String(k)];
4817
- }), setSelected = selState[1];
5000
+ });
5001
+ function setSelected(next, change) {
5002
+ selState[1](next);
5003
+ if (onSel.current) onSel.current(next, change || { key: null, shiftKey: false, source: "sync" });
5004
+ }
4818
5005
  const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
4819
5006
  return rejected[String(k)];
4820
5007
  }).join("\0") + "#" + selected.join("\0");
@@ -5302,11 +5489,39 @@ window.Aura = (() => {
5302
5489
  return selSet[String(k)];
5303
5490
  }).length;
5304
5491
  const all = nSel > 0 && nSel === pageKeys.length;
5305
- function toggle(k, on) {
5492
+ const anchor = React31.useRef(null);
5493
+ const shiftClick = React31.useRef(false);
5494
+ function toggle(k, on, how) {
5495
+ const same2 = function(x) {
5496
+ return String(x) === String(k);
5497
+ };
5498
+ let range = null;
5499
+ if (props.rangeSelect && how.shiftKey && anchor.current != null) {
5500
+ const from = pageKeys.findIndex(function(x) {
5501
+ return String(x) === String(anchor.current);
5502
+ });
5503
+ const to = pageKeys.findIndex(same2);
5504
+ if (from >= 0 && to >= 0) range = pageKeys.slice(Math.min(from, to), Math.max(from, to) + 1);
5505
+ }
5506
+ anchor.current = k;
5507
+ const change = { key: k, shiftKey: how.shiftKey, source: how.source };
5508
+ if (range) {
5509
+ const inRange = {};
5510
+ range.forEach(function(x) {
5511
+ inRange[String(x)] = true;
5512
+ });
5513
+ const rest = selected.filter(function(x) {
5514
+ return !inRange[String(x)];
5515
+ });
5516
+ change.range = range;
5517
+ setSelected(on ? rest.concat(range) : rest, change);
5518
+ return;
5519
+ }
5306
5520
  setSelected(
5307
5521
  on ? selected.concat([k]) : selected.filter(function(x) {
5308
- return String(x) !== String(k);
5309
- })
5522
+ return !same2(x);
5523
+ }),
5524
+ change
5310
5525
  );
5311
5526
  }
5312
5527
  function toggleAll() {
@@ -5319,7 +5534,8 @@ window.Aura = (() => {
5319
5534
  pageKeys.filter(function(k) {
5320
5535
  return !selSet[String(k)];
5321
5536
  })
5322
- )
5537
+ ),
5538
+ { key: null, shiftKey: false, source: "all" }
5323
5539
  );
5324
5540
  }
5325
5541
  function canResize(c) {
@@ -5498,8 +5714,8 @@ window.Aura = (() => {
5498
5714
  };
5499
5715
  }).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
5500
5716
  }
5501
- function openMenu(kind, key, anchor, rc) {
5502
- setMenu({ kind, key, anchor, rc });
5717
+ function openMenu(kind, key, anchor2, rc) {
5718
+ setMenu({ kind, key, anchor: anchor2, rc });
5503
5719
  }
5504
5720
  function closeMenu(restore) {
5505
5721
  const m = menu;
@@ -5559,7 +5775,8 @@ window.Aura = (() => {
5559
5775
  if (pageKeys.length) toggleAll();
5560
5776
  } else if (r === 0 && col && col.sortable && canSortAny) sortBy(col.key);
5561
5777
  else if (r > 0 && k === " " && selectable) {
5562
- if (canSelect(row) && !(stacked && noCardSel)) toggle(row[rowKey], !selSet[row[rowKey]]);
5778
+ if (canSelect(row) && !(stacked && noCardSel))
5779
+ toggle(row[rowKey], !selSet[row[rowKey]], { shiftKey: e.shiftKey, source: "keyboard" });
5563
5780
  } else if (r > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
5564
5781
  followRow(target.closest('[role="row"]'), e);
5565
5782
  else if (r > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
@@ -5749,6 +5966,9 @@ window.Aura = (() => {
5749
5966
  "aria-label": canSelect(r) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r) : void 0,
5750
5967
  onFocus: function(e) {
5751
5968
  if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
5969
+ },
5970
+ onClickCapture: function(e) {
5971
+ shiftClick.current = e.shiftKey;
5752
5972
  }
5753
5973
  },
5754
5974
  canSelect(r) ? /* @__PURE__ */ React31.createElement(
@@ -5759,7 +5979,9 @@ window.Aura = (() => {
5759
5979
  tabIndex: -1,
5760
5980
  label: selLabel,
5761
5981
  onChange: function(on) {
5762
- toggle(k, on);
5982
+ const shift = shiftClick.current;
5983
+ shiftClick.current = false;
5984
+ toggle(k, on, { shiftKey: shift, source: "click" });
5763
5985
  }
5764
5986
  }
5765
5987
  ) : null
@@ -6142,7 +6364,13 @@ window.Aura = (() => {
6142
6364
  const Link = useLinkComponent(props.linkComponent);
6143
6365
  const manual = props.activation === "manual";
6144
6366
  const seg = props.variant === "segmented";
6145
- const listCls = cx("aura-tabs__list", seg && "aura-segmented", seg && props.fullWidth && "is-full");
6367
+ const fw = props.fullWidth;
6368
+ const listCls = cx(
6369
+ "aura-tabs__list",
6370
+ seg && "aura-segmented",
6371
+ fw === true && (seg ? "is-full" : "is-fill"),
6372
+ typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
6373
+ );
6146
6374
  const tabCls = function(on, extra) {
6147
6375
  return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
6148
6376
  };
@@ -6463,16 +6691,19 @@ window.Aura = (() => {
6463
6691
  return item(c, depth + 1);
6464
6692
  })));
6465
6693
  }
6466
- const on = active === it.id;
6694
+ const action = it.selectable === false;
6695
+ const on = !action && active === it.id;
6467
6696
  const common = {
6468
6697
  ...tipHandlers(it.label),
6469
- className: cx("aura-nav__item", on && "is-active"),
6698
+ className: cx("aura-nav__item", action && "aura-nav__item--action", on && "is-active"),
6470
6699
  "aria-current": on ? "page" : void 0,
6471
6700
  style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
6472
6701
  onClick: function(e) {
6473
6702
  if (!it.href) e.preventDefault();
6474
6703
  else if (!plainClick(e)) return;
6475
- st[1](it.id);
6704
+ if (!action) st[1](it.id);
6705
+ if (it.onSelect) it.onSelect();
6706
+ if (action && props.onAction) props.onAction(it.id);
6476
6707
  }
6477
6708
  };
6478
6709
  return /* @__PURE__ */ React34.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React34.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React34.createElement("button", { type: "button", ...common }, inner(it, false, false)));
@@ -6489,6 +6720,7 @@ window.Aura = (() => {
6489
6720
  "aura-nav",
6490
6721
  collapsed && "aura-nav--collapsed",
6491
6722
  props.bordered === false && "aura-nav--borderless",
6723
+ props.chevron === "right" && "aura-nav--chevron-right",
6492
6724
  props.className
6493
6725
  ),
6494
6726
  "data-collapsed": collapsed ? "" : void 0,
@@ -6502,7 +6734,20 @@ window.Aura = (() => {
6502
6734
  })));
6503
6735
  })),
6504
6736
  props.footer ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
6505
- props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
6737
+ props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle aura-nav__toggle--row" }, /* @__PURE__ */ React34.createElement(
6738
+ "button",
6739
+ {
6740
+ type: "button",
6741
+ className: "aura-nav__item aura-nav__item--action",
6742
+ ...tipHandlers(collapsed ? t.expandNav : t.collapseNav),
6743
+ onClick: function() {
6744
+ setTip(null);
6745
+ col[1](!collapsed);
6746
+ }
6747
+ },
6748
+ /* @__PURE__ */ React34.createElement(Icon, { name: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null) }),
6749
+ /* @__PURE__ */ React34.createElement("span", { className: "aura-nav__label" }, collapsed ? t.expandNav : t.collapseNav)
6750
+ )) : props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
6506
6751
  IconButton,
6507
6752
  {
6508
6753
  icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
@@ -6535,13 +6780,83 @@ window.Aura = (() => {
6535
6780
  const t = useStrings();
6536
6781
  const Link = useLinkComponent(props.linkComponent);
6537
6782
  const items2 = props.items || [];
6538
- return /* @__PURE__ */ React35.createElement("nav", { ref, "aria-label": props.label || t.breadcrumb, className: cx("aura-crumbs", props.className) }, /* @__PURE__ */ React35.createElement("ol", null, items2.map(function(it, i) {
6783
+ const collapsible = !!props.collapseBelow && items2.length > 2;
6784
+ const trail = items2.map(function(it) {
6785
+ return it.label + "" + (it.href || "");
6786
+ }).join("");
6787
+ const st = React35.useState(null), expanded = st[0] === trail, setExpanded = function() {
6788
+ st[1](trail);
6789
+ };
6790
+ const listRef = React35.useRef(null);
6791
+ const focusNext = React35.useRef(false);
6792
+ React35.useEffect(
6793
+ function() {
6794
+ if (!expanded || !focusNext.current) return;
6795
+ focusNext.current = false;
6796
+ const ol = listRef.current;
6797
+ if (!ol) return;
6798
+ let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
6799
+ if (!target) {
6800
+ target = ol.querySelector(".aura-crumbs__middle > *");
6801
+ if (target) target.tabIndex = -1;
6802
+ }
6803
+ if (target) target.focus();
6804
+ },
6805
+ [expanded]
6806
+ );
6807
+ const sep = /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
6808
+ const more = collapsible && !expanded ? /* @__PURE__ */ React35.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React35.createElement(
6809
+ "button",
6810
+ {
6811
+ type: "button",
6812
+ "aria-label": t.breadcrumbMore,
6813
+ onClick: function() {
6814
+ focusNext.current = true;
6815
+ setExpanded();
6816
+ }
6817
+ },
6818
+ "\u2026"
6819
+ ), sep) : null;
6820
+ const out = [];
6821
+ items2.forEach(function(it, i) {
6539
6822
  const last = i === items2.length - 1;
6540
- return /* @__PURE__ */ React35.createElement("li", { key: i }, last ? /* @__PURE__ */ React35.createElement("span", { "aria-current": "page", className: "aura-crumbs__current" }, it.label) : it.href ? /* @__PURE__ */ React35.createElement(Link, { href: it.href, onClick: it.onClick }, it.label) : it.onClick ? /* @__PURE__ */ React35.createElement("button", { type: "button", onClick: it.onClick }, it.label) : (
6541
- /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6542
- /* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
6543
- ), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
6544
- })));
6823
+ const lp = it.linkProps || {};
6824
+ const plain = lp;
6825
+ const own = lp.onClick;
6826
+ const click = own || it.onClick ? function(e) {
6827
+ if (own) own(e);
6828
+ if (it.onClick) it.onClick();
6829
+ } : void 0;
6830
+ out.push(
6831
+ /* @__PURE__ */ React35.createElement(
6832
+ "li",
6833
+ {
6834
+ key: i,
6835
+ ...it.itemProps,
6836
+ className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
6837
+ },
6838
+ last ? /* @__PURE__ */ React35.createElement("span", { ...plain, "aria-current": "page", className: cx("aura-crumbs__current", lp.className) }, it.label) : it.href ? /* @__PURE__ */ React35.createElement(Link, { ...lp, href: it.href, onClick: click }, it.label) : it.onClick ? /* @__PURE__ */ React35.createElement("button", { ...lp, type: "button", onClick: click }, it.label) : (
6839
+ /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6840
+ /* @__PURE__ */ React35.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
6841
+ ),
6842
+ last ? null : sep
6843
+ )
6844
+ );
6845
+ if (i === 0 && more) out.push(more);
6846
+ });
6847
+ return /* @__PURE__ */ React35.createElement(
6848
+ "nav",
6849
+ {
6850
+ ref,
6851
+ "aria-label": props.label || t.breadcrumb,
6852
+ className: cx(
6853
+ "aura-crumbs",
6854
+ collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
6855
+ props.className
6856
+ )
6857
+ },
6858
+ /* @__PURE__ */ React35.createElement("ol", { ref: listRef }, out)
6859
+ );
6545
6860
  });
6546
6861
 
6547
6862
  // src/Avatar.tsx
@@ -6699,6 +7014,11 @@ window.Aura = (() => {
6699
7014
  onNav(id);
6700
7015
  setOpen(false);
6701
7016
  },
7017
+ /* 5.16: an action row (Sign out) closes the drawer too. */
7018
+ onAction: function(id) {
7019
+ setOpen(false);
7020
+ if (navEl.props.onAction) navEl.props.onAction(id);
7021
+ },
6702
7022
  className: cx(navEl.props.className, "is-in-drawer"),
6703
7023
  collapsed: false,
6704
7024
  collapsible: false
@@ -6862,7 +7182,8 @@ window.Aura = (() => {
6862
7182
  return out;
6863
7183
  }
6864
7184
  var Table = React44.forwardRef(function Table2(props, ref) {
6865
- const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
7185
+ const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
7186
+ const cards = !!stackBelow && stackStyle === "cards";
6866
7187
  const labels = stackBelow ? headerLabels(children) : null;
6867
7188
  if (labels && !labels.length)
6868
7189
  devWarnOnce(
@@ -6886,7 +7207,7 @@ window.Aura = (() => {
6886
7207
  ro.disconnect();
6887
7208
  };
6888
7209
  }, []);
6889
- return /* @__PURE__ */ React44.createElement(
7210
+ const table = /* @__PURE__ */ React44.createElement(
6890
7211
  "div",
6891
7212
  {
6892
7213
  ref: wrap,
@@ -6905,6 +7226,7 @@ window.Aura = (() => {
6905
7226
  "aura-tbl",
6906
7227
  stackBelow && "aura-tbl--stack-" + stackBelow,
6907
7228
  align === "middle" && "aura-tbl--middle",
7229
+ cards && "aura-tbl--cards",
6908
7230
  className
6909
7231
  ),
6910
7232
  role: stackBelow ? "table" : void 0,
@@ -6914,6 +7236,7 @@ window.Aura = (() => {
6914
7236
  labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
6915
7237
  )
6916
7238
  );
7239
+ return cards ? /* @__PURE__ */ React44.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
6917
7240
  });
6918
7241
  function section(tag, cls) {
6919
7242
  const C = React44.forwardRef(function TableSection(props, ref) {
@@ -8015,9 +8338,13 @@ window.Aura = (() => {
8015
8338
  // src/Progress.tsx
8016
8339
  var React53 = __toESM(require_react(), 1);
8017
8340
  var Progress = React53.forwardRef(function Progress2(props, ref) {
8341
+ const t = useStrings();
8018
8342
  const auto = uid(), id = props.id || auto;
8019
8343
  const max = props.max || 100, det = props.value != null;
8020
8344
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
8345
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
8346
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
8347
+ const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
8021
8348
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
8022
8349
  return /* @__PURE__ */ React53.createElement(
8023
8350
  "div",
@@ -8041,9 +8368,16 @@ window.Aura = (() => {
8041
8368
  "aria-valuemin": det ? 0 : void 0,
8042
8369
  "aria-valuemax": det ? max : void 0,
8043
8370
  "aria-valuenow": det ? props.value : void 0,
8044
- "aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
8371
+ "aria-valuetext": det ? valueText : void 0
8045
8372
  },
8046
- /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
8373
+ /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
8374
+ sec ? /* @__PURE__ */ React53.createElement(
8375
+ "span",
8376
+ {
8377
+ className: "aura-progress__bar aura-progress__bar--reserved",
8378
+ style: { left: pct + "%", width: spct + "%" }
8379
+ }
8380
+ ) : null
8047
8381
  ),
8048
8382
  props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
8049
8383
  );