@actioneer/ads 0.5.8 → 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.
Files changed (40) hide show
  1. package/components/assistant-ui/composer-harness.js +12 -10
  2. package/components/avatar.d.ts +1 -0
  3. package/components/avatar.js +5 -4
  4. package/components/breadcrumbs.d.ts +3 -1
  5. package/components/breadcrumbs.js +62 -56
  6. package/components/button.js +11 -11
  7. package/components/card.js +19 -18
  8. package/components/chart.d.ts +6 -0
  9. package/components/chart.js +747 -657
  10. package/components/date-range-picker.d.ts +25 -0
  11. package/components/date-range-picker.js +187 -0
  12. package/components/drawer.d.ts +3 -1
  13. package/components/drawer.js +115 -95
  14. package/components/index.d.ts +1 -0
  15. package/components/index.js +499 -497
  16. package/components/modal.d.ts +5 -1
  17. package/components/modal.js +74 -61
  18. package/components/panel.js +31 -28
  19. package/components/pixel-icon.d.ts +4 -0
  20. package/components/pixel-icon.js +210 -163
  21. package/components/segmented.d.ts +1 -0
  22. package/components/segmented.js +31 -28
  23. package/components/select.d.ts +5 -0
  24. package/components/select.js +177 -132
  25. package/components/table.d.ts +7 -0
  26. package/components/table.js +183 -173
  27. package/components/tabs.js +1 -1
  28. package/components/tree.js +86 -58
  29. package/components/viz-charts.js +186 -183
  30. package/demo/components/add-to-artifact.js +131 -107
  31. package/demo/lib/artifact-library.js +37 -29
  32. package/demo/lib/artifact-pin-guard.js +12 -0
  33. package/fonts.css +2 -0
  34. package/lib/icons.d.ts +20 -0
  35. package/lib/icons.js +112 -107
  36. package/llms.txt +23 -3
  37. package/manifest.json +13774 -14
  38. package/package.json +4 -1
  39. package/styles.css +76 -60
  40. package/theme.css +70 -57
@@ -8,8 +8,12 @@ export interface ModalProps extends VariantProps<typeof panelVariants> {
8
8
  onOpenChange: (open: boolean) => void;
9
9
  className?: string;
10
10
  children: React.ReactNode;
11
+ showCloseButton?: boolean;
12
+ "aria-label"?: string;
13
+ "aria-labelledby"?: string;
14
+ "aria-describedby"?: string;
11
15
  }
12
- export declare function Modal({ open, onOpenChange, size, className, children }: ModalProps): React.ReactPortal;
16
+ export declare function Modal({ open, onOpenChange, size, className, children, showCloseButton, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ModalProps): React.ReactPortal;
13
17
  export declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
18
  export declare const ModalTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
15
19
  export declare const ModalDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
3
- import * as i from "react";
4
- import { createPortal as R } from "react-dom";
5
- import { MotionConfig as E, AnimatePresence as A, motion as h } from "motion/react";
6
- import { Close as D } from "../lib/icons.js";
7
- import { cva as F } from "class-variance-authority";
8
- import { cn as a } from "../lib/cn.js";
9
- import { backdropVariants as j, modalPanelVariants as z } from "../lib/motion.js";
10
- import { Ripple as P } from "./ripple.js";
11
- const T = F(
2
+ import { jsx as a, jsxs as y } from "react/jsx-runtime";
3
+ import * as n from "react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { MotionConfig as j, AnimatePresence as z, motion as h } from "motion/react";
6
+ import { Close as P } from "../lib/icons.js";
7
+ import { cva as T } from "class-variance-authority";
8
+ import { cn as i } from "../lib/cn.js";
9
+ import { backdropVariants as V, modalPanelVariants as H } from "../lib/motion.js";
10
+ import { Ripple as L } from "./ripple.js";
11
+ const q = T(
12
12
  [
13
13
  "relative flex w-full flex-col",
14
14
  // Cap height to the viewport and clip, so a tall modal scrolls its body
@@ -29,57 +29,67 @@ const T = F(
29
29
  defaultVariants: { size: "md" }
30
30
  }
31
31
  );
32
- function U({ open: o, onOpenChange: t, size: r, className: g, children: w }) {
33
- const d = i.useRef(null), f = i.useRef(null), u = i.useRef(null);
34
- return i.useEffect(() => {
32
+ function Z({
33
+ open: o,
34
+ onOpenChange: t,
35
+ size: r,
36
+ className: g,
37
+ children: w,
38
+ showCloseButton: M = !0,
39
+ "aria-label": N,
40
+ "aria-labelledby": k,
41
+ "aria-describedby": R
42
+ }) {
43
+ const d = n.useRef(null), f = n.useRef(null), u = n.useRef(null);
44
+ return n.useEffect(() => {
35
45
  if (!o) return;
36
46
  u.current = document.activeElement;
37
- const M = document.body.style.overflow;
47
+ const E = document.body.style.overflow;
38
48
  document.body.style.overflow = "hidden";
39
49
  const m = f.current, p = [];
40
50
  if (m)
41
51
  for (const e of Array.from(document.body.children))
42
52
  e !== m && e instanceof HTMLElement && !e.inert && (e.inert = !0, p.push(e));
43
- const N = () => {
53
+ const A = () => {
44
54
  var e;
45
55
  return Array.from(
46
56
  ((e = d.current) == null ? void 0 : e.querySelectorAll(
47
57
  'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])'
48
58
  )) ?? []
49
59
  );
50
- }, x = (e) => {
60
+ }, b = (e) => {
51
61
  if (e.key === "Escape") {
52
62
  e.stopPropagation(), t(!1);
53
63
  return;
54
64
  }
55
65
  if (e.key !== "Tab") return;
56
- const s = d.current;
57
- if (!s) return;
58
- const l = N();
59
- if (l.length === 0) {
60
- e.preventDefault(), s.focus();
66
+ const l = d.current;
67
+ if (!l) return;
68
+ const s = A();
69
+ if (s.length === 0) {
70
+ e.preventDefault(), l.focus();
61
71
  return;
62
72
  }
63
- const v = l[0], b = l[l.length - 1], c = document.activeElement;
64
- e.shiftKey ? (c === v || c === s) && (e.preventDefault(), b.focus()) : c === b && (e.preventDefault(), v.focus());
73
+ const x = s[0], v = s[s.length - 1], c = document.activeElement;
74
+ e.shiftKey ? (c === x || c === l) && (e.preventDefault(), v.focus()) : c === v && (e.preventDefault(), x.focus());
65
75
  };
66
- document.addEventListener("keydown", x);
67
- const k = requestAnimationFrame(() => {
76
+ document.addEventListener("keydown", b);
77
+ const D = requestAnimationFrame(() => {
68
78
  var e;
69
79
  (e = d.current) == null || e.focus();
70
80
  });
71
81
  return () => {
72
- var e, s;
73
- document.removeEventListener("keydown", x), document.body.style.overflow = M;
74
- for (const l of p) l.inert = !1;
75
- cancelAnimationFrame(k), (s = (e = u.current) == null ? void 0 : e.focus) == null || s.call(e);
82
+ var e, l;
83
+ document.removeEventListener("keydown", b), document.body.style.overflow = E;
84
+ for (const s of p) s.inert = !1;
85
+ cancelAnimationFrame(D), (l = (e = u.current) == null ? void 0 : e.focus) == null || l.call(e);
76
86
  };
77
- }, [o, t]), R(
78
- /* @__PURE__ */ n(E, { reducedMotion: "user", children: /* @__PURE__ */ n(A, { children: o && /* @__PURE__ */ y("div", { ref: f, className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
79
- /* @__PURE__ */ n(
87
+ }, [o, t]), F(
88
+ /* @__PURE__ */ a(j, { reducedMotion: "user", children: /* @__PURE__ */ a(z, { children: o && /* @__PURE__ */ y("div", { ref: f, className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
89
+ /* @__PURE__ */ a(
80
90
  h.div,
81
91
  {
82
- variants: j,
92
+ variants: V,
83
93
  initial: "hidden",
84
94
  animate: "visible",
85
95
  exit: "hidden",
@@ -93,23 +103,26 @@ function U({ open: o, onOpenChange: t, size: r, className: g, children: w }) {
93
103
  h.div,
94
104
  {
95
105
  ref: d,
96
- variants: z,
106
+ variants: H,
97
107
  initial: "hidden",
98
108
  animate: "visible",
99
109
  exit: "hidden",
100
110
  role: "dialog",
101
111
  "aria-modal": "true",
112
+ "aria-label": N,
113
+ "aria-labelledby": k,
114
+ "aria-describedby": R,
102
115
  tabIndex: -1,
103
- className: a(T({ size: r }), "relative outline-none", g),
116
+ className: i(q({ size: r }), "relative outline-none", g),
104
117
  children: [
105
- /* @__PURE__ */ n(P, { origin: "center" }),
106
- /* @__PURE__ */ n(
118
+ /* @__PURE__ */ a(L, { origin: "center" }),
119
+ M ? /* @__PURE__ */ a(
107
120
  "button",
108
121
  {
109
122
  type: "button",
110
123
  onClick: () => t(!1),
111
124
  "aria-label": "Close",
112
- className: a(
125
+ className: i(
113
126
  "absolute right-4 top-4 inline-flex size-8 items-center justify-center",
114
127
  "rounded-sm text-muted-foreground",
115
128
  "transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none hover:bg-muted hover:text-foreground",
@@ -117,9 +130,9 @@ function U({ open: o, onOpenChange: t, size: r, className: g, children: w }) {
117
130
  "outline-none focus-visible:ring-3 focus-visible:ring-ring",
118
131
  "[&_svg]:size-4 [&_svg]:shrink-0"
119
132
  ),
120
- children: /* @__PURE__ */ n(D, { "aria-hidden": !0 })
133
+ children: /* @__PURE__ */ a(P, { "aria-hidden": !0 })
121
134
  }
122
- ),
135
+ ) : null,
123
136
  w
124
137
  ]
125
138
  },
@@ -129,62 +142,62 @@ function U({ open: o, onOpenChange: t, size: r, className: g, children: w }) {
129
142
  document.body
130
143
  );
131
144
  }
132
- const V = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
145
+ const B = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
133
146
  "div",
134
147
  {
135
148
  ref: r,
136
- className: a("flex shrink-0 flex-col gap-1 px-6 pt-6 pr-14", o),
149
+ className: i("flex shrink-0 flex-col gap-1 px-6 pt-6 pr-14", o),
137
150
  ...t
138
151
  }
139
152
  ));
140
- V.displayName = "ModalHeader";
141
- const H = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
153
+ B.displayName = "ModalHeader";
154
+ const C = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
142
155
  "h2",
143
156
  {
144
157
  ref: r,
145
- className: a("text-lg font-medium text-foreground", o),
158
+ className: i("text-lg font-medium text-foreground", o),
146
159
  ...t
147
160
  }
148
161
  ));
149
- H.displayName = "ModalTitle";
150
- const L = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
162
+ C.displayName = "ModalTitle";
163
+ const K = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
151
164
  "p",
152
165
  {
153
166
  ref: r,
154
- className: a("text-xs text-muted-foreground", o),
167
+ className: i("text-xs text-muted-foreground", o),
155
168
  ...t
156
169
  }
157
170
  ));
158
- L.displayName = "ModalDescription";
159
- const q = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
171
+ K.displayName = "ModalDescription";
172
+ const _ = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
160
173
  "div",
161
174
  {
162
175
  ref: r,
163
- className: a(
176
+ className: i(
164
177
  "min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-4 text-xs text-foreground",
165
178
  o
166
179
  ),
167
180
  ...t
168
181
  }
169
182
  ));
170
- q.displayName = "ModalBody";
171
- const B = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ n(
183
+ _.displayName = "ModalBody";
184
+ const I = n.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
172
185
  "div",
173
186
  {
174
187
  ref: r,
175
- className: a(
188
+ className: i(
176
189
  "flex shrink-0 items-center justify-end gap-2 px-6 pb-6 pt-2",
177
190
  o
178
191
  ),
179
192
  ...t
180
193
  }
181
194
  ));
182
- B.displayName = "ModalFooter";
195
+ I.displayName = "ModalFooter";
183
196
  export {
184
- U as Modal,
185
- q as ModalBody,
186
- L as ModalDescription,
187
- B as ModalFooter,
188
- V as ModalHeader,
189
- H as ModalTitle
197
+ Z as Modal,
198
+ _ as ModalBody,
199
+ K as ModalDescription,
200
+ I as ModalFooter,
201
+ B as ModalHeader,
202
+ C as ModalTitle
190
203
  };
@@ -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
  };
@@ -22,6 +22,10 @@ export interface PixelIconProps extends React.HTMLAttributes<HTMLSpanElement> {
22
22
  motionMode?: number;
23
23
  /** Optional hover/click accent. Defaults to the standard green interaction color. */
24
24
  interactionColor?: string;
25
+ /** Optional 1–10 color ramp. Short ramps repeat to fill the ten tile shades. */
26
+ palette?: readonly string[];
27
+ /** Whether interaction is limited to filled tiles or spans the whole icon surface. */
28
+ interactionArea?: "tiles" | "surface";
25
29
  /** Larger hero rendering (broader hatch, mode 3). */
26
30
  hero?: boolean;
27
31
  }