@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.d.cts CHANGED
@@ -722,6 +722,12 @@ interface RecentActivityCardProps {
722
722
  actionLabel?: string;
723
723
  actionIcon?: LucideIcon;
724
724
  onAction?: () => void;
725
+ /**
726
+ * A custom header action node — rendered in the action slot INSTEAD of the
727
+ * built-in label button. For actions that aren't a single click (e.g. a
728
+ * source dropdown). The empty-card CTA still uses `onAction`/`emptyActionLabel`.
729
+ */
730
+ action?: ReactNode;
725
731
  rows: RecentActivityRow[];
726
732
  /** Says what the list is — "Recent", "Recently joined". */
727
733
  caption?: string;
@@ -764,7 +770,7 @@ interface RecentActivityCardProps {
764
770
  * Styled with SEMANTIC tokens only (card, border, foreground, muted-foreground,
765
771
  * primary, accent), so every firm gets it in its own colours.
766
772
  */
767
- declare function RecentActivityCard({ icon: Icon, title, count, onOpen, actionLabel, actionIcon: ActionIcon, onAction, rows, caption, emptyText, emptyActionLabel, className, testId, }: RecentActivityCardProps): react.JSX.Element;
773
+ declare function RecentActivityCard({ icon: Icon, title, count, onOpen, actionLabel, actionIcon: ActionIcon, onAction, action, rows, caption, emptyText, emptyActionLabel, className, testId, }: RecentActivityCardProps): react.JSX.Element;
768
774
 
769
775
  interface AskBarProps {
770
776
  /** Receives the trimmed question; the caller owns what asking means. */
@@ -835,6 +841,11 @@ interface SectionStripAction {
835
841
  label: string;
836
842
  onClick: () => void;
837
843
  testId?: string;
844
+ /**
845
+ * A custom element rendered in place of the default ghost button — for a
846
+ * primary/emphasised action that shouldn't look like the quiet header doors.
847
+ */
848
+ node?: ReactNode;
838
849
  }
839
850
  interface SectionStripProps {
840
851
  /** Glyph beside the title, in the header. */
@@ -849,11 +860,18 @@ interface SectionStripProps {
849
860
  actions?: SectionStripAction[];
850
861
  /** Captioned row groups; groups with no rows are skipped. */
851
862
  groups: SectionStripGroup[];
852
- /** The one quiet row shown when every group is empty. */
863
+ /**
864
+ * Shown when every group is empty. By default a single quiet row. Supply an
865
+ * `icon` (and optional `description`) to render the fuller dashed empty state
866
+ * instead — the same shape a card uses, for sections that want the empty
867
+ * state to invite rather than just note.
868
+ */
853
869
  empty?: {
854
870
  label: ReactNode;
855
871
  onClick?: () => void;
856
872
  testId?: string;
873
+ icon?: LucideIcon;
874
+ description?: ReactNode;
857
875
  };
858
876
  className?: string;
859
877
  /** Root test id; children derive `-open` and per-action/per-group ids. */
package/dist/index.d.ts CHANGED
@@ -722,6 +722,12 @@ interface RecentActivityCardProps {
722
722
  actionLabel?: string;
723
723
  actionIcon?: LucideIcon;
724
724
  onAction?: () => void;
725
+ /**
726
+ * A custom header action node — rendered in the action slot INSTEAD of the
727
+ * built-in label button. For actions that aren't a single click (e.g. a
728
+ * source dropdown). The empty-card CTA still uses `onAction`/`emptyActionLabel`.
729
+ */
730
+ action?: ReactNode;
725
731
  rows: RecentActivityRow[];
726
732
  /** Says what the list is — "Recent", "Recently joined". */
727
733
  caption?: string;
@@ -764,7 +770,7 @@ interface RecentActivityCardProps {
764
770
  * Styled with SEMANTIC tokens only (card, border, foreground, muted-foreground,
765
771
  * primary, accent), so every firm gets it in its own colours.
766
772
  */
767
- declare function RecentActivityCard({ icon: Icon, title, count, onOpen, actionLabel, actionIcon: ActionIcon, onAction, rows, caption, emptyText, emptyActionLabel, className, testId, }: RecentActivityCardProps): react.JSX.Element;
773
+ declare function RecentActivityCard({ icon: Icon, title, count, onOpen, actionLabel, actionIcon: ActionIcon, onAction, action, rows, caption, emptyText, emptyActionLabel, className, testId, }: RecentActivityCardProps): react.JSX.Element;
768
774
 
769
775
  interface AskBarProps {
770
776
  /** Receives the trimmed question; the caller owns what asking means. */
@@ -835,6 +841,11 @@ interface SectionStripAction {
835
841
  label: string;
836
842
  onClick: () => void;
837
843
  testId?: string;
844
+ /**
845
+ * A custom element rendered in place of the default ghost button — for a
846
+ * primary/emphasised action that shouldn't look like the quiet header doors.
847
+ */
848
+ node?: ReactNode;
838
849
  }
839
850
  interface SectionStripProps {
840
851
  /** Glyph beside the title, in the header. */
@@ -849,11 +860,18 @@ interface SectionStripProps {
849
860
  actions?: SectionStripAction[];
850
861
  /** Captioned row groups; groups with no rows are skipped. */
851
862
  groups: SectionStripGroup[];
852
- /** The one quiet row shown when every group is empty. */
863
+ /**
864
+ * Shown when every group is empty. By default a single quiet row. Supply an
865
+ * `icon` (and optional `description`) to render the fuller dashed empty state
866
+ * instead — the same shape a card uses, for sections that want the empty
867
+ * state to invite rather than just note.
868
+ */
853
869
  empty?: {
854
870
  label: ReactNode;
855
871
  onClick?: () => void;
856
872
  testId?: string;
873
+ icon?: LucideIcon;
874
+ description?: ReactNode;
857
875
  };
858
876
  className?: string;
859
877
  /** Root test id; children derive `-open` and per-action/per-group ids. */
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { formatPageRefs, tid, initials, fromNow, fmtDate, assetRefId, applyStoredTheme, AssetResolverProvider, ThemeEditor, applyThemeVars, SectionHeading, PricingTable, Tabs as Tabs$1, Accordion, Gallery, VideoEmbed, ContactForm, Banner, MediaText, TeamGrid, Steps, TestimonialGrid, Columns, Spacer, Container, Hero, FeatureGrid, Testimonial, CTABanner, LogoCloud, FAQ, Timeline, RichTextBlock, Callout, BlockImage, AvatarBlock, Navbar, Footer, ListBlock, isAssetRef, asAssetRef } from './chunk-27Q4AST5.js';
2
2
  export { ASSET_REF_PREFIX, Accordion, AssetResolverProvider, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Callout, Columns, ContactForm, Container, FAQ, FONT_PAIRINGS, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, RichTextBlock, SectionHeading, Spacer, Steps, THEME_STYLE_ID, Tabs, TeamGrid, Testimonial, TestimonialGrid, ThemeEditor, Timeline, TimelineCalendar, TimelineGantt, VideoEmbed, applyFontVars, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearFontVars, clearThemeVars, createThemeStore, dayKey, daysUntil, fmtDate, fmtDateTime, fontPackages, formatPageRefs, formatSpan, fromNow, gbp, getFontPairing, hrs, initials, isAssetRef, matchFontPairing, monthLabel, parseIso, pct, tid, toEmbedUrl, toHslTriplet, useAssetRenderer, useAssetResolverActive, utcDay } from './chunk-27Q4AST5.js';
3
3
  import { createContext, useState, useRef, useEffect, useMemo, useCallback, useContext } from 'react';
4
- import { MessageSquare, Cpu, Code, Cloud, Layers, Target, Award, MapPin, Phone, Mail, Lock, Globe, Heart, Star, Rocket, Shield, Zap, Sparkles, Gavel, Scale, Bell, Activity, BarChart3, DollarSign, TrendingUp, Info, AlertCircle, CheckCircle, Clock, Calendar, Briefcase, Users, Folder, FileText, X, Loader2, UploadCloud, Search, Pencil, ChevronDown, ArrowUpRight, ArrowDownRight, ChevronRight, Plus, FolderLock, CheckCircle2, ArrowLeftRight, MessagesSquare, Menu, ArrowLeft, Palette, RotateCcw, ChevronUp, BrainCircuit, Bot, LayoutGrid, FileJson, Download, Crop, ImagePlus, Upload, Link2, Check } from 'lucide-react';
4
+ import { MessageSquare, Cpu, Code, Cloud, Layers, Target, Award, MapPin, Phone, Mail, Lock, Globe, Heart, Star, Rocket, Shield, Zap, Sparkles, Gavel, Scale, Bell, Activity, BarChart3, DollarSign, TrendingUp, Info, AlertCircle, CheckCircle, Clock, Calendar, Briefcase, Users, Folder, FileText, X, Loader2, UploadCloud, Search, Pencil, ChevronDown, ArrowUpRight, ArrowDownRight, Plus, FolderLock, CheckCircle2, ArrowLeftRight, MessagesSquare, Menu, ArrowLeft, Palette, RotateCcw, ChevronUp, BrainCircuit, Bot, LayoutGrid, FileJson, Download, Crop, ImagePlus, Upload, Link2, Check } from 'lucide-react';
5
5
  import { cn, DocumentEntity, useArbi, ArbiProvider, useAiTask, useWorkspaceDocs as useWorkspaceDocs$1, useSemanticSearch as useSemanticSearch$1, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Input, Textarea, Avatar, AvatarImage, AvatarFallback, Card, Button, CardHeader, CardTitle, CardDescription, CardContent, Tooltip, TooltipTrigger, TooltipContent, CardFooter, TooltipProvider, NotificationBell, UserMenu, useThumbnails, Badge, Switch, useConfigs, useAgents, Checkbox, Tabs, TabsList, TabsTrigger, TabsContent, Separator, ArbiWebSocketProvider, useDocuments, ImageCropModal, DEFAULT_ASPECT_OPTIONS, useConversations } from '@arbidocs/react';
6
6
  export { DocumentCard, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, redlineStats, textToArtifact, toRedlineMarkdown } from '@arbidocs/react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1340,21 +1340,26 @@ function IdentityFieldRow({ field, canEdit }) {
1340
1340
  children: charsLeft < 0 ? `${-charsLeft} over` : `${charsLeft} left`
1341
1341
  }
1342
1342
  )
1343
- ] }) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
1344
- /* @__PURE__ */ jsx("span", { className: cn("px-1.5 py-0.5", valueClassName), "data-testid": testId, children: value || /* @__PURE__ */ jsx("span", { className: "italic text-muted-foreground", children: placeholder }) }),
1345
- canEdit && /* @__PURE__ */ 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__ */ jsx(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__ */ jsxs("span", { className: "identity-field flex min-w-0 items-center gap-1.5", children: [
1348
+ /* @__PURE__ */ jsx("span", { className: cn("px-1.5 py-0.5", valueClassName), "data-testid": testId, children: value || /* @__PURE__ */ jsx("span", { className: "italic text-muted-foreground", children: placeholder }) }),
1349
+ canEdit && /* @__PURE__ */ 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__ */ jsx(Pencil, { className: "size-3.5" })
1359
+ }
1360
+ )
1361
+ ] })
1362
+ ),
1358
1363
  trailing ? /* @__PURE__ */ 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__ */ jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1498
1508
  /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-sm font-semibold text-foreground", children: title }),
1499
- count !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count }),
1500
- onOpen && /* @__PURE__ */ jsx(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__ */ jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1501
1510
  ]
1502
1511
  }
1503
1512
  ),
1504
- actionLabel ? /* @__PURE__ */ jsxs(
1513
+ action ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action }) : actionLabel ? /* @__PURE__ */ jsxs(
1505
1514
  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__ */ 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__ */ jsx(ActionIcon, { className: "size-5" }) : /* @__PURE__ */ jsx(Plus, { className: "size-5" }) }),
1540
+ /* @__PURE__ */ 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__ */ jsx(ActionIcon, { className: "size-5" }) : /* @__PURE__ */ jsx(Plus, { className: "size-5" }) }),
1532
1541
  /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: emptyActionLabel ?? actionLabel }),
1533
1542
  /* @__PURE__ */ 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: 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__ */ jsxs(
@@ -1749,29 +1760,48 @@ function SectionStrip({
1749
1760
  children: [
1750
1761
  Icon && /* @__PURE__ */ jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }),
1751
1762
  /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-sm font-semibold text-foreground", children: title }),
1752
- count !== void 0 && /* @__PURE__ */ jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count }),
1753
- onOpen && /* @__PURE__ */ jsx(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__ */ jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: count })
1754
1764
  ]
1755
1765
  }
1756
1766
  ),
1757
- actions.map((action) => /* @__PURE__ */ jsxs(
1758
- Button,
1767
+ actions.map(
1768
+ (action) => action.node ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action.node }, action.label) : /* @__PURE__ */ jsxs(
1769
+ 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__ */ jsx(action.icon, { className: "size-3.5" }),
1779
+ /* @__PURE__ */ 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__ */ 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__ */ jsx(action.icon, { className: "size-3.5" }),
1768
- /* @__PURE__ */ jsx("span", { className: "sr-only @md:not-sr-only @md:ml-1.5", children: action.label })
1798
+ /* @__PURE__ */ 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__ */ jsx(empty.icon, { className: "size-5" }) }),
1799
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: empty.label }),
1800
+ empty.description && /* @__PURE__ */ 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__ */ jsxs(
1802
+ }
1803
+ )
1804
+ ) : /* @__PURE__ */ 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,