@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.
@@ -119,6 +119,7 @@ __export(index_exports, {
119
119
  useBreakpoint: () => useBreakpoint,
120
120
  useColorScheme: () => useColorScheme,
121
121
  useDensity: () => useDensity,
122
+ useDialogClose: () => useDialogClose,
122
123
  useFormatDate: () => useFormatDate,
123
124
  useResponsive: () => useResponsive
124
125
  });
@@ -604,8 +605,11 @@ function cardElement(props, ref) {
604
605
  "interactive",
605
606
  "as",
606
607
  "className",
607
- "titleId"
608
+ "titleId",
609
+ "header",
610
+ "flushBelow"
608
611
  ]);
612
+ const head = props.header !== void 0 && props.header !== null && props.header !== false;
609
613
  return h2(
610
614
  props.as || "section",
611
615
  Object.assign({}, rest, {
@@ -614,12 +618,13 @@ function cardElement(props, ref) {
614
618
  "aura-card",
615
619
  creative && "aura-card--creative",
616
620
  props.interactive && "is-interactive",
621
+ props.flushBelow && "aura-card--flush-below-" + props.flushBelow,
617
622
  props.className
618
623
  ),
619
624
  /* A titled card is labelled by its title; otherwise the caller's aria-labelledby stays (5.8). */
620
- "aria-labelledby": props.title && props.titleId ? props.titleId : props["aria-labelledby"]
625
+ "aria-labelledby": !head && props.title && props.titleId ? props.titleId : props["aria-labelledby"]
621
626
  }),
622
- 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,
627
+ 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,
623
628
  props.children ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__body" }, props.children) : null,
624
629
  props.footer ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__foot" }, props.footer) : null
625
630
  );
@@ -754,6 +759,7 @@ function buttonClass(opts = {}) {
754
759
  "aura-btn--" + (opts.variant || "primary"),
755
760
  opts.size === "sm" && "aura-btn--sm",
756
761
  opts.fullWidth && "aura-btn--full",
762
+ opts.touchHeight && "aura-btn--touch",
757
763
  opts.loading && "is-loading",
758
764
  opts.className
759
765
  );
@@ -883,6 +889,10 @@ var th = {
883
889
  pageN: function(p) {
884
890
  return "\u0E2B\u0E19\u0E49\u0E32 " + p;
885
891
  },
892
+ progressReserved: function(v, r, max) {
893
+ return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r);
894
+ },
895
+ breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
886
896
  accepts: function(list, max) {
887
897
  return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
888
898
  }
@@ -1009,6 +1019,10 @@ var sv = {
1009
1019
  pageN: function(p) {
1010
1020
  return "Sida " + p;
1011
1021
  },
1022
+ progressReserved: function(v, r, max) {
1023
+ return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r) + " reserverade";
1024
+ },
1025
+ breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
1012
1026
  accepts: function(list, max) {
1013
1027
  return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
1014
1028
  }
@@ -1136,6 +1150,10 @@ var STRINGS = {
1136
1150
  pageN: function(p) {
1137
1151
  return "Page " + p;
1138
1152
  },
1153
+ progressReserved: function(v, r, max) {
1154
+ return n2(v) + " of " + n2(max) + " used, " + n2(r) + " reserved";
1155
+ },
1156
+ breadcrumbMore: "Show the full path",
1139
1157
  accepts: function(list, max) {
1140
1158
  return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
1141
1159
  }
@@ -1202,7 +1220,8 @@ function ButtonLink(props, ref, Link) {
1202
1220
  "linkComponent",
1203
1221
  "href",
1204
1222
  "fullWidth",
1205
- "size"
1223
+ "size",
1224
+ "touchHeight"
1206
1225
  ]);
1207
1226
  const Tag3 = disabled ? "a" : Link;
1208
1227
  return /* @__PURE__ */ React6.createElement(
@@ -1218,6 +1237,7 @@ function ButtonLink(props, ref, Link) {
1218
1237
  variant,
1219
1238
  size: props.size,
1220
1239
  fullWidth: props.fullWidth,
1240
+ touchHeight: props.touchHeight,
1221
1241
  className: props.className
1222
1242
  }),
1223
1243
  onClick: disabled ? void 0 : props.onClick
@@ -1248,7 +1268,8 @@ var Button = React6.forwardRef(
1248
1268
  "loading",
1249
1269
  "onClick",
1250
1270
  "fullWidth",
1251
- "size"
1271
+ "size",
1272
+ "touchHeight"
1252
1273
  ]);
1253
1274
  return /* @__PURE__ */ React6.createElement(
1254
1275
  "button",
@@ -1260,6 +1281,7 @@ var Button = React6.forwardRef(
1260
1281
  variant,
1261
1282
  size: props.size,
1262
1283
  fullWidth: props.fullWidth,
1284
+ touchHeight: props.touchHeight,
1263
1285
  loading,
1264
1286
  className: props.className
1265
1287
  }),
@@ -1279,7 +1301,7 @@ var Button = React6.forwardRef(
1279
1301
  // src/IconButton.tsx
1280
1302
  var React7 = __toESM(require("react"), 1);
1281
1303
  var IconButton = React7.forwardRef(function IconButton2(props, ref) {
1282
- const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
1304
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
1283
1305
  return /* @__PURE__ */ React7.createElement(
1284
1306
  "button",
1285
1307
  {
@@ -1288,7 +1310,12 @@ var IconButton = React7.forwardRef(function IconButton2(props, ref) {
1288
1310
  type: props.type || "button",
1289
1311
  "aria-label": props.label,
1290
1312
  title: props.label,
1291
- className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
1313
+ className: cx(
1314
+ "aura-icon-btn",
1315
+ props.tone === "danger" && "aura-icon-btn--danger",
1316
+ props.touchHeight && "aura-icon-btn--touch",
1317
+ props.className
1318
+ )
1292
1319
  },
1293
1320
  /* @__PURE__ */ React7.createElement(Icon, { name: props.icon, size: props.size || "sm" })
1294
1321
  );
@@ -1560,7 +1587,8 @@ var Checkbox = React10.forwardRef(function Checkbox2(props, ref) {
1560
1587
  "description",
1561
1588
  "className",
1562
1589
  "tabIndex",
1563
- "disabled"
1590
+ "disabled",
1591
+ "hitArea"
1564
1592
  ]);
1565
1593
  const text2 = props.children;
1566
1594
  const labelled = text2 != null && text2 !== "";
@@ -1570,10 +1598,19 @@ var Checkbox = React10.forwardRef(function Checkbox2(props, ref) {
1570
1598
  "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`."
1571
1599
  );
1572
1600
  const descId = props.description ? (props.id || auto) + "-desc" : void 0;
1601
+ const ha = props.hitArea;
1602
+ const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
1573
1603
  return /* @__PURE__ */ React10.createElement(
1574
1604
  "label",
1575
1605
  {
1576
- className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
1606
+ className: cx(
1607
+ "aura-check",
1608
+ labelled && "aura-check--labelled",
1609
+ hit && "has-hit",
1610
+ props.disabled && "is-disabled",
1611
+ props.className
1612
+ ),
1613
+ style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
1577
1614
  onClick: function(e) {
1578
1615
  e.stopPropagation();
1579
1616
  }
@@ -2412,6 +2449,13 @@ var Combobox = React19.forwardRef(
2412
2449
  const density = useDensity();
2413
2450
  const auto = uid(), id = props.id || auto, listId = id + "-list";
2414
2451
  const options = (props.options || []).map(toOpt);
2452
+ const groups = props.groups || [];
2453
+ groups.forEach(function(g, gi) {
2454
+ g.options.forEach(function(o) {
2455
+ options.push(Object.assign({}, toOpt(o), { __g: gi }));
2456
+ });
2457
+ });
2458
+ const custom = !multi && !!props.allowCustomValue;
2415
2459
  const st = useMaybeControlled(
2416
2460
  multi ? mp.value : props.value === void 0 ? void 0 : props.value == null ? [] : [props.value],
2417
2461
  multi ? mp.defaultValue || [] : props.defaultValue == null ? [] : [props.defaultValue],
@@ -2451,7 +2495,9 @@ var Combobox = React19.forwardRef(
2451
2495
  });
2452
2496
  const more = shown.length > limit;
2453
2497
  shown = shown.slice(0, limit);
2454
- const activeIdx = Math.min(active, shown.length - 1);
2498
+ const activeIdx = active < 0 ? query ? shown.findIndex(function(o) {
2499
+ return !o.disabled && norm(o.label) === norm(query.trim());
2500
+ }) : -1 : Math.min(active, shown.length - 1);
2455
2501
  function place() {
2456
2502
  if (!boxRef.current) return;
2457
2503
  const r = boxRef.current.getBoundingClientRect();
@@ -2476,6 +2522,7 @@ var Combobox = React19.forwardRef(
2476
2522
  function outside(e) {
2477
2523
  if (boxRef.current && boxRef.current.contains(e.target)) return;
2478
2524
  if (listRef.current && listRef.current.contains(e.target)) return;
2525
+ if (commitRef.current()) return;
2479
2526
  close(false);
2480
2527
  }
2481
2528
  function onScroll(e) {
@@ -2512,6 +2559,27 @@ var Combobox = React19.forwardRef(
2512
2559
  setOpen(false);
2513
2560
  setQuery(null);
2514
2561
  }
2562
+ const committed = React19.useRef(false);
2563
+ const commitRef = React19.useRef(function() {
2564
+ return false;
2565
+ });
2566
+ function commitTyped() {
2567
+ if (!custom || query == null || committed.current) return false;
2568
+ committed.current = true;
2569
+ const q = query.trim();
2570
+ if (!q) {
2571
+ if (props.clearable !== false) setValue(null);
2572
+ } else {
2573
+ const hit = options.filter(function(o) {
2574
+ return !o.disabled && norm(o.label) === norm(q);
2575
+ })[0];
2576
+ setValue(hit ? hit.value : q);
2577
+ }
2578
+ setQuery(null);
2579
+ setOpen(false);
2580
+ return true;
2581
+ }
2582
+ commitRef.current = commitTyped;
2515
2583
  function choose(o) {
2516
2584
  if (!o || o.disabled) return;
2517
2585
  if (multi) {
@@ -2552,7 +2620,7 @@ var Combobox = React19.forwardRef(
2552
2620
  if (open && live[activeIdx]) {
2553
2621
  e.preventDefault();
2554
2622
  choose(live[activeIdx]);
2555
- }
2623
+ } else if (commitTyped()) e.preventDefault();
2556
2624
  } else if (k === "Escape") {
2557
2625
  if (open) {
2558
2626
  e.preventDefault();
@@ -2564,58 +2632,95 @@ var Combobox = React19.forwardRef(
2564
2632
  } else if (k === "Backspace" && multi && !props.readOnly && !text2 && values.length) {
2565
2633
  setValues(values.slice(0, -1));
2566
2634
  } else if (k === "Tab") {
2635
+ if (custom && open && query != null && live[activeIdx]) {
2636
+ choose(live[activeIdx]);
2637
+ return;
2638
+ }
2639
+ if (commitTyped()) return;
2567
2640
  if (open) close();
2568
2641
  }
2569
2642
  }
2570
- const text2 = query != null ? query : selected ? selected.label : "";
2643
+ const text2 = query != null ? query : selected ? selected.label : custom && value != null ? value : "";
2571
2644
  const summaryId = id + "-picked";
2572
2645
  const optId = function(i) {
2573
2646
  return id + "-opt-" + i;
2574
2647
  };
2648
+ function renderOpt(o, i) {
2649
+ const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
2650
+ const blocked = o.disabled || multi && full && !isSel;
2651
+ return /* @__PURE__ */ React19.createElement(
2652
+ "li",
2653
+ {
2654
+ key: o.value,
2655
+ id: optId(i),
2656
+ role: "option",
2657
+ "data-idx": i,
2658
+ "aria-selected": isSel,
2659
+ "aria-disabled": blocked || void 0,
2660
+ className: cx(
2661
+ "aura-combo__option",
2662
+ i === activeIdx && "is-active",
2663
+ isSel && "is-selected",
2664
+ blocked && "is-disabled"
2665
+ ),
2666
+ onPointerDown: function(e) {
2667
+ e.preventDefault();
2668
+ },
2669
+ onClick: function() {
2670
+ if (!blocked || isSel) choose(o);
2671
+ },
2672
+ onPointerMove: function() {
2673
+ if (activeIdx !== i) setActive(i);
2674
+ }
2675
+ },
2676
+ o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
2677
+ /* @__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),
2678
+ isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
2679
+ );
2680
+ }
2681
+ function grouped(list2) {
2682
+ const out = [];
2683
+ list2.forEach(function(o, i) {
2684
+ const last = out[out.length - 1];
2685
+ if (last && last.g === o.__g) last.items.push([o, i]);
2686
+ else out.push({ g: o.__g, items: [[o, i]] });
2687
+ });
2688
+ return out;
2689
+ }
2575
2690
  const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
2576
- /* @__PURE__ */ React19.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React19.createElement(
2577
- "ul",
2691
+ /* @__PURE__ */ React19.createElement(
2692
+ "div",
2578
2693
  {
2579
- id: listId,
2580
- role: "listbox",
2581
- "aria-label": props.label,
2582
- "aria-multiselectable": multi || void 0,
2583
- className: "aura-combo__list"
2694
+ ref: listRef,
2695
+ "data-density": density,
2696
+ className: "aura-combo__popover",
2697
+ style: posState[0],
2698
+ onPointerDown: function(e) {
2699
+ e.preventDefault();
2700
+ }
2584
2701
  },
2585
- live.map(function(o, i) {
2586
- const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
2587
- const blocked = o.disabled || multi && full && !isSel;
2588
- return /* @__PURE__ */ React19.createElement(
2589
- "li",
2590
- {
2591
- key: o.value,
2592
- id: optId(i),
2593
- role: "option",
2594
- "data-idx": i,
2595
- "aria-selected": isSel,
2596
- "aria-disabled": blocked || void 0,
2597
- className: cx(
2598
- "aura-combo__option",
2599
- i === activeIdx && "is-active",
2600
- isSel && "is-selected",
2601
- blocked && "is-disabled"
2602
- ),
2603
- onPointerDown: function(e) {
2604
- e.preventDefault();
2605
- },
2606
- onClick: function() {
2607
- if (!blocked || isSel) choose(o);
2608
- },
2609
- onPointerMove: function() {
2610
- if (activeIdx !== i) setActive(i);
2611
- }
2612
- },
2613
- o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
2614
- /* @__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),
2615
- isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
2616
- );
2617
- })
2618
- ) : 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),
2702
+ live.length ? /* @__PURE__ */ React19.createElement(
2703
+ "ul",
2704
+ {
2705
+ id: listId,
2706
+ role: "listbox",
2707
+ "aria-label": props.label,
2708
+ "aria-multiselectable": multi || void 0,
2709
+ className: "aura-combo__list"
2710
+ },
2711
+ grouped(live).map(function(seg) {
2712
+ if (seg.g == null)
2713
+ return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: "u" + seg.items[0][1] }, seg.items.map(function(p) {
2714
+ return renderOpt(p[0], p[1]);
2715
+ }));
2716
+ const gid = id + "-group-" + seg.g + "-" + seg.items[0][1];
2717
+ 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) {
2718
+ return renderOpt(p[0], p[1]);
2719
+ })));
2720
+ })
2721
+ ) : null,
2722
+ 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
2723
+ ),
2619
2724
  document.body
2620
2725
  ) : null;
2621
2726
  return /* @__PURE__ */ React19.createElement(
@@ -2677,8 +2782,9 @@ var Combobox = React19.forwardRef(
2677
2782
  required: props.required && (!multi || !values.length),
2678
2783
  value: text2,
2679
2784
  onChange: function(e) {
2785
+ committed.current = false;
2680
2786
  setQuery(e.target.value);
2681
- setActive(0);
2787
+ setActive(custom ? -1 : 0);
2682
2788
  if (!open) setOpen(true);
2683
2789
  if (props.onSearch) props.onSearch(e.target.value);
2684
2790
  },
@@ -2687,6 +2793,8 @@ var Combobox = React19.forwardRef(
2687
2793
  onBlur: function() {
2688
2794
  setTimeout(function() {
2689
2795
  if (listRef.current && listRef.current.contains(document.activeElement)) return;
2796
+ if (custom && document.activeElement === inputRef.current) return;
2797
+ if (commitRef.current()) return;
2690
2798
  setOpen(false);
2691
2799
  setQuery(null);
2692
2800
  }, 0);
@@ -4122,7 +4230,13 @@ var FilterBar = React26.forwardRef(function FilterBar2(props, ref) {
4122
4230
  ref,
4123
4231
  role: "region",
4124
4232
  "aria-label": props.label || t.filters,
4125
- className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
4233
+ className: cx(
4234
+ "aura-filterbar",
4235
+ props.searchGrow && "aura-filterbar--grow",
4236
+ props.controlsLayout === "fill" && "aura-filterbar--fill",
4237
+ props.stackBelow === "lg" && "aura-filterbar--stack-lg",
4238
+ props.className
4239
+ )
4126
4240
  },
4127
4241
  /* @__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(
4128
4242
  "input",
@@ -4210,6 +4324,8 @@ function useModal(open, ref, opts) {
4210
4324
  const mounted = useMounted();
4211
4325
  const prev = React27.useRef(null);
4212
4326
  const o = opts || {};
4327
+ const latest = React27.useRef(o);
4328
+ latest.current = o;
4213
4329
  React27.useEffect(
4214
4330
  function() {
4215
4331
  if (!open || !mounted) return;
@@ -4230,7 +4346,12 @@ function useModal(open, ref, opts) {
4230
4346
  if (target && o.autoFocus !== false) target.focus();
4231
4347
  return function() {
4232
4348
  unlock();
4233
- if (prev.current && prev.current.focus) prev.current.focus();
4349
+ const l = latest.current;
4350
+ const ff = l.finalFocus;
4351
+ const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
4352
+ const back = to && to.isConnected ? to : prev.current;
4353
+ if (back && back.focus) back.focus();
4354
+ if (l.onCloseComplete) l.onCloseComplete();
4234
4355
  };
4235
4356
  },
4236
4357
  [open, mounted]
@@ -4612,22 +4733,77 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
4612
4733
  // src/Dialog.tsx
4613
4734
  var React30 = __toESM(require("react"), 1);
4614
4735
  var import_react_dom8 = require("react-dom");
4736
+ var DialogClose = React30.createContext(null);
4737
+ function useDialogClose() {
4738
+ return React30.useContext(DialogClose) || function() {
4739
+ };
4740
+ }
4615
4741
  var Dialog = React30.forwardRef(function Dialog2(props, ref) {
4616
4742
  const t = useStrings();
4617
4743
  const density = useDensity();
4618
4744
  const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
4745
+ const openState = useMaybeControlled(props.open, false, null), open = openState[0];
4746
+ if (props.open === void 0 && !props.trigger)
4747
+ devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
4748
+ const trigId = uid();
4749
+ function closeNow() {
4750
+ if (props.open === void 0) openState[1](false);
4751
+ if (props.onClose) props.onClose();
4752
+ }
4619
4753
  function close() {
4620
- if (props.dismissible !== false && props.onClose) props.onClose();
4754
+ if (props.dismissible === false) return;
4755
+ closeNow();
4621
4756
  }
4622
4757
  const scrimCloses = props.dismissible !== false && (props.dismissOnScrim !== void 0 ? props.dismissOnScrim : props.role !== "alertdialog");
4623
- const modal = useModal(props.open, own, {
4758
+ const modal = useModal(open, own, {
4624
4759
  autoFocus: props.autoFocus,
4625
4760
  onEscape: close,
4626
4761
  bodySelector: ".aura-dialog__body",
4627
- footSelector: ".aura-dialog__foot"
4762
+ footSelector: ".aura-dialog__foot",
4763
+ /* With a trigger, focus goes back to it even where a click doesn't focus buttons (Safari). */
4764
+ finalFocus: props.trigger ? function() {
4765
+ const ff = props.finalFocus;
4766
+ const to = ff ? typeof ff === "function" ? ff() : ff.current : null;
4767
+ return to || document.querySelector('[data-aura-trigger="' + trigId + '"]');
4768
+ } : props.finalFocus,
4769
+ onCloseComplete: props.onCloseComplete
4628
4770
  });
4629
- if (!modal.ready) return null;
4630
- return (0, import_react_dom8.createPortal)(
4771
+ const trig = props.trigger;
4772
+ const trigger = trig && React30.isValidElement(trig) ? React30.cloneElement(trig, {
4773
+ "aria-haspopup": "dialog",
4774
+ "aria-expanded": open,
4775
+ "data-aura-trigger": trigId,
4776
+ onClick: function(e) {
4777
+ const own2 = trig.props.onClick;
4778
+ if (own2) own2(e);
4779
+ if (e.defaultPrevented) return;
4780
+ if (props.open === void 0) openState[1](true);
4781
+ if (props.onOpen) props.onOpen();
4782
+ }
4783
+ }) : null;
4784
+ if (!modal.ready) return trigger;
4785
+ const rest = omit(props, [
4786
+ "open",
4787
+ "onClose",
4788
+ "title",
4789
+ "description",
4790
+ "children",
4791
+ "footer",
4792
+ "size",
4793
+ "dismissible",
4794
+ "dismissOnScrim",
4795
+ "role",
4796
+ "autoFocus",
4797
+ "className",
4798
+ "trigger",
4799
+ "onOpen",
4800
+ "finalFocus",
4801
+ "onCloseComplete",
4802
+ "aria-labelledby",
4803
+ "aria-describedby",
4804
+ "aria-modal"
4805
+ ]);
4806
+ const panel = (0, import_react_dom8.createPortal)(
4631
4807
  /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
4632
4808
  "div",
4633
4809
  {
@@ -4641,21 +4817,22 @@ var Dialog = React30.forwardRef(function Dialog2(props, ref) {
4641
4817
  ), /* @__PURE__ */ React30.createElement(
4642
4818
  "div",
4643
4819
  {
4820
+ ...rest,
4644
4821
  ref: merged,
4645
4822
  role: props.role || "dialog",
4646
4823
  "aria-modal": true,
4647
4824
  "aria-labelledby": titleId,
4648
- "aria-describedby": props.description ? descId : void 0,
4825
+ "aria-describedby": cx(props.description ? descId : "", props["aria-describedby"]) || void 0,
4649
4826
  tabIndex: -1,
4650
4827
  className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
4651
4828
  },
4652
4829
  /* @__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),
4653
4830
  props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
4654
- props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
4655
- props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
4831
+ /* @__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)
4656
4832
  )),
4657
4833
  document.body
4658
4834
  );
4835
+ return trigger ? /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, panel) : panel;
4659
4836
  });
4660
4837
  var Drawer = React30.forwardRef(function Drawer2(props, ref) {
4661
4838
  const t = useStrings();
@@ -4668,7 +4845,9 @@ var Drawer = React30.forwardRef(function Drawer2(props, ref) {
4668
4845
  autoFocus: props.autoFocus,
4669
4846
  onEscape: close,
4670
4847
  bodySelector: ".aura-drawer__body",
4671
- footSelector: ".aura-drawer__foot"
4848
+ footSelector: ".aura-drawer__foot",
4849
+ finalFocus: props.finalFocus,
4850
+ onCloseComplete: props.onCloseComplete
4672
4851
  });
4673
4852
  if (!modal.ready) return null;
4674
4853
  const side = props.side === "left" ? "left" : "right";
@@ -4689,7 +4868,9 @@ var Drawer = React30.forwardRef(function Drawer2(props, ref) {
4689
4868
  "aria-labelledby",
4690
4869
  "className",
4691
4870
  "closeLabel",
4692
- "closeProps"
4871
+ "closeProps",
4872
+ "finalFocus",
4873
+ "onCloseComplete"
4693
4874
  ]);
4694
4875
  const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
4695
4876
  return (0, import_react_dom8.createPortal)(
@@ -4785,7 +4966,9 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
4785
4966
  oneCallback ? null : props.onSortChange
4786
4967
  );
4787
4968
  const sort = sortState[0], setSort = sortState[1];
4788
- const selState = useMaybeControlled(props.selected, props.defaultSelected || [], props.onSelectionChange);
4969
+ const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
4970
+ const onSel = React31.useRef(props.onSelectionChange);
4971
+ onSel.current = props.onSelectionChange;
4789
4972
  const canSelect = function(r) {
4790
4973
  return !!r && (!props.isRowSelectable || !!props.isRowSelectable(r));
4791
4974
  };
@@ -4796,7 +4979,11 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
4796
4979
  });
4797
4980
  const selected = selState[0].filter(function(k) {
4798
4981
  return !rejected[String(k)];
4799
- }), setSelected = selState[1];
4982
+ });
4983
+ function setSelected(next, change) {
4984
+ selState[1](next);
4985
+ if (onSel.current) onSel.current(next, change || { key: null, shiftKey: false, source: "sync" });
4986
+ }
4800
4987
  const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
4801
4988
  return rejected[String(k)];
4802
4989
  }).join("\0") + "#" + selected.join("\0");
@@ -5284,11 +5471,39 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5284
5471
  return selSet[String(k)];
5285
5472
  }).length;
5286
5473
  const all = nSel > 0 && nSel === pageKeys.length;
5287
- function toggle(k, on) {
5474
+ const anchor = React31.useRef(null);
5475
+ const shiftClick = React31.useRef(false);
5476
+ function toggle(k, on, how) {
5477
+ const same2 = function(x) {
5478
+ return String(x) === String(k);
5479
+ };
5480
+ let range = null;
5481
+ if (props.rangeSelect && how.shiftKey && anchor.current != null) {
5482
+ const from = pageKeys.findIndex(function(x) {
5483
+ return String(x) === String(anchor.current);
5484
+ });
5485
+ const to = pageKeys.findIndex(same2);
5486
+ if (from >= 0 && to >= 0) range = pageKeys.slice(Math.min(from, to), Math.max(from, to) + 1);
5487
+ }
5488
+ anchor.current = k;
5489
+ const change = { key: k, shiftKey: how.shiftKey, source: how.source };
5490
+ if (range) {
5491
+ const inRange = {};
5492
+ range.forEach(function(x) {
5493
+ inRange[String(x)] = true;
5494
+ });
5495
+ const rest = selected.filter(function(x) {
5496
+ return !inRange[String(x)];
5497
+ });
5498
+ change.range = range;
5499
+ setSelected(on ? rest.concat(range) : rest, change);
5500
+ return;
5501
+ }
5288
5502
  setSelected(
5289
5503
  on ? selected.concat([k]) : selected.filter(function(x) {
5290
- return String(x) !== String(k);
5291
- })
5504
+ return !same2(x);
5505
+ }),
5506
+ change
5292
5507
  );
5293
5508
  }
5294
5509
  function toggleAll() {
@@ -5301,7 +5516,8 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5301
5516
  pageKeys.filter(function(k) {
5302
5517
  return !selSet[String(k)];
5303
5518
  })
5304
- )
5519
+ ),
5520
+ { key: null, shiftKey: false, source: "all" }
5305
5521
  );
5306
5522
  }
5307
5523
  function canResize(c) {
@@ -5480,8 +5696,8 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5480
5696
  };
5481
5697
  }).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
5482
5698
  }
5483
- function openMenu(kind, key, anchor, rc) {
5484
- setMenu({ kind, key, anchor, rc });
5699
+ function openMenu(kind, key, anchor2, rc) {
5700
+ setMenu({ kind, key, anchor: anchor2, rc });
5485
5701
  }
5486
5702
  function closeMenu(restore) {
5487
5703
  const m = menu;
@@ -5541,7 +5757,8 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5541
5757
  if (pageKeys.length) toggleAll();
5542
5758
  } else if (r === 0 && col && col.sortable && canSortAny) sortBy(col.key);
5543
5759
  else if (r > 0 && k === " " && selectable) {
5544
- if (canSelect(row) && !(stacked && noCardSel)) toggle(row[rowKey], !selSet[row[rowKey]]);
5760
+ if (canSelect(row) && !(stacked && noCardSel))
5761
+ toggle(row[rowKey], !selSet[row[rowKey]], { shiftKey: e.shiftKey, source: "keyboard" });
5545
5762
  } else if (r > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
5546
5763
  followRow(target.closest('[role="row"]'), e);
5547
5764
  else if (r > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
@@ -5731,6 +5948,9 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5731
5948
  "aria-label": canSelect(r) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r) : void 0,
5732
5949
  onFocus: function(e) {
5733
5950
  if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
5951
+ },
5952
+ onClickCapture: function(e) {
5953
+ shiftClick.current = e.shiftKey;
5734
5954
  }
5735
5955
  },
5736
5956
  canSelect(r) ? /* @__PURE__ */ React31.createElement(
@@ -5741,7 +5961,9 @@ var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
5741
5961
  tabIndex: -1,
5742
5962
  label: selLabel,
5743
5963
  onChange: function(on) {
5744
- toggle(k, on);
5964
+ const shift = shiftClick.current;
5965
+ shiftClick.current = false;
5966
+ toggle(k, on, { shiftKey: shift, source: "click" });
5745
5967
  }
5746
5968
  }
5747
5969
  ) : null
@@ -6124,7 +6346,13 @@ var Tabs = React33.forwardRef(function Tabs2(props, ref) {
6124
6346
  const Link = useLinkComponent(props.linkComponent);
6125
6347
  const manual = props.activation === "manual";
6126
6348
  const seg = props.variant === "segmented";
6127
- const listCls = cx("aura-tabs__list", seg && "aura-segmented", seg && props.fullWidth && "is-full");
6349
+ const fw = props.fullWidth;
6350
+ const listCls = cx(
6351
+ "aura-tabs__list",
6352
+ seg && "aura-segmented",
6353
+ fw === true && (seg ? "is-full" : "is-fill"),
6354
+ typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
6355
+ );
6128
6356
  const tabCls = function(on, extra) {
6129
6357
  return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
6130
6358
  };
@@ -6445,16 +6673,19 @@ var SideNav = React34.forwardRef(function SideNav2(props, ref) {
6445
6673
  return item(c, depth + 1);
6446
6674
  })));
6447
6675
  }
6448
- const on = active === it.id;
6676
+ const action = it.selectable === false;
6677
+ const on = !action && active === it.id;
6449
6678
  const common = {
6450
6679
  ...tipHandlers(it.label),
6451
- className: cx("aura-nav__item", on && "is-active"),
6680
+ className: cx("aura-nav__item", action && "aura-nav__item--action", on && "is-active"),
6452
6681
  "aria-current": on ? "page" : void 0,
6453
6682
  style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
6454
6683
  onClick: function(e) {
6455
6684
  if (!it.href) e.preventDefault();
6456
6685
  else if (!plainClick(e)) return;
6457
- st[1](it.id);
6686
+ if (!action) st[1](it.id);
6687
+ if (it.onSelect) it.onSelect();
6688
+ if (action && props.onAction) props.onAction(it.id);
6458
6689
  }
6459
6690
  };
6460
6691
  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)));
@@ -6471,6 +6702,7 @@ var SideNav = React34.forwardRef(function SideNav2(props, ref) {
6471
6702
  "aura-nav",
6472
6703
  collapsed && "aura-nav--collapsed",
6473
6704
  props.bordered === false && "aura-nav--borderless",
6705
+ props.chevron === "right" && "aura-nav--chevron-right",
6474
6706
  props.className
6475
6707
  ),
6476
6708
  "data-collapsed": collapsed ? "" : void 0,
@@ -6484,7 +6716,20 @@ var SideNav = React34.forwardRef(function SideNav2(props, ref) {
6484
6716
  })));
6485
6717
  })),
6486
6718
  props.footer ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
6487
- props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
6719
+ props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle aura-nav__toggle--row" }, /* @__PURE__ */ React34.createElement(
6720
+ "button",
6721
+ {
6722
+ type: "button",
6723
+ className: "aura-nav__item aura-nav__item--action",
6724
+ ...tipHandlers(collapsed ? t.expandNav : t.collapseNav),
6725
+ onClick: function() {
6726
+ setTip(null);
6727
+ col[1](!collapsed);
6728
+ }
6729
+ },
6730
+ /* @__PURE__ */ React34.createElement(Icon, { name: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null) }),
6731
+ /* @__PURE__ */ React34.createElement("span", { className: "aura-nav__label" }, collapsed ? t.expandNav : t.collapseNav)
6732
+ )) : props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
6488
6733
  IconButton,
6489
6734
  {
6490
6735
  icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
@@ -6517,13 +6762,83 @@ var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
6517
6762
  const t = useStrings();
6518
6763
  const Link = useLinkComponent(props.linkComponent);
6519
6764
  const items2 = props.items || [];
6520
- 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) {
6765
+ const collapsible = !!props.collapseBelow && items2.length > 2;
6766
+ const trail = items2.map(function(it) {
6767
+ return it.label + "" + (it.href || "");
6768
+ }).join("");
6769
+ const st = React35.useState(null), expanded = st[0] === trail, setExpanded = function() {
6770
+ st[1](trail);
6771
+ };
6772
+ const listRef = React35.useRef(null);
6773
+ const focusNext = React35.useRef(false);
6774
+ React35.useEffect(
6775
+ function() {
6776
+ if (!expanded || !focusNext.current) return;
6777
+ focusNext.current = false;
6778
+ const ol = listRef.current;
6779
+ if (!ol) return;
6780
+ let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
6781
+ if (!target) {
6782
+ target = ol.querySelector(".aura-crumbs__middle > *");
6783
+ if (target) target.tabIndex = -1;
6784
+ }
6785
+ if (target) target.focus();
6786
+ },
6787
+ [expanded]
6788
+ );
6789
+ const sep = /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
6790
+ const more = collapsible && !expanded ? /* @__PURE__ */ React35.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React35.createElement(
6791
+ "button",
6792
+ {
6793
+ type: "button",
6794
+ "aria-label": t.breadcrumbMore,
6795
+ onClick: function() {
6796
+ focusNext.current = true;
6797
+ setExpanded();
6798
+ }
6799
+ },
6800
+ "\u2026"
6801
+ ), sep) : null;
6802
+ const out = [];
6803
+ items2.forEach(function(it, i) {
6521
6804
  const last = i === items2.length - 1;
6522
- 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) : (
6523
- /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6524
- /* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
6525
- ), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
6526
- })));
6805
+ const lp = it.linkProps || {};
6806
+ const plain = lp;
6807
+ const own = lp.onClick;
6808
+ const click = own || it.onClick ? function(e) {
6809
+ if (own) own(e);
6810
+ if (it.onClick) it.onClick();
6811
+ } : void 0;
6812
+ out.push(
6813
+ /* @__PURE__ */ React35.createElement(
6814
+ "li",
6815
+ {
6816
+ key: i,
6817
+ ...it.itemProps,
6818
+ className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
6819
+ },
6820
+ 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) : (
6821
+ /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6822
+ /* @__PURE__ */ React35.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
6823
+ ),
6824
+ last ? null : sep
6825
+ )
6826
+ );
6827
+ if (i === 0 && more) out.push(more);
6828
+ });
6829
+ return /* @__PURE__ */ React35.createElement(
6830
+ "nav",
6831
+ {
6832
+ ref,
6833
+ "aria-label": props.label || t.breadcrumb,
6834
+ className: cx(
6835
+ "aura-crumbs",
6836
+ collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
6837
+ props.className
6838
+ )
6839
+ },
6840
+ /* @__PURE__ */ React35.createElement("ol", { ref: listRef }, out)
6841
+ );
6527
6842
  });
6528
6843
 
6529
6844
  // src/Avatar.tsx
@@ -6681,6 +6996,11 @@ var AppShell = React41.forwardRef(function AppShell2(props, ref) {
6681
6996
  onNav(id);
6682
6997
  setOpen(false);
6683
6998
  },
6999
+ /* 5.16: an action row (Sign out) closes the drawer too. */
7000
+ onAction: function(id) {
7001
+ setOpen(false);
7002
+ if (navEl.props.onAction) navEl.props.onAction(id);
7003
+ },
6684
7004
  className: cx(navEl.props.className, "is-in-drawer"),
6685
7005
  collapsed: false,
6686
7006
  collapsible: false
@@ -6844,7 +7164,8 @@ function headerLabels(children) {
6844
7164
  return out;
6845
7165
  }
6846
7166
  var Table = React44.forwardRef(function Table2(props, ref) {
6847
- const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
7167
+ const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
7168
+ const cards = !!stackBelow && stackStyle === "cards";
6848
7169
  const labels = stackBelow ? headerLabels(children) : null;
6849
7170
  if (labels && !labels.length)
6850
7171
  devWarnOnce(
@@ -6868,7 +7189,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
6868
7189
  ro.disconnect();
6869
7190
  };
6870
7191
  }, []);
6871
- return /* @__PURE__ */ React44.createElement(
7192
+ const table = /* @__PURE__ */ React44.createElement(
6872
7193
  "div",
6873
7194
  {
6874
7195
  ref: wrap,
@@ -6887,6 +7208,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
6887
7208
  "aura-tbl",
6888
7209
  stackBelow && "aura-tbl--stack-" + stackBelow,
6889
7210
  align === "middle" && "aura-tbl--middle",
7211
+ cards && "aura-tbl--cards",
6890
7212
  className
6891
7213
  ),
6892
7214
  role: stackBelow ? "table" : void 0,
@@ -6896,6 +7218,7 @@ var Table = React44.forwardRef(function Table2(props, ref) {
6896
7218
  labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
6897
7219
  )
6898
7220
  );
7221
+ return cards ? /* @__PURE__ */ React44.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
6899
7222
  });
6900
7223
  function section(tag, cls) {
6901
7224
  const C = React44.forwardRef(function TableSection(props, ref) {
@@ -7997,9 +8320,13 @@ var Badge = React52.forwardRef(function Badge2(props, ref) {
7997
8320
  // src/Progress.tsx
7998
8321
  var React53 = __toESM(require("react"), 1);
7999
8322
  var Progress = React53.forwardRef(function Progress2(props, ref) {
8323
+ const t = useStrings();
8000
8324
  const auto = uid(), id = props.id || auto;
8001
8325
  const max = props.max || 100, det = props.value != null;
8002
8326
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
8327
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
8328
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
8329
+ const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
8003
8330
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
8004
8331
  return /* @__PURE__ */ React53.createElement(
8005
8332
  "div",
@@ -8023,9 +8350,16 @@ var Progress = React53.forwardRef(function Progress2(props, ref) {
8023
8350
  "aria-valuemin": det ? 0 : void 0,
8024
8351
  "aria-valuemax": det ? max : void 0,
8025
8352
  "aria-valuenow": det ? props.value : void 0,
8026
- "aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
8353
+ "aria-valuetext": det ? valueText : void 0
8027
8354
  },
8028
- /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
8355
+ /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
8356
+ sec ? /* @__PURE__ */ React53.createElement(
8357
+ "span",
8358
+ {
8359
+ className: "aura-progress__bar aura-progress__bar--reserved",
8360
+ style: { left: pct + "%", width: spct + "%" }
8361
+ }
8362
+ ) : null
8029
8363
  ),
8030
8364
  props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
8031
8365
  );