@caqophony/ui 0.6.2 → 0.6.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.d.mts CHANGED
@@ -1703,6 +1703,12 @@ declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.
1703
1703
  * The shell provides the structural frame (sidebar, header, breadcrumb).
1704
1704
  * PageContent provides the content padding every page needs.
1705
1705
  *
1706
+ * #6254 — the children are spaced by a flex column's `gap`, never by
1707
+ * `space-y-*`: that margin sits on each direct child, and a generated page
1708
+ * wraps each state's sections in `<div className="contents">`, which has no
1709
+ * box to carry it (the page header sat flush on the card). A flex gap spaces
1710
+ * the items a `display: contents` child lays out, as it spaces its own.
1711
+ *
1706
1712
  * Usage:
1707
1713
  * import { PageContent } from '@caqophony/ui';
1708
1714
  * <PageContent>
@@ -1714,7 +1720,7 @@ declare const Container: React.ForwardRefExoticComponent<ContainerProps & React.
1714
1720
  */
1715
1721
 
1716
1722
  interface PageContentProps extends React.HTMLAttributes<HTMLDivElement> {
1717
- /** Vertical gap between direct children. Default: 'md' (space-y-6) */
1723
+ /** Vertical gap between the sections. Default: 'md' (gap-6) */
1718
1724
  gap?: 'sm' | 'md' | 'lg' | 'none';
1719
1725
  /** Whether to include page-level padding. Default: true */
1720
1726
  padded?: boolean;
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
112
112
  "div",
113
113
  {
114
114
  ref,
115
- className: cn("flex flex-col space-y-1.5 p-6", className),
115
+ className: cn("flex flex-col gap-1.5 p-6", className),
116
116
  ...props
117
117
  }
118
118
  ));
@@ -346,7 +346,7 @@ function FormSection({
346
346
  title && /* @__PURE__ */ jsx6("legend", { className: "text-base font-medium text-foreground dark:text-foreground", children: title }),
347
347
  description && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground dark:text-muted-foreground", children: description })
348
348
  ] }),
349
- /* @__PURE__ */ jsx6("div", { className: "space-y-4", children })
349
+ /* @__PURE__ */ jsx6("div", { className: "flex flex-col gap-4", children })
350
350
  ] });
351
351
  }
352
352
  function FormError({ error, className }) {
@@ -881,7 +881,14 @@ function AccordionSingle({
881
881
  value,
882
882
  onValueChange: handleValueChange
883
883
  },
884
- children: /* @__PURE__ */ jsx9("div", { className: cn("space-y-2", className), "data-accordion-root": "", children })
884
+ children: /* @__PURE__ */ jsx9(
885
+ "div",
886
+ {
887
+ className: cn("flex flex-col gap-2", className),
888
+ "data-accordion-root": "",
889
+ children
890
+ }
891
+ )
885
892
  }
886
893
  );
887
894
  }
@@ -913,7 +920,14 @@ function AccordionMultiple({
913
920
  value,
914
921
  onValueChange: handleValueChange
915
922
  },
916
- children: /* @__PURE__ */ jsx9("div", { className: cn("space-y-2", className), "data-accordion-root": "", children })
923
+ children: /* @__PURE__ */ jsx9(
924
+ "div",
925
+ {
926
+ className: cn("flex flex-col gap-2", className),
927
+ "data-accordion-root": "",
928
+ children
929
+ }
930
+ )
917
931
  }
918
932
  );
919
933
  }
@@ -1517,15 +1531,27 @@ function SkeletonRow({ className = "" }) {
1517
1531
  import * as React8 from "react";
1518
1532
  import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
1519
1533
  var StackedList = React8.forwardRef(
1520
- ({ className, divided = true, density = "default", ...props }, ref) => /* @__PURE__ */ jsx19(
1521
- "ul",
1522
- {
1523
- ref,
1524
- role: "list",
1525
- className: cn("w-full", divided && "divide-y divide-border", className),
1526
- "data-density": density,
1527
- ...props
1528
- }
1534
+ ({ className, divided = true, density = "default", ...props }, ref) => (
1535
+ // #6255: one grid for the list, an `auto` avatar column and the rest:
1536
+ // each item lays itself on it (`subgrid`), so the widest avatar sets one
1537
+ // column for every row and the titles start at one x. Every child spans
1538
+ // both columns, so a row that is not a StackedListItem stays a full row.
1539
+ // The column gap is the avatar's own margin: a list with no avatar has a
1540
+ // 0px column and no gap.
1541
+ /* @__PURE__ */ jsx19(
1542
+ "ul",
1543
+ {
1544
+ ref,
1545
+ role: "list",
1546
+ className: cn(
1547
+ "grid w-full grid-cols-[auto_minmax(0,1fr)] [&>*]:col-span-full",
1548
+ divided && "divide-y divide-border",
1549
+ className
1550
+ ),
1551
+ "data-density": density,
1552
+ ...props
1553
+ }
1554
+ )
1529
1555
  )
1530
1556
  );
1531
1557
  StackedList.displayName = "StackedList";
@@ -1544,37 +1570,39 @@ var StackedListItem = React8.forwardRef(
1544
1570
  {
1545
1571
  ref,
1546
1572
  className: cn(
1547
- "flex items-center gap-4",
1573
+ "grid grid-cols-subgrid items-center",
1548
1574
  density === "compact" ? "px-3 py-2" : "px-4 py-4",
1549
1575
  className
1550
1576
  ),
1551
1577
  ...props,
1552
1578
  children: [
1553
- avatar && /* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: avatar }),
1554
- /* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
1555
- /* @__PURE__ */ jsx19(
1556
- "p",
1557
- {
1558
- className: cn(
1559
- "truncate font-medium text-foreground",
1560
- density === "compact" ? "text-sm" : "text-base"
1561
- ),
1562
- children: title
1563
- }
1564
- ),
1565
- description && /* @__PURE__ */ jsx19(
1566
- "p",
1567
- {
1568
- className: cn(
1569
- "truncate text-muted-foreground",
1570
- density === "compact" ? "text-xs" : "text-sm"
1571
- ),
1572
- children: description
1573
- }
1574
- )
1575
- ] }),
1576
- meta && /* @__PURE__ */ jsx19("span", { className: "flex-shrink-0 text-sm text-muted-foreground", children: meta }),
1577
- action && /* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: action })
1579
+ avatar && /* @__PURE__ */ jsx19("div", { className: "col-start-1 mr-4", children: avatar }),
1580
+ /* @__PURE__ */ jsxs13("div", { className: "col-start-2 flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1", children: [
1581
+ /* @__PURE__ */ jsxs13("div", { className: "min-w-0 grow basis-40", children: [
1582
+ /* @__PURE__ */ jsx19(
1583
+ "p",
1584
+ {
1585
+ className: cn(
1586
+ "break-words font-medium text-foreground",
1587
+ density === "compact" ? "text-sm" : "text-base"
1588
+ ),
1589
+ children: title
1590
+ }
1591
+ ),
1592
+ description && /* @__PURE__ */ jsx19(
1593
+ "p",
1594
+ {
1595
+ className: cn(
1596
+ "truncate text-muted-foreground",
1597
+ density === "compact" ? "text-xs" : "text-sm"
1598
+ ),
1599
+ children: description
1600
+ }
1601
+ )
1602
+ ] }),
1603
+ meta && /* @__PURE__ */ jsx19("span", { className: "flex-shrink-0 text-sm text-muted-foreground", children: meta }),
1604
+ action && /* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: action })
1605
+ ] })
1578
1606
  ]
1579
1607
  }
1580
1608
  )
@@ -3149,7 +3177,7 @@ var FormLayout = React20.forwardRef(
3149
3177
  {
3150
3178
  ref,
3151
3179
  className: cn(
3152
- layout === "stacked" && "space-y-6",
3180
+ layout === "stacked" && "flex flex-col gap-6",
3153
3181
  layout === "inline" && "flex flex-wrap items-end gap-4",
3154
3182
  layout === "two-column" && "grid grid-cols-1 gap-6 lg:grid-cols-2",
3155
3183
  className
@@ -3170,7 +3198,7 @@ var FormLayoutSection = React20.forwardRef(({ className, title, description, chi
3170
3198
  title && /* @__PURE__ */ jsx31("h3", { className: "text-base font-semibold text-foreground", children: title }),
3171
3199
  description && /* @__PURE__ */ jsx31("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
3172
3200
  ] }),
3173
- /* @__PURE__ */ jsx31("div", { className: "space-y-4", children })
3201
+ /* @__PURE__ */ jsx31("div", { className: "flex flex-col gap-4", children })
3174
3202
  ]
3175
3203
  }
3176
3204
  ));
@@ -4161,7 +4189,7 @@ var DescriptionList = React32.forwardRef(({ className, layout = "stacked", ...pr
4161
4189
  className: cn(
4162
4190
  layout === "grid" && "grid grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2",
4163
4191
  layout === "side-by-side" && "divide-y divide-border",
4164
- layout === "stacked" && "space-y-4",
4192
+ layout === "stacked" && "flex flex-col gap-4",
4165
4193
  className
4166
4194
  ),
4167
4195
  ...props
@@ -4445,9 +4473,9 @@ Divider.displayName = "Divider";
4445
4473
  import * as React36 from "react";
4446
4474
  import { jsx as jsx50 } from "react/jsx-runtime";
4447
4475
  var GAP_CLASSES2 = {
4448
- sm: "space-y-4",
4449
- md: "space-y-6",
4450
- lg: "space-y-8",
4476
+ sm: "gap-4",
4477
+ md: "gap-6",
4478
+ lg: "gap-8",
4451
4479
  none: ""
4452
4480
  };
4453
4481
  var PageContent = React36.forwardRef(
@@ -4455,7 +4483,12 @@ var PageContent = React36.forwardRef(
4455
4483
  "div",
4456
4484
  {
4457
4485
  ref,
4458
- className: cn(GAP_CLASSES2[gap], padded && "p-4 sm:p-6", className),
4486
+ className: cn(
4487
+ "flex min-w-0 flex-col",
4488
+ GAP_CLASSES2[gap],
4489
+ padded && "p-4 sm:p-6",
4490
+ className
4491
+ ),
4459
4492
  ...props,
4460
4493
  children
4461
4494
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caqophony/ui",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Generic, optional React UI reuse library (Gossamer tokens). Centrally maintained by Caqophony.",
5
5
  "license": "MIT",
6
6
  "author": "Caqophony",