@assure-one/design-system 1.4.0 → 1.4.1
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.ts +10 -4
- package/dist/index.js +59 -51
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2384,14 +2384,20 @@ declare const EngagementTimelineStep: React$1.ForwardRefExoticComponent<Engageme
|
|
|
2384
2384
|
/**
|
|
2385
2385
|
* FolderTree — collapsible document tree (Documents panel / mobile sheet).
|
|
2386
2386
|
* Rows are chevron + folder + name + optional count. Each row has two
|
|
2387
|
-
* intents and therefore two DOM elements (skill §4): the
|
|
2388
|
-
* `<button>` that selects/opens the folder, and the chevron is a separate
|
|
2387
|
+
* intents and therefore two DOM elements (skill §4): the chevron is a
|
|
2389
2388
|
* `<button>` that only toggles expansion (so `aria-expanded` is accurate
|
|
2390
|
-
* and
|
|
2389
|
+
* and is independently keyboard-reachable), and the body is a separate
|
|
2390
|
+
* `<button>` that selects the folder.
|
|
2391
|
+
*
|
|
2392
|
+
* Sizing matches the firm Documents workspace: 12px name rows, a 13px
|
|
2393
|
+
* chevron column, 14px folder glyphs, and a flush-right tabular count pill.
|
|
2394
|
+
* Nesting is drawn VS Code / Linear style — each nested level renders a
|
|
2395
|
+
* single continuous vertical indent guide in the gutter (no per-row elbow
|
|
2396
|
+
* connectors), so stacked siblings form one clean line down the level.
|
|
2391
2397
|
*
|
|
2392
2398
|
* Open state is uncontrolled by default (SSR-safe lazy initializer seeded
|
|
2393
2399
|
* from `defaultOpenIds`) or fully controlled via `openIds` + `onOpenChange`.
|
|
2394
|
-
* The active row is tinted with the Pro tone (`bg-pro-bg`).
|
|
2400
|
+
* The active row is tinted with the Pro tone (`bg-pro-bg` / `text-pro-fg`).
|
|
2395
2401
|
*/
|
|
2396
2402
|
interface FolderNode {
|
|
2397
2403
|
id: string;
|
package/dist/index.js
CHANGED
|
@@ -9772,7 +9772,12 @@ var EngagementTimelineStep = forwardRef(
|
|
|
9772
9772
|
}
|
|
9773
9773
|
);
|
|
9774
9774
|
EngagementTimelineStep.displayName = "EngagementTimelineStep";
|
|
9775
|
-
var
|
|
9775
|
+
var ROW_BASE = "group/row flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1 text-left text-[12px] font-medium transition-colors duration-[120ms] motion-reduce:transition-none";
|
|
9776
|
+
var ROW_INACTIVE = "text-fg-2 hover:bg-surface-2 hover:text-fg";
|
|
9777
|
+
var ROW_ACTIVE = "bg-pro-bg text-pro-fg font-semibold";
|
|
9778
|
+
var BADGE_BASE = "ml-auto min-w-[18px] rounded-full px-[5px] py-px text-center text-[10px] font-[650] tabular-nums";
|
|
9779
|
+
var BADGE_INACTIVE = "bg-surface-2 text-fg-4";
|
|
9780
|
+
var BADGE_ACTIVE = "bg-pro-bg text-pro-fg";
|
|
9776
9781
|
var FolderTree = forwardRef(function FolderTree2({ nodes, activeId, onSelect, defaultOpenIds, openIds, onOpenChange, className, ...props }, ref) {
|
|
9777
9782
|
const isControlled = openIds !== void 0;
|
|
9778
9783
|
const [internalOpen, setInternalOpen] = useState(() => new Set(defaultOpenIds ?? []));
|
|
@@ -9791,59 +9796,62 @@ var FolderTree = forwardRef(function FolderTree2({ nodes, activeId, onSelect, de
|
|
|
9791
9796
|
const hasChildren = Boolean(node.children?.length);
|
|
9792
9797
|
const isOpen = open.has(node.id);
|
|
9793
9798
|
const isActive = activeId === node.id;
|
|
9794
|
-
return /* @__PURE__ */ jsxs("li", { children: [
|
|
9795
|
-
/* @__PURE__ */
|
|
9796
|
-
"
|
|
9799
|
+
return /* @__PURE__ */ jsxs("li", { className: "relative", children: [
|
|
9800
|
+
depth > 0 && /* @__PURE__ */ jsx(
|
|
9801
|
+
"span",
|
|
9797
9802
|
{
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
isActive ? "bg-pro-bg" : "hover:bg-bg-2"
|
|
9801
|
-
),
|
|
9802
|
-
children: [
|
|
9803
|
-
/* @__PURE__ */ jsx(
|
|
9804
|
-
"button",
|
|
9805
|
-
{
|
|
9806
|
-
type: "button",
|
|
9807
|
-
"aria-expanded": hasChildren ? isOpen : void 0,
|
|
9808
|
-
"aria-label": isOpen ? `Collapse ${node.name}` : `Expand ${node.name}`,
|
|
9809
|
-
onClick: () => hasChildren && toggle(node.id),
|
|
9810
|
-
disabled: !hasChildren,
|
|
9811
|
-
className: "flex w-6 shrink-0 items-center justify-center self-stretch text-fg-4 disabled:opacity-0",
|
|
9812
|
-
style: { marginLeft: depth * INDENT },
|
|
9813
|
-
tabIndex: hasChildren ? 0 : -1,
|
|
9814
|
-
children: /* @__PURE__ */ jsx(
|
|
9815
|
-
ChevronRightIcon,
|
|
9816
|
-
{
|
|
9817
|
-
className: cn(
|
|
9818
|
-
"size-3.5 transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out-quart)] motion-reduce:transition-none",
|
|
9819
|
-
isOpen && "rotate-90"
|
|
9820
|
-
),
|
|
9821
|
-
"aria-hidden": "true"
|
|
9822
|
-
}
|
|
9823
|
-
)
|
|
9824
|
-
}
|
|
9825
|
-
),
|
|
9826
|
-
/* @__PURE__ */ jsxs(
|
|
9827
|
-
"button",
|
|
9828
|
-
{
|
|
9829
|
-
type: "button",
|
|
9830
|
-
onClick: () => onSelect?.(node.id),
|
|
9831
|
-
"aria-current": isActive ? "true" : void 0,
|
|
9832
|
-
className: cn(
|
|
9833
|
-
"flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-2 text-left text-sm focus-visible:outline-none focus-visible:[box-shadow:var(--shadow-focus-ring)]",
|
|
9834
|
-
isActive ? "text-pro-fg font-medium" : "text-fg-2"
|
|
9835
|
-
),
|
|
9836
|
-
children: [
|
|
9837
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "shrink-0 [&_svg]:size-4", children: isOpen && hasChildren ? /* @__PURE__ */ jsx(FolderOpenIcon, {}) : /* @__PURE__ */ jsx(FolderClosedIcon, {}) }),
|
|
9838
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: node.name }),
|
|
9839
|
-
node.count != null && /* @__PURE__ */ jsx("span", { className: "text-fg-4 shrink-0 text-xs tabular-nums", children: node.count })
|
|
9840
|
-
]
|
|
9841
|
-
}
|
|
9842
|
-
)
|
|
9843
|
-
]
|
|
9803
|
+
"aria-hidden": true,
|
|
9804
|
+
className: "pointer-events-none absolute left-[-11px] top-0 bottom-0 w-px bg-[color:var(--color-rule-strong)]"
|
|
9844
9805
|
}
|
|
9845
9806
|
),
|
|
9846
|
-
|
|
9807
|
+
/* @__PURE__ */ jsxs("div", { className: cn(ROW_BASE, isActive ? ROW_ACTIVE : ROW_INACTIVE), children: [
|
|
9808
|
+
hasChildren ? /* @__PURE__ */ jsx(
|
|
9809
|
+
"button",
|
|
9810
|
+
{
|
|
9811
|
+
type: "button",
|
|
9812
|
+
"aria-expanded": isOpen,
|
|
9813
|
+
"aria-label": isOpen ? `Collapse ${node.name}` : `Expand ${node.name}`,
|
|
9814
|
+
onClick: (e) => {
|
|
9815
|
+
e.stopPropagation();
|
|
9816
|
+
toggle(node.id);
|
|
9817
|
+
},
|
|
9818
|
+
className: cn(
|
|
9819
|
+
"shrink-0 text-fg-4 transition-transform duration-[150ms] motion-reduce:transition-none",
|
|
9820
|
+
isOpen && "rotate-90"
|
|
9821
|
+
),
|
|
9822
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { size: 13, "aria-hidden": "true" })
|
|
9823
|
+
}
|
|
9824
|
+
) : /* @__PURE__ */ jsx("span", { className: "w-[13px] shrink-0", "aria-hidden": true }),
|
|
9825
|
+
/* @__PURE__ */ jsxs(
|
|
9826
|
+
"button",
|
|
9827
|
+
{
|
|
9828
|
+
type: "button",
|
|
9829
|
+
onClick: () => onSelect?.(node.id),
|
|
9830
|
+
"aria-current": isActive ? "true" : void 0,
|
|
9831
|
+
className: "flex min-w-0 flex-1 items-center gap-1.5 text-left text-[12px] focus-visible:outline-none focus-visible:[box-shadow:var(--shadow-focus-ring)]",
|
|
9832
|
+
children: [
|
|
9833
|
+
isOpen && hasChildren ? /* @__PURE__ */ jsx(
|
|
9834
|
+
FolderOpenIcon,
|
|
9835
|
+
{
|
|
9836
|
+
size: 14,
|
|
9837
|
+
"aria-hidden": "true",
|
|
9838
|
+
className: cn("shrink-0", isActive ? "text-pro-fg" : "text-fg-3")
|
|
9839
|
+
}
|
|
9840
|
+
) : /* @__PURE__ */ jsx(
|
|
9841
|
+
FolderClosedIcon,
|
|
9842
|
+
{
|
|
9843
|
+
size: 14,
|
|
9844
|
+
"aria-hidden": "true",
|
|
9845
|
+
className: cn("shrink-0", isActive ? "text-pro-fg" : "text-fg-3")
|
|
9846
|
+
}
|
|
9847
|
+
),
|
|
9848
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: node.name })
|
|
9849
|
+
]
|
|
9850
|
+
}
|
|
9851
|
+
),
|
|
9852
|
+
node.count != null && /* @__PURE__ */ jsx("span", { className: cn(BADGE_BASE, isActive ? BADGE_ACTIVE : BADGE_INACTIVE), children: node.count })
|
|
9853
|
+
] }),
|
|
9854
|
+
hasChildren && isOpen && /* @__PURE__ */ jsx("ul", { className: "relative flex flex-col pl-[22px]", children: node.children.map((child) => renderNode(child, depth + 1)) })
|
|
9847
9855
|
] }, node.id);
|
|
9848
9856
|
};
|
|
9849
9857
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: nodes.map((node) => renderNode(node, 0)) }) });
|