@actioneer/ads 0.7.0 → 0.8.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.
@@ -4,12 +4,9 @@ declare const panelVariants: (props?: ({
4
4
  side?: "bottom" | "left" | "right" | null | undefined;
5
5
  size?: "xl" | "sm" | "md" | "lg" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
- export type DrawerAppearance = "flat" | "floating";
8
7
  export interface DrawerProps extends VariantProps<typeof panelVariants> {
9
8
  open: boolean;
10
9
  onOpenChange: (open: boolean) => void;
11
- /** Flat joins a canvas layout; floating adds an NG3 stroke and shadow 400. */
12
- appearance?: DrawerAppearance;
13
10
  /** Whether Escape and the built-in close button can dismiss the drawer. */
14
11
  dismissible?: boolean;
15
12
  /** Accessible label for the drawer landmark. */
@@ -60,18 +57,9 @@ export declare function ModalDrawer({ open, onOpenChange, side: sideProp, size,
60
57
  *
61
58
  * This mirrors the shell's main + chat layout — white panels on the canvas.
62
59
  * If the panel doesn't read, fix the ground; never add a border or shadow to
63
- * force it (that fights principle 1). Use `FloatingDrawer` when the surface is
64
- * intentionally inset and should read as an elevated utility panel.
60
+ * force it (that fights principle 1).
65
61
  */
66
- export declare function Drawer({ open, onOpenChange, appearance, dismissible, side: sideProp, size, containerClassName, className, children, "aria-label": ariaLabel, }: DrawerProps): React.JSX.Element;
67
- export type FloatingDrawerProps = Omit<DrawerProps, "appearance">;
68
- /**
69
- * FloatingDrawer — an inset utility drawer with a card surface, NG3 stroke,
70
- * and shadow 400. It keeps the Drawer interaction and motion model while
71
- * providing the elevated treatment used for chat history, section trees, and
72
- * property inspectors.
73
- */
74
- export declare function FloatingDrawer(props: FloatingDrawerProps): React.JSX.Element;
62
+ export declare function Drawer({ open, onOpenChange, dismissible, side: sideProp, size, containerClassName, className, children, "aria-label": ariaLabel, }: DrawerProps): React.JSX.Element;
75
63
  /** @deprecated Alias for `Drawer` — the canonical drawer is now the inline
76
64
  * variant. Kept for any code still importing `InlineDrawer`. */
77
65
  export declare const InlineDrawer: typeof Drawer;
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as i, jsxs as y } from "react/jsx-runtime";
3
- import * as s from "react";
4
- import { createPortal as R } from "react-dom";
5
- import { MotionConfig as z, AnimatePresence as D, motion as g } from "motion/react";
6
- import { Close as j } from "../lib/icons.js";
7
- import { cva as F } from "class-variance-authority";
3
+ import * as a from "react";
4
+ import { createPortal as E } from "react-dom";
5
+ import { MotionConfig as z, AnimatePresence as N, motion as w } from "motion/react";
6
+ import { Close as R } from "../lib/icons.js";
7
+ import { cva as j } from "class-variance-authority";
8
8
  import { cn as n } from "../lib/cn.js";
9
- import { springSheet as l, drawerOffset as v, drawerBackdropVariants as A } from "../lib/motion.js";
10
- const N = F(
9
+ import { springSheet as l, drawerOffset as h, drawerBackdropVariants as F } from "../lib/motion.js";
10
+ const k = j(
11
11
  [
12
12
  "relative flex flex-col",
13
13
  "bg-elevated text-foreground",
@@ -43,25 +43,25 @@ const N = F(
43
43
  ],
44
44
  defaultVariants: { side: "right", size: "md" }
45
45
  }
46
- ), B = {
46
+ ), A = {
47
47
  right: "justify-end items-stretch",
48
48
  left: "justify-start items-stretch",
49
49
  bottom: "justify-center items-end"
50
- }, L = {
50
+ }, B = {
51
51
  sm: "25%",
52
52
  md: "33.333333%",
53
53
  lg: "50%",
54
54
  xl: "66.666667%"
55
55
  };
56
- function k({
57
- onClick: e,
58
- className: t
56
+ function D({
57
+ onClick: t,
58
+ className: e
59
59
  }) {
60
60
  return /* @__PURE__ */ i(
61
61
  "button",
62
62
  {
63
63
  type: "button",
64
- onClick: e,
64
+ onClick: t,
65
65
  "aria-label": "Close",
66
66
  className: n(
67
67
  "absolute inline-flex size-8 items-center justify-center",
@@ -70,75 +70,75 @@ function k({
70
70
  "active:scale-[0.97] motion-reduce:active:scale-100",
71
71
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
72
72
  "[&_svg]:size-4 [&_svg]:shrink-0",
73
- t
73
+ e
74
74
  ),
75
- children: /* @__PURE__ */ i(j, { "aria-hidden": !0 })
75
+ children: /* @__PURE__ */ i(R, { "aria-hidden": !0 })
76
76
  }
77
77
  );
78
78
  }
79
79
  function G({
80
- open: e,
81
- onOpenChange: t,
82
- side: o,
83
- size: c,
84
- className: x,
85
- children: m,
86
- "aria-label": p
80
+ open: t,
81
+ onOpenChange: e,
82
+ side: r,
83
+ size: v,
84
+ className: c,
85
+ children: x,
86
+ "aria-label": g
87
87
  }) {
88
- const d = o ?? "right", f = s.useRef(null), u = s.useRef(null);
89
- return s.useEffect(() => {
90
- if (!e) return;
91
- u.current = document.activeElement;
92
- const a = document.body.style.overflow;
88
+ const d = r ?? "right", m = a.useRef(null), s = a.useRef(null);
89
+ return a.useEffect(() => {
90
+ if (!t) return;
91
+ s.current = document.activeElement;
92
+ const p = document.body.style.overflow;
93
93
  document.body.style.overflow = "hidden";
94
- const w = (r) => {
95
- r.key === "Escape" && (r.stopPropagation(), t(!1));
94
+ const f = (o) => {
95
+ o.key === "Escape" && (o.stopPropagation(), e(!1));
96
96
  };
97
- document.addEventListener("keydown", w);
98
- const b = requestAnimationFrame(() => {
99
- var r;
100
- (r = f.current) == null || r.focus();
97
+ document.addEventListener("keydown", f);
98
+ const u = requestAnimationFrame(() => {
99
+ var o;
100
+ (o = m.current) == null || o.focus();
101
101
  });
102
102
  return () => {
103
- var r, h;
104
- document.removeEventListener("keydown", w), document.body.style.overflow = a, cancelAnimationFrame(b), (h = (r = u.current) == null ? void 0 : r.focus) == null || h.call(r);
103
+ var o, b;
104
+ document.removeEventListener("keydown", f), document.body.style.overflow = p, cancelAnimationFrame(u), (b = (o = s.current) == null ? void 0 : o.focus) == null || b.call(o);
105
105
  };
106
- }, [e, t]), R(
107
- /* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(D, { children: e && /* @__PURE__ */ y("div", { className: n("fixed inset-0 z-50 flex", B[d]), children: [
106
+ }, [t, e]), E(
107
+ /* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(N, { children: t && /* @__PURE__ */ y("div", { className: n("fixed inset-0 z-50 flex", A[d]), children: [
108
108
  /* @__PURE__ */ i(
109
- g.div,
109
+ w.div,
110
110
  {
111
- variants: A,
111
+ variants: F,
112
112
  initial: "hidden",
113
113
  animate: "visible",
114
114
  exit: "hidden",
115
115
  className: "absolute inset-0 bg-overlay",
116
- onClick: () => t(!1),
116
+ onClick: () => e(!1),
117
117
  "aria-hidden": !0
118
118
  },
119
119
  "backdrop"
120
120
  ),
121
121
  /* @__PURE__ */ y(
122
- g.div,
122
+ w.div,
123
123
  {
124
- ref: f,
125
- initial: v[d],
124
+ ref: m,
125
+ initial: h[d],
126
126
  animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
127
- exit: { ...v[d], pointerEvents: "none", transition: l },
127
+ exit: { ...h[d], pointerEvents: "none", transition: l },
128
128
  role: "dialog",
129
129
  "aria-modal": "true",
130
- "aria-label": p,
130
+ "aria-label": g,
131
131
  tabIndex: -1,
132
- className: n(N({ side: d, size: c }), "relative outline-none", x),
132
+ className: n(k({ side: d, size: v }), "relative outline-none", c),
133
133
  children: [
134
134
  /* @__PURE__ */ i(
135
- k,
135
+ D,
136
136
  {
137
- onClick: () => t(!1),
137
+ onClick: () => e(!1),
138
138
  className: "right-4 top-4"
139
139
  }
140
140
  ),
141
- m
141
+ x
142
142
  ]
143
143
  },
144
144
  "panel"
@@ -147,61 +147,59 @@ function G({
147
147
  document.body
148
148
  );
149
149
  }
150
- function E({
151
- open: e,
152
- onOpenChange: t,
153
- appearance: o = "flat",
154
- dismissible: c = !0,
155
- side: x,
156
- size: m,
157
- containerClassName: p,
158
- className: d,
159
- children: f,
160
- "aria-label": u
150
+ function L({
151
+ open: t,
152
+ onOpenChange: e,
153
+ dismissible: r = !0,
154
+ side: v,
155
+ size: c,
156
+ containerClassName: x,
157
+ className: g,
158
+ children: d,
159
+ "aria-label": m
161
160
  }) {
162
- const a = x ?? "right", w = m ?? "md", b = s.useRef(null);
163
- return s.useEffect(() => {
164
- if (!e || !c) return;
165
- const r = (h) => {
166
- h.key === "Escape" && t(!1);
161
+ const s = v ?? "right", p = c ?? "md", f = a.useRef(null);
162
+ return a.useEffect(() => {
163
+ if (!t || !r) return;
164
+ const u = (o) => {
165
+ o.key === "Escape" && e(!1);
167
166
  };
168
- return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
169
- }, [e, t, c]), /* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(D, { initial: !1, children: e && /* @__PURE__ */ i(
170
- g.div,
167
+ return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
168
+ }, [t, e, r]), /* @__PURE__ */ i(z, { reducedMotion: "user", children: /* @__PURE__ */ i(N, { initial: !1, children: t && /* @__PURE__ */ i(
169
+ w.div,
171
170
  {
172
- initial: a === "bottom" ? { height: "0%" } : { width: 0 },
173
- animate: a === "bottom" ? { height: L[w], transition: l } : { width: "auto", transition: l },
174
- exit: a === "bottom" ? { height: "0%", pointerEvents: "none", transition: l } : { width: 0, pointerEvents: "none", transition: l },
171
+ initial: s === "bottom" ? { height: "0%" } : { width: 0 },
172
+ animate: s === "bottom" ? { height: B[p], transition: l } : { width: "auto", transition: l },
173
+ exit: s === "bottom" ? { height: "0%", pointerEvents: "none", transition: l } : { width: 0, pointerEvents: "none", transition: l },
175
174
  className: n(
176
175
  "shrink-0 overflow-hidden",
177
- a === "bottom" ? "w-full" : "h-full",
178
- p
176
+ s === "bottom" ? "w-full" : "h-full",
177
+ x
179
178
  ),
180
179
  children: /* @__PURE__ */ y(
181
- g.aside,
180
+ w.aside,
182
181
  {
183
- ref: b,
184
- initial: v[a],
182
+ ref: f,
183
+ initial: h[s],
185
184
  animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
186
- exit: { ...v[a], pointerEvents: "none", transition: l },
185
+ exit: { ...h[s], pointerEvents: "none", transition: l },
187
186
  role: "complementary",
188
- "aria-label": u,
187
+ "aria-label": m,
189
188
  className: n(
190
- N({ side: a, size: m }),
191
- "relative shrink-0 overflow-hidden rounded-lg bg-card outline-none",
192
- o === "floating" ? "border border-ng3 shadow-400" : "border-0 shadow-none",
193
- a === "bottom" && "h-full",
194
- d
189
+ k({ side: s, size: c }),
190
+ "relative shrink-0 overflow-hidden rounded-lg border-0 bg-card shadow-none outline-none",
191
+ s === "bottom" && "h-full",
192
+ g
195
193
  ),
196
194
  children: [
197
- c && /* @__PURE__ */ i(
198
- k,
195
+ r && /* @__PURE__ */ i(
196
+ D,
199
197
  {
200
- onClick: () => t(!1),
198
+ onClick: () => e(!1),
201
199
  className: "right-2 top-1"
202
200
  }
203
201
  ),
204
- f
202
+ d
205
203
  ]
206
204
  }
207
205
  )
@@ -209,56 +207,52 @@ function E({
209
207
  "inline-drawer-slot"
210
208
  ) }) });
211
209
  }
212
- function J(e) {
213
- return /* @__PURE__ */ i(E, { ...e, appearance: "floating" });
214
- }
215
- const Q = E, M = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ i(
210
+ const J = L, M = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
216
211
  "div",
217
212
  {
218
- ref: o,
219
- className: n("flex flex-col gap-1 px-6 py-4 pr-14", e),
220
- ...t
213
+ ref: r,
214
+ className: n("flex flex-col gap-1 px-6 py-4 pr-14", t),
215
+ ...e
221
216
  }
222
217
  ));
223
218
  M.displayName = "DrawerHeader";
224
- const V = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ i(
219
+ const V = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
225
220
  "h2",
226
221
  {
227
- ref: o,
228
- className: n("text-lg font-medium text-foreground", e),
229
- ...t
222
+ ref: r,
223
+ className: n("text-lg font-medium text-foreground", t),
224
+ ...e
230
225
  }
231
226
  ));
232
227
  V.displayName = "DrawerTitle";
233
- const I = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ i(
228
+ const I = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
234
229
  "div",
235
230
  {
236
- ref: o,
231
+ ref: r,
237
232
  tabIndex: 0,
238
- className: n("flex-1 overflow-y-auto px-6 py-4 text-xs text-foreground", e),
239
- ...t
233
+ className: n("flex-1 overflow-y-auto px-6 py-4 text-xs text-foreground", t),
234
+ ...e
240
235
  }
241
236
  ));
242
237
  I.displayName = "DrawerBody";
243
- const P = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ i(
238
+ const P = a.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ i(
244
239
  "div",
245
240
  {
246
- ref: o,
241
+ ref: r,
247
242
  className: n(
248
243
  "flex items-center justify-end gap-2 px-6 py-4",
249
- e
244
+ t
250
245
  ),
251
- ...t
246
+ ...e
252
247
  }
253
248
  ));
254
249
  P.displayName = "DrawerFooter";
255
250
  export {
256
- E as Drawer,
251
+ L as Drawer,
257
252
  I as DrawerBody,
258
253
  P as DrawerFooter,
259
254
  M as DrawerHeader,
260
255
  V as DrawerTitle,
261
- J as FloatingDrawer,
262
- Q as InlineDrawer,
256
+ J as InlineDrawer,
263
257
  G as ModalDrawer
264
258
  };
@@ -7,8 +7,8 @@ const L = i(
7
7
  // Border WIDTH only — no border-color utility. ads-interactive owns the
8
8
  // color (rest = --glow-border-rest below); a `border-input` utility here
9
9
  // would out-cascade the shared hover/focus rules.
10
- "flex w-full rounded-md border bg-elevated text-on-white-tertiary",
11
- "px-3 text-m font-medium hover:text-on-white-secondary focus:text-on-white-primary",
10
+ "flex w-full rounded-md border bg-elevated text-on-white-secondary",
11
+ "px-3 text-m font-medium focus:text-on-white-primary",
12
12
  "placeholder:text-on-white-tertiary hover:placeholder:text-on-white-secondary focus:placeholder:text-transparent",
13
13
  "outline-none",
14
14
  // Text/placeholder color changes are intentionally immediate. Interpolating
@@ -41,7 +41,7 @@ const L = i(
41
41
  }
42
42
  ));
43
43
  w.displayName = "Label";
44
- const h = a.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ l(
44
+ const y = a.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ l(
45
45
  "p",
46
46
  {
47
47
  ref: o,
@@ -49,8 +49,8 @@ const h = a.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ l(
49
49
  ...e
50
50
  }
51
51
  ));
52
- h.displayName = "FieldDescription";
53
- const y = a.forwardRef(
52
+ y.displayName = "FieldDescription";
53
+ const h = a.forwardRef(
54
54
  ({ className: r, children: e, ...o }, t) => e ? /* @__PURE__ */ l(
55
55
  "p",
56
56
  {
@@ -61,7 +61,7 @@ const y = a.forwardRef(
61
61
  }
62
62
  ) : null
63
63
  );
64
- y.displayName = "FieldError";
64
+ h.displayName = "FieldError";
65
65
  const D = a.forwardRef(
66
66
  ({ className: r, label: e, description: o, error: t, required: d, htmlFor: g, errorId: s, descriptionId: c, children: n, ...N }, F) => {
67
67
  const m = a.useId(), p = s ?? `${m}-error`, f = c ?? `${m}-description`, u = t ? p : o ? f : void 0, E = s == null && c == null;
@@ -76,15 +76,15 @@ const D = a.forwardRef(
76
76
  return /* @__PURE__ */ v("div", { ref: F, className: i("flex flex-col gap-1.5", r), ...N, children: [
77
77
  e && /* @__PURE__ */ l(w, { htmlFor: g, required: d, children: e }),
78
78
  x,
79
- t ? /* @__PURE__ */ l(y, { id: p, children: t }) : o ? /* @__PURE__ */ l(h, { id: f, children: o }) : null
79
+ t ? /* @__PURE__ */ l(h, { id: p, children: t }) : o ? /* @__PURE__ */ l(y, { id: f, children: o }) : null
80
80
  ] });
81
81
  }
82
82
  );
83
83
  D.displayName = "Field";
84
84
  export {
85
85
  D as Field,
86
- h as FieldDescription,
87
- y as FieldError,
86
+ y as FieldDescription,
87
+ h as FieldError,
88
88
  w as Label,
89
89
  L as inputBaseClass
90
90
  };