@jirawatpyk/aura-react 5.13.0 → 5.15.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.
@@ -622,8 +622,11 @@ window.Aura = (() => {
622
622
  "interactive",
623
623
  "as",
624
624
  "className",
625
- "titleId"
625
+ "titleId",
626
+ "header",
627
+ "flushBelow"
626
628
  ]);
629
+ const head = props.header !== void 0 && props.header !== null && props.header !== false;
627
630
  return h2(
628
631
  props.as || "section",
629
632
  Object.assign({}, rest, {
@@ -632,12 +635,13 @@ window.Aura = (() => {
632
635
  "aura-card",
633
636
  creative && "aura-card--creative",
634
637
  props.interactive && "is-interactive",
638
+ props.flushBelow && "aura-card--flush-below-" + props.flushBelow,
635
639
  props.className
636
640
  ),
637
641
  /* 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"]
642
+ "aria-labelledby": !head && props.title && props.titleId ? props.titleId : props["aria-labelledby"]
639
643
  }),
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,
644
+ 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
645
  props.children ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__body" }, props.children) : null,
642
646
  props.footer ? /* @__PURE__ */ React4.createElement("div", { className: "aura-card__foot" }, props.footer) : null
643
647
  );
@@ -674,7 +678,7 @@ window.Aura = (() => {
674
678
  );
675
679
  }
676
680
  function emptyStateElement(props, ref) {
677
- const HT = "h" + (props.headingLevel || 3);
681
+ const HT = props.headingLevel === false ? "p" : "h" + (props.headingLevel || 3);
678
682
  const rest = omit(props, [
679
683
  "title",
680
684
  "description",
@@ -706,12 +710,73 @@ window.Aura = (() => {
706
710
  props.action ? /* @__PURE__ */ React4.createElement("div", { className: "aura-empty__action" }, props.action) : null
707
711
  );
708
712
  }
713
+ function statElement(props, ref, Link) {
714
+ const ch = props.change;
715
+ const dir = ch && (ch.direction || "flat");
716
+ const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
717
+ const v = props.value;
718
+ const numeric = typeof v === "number" || typeof v === "string" && /\d/.test(v) && /^[\s\d.,:+\-\u2212%()\u0E3F$\u20AC\u00A3\u00A5kKmMbB]+$/.test(v.replace(/\b[A-Z]{3}\b/g, ""));
719
+ const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
720
+ const interactive = !!(props.href || props.onClick);
721
+ if (props.headingLevel && Tag3 === "button")
722
+ devWarnOnce(
723
+ "stat-heading-button",
724
+ "Stat `headingLevel` is ignored with `onClick`: a heading can\u2019t sit in a button. Use `href`, or put the heading outside."
725
+ );
726
+ const LabelTag = props.headingLevel && Tag3 !== "button" ? "h" + props.headingLevel : "span";
727
+ const HeadTag = LabelTag === "span" ? "span" : "div";
728
+ return /* @__PURE__ */ React4.createElement(
729
+ Tag3,
730
+ {
731
+ ref,
732
+ className: cx("aura-stat", interactive && "is-interactive", props.loading && "is-loading", props.className),
733
+ href: props.href,
734
+ onClick: props.onClick,
735
+ type: Tag3 === "button" ? "button" : void 0,
736
+ "aria-busy": props.loading || void 0
737
+ },
738
+ /* @__PURE__ */ React4.createElement(HeadTag, { className: "aura-stat__head" }, /* @__PURE__ */ React4.createElement(LabelTag, { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React4.createElement(Icon, { name: props.icon })) : null),
739
+ props.loading ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React4.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React4.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
740
+ ch && !props.loading || props.caption ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React4.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React4.createElement(
741
+ Icon,
742
+ {
743
+ name: dir === "up" ? /* @__PURE__ */ React4.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React4.createElement(IconTrendingDown, null) : /* @__PURE__ */ React4.createElement(IconMinus, null),
744
+ size: 14
745
+ }
746
+ ), /* @__PURE__ */ React4.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React4.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
747
+ );
748
+ }
749
+ var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
750
+ function initials(name) {
751
+ const parts = String(name || "?").trim().split(/\s+/);
752
+ return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
753
+ }
754
+ function avatarElement(props, ref, broken, onError) {
755
+ const size = props.size || "md";
756
+ let hash = 0;
757
+ String(props.name || "").split("").forEach(function(ch) {
758
+ hash = hash * 31 + ch.charCodeAt(0) >>> 0;
759
+ });
760
+ const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
761
+ return /* @__PURE__ */ React4.createElement(
762
+ "span",
763
+ {
764
+ ref,
765
+ className: cx("aura-avatar", "aura-avatar--" + size, "aura-avatar--" + tone2, props.className),
766
+ role: "img",
767
+ "aria-label": props.name + (props.status ? ", " + props.status : "")
768
+ },
769
+ props.src && broken !== props.src ? /* @__PURE__ */ React4.createElement("img", { key: props.src, src: props.src, alt: "", onError }) : /* @__PURE__ */ React4.createElement("span", { "aria-hidden": true }, initials(props.name)),
770
+ props.status === "online" ? /* @__PURE__ */ React4.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
771
+ );
772
+ }
709
773
  function buttonClass(opts = {}) {
710
774
  return cx(
711
775
  "aura-btn",
712
776
  "aura-btn--" + (opts.variant || "primary"),
713
777
  opts.size === "sm" && "aura-btn--sm",
714
778
  opts.fullWidth && "aura-btn--full",
779
+ opts.touchHeight && "aura-btn--touch",
715
780
  opts.loading && "is-loading",
716
781
  opts.className
717
782
  );
@@ -841,6 +906,10 @@ window.Aura = (() => {
841
906
  pageN: function(p) {
842
907
  return "\u0E2B\u0E19\u0E49\u0E32 " + p;
843
908
  },
909
+ progressReserved: function(v, r, max) {
910
+ return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r);
911
+ },
912
+ breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
844
913
  accepts: function(list, max) {
845
914
  return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
846
915
  }
@@ -967,6 +1036,10 @@ window.Aura = (() => {
967
1036
  pageN: function(p) {
968
1037
  return "Sida " + p;
969
1038
  },
1039
+ progressReserved: function(v, r, max) {
1040
+ return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r) + " reserverade";
1041
+ },
1042
+ breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
970
1043
  accepts: function(list, max) {
971
1044
  return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
972
1045
  }
@@ -1094,6 +1167,10 @@ window.Aura = (() => {
1094
1167
  pageN: function(p) {
1095
1168
  return "Page " + p;
1096
1169
  },
1170
+ progressReserved: function(v, r, max) {
1171
+ return n2(v) + " of " + n2(max) + " used, " + n2(r) + " reserved";
1172
+ },
1173
+ breadcrumbMore: "Show the full path",
1097
1174
  accepts: function(list, max) {
1098
1175
  return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
1099
1176
  }
@@ -1160,7 +1237,8 @@ window.Aura = (() => {
1160
1237
  "linkComponent",
1161
1238
  "href",
1162
1239
  "fullWidth",
1163
- "size"
1240
+ "size",
1241
+ "touchHeight"
1164
1242
  ]);
1165
1243
  const Tag3 = disabled ? "a" : Link;
1166
1244
  return /* @__PURE__ */ React6.createElement(
@@ -1176,6 +1254,7 @@ window.Aura = (() => {
1176
1254
  variant,
1177
1255
  size: props.size,
1178
1256
  fullWidth: props.fullWidth,
1257
+ touchHeight: props.touchHeight,
1179
1258
  className: props.className
1180
1259
  }),
1181
1260
  onClick: disabled ? void 0 : props.onClick
@@ -1194,6 +1273,8 @@ window.Aura = (() => {
1194
1273
  const props = all;
1195
1274
  const variant = props.variant || "primary";
1196
1275
  const loading = !!props.loading;
1276
+ const ad = props["aria-disabled"];
1277
+ const blocked = loading || ad === true || ad === "true";
1197
1278
  const rest = omit(props, [
1198
1279
  "variant",
1199
1280
  "className",
@@ -1204,7 +1285,8 @@ window.Aura = (() => {
1204
1285
  "loading",
1205
1286
  "onClick",
1206
1287
  "fullWidth",
1207
- "size"
1288
+ "size",
1289
+ "touchHeight"
1208
1290
  ]);
1209
1291
  return /* @__PURE__ */ React6.createElement(
1210
1292
  "button",
@@ -1216,12 +1298,13 @@ window.Aura = (() => {
1216
1298
  variant,
1217
1299
  size: props.size,
1218
1300
  fullWidth: props.fullWidth,
1301
+ touchHeight: props.touchHeight,
1219
1302
  loading,
1220
1303
  className: props.className
1221
1304
  }),
1222
1305
  "aria-busy": loading || void 0,
1223
- "aria-disabled": loading || void 0,
1224
- onClick: loading ? function(e) {
1306
+ "aria-disabled": blocked || void 0,
1307
+ onClick: blocked ? function(e) {
1225
1308
  e.preventDefault();
1226
1309
  } : props.onClick
1227
1310
  },
@@ -1235,7 +1318,7 @@ window.Aura = (() => {
1235
1318
  // src/IconButton.tsx
1236
1319
  var React7 = __toESM(require_react(), 1);
1237
1320
  var IconButton = React7.forwardRef(function IconButton2(props, ref) {
1238
- const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
1321
+ const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
1239
1322
  return /* @__PURE__ */ React7.createElement(
1240
1323
  "button",
1241
1324
  {
@@ -1244,7 +1327,12 @@ window.Aura = (() => {
1244
1327
  type: props.type || "button",
1245
1328
  "aria-label": props.label,
1246
1329
  title: props.label,
1247
- className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
1330
+ className: cx(
1331
+ "aura-icon-btn",
1332
+ props.tone === "danger" && "aura-icon-btn--danger",
1333
+ props.touchHeight && "aura-icon-btn--touch",
1334
+ props.className
1335
+ )
1248
1336
  },
1249
1337
  /* @__PURE__ */ React7.createElement(Icon, { name: props.icon, size: props.size || "sm" })
1250
1338
  );
@@ -1516,7 +1604,8 @@ window.Aura = (() => {
1516
1604
  "description",
1517
1605
  "className",
1518
1606
  "tabIndex",
1519
- "disabled"
1607
+ "disabled",
1608
+ "hitArea"
1520
1609
  ]);
1521
1610
  const text2 = props.children;
1522
1611
  const labelled = text2 != null && text2 !== "";
@@ -1526,10 +1615,19 @@ window.Aura = (() => {
1526
1615
  "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`."
1527
1616
  );
1528
1617
  const descId = props.description ? (props.id || auto) + "-desc" : void 0;
1618
+ const ha = props.hitArea;
1619
+ const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
1529
1620
  return /* @__PURE__ */ React10.createElement(
1530
1621
  "label",
1531
1622
  {
1532
- className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
1623
+ className: cx(
1624
+ "aura-check",
1625
+ labelled && "aura-check--labelled",
1626
+ hit && "has-hit",
1627
+ props.disabled && "is-disabled",
1628
+ props.className
1629
+ ),
1630
+ style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
1533
1631
  onClick: function(e) {
1534
1632
  e.stopPropagation();
1535
1633
  }
@@ -4078,7 +4176,13 @@ window.Aura = (() => {
4078
4176
  ref,
4079
4177
  role: "region",
4080
4178
  "aria-label": props.label || t.filters,
4081
- className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
4179
+ className: cx(
4180
+ "aura-filterbar",
4181
+ props.searchGrow && "aura-filterbar--grow",
4182
+ props.controlsLayout === "fill" && "aura-filterbar--fill",
4183
+ props.stackBelow === "lg" && "aura-filterbar--stack-lg",
4184
+ props.className
4185
+ )
4082
4186
  },
4083
4187
  /* @__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(
4084
4188
  "input",
@@ -6080,7 +6184,13 @@ window.Aura = (() => {
6080
6184
  const Link = useLinkComponent(props.linkComponent);
6081
6185
  const manual = props.activation === "manual";
6082
6186
  const seg = props.variant === "segmented";
6083
- const listCls = cx("aura-tabs__list", seg && "aura-segmented", seg && props.fullWidth && "is-full");
6187
+ const fw = props.fullWidth;
6188
+ const listCls = cx(
6189
+ "aura-tabs__list",
6190
+ seg && "aura-segmented",
6191
+ fw === true && (seg ? "is-full" : "is-fill"),
6192
+ typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
6193
+ );
6084
6194
  const tabCls = function(on, extra) {
6085
6195
  return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
6086
6196
  };
@@ -6137,7 +6247,7 @@ window.Aura = (() => {
6137
6247
  key: t.id,
6138
6248
  href: t.href,
6139
6249
  className: tabCls(on, own.className),
6140
- "aria-current": on ? "page" : void 0,
6250
+ "aria-current": on ? props.current || "page" : void 0,
6141
6251
  onClick: function(e) {
6142
6252
  if (own.onClick) own.onClick(e);
6143
6253
  if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
@@ -6473,50 +6583,92 @@ window.Aura = (() => {
6473
6583
  const t = useStrings();
6474
6584
  const Link = useLinkComponent(props.linkComponent);
6475
6585
  const items2 = props.items || [];
6476
- 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) {
6586
+ const collapsible = !!props.collapseBelow && items2.length > 2;
6587
+ const trail = items2.map(function(it) {
6588
+ return it.label + "" + (it.href || "");
6589
+ }).join("");
6590
+ const st = React35.useState(null), expanded = st[0] === trail, setExpanded = function() {
6591
+ st[1](trail);
6592
+ };
6593
+ const listRef = React35.useRef(null);
6594
+ const focusNext = React35.useRef(false);
6595
+ React35.useEffect(
6596
+ function() {
6597
+ if (!expanded || !focusNext.current) return;
6598
+ focusNext.current = false;
6599
+ const ol = listRef.current;
6600
+ if (!ol) return;
6601
+ let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
6602
+ if (!target) {
6603
+ target = ol.querySelector(".aura-crumbs__middle > *");
6604
+ if (target) target.tabIndex = -1;
6605
+ }
6606
+ if (target) target.focus();
6607
+ },
6608
+ [expanded]
6609
+ );
6610
+ const sep = /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
6611
+ const more = collapsible && !expanded ? /* @__PURE__ */ React35.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React35.createElement(
6612
+ "button",
6613
+ {
6614
+ type: "button",
6615
+ "aria-label": t.breadcrumbMore,
6616
+ onClick: function() {
6617
+ focusNext.current = true;
6618
+ setExpanded();
6619
+ }
6620
+ },
6621
+ "\u2026"
6622
+ ), sep) : null;
6623
+ const out = [];
6624
+ items2.forEach(function(it, i) {
6477
6625
  const last = i === items2.length - 1;
6478
- 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) : (
6479
- /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6480
- /* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
6481
- ), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
6482
- })));
6626
+ const lp = it.linkProps || {};
6627
+ const plain = lp;
6628
+ const own = lp.onClick;
6629
+ const click = own || it.onClick ? function(e) {
6630
+ if (own) own(e);
6631
+ if (it.onClick) it.onClick();
6632
+ } : void 0;
6633
+ out.push(
6634
+ /* @__PURE__ */ React35.createElement(
6635
+ "li",
6636
+ {
6637
+ key: i,
6638
+ ...it.itemProps,
6639
+ className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
6640
+ },
6641
+ 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) : (
6642
+ /* 5.7: a segment with no page and no action is text, not a button that does nothing. */
6643
+ /* @__PURE__ */ React35.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
6644
+ ),
6645
+ last ? null : sep
6646
+ )
6647
+ );
6648
+ if (i === 0 && more) out.push(more);
6649
+ });
6650
+ return /* @__PURE__ */ React35.createElement(
6651
+ "nav",
6652
+ {
6653
+ ref,
6654
+ "aria-label": props.label || t.breadcrumb,
6655
+ className: cx(
6656
+ "aura-crumbs",
6657
+ collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
6658
+ props.className
6659
+ )
6660
+ },
6661
+ /* @__PURE__ */ React35.createElement("ol", { ref: listRef }, out)
6662
+ );
6483
6663
  });
6484
6664
 
6485
6665
  // src/Avatar.tsx
6486
6666
  var React36 = __toESM(require_react(), 1);
6487
- var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
6488
- function initials(name) {
6489
- const parts = String(name || "?").trim().split(/\s+/);
6490
- return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
6491
- }
6492
6667
  var Avatar = React36.forwardRef(function Avatar2(props, ref) {
6493
- const size = props.size || "md", errState = React36.useState(null);
6494
- let hash = 0;
6495
- String(props.name || "").split("").forEach(function(ch) {
6496
- hash = hash * 31 + ch.charCodeAt(0) >>> 0;
6668
+ const errState = React36.useState(null);
6669
+ return avatarElement(props, ref, errState[0], function() {
6670
+ errState[1](props.src || null);
6497
6671
  });
6498
- const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
6499
- return /* @__PURE__ */ React36.createElement(
6500
- "span",
6501
- {
6502
- ref,
6503
- className: cx("aura-avatar", "aura-avatar--" + size, "aura-avatar--" + tone2, props.className),
6504
- role: "img",
6505
- "aria-label": props.name + (props.status ? ", " + props.status : "")
6506
- },
6507
- props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
6508
- "img",
6509
- {
6510
- key: props.src,
6511
- src: props.src,
6512
- alt: "",
6513
- onError: function() {
6514
- errState[1](props.src || null);
6515
- }
6516
- }
6517
- ) : /* @__PURE__ */ React36.createElement("span", { "aria-hidden": true }, initials(props.name)),
6518
- props.status === "online" ? /* @__PURE__ */ React36.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
6519
- );
6520
6672
  });
6521
6673
 
6522
6674
  // src/Stack.tsx
@@ -6637,6 +6789,27 @@ window.Aura = (() => {
6637
6789
  if (shared) navState[1](id);
6638
6790
  if (navEl && navEl.props.onChange) navEl.props.onChange(id);
6639
6791
  }
6792
+ const rootRef = React41.useRef(null);
6793
+ const barRef = React41.useRef(null);
6794
+ const mergedRef = useMergedRef(ref, rootRef);
6795
+ const hasBar = !!(props.header || props.nav);
6796
+ useIsoLayoutEffect(
6797
+ function() {
6798
+ const root = rootRef.current, bar = barRef.current;
6799
+ if (!root || !bar) return;
6800
+ function sync() {
6801
+ root.style.setProperty("--aura-shell-bar-height", bar.getBoundingClientRect().height + "px");
6802
+ }
6803
+ sync();
6804
+ const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
6805
+ if (ro) ro.observe(bar);
6806
+ return function() {
6807
+ if (ro) ro.disconnect();
6808
+ root.style.removeProperty("--aura-shell-bar-height");
6809
+ };
6810
+ },
6811
+ [hasBar]
6812
+ );
6640
6813
  const deskNav = navEl && shared ? React41.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
6641
6814
  const drawerNav = navEl ? React41.cloneElement(navEl, {
6642
6815
  value: shared ? navState[0] : navEl.props.value,
@@ -6648,32 +6821,56 @@ window.Aura = (() => {
6648
6821
  collapsed: false,
6649
6822
  collapsible: false
6650
6823
  }) : props.nav;
6651
- return /* @__PURE__ */ React41.createElement("div", { ref, className: cx("aura-shell", props.bottomNav && "aura-shell--bottomnav", props.className) }, props.nav ? /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__nav" }, deskNav) : null, props.nav ? /* @__PURE__ */ React41.createElement(
6652
- Drawer,
6824
+ return /* @__PURE__ */ React41.createElement(
6825
+ "div",
6653
6826
  {
6654
- open,
6655
- onClose: function() {
6656
- setOpen(false);
6657
- },
6658
- side: "left",
6659
- size: "nav",
6660
- "aria-label": props.navLabel || t.navigation,
6661
- dismissible: true
6827
+ ref: mergedRef,
6828
+ className: cx(
6829
+ "aura-shell",
6830
+ props.bottomNav && "aura-shell--bottomnav",
6831
+ /* 5.14: no top bar at all, or one that only holds the menu button (gone from lg up): the bar-height token is 0. */
6832
+ !props.header && !props.nav && "aura-shell--no-bar",
6833
+ !props.header && props.nav && "aura-shell--menu-bar",
6834
+ props.className
6835
+ )
6662
6836
  },
6663
- drawerNav
6664
- ) : null, /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React41.createElement("header", { className: cx("aura-shell__bar", !props.header && "aura-shell__bar--menu-only") }, props.nav ? /* @__PURE__ */ React41.createElement(
6665
- IconButton,
6666
- {
6667
- className: "aura-shell__menu",
6668
- icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
6669
- label: props.menuLabel || t.openNav,
6670
- size: "md",
6671
- onClick: function() {
6672
- setOpen(true);
6837
+ props.nav ? /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
6838
+ props.nav ? /* @__PURE__ */ React41.createElement(
6839
+ Drawer,
6840
+ {
6841
+ open,
6842
+ onClose: function() {
6843
+ setOpen(false);
6844
+ },
6845
+ side: "left",
6846
+ size: "nav",
6847
+ "aria-label": props.navLabel || t.navigation,
6848
+ dismissible: true
6673
6849
  },
6674
- "aria-expanded": open
6675
- }
6676
- ) : null, /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React41.createElement("main", { className: "aura-shell__content", id: props.mainId || "main", tabIndex: -1 }, props.children), props.bottomNav || null));
6850
+ drawerNav
6851
+ ) : null,
6852
+ /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React41.createElement("header", { ref: barRef, className: cx("aura-shell__bar", !props.header && "aura-shell__bar--menu-only") }, props.nav ? /* @__PURE__ */ React41.createElement(
6853
+ IconButton,
6854
+ {
6855
+ className: "aura-shell__menu",
6856
+ icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
6857
+ label: props.menuLabel || t.openNav,
6858
+ size: "md",
6859
+ onClick: function() {
6860
+ setOpen(true);
6861
+ },
6862
+ "aria-expanded": open
6863
+ }
6864
+ ) : null, /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React41.createElement(
6865
+ "main",
6866
+ {
6867
+ className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
6868
+ id: props.mainId || "main",
6869
+ tabIndex: -1
6870
+ },
6871
+ props.children
6872
+ ), props.bottomNav || null)
6873
+ );
6677
6874
  });
6678
6875
 
6679
6876
  // src/ActionBar.tsx
@@ -6783,7 +6980,8 @@ window.Aura = (() => {
6783
6980
  return out;
6784
6981
  }
6785
6982
  var Table = React44.forwardRef(function Table2(props, ref) {
6786
- const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
6983
+ const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
6984
+ const cards = !!stackBelow && stackStyle === "cards";
6787
6985
  const labels = stackBelow ? headerLabels(children) : null;
6788
6986
  if (labels && !labels.length)
6789
6987
  devWarnOnce(
@@ -6807,7 +7005,7 @@ window.Aura = (() => {
6807
7005
  ro.disconnect();
6808
7006
  };
6809
7007
  }, []);
6810
- return /* @__PURE__ */ React44.createElement(
7008
+ const table = /* @__PURE__ */ React44.createElement(
6811
7009
  "div",
6812
7010
  {
6813
7011
  ref: wrap,
@@ -6826,6 +7024,7 @@ window.Aura = (() => {
6826
7024
  "aura-tbl",
6827
7025
  stackBelow && "aura-tbl--stack-" + stackBelow,
6828
7026
  align === "middle" && "aura-tbl--middle",
7027
+ cards && "aura-tbl--cards",
6829
7028
  className
6830
7029
  ),
6831
7030
  role: stackBelow ? "table" : void 0,
@@ -6835,6 +7034,7 @@ window.Aura = (() => {
6835
7034
  labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
6836
7035
  )
6837
7036
  );
7037
+ return cards ? /* @__PURE__ */ React44.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
6838
7038
  });
6839
7039
  function section(tag, cls) {
6840
7040
  const C = React44.forwardRef(function TableSection(props, ref) {
@@ -6977,34 +7177,8 @@ window.Aura = (() => {
6977
7177
  // src/Stat.tsx
6978
7178
  var React47 = __toESM(require_react(), 1);
6979
7179
  var Stat = React47.forwardRef(function Stat2(props, ref) {
6980
- const ch = props.change;
6981
- const dir = ch && (ch.direction || "flat");
6982
- const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
6983
7180
  const Link = useLinkComponent(props.linkComponent);
6984
- const v = props.value;
6985
- const numeric = typeof v === "number" || typeof v === "string" && /\d/.test(v) && /^[\s\d.,:+\-\u2212%()\u0E3F$\u20AC\u00A3\u00A5kKmMbB]+$/.test(v.replace(/\b[A-Z]{3}\b/g, ""));
6986
- const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
6987
- const interactive = !!(props.href || props.onClick);
6988
- return /* @__PURE__ */ React47.createElement(
6989
- Tag3,
6990
- {
6991
- ref,
6992
- className: cx("aura-stat", interactive && "is-interactive", props.loading && "is-loading", props.className),
6993
- href: props.href,
6994
- onClick: props.onClick,
6995
- type: Tag3 === "button" ? "button" : void 0,
6996
- "aria-busy": props.loading || void 0
6997
- },
6998
- /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React47.createElement(Icon, { name: props.icon })) : null),
6999
- props.loading ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React47.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React47.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
7000
- ch && !props.loading || props.caption ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React47.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React47.createElement(
7001
- Icon,
7002
- {
7003
- name: dir === "up" ? /* @__PURE__ */ React47.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React47.createElement(IconTrendingDown, null) : /* @__PURE__ */ React47.createElement(IconMinus, null),
7004
- size: 14
7005
- }
7006
- ), /* @__PURE__ */ React47.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
7007
- );
7181
+ return statElement(props, ref, Link);
7008
7182
  });
7009
7183
 
7010
7184
  // src/TimePicker.tsx
@@ -7962,9 +8136,13 @@ window.Aura = (() => {
7962
8136
  // src/Progress.tsx
7963
8137
  var React53 = __toESM(require_react(), 1);
7964
8138
  var Progress = React53.forwardRef(function Progress2(props, ref) {
8139
+ const t = useStrings();
7965
8140
  const auto = uid(), id = props.id || auto;
7966
8141
  const max = props.max || 100, det = props.value != null;
7967
8142
  const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
8143
+ const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
8144
+ const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
8145
+ const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
7968
8146
  const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
7969
8147
  return /* @__PURE__ */ React53.createElement(
7970
8148
  "div",
@@ -7988,9 +8166,16 @@ window.Aura = (() => {
7988
8166
  "aria-valuemin": det ? 0 : void 0,
7989
8167
  "aria-valuemax": det ? max : void 0,
7990
8168
  "aria-valuenow": det ? props.value : void 0,
7991
- "aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
8169
+ "aria-valuetext": det ? valueText : void 0
7992
8170
  },
7993
- /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
8171
+ /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
8172
+ sec ? /* @__PURE__ */ React53.createElement(
8173
+ "span",
8174
+ {
8175
+ className: "aura-progress__bar aura-progress__bar--reserved",
8176
+ style: { left: pct + "%", width: spct + "%" }
8177
+ }
8178
+ ) : null
7994
8179
  ),
7995
8180
  props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
7996
8181
  );