@arbidocs/blocks 0.3.161 → 0.3.162

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.cjs CHANGED
@@ -1340,21 +1340,26 @@ function IdentityFieldRow({ field, canEdit }) {
1340
1340
  children: charsLeft < 0 ? `${-charsLeft} over` : `${charsLeft} left`
1341
1341
  }
1342
1342
  )
1343
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
1344
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: react.cn("px-1.5 py-0.5", valueClassName), "data-testid": testId, children: value || /* @__PURE__ */ jsxRuntime.jsx("span", { className: "italic text-muted-foreground", children: placeholder }) }),
1345
- canEdit && /* @__PURE__ */ jsxRuntime.jsx(
1346
- "button",
1347
- {
1348
- type: "button",
1349
- onClick: () => setIsEditing(true),
1350
- "aria-label": `Edit ${label.toLowerCase()}`,
1351
- title: `Edit ${label.toLowerCase()}`,
1352
- className: "shrink-0 cursor-pointer rounded p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
1353
- "data-testid": testId && `${testId}-edit`,
1354
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
1355
- }
1356
- )
1357
- ] }),
1343
+ ] }) : (
1344
+ // `identity-field` (not the generic `group`) scopes the pencil's hover
1345
+ // to THIS field only — an ancestor card also carries `group`, so a
1346
+ // `.group:hover` rule would reveal every field's pencil at once.
1347
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "identity-field flex min-w-0 items-center gap-1.5", children: [
1348
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: react.cn("px-1.5 py-0.5", valueClassName), "data-testid": testId, children: value || /* @__PURE__ */ jsxRuntime.jsx("span", { className: "italic text-muted-foreground", children: placeholder }) }),
1349
+ canEdit && /* @__PURE__ */ jsxRuntime.jsx(
1350
+ "button",
1351
+ {
1352
+ type: "button",
1353
+ onClick: () => setIsEditing(true),
1354
+ "aria-label": `Edit ${label.toLowerCase()}`,
1355
+ title: `Edit ${label.toLowerCase()}`,
1356
+ className: "shrink-0 cursor-pointer rounded p-1 text-muted-foreground opacity-0 transition-[color,background-color,opacity] hover:bg-accent hover:text-foreground focus-visible:opacity-100 [.identity-field:hover_&]:opacity-100",
1357
+ "data-testid": testId && `${testId}-edit`,
1358
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
1359
+ }
1360
+ )
1361
+ ] })
1362
+ ),
1358
1363
  trailing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto shrink-0", children: trailing }) : null
1359
1364
  ] })
1360
1365
  ] });
@@ -1463,6 +1468,7 @@ function RecentActivityCard({
1463
1468
  actionLabel,
1464
1469
  actionIcon: ActionIcon,
1465
1470
  onAction,
1471
+ action,
1466
1472
  rows,
1467
1473
  caption,
1468
1474
  emptyText,
@@ -1479,7 +1485,11 @@ function RecentActivityCard({
1479
1485
  // scrolling inside a fixed-height card puts a scrollbar in the middle
1480
1486
  // of the page, where every other page in the app scrolls at its outer
1481
1487
  // edge. The page is the scroll container; the card is just tall.
1482
- "card-hover flex flex-col overflow-hidden rounded-xl bg-card p-0 shadow-sm",
1488
+ //
1489
+ // No `card-hover` lift: the card is a container, not a single link — its
1490
+ // header and each row have their OWN hover, so a whole-card lift on any
1491
+ // hover would highlight the section instead of the item under the cursor.
1492
+ "flex flex-col overflow-hidden rounded-xl bg-card p-0 shadow-sm",
1483
1493
  className
1484
1494
  ),
1485
1495
  "data-testid": testId,
@@ -1496,12 +1506,11 @@ function RecentActivityCard({
1496
1506
  children: [
1497
1507
  Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1498
1508
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap text-sm font-semibold text-foreground", children: title }),
1499
- count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count }),
1500
- onOpen && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto size-4 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" })
1509
+ count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1501
1510
  ]
1502
1511
  }
1503
1512
  ),
1504
- actionLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
1513
+ action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action }) : actionLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
1505
1514
  react.Button,
1506
1515
  {
1507
1516
  variant: "ghost",
@@ -1528,7 +1537,7 @@ function RecentActivityCard({
1528
1537
  className: "group m-3 flex flex-1 cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border px-4 text-center transition-colors hover:border-border hover:bg-accent/50 focus-visible:border-border focus-visible:bg-accent/50 focus-visible:outline-none",
1529
1538
  "data-testid": testId && `${testId}-empty-action`,
1530
1539
  children: [
1531
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: ActionIcon ? /* @__PURE__ */ jsxRuntime.jsx(ActionIcon, { className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-5" }) }),
1540
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-6 flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: ActionIcon ? /* @__PURE__ */ jsxRuntime.jsx(ActionIcon, { className: "size-5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-5" }) }),
1532
1541
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: emptyActionLabel ?? actionLabel }),
1533
1542
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-relaxed text-muted-foreground", children: emptyText })
1534
1543
  ]
@@ -1550,11 +1559,13 @@ function RecentActivityCard({
1550
1559
  {
1551
1560
  className: react.cn(
1552
1561
  "group relative flex items-center border-b border-border/60 transition-colors last:border-b-0",
1553
- // A row is a link to somewhere, so hovering it has to look
1554
- // like one but quietly: a neutral wash plus the title
1555
- // turning primary. Loud primary tints and edge bars read as
1556
- // selection chrome, not hover.
1557
- "hover:bg-accent/60 has-[button:focus-visible]:bg-accent/60"
1562
+ // Clearly highlight the row under the cursor so it's obvious
1563
+ // which item will be clicked. Use the ungated `[&:hover]`
1564
+ // selector rather than `hover:` the latter compiles behind
1565
+ // `@media (hover: hover)`, so on a touchscreen (primary pointer
1566
+ // reports `hover: none`) the highlight never shows even with a
1567
+ // real mouse attached.
1568
+ "[&:hover]:bg-primary/10 has-[button:focus-visible]:bg-primary/10"
1558
1569
  ),
1559
1570
  children: [
1560
1571
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1749,29 +1760,48 @@ function SectionStrip({
1749
1760
  children: [
1750
1761
  Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1751
1762
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap text-sm font-semibold text-foreground", children: title }),
1752
- count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count }),
1753
- onOpen && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto size-4 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-foreground" })
1763
+ count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1754
1764
  ]
1755
1765
  }
1756
1766
  ),
1757
- actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
1758
- react.Button,
1767
+ actions.map(
1768
+ (action) => action.node ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action.node }, action.label) : /* @__PURE__ */ jsxRuntime.jsxs(
1769
+ react.Button,
1770
+ {
1771
+ variant: "ghost",
1772
+ size: "sm",
1773
+ className: "h-8 shrink-0 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",
1774
+ onClick: action.onClick,
1775
+ title: action.label,
1776
+ "data-testid": action.testId,
1777
+ children: [
1778
+ action.icon && /* @__PURE__ */ jsxRuntime.jsx(action.icon, { className: "size-3.5" }),
1779
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only @md:not-sr-only @md:ml-1.5", children: action.label })
1780
+ ]
1781
+ },
1782
+ action.label
1783
+ )
1784
+ )
1785
+ ] }),
1786
+ filledGroups.length === 0 ? empty ? empty.icon ? (
1787
+ // Fuller dashed empty state, matching a card's — an invitation, not
1788
+ // just a note. The icon glyph rides a tinted circle that fills on
1789
+ // hover, exactly like RecentActivityCard's empty card.
1790
+ /* @__PURE__ */ jsxRuntime.jsxs(
1791
+ "button",
1759
1792
  {
1760
- variant: "ghost",
1761
- size: "sm",
1762
- className: "h-8 shrink-0 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",
1763
- onClick: action.onClick,
1764
- title: action.label,
1765
- "data-testid": action.testId,
1793
+ type: "button",
1794
+ onClick: empty.onClick,
1795
+ className: "group mt-2 flex w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border px-4 py-8 text-center transition-colors hover:border-border hover:bg-accent/50 focus-visible:border-border focus-visible:bg-accent/50 focus-visible:outline-none",
1796
+ "data-testid": empty.testId,
1766
1797
  children: [
1767
- action.icon && /* @__PURE__ */ jsxRuntime.jsx(action.icon, { className: "size-3.5" }),
1768
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only @md:not-sr-only @md:ml-1.5", children: action.label })
1798
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-2 flex size-11 items-center justify-center rounded-full bg-primary/10 text-primary transition-colors group-hover:bg-primary group-hover:text-primary-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(empty.icon, { className: "size-5" }) }),
1799
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: empty.label }),
1800
+ empty.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-relaxed text-muted-foreground", children: empty.description })
1769
1801
  ]
1770
- },
1771
- action.label
1772
- ))
1773
- ] }),
1774
- filledGroups.length === 0 ? empty ? /* @__PURE__ */ jsxRuntime.jsxs(
1802
+ }
1803
+ )
1804
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
1775
1805
  "button",
1776
1806
  {
1777
1807
  type: "button",
@@ -1791,7 +1821,7 @@ function SectionStrip({
1791
1821
  type: "button",
1792
1822
  onClick: row.onClick,
1793
1823
  title: row.title,
1794
- className: "group flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-primary/10",
1824
+ className: "group flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors [&:hover]:bg-primary/10",
1795
1825
  "data-testid": group.rowTestId ?? (testId && `${testId}-row`),
1796
1826
  children: [
1797
1827
  row.leading,