@actioneer/ads 1.0.8 → 1.0.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.
- package/DESIGN.md +42 -8
- package/README.md +16 -4
- package/components/assistant-ui/composer-harness.js +5 -4
- package/components/breadcrumbs.js +12 -12
- package/components/button.d.ts +16 -1
- package/components/button.js +7 -4
- package/components/chart.d.ts +31 -4
- package/components/chart.js +747 -572
- package/components/chip.d.ts +2 -1
- package/components/chip.js +37 -34
- package/components/filters.d.ts +37 -0
- package/components/filters.js +129 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +447 -444
- package/components/modal.d.ts +2 -1
- package/components/modal.js +101 -90
- package/components/popover.d.ts +6 -1
- package/components/popover.js +74 -64
- package/components/sidebar.d.ts +15 -0
- package/components/sidebar.js +186 -149
- package/components/table.d.ts +8 -0
- package/components/table.js +357 -350
- package/components/tabs.d.ts +6 -1
- package/components/tabs.js +28 -31
- package/demo/components/add-to-artifact.js +3 -2
- package/examples/README.md +3 -2
- package/examples/campaign-analysis-screen.tsx +138 -0
- package/examples/campaigns-screen.tsx +439 -0
- package/lib/icons.js +3 -3
- package/llms.txt +81 -17
- package/manifest.json +1601 -83
- package/package.json +1 -1
package/components/modal.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
declare const panelVariants: (props?: ({
|
|
4
4
|
size?: "xl" | "sm" | "md" | "lg" | "full" | null | undefined;
|
|
5
5
|
position?: "top" | "center" | null | undefined;
|
|
6
|
+
height?: "content" | "fixed" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export interface ModalProps extends VariantProps<typeof panelVariants> {
|
|
8
9
|
open: boolean;
|
|
@@ -34,7 +35,7 @@ export interface ModalProps extends VariantProps<typeof panelVariants> {
|
|
|
34
35
|
* outside interaction, scroll locking, and focus restoration. ADS owns the
|
|
35
36
|
* geometry, tokens, motion, and composable header/body/footer anatomy.
|
|
36
37
|
*/
|
|
37
|
-
export declare function Modal({ open, onOpenChange, size, position, className, children, showCloseButton, closeOnOverlayClick, closeOnEscape, container, initialFocusRef, onAfterClose, onAfterOpen, overlayClassName, viewportClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ModalProps): React.JSX.Element;
|
|
38
|
+
export declare function Modal({ open, onOpenChange, size, position, height, className, children, showCloseButton, closeOnOverlayClick, closeOnEscape, container, initialFocusRef, onAfterClose, onAfterOpen, overlayClassName, viewportClassName, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, }: ModalProps): React.JSX.Element;
|
|
38
39
|
export declare const ModalClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
39
40
|
export declare const ModalHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
40
41
|
export declare const ModalTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
package/components/modal.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as t, jsxs as
|
|
2
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
3
3
|
import * as r from "react";
|
|
4
|
-
import { MotionConfig as
|
|
5
|
-
import { Dialog as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { Close as
|
|
4
|
+
import { MotionConfig as B, AnimatePresence as H, motion as M } from "motion/react";
|
|
5
|
+
import { Dialog as c } from "radix-ui";
|
|
6
|
+
import { cva as S } from "class-variance-authority";
|
|
7
|
+
import { Close as K } from "../lib/icons.js";
|
|
8
8
|
import { cn as n } from "../lib/cn.js";
|
|
9
|
-
import { backdropVariants as
|
|
10
|
-
const
|
|
9
|
+
import { backdropVariants as q, modalPanelVariants as A } from "../lib/motion.js";
|
|
10
|
+
const F = S(
|
|
11
11
|
[
|
|
12
12
|
"pointer-events-auto relative flex w-full min-w-0 flex-col overflow-hidden",
|
|
13
13
|
"max-h-[calc(100dvh-2rem)] bg-elevated text-foreground outline-none",
|
|
@@ -31,58 +31,69 @@ const A = H(
|
|
|
31
31
|
position: {
|
|
32
32
|
center: "",
|
|
33
33
|
top: ""
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* `content` hugs its content (confirmations, short prompts). `fixed`
|
|
37
|
+
* keeps one stable 640px frame for create/edit forms — the header and
|
|
38
|
+
* footer stay put and ModalBody scrolls (user-mandated, 2026-10-26).
|
|
39
|
+
*/
|
|
40
|
+
height: {
|
|
41
|
+
content: "",
|
|
42
|
+
fixed: "h-[40rem]"
|
|
34
43
|
}
|
|
35
44
|
},
|
|
36
45
|
defaultVariants: {
|
|
37
46
|
size: "md",
|
|
38
|
-
position: "center"
|
|
47
|
+
position: "center",
|
|
48
|
+
height: "content"
|
|
39
49
|
}
|
|
40
50
|
}
|
|
41
|
-
),
|
|
42
|
-
function
|
|
43
|
-
return r.Children.toArray(o).some((e) => r.isValidElement(e) ? e.type ===
|
|
51
|
+
), v = r.createContext(null);
|
|
52
|
+
function w(o) {
|
|
53
|
+
return r.Children.toArray(o).some((e) => r.isValidElement(e) ? e.type === C ? !0 : w(
|
|
44
54
|
e.props.children
|
|
45
55
|
) : !1);
|
|
46
56
|
}
|
|
47
|
-
function
|
|
57
|
+
function te({
|
|
48
58
|
open: o,
|
|
49
59
|
onOpenChange: e,
|
|
50
60
|
size: a,
|
|
51
61
|
position: i,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"aria-
|
|
65
|
-
"aria-
|
|
62
|
+
height: l,
|
|
63
|
+
className: s,
|
|
64
|
+
children: m,
|
|
65
|
+
showCloseButton: D = !0,
|
|
66
|
+
closeOnOverlayClick: z = !0,
|
|
67
|
+
closeOnEscape: I = !0,
|
|
68
|
+
container: R,
|
|
69
|
+
initialFocusRef: u,
|
|
70
|
+
onAfterClose: j,
|
|
71
|
+
onAfterOpen: f,
|
|
72
|
+
overlayClassName: V,
|
|
73
|
+
viewportClassName: k,
|
|
74
|
+
"aria-label": h,
|
|
75
|
+
"aria-labelledby": P,
|
|
76
|
+
"aria-describedby": _
|
|
66
77
|
}) {
|
|
67
|
-
const b = r.useRef(null),
|
|
68
|
-
() =>
|
|
69
|
-
[
|
|
70
|
-
),
|
|
71
|
-
() => ({ titleId:
|
|
72
|
-
[
|
|
78
|
+
const b = r.useRef(null), p = r.useId(), x = r.useId(), E = r.useMemo(
|
|
79
|
+
() => w(m),
|
|
80
|
+
[m]
|
|
81
|
+
), T = r.useMemo(
|
|
82
|
+
() => ({ titleId: p, descriptionId: x }),
|
|
83
|
+
[x, p]
|
|
73
84
|
);
|
|
74
|
-
return /* @__PURE__ */ t(
|
|
75
|
-
/* @__PURE__ */ t(
|
|
76
|
-
|
|
85
|
+
return /* @__PURE__ */ t(c.Root, { open: o, onOpenChange: e, children: /* @__PURE__ */ t(v.Provider, { value: T, children: /* @__PURE__ */ t(B, { reducedMotion: "user", children: /* @__PURE__ */ t(H, { initial: !1, onExitComplete: j, children: o ? /* @__PURE__ */ g(c.Portal, { forceMount: !0, container: R ?? void 0, children: [
|
|
86
|
+
/* @__PURE__ */ t(c.Overlay, { forceMount: !0, asChild: !0, children: /* @__PURE__ */ t(
|
|
87
|
+
M.div,
|
|
77
88
|
{
|
|
78
89
|
"data-slot": "modal-overlay",
|
|
79
|
-
variants:
|
|
90
|
+
variants: q,
|
|
80
91
|
initial: "hidden",
|
|
81
92
|
animate: "visible",
|
|
82
93
|
exit: "hidden",
|
|
83
94
|
className: n(
|
|
84
95
|
"fixed inset-0 z-50 bg-overlay",
|
|
85
|
-
|
|
96
|
+
V
|
|
86
97
|
)
|
|
87
98
|
},
|
|
88
99
|
"modal-overlay"
|
|
@@ -95,47 +106,47 @@ function ee({
|
|
|
95
106
|
"pointer-events-none fixed inset-0 z-50 grid overflow-y-auto p-4",
|
|
96
107
|
i === "top" ? "place-items-start justify-items-center pt-[max(1rem,8dvh)]" : "place-items-center",
|
|
97
108
|
"max-sm:p-2",
|
|
98
|
-
|
|
109
|
+
k
|
|
99
110
|
),
|
|
100
111
|
children: /* @__PURE__ */ t(
|
|
101
|
-
|
|
112
|
+
c.Content,
|
|
102
113
|
{
|
|
103
114
|
forceMount: !0,
|
|
104
115
|
asChild: !0,
|
|
105
|
-
"aria-label":
|
|
106
|
-
"aria-labelledby":
|
|
107
|
-
"aria-describedby":
|
|
108
|
-
onEscapeKeyDown: (
|
|
109
|
-
|
|
116
|
+
"aria-label": h,
|
|
117
|
+
"aria-labelledby": P ?? (h ? void 0 : p),
|
|
118
|
+
"aria-describedby": _ ?? (E ? x : void 0),
|
|
119
|
+
onEscapeKeyDown: (d) => {
|
|
120
|
+
I || d.preventDefault();
|
|
110
121
|
},
|
|
111
|
-
onPointerDownOutside: (
|
|
112
|
-
|
|
122
|
+
onPointerDownOutside: (d) => {
|
|
123
|
+
z || d.preventDefault();
|
|
113
124
|
},
|
|
114
|
-
onOpenAutoFocus: (
|
|
115
|
-
var
|
|
116
|
-
|
|
125
|
+
onOpenAutoFocus: (d) => {
|
|
126
|
+
var y;
|
|
127
|
+
d.preventDefault(), (y = (u == null ? void 0 : u.current) ?? b.current) == null || y.focus();
|
|
117
128
|
},
|
|
118
|
-
onFocusOutside: (
|
|
119
|
-
children: /* @__PURE__ */
|
|
120
|
-
|
|
129
|
+
onFocusOutside: (d) => d.preventDefault(),
|
|
130
|
+
children: /* @__PURE__ */ g(
|
|
131
|
+
M.div,
|
|
121
132
|
{
|
|
122
133
|
ref: b,
|
|
123
134
|
"data-slot": "modal",
|
|
124
135
|
tabIndex: -1,
|
|
125
|
-
variants:
|
|
136
|
+
variants: A,
|
|
126
137
|
initial: "hidden",
|
|
127
138
|
animate: "visible",
|
|
128
139
|
exit: "hidden",
|
|
129
|
-
onAnimationComplete: (
|
|
130
|
-
|
|
140
|
+
onAnimationComplete: (d) => {
|
|
141
|
+
d === "visible" && (f == null || f());
|
|
131
142
|
},
|
|
132
143
|
className: n(
|
|
133
|
-
|
|
134
|
-
|
|
144
|
+
F({ size: a, position: i, height: l }),
|
|
145
|
+
s
|
|
135
146
|
),
|
|
136
147
|
children: [
|
|
137
|
-
|
|
138
|
-
|
|
148
|
+
D ? /* @__PURE__ */ t(N, {}) : null,
|
|
149
|
+
m
|
|
139
150
|
]
|
|
140
151
|
},
|
|
141
152
|
"modal-panel"
|
|
@@ -146,7 +157,7 @@ function ee({
|
|
|
146
157
|
)
|
|
147
158
|
] }) : null }) }) }) });
|
|
148
159
|
}
|
|
149
|
-
const
|
|
160
|
+
const N = r.forwardRef(({ className: o, children: e, "aria-label": a = "Close", ...i }, l) => /* @__PURE__ */ t(c.Close, { asChild: !0, children: /* @__PURE__ */ t(
|
|
150
161
|
"button",
|
|
151
162
|
{
|
|
152
163
|
ref: l,
|
|
@@ -163,11 +174,11 @@ const w = r.forwardRef(({ className: o, children: e, "aria-label": a = "Close",
|
|
|
163
174
|
o
|
|
164
175
|
),
|
|
165
176
|
...i,
|
|
166
|
-
children: e ?? /* @__PURE__ */ t(
|
|
177
|
+
children: e ?? /* @__PURE__ */ t(K, { "aria-hidden": !0 })
|
|
167
178
|
}
|
|
168
179
|
) }));
|
|
169
|
-
|
|
170
|
-
const
|
|
180
|
+
N.displayName = "ModalClose";
|
|
181
|
+
const G = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
171
182
|
"div",
|
|
172
183
|
{
|
|
173
184
|
ref: a,
|
|
@@ -179,36 +190,36 @@ const F = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
|
179
190
|
...e
|
|
180
191
|
}
|
|
181
192
|
));
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
const l = r.useContext(
|
|
193
|
+
G.displayName = "ModalHeader";
|
|
194
|
+
const J = r.forwardRef(({ className: o, id: e, ...a }, i) => {
|
|
195
|
+
const l = r.useContext(v), s = n(
|
|
185
196
|
"text-l font-semibold leading-5 text-foreground",
|
|
186
197
|
o
|
|
187
198
|
);
|
|
188
199
|
return l ? /* @__PURE__ */ t(
|
|
189
|
-
|
|
200
|
+
c.Title,
|
|
190
201
|
{
|
|
191
202
|
ref: i,
|
|
192
203
|
id: e ?? l.titleId,
|
|
193
204
|
"data-slot": "modal-title",
|
|
194
|
-
className:
|
|
205
|
+
className: s,
|
|
195
206
|
...a
|
|
196
207
|
}
|
|
197
|
-
) : /* @__PURE__ */ t("h2", { ref: i, id: e, className:
|
|
208
|
+
) : /* @__PURE__ */ t("h2", { ref: i, id: e, className: s, ...a });
|
|
198
209
|
});
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
const l = r.useContext(
|
|
210
|
+
J.displayName = "ModalTitle";
|
|
211
|
+
const C = r.forwardRef(({ className: o, id: e, ...a }, i) => {
|
|
212
|
+
const l = r.useContext(v), s = n(
|
|
202
213
|
"text-sm leading-5 text-muted-foreground",
|
|
203
214
|
o
|
|
204
215
|
);
|
|
205
216
|
return l ? /* @__PURE__ */ t(
|
|
206
|
-
|
|
217
|
+
c.Description,
|
|
207
218
|
{
|
|
208
219
|
ref: i,
|
|
209
220
|
id: e ?? l.descriptionId,
|
|
210
221
|
"data-slot": "modal-description",
|
|
211
|
-
className:
|
|
222
|
+
className: s,
|
|
212
223
|
...a
|
|
213
224
|
}
|
|
214
225
|
) : /* @__PURE__ */ t(
|
|
@@ -216,13 +227,13 @@ const N = r.forwardRef(({ className: o, id: e, ...a }, i) => {
|
|
|
216
227
|
{
|
|
217
228
|
ref: i,
|
|
218
229
|
id: e,
|
|
219
|
-
className:
|
|
230
|
+
className: s,
|
|
220
231
|
...a
|
|
221
232
|
}
|
|
222
233
|
);
|
|
223
234
|
});
|
|
224
|
-
|
|
225
|
-
const
|
|
235
|
+
C.displayName = "ModalDescription";
|
|
236
|
+
const O = r.forwardRef(
|
|
226
237
|
({ className: o, padding: e = "default", ...a }, i) => /* @__PURE__ */ t(
|
|
227
238
|
"div",
|
|
228
239
|
{
|
|
@@ -237,8 +248,8 @@ const J = r.forwardRef(
|
|
|
237
248
|
}
|
|
238
249
|
)
|
|
239
250
|
);
|
|
240
|
-
|
|
241
|
-
const
|
|
251
|
+
O.displayName = "ModalBody";
|
|
252
|
+
const Q = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
242
253
|
"div",
|
|
243
254
|
{
|
|
244
255
|
ref: a,
|
|
@@ -250,8 +261,8 @@ const O = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
|
250
261
|
...e
|
|
251
262
|
}
|
|
252
263
|
));
|
|
253
|
-
|
|
254
|
-
const
|
|
264
|
+
Q.displayName = "ModalSection";
|
|
265
|
+
const U = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
255
266
|
"div",
|
|
256
267
|
{
|
|
257
268
|
ref: a,
|
|
@@ -264,14 +275,14 @@ const Q = r.forwardRef(({ className: o, ...e }, a) => /* @__PURE__ */ t(
|
|
|
264
275
|
...e
|
|
265
276
|
}
|
|
266
277
|
));
|
|
267
|
-
|
|
278
|
+
U.displayName = "ModalFooter";
|
|
268
279
|
export {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
te as Modal,
|
|
281
|
+
O as ModalBody,
|
|
282
|
+
N as ModalClose,
|
|
283
|
+
C as ModalDescription,
|
|
284
|
+
U as ModalFooter,
|
|
285
|
+
G as ModalHeader,
|
|
286
|
+
Q as ModalSection,
|
|
287
|
+
J as ModalTitle
|
|
277
288
|
};
|
package/components/popover.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export interface PopoverProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
/** Uncontrolled initial state. */
|
|
4
5
|
defaultOpen?: boolean;
|
|
6
|
+
/** Controlled open state — pair with `onOpenChange`. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** Called whenever the trigger, Escape, or an outside press changes the state. */
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
10
|
}
|
|
6
|
-
export declare function Popover({ children, defaultOpen }: PopoverProps): React.JSX.Element;
|
|
11
|
+
export declare function Popover({ children, defaultOpen, open: openProp, onOpenChange, }: PopoverProps): React.JSX.Element;
|
|
7
12
|
export interface PopoverTriggerProps {
|
|
8
13
|
children: React.ReactElement;
|
|
9
14
|
}
|
package/components/popover.js
CHANGED
|
@@ -1,99 +1,109 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
2
|
+
import { jsx as b, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { createPortal as L } from "react-dom";
|
|
5
|
+
import { MotionConfig as R, AnimatePresence as k, motion as C } from "motion/react";
|
|
6
6
|
import { cn as z } from "../lib/cn.js";
|
|
7
|
-
import { floatVariants as
|
|
8
|
-
import { Ripple as
|
|
7
|
+
import { floatVariants as j } from "../lib/motion.js";
|
|
8
|
+
import { Ripple as A } from "./ripple.js";
|
|
9
9
|
const x = {
|
|
10
10
|
start: "top left",
|
|
11
11
|
center: "top",
|
|
12
12
|
end: "top right"
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
const e =
|
|
13
|
+
}, E = r.createContext(null);
|
|
14
|
+
function P(d) {
|
|
15
|
+
const e = r.useContext(E);
|
|
16
16
|
if (!e)
|
|
17
|
-
throw new Error(`${
|
|
17
|
+
throw new Error(`${d} must be used within a <Popover>.`);
|
|
18
18
|
return e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function K({
|
|
21
|
+
children: d,
|
|
22
|
+
defaultOpen: e = !1,
|
|
23
|
+
open: n,
|
|
24
|
+
onOpenChange: i
|
|
25
|
+
}) {
|
|
26
|
+
const [u, m] = r.useState(e), t = n ?? u, s = r.useCallback(
|
|
27
|
+
(a) => {
|
|
28
|
+
n === void 0 && m(a), i == null || i(a);
|
|
29
|
+
},
|
|
30
|
+
[n, i]
|
|
31
|
+
), f = r.useRef(null);
|
|
32
|
+
return /* @__PURE__ */ b(E.Provider, { value: { open: t, setOpen: s, triggerRef: f }, children: d });
|
|
23
33
|
}
|
|
24
|
-
function
|
|
25
|
-
const { open: e, setOpen:
|
|
26
|
-
return
|
|
27
|
-
ref:
|
|
34
|
+
function N({ children: d }) {
|
|
35
|
+
const { open: e, setOpen: n, triggerRef: i } = P("PopoverTrigger"), u = d;
|
|
36
|
+
return r.cloneElement(u, {
|
|
37
|
+
ref: i,
|
|
28
38
|
"aria-expanded": e,
|
|
29
39
|
"aria-haspopup": !0,
|
|
30
|
-
onClick: (
|
|
31
|
-
var
|
|
32
|
-
(
|
|
40
|
+
onClick: (m) => {
|
|
41
|
+
var t, s;
|
|
42
|
+
(s = (t = u.props).onClick) == null || s.call(t, m), n(!e);
|
|
33
43
|
}
|
|
34
44
|
});
|
|
35
45
|
}
|
|
36
|
-
function
|
|
37
|
-
className:
|
|
46
|
+
function U({
|
|
47
|
+
className: d,
|
|
38
48
|
align: e = "start",
|
|
39
|
-
sideOffset:
|
|
40
|
-
children:
|
|
41
|
-
"aria-label":
|
|
42
|
-
...
|
|
49
|
+
sideOffset: n = 8,
|
|
50
|
+
children: i,
|
|
51
|
+
"aria-label": u = "Popover",
|
|
52
|
+
...m
|
|
43
53
|
}) {
|
|
44
|
-
const { open:
|
|
45
|
-
return
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
50
|
-
var
|
|
51
|
-
const
|
|
52
|
-
let
|
|
53
|
-
e === "center" ?
|
|
54
|
+
const { open: t, setOpen: s, triggerRef: f } = P("PopoverContent"), a = r.useRef(null), [l, h] = r.useState(null);
|
|
55
|
+
return r.useLayoutEffect(() => {
|
|
56
|
+
if (!t) return;
|
|
57
|
+
const v = f.current;
|
|
58
|
+
if (!v) return;
|
|
59
|
+
const c = () => {
|
|
60
|
+
var g;
|
|
61
|
+
const o = v.getBoundingClientRect(), w = ((g = a.current) == null ? void 0 : g.offsetWidth) ?? 0;
|
|
62
|
+
let p = o.left;
|
|
63
|
+
e === "center" ? p = o.left + o.width / 2 - w / 2 : e === "end" && (p = o.right - w), h({ top: o.bottom + n, left: p });
|
|
54
64
|
};
|
|
55
|
-
return
|
|
56
|
-
window.removeEventListener("resize",
|
|
65
|
+
return c(), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
|
|
66
|
+
window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
|
|
57
67
|
};
|
|
58
|
-
}, [
|
|
59
|
-
if (!
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
var
|
|
64
|
-
const
|
|
65
|
-
(
|
|
68
|
+
}, [t, e, n, f]), r.useEffect(() => {
|
|
69
|
+
if (!t) return;
|
|
70
|
+
const v = (o) => {
|
|
71
|
+
o.key === "Escape" && s(!1);
|
|
72
|
+
}, c = (o) => {
|
|
73
|
+
var p, g;
|
|
74
|
+
const w = o.target;
|
|
75
|
+
(p = a.current) != null && p.contains(w) || (g = f.current) != null && g.contains(w) || s(!1);
|
|
66
76
|
};
|
|
67
|
-
return document.addEventListener("keydown",
|
|
68
|
-
document.removeEventListener("keydown",
|
|
77
|
+
return document.addEventListener("keydown", v), document.addEventListener("pointerdown", c), () => {
|
|
78
|
+
document.removeEventListener("keydown", v), document.removeEventListener("pointerdown", c);
|
|
69
79
|
};
|
|
70
|
-
}, [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
80
|
+
}, [t, s, f]), L(
|
|
81
|
+
/* @__PURE__ */ b(R, { reducedMotion: "user", children: /* @__PURE__ */ b(k, { children: t && /* @__PURE__ */ y(
|
|
82
|
+
C.div,
|
|
73
83
|
{
|
|
74
|
-
ref:
|
|
84
|
+
ref: a,
|
|
75
85
|
role: "dialog",
|
|
76
|
-
"aria-label":
|
|
77
|
-
variants:
|
|
86
|
+
"aria-label": u,
|
|
87
|
+
variants: j,
|
|
78
88
|
initial: "hidden",
|
|
79
89
|
animate: "visible",
|
|
80
90
|
exit: "hidden",
|
|
81
91
|
style: {
|
|
82
92
|
position: "fixed",
|
|
83
|
-
top: (
|
|
84
|
-
left: (
|
|
85
|
-
visibility:
|
|
93
|
+
top: (l == null ? void 0 : l.top) ?? 0,
|
|
94
|
+
left: (l == null ? void 0 : l.left) ?? 0,
|
|
95
|
+
visibility: l ? "visible" : "hidden",
|
|
86
96
|
transformOrigin: x[e]
|
|
87
97
|
},
|
|
88
98
|
className: z(
|
|
89
99
|
"relative z-50 min-w-44 rounded-lg border border-border bg-elevated p-3",
|
|
90
100
|
"text-xs text-foreground",
|
|
91
|
-
|
|
101
|
+
d
|
|
92
102
|
),
|
|
93
|
-
...
|
|
103
|
+
...m,
|
|
94
104
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
105
|
+
/* @__PURE__ */ b(A, { origin: x[e] }),
|
|
106
|
+
i
|
|
97
107
|
]
|
|
98
108
|
}
|
|
99
109
|
) }) }),
|
|
@@ -101,7 +111,7 @@ function N({
|
|
|
101
111
|
);
|
|
102
112
|
}
|
|
103
113
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
K as Popover,
|
|
115
|
+
U as PopoverContent,
|
|
116
|
+
N as PopoverTrigger
|
|
107
117
|
};
|
package/components/sidebar.d.ts
CHANGED
|
@@ -63,6 +63,21 @@ export interface SidebarBrandProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
63
63
|
* `SidebarHeader`.
|
|
64
64
|
*/
|
|
65
65
|
export declare function SidebarBrand({ logo, href, label, showTrigger, children, className, ...props }: SidebarBrandProps): React.JSX.Element;
|
|
66
|
+
export interface SidebarWorkspaceProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
67
|
+
/** Customer workspace name. Also the logo's alt text and the tile initial. */
|
|
68
|
+
name: string;
|
|
69
|
+
/** Customer logo URL. Without it, a WG12 letter tile shows the initial. */
|
|
70
|
+
logoSrc?: string;
|
|
71
|
+
/** Show the name beside the mark. Always hidden in the collapsed rail. Default true. */
|
|
72
|
+
showName?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Customer workspace branding for the rail's top-left brand slot: a 32px
|
|
76
|
+
* customer logo (or a WG12 letter tile when no logo is given) and the
|
|
77
|
+
* workspace name, which truncates and hides in the collapsed rail. Pass it as
|
|
78
|
+
* `SidebarBrand`'s `logo`.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SidebarWorkspace: React.ForwardRefExoticComponent<SidebarWorkspaceProps & React.RefAttributes<HTMLSpanElement>>;
|
|
66
81
|
export declare const SidebarHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
67
82
|
export declare const SidebarNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
68
83
|
export interface SidebarSectionProps extends React.HTMLAttributes<HTMLDivElement> {
|