@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.
- package/components/assistant-ui/composer-harness.js +12 -10
- package/components/avatar.d.ts +1 -0
- package/components/avatar.js +5 -4
- package/components/breadcrumbs.d.ts +3 -1
- package/components/breadcrumbs.js +62 -56
- package/components/button.js +11 -11
- package/components/card.js +19 -18
- package/components/chart.d.ts +6 -0
- package/components/chart.js +747 -657
- package/components/date-range-picker.d.ts +25 -0
- package/components/date-range-picker.js +187 -0
- package/components/drawer.d.ts +3 -1
- package/components/drawer.js +115 -95
- package/components/index.d.ts +1 -0
- package/components/index.js +499 -497
- package/components/modal.d.ts +5 -1
- package/components/modal.js +74 -61
- package/components/panel.js +31 -28
- package/components/pixel-icon.d.ts +4 -0
- package/components/pixel-icon.js +210 -163
- package/components/segmented.d.ts +1 -0
- package/components/segmented.js +31 -28
- package/components/select.d.ts +5 -0
- package/components/select.js +177 -132
- package/components/table.d.ts +7 -0
- package/components/table.js +183 -173
- package/components/tabs.js +1 -1
- package/components/tree.js +86 -58
- package/components/viz-charts.js +186 -183
- package/demo/components/add-to-artifact.js +131 -107
- package/demo/lib/artifact-library.js +37 -29
- package/demo/lib/artifact-pin-guard.js +12 -0
- package/fonts.css +2 -0
- package/lib/icons.d.ts +20 -0
- package/lib/icons.js +112 -107
- package/llms.txt +23 -3
- package/manifest.json +13774 -14
- package/package.json +4 -1
- package/styles.css +76 -60
- package/theme.css +70 -57
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type DateRangeValue = {
|
|
3
|
+
start: string;
|
|
4
|
+
end: string;
|
|
5
|
+
};
|
|
6
|
+
export interface DateRangePickerProps {
|
|
7
|
+
value?: DateRangeValue | null;
|
|
8
|
+
defaultValue?: DateRangeValue | null;
|
|
9
|
+
onChange?: (value: DateRangeValue | null) => void;
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
errorMessage?: React.ReactNode;
|
|
13
|
+
size?: "sm" | "md";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
minValue?: string;
|
|
16
|
+
maxValue?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ADS date-range picker, adapted from HeroUI's composition-first pattern.
|
|
22
|
+
* React Aria owns keyboard, focus, locale, and range-selection behavior while
|
|
23
|
+
* ADS owns every visual token, state, radius, and elevation.
|
|
24
|
+
*/
|
|
25
|
+
export declare function DateRangePicker({ value, defaultValue, onChange, label, description, errorMessage, size, disabled, minValue, maxValue, className, "aria-label": ariaLabel, }: DateRangePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as x from "react";
|
|
4
|
+
import { parseDate as u } from "@internationalized/date";
|
|
5
|
+
import { DateRangePicker as H, Label as I, Group as L, DateInput as b, DateSegment as p, Button as l, Text as h, Popover as O, Dialog as T, RangeCalendar as $, Heading as q, CalendarGrid as A, CalendarGridHeader as E, CalendarHeaderCell as F, CalendarGridBody as J, CalendarCell as K } from "react-aria-components";
|
|
6
|
+
import { Calendar as M, ChevronLeft as Q, ChevronRight as U } from "../lib/icons.js";
|
|
7
|
+
import { cn as n } from "../lib/cn.js";
|
|
8
|
+
function N(r) {
|
|
9
|
+
if (!(r != null && r.start) || !r.end) return null;
|
|
10
|
+
try {
|
|
11
|
+
return {
|
|
12
|
+
start: u(r.start),
|
|
13
|
+
end: u(r.end)
|
|
14
|
+
};
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function y(r) {
|
|
20
|
+
if (r)
|
|
21
|
+
try {
|
|
22
|
+
return u(r);
|
|
23
|
+
} catch {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function W(r) {
|
|
28
|
+
return r ? {
|
|
29
|
+
start: r.start.toString(),
|
|
30
|
+
end: r.end.toString()
|
|
31
|
+
} : null;
|
|
32
|
+
}
|
|
33
|
+
const X = {
|
|
34
|
+
sm: {
|
|
35
|
+
group: "min-h-8 rounded-sm text-xs",
|
|
36
|
+
trigger: "size-7 rounded-sm"
|
|
37
|
+
},
|
|
38
|
+
md: {
|
|
39
|
+
group: "min-h-10 rounded-md text-sm",
|
|
40
|
+
trigger: "size-8 rounded-sm"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
function te({
|
|
44
|
+
value: r,
|
|
45
|
+
defaultValue: m,
|
|
46
|
+
onChange: d,
|
|
47
|
+
label: c,
|
|
48
|
+
description: g,
|
|
49
|
+
errorMessage: s,
|
|
50
|
+
size: v = "md",
|
|
51
|
+
disabled: w,
|
|
52
|
+
minValue: z,
|
|
53
|
+
maxValue: k,
|
|
54
|
+
className: D,
|
|
55
|
+
"aria-label": C
|
|
56
|
+
}) {
|
|
57
|
+
const f = X[v], R = x.useMemo(() => N(r), [r]), j = x.useMemo(
|
|
58
|
+
() => N(m),
|
|
59
|
+
[m]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ a(
|
|
62
|
+
H,
|
|
63
|
+
{
|
|
64
|
+
"aria-label": C,
|
|
65
|
+
className: n("flex w-full flex-col gap-1.5", D),
|
|
66
|
+
value: r === void 0 ? void 0 : R,
|
|
67
|
+
defaultValue: j ?? void 0,
|
|
68
|
+
isDisabled: w,
|
|
69
|
+
minValue: y(z),
|
|
70
|
+
maxValue: y(k),
|
|
71
|
+
isInvalid: !!s,
|
|
72
|
+
onChange: (t) => d == null ? void 0 : d(W(t)),
|
|
73
|
+
children: [
|
|
74
|
+
c && /* @__PURE__ */ e(I, { className: "text-xs font-medium text-foreground", children: c }),
|
|
75
|
+
/* @__PURE__ */ a(
|
|
76
|
+
L,
|
|
77
|
+
{
|
|
78
|
+
className: n(
|
|
79
|
+
"flex w-full items-center gap-1 border border-input bg-background px-2 text-foreground shadow-xs outline-none transition-[border-color,box-shadow,background-color]",
|
|
80
|
+
"hover:bg-muted/40 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring",
|
|
81
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
82
|
+
"data-[invalid]:border-danger data-[invalid]:ring-danger/20",
|
|
83
|
+
f.group
|
|
84
|
+
),
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ e(b, { slot: "start", className: "flex min-w-0 flex-1 items-center", children: (t) => /* @__PURE__ */ e(
|
|
87
|
+
p,
|
|
88
|
+
{
|
|
89
|
+
segment: t,
|
|
90
|
+
className: ({ isFocused: i, isPlaceholder: o }) => n(
|
|
91
|
+
"rounded-xs px-0.5 tabular-nums outline-none",
|
|
92
|
+
o && "text-muted-foreground",
|
|
93
|
+
i && "bg-primary text-primary-foreground"
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
) }),
|
|
97
|
+
/* @__PURE__ */ e("span", { "aria-hidden": "true", className: "shrink-0 text-muted-foreground", children: "–" }),
|
|
98
|
+
/* @__PURE__ */ e(b, { slot: "end", className: "flex min-w-0 flex-1 items-center", children: (t) => /* @__PURE__ */ e(
|
|
99
|
+
p,
|
|
100
|
+
{
|
|
101
|
+
segment: t,
|
|
102
|
+
className: ({ isFocused: i, isPlaceholder: o }) => n(
|
|
103
|
+
"rounded-xs px-0.5 tabular-nums outline-none",
|
|
104
|
+
o && "text-muted-foreground",
|
|
105
|
+
i && "bg-primary text-primary-foreground"
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
) }),
|
|
109
|
+
/* @__PURE__ */ e(
|
|
110
|
+
l,
|
|
111
|
+
{
|
|
112
|
+
"aria-label": "Open calendar",
|
|
113
|
+
className: n(
|
|
114
|
+
"ml-auto inline-flex shrink-0 items-center justify-center border border-transparent text-muted-foreground outline-none transition-colors",
|
|
115
|
+
"hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring data-[pressed]:bg-muted",
|
|
116
|
+
f.trigger
|
|
117
|
+
),
|
|
118
|
+
children: /* @__PURE__ */ e(M, { className: "size-4" })
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
g && !s && /* @__PURE__ */ e(h, { slot: "description", className: "text-xs text-muted-foreground", children: g }),
|
|
125
|
+
s && /* @__PURE__ */ e(h, { slot: "errorMessage", className: "text-xs text-danger", children: s }),
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
O,
|
|
128
|
+
{
|
|
129
|
+
placement: "bottom end",
|
|
130
|
+
offset: 6,
|
|
131
|
+
className: "z-50 w-72 rounded-md border border-border bg-popover p-3 text-popover-foreground shadow-elevation outline-none entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",
|
|
132
|
+
children: /* @__PURE__ */ e(T, { className: "outline-none", children: /* @__PURE__ */ a($, { className: "w-full", visibleDuration: { months: 1 }, children: [
|
|
133
|
+
/* @__PURE__ */ a("header", { className: "mb-3 flex items-center justify-between gap-2", children: [
|
|
134
|
+
/* @__PURE__ */ e(
|
|
135
|
+
l,
|
|
136
|
+
{
|
|
137
|
+
slot: "previous",
|
|
138
|
+
className: "inline-flex size-8 items-center justify-center rounded-sm border border-input bg-background text-foreground outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring disabled:opacity-40",
|
|
139
|
+
children: /* @__PURE__ */ e(Q, { className: "size-4" })
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ e(q, { className: "text-sm font-semibold" }),
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
l,
|
|
145
|
+
{
|
|
146
|
+
slot: "next",
|
|
147
|
+
className: "inline-flex size-8 items-center justify-center rounded-sm border border-input bg-background text-foreground outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring disabled:opacity-40",
|
|
148
|
+
children: /* @__PURE__ */ e(U, { className: "size-4" })
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ a(A, { weekdayStyle: "short", className: "w-full border-separate border-spacing-0.5", children: [
|
|
153
|
+
/* @__PURE__ */ e(E, { children: (t) => /* @__PURE__ */ e(F, { className: "h-7 text-center text-xs font-medium text-muted-foreground", children: t }) }),
|
|
154
|
+
/* @__PURE__ */ e(J, { children: (t) => /* @__PURE__ */ e(
|
|
155
|
+
K,
|
|
156
|
+
{
|
|
157
|
+
date: t,
|
|
158
|
+
className: ({
|
|
159
|
+
isDisabled: i,
|
|
160
|
+
isFocusVisible: o,
|
|
161
|
+
isOutsideMonth: B,
|
|
162
|
+
isSelected: G,
|
|
163
|
+
isSelectionEnd: P,
|
|
164
|
+
isSelectionStart: S,
|
|
165
|
+
isUnavailable: V
|
|
166
|
+
}) => n(
|
|
167
|
+
"relative flex size-8 items-center justify-center rounded-sm text-xs tabular-nums outline-none transition-colors",
|
|
168
|
+
"hover:bg-muted",
|
|
169
|
+
G && "bg-muted font-medium text-foreground",
|
|
170
|
+
(S || P) && "bg-primary text-primary-foreground hover:bg-primary",
|
|
171
|
+
B && "text-muted-foreground/45",
|
|
172
|
+
(i || V) && "pointer-events-none text-muted-foreground/35 line-through",
|
|
173
|
+
o && "ring-3 ring-ring"
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
) })
|
|
177
|
+
] })
|
|
178
|
+
] }) })
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
te as DateRangePicker
|
|
187
|
+
};
|
package/components/drawer.d.ts
CHANGED
|
@@ -22,10 +22,12 @@ export interface DrawerProps extends VariantProps<typeof panelVariants> {
|
|
|
22
22
|
export interface ModalDrawerProps extends VariantProps<typeof panelVariants> {
|
|
23
23
|
open: boolean;
|
|
24
24
|
onOpenChange: (open: boolean) => void;
|
|
25
|
+
/** Accessible name for the modal drawer dialog. */
|
|
26
|
+
"aria-label": string;
|
|
25
27
|
className?: string;
|
|
26
28
|
children: React.ReactNode;
|
|
27
29
|
}
|
|
28
|
-
export declare function ModalDrawer({ open, onOpenChange, side: sideProp, size, className, children, }: ModalDrawerProps): React.ReactPortal;
|
|
30
|
+
export declare function ModalDrawer({ open, onOpenChange, side: sideProp, size, className, children, "aria-label": ariaLabel, }: ModalDrawerProps): React.ReactPortal;
|
|
29
31
|
/**
|
|
30
32
|
* Drawer — an in-flow side panel that slides in beside content instead of
|
|
31
33
|
* portaling over the whole page. No backdrop, no scroll lock; the surrounding
|
package/components/drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as i, jsxs as
|
|
2
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
3
3
|
import * as a from "react";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { MotionConfig as
|
|
4
|
+
import { createPortal as E } from "react-dom";
|
|
5
|
+
import { MotionConfig as y, AnimatePresence as z, motion as w } from "motion/react";
|
|
6
6
|
import { Close as R } from "../lib/icons.js";
|
|
7
|
-
import { cva as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { springSheet as
|
|
10
|
-
const
|
|
7
|
+
import { cva as j } from "class-variance-authority";
|
|
8
|
+
import { cn as n } from "../lib/cn.js";
|
|
9
|
+
import { springSheet as l, drawerOffset as h, drawerBackdropVariants as F } from "../lib/motion.js";
|
|
10
|
+
const N = j(
|
|
11
11
|
[
|
|
12
12
|
"relative flex flex-col",
|
|
13
13
|
"bg-elevated text-foreground",
|
|
@@ -43,12 +43,17 @@ const z = E(
|
|
|
43
43
|
],
|
|
44
44
|
defaultVariants: { side: "right", size: "md" }
|
|
45
45
|
}
|
|
46
|
-
),
|
|
46
|
+
), A = {
|
|
47
47
|
right: "justify-end items-stretch",
|
|
48
48
|
left: "justify-start items-stretch",
|
|
49
49
|
bottom: "justify-center items-end"
|
|
50
|
+
}, B = {
|
|
51
|
+
sm: "25%",
|
|
52
|
+
md: "33.333333%",
|
|
53
|
+
lg: "50%",
|
|
54
|
+
xl: "66.666667%"
|
|
50
55
|
};
|
|
51
|
-
function
|
|
56
|
+
function k({
|
|
52
57
|
onClick: t,
|
|
53
58
|
className: e
|
|
54
59
|
}) {
|
|
@@ -58,7 +63,7 @@ function N({
|
|
|
58
63
|
type: "button",
|
|
59
64
|
onClick: t,
|
|
60
65
|
"aria-label": "Close",
|
|
61
|
-
className:
|
|
66
|
+
className: n(
|
|
62
67
|
"absolute inline-flex size-8 items-center justify-center",
|
|
63
68
|
"rounded-sm text-muted-foreground",
|
|
64
69
|
"transition-[background,color,transform] duration-150 ease-out motion-reduce:transition-none hover:bg-muted hover:text-foreground",
|
|
@@ -71,38 +76,39 @@ function N({
|
|
|
71
76
|
}
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
|
-
function
|
|
79
|
+
function G({
|
|
75
80
|
open: t,
|
|
76
81
|
onOpenChange: e,
|
|
77
|
-
side:
|
|
78
|
-
size:
|
|
79
|
-
className:
|
|
80
|
-
children:
|
|
82
|
+
side: s,
|
|
83
|
+
size: d,
|
|
84
|
+
className: v,
|
|
85
|
+
children: x,
|
|
86
|
+
"aria-label": g
|
|
81
87
|
}) {
|
|
82
|
-
const
|
|
88
|
+
const r = s ?? "right", c = a.useRef(null), m = a.useRef(null);
|
|
83
89
|
return a.useEffect(() => {
|
|
84
90
|
if (!t) return;
|
|
85
|
-
|
|
86
|
-
const
|
|
91
|
+
m.current = document.activeElement;
|
|
92
|
+
const f = document.body.style.overflow;
|
|
87
93
|
document.body.style.overflow = "hidden";
|
|
88
|
-
const
|
|
89
|
-
|
|
94
|
+
const u = (o) => {
|
|
95
|
+
o.key === "Escape" && (o.stopPropagation(), e(!1));
|
|
90
96
|
};
|
|
91
|
-
document.addEventListener("keydown",
|
|
92
|
-
const
|
|
93
|
-
var
|
|
94
|
-
(
|
|
97
|
+
document.addEventListener("keydown", u);
|
|
98
|
+
const D = requestAnimationFrame(() => {
|
|
99
|
+
var o;
|
|
100
|
+
(o = c.current) == null || o.focus();
|
|
95
101
|
});
|
|
96
102
|
return () => {
|
|
97
|
-
var
|
|
98
|
-
document.removeEventListener("keydown",
|
|
103
|
+
var o, p;
|
|
104
|
+
document.removeEventListener("keydown", u), document.body.style.overflow = f, cancelAnimationFrame(D), (p = (o = m.current) == null ? void 0 : o.focus) == null || p.call(o);
|
|
99
105
|
};
|
|
100
|
-
}, [t, e]),
|
|
101
|
-
/* @__PURE__ */ i(
|
|
106
|
+
}, [t, e]), E(
|
|
107
|
+
/* @__PURE__ */ i(y, { reducedMotion: "user", children: /* @__PURE__ */ i(z, { children: t && /* @__PURE__ */ b("div", { className: n("fixed inset-0 z-50 flex", A[r]), children: [
|
|
102
108
|
/* @__PURE__ */ i(
|
|
103
|
-
|
|
109
|
+
w.div,
|
|
104
110
|
{
|
|
105
|
-
variants:
|
|
111
|
+
variants: F,
|
|
106
112
|
initial: "hidden",
|
|
107
113
|
animate: "visible",
|
|
108
114
|
exit: "hidden",
|
|
@@ -112,26 +118,27 @@ function q({
|
|
|
112
118
|
},
|
|
113
119
|
"backdrop"
|
|
114
120
|
),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
121
|
+
/* @__PURE__ */ b(
|
|
122
|
+
w.div,
|
|
117
123
|
{
|
|
118
|
-
ref:
|
|
119
|
-
initial:
|
|
120
|
-
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition:
|
|
121
|
-
exit: { ...
|
|
124
|
+
ref: c,
|
|
125
|
+
initial: h[r],
|
|
126
|
+
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
|
|
127
|
+
exit: { ...h[r], pointerEvents: "none", transition: l },
|
|
122
128
|
role: "dialog",
|
|
123
129
|
"aria-modal": "true",
|
|
130
|
+
"aria-label": g,
|
|
124
131
|
tabIndex: -1,
|
|
125
|
-
className:
|
|
132
|
+
className: n(N({ side: r, size: d }), "relative outline-none", v),
|
|
126
133
|
children: [
|
|
127
134
|
/* @__PURE__ */ i(
|
|
128
|
-
|
|
135
|
+
k,
|
|
129
136
|
{
|
|
130
137
|
onClick: () => e(!1),
|
|
131
138
|
className: "right-4 top-4"
|
|
132
139
|
}
|
|
133
140
|
),
|
|
134
|
-
|
|
141
|
+
x
|
|
135
142
|
]
|
|
136
143
|
},
|
|
137
144
|
"panel"
|
|
@@ -140,96 +147,109 @@ function q({
|
|
|
140
147
|
document.body
|
|
141
148
|
);
|
|
142
149
|
}
|
|
143
|
-
function
|
|
150
|
+
function L({
|
|
144
151
|
open: t,
|
|
145
152
|
onOpenChange: e,
|
|
146
|
-
side:
|
|
147
|
-
size:
|
|
148
|
-
className:
|
|
149
|
-
children:
|
|
150
|
-
"aria-label":
|
|
153
|
+
side: s,
|
|
154
|
+
size: d,
|
|
155
|
+
className: v,
|
|
156
|
+
children: x,
|
|
157
|
+
"aria-label": g
|
|
151
158
|
}) {
|
|
152
|
-
const
|
|
159
|
+
const r = s ?? "right", c = d ?? "md", m = a.useRef(null);
|
|
153
160
|
return a.useEffect(() => {
|
|
154
161
|
if (!t) return;
|
|
155
|
-
const
|
|
156
|
-
|
|
162
|
+
const f = (u) => {
|
|
163
|
+
u.key === "Escape" && e(!1);
|
|
157
164
|
};
|
|
158
|
-
return document.addEventListener("keydown",
|
|
159
|
-
}, [t, e]), /* @__PURE__ */ i(
|
|
160
|
-
|
|
165
|
+
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
166
|
+
}, [t, e]), /* @__PURE__ */ i(y, { reducedMotion: "user", children: /* @__PURE__ */ i(z, { initial: !1, children: t && /* @__PURE__ */ i(
|
|
167
|
+
w.div,
|
|
161
168
|
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
className: o(
|
|
169
|
-
z({ side: n, size: w }),
|
|
170
|
-
"relative shrink-0 overflow-hidden rounded-lg bg-card shadow-none outline-none",
|
|
171
|
-
x
|
|
169
|
+
initial: r === "bottom" ? { height: "0%" } : { width: 0 },
|
|
170
|
+
animate: r === "bottom" ? { height: B[c], transition: l } : { width: "auto", transition: l },
|
|
171
|
+
exit: r === "bottom" ? { height: "0%", pointerEvents: "none", transition: l } : { width: 0, pointerEvents: "none", transition: l },
|
|
172
|
+
className: n(
|
|
173
|
+
"shrink-0 overflow-hidden",
|
|
174
|
+
r === "bottom" ? "w-full" : "h-full"
|
|
172
175
|
),
|
|
173
|
-
children:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
children: /* @__PURE__ */ b(
|
|
177
|
+
w.aside,
|
|
178
|
+
{
|
|
179
|
+
ref: m,
|
|
180
|
+
initial: h[r],
|
|
181
|
+
animate: { transform: "translate3d(0, 0, 0)", opacity: 1, transition: l },
|
|
182
|
+
exit: { ...h[r], pointerEvents: "none", transition: l },
|
|
183
|
+
role: "complementary",
|
|
184
|
+
"aria-label": g,
|
|
185
|
+
className: n(
|
|
186
|
+
N({ side: r, size: d }),
|
|
187
|
+
"relative shrink-0 overflow-hidden rounded-lg bg-card shadow-none outline-none",
|
|
188
|
+
r === "bottom" && "h-full",
|
|
189
|
+
v
|
|
190
|
+
),
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ i(
|
|
193
|
+
k,
|
|
194
|
+
{
|
|
195
|
+
onClick: () => e(!1),
|
|
196
|
+
className: "right-2 top-1"
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
x
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
183
203
|
},
|
|
184
|
-
"inline-drawer"
|
|
204
|
+
"inline-drawer-slot"
|
|
185
205
|
) }) });
|
|
186
206
|
}
|
|
187
|
-
const
|
|
207
|
+
const J = L, M = a.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i(
|
|
188
208
|
"div",
|
|
189
209
|
{
|
|
190
|
-
ref:
|
|
191
|
-
className:
|
|
210
|
+
ref: s,
|
|
211
|
+
className: n("flex flex-col gap-1 px-6 py-4 pr-14", t),
|
|
192
212
|
...e
|
|
193
213
|
}
|
|
194
214
|
));
|
|
195
|
-
|
|
196
|
-
const
|
|
215
|
+
M.displayName = "DrawerHeader";
|
|
216
|
+
const V = a.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i(
|
|
197
217
|
"h2",
|
|
198
218
|
{
|
|
199
|
-
ref:
|
|
200
|
-
className:
|
|
219
|
+
ref: s,
|
|
220
|
+
className: n("text-lg font-medium text-foreground", t),
|
|
201
221
|
...e
|
|
202
222
|
}
|
|
203
223
|
));
|
|
204
|
-
|
|
205
|
-
const
|
|
224
|
+
V.displayName = "DrawerTitle";
|
|
225
|
+
const I = a.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i(
|
|
206
226
|
"div",
|
|
207
227
|
{
|
|
208
|
-
ref:
|
|
228
|
+
ref: s,
|
|
209
229
|
tabIndex: 0,
|
|
210
|
-
className:
|
|
230
|
+
className: n("flex-1 overflow-y-auto px-6 py-4 text-xs text-foreground", t),
|
|
211
231
|
...e
|
|
212
232
|
}
|
|
213
233
|
));
|
|
214
|
-
|
|
215
|
-
const
|
|
234
|
+
I.displayName = "DrawerBody";
|
|
235
|
+
const P = a.forwardRef(({ className: t, ...e }, s) => /* @__PURE__ */ i(
|
|
216
236
|
"div",
|
|
217
237
|
{
|
|
218
|
-
ref:
|
|
219
|
-
className:
|
|
238
|
+
ref: s,
|
|
239
|
+
className: n(
|
|
220
240
|
"flex items-center justify-end gap-2 px-6 py-4",
|
|
221
241
|
t
|
|
222
242
|
),
|
|
223
243
|
...e
|
|
224
244
|
}
|
|
225
245
|
));
|
|
226
|
-
|
|
246
|
+
P.displayName = "DrawerFooter";
|
|
227
247
|
export {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
L as Drawer,
|
|
249
|
+
I as DrawerBody,
|
|
250
|
+
P as DrawerFooter,
|
|
251
|
+
M as DrawerHeader,
|
|
252
|
+
V as DrawerTitle,
|
|
253
|
+
J as InlineDrawer,
|
|
254
|
+
G as ModalDrawer
|
|
235
255
|
};
|
package/components/index.d.ts
CHANGED