@arbidocs/blocks 0.3.161 → 0.3.163

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
@@ -1236,7 +1236,7 @@ function EntityIdentityBar({
1236
1236
  /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "min-w-0 flex-1 space-y-1.5", children: [
1237
1237
  fields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(IdentityFieldRow, { field, canEdit }, field.label)),
1238
1238
  extraRows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", "data-testid": row.testId, children: [
1239
- /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "w-24 shrink-0 text-xs font-medium text-muted-foreground", children: [
1239
+ /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "w-24 shrink-0 text-sm font-medium text-muted-foreground", children: [
1240
1240
  row.label,
1241
1241
  ":"
1242
1242
  ] }),
@@ -1304,7 +1304,7 @@ function IdentityFieldRow({ field, canEdit }) {
1304
1304
  "dt",
1305
1305
  {
1306
1306
  className: react.cn(
1307
- "w-24 shrink-0 text-xs font-medium text-muted-foreground",
1307
+ "w-24 shrink-0 text-sm font-medium text-muted-foreground",
1308
1308
  multiline && "pt-1"
1309
1309
  ),
1310
1310
  children: [
@@ -1320,15 +1320,9 @@ function IdentityFieldRow({ field, canEdit }) {
1320
1320
  {
1321
1321
  ...shared,
1322
1322
  rows: 2,
1323
- className: react.cn(fieldClass, "min-h-0 resize-none text-sm leading-snug")
1323
+ className: react.cn(fieldClass, "min-h-0 resize-none leading-snug", valueClassName)
1324
1324
  }
1325
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1326
- react.Input,
1327
- {
1328
- ...shared,
1329
- className: react.cn(fieldClass, "pr-20 text-xl font-semibold tracking-tight")
1330
- }
1331
- ),
1325
+ ) : /* @__PURE__ */ jsxRuntime.jsx(react.Input, { ...shared, className: react.cn(fieldClass, "pr-20", valueClassName) }),
1332
1326
  charsLeft !== null && charsLeft <= COUNTER_THRESHOLD && /* @__PURE__ */ jsxRuntime.jsx(
1333
1327
  "span",
1334
1328
  {
@@ -1340,21 +1334,26 @@ function IdentityFieldRow({ field, canEdit }) {
1340
1334
  children: charsLeft < 0 ? `${-charsLeft} over` : `${charsLeft} left`
1341
1335
  }
1342
1336
  )
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
- ] }),
1337
+ ] }) : (
1338
+ // `identity-field` (not the generic `group`) scopes the pencil's hover
1339
+ // to THIS field only — an ancestor card also carries `group`, so a
1340
+ // `.group:hover` rule would reveal every field's pencil at once.
1341
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "identity-field flex min-w-0 items-center gap-1.5", children: [
1342
+ /* @__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 }) }),
1343
+ canEdit && /* @__PURE__ */ jsxRuntime.jsx(
1344
+ "button",
1345
+ {
1346
+ type: "button",
1347
+ onClick: () => setIsEditing(true),
1348
+ "aria-label": `Edit ${label.toLowerCase()}`,
1349
+ title: `Edit ${label.toLowerCase()}`,
1350
+ 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",
1351
+ "data-testid": testId && `${testId}-edit`,
1352
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
1353
+ }
1354
+ )
1355
+ ] })
1356
+ ),
1358
1357
  trailing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto shrink-0", children: trailing }) : null
1359
1358
  ] })
1360
1359
  ] });
@@ -1463,6 +1462,7 @@ function RecentActivityCard({
1463
1462
  actionLabel,
1464
1463
  actionIcon: ActionIcon,
1465
1464
  onAction,
1465
+ action,
1466
1466
  rows,
1467
1467
  caption,
1468
1468
  emptyText,
@@ -1479,7 +1479,11 @@ function RecentActivityCard({
1479
1479
  // scrolling inside a fixed-height card puts a scrollbar in the middle
1480
1480
  // of the page, where every other page in the app scrolls at its outer
1481
1481
  // 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",
1482
+ //
1483
+ // No `card-hover` lift: the card is a container, not a single link — its
1484
+ // header and each row have their OWN hover, so a whole-card lift on any
1485
+ // hover would highlight the section instead of the item under the cursor.
1486
+ "flex flex-col overflow-hidden rounded-xl bg-card p-0 shadow-sm",
1483
1487
  className
1484
1488
  ),
1485
1489
  "data-testid": testId,
@@ -1496,12 +1500,11 @@ function RecentActivityCard({
1496
1500
  children: [
1497
1501
  Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1498
1502
  /* @__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" })
1503
+ count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1501
1504
  ]
1502
1505
  }
1503
1506
  ),
1504
- actionLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
1507
+ action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action }) : actionLabel ? /* @__PURE__ */ jsxRuntime.jsxs(
1505
1508
  react.Button,
1506
1509
  {
1507
1510
  variant: "ghost",
@@ -1528,7 +1531,7 @@ function RecentActivityCard({
1528
1531
  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
1532
  "data-testid": testId && `${testId}-empty-action`,
1530
1533
  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" }) }),
1534
+ /* @__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
1535
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: emptyActionLabel ?? actionLabel }),
1533
1536
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-relaxed text-muted-foreground", children: emptyText })
1534
1537
  ]
@@ -1550,11 +1553,13 @@ function RecentActivityCard({
1550
1553
  {
1551
1554
  className: react.cn(
1552
1555
  "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"
1556
+ // Clearly highlight the row under the cursor so it's obvious
1557
+ // which item will be clicked. Use the ungated `[&:hover]`
1558
+ // selector rather than `hover:` the latter compiles behind
1559
+ // `@media (hover: hover)`, so on a touchscreen (primary pointer
1560
+ // reports `hover: none`) the highlight never shows even with a
1561
+ // real mouse attached.
1562
+ "[&:hover]:bg-primary/10 has-[button:focus-visible]:bg-primary/10"
1558
1563
  ),
1559
1564
  children: [
1560
1565
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1749,29 +1754,48 @@ function SectionStrip({
1749
1754
  children: [
1750
1755
  Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1751
1756
  /* @__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" })
1757
+ count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1754
1758
  ]
1755
1759
  }
1756
1760
  ),
1757
- actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
1758
- react.Button,
1761
+ actions.map(
1762
+ (action) => action.node ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action.node }, action.label) : /* @__PURE__ */ jsxRuntime.jsxs(
1763
+ react.Button,
1764
+ {
1765
+ variant: "ghost",
1766
+ size: "sm",
1767
+ className: "h-8 shrink-0 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",
1768
+ onClick: action.onClick,
1769
+ title: action.label,
1770
+ "data-testid": action.testId,
1771
+ children: [
1772
+ action.icon && /* @__PURE__ */ jsxRuntime.jsx(action.icon, { className: "size-3.5" }),
1773
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only @md:not-sr-only @md:ml-1.5", children: action.label })
1774
+ ]
1775
+ },
1776
+ action.label
1777
+ )
1778
+ )
1779
+ ] }),
1780
+ filledGroups.length === 0 ? empty ? empty.icon ? (
1781
+ // Fuller dashed empty state, matching a card's — an invitation, not
1782
+ // just a note. The icon glyph rides a tinted circle that fills on
1783
+ // hover, exactly like RecentActivityCard's empty card.
1784
+ /* @__PURE__ */ jsxRuntime.jsxs(
1785
+ "button",
1759
1786
  {
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,
1787
+ type: "button",
1788
+ onClick: empty.onClick,
1789
+ 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",
1790
+ "data-testid": empty.testId,
1766
1791
  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 })
1792
+ /* @__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" }) }),
1793
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-foreground", children: empty.label }),
1794
+ empty.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs leading-relaxed text-muted-foreground", children: empty.description })
1769
1795
  ]
1770
- },
1771
- action.label
1772
- ))
1773
- ] }),
1774
- filledGroups.length === 0 ? empty ? /* @__PURE__ */ jsxRuntime.jsxs(
1796
+ }
1797
+ )
1798
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
1775
1799
  "button",
1776
1800
  {
1777
1801
  type: "button",
@@ -1791,7 +1815,7 @@ function SectionStrip({
1791
1815
  type: "button",
1792
1816
  onClick: row.onClick,
1793
1817
  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",
1818
+ 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
1819
  "data-testid": group.rowTestId ?? (testId && `${testId}-row`),
1796
1820
  children: [
1797
1821
  row.leading,