gridsmith-ui 0.17.2 → 0.17.3

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.
package/dist/index.js CHANGED
@@ -2325,18 +2325,21 @@ function Field({ label, children, hint, error, required, labelAction, id: idProp
2325
2325
  const { error: errorFlag, ...ariaOnly } = controlProps;
2326
2326
  control = cloneElement(child, isNative ? ariaOnly : { ...ariaOnly, ...errorFlag ? { error: true } : {} });
2327
2327
  }
2328
- return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-ds-1.5", className), children: [
2329
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-ds-2", children: [
2330
- /* @__PURE__ */ jsxs(Label, { id: labelId, htmlFor: id, children: [
2331
- label,
2332
- required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-ds-0.5 text-[var(--ds-status-error)]", children: "*" })
2328
+ return (
2329
+ // In a settings panel a field keeps the narrow reading width however wide the page is (--ds-form-max, Sprint 25.9 A4)
2330
+ /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-ds-1.5 max-w-[var(--ds-form-max,none)]", className), children: [
2331
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-ds-2", children: [
2332
+ /* @__PURE__ */ jsxs(Label, { id: labelId, htmlFor: id, children: [
2333
+ label,
2334
+ required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-ds-0.5 text-[var(--ds-status-error)]", children: "*" })
2335
+ ] }),
2336
+ labelAction
2333
2337
  ] }),
2334
- labelAction
2335
- ] }),
2336
- /* @__PURE__ */ jsx(FieldContext.Provider, { value: fieldContext, children: control }),
2337
- hint && /* @__PURE__ */ jsx("p", { id: hintId, className: "text-xs text-[var(--ds-text-muted)]", children: hint }),
2338
- hasError && /* @__PURE__ */ jsx(InlineFieldError, { id: errorId, message: error, className: "mt-0" })
2339
- ] });
2338
+ /* @__PURE__ */ jsx(FieldContext.Provider, { value: fieldContext, children: control }),
2339
+ hint && /* @__PURE__ */ jsx("p", { id: hintId, className: "text-xs text-[var(--ds-text-muted)]", children: hint }),
2340
+ hasError && /* @__PURE__ */ jsx(InlineFieldError, { id: errorId, message: error, className: "mt-0" })
2341
+ ] })
2342
+ );
2340
2343
  }
2341
2344
  function TruncFileName({ children, className }) {
2342
2345
  const { ref, isTruncated } = useTextOverflow({ lines: 1 });
@@ -2506,7 +2509,8 @@ function SliderRange({
2506
2509
  label,
2507
2510
  "aria-label": ariaLabel,
2508
2511
  "aria-describedby": describedByProp,
2509
- trackStyle
2512
+ trackStyle,
2513
+ formatValue
2510
2514
  }) {
2511
2515
  const field = useField();
2512
2516
  const ownId = useId();
@@ -2519,6 +2523,8 @@ function SliderRange({
2519
2523
  const high = isRange ? value[1] : value;
2520
2524
  const trackRef = useRef(null);
2521
2525
  const pct = (v) => (v - min) / (max - min) * 100;
2526
+ const shown = (v) => formatValue ? formatValue(v) : v;
2527
+ const valueText = (v) => formatValue ? formatValue(v) : void 0;
2522
2528
  const handleChange = useCallback(
2523
2529
  (which, raw) => {
2524
2530
  const v = Math.round(raw / step) * step;
@@ -2571,7 +2577,7 @@ function SliderRange({
2571
2577
  return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-ds-1", disabled && "opacity-disabled", className), children: [
2572
2578
  (showLabel || showValue) && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-ds-2", showLabel ? "justify-between" : "justify-end"), children: [
2573
2579
  showLabel && /* @__PURE__ */ jsx("span", { id: `${ownId}-label`, className: "text-sm font-medium leading-none text-[var(--ds-text-secondary)]", children: label }),
2574
- showValue && /* @__PURE__ */ jsx("span", { className: "text-xs font-mono tabular-nums text-[var(--ds-text-muted)]", children: isRange ? `${low} \u2013 ${high}` : low })
2580
+ showValue && /* @__PURE__ */ jsx("span", { className: "text-xs font-mono tabular-nums text-[var(--ds-text-muted)]", children: isRange ? `${shown(low)} \u2013 ${shown(high)}` : shown(low) })
2575
2581
  ] }),
2576
2582
  isRange && nameId && /* @__PURE__ */ jsxs(Fragment, { children: [
2577
2583
  /* @__PURE__ */ jsx("span", { id: `${ownId}-minimum`, hidden: true, children: "minimum" }),
@@ -2604,6 +2610,7 @@ function SliderRange({
2604
2610
  "aria-valuemin": min,
2605
2611
  "aria-valuemax": high,
2606
2612
  "aria-valuenow": low,
2613
+ "aria-valuetext": valueText(low),
2607
2614
  "aria-invalid": error || void 0,
2608
2615
  onKeyDown: handleKeyDown("low"),
2609
2616
  onPointerDown: handlePointerDown("low"),
@@ -2629,6 +2636,7 @@ function SliderRange({
2629
2636
  "aria-valuemin": isRange ? low : min,
2630
2637
  "aria-valuemax": max,
2631
2638
  "aria-valuenow": high,
2639
+ "aria-valuetext": valueText(high),
2632
2640
  "aria-invalid": error || void 0,
2633
2641
  onKeyDown: handleKeyDown("high"),
2634
2642
  onPointerDown: handlePointerDown("high"),
@@ -4302,7 +4310,7 @@ function FormWrapper({ onSubmit, validationMode: validationModeProp, children, a
4302
4310
  f.message
4303
4311
  ] }, f.id || f.label)) }) }) : null;
4304
4312
  const actionsNode = actions && !drawerFooter ? /* @__PURE__ */ jsx("div", { "data-form-actions": "", className: cn("flex flex-wrap items-center gap-ds-2 pt-ds-2", actionsAlign === "end" ? "justify-end" : "justify-start"), children: actions }) : null;
4305
- return /* @__PURE__ */ jsx(FormCtx.Provider, { value: { errors, setError, clearErrors, validationMode, submitted }, children: /* @__PURE__ */ jsxs("form", { ref: setRefs, id: drawerFooter ? formId : void 0, onSubmit: handleSubmit, onFocusCapture: userActed, onInputCapture: userActed, className: cn("flex flex-col gap-ds-5", className), noValidate: true, children: [
4313
+ return /* @__PURE__ */ jsx(FormCtx.Provider, { value: { errors, setError, clearErrors, validationMode, submitted }, children: /* @__PURE__ */ jsxs("form", { ref: setRefs, id: drawerFooter ? formId : void 0, onSubmit: handleSubmit, onFocusCapture: userActed, onInputCapture: userActed, className: cn("flex flex-col gap-ds-5 max-w-[var(--ds-form-max,none)]", className), noValidate: true, children: [
4306
4314
  summaryNode && /* @__PURE__ */ jsx("div", { "data-form-error-summary": "", children: summaryNode }),
4307
4315
  children,
4308
4316
  actionsNode
@@ -5381,11 +5389,27 @@ var columnClasses = {
5381
5389
  3: "grid-cols-3",
5382
5390
  4: "grid-cols-4"
5383
5391
  };
5392
+ var autoColumnClasses = {
5393
+ horizontal: {
5394
+ 2: "grid-cols-[repeat(auto-fill,minmax(max(min(20rem,100%),calc((100%_-_var(--ds-space-8))/2)),1fr))]",
5395
+ 3: "grid-cols-[repeat(auto-fill,minmax(max(min(20rem,100%),calc((100%_-_2*var(--ds-space-8))/3)),1fr))]",
5396
+ 4: "grid-cols-[repeat(auto-fill,minmax(max(min(20rem,100%),calc((100%_-_3*var(--ds-space-8))/4)),1fr))]"
5397
+ },
5398
+ vertical: {
5399
+ 2: "grid-cols-[repeat(auto-fill,minmax(max(min(8rem,100%),calc((100%_-_var(--ds-space-6))/2)),1fr))]",
5400
+ 3: "grid-cols-[repeat(auto-fill,minmax(max(min(8rem,100%),calc((100%_-_2*var(--ds-space-6))/3)),1fr))]",
5401
+ 4: "grid-cols-[repeat(auto-fill,minmax(max(min(8rem,100%),calc((100%_-_3*var(--ds-space-6))/4)),1fr))]"
5402
+ }
5403
+ };
5384
5404
  var spanClasses = {
5385
5405
  2: "col-span-2",
5386
5406
  3: "col-span-3",
5387
5407
  4: "col-span-4"
5388
5408
  };
5409
+ function spanClass(span, columns) {
5410
+ if (!span || span <= 1) return void 0;
5411
+ return span >= columns ? "col-span-full" : spanClasses[span];
5412
+ }
5389
5413
  var stackBreakpoints = {
5390
5414
  sm: "max-sm:grid-cols-1",
5391
5415
  md: "max-md:grid-cols-1",
@@ -5402,6 +5426,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5402
5426
  }, ref) {
5403
5427
  const s = sizeStyles3[size];
5404
5428
  const stackBelow = stackBelowProp ?? (columns > 1 ? "sm" : void 0);
5429
+ const templateClass = (layout) => columns > 1 && stackBelow !== "none" ? autoColumnClasses[layout][columns] : columnClasses[columns];
5405
5430
  if (orientation === "vertical") {
5406
5431
  return /* @__PURE__ */ jsx(
5407
5432
  "dl",
@@ -5409,7 +5434,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5409
5434
  ref,
5410
5435
  className: cn(
5411
5436
  "grid",
5412
- columnClasses[columns],
5437
+ templateClass("vertical"),
5413
5438
  "gap-x-ds-6 gap-y-ds-1",
5414
5439
  stackBelow && stackBelow !== "none" && stackBreakpoints[stackBelow],
5415
5440
  dividers && "divide-y-[length:var(--ds-border-width)] divide-[var(--ds-border-subtle)]",
@@ -5420,7 +5445,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5420
5445
  {
5421
5446
  className: cn(
5422
5447
  s.py,
5423
- item.span && item.span > 1 && spanClasses[item.span]
5448
+ spanClass(item.span, columns)
5424
5449
  ),
5425
5450
  children: [
5426
5451
  /* @__PURE__ */ jsxs(
@@ -5451,7 +5476,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5451
5476
  ref,
5452
5477
  className: cn(
5453
5478
  "grid",
5454
- columnClasses[columns],
5479
+ templateClass("horizontal"),
5455
5480
  "gap-x-ds-8",
5456
5481
  stackBelow && stackBelow !== "none" && stackBreakpoints[stackBelow],
5457
5482
  dividers && "divide-y-[length:var(--ds-border-width)] divide-[var(--ds-border-subtle)]",
@@ -5464,7 +5489,7 @@ var DescriptionList = forwardRef(function DescriptionList2({
5464
5489
  "flex items-start justify-between",
5465
5490
  s.py,
5466
5491
  s.gap,
5467
- item.span && item.span > 1 && spanClasses[item.span]
5492
+ spanClass(item.span, columns)
5468
5493
  ),
5469
5494
  children: [
5470
5495
  /* @__PURE__ */ jsxs(
@@ -5581,6 +5606,22 @@ function TruncCell({ children, lines }) {
5581
5606
  if (!isTruncated) return cell;
5582
5607
  return /* @__PURE__ */ jsx(Tooltip, { content: children, children: cell });
5583
5608
  }
5609
+ var TITLE_CLASSES = "font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] break-words";
5610
+ var FRAME_CLASSES = cn(
5611
+ "border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
5612
+ "rounded-[var(--ds-radius-md)]",
5613
+ GLASS_SURFACE,
5614
+ "bg-[var(--ds-bg-surface)]"
5615
+ );
5616
+ function TableHeading({ title, description, actions, titleId, descriptionId, inset }) {
5617
+ return /* @__PURE__ */ jsxs("div", { "data-table-heading": "", className: cn("flex flex-wrap items-start justify-between gap-ds-4", inset ? "px-ds-5 py-ds-4" : "pb-ds-4"), children: [
5618
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-ds-1.5 grow basis-1/2 [min-width:min-content] break-words", children: [
5619
+ /* @__PURE__ */ jsx("h3", { id: titleId, className: TITLE_CLASSES, children: title }),
5620
+ description && /* @__PURE__ */ jsx("p", { id: descriptionId, className: "text-sm text-[var(--ds-text-muted)]", children: description })
5621
+ ] }),
5622
+ actions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-ds-2 shrink-0 ml-auto", children: actions })
5623
+ ] });
5624
+ }
5584
5625
  function Table({
5585
5626
  columns,
5586
5627
  data,
@@ -5601,8 +5642,14 @@ function Table({
5601
5642
  emptyState,
5602
5643
  onRowClick,
5603
5644
  mobileBreakpoint: mobileBreakpointProp,
5645
+ title,
5646
+ description,
5647
+ actions,
5604
5648
  ref
5605
5649
  }) {
5650
+ const headingId = useId();
5651
+ const titleId = `${headingId}-title`;
5652
+ const descriptionId = `${headingId}-description`;
5606
5653
  const [internalSortKey, setInternalSortKey] = useState(null);
5607
5654
  const [internalSortDir, setInternalSortDir] = useState(null);
5608
5655
  const [expandedRows, setExpandedRows] = useState(/* @__PURE__ */ new Set());
@@ -5669,14 +5716,21 @@ function Table({
5669
5716
  const preferences = useShellPreferences();
5670
5717
  const mobileBreakpoint = mobileBreakpointProp ?? preferences.tableToCardsBreakpoint ?? "md";
5671
5718
  const isMobile = useBreakpoint(mobileBreakpoint);
5719
+ const cardHeading = title ? /* @__PURE__ */ jsx(TableHeading, { title, description, actions, titleId, descriptionId, inset: false }) : null;
5720
+ const titledCards = (body) => /* @__PURE__ */ jsxs("div", { ref, "data-ds-list": "", "data-gs": "table", className: cn("flex flex-col", className), children: [
5721
+ cardHeading,
5722
+ body
5723
+ ] });
5672
5724
  if (isMobile) {
5673
5725
  if (loading) {
5674
- return /* @__PURE__ */ jsx("div", { ref, "data-ds-list": "", className: cn("flex items-center justify-center py-ds-10", className), children: /* @__PURE__ */ jsx(Spinner, { label: "Loading table data" }) });
5726
+ if (title) return titledCards(/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-ds-10", children: /* @__PURE__ */ jsx(Spinner, { label: "Loading table data" }) }));
5727
+ return /* @__PURE__ */ jsx("div", { ref, "data-ds-list": "", "data-gs": "table", className: cn("flex items-center justify-center py-ds-10", className), children: /* @__PURE__ */ jsx(Spinner, { label: "Loading table data" }) });
5675
5728
  }
5676
5729
  if (data.length === 0 && emptyState) {
5677
- return /* @__PURE__ */ jsx("div", { ref, "data-ds-list": "", className: cn("py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", className), children: emptyState });
5730
+ if (title) return titledCards(/* @__PURE__ */ jsx("div", { className: "py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", children: emptyState }));
5731
+ return /* @__PURE__ */ jsx("div", { ref, "data-ds-list": "", "data-gs": "table", className: cn("py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", className), children: emptyState });
5678
5732
  }
5679
- return /* @__PURE__ */ jsx(TableCardCtx, { value: true, children: /* @__PURE__ */ jsx("div", { ref, "data-ds-list": "", className: cn("flex flex-col gap-ds-3 overflow-y-auto", className), children: sortedWithIndices.map(({ row, originalIdx }, i) => {
5733
+ const cards = /* @__PURE__ */ jsx(TableCardCtx, { value: true, children: /* @__PURE__ */ jsx("div", { ref: title ? void 0 : ref, "data-ds-list": title ? void 0 : "", "data-gs": title ? void 0 : "table", className: cn("flex flex-col gap-ds-3 overflow-y-auto", title ? "min-h-0" : className), children: sortedWithIndices.map(({ row, originalIdx }, i) => {
5680
5734
  const isSelected = selectedSet.has(originalIdx);
5681
5735
  return /* @__PURE__ */ jsxs(
5682
5736
  "div",
@@ -5710,173 +5764,179 @@ function Table({
5710
5764
  i
5711
5765
  );
5712
5766
  }) }) });
5767
+ return title ? titledCards(cards) : cards;
5713
5768
  }
5714
- return /* @__PURE__ */ jsx(
5715
- "div",
5716
- {
5717
- ref,
5718
- "data-ds-list": "",
5719
- className: cn(
5720
- "w-full overflow-x-auto",
5721
- "border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
5722
- "rounded-[var(--ds-radius-md)]",
5723
- GLASS_SURFACE,
5724
- "bg-[var(--ds-bg-surface)]",
5725
- className
5726
- ),
5727
- children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
5728
- /* @__PURE__ */ jsx("thead", { className: cn("bg-[var(--ds-bg-muted)]", stickyHeader && "sticky top-0 z-10"), children: /* @__PURE__ */ jsxs("tr", { className: "border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]", children: [
5729
- selectable && /* @__PURE__ */ jsx("th", { className: cn("w-10", density === "compact" ? "px-ds-2 py-ds-2" : "px-ds-3 py-ds-3"), children: /* @__PURE__ */ jsx(
5730
- Checkbox,
5731
- {
5732
- checked: allSelected,
5733
- indeterminate: someSelected,
5734
- onChange: toggleAll
5735
- }
5736
- ) }),
5737
- expandable && /* @__PURE__ */ jsx("th", { className: cn("w-8", density === "compact" ? "px-ds-1 py-ds-2" : "px-ds-2 py-ds-3") }),
5738
- columns.map((col) => {
5739
- const isSortable = sortable || col.sortable;
5740
- const isActiveSort = sortKey === col.key;
5741
- const headerKind = kindOf(col);
5742
- const headerAlign = col.align ?? (headerKind === "number" ? "right" : "left");
5743
- const shrink = (headerKind === "number" || headerKind === "date") && !col.maxWidth;
5744
- return /* @__PURE__ */ jsx(
5745
- "th",
5746
- {
5747
- className: cn(
5748
- density === "compact" ? "px-ds-3 py-ds-2" : "px-ds-4 py-ds-3",
5749
- shrink && "w-px whitespace-nowrap",
5750
- "font-[var(--ds-weight-heading)] text-[var(--ds-text-secondary)]",
5751
- "text-xs uppercase tracking-wider",
5752
- headerAlign === "right" ? "text-right" : headerAlign === "center" ? "text-center" : "text-left",
5753
- isSortable && "cursor-pointer select-none hover:text-[var(--ds-text-primary)]"
5754
- ),
5755
- style: col.maxWidth || col.width || col.minWidth ? { maxWidth: col.maxWidth, width: col.width, minWidth: col.minWidth } : void 0,
5756
- onClick: isSortable ? () => handleSort(col.key) : void 0,
5757
- children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-ds-1", children: [
5758
- col.header,
5759
- isSortable && isActiveSort && /* @__PURE__ */ jsx(
5769
+ const table = /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", ...title ? { "aria-labelledby": titleId, "aria-describedby": description ? descriptionId : void 0 } : {}, children: [
5770
+ /* @__PURE__ */ jsx("thead", { className: cn("bg-[var(--ds-bg-muted)]", stickyHeader && "sticky top-0 z-10"), children: /* @__PURE__ */ jsxs("tr", { className: "border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]", children: [
5771
+ selectable && /* @__PURE__ */ jsx("th", { className: cn("w-10", density === "compact" ? "px-ds-2 py-ds-2" : "px-ds-3 py-ds-3"), children: /* @__PURE__ */ jsx(
5772
+ Checkbox,
5773
+ {
5774
+ checked: allSelected,
5775
+ indeterminate: someSelected,
5776
+ onChange: toggleAll
5777
+ }
5778
+ ) }),
5779
+ expandable && /* @__PURE__ */ jsx("th", { className: cn("w-8", density === "compact" ? "px-ds-1 py-ds-2" : "px-ds-2 py-ds-3") }),
5780
+ columns.map((col) => {
5781
+ const isSortable = sortable || col.sortable;
5782
+ const isActiveSort = sortKey === col.key;
5783
+ const headerKind = kindOf(col);
5784
+ const headerAlign = col.align ?? (headerKind === "number" ? "right" : "left");
5785
+ const shrink = (headerKind === "number" || headerKind === "date") && !col.maxWidth;
5786
+ return /* @__PURE__ */ jsx(
5787
+ "th",
5788
+ {
5789
+ className: cn(
5790
+ density === "compact" ? "px-ds-3 py-ds-2" : "px-ds-4 py-ds-3",
5791
+ shrink && "w-px whitespace-nowrap",
5792
+ "font-[var(--ds-weight-heading)] text-[var(--ds-text-secondary)]",
5793
+ "text-xs uppercase tracking-wider",
5794
+ headerAlign === "right" ? "text-right" : headerAlign === "center" ? "text-center" : "text-left",
5795
+ isSortable && "cursor-pointer select-none hover:text-[var(--ds-text-primary)]"
5796
+ ),
5797
+ style: col.maxWidth || col.width || col.minWidth ? { maxWidth: col.maxWidth, width: col.width, minWidth: col.minWidth } : void 0,
5798
+ onClick: isSortable ? () => handleSort(col.key) : void 0,
5799
+ children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-ds-1", children: [
5800
+ col.header,
5801
+ isSortable && isActiveSort && /* @__PURE__ */ jsx(
5802
+ Icon,
5803
+ {
5804
+ name: "chevron-right",
5805
+ size: 12,
5806
+ className: cn(
5807
+ "transition-transform",
5808
+ sortDir === "asc" ? "-rotate-90" : "rotate-90"
5809
+ )
5810
+ }
5811
+ )
5812
+ ] })
5813
+ },
5814
+ col.key
5815
+ );
5816
+ })
5817
+ ] }) }),
5818
+ /* @__PURE__ */ jsx("tbody", { children: loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5819
+ "td",
5820
+ {
5821
+ colSpan: columns.length + (selectable ? 1 : 0) + (expandable ? 1 : 0),
5822
+ className: "px-ds-4 py-ds-10 text-center",
5823
+ children: /* @__PURE__ */ jsx(Spinner, { label: "Loading table data" })
5824
+ }
5825
+ ) }) : data.length === 0 && emptyState ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5826
+ "td",
5827
+ {
5828
+ colSpan: columns.length + (selectable ? 1 : 0) + (expandable ? 1 : 0),
5829
+ className: "px-ds-4 py-ds-10 text-center text-sm text-[var(--ds-text-muted)]",
5830
+ children: emptyState
5831
+ }
5832
+ ) }) : sortedWithIndices.map(({ row, originalIdx }, i) => {
5833
+ const isSelected = selectedSet.has(originalIdx);
5834
+ const isExpanded = expandedRows.has(i);
5835
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5836
+ /* @__PURE__ */ jsxs(
5837
+ "tr",
5838
+ {
5839
+ className: cn(
5840
+ "border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] last:border-b-0",
5841
+ "transition-colors",
5842
+ isSelected ? "bg-[var(--ds-accent-subtle)]" : striped && i % 2 === 1 ? "bg-[var(--ds-bg-muted)]/50" : "hover:bg-[var(--ds-bg-muted)]",
5843
+ onRowClick && "cursor-pointer focus-visible:outline-none focus-visible:shadow-[inset_var(--ds-shadow-focus)]"
5844
+ ),
5845
+ onClick: onRowClick ? () => onRowClick(row, originalIdx) : void 0,
5846
+ tabIndex: onRowClick ? 0 : void 0,
5847
+ onKeyDown: onRowClick ? (e) => {
5848
+ if (e.target !== e.currentTarget) return;
5849
+ if (e.key === "Enter" || e.key === " ") {
5850
+ e.preventDefault();
5851
+ onRowClick(row, originalIdx);
5852
+ }
5853
+ } : void 0,
5854
+ children: [
5855
+ selectable && /* @__PURE__ */ jsx("td", { className: cn("w-10", density === "compact" ? "px-ds-2 py-ds-2" : "px-ds-3 py-ds-3"), children: /* @__PURE__ */ jsx(Checkbox, { checked: isSelected, onChange: () => toggleRow(originalIdx) }) }),
5856
+ expandable && /* @__PURE__ */ jsx("td", { className: cn("w-8", density === "compact" ? "px-ds-1 py-ds-2" : "px-ds-2 py-ds-3"), children: /* @__PURE__ */ jsx(
5857
+ "button",
5858
+ {
5859
+ onClick: () => toggleExpand(i),
5860
+ className: "text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)] cursor-pointer",
5861
+ "aria-expanded": isExpanded,
5862
+ "aria-label": "Expand row",
5863
+ children: /* @__PURE__ */ jsx(
5760
5864
  Icon,
5761
5865
  {
5762
5866
  name: "chevron-right",
5763
- size: 12,
5764
- className: cn(
5765
- "transition-transform",
5766
- sortDir === "asc" ? "-rotate-90" : "rotate-90"
5767
- )
5867
+ size: 14,
5868
+ className: cn("transition-transform", isExpanded && "rotate-90")
5768
5869
  }
5769
5870
  )
5770
- ] })
5771
- },
5772
- col.key
5773
- );
5774
- })
5775
- ] }) }),
5776
- /* @__PURE__ */ jsx("tbody", { children: loading ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5777
- "td",
5778
- {
5779
- colSpan: columns.length + (selectable ? 1 : 0) + (expandable ? 1 : 0),
5780
- className: "px-ds-4 py-ds-10 text-center",
5781
- children: /* @__PURE__ */ jsx(Spinner, { label: "Loading table data" })
5871
+ }
5872
+ ) }),
5873
+ columns.map((col) => {
5874
+ const truncLines = col.truncate === true ? 1 : col.truncate ? col.truncate.lines : 0;
5875
+ const kind = kindOf(col);
5876
+ const alignClass = col.align ? col.align === "right" ? "text-right" : col.align === "center" ? "text-center" : "text-left" : kind === "number" ? "text-right" : "text-left";
5877
+ const cellContent = row[col.key];
5878
+ const shrink = (kind === "number" || kind === "date") && !col.maxWidth;
5879
+ let inner;
5880
+ if (truncLines > 0) {
5881
+ inner = /* @__PURE__ */ jsx(TruncCell, { lines: truncLines, children: cellContent });
5882
+ } else if (kind === "email") {
5883
+ inner = /* @__PURE__ */ jsx("span", { className: "max-w-[40ch] truncate inline-block align-bottom", title: typeof cellContent === "string" ? cellContent : void 0, children: cellContent });
5884
+ } else {
5885
+ inner = cellContent;
5886
+ }
5887
+ const align = col.align ?? (kind === "number" ? "right" : "left");
5888
+ if (align !== "left" && cellContent !== null && cellContent !== void 0 && typeof cellContent !== "string" && typeof cellContent !== "number") {
5889
+ inner = /* @__PURE__ */ jsx("div", { className: cn("flex items-center", align === "center" ? "justify-center" : "justify-end"), children: inner });
5890
+ }
5891
+ return /* @__PURE__ */ jsx(
5892
+ "td",
5893
+ {
5894
+ className: cn(
5895
+ density === "compact" ? "px-ds-3 py-ds-2" : "px-ds-4 py-ds-3",
5896
+ "text-[var(--ds-text-primary)]",
5897
+ alignClass,
5898
+ shrink && "w-px whitespace-nowrap"
5899
+ ),
5900
+ style: col.maxWidth || col.width || col.minWidth ? { maxWidth: col.maxWidth, width: col.width, minWidth: col.minWidth } : void 0,
5901
+ children: inner
5902
+ },
5903
+ col.key
5904
+ );
5905
+ })
5906
+ ]
5782
5907
  }
5783
- ) }) : data.length === 0 && emptyState ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5908
+ ),
5909
+ expandable && isExpanded && renderExpanded && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5784
5910
  "td",
5785
5911
  {
5786
- colSpan: columns.length + (selectable ? 1 : 0) + (expandable ? 1 : 0),
5787
- className: "px-ds-4 py-ds-10 text-center text-sm text-[var(--ds-text-muted)]",
5788
- children: emptyState
5912
+ colSpan: columns.length + (selectable ? 1 : 0) + 1,
5913
+ className: "bg-[var(--ds-bg-muted)] px-ds-6 py-ds-4 text-sm text-[var(--ds-text-primary)]",
5914
+ children: renderExpanded(row, i)
5789
5915
  }
5790
- ) }) : sortedWithIndices.map(({ row, originalIdx }, i) => {
5791
- const isSelected = selectedSet.has(originalIdx);
5792
- const isExpanded = expandedRows.has(i);
5793
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
5794
- /* @__PURE__ */ jsxs(
5795
- "tr",
5796
- {
5797
- className: cn(
5798
- "border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] last:border-b-0",
5799
- "transition-colors",
5800
- isSelected ? "bg-[var(--ds-accent-subtle)]" : striped && i % 2 === 1 ? "bg-[var(--ds-bg-muted)]/50" : "hover:bg-[var(--ds-bg-muted)]",
5801
- onRowClick && "cursor-pointer focus-visible:outline-none focus-visible:shadow-[inset_var(--ds-shadow-focus)]"
5802
- ),
5803
- onClick: onRowClick ? () => onRowClick(row, originalIdx) : void 0,
5804
- tabIndex: onRowClick ? 0 : void 0,
5805
- onKeyDown: onRowClick ? (e) => {
5806
- if (e.target !== e.currentTarget) return;
5807
- if (e.key === "Enter" || e.key === " ") {
5808
- e.preventDefault();
5809
- onRowClick(row, originalIdx);
5810
- }
5811
- } : void 0,
5812
- children: [
5813
- selectable && /* @__PURE__ */ jsx("td", { className: cn("w-10", density === "compact" ? "px-ds-2 py-ds-2" : "px-ds-3 py-ds-3"), children: /* @__PURE__ */ jsx(Checkbox, { checked: isSelected, onChange: () => toggleRow(originalIdx) }) }),
5814
- expandable && /* @__PURE__ */ jsx("td", { className: cn("w-8", density === "compact" ? "px-ds-1 py-ds-2" : "px-ds-2 py-ds-3"), children: /* @__PURE__ */ jsx(
5815
- "button",
5816
- {
5817
- onClick: () => toggleExpand(i),
5818
- className: "text-[var(--ds-text-muted)] hover:text-[var(--ds-text-primary)] cursor-pointer",
5819
- "aria-expanded": isExpanded,
5820
- "aria-label": "Expand row",
5821
- children: /* @__PURE__ */ jsx(
5822
- Icon,
5823
- {
5824
- name: "chevron-right",
5825
- size: 14,
5826
- className: cn("transition-transform", isExpanded && "rotate-90")
5827
- }
5828
- )
5829
- }
5830
- ) }),
5831
- columns.map((col) => {
5832
- const truncLines = col.truncate === true ? 1 : col.truncate ? col.truncate.lines : 0;
5833
- const kind = kindOf(col);
5834
- const alignClass = col.align ? col.align === "right" ? "text-right" : col.align === "center" ? "text-center" : "text-left" : kind === "number" ? "text-right" : "text-left";
5835
- const cellContent = row[col.key];
5836
- const shrink = (kind === "number" || kind === "date") && !col.maxWidth;
5837
- let inner;
5838
- if (truncLines > 0) {
5839
- inner = /* @__PURE__ */ jsx(TruncCell, { lines: truncLines, children: cellContent });
5840
- } else if (kind === "email") {
5841
- inner = /* @__PURE__ */ jsx("span", { className: "max-w-[40ch] truncate inline-block align-bottom", title: typeof cellContent === "string" ? cellContent : void 0, children: cellContent });
5842
- } else {
5843
- inner = cellContent;
5844
- }
5845
- const align = col.align ?? (kind === "number" ? "right" : "left");
5846
- if (align !== "left" && cellContent !== null && cellContent !== void 0 && typeof cellContent !== "string" && typeof cellContent !== "number") {
5847
- inner = /* @__PURE__ */ jsx("div", { className: cn("flex items-center", align === "center" ? "justify-center" : "justify-end"), children: inner });
5848
- }
5849
- return /* @__PURE__ */ jsx(
5850
- "td",
5851
- {
5852
- className: cn(
5853
- density === "compact" ? "px-ds-3 py-ds-2" : "px-ds-4 py-ds-3",
5854
- "text-[var(--ds-text-primary)]",
5855
- alignClass,
5856
- shrink && "w-px whitespace-nowrap"
5857
- ),
5858
- style: col.maxWidth || col.width || col.minWidth ? { maxWidth: col.maxWidth, width: col.width, minWidth: col.minWidth } : void 0,
5859
- children: inner
5860
- },
5861
- col.key
5862
- );
5863
- })
5864
- ]
5865
- }
5866
- ),
5867
- expandable && isExpanded && renderExpanded && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
5868
- "td",
5869
- {
5870
- colSpan: columns.length + (selectable ? 1 : 0) + 1,
5871
- className: "bg-[var(--ds-bg-muted)] px-ds-6 py-ds-4 text-sm text-[var(--ds-text-primary)]",
5872
- children: renderExpanded(row, i)
5873
- }
5874
- ) })
5875
- ] }, i);
5876
- }) })
5877
- ] })
5878
- }
5879
- );
5916
+ ) })
5917
+ ] }, i);
5918
+ }) })
5919
+ ] });
5920
+ if (!title) {
5921
+ return /* @__PURE__ */ jsx(
5922
+ "div",
5923
+ {
5924
+ ref,
5925
+ "data-ds-list": "",
5926
+ "data-gs": "table",
5927
+ className: cn(
5928
+ "w-full overflow-x-auto",
5929
+ FRAME_CLASSES,
5930
+ className
5931
+ ),
5932
+ children: table
5933
+ }
5934
+ );
5935
+ }
5936
+ return /* @__PURE__ */ jsxs("div", { ref, "data-ds-list": "", "data-gs": "table", className: cn("w-full flex flex-col", FRAME_CLASSES, className), children: [
5937
+ /* @__PURE__ */ jsx(TableHeading, { title, description, actions, titleId, descriptionId, inset: true }),
5938
+ /* @__PURE__ */ jsx("div", { "data-table-scroll": "", className: "min-h-0 overflow-x-auto rounded-b-[inherit]", children: table })
5939
+ ] });
5880
5940
  }
5881
5941
  function optionsKeyForFit(options) {
5882
5942
  return options.map((o) => `${o.value}:${o.label}`).join("|");
@@ -8386,6 +8446,7 @@ function Carousel({
8386
8446
  "div",
8387
8447
  {
8388
8448
  ref,
8449
+ "data-gs-clip": "",
8389
8450
  className: cn(
8390
8451
  "relative overflow-hidden rounded-[var(--ds-radius-md)]",
8391
8452
  "bg-[var(--ds-bg-muted)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
@@ -10193,7 +10254,7 @@ function TimeBar({ start, end, minWidth = 0, labels, children, className, style,
10193
10254
  const shows = (i) => i === 0 ? fits(0) : `calc(${[fits(i), ...labels.slice(0, i).map((_, j) => `(1 - ${fits(j)})`)].join(" * ")})`;
10194
10255
  const named = props["aria-label"] !== void 0 || props["aria-labelledby"] !== void 0;
10195
10256
  label = /* @__PURE__ */ jsxs(Fragment, { children: [
10196
- /* @__PURE__ */ jsx("span", { "data-time-bar-label": "", "aria-hidden": "true", className: "sticky grid overflow-hidden whitespace-nowrap", style: { ...sticky, paddingInline: inset }, children: labels.map((text, i) => /* @__PURE__ */ jsx("span", { ref: i === 0 ? textRef : void 0, "data-time-bar-form": "", className: "justify-self-start [grid-area:1/1]", style: { opacity: shows(i) }, children: text }, i)) }),
10257
+ /* @__PURE__ */ jsx("span", { "data-time-bar-label": "", "data-gs-clip": "", "aria-hidden": "true", className: "sticky grid overflow-hidden whitespace-nowrap", style: { ...sticky, paddingInline: inset }, children: labels.map((text, i) => /* @__PURE__ */ jsx("span", { ref: i === 0 ? textRef : void 0, "data-time-bar-form": "", className: "justify-self-start [grid-area:1/1]", style: { opacity: shows(i) }, children: text }, i)) }),
10197
10258
  !named && /* @__PURE__ */ jsx("span", { className: "sr-only", children: labels[0] })
10198
10259
  ] });
10199
10260
  } else if (children != null && children !== false) {
@@ -10201,6 +10262,7 @@ function TimeBar({ start, end, minWidth = 0, labels, children, className, style,
10201
10262
  "span",
10202
10263
  {
10203
10264
  "data-time-bar-label": "",
10265
+ "data-gs-clip": "",
10204
10266
  className: "sticky flex min-w-0 items-center gap-ds-1 overflow-hidden whitespace-nowrap",
10205
10267
  style: { ...sticky, paddingInline: INSET, opacity: `clamp(0, calc((${inView} - ${MIN_TITLE}) * 1000), 1)` },
10206
10268
  children: typeof children === "string" ? /* @__PURE__ */ jsx("span", { className: "truncate", children }) : children
@@ -10212,6 +10274,7 @@ function TimeBar({ start, end, minWidth = 0, labels, children, className, style,
10212
10274
  {
10213
10275
  ...props,
10214
10276
  ref: barRef,
10277
+ "data-gs-clip": "",
10215
10278
  className: cn("absolute top-ds-2 bottom-ds-2 flex items-center overflow-clip rounded-[var(--ds-radius-sm)] outline-none focus-visible:outline-hidden focus-visible:shadow-[var(--ds-shadow-focus)]", className),
10216
10279
  style: { insetInlineStart: x, width: drawnWidth, ...style },
10217
10280
  children: label
@@ -10661,7 +10724,7 @@ function Gantt({
10661
10724
  minWidth: MIN_BAR,
10662
10725
  className: cn("cursor-pointer text-xs font-medium", EDGE, tone.fill, tone.on, isSelected && SELECTED),
10663
10726
  style: { top: (ROW_HEIGHT2 - BAR_HEIGHT) / 2, bottom: "auto", height: BAR_HEIGHT },
10664
- children: place === "inside" && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex min-w-0 items-center gap-ds-1 overflow-hidden", children: title })
10727
+ children: place === "inside" && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", "data-gs-clip": "", className: "flex min-w-0 items-center gap-ds-1 overflow-hidden", children: title })
10665
10728
  }
10666
10729
  )
10667
10730
  );
@@ -11311,6 +11374,7 @@ function TabsList({ children, className }) {
11311
11374
  {
11312
11375
  role: "tablist",
11313
11376
  ...overflow === "scroll" ? track : {},
11377
+ "data-gs-clip": overflow === "scroll" ? void 0 : "",
11314
11378
  className: cn(
11315
11379
  trackClasses("horizontal"),
11316
11380
  "max-w-full",
@@ -11415,6 +11479,7 @@ function TabsRoot(props) {
11415
11479
  {
11416
11480
  role: "tablist",
11417
11481
  ...effectiveOverflow === "scroll" ? track : {},
11482
+ "data-gs-clip": effectiveOverflow === "scroll" ? void 0 : "",
11418
11483
  className: cn(
11419
11484
  trackClasses("horizontal"),
11420
11485
  effectiveOverflow === "scroll" ? SCROLL_TRACK : "overflow-hidden",
@@ -11432,14 +11497,35 @@ var Tabs = Object.assign(TabsRoot, {
11432
11497
  Trigger: TabsTrigger,
11433
11498
  Content: TabsContent
11434
11499
  });
11435
- var MIN_PANEL_WIDTH = 480;
11500
+ var MIN_PANEL_WIDTH = 560;
11501
+ var PANEL_STYLE = {
11502
+ "--ds-form-max": "calc(var(--ds-bp-md) - 2 * var(--ds-space-6))"
11503
+ };
11504
+ var PANEL_CLASSES = "min-w-0 @container";
11505
+ function useColumnGap(ref) {
11506
+ const [gap, setGap] = useState(0);
11507
+ useLayoutEffect(() => {
11508
+ const el = ref.current;
11509
+ if (!el) return;
11510
+ const read = () => {
11511
+ const px = parseFloat(getComputedStyle(el).columnGap);
11512
+ setGap(Number.isFinite(px) ? px : 0);
11513
+ };
11514
+ read();
11515
+ if (typeof ResizeObserver === "undefined") return;
11516
+ const observer = new ResizeObserver(read);
11517
+ observer.observe(el);
11518
+ return () => observer.disconnect();
11519
+ }, [ref]);
11520
+ return gap;
11521
+ }
11436
11522
  function SettingsLayout({
11437
11523
  sections,
11438
11524
  value,
11439
11525
  onChange,
11440
11526
  layout: layoutProp,
11441
11527
  railWidth = 220,
11442
- collapseBelow = railWidth + MIN_PANEL_WIDTH,
11528
+ collapseBelow: collapseBelowProp,
11443
11529
  "aria-label": ariaLabel = "Settings sections",
11444
11530
  children,
11445
11531
  className
@@ -11447,32 +11533,37 @@ function SettingsLayout({
11447
11533
  const shell = useAppShell();
11448
11534
  const layout = layoutProp ?? shell?.theme?.settingsLayout ?? "sidebar";
11449
11535
  const rootRef = useRef(null);
11536
+ const gap = useColumnGap(rootRef);
11537
+ const collapseBelow = collapseBelowProp ?? railWidth + gap + MIN_PANEL_WIDTH;
11450
11538
  const compact = useCompact(rootRef, collapseBelow);
11451
11539
  const tabs = sections.map((s) => ({ id: s.id, label: s.label, icon: s.icon, group: s.group, disabled: s.disabled }));
11452
11540
  const stickyTop = shell ? "var(--ds-sticky-offset, 0px)" : "calc(var(--ds-navbar-height) + var(--ds-sticky-offset, 0px))";
11453
11541
  if (layout === "tabs") {
11454
11542
  return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-settings-layout": "tabs", className: cn("flex flex-col gap-ds-6", className), children: [
11455
11543
  /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(Tabs, { orientation: "horizontal", mobile: "dropdown", tabs, activeTab: value, onTabChange: onChange }) }),
11456
- /* @__PURE__ */ jsx("div", { className: "min-w-0", children })
11544
+ /* @__PURE__ */ jsx("div", { "data-settings-panel": "", className: PANEL_CLASSES, style: PANEL_STYLE, children })
11457
11545
  ] });
11458
11546
  }
11459
11547
  if (compact) {
11460
- return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-settings-layout": "sidebar", "data-collapsed": "true", className: cn("flex flex-col gap-ds-6", className), children: [
11461
- /* @__PURE__ */ jsx(
11462
- Dropdown,
11463
- {
11464
- "aria-label": ariaLabel,
11465
- options: sections.filter((s) => !s.disabled).map((s) => ({ id: s.id, label: s.label, group: s.group })),
11466
- value,
11467
- onChange: (v) => onChange(v)
11468
- }
11469
- ),
11470
- /* @__PURE__ */ jsx("div", { className: "min-w-0", children })
11471
- ] });
11548
+ return (
11549
+ // gap-x-ds-8 is the rail's gap, unused in one column: the threshold reads the same gap as the row (useColumnGap)
11550
+ /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-settings-layout": "sidebar", "data-collapsed": "true", className: cn("flex flex-col gap-y-ds-6 gap-x-ds-8", className), children: [
11551
+ /* @__PURE__ */ jsx(
11552
+ Dropdown,
11553
+ {
11554
+ "aria-label": ariaLabel,
11555
+ options: sections.filter((s) => !s.disabled).map((s) => ({ id: s.id, label: s.label, group: s.group })),
11556
+ value,
11557
+ onChange: (v) => onChange(v)
11558
+ }
11559
+ ),
11560
+ /* @__PURE__ */ jsx("div", { "data-settings-panel": "", className: PANEL_CLASSES, style: PANEL_STYLE, children })
11561
+ ] })
11562
+ );
11472
11563
  }
11473
11564
  return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-settings-layout": "sidebar", className: cn("flex flex-row items-start gap-ds-8", className), children: [
11474
11565
  /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, className: "sticky self-start shrink-0", style: { width: `${railWidth}px`, top: stickyTop }, children: /* @__PURE__ */ jsx(Tabs, { orientation: "vertical", tabs, activeTab: value, onTabChange: onChange, className: "w-full" }) }),
11475
- /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children })
11566
+ /* @__PURE__ */ jsx("div", { "data-settings-panel": "", className: cn("flex-1", PANEL_CLASSES), style: PANEL_STYLE, children })
11476
11567
  ] });
11477
11568
  }
11478
11569
  function SeparatorIcon({ type, size }) {
@@ -13184,6 +13275,16 @@ var widthToMaxWidth = {
13184
13275
  full: "full",
13185
13276
  narrow: "md"
13186
13277
  };
13278
+ var dataWidthOf = {
13279
+ sm: "sm",
13280
+ md: "narrow",
13281
+ lg: "lg",
13282
+ xl: "constrained",
13283
+ full: "full"
13284
+ };
13285
+ function pageMaxWidth(resolved) {
13286
+ return resolved === "md" ? `var(--ds-page-max, ${maxWidthValues.md})` : maxWidthValues[resolved];
13287
+ }
13187
13288
  var paddingClasses = {
13188
13289
  none: "",
13189
13290
  default: "px-ds-6",
@@ -13281,7 +13382,8 @@ var PageContainer = forwardRef(function PageContainer2({
13281
13382
  else rootRef.current?.style.removeProperty("--ds-sticky-offset");
13282
13383
  }, []);
13283
13384
  const resolvedMaxWidth = width ? widthToMaxWidth[width] : maxWidth;
13284
- const maxWidthValue = maxWidthValues[resolvedMaxWidth];
13385
+ const maxWidthValue = pageMaxWidth(resolvedMaxWidth);
13386
+ const dataWidth = dataWidthOf[resolvedMaxWidth];
13285
13387
  const [requestedWidth, setRequestedWidth] = useState(null);
13286
13388
  const requestContentWidth = useCallback((w) => setRequestedWidth(w), []);
13287
13389
  const effectiveContentWidth = contentWidth ?? requestedWidth ?? void 0;
@@ -13345,6 +13447,7 @@ var PageContainer = forwardRef(function PageContainer2({
13345
13447
  {
13346
13448
  ref: setRoot,
13347
13449
  "data-page-container": wrappedHeader ? "" : void 0,
13450
+ "data-width": dataWidth,
13348
13451
  className: cn(
13349
13452
  "w-full",
13350
13453
  paddingClasses[padding],
@@ -13376,7 +13479,7 @@ var PageContainer = forwardRef(function PageContainer2({
13376
13479
  ...overlapActive ? { marginTop: "calc(-1 * var(--ds-overlap, 0px))", position: "relative", zIndex: 1 } : {}
13377
13480
  } : void 0;
13378
13481
  const column = /* @__PURE__ */ jsx(PageContainerContext, { value: { contentMaxWidth: maxWidthValue, placement: "inside", containedBreadcrumbs: false, breadcrumbsInsideHeader: false, noBottomMargin: false, overlap: false, setPinnedHeight, reportHeader, requestContentWidth, insidePaddedColumn: true }, children: /* @__PURE__ */ jsx("div", { ref: columnRef, className: cn(columnClass(contentPadding), bottomPaddingClasses[vPad], className), style: { ...columnStyle, ...launcherPadding }, children: capped(rest) }) });
13379
- return /* @__PURE__ */ jsxs("div", { ref: setRoot, "data-page-container": "", className: "w-full", children: [
13482
+ return /* @__PURE__ */ jsxs("div", { ref: setRoot, "data-page-container": "", "data-width": dataWidth, className: "w-full", children: [
13380
13483
  placement === "block" ? /* @__PURE__ */ jsx("div", { style: floatingBlockPadding(r.navbarFloating, r.sidebarFloating, overlapActive), children: /* @__PURE__ */ jsxs("div", { className: FLOATING_BLOCK, children: [
13381
13484
  strip,
13382
13485
  colourful ? header : /* @__PURE__ */ jsx("div", { className: columnClass(padding), style: columnStyle, children: header })
@@ -13637,7 +13740,7 @@ var PageHeader = forwardRef(function PageHeader2({
13637
13740
  }
13638
13741
  let header;
13639
13742
  if (variant === "minimal") {
13640
- header = /* @__PURE__ */ jsx(MinimalHeader, { title, caption, focusBack, badge, breadcrumbs: inlineBreadcrumbs, actions, tabs, breadcrumbPill: bcPill, breadcrumbSeparator: bcSep, as: Heading, className, headerRef: floating ? void 0 : ref, isFloating: floating, contentMaxWidth: gutterWidth });
13743
+ header = /* @__PURE__ */ jsx(MinimalHeader, { title, description, caption, focusBack, badge, breadcrumbs: inlineBreadcrumbs, actions, tabs, breadcrumbPill: bcPill, breadcrumbSeparator: bcSep, as: Heading, className, headerRef: floating ? void 0 : ref, isFloating: floating, contentMaxWidth: gutterWidth });
13641
13744
  } else if (variant === "tabs-integrated") {
13642
13745
  header = /* @__PURE__ */ jsx(
13643
13746
  TabsIntegratedHeader,
@@ -13812,6 +13915,7 @@ function DefaultHeader({
13812
13915
  }
13813
13916
  function MinimalHeader({
13814
13917
  title,
13918
+ description,
13815
13919
  caption,
13816
13920
  focusBack,
13817
13921
  badge,
@@ -13839,6 +13943,7 @@ function MinimalHeader({
13839
13943
  ] }),
13840
13944
  actions && /* @__PURE__ */ jsx(ControlSizeContext.Provider, { value: "sm", children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-ds-2 shrink-0", children: actions }) })
13841
13945
  ] }),
13946
+ description && /* @__PURE__ */ jsx(ClampedText, { className: "mt-ds-1 text-sm text-[var(--ds-text-secondary)]", children: description }),
13842
13947
  tabs && /* @__PURE__ */ jsx(TabRow, { hasCaption: !!caption, className: "mt-ds-3 -mx-ds-1", children: tabs })
13843
13948
  ] }) });
13844
13949
  }
@@ -14127,6 +14232,7 @@ function SnappingHeader({
14127
14232
  ] }),
14128
14233
  actions && /* @__PURE__ */ jsx(ControlSizeContext.Provider, { value: "sm", children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-ds-2 shrink-0", children: actions }) })
14129
14234
  ] }),
14235
+ description && /* @__PURE__ */ jsx(ClampedText, { className: "mt-ds-1 text-sm text-[var(--ds-text-secondary)]", children: description }),
14130
14236
  filters && /* @__PURE__ */ jsx(ControlSizeContext.Provider, { value: "sm", children: /* @__PURE__ */ jsx("div", { className: "flex items-center flex-wrap gap-ds-3 mt-ds-3", children: filters }) }),
14131
14237
  expandedContent && /* @__PURE__ */ jsx("div", { className: "mt-ds-3", children: expandedContent }),
14132
14238
  tabs && /* @__PURE__ */ jsx(TabRow, { hasCaption: !!caption, className: "mt-ds-3 -mx-ds-1", children: tabs })
@@ -16489,6 +16595,7 @@ var SectionHeading = forwardRef(function SectionHeading2({
16489
16595
  "div",
16490
16596
  {
16491
16597
  ref,
16598
+ "data-gs": "section-heading",
16492
16599
  "data-variant": variant,
16493
16600
  className: cn(
16494
16601
  pane ? "shrink-0 px-ds-4 pt-ds-4 pb-ds-3 border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]" : "mb-[var(--ds-heading-gap)]",
@@ -16504,7 +16611,7 @@ var SectionHeading = forwardRef(function SectionHeading2({
16504
16611
  ), children: [
16505
16612
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
16506
16613
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-2", children: [
16507
- /* @__PURE__ */ jsx("h2", { className: "font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)] truncate", children: title }),
16614
+ /* @__PURE__ */ jsx("h2", { className: cn("font-[family-name:var(--ds-font-display)] text-lg font-[var(--ds-weight-heading)] text-[var(--ds-text-primary)]", pane ? "truncate" : "min-w-0 break-words"), children: title }),
16508
16615
  badge,
16509
16616
  count !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "sm", children: count })
16510
16617
  ] }),