@actioneer/ads 0.5.8 → 0.5.9

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,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  declare const sizeClasses: {
3
+ readonly xs: "size-5 text-[10px]";
3
4
  readonly sm: "size-8 text-xs";
4
5
  readonly md: "size-10 text-xs";
5
6
  readonly lg: "size-12 text-base";
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
+ import { jsx as n, jsxs as b } from "react/jsx-runtime";
3
3
  import * as f from "react";
4
4
  import { cn as i } from "../lib/cn.js";
5
5
  const g = {
6
+ xs: "size-5 text-[10px]",
6
7
  sm: "size-8 text-xs",
7
8
  md: "size-10 text-xs",
8
9
  lg: "size-12 text-base",
@@ -62,21 +63,21 @@ N.displayName = "Avatar";
62
63
  const y = f.forwardRef(
63
64
  ({ className: r, max: e, size: t = "md", radius: s = "full", children: o, ...a }, c) => {
64
65
  const l = f.Children.toArray(o), d = typeof e == "number" ? l.length - e : 0, p = typeof e == "number" ? l.slice(0, e) : l;
65
- return /* @__PURE__ */ x(
66
+ return /* @__PURE__ */ b(
66
67
  "div",
67
68
  {
68
69
  ref: c,
69
70
  className: i("flex items-center", r),
70
71
  ...a,
71
72
  children: [
72
- p.map((b, u) => /* @__PURE__ */ n(
73
+ p.map((x, u) => /* @__PURE__ */ n(
73
74
  "div",
74
75
  {
75
76
  className: i(
76
77
  "ring-2 ring-background rounded-full",
77
78
  u > 0 && "-ml-2"
78
79
  ),
79
- children: b
80
+ children: x
80
81
  },
81
82
  u
82
83
  )),
@@ -18,6 +18,8 @@ export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
18
18
  * overflow menu) — they ride along when the trail is sticky.
19
19
  */
20
20
  actions?: React.ReactNode;
21
+ /** Controls pinned to the true horizontal center of the trail row. */
22
+ center?: React.ReactNode;
21
23
  /**
22
24
  * Supporting metadata stitched inline right after the trail (schema name,
23
25
  * sync status…). Muted, truncates before the trail does.
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as v, jsx as e, Fragment as k } from "react/jsx-runtime";
2
+ import { jsxs as h, jsx as e, Fragment as B } from "react/jsx-runtime";
3
3
  import * as t from "react";
4
- import { ArrowLeft as B } from "../lib/icons.js";
5
- import { cn as a } from "../lib/cn.js";
6
- const N = t.createContext({
4
+ import { ArrowLeft as y } from "../lib/icons.js";
5
+ import { cn as c } from "../lib/cn.js";
6
+ const w = t.createContext({
7
7
  count: 0
8
- }), w = t.createContext(0);
8
+ }), C = t.createContext(0);
9
9
  function R(s) {
10
10
  let n = (s == null ? void 0 : s.parentElement) ?? null;
11
11
  for (; n; ) {
@@ -15,35 +15,36 @@ function R(s) {
15
15
  }
16
16
  return null;
17
17
  }
18
- const y = t.forwardRef(
18
+ const z = t.forwardRef(
19
19
  ({
20
20
  className: s,
21
21
  children: n,
22
22
  sticky: r,
23
- onBack: c,
24
- backLabel: g = "Back",
23
+ onBack: u,
24
+ backLabel: x = "Back",
25
25
  actions: m,
26
- meta: f,
27
- ...p
28
- }, i) => {
29
- const b = t.Children.toArray(n), l = t.useRef(null), u = t.useCallback(
26
+ center: f,
27
+ meta: b,
28
+ ...v
29
+ }, l) => {
30
+ const a = t.Children.toArray(n), i = t.useRef(null), p = t.useCallback(
30
31
  (o) => {
31
- l.current = o, typeof i == "function" ? i(o) : i && (i.current = o);
32
+ i.current = o, typeof l == "function" ? l(o) : l && (l.current = o);
32
33
  },
33
- [i]
34
- ), [x, C] = t.useState(!1);
34
+ [l]
35
+ ), [N, k] = t.useState(!1);
35
36
  return t.useEffect(() => {
36
37
  if (!r) return;
37
- const o = R(l.current), d = o ?? window, h = () => C((o ? o.scrollTop : window.scrollY) > 2);
38
- return h(), d.addEventListener("scroll", h, { passive: !0 }), () => d.removeEventListener("scroll", h);
39
- }, [r]), /* @__PURE__ */ v(
38
+ const o = R(i.current), d = o ?? window, g = () => k((o ? o.scrollTop : window.scrollY) > 2);
39
+ return g(), d.addEventListener("scroll", g, { passive: !0 }), () => d.removeEventListener("scroll", g);
40
+ }, [r]), /* @__PURE__ */ h(
40
41
  "nav",
41
42
  {
42
- ref: u,
43
+ ref: p,
43
44
  "aria-label": "Breadcrumb",
44
- "data-stuck": r ? x ? "true" : "false" : void 0,
45
- className: a(
46
- "flex w-full items-center",
45
+ "data-stuck": r ? N ? "true" : "false" : void 0,
46
+ className: c(
47
+ "relative flex w-full items-center",
47
48
  r && "sticky top-0 z-40 bg-background transition-[border-color] duration-150 ease-out motion-reduce:transition-none",
48
49
  // Sticky offsets resolve against the scrollport's PADDING box, so in
49
50
  // a padded panel the pinned trail sits below a strip the content
@@ -51,66 +52,67 @@ const y = t.forwardRef(
51
52
  // background over that gap (a no-op at rest, where the strip is the
52
53
  // panel's empty padding).
53
54
  r && "before:absolute before:inset-x-0 before:-top-8 before:h-8 before:bg-inherit before:content-['']",
54
- r && (x ? "border-b border-border" : "border-b border-transparent"),
55
+ r && (N ? "border-b border-border" : "border-b border-transparent"),
55
56
  s
56
57
  ),
57
- ...p,
58
+ ...v,
58
59
  children: [
59
- c && /* @__PURE__ */ e(
60
+ u && /* @__PURE__ */ e(
60
61
  "button",
61
62
  {
62
63
  type: "button",
63
- onClick: c,
64
- "aria-label": g,
65
- className: a(
64
+ onClick: u,
65
+ "aria-label": x,
66
+ className: c(
66
67
  "mr-1 inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-muted-foreground",
67
68
  "transition-colors hover:bg-fill hover:text-foreground",
68
69
  "outline-none focus-visible:ring-3 focus-visible:ring-ring [&_svg]:size-4"
69
70
  ),
70
- children: /* @__PURE__ */ e(B, { "aria-hidden": !0 })
71
+ children: /* @__PURE__ */ e(y, { "aria-hidden": !0 })
71
72
  }
72
73
  ),
73
- /* @__PURE__ */ e("ol", { className: "flex min-w-0 items-center gap-1.5 text-base", children: /* @__PURE__ */ e(N.Provider, { value: { count: b.length }, children: b.map((o, d) => /* @__PURE__ */ e(w.Provider, { value: d, children: o }, d)) }) }),
74
- f && /* @__PURE__ */ e("div", { className: "ml-4 flex min-w-0 shrink items-center gap-3 text-xs text-muted-foreground", children: f }),
74
+ /* @__PURE__ */ e("ol", { className: "flex min-w-0 items-center gap-1.5 text-base", children: /* @__PURE__ */ e(w.Provider, { value: { count: a.length }, children: a.map((o, d) => /* @__PURE__ */ e(C.Provider, { value: d, children: o }, d)) }) }),
75
+ b && /* @__PURE__ */ e("div", { className: "ml-4 flex min-w-0 shrink items-center gap-3 text-xs text-muted-foreground", children: b }),
76
+ f && /* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 z-50 flex -translate-x-1/2 -translate-y-1/2 items-center", children: f }),
75
77
  m && /* @__PURE__ */ e("div", { className: "ml-auto flex shrink-0 items-center gap-2 pl-4", children: m })
76
78
  ]
77
79
  }
78
80
  );
79
81
  }
80
82
  );
81
- y.displayName = "Breadcrumbs";
82
- const E = t.forwardRef(({ className: s, href: n, isCurrent: r, icon: c, children: g, ...m }, f) => {
83
- const { count: p } = t.useContext(N), b = t.useContext(w) === p - 1, l = "inline-flex items-center gap-1.5", u = /* @__PURE__ */ v(k, { children: [
84
- c && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex shrink-0 items-center [&_svg]:size-4", children: c }),
85
- g
86
- ] }), x = r ? /* @__PURE__ */ e(
83
+ z.displayName = "Breadcrumbs";
84
+ const E = t.forwardRef(({ className: s, href: n, isCurrent: r, icon: u, children: x, ...m }, f) => {
85
+ const { count: b } = t.useContext(w), l = t.useContext(C) === b - 1, a = "inline-flex items-center gap-1.5", i = /* @__PURE__ */ h(B, { children: [
86
+ u && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "flex shrink-0 items-center [&_svg]:size-4", children: u }),
87
+ x
88
+ ] }), p = r ? /* @__PURE__ */ e(
87
89
  "span",
88
90
  {
89
91
  "aria-current": "page",
90
- className: a(l, "font-normal text-primary"),
91
- children: u
92
+ className: c(a, "font-normal text-primary"),
93
+ children: i
92
94
  }
93
95
  ) : n ? /* @__PURE__ */ e(
94
96
  "a",
95
97
  {
96
98
  href: n,
97
- className: a(
98
- l,
99
+ className: c(
100
+ a,
99
101
  "font-normal text-muted-foreground transition-colors hover:text-foreground",
100
102
  "outline-none focus-visible:ring-3 focus-visible:ring-ring rounded-sm"
101
103
  ),
102
- children: u
104
+ children: i
103
105
  }
104
- ) : /* @__PURE__ */ e("span", { className: a(l, "text-muted-foreground"), children: u });
105
- return /* @__PURE__ */ v(
106
+ ) : /* @__PURE__ */ e("span", { className: c(a, "text-muted-foreground"), children: i });
107
+ return /* @__PURE__ */ h(
106
108
  "li",
107
109
  {
108
110
  ref: f,
109
- className: a("flex items-center gap-1.5", s),
111
+ className: c("flex items-center gap-1.5", s),
110
112
  ...m,
111
113
  children: [
112
- x,
113
- !b && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "shrink-0 select-none text-border-strong", children: "/" })
114
+ p,
115
+ !l && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "shrink-0 select-none text-border-strong", children: "/" })
114
116
  ]
115
117
  }
116
118
  );
@@ -118,5 +120,5 @@ const E = t.forwardRef(({ className: s, href: n, isCurrent: r, icon: c, children
118
120
  E.displayName = "BreadcrumbItem";
119
121
  export {
120
122
  E as BreadcrumbItem,
121
- y as Breadcrumbs
123
+ z as Breadcrumbs
122
124
  };
@@ -100,6 +100,8 @@ export interface LineChartProps extends BaseChartProps {
100
100
  curve?: "linear" | "natural" | "step";
101
101
  /** Series keys that render dashed — projections, not observations. */
102
102
  forecastKeys?: string[];
103
+ /** When set, only these series keys animate on mount/update. */
104
+ animatedSeriesKeys?: string[];
103
105
  /**
104
106
  * Print each observation's value above its dot. On by default for a SINGLE
105
107
  * series (the reader shouldn't have to hover to read a number that fits);
@@ -112,6 +114,8 @@ export interface AreaChartProps extends BaseChartProps {
112
114
  stacked?: boolean;
113
115
  /** Series keys that render dashed — projections, not observations. */
114
116
  forecastKeys?: string[];
117
+ /** When set, only these series keys animate on mount/update. */
118
+ animatedSeriesKeys?: string[];
115
119
  /** Print each observation's value above its dot — see {@link LineChartProps.showValues}. */
116
120
  showValues?: boolean;
117
121
  }
@@ -130,6 +134,8 @@ export interface ComboChartProps extends BaseChartProps {
130
134
  stacked?: boolean;
131
135
  /** Line keys that render dashed — projections, not observations. */
132
136
  forecastKeys?: string[];
137
+ /** When set, only these series keys animate on mount/update. */
138
+ animatedSeriesKeys?: string[];
133
139
  }
134
140
  export type ComposedChartProps = ComboChartProps;
135
141
  export interface PieChartProps {