@actioneer/ads 0.5.9 → 0.6.0

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.
@@ -1,13 +1,14 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import * as l from "react";
4
- import { cn as n } from "../lib/cn.js";
5
- const s = l.forwardRef(
6
- ({ className: e, ...a }, r) => /* @__PURE__ */ o(
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { cn as o } from "../lib/cn.js";
5
+ const l = n.forwardRef(
6
+ ({ className: e, ...a }, r) => /* @__PURE__ */ t(
7
7
  "div",
8
8
  {
9
9
  ref: r,
10
- className: n(
10
+ "data-slot": "panel",
11
+ className: o(
11
12
  // Static surface — delineated by color alone (elevation is reserved for
12
13
  // actionable surfaces).
13
14
  "flex min-h-0 min-w-0 flex-col overflow-hidden rounded-lg bg-card",
@@ -17,55 +18,57 @@ const s = l.forwardRef(
17
18
  }
18
19
  )
19
20
  );
20
- s.displayName = "Panel";
21
- const t = l.forwardRef(
22
- ({ className: e, ...a }, r) => /* @__PURE__ */ o(
21
+ l.displayName = "Panel";
22
+ const s = n.forwardRef(
23
+ ({ className: e, ...a }, r) => /* @__PURE__ */ t(
23
24
  "div",
24
25
  {
25
26
  ref: r,
26
- className: n(
27
- "flex h-[var(--panel-header-height)] shrink-0 items-center justify-between gap-2",
28
- "border-b border-border bg-card px-3",
27
+ className: o(
28
+ "relative flex h-[var(--panel-header-height)] shrink-0 items-center justify-between gap-2",
29
+ "border-b-0 bg-card px-3",
30
+ "after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-px",
31
+ "after:bg-[linear-gradient(to_right,var(--color-border)_0%,transparent_100%)] after:content-['']",
29
32
  e
30
33
  ),
31
34
  ...a
32
35
  }
33
36
  )
34
37
  );
35
- t.displayName = "PanelHeader";
36
- const d = l.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ o(
38
+ s.displayName = "PanelHeader";
39
+ const i = n.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ t(
37
40
  "h2",
38
41
  {
39
42
  ref: r,
40
- className: n("flex min-w-0 items-center gap-2 truncate text-xs font-medium text-foreground", e),
43
+ className: o("flex min-w-0 items-center gap-2 truncate text-xs font-medium text-foreground", e),
41
44
  ...a
42
45
  }
43
46
  ));
44
- d.displayName = "PanelTitle";
45
- const i = l.forwardRef(
46
- ({ className: e, ...a }, r) => /* @__PURE__ */ o("div", { ref: r, className: n("flex shrink-0 items-center gap-1", e), ...a })
47
+ i.displayName = "PanelTitle";
48
+ const d = n.forwardRef(
49
+ ({ className: e, ...a }, r) => /* @__PURE__ */ t("div", { ref: r, className: o("flex shrink-0 items-center gap-1", e), ...a })
47
50
  );
48
- i.displayName = "PanelToolbar";
49
- const f = l.forwardRef(
50
- ({ className: e, ...a }, r) => /* @__PURE__ */ o("div", { ref: r, tabIndex: 0, className: n("min-h-0 flex-1 overflow-auto p-4", e), ...a })
51
+ d.displayName = "PanelToolbar";
52
+ const f = n.forwardRef(
53
+ ({ className: e, ...a }, r) => /* @__PURE__ */ t("div", { ref: r, tabIndex: 0, className: o("min-h-0 flex-1 overflow-auto p-4", e), ...a })
51
54
  );
52
55
  f.displayName = "PanelBody";
53
- const m = l.forwardRef(
54
- ({ className: e, ...a }, r) => /* @__PURE__ */ o(
56
+ const m = n.forwardRef(
57
+ ({ className: e, ...a }, r) => /* @__PURE__ */ t(
55
58
  "div",
56
59
  {
57
60
  ref: r,
58
- className: n("flex shrink-0 items-center gap-2 bg-surface/40 px-3 py-2", e),
61
+ className: o("flex shrink-0 items-center gap-2 bg-surface/40 px-3 py-2", e),
59
62
  ...a
60
63
  }
61
64
  )
62
65
  );
63
66
  m.displayName = "PanelFooter";
64
67
  export {
65
- s as Panel,
68
+ l as Panel,
66
69
  f as PanelBody,
67
70
  m as PanelFooter,
68
- t as PanelHeader,
69
- d as PanelTitle,
70
- i as PanelToolbar
71
+ s as PanelHeader,
72
+ i as PanelTitle,
73
+ d as PanelToolbar
71
74
  };
@@ -93,7 +93,7 @@ const O = $("inline-flex", {
93
93
  }
94
94
  },
95
95
  compoundVariants: [
96
- // Track radius follows control size: compact = 4px, standard = 8px.
96
+ // Track radius follows control size: compact = 4px, standard = 6px.
97
97
  { variant: "primary", size: "sm", className: "rounded-sm" },
98
98
  { variant: "primary", size: "md", className: "rounded-md" },
99
99
  { variant: "primary", size: "lg", className: "rounded-md" },
@@ -1,91 +1,119 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as h, Fragment as y } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as i, Fragment as T } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import { MotionConfig as M, AnimatePresence as _, motion as z } from "motion/react";
5
- import { cn as a } from "../lib/cn.js";
6
- import { ChevronRight as D, FileText as S } from "../lib/icons.js";
7
- import { springDisclosure as V } from "../lib/motion.js";
8
- const W = t.forwardRef(({ className: s, ...c }, d) => /* @__PURE__ */ e(
4
+ import { MotionConfig as _, AnimatePresence as $, motion as D } from "motion/react";
5
+ import { cn as d } from "../lib/cn.js";
6
+ import { ChevronRight as V, FileText as W } from "../lib/icons.js";
7
+ import { springDisclosure as q } from "../lib/motion.js";
8
+ const B = t.forwardRef(({ className: f, ...o }, m) => /* @__PURE__ */ e(
9
9
  "div",
10
10
  {
11
- ref: d,
11
+ ref: m,
12
12
  role: "tree",
13
- className: a("flex flex-col gap-0.5 text-xs", s),
14
- ...c
13
+ className: d("flex flex-col gap-0.5 text-xs", f),
14
+ ...o
15
15
  }
16
16
  ));
17
- W.displayName = "Tree";
18
- const q = t.forwardRef(
17
+ B.displayName = "Tree";
18
+ const E = t.forwardRef(
19
19
  ({
20
- className: s,
21
- label: c,
22
- icon: d,
23
- count: p,
24
- endContent: N,
25
- defaultExpanded: w = !1,
26
- expanded: x,
27
- onExpandedChange: f,
28
- href: g,
29
- isActive: o,
30
- onSelect: C,
31
- children: n,
32
- ...I
33
- }, k) => {
34
- const r = t.Children.count(n) > 0, v = x !== void 0, [T, R] = t.useState(w), i = v ? x : T, j = (l) => {
35
- v || R(l), f == null || f(l);
36
- }, m = a(
37
- "flex h-9 w-full items-center gap-2 rounded-md px-2 text-left",
20
+ className: f,
21
+ label: o,
22
+ icon: m,
23
+ count: g,
24
+ endContent: x,
25
+ defaultExpanded: R = !1,
26
+ expanded: v,
27
+ onExpandedChange: u,
28
+ href: y,
29
+ isActive: s,
30
+ onSelect: b,
31
+ children: l,
32
+ ...j
33
+ }, z) => {
34
+ const n = t.Children.count(l) > 0, N = v !== void 0, [F, M] = t.useState(R), r = N ? v : F, w = (c) => {
35
+ N || M(c), u == null || u(c);
36
+ }, a = d(
37
+ "flex h-9 w-full items-center gap-1.5 rounded-md px-2 text-left",
38
38
  "outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring",
39
39
  "[&_svg]:size-4 [&_svg]:shrink-0",
40
- o ? "bg-fill font-normal text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
41
- ), u = d ?? (r ? null : /* @__PURE__ */ e(S, { className: "text-tertiary" })), F = o && t.isValidElement(u) ? t.cloneElement(
42
- u,
40
+ s ? "bg-fill font-normal text-foreground" : "text-muted-foreground hover:bg-fill/60 hover:text-foreground"
41
+ ), h = m ?? (n ? null : /* @__PURE__ */ e(W, { className: "text-tertiary" })), C = s && t.isValidElement(h) ? t.cloneElement(
42
+ h,
43
43
  { weight: "fill" }
44
- ) : u, b = /* @__PURE__ */ h(y, { children: [
45
- F,
46
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: c }),
47
- N,
48
- r && /* @__PURE__ */ h(y, { children: [
49
- (p ?? t.Children.count(n)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: p ?? t.Children.count(n) }),
44
+ ) : h, k = /* @__PURE__ */ e(
45
+ V,
46
+ {
47
+ className: d(
48
+ "text-muted-foreground transition-transform duration-150 motion-reduce:transition-none",
49
+ r && "rotate-90"
50
+ ),
51
+ strokeWidth: 2
52
+ }
53
+ ), I = (g ?? t.Children.count(l)) > 0 && /* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums text-xs text-tertiary", children: g ?? t.Children.count(l) }), p = /* @__PURE__ */ i(T, { children: [
54
+ C,
55
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: o }),
56
+ x,
57
+ n && /* @__PURE__ */ i(T, { children: [
58
+ I,
59
+ k
60
+ ] })
61
+ ] });
62
+ return /* @__PURE__ */ i("div", { ref: z, role: "treeitem", "aria-expanded": n ? r : void 0, "aria-selected": s, className: f, ...j, children: [
63
+ n && b ? /* @__PURE__ */ i("div", { className: a, children: [
64
+ /* @__PURE__ */ i(
65
+ "button",
66
+ {
67
+ type: "button",
68
+ className: "flex min-w-0 flex-1 items-center gap-1.5 rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring",
69
+ onClick: b,
70
+ children: [
71
+ C,
72
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: o })
73
+ ]
74
+ }
75
+ ),
76
+ x,
77
+ I,
50
78
  /* @__PURE__ */ e(
51
- D,
79
+ "button",
52
80
  {
53
- className: a(
54
- "text-muted-foreground transition-transform duration-150 motion-reduce:transition-none",
55
- i && "rotate-90"
56
- ),
57
- strokeWidth: 2
81
+ type: "button",
82
+ "aria-label": `${r ? "Collapse" : "Expand"} ${typeof o == "string" ? o : "tree item"}`,
83
+ "aria-expanded": r,
84
+ className: "inline-flex size-7 shrink-0 items-center justify-center rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring",
85
+ onClick: () => w(!r),
86
+ children: k
58
87
  }
59
88
  )
60
- ] })
61
- ] });
62
- return /* @__PURE__ */ h("div", { ref: k, role: "treeitem", "aria-expanded": r ? i : void 0, "aria-selected": o, className: s, ...I, children: [
63
- r ? /* @__PURE__ */ e("button", { type: "button", className: m, onClick: () => j(!i), children: b }) : g ? /* @__PURE__ */ e("a", { href: g, className: m, "aria-current": o ? "page" : void 0, children: b }) : /* @__PURE__ */ e("button", { type: "button", className: m, onClick: C, children: b }),
64
- /* @__PURE__ */ e(M, { reducedMotion: "user", children: /* @__PURE__ */ e(_, { initial: !1, children: r && i && /* @__PURE__ */ e(
65
- z.div,
89
+ ] }) : n ? /* @__PURE__ */ e("button", { type: "button", className: a, onClick: () => w(!r), children: p }) : y ? /* @__PURE__ */ e("a", { href: y, className: a, "aria-current": s ? "page" : void 0, children: p }) : /* @__PURE__ */ e("button", { type: "button", className: a, onClick: b, children: p }),
90
+ /* @__PURE__ */ e(_, { reducedMotion: "user", children: /* @__PURE__ */ e($, { initial: !1, children: n && r && /* @__PURE__ */ e(
91
+ D.div,
66
92
  {
67
93
  role: "group",
68
94
  initial: { height: 0, opacity: 0, y: -4 },
69
95
  animate: { height: "auto", opacity: 1, y: 0 },
70
96
  exit: { height: 0, opacity: 0, y: -4 },
71
- transition: V,
97
+ transition: q,
72
98
  className: "ml-4 flex flex-col gap-0.5 overflow-hidden",
73
- children: t.Children.map(n, (l) => /* @__PURE__ */ e(
99
+ children: t.Children.map(l, (c) => /* @__PURE__ */ e(
74
100
  "div",
75
101
  {
76
- className: a(
102
+ className: d(
77
103
  "relative ps-5",
78
104
  // Continuous vertical rail — a straight line (no radius) so it
79
105
  // never breaks between children. The LAST child needs no rail
80
106
  // at all: the elbow's own left border draws its final vertical
81
107
  // segment, so a rail there would poke through the curve.
82
- "before:absolute before:left-0 before:top-0 before:bottom-0 before:border-l before:border-border before:content-['']",
108
+ // Extend through the group's 2px row gap so the shared
109
+ // spine remains visually continuous between elbows.
110
+ "before:absolute before:left-0 before:top-0 before:-bottom-0.5 before:border-l before:border-border before:content-['']",
83
111
  "last:before:hidden",
84
112
  // Rounded elbow branching off the rail to this child. Its own
85
113
  // left border overlaps the rail, so the curve reads cleanly.
86
114
  "after:absolute after:left-0 after:top-0 after:h-4 after:w-4 after:rounded-bl-[9px] after:border-b after:border-l after:border-border after:content-['']"
87
115
  ),
88
- children: l
116
+ children: c
89
117
  }
90
118
  ))
91
119
  }
@@ -93,8 +121,8 @@ const q = t.forwardRef(
93
121
  ] });
94
122
  }
95
123
  );
96
- q.displayName = "TreeItem";
124
+ E.displayName = "TreeItem";
97
125
  export {
98
- W as Tree,
99
- q as TreeItem
126
+ B as Tree,
127
+ E as TreeItem
100
128
  };