@arbidocs/blocks 0.3.179 → 0.3.181
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 +48 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +48 -29
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/grid.css +10 -0
package/dist/index.d.cts
CHANGED
|
@@ -593,6 +593,20 @@ interface EntityIdentityField {
|
|
|
593
593
|
* value run the full width, which is what a description wants.
|
|
594
594
|
*/
|
|
595
595
|
trailing?: ReactNode;
|
|
596
|
+
/**
|
|
597
|
+
* Content rendered immediately BEFORE the value — the entity's own mark.
|
|
598
|
+
* Sits outside the edit swap, so starting to edit the name doesn't make the
|
|
599
|
+
* icon jump or disappear.
|
|
600
|
+
*/
|
|
601
|
+
leading?: ReactNode;
|
|
602
|
+
/**
|
|
603
|
+
* Drops the caption from view for this row, leaving the value flush left.
|
|
604
|
+
* For a field whose value already says what it is — a workspace's name and
|
|
605
|
+
* description read as exactly that — the caption is a word the eye has to
|
|
606
|
+
* step over on the way in. The caption stays in the markup for screen
|
|
607
|
+
* readers, which have no such visual cue to fall back on.
|
|
608
|
+
*/
|
|
609
|
+
hideLabel?: boolean;
|
|
596
610
|
/** Row test id; the pencil and input derive `-edit` and `-input`. */
|
|
597
611
|
testId?: string;
|
|
598
612
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -593,6 +593,20 @@ interface EntityIdentityField {
|
|
|
593
593
|
* value run the full width, which is what a description wants.
|
|
594
594
|
*/
|
|
595
595
|
trailing?: ReactNode;
|
|
596
|
+
/**
|
|
597
|
+
* Content rendered immediately BEFORE the value — the entity's own mark.
|
|
598
|
+
* Sits outside the edit swap, so starting to edit the name doesn't make the
|
|
599
|
+
* icon jump or disappear.
|
|
600
|
+
*/
|
|
601
|
+
leading?: ReactNode;
|
|
602
|
+
/**
|
|
603
|
+
* Drops the caption from view for this row, leaving the value flush left.
|
|
604
|
+
* For a field whose value already says what it is — a workspace's name and
|
|
605
|
+
* description read as exactly that — the caption is a word the eye has to
|
|
606
|
+
* step over on the way in. The caption stays in the markup for screen
|
|
607
|
+
* readers, which have no such visual cue to fall back on.
|
|
608
|
+
*/
|
|
609
|
+
hideLabel?: boolean;
|
|
596
610
|
/** Row test id; the pencil and input derive `-edit` and `-input`. */
|
|
597
611
|
testId?: string;
|
|
598
612
|
}
|
package/dist/index.js
CHANGED
|
@@ -1297,6 +1297,8 @@ function IdentityFieldRow({ field, canEdit }) {
|
|
|
1297
1297
|
multiline = false,
|
|
1298
1298
|
maxLength,
|
|
1299
1299
|
valueClassName,
|
|
1300
|
+
leading,
|
|
1301
|
+
hideLabel,
|
|
1300
1302
|
trailing,
|
|
1301
1303
|
testId
|
|
1302
1304
|
} = field;
|
|
@@ -1340,8 +1342,7 @@ function IdentityFieldRow({ field, canEdit }) {
|
|
|
1340
1342
|
"dt",
|
|
1341
1343
|
{
|
|
1342
1344
|
className: cn(
|
|
1343
|
-
"w-24 shrink-0 text-sm font-medium text-muted-foreground",
|
|
1344
|
-
multiline && "pt-1"
|
|
1345
|
+
hideLabel ? "sr-only" : cn("w-24 shrink-0 text-sm font-medium text-muted-foreground", multiline && "pt-1")
|
|
1345
1346
|
),
|
|
1346
1347
|
children: [
|
|
1347
1348
|
label,
|
|
@@ -1350,6 +1351,7 @@ function IdentityFieldRow({ field, canEdit }) {
|
|
|
1350
1351
|
}
|
|
1351
1352
|
),
|
|
1352
1353
|
/* @__PURE__ */ jsxs("dd", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
1354
|
+
leading,
|
|
1353
1355
|
isEditing ? /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
|
|
1354
1356
|
multiline ? /* @__PURE__ */ jsx(
|
|
1355
1357
|
Textarea,
|
|
@@ -1524,7 +1526,7 @@ function RecentActivityCard({
|
|
|
1524
1526
|
),
|
|
1525
1527
|
"data-testid": testId,
|
|
1526
1528
|
children: [
|
|
1527
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 px-2 pt-2", children: [
|
|
1529
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1 border-b border-border/60 px-2 pb-2 pt-2", children: [
|
|
1528
1530
|
/* @__PURE__ */ jsxs(
|
|
1529
1531
|
"button",
|
|
1530
1532
|
{
|
|
@@ -1579,7 +1581,7 @@ function RecentActivityCard({
|
|
|
1579
1581
|
/* @__PURE__ */ jsx(
|
|
1580
1582
|
"p",
|
|
1581
1583
|
{
|
|
1582
|
-
className: "mt-1 px-4 pb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
1584
|
+
className: "mt-1 px-4 pb-1 text-right text-[11px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
1583
1585
|
"data-testid": testId && `${testId}-caption`,
|
|
1584
1586
|
children: caption
|
|
1585
1587
|
}
|
|
@@ -1793,15 +1795,19 @@ function QuickActionCards({
|
|
|
1793
1795
|
title: item.disabled ? item.disabledReason : void 0,
|
|
1794
1796
|
"aria-describedby": void 0,
|
|
1795
1797
|
className: cn(
|
|
1796
|
-
"group flex h-full items-start gap-3 rounded-2xl border border-border
|
|
1797
|
-
|
|
1798
|
+
"group flex h-full items-start gap-3 rounded-2xl border border-border bg-card p-4 text-left",
|
|
1799
|
+
// A soft lift instead of a heavy outline: the shadow separates the
|
|
1800
|
+
// tile from the page, and deepens on hover so the card reads as
|
|
1801
|
+
// liftable rather than merely tinted.
|
|
1802
|
+
"shadow-sm [&:hover]:shadow-md",
|
|
1803
|
+
"transition-[color,background-color,border-color,box-shadow]",
|
|
1798
1804
|
// `[&:hover]` rather than `hover:` — Tailwind v4 wraps the hover
|
|
1799
1805
|
// variant in @media (hover: hover), so on a touchscreen the
|
|
1800
1806
|
// affordance would never appear at all.
|
|
1801
1807
|
"[&:hover]:border-theme-cyan/50 [&:hover]:bg-theme-cyan/5",
|
|
1802
1808
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-theme-cyan focus-visible:ring-offset-2",
|
|
1803
1809
|
"disabled:cursor-default disabled:opacity-55",
|
|
1804
|
-
"disabled:[&:hover]:border-border
|
|
1810
|
+
"disabled:[&:hover]:border-border disabled:[&:hover]:bg-card"
|
|
1805
1811
|
),
|
|
1806
1812
|
"data-testid": item.testId,
|
|
1807
1813
|
children: [
|
|
@@ -1843,10 +1849,17 @@ function SectionStrip({
|
|
|
1843
1849
|
return /* @__PURE__ */ jsxs(
|
|
1844
1850
|
"div",
|
|
1845
1851
|
{
|
|
1846
|
-
className: cn(
|
|
1852
|
+
className: cn(
|
|
1853
|
+
// `p-0`, with the padding pushed onto the children — the same box
|
|
1854
|
+
// model the activity cards use. It is what lets a row's meta (the
|
|
1855
|
+
// date) sit on the card's own right inset, so the Facts dates line up
|
|
1856
|
+
// with the Files ones instead of 8px short of them.
|
|
1857
|
+
"@container rounded-xl border border-border/60 bg-card p-0 shadow-sm",
|
|
1858
|
+
className
|
|
1859
|
+
),
|
|
1847
1860
|
"data-testid": testId,
|
|
1848
1861
|
children: [
|
|
1849
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
1862
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1 border-b border-border/60 px-2 pb-2 pt-2", children: [
|
|
1850
1863
|
/* @__PURE__ */ jsxs(
|
|
1851
1864
|
"button",
|
|
1852
1865
|
{
|
|
@@ -1890,7 +1903,7 @@ function SectionStrip({
|
|
|
1890
1903
|
{
|
|
1891
1904
|
type: "button",
|
|
1892
1905
|
onClick: empty.onClick,
|
|
1893
|
-
className: "group
|
|
1906
|
+
className: "group m-2 flex w-[calc(100%-1rem)] 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",
|
|
1894
1907
|
"data-testid": empty.testId,
|
|
1895
1908
|
children: [
|
|
1896
1909
|
/* @__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" }) }),
|
|
@@ -1904,31 +1917,37 @@ function SectionStrip({
|
|
|
1904
1917
|
{
|
|
1905
1918
|
type: "button",
|
|
1906
1919
|
onClick: empty.onClick,
|
|
1907
|
-
className: "flex
|
|
1920
|
+
className: "m-2 flex items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-primary/5 hover:text-foreground",
|
|
1908
1921
|
"data-testid": empty.testId,
|
|
1909
1922
|
children: [
|
|
1910
1923
|
/* @__PURE__ */ jsx(Plus, { className: "size-3.5 shrink-0" }),
|
|
1911
1924
|
empty.label
|
|
1912
1925
|
]
|
|
1913
1926
|
}
|
|
1914
|
-
) : null : /* @__PURE__ */ jsx(
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
"
|
|
1918
|
-
{
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1927
|
+
) : null : /* @__PURE__ */ jsx(
|
|
1928
|
+
"div",
|
|
1929
|
+
{
|
|
1930
|
+
className: "grid gap-x-4 pb-2",
|
|
1931
|
+
children: filledGroups.map((group) => /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
1932
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 px-4 pb-0.5 text-right text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: group.caption }),
|
|
1933
|
+
/* @__PURE__ */ jsx("ul", { children: group.rows.map((row) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
1934
|
+
"button",
|
|
1935
|
+
{
|
|
1936
|
+
type: "button",
|
|
1937
|
+
onClick: row.onClick,
|
|
1938
|
+
title: row.title,
|
|
1939
|
+
className: "group flex w-full min-w-0 items-center gap-2 rounded-lg py-1.5 pl-4 pr-2 text-left transition-colors [&:hover]:bg-primary/10",
|
|
1940
|
+
"data-testid": group.rowTestId ?? (testId && `${testId}-row`),
|
|
1941
|
+
children: [
|
|
1942
|
+
row.leading,
|
|
1943
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-sm text-foreground group-hover:text-primary", children: row.title }),
|
|
1944
|
+
row.meta && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] tabular-nums text-muted-foreground", children: row.meta })
|
|
1945
|
+
]
|
|
1946
|
+
}
|
|
1947
|
+
) }, row.id)) })
|
|
1948
|
+
] }, group.caption))
|
|
1949
|
+
}
|
|
1950
|
+
)
|
|
1932
1951
|
]
|
|
1933
1952
|
}
|
|
1934
1953
|
);
|