raft-ui 0.0.7 → 0.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/dist/wip.mjs CHANGED
@@ -1,288 +1,16 @@
1
- import { a as useThemeFamily, c as tv, t as Button$1 } from "./button-CJqMhTPQ.mjs";
2
1
  import { cn } from "./cn.mjs";
2
+ import { a as useThemeFamily, c as tv, t as Button$1 } from "./button-jUlaK4eN.mjs";
3
+ import { Dialog } from "@base-ui/react/dialog";
4
+ import { MessageSquare, X } from "lucide-react";
5
+ import { Children, Fragment, cloneElement, isValidElement, useCallback, useRef, useState } from "react";
3
6
  import { Button } from "@base-ui/react/button";
4
- import { useCallback, useRef, useState } from "react";
5
7
  import { mergeProps } from "@base-ui/react/merge-props";
6
8
  import { useRender } from "@base-ui/react/use-render";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { MessageSquare } from "lucide-react";
9
- import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Toggle } from "@base-ui/react/toggle";
11
11
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
12
12
  import { useHotkey } from "@tanstack/react-hotkeys";
13
- //#region src/components/dialog/dialog.tsx
14
- const dialog = tv({
15
- slots: {
16
- overlay: [
17
- "fixed inset-0 z-50",
18
- "transition-opacity duration-100",
19
- "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"
20
- ],
21
- content: [
22
- "fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2",
23
- "outline-none transition-[opacity,transform] duration-100",
24
- "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
25
- "data-[ending-style]:scale-95 data-[ending-style]:opacity-0"
26
- ],
27
- header: ["flex min-w-0 flex-col gap-1"],
28
- body: ["min-w-0"],
29
- footer: ["flex items-center justify-end gap-3"],
30
- title: ["m-0 min-w-0 text-foreground-strong"],
31
- description: ["m-0 text-foreground-muted"]
32
- },
33
- variants: { theme: {
34
- brutal: {
35
- overlay: ["bg-black/60"],
36
- content: ["gap-4 border-2 border-line-strong bg-layer-panel p-6 shadow-xl"],
37
- title: ["font-heading text-lg leading-none font-bold uppercase"],
38
- description: ["font-sans text-sm leading-5 text-foreground/60"]
39
- },
40
- elegant: {
41
- overlay: ["bg-black/20"],
42
- content: ["gap-5 rounded-lg bg-layer-popover p-5", "shadow-[0_24px_48px_-24px_oklch(0.21_0.006_285_/_0.30),0_0_0_1px_oklch(0.21_0.006_285_/_0.08),0_1px_2px_oklch(0.21_0.006_285_/_0.08)]"],
43
- title: ["font-sans text-base leading-5 font-medium tracking-[-0.005em]"],
44
- description: ["font-sans text-sm leading-5 text-[oklch(0.48_0_0)] dark:text-[oklch(0.76_0_0)]"]
45
- }
46
- } }
47
- });
48
- function Dialog(props) {
49
- return /* @__PURE__ */ jsx(Dialog$1.Root, {
50
- "data-slot": "dialog",
51
- ...props
52
- });
53
- }
54
- function DialogTrigger(props) {
55
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
56
- "data-slot": "dialog-trigger",
57
- ...props
58
- });
59
- }
60
- function DialogPortal(props) {
61
- return /* @__PURE__ */ jsx(Dialog$1.Portal, {
62
- "data-slot": "dialog-portal",
63
- ...props
64
- });
65
- }
66
- function DialogOverlay({ className, ...props }) {
67
- const { overlay } = dialog({ theme: useThemeFamily() });
68
- return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
69
- "data-slot": "dialog-overlay",
70
- className: overlay({ className }),
71
- ...props
72
- });
73
- }
74
- function DialogContent({ className, children, portalProps, overlay, ...props }) {
75
- const { content } = dialog({ theme: useThemeFamily() });
76
- return /* @__PURE__ */ jsxs(DialogPortal, {
77
- ...portalProps,
78
- children: [overlay === false ? null : /* @__PURE__ */ jsx(DialogOverlay, { ...overlay }), /* @__PURE__ */ jsx(Dialog$1.Popup, {
79
- "data-slot": "dialog-content",
80
- className: content({ className }),
81
- ...props,
82
- children
83
- })]
84
- });
85
- }
86
- function DialogClose(props) {
87
- return /* @__PURE__ */ jsx(Dialog$1.Close, {
88
- "data-slot": "dialog-close",
89
- ...props
90
- });
91
- }
92
- function DialogHeader({ className, ...props }) {
93
- const { header } = dialog({ theme: useThemeFamily() });
94
- return /* @__PURE__ */ jsx("div", {
95
- "data-slot": "dialog-header",
96
- className: header({ className }),
97
- ...props
98
- });
99
- }
100
- function DialogBody({ className, ...props }) {
101
- const { body } = dialog({ theme: useThemeFamily() });
102
- return /* @__PURE__ */ jsx("div", {
103
- "data-slot": "dialog-body",
104
- className: body({ className }),
105
- ...props
106
- });
107
- }
108
- function DialogFooter({ className, ...props }) {
109
- const { footer } = dialog({ theme: useThemeFamily() });
110
- return /* @__PURE__ */ jsx("div", {
111
- "data-slot": "dialog-footer",
112
- className: footer({ className }),
113
- ...props
114
- });
115
- }
116
- function DialogTitle({ className, ...props }) {
117
- const { title } = dialog({ theme: useThemeFamily() });
118
- return /* @__PURE__ */ jsx(Dialog$1.Title, {
119
- "data-slot": "dialog-title",
120
- className: title({ className }),
121
- ...props
122
- });
123
- }
124
- function DialogDescription({ className, ...props }) {
125
- const { description } = dialog({ theme: useThemeFamily() });
126
- return /* @__PURE__ */ jsx(Dialog$1.Description, {
127
- "data-slot": "dialog-description",
128
- className: description({ className }),
129
- ...props
130
- });
131
- }
132
- //#endregion
133
- //#region src/components/alert-dialog/alert-dialog.tsx
134
- const alertDialog = tv({
135
- slots: {
136
- overlay: [
137
- "fixed inset-0 z-50",
138
- "transition-opacity duration-100",
139
- "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"
140
- ],
141
- content: [
142
- "fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
143
- "outline-none transition-[opacity,transform] duration-100",
144
- "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
145
- "data-[ending-style]:scale-95 data-[ending-style]:opacity-0"
146
- ],
147
- header: ["grid min-w-0 gap-1"],
148
- media: ["flex size-10 shrink-0 items-center justify-center"],
149
- body: ["min-w-0"],
150
- footer: ["flex items-center justify-end gap-3"],
151
- title: ["m-0 min-w-0 text-foreground-strong"],
152
- description: ["m-0 text-foreground-muted"]
153
- },
154
- variants: {
155
- theme: {
156
- brutal: {
157
- overlay: ["bg-black/60"],
158
- content: ["gap-4 border-2 border-line-strong bg-layer-panel p-6 shadow-xl"],
159
- media: ["border-2 border-line-strong bg-warning-base text-foreground-inverse"],
160
- title: ["font-heading text-lg leading-none font-bold uppercase"],
161
- description: ["font-sans text-sm leading-5 text-foreground/60"]
162
- },
163
- elegant: {
164
- overlay: ["bg-black/20"],
165
- content: ["gap-5 rounded-lg bg-layer-popover p-5", "shadow-[0_24px_48px_-24px_oklch(0.21_0.006_285_/_0.30),0_0_0_1px_oklch(0.21_0.006_285_/_0.08),0_1px_2px_oklch(0.21_0.006_285_/_0.08)]"],
166
- media: ["rounded-md bg-danger-lighter text-danger-base"],
167
- title: ["font-sans text-base leading-5 font-medium tracking-[-0.005em]"],
168
- description: ["font-sans text-sm leading-5 text-[oklch(0.48_0_0)] dark:text-[oklch(0.76_0_0)]"]
169
- }
170
- },
171
- size: {
172
- sm: { content: ["max-w-sm"] },
173
- md: { content: ["max-w-md"] }
174
- }
175
- },
176
- defaultVariants: { size: "sm" }
177
- });
178
- function AlertDialog(props) {
179
- return /* @__PURE__ */ jsx(Dialog$1.Root, {
180
- "data-slot": "alert-dialog",
181
- ...props
182
- });
183
- }
184
- function AlertDialogTrigger(props) {
185
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
186
- "data-slot": "alert-dialog-trigger",
187
- ...props
188
- });
189
- }
190
- function AlertDialogPortal(props) {
191
- return /* @__PURE__ */ jsx(Dialog$1.Portal, {
192
- "data-slot": "alert-dialog-portal",
193
- ...props
194
- });
195
- }
196
- function AlertDialogOverlay({ className, ...props }) {
197
- const { overlay } = alertDialog({ theme: useThemeFamily() });
198
- return /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
199
- "data-slot": "alert-dialog-overlay",
200
- className: overlay({ className }),
201
- ...props
202
- });
203
- }
204
- function AlertDialogContent({ className, children, portalProps, overlay, size, ...props }) {
205
- const { content } = alertDialog({
206
- theme: useThemeFamily(),
207
- size
208
- });
209
- return /* @__PURE__ */ jsxs(AlertDialogPortal, {
210
- ...portalProps,
211
- children: [overlay === false ? null : /* @__PURE__ */ jsx(AlertDialogOverlay, { ...overlay }), /* @__PURE__ */ jsx(Dialog$1.Popup, {
212
- "data-slot": "alert-dialog-content",
213
- className: content({ className }),
214
- ...props,
215
- role: "alertdialog",
216
- children
217
- })]
218
- });
219
- }
220
- function AlertDialogHeader({ className, ...props }) {
221
- const { header } = alertDialog({ theme: useThemeFamily() });
222
- return /* @__PURE__ */ jsx("div", {
223
- "data-slot": "alert-dialog-header",
224
- className: header({ className }),
225
- ...props
226
- });
227
- }
228
- function AlertDialogMedia({ className, ...props }) {
229
- const { media } = alertDialog({ theme: useThemeFamily() });
230
- return /* @__PURE__ */ jsx("div", {
231
- "data-slot": "alert-dialog-media",
232
- className: media({ className }),
233
- ...props
234
- });
235
- }
236
- function AlertDialogBody({ className, ...props }) {
237
- const { body } = alertDialog({ theme: useThemeFamily() });
238
- return /* @__PURE__ */ jsx("div", {
239
- "data-slot": "alert-dialog-body",
240
- className: body({ className }),
241
- ...props
242
- });
243
- }
244
- function AlertDialogFooter({ className, ...props }) {
245
- const { footer } = alertDialog({ theme: useThemeFamily() });
246
- return /* @__PURE__ */ jsx("div", {
247
- "data-slot": "alert-dialog-footer",
248
- className: footer({ className }),
249
- ...props
250
- });
251
- }
252
- function AlertDialogTitle({ className, ...props }) {
253
- const { title } = alertDialog({ theme: useThemeFamily() });
254
- return /* @__PURE__ */ jsx(Dialog$1.Title, {
255
- "data-slot": "alert-dialog-title",
256
- className: title({ className }),
257
- ...props
258
- });
259
- }
260
- function AlertDialogDescription({ className, ...props }) {
261
- const { description } = alertDialog({ theme: useThemeFamily() });
262
- return /* @__PURE__ */ jsx(Dialog$1.Description, {
263
- "data-slot": "alert-dialog-description",
264
- className: description({ className }),
265
- ...props
266
- });
267
- }
268
- function AlertDialogAction(props) {
269
- return /* @__PURE__ */ jsx(Button$1, {
270
- "data-slot": "alert-dialog-action",
271
- ...props
272
- });
273
- }
274
- function AlertDialogCancel({ className, variant = "outline", size = "sm", ...props }) {
275
- return /* @__PURE__ */ jsx(Dialog$1.Close, {
276
- "data-slot": "alert-dialog-cancel",
277
- render: /* @__PURE__ */ jsx(Button$1, {
278
- className,
279
- variant,
280
- size
281
- }),
282
- ...props
283
- });
284
- }
285
- //#endregion
13
+ import { Drawer } from "vaul";
286
14
  //#region src/components/toggle-group/toggle-group.tsx
287
15
  const toggleGroup = tv({
288
16
  slots: {
@@ -690,10 +418,10 @@ const panelHeader = tv({
690
418
  },
691
419
  variants: { theme: {
692
420
  brutal: {
693
- root: "border-b-2 border-line-strong bg-layer-panel",
694
- icon: "border-line-strong",
695
- title: "text-foreground-strong",
696
- subtitle: "text-foreground/50"
421
+ root: "border-b-2 border-black bg-white",
422
+ icon: "border-black",
423
+ title: "text-black",
424
+ subtitle: "text-black/50"
697
425
  },
698
426
  elegant: {}
699
427
  } }
@@ -911,7 +639,7 @@ function QuotedMessageCardThread({ className, render, children = "Thread", ...pr
911
639
  render,
912
640
  props: mergeProps({
913
641
  className: thread({ className }),
914
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageSquare, {}), children] })
642
+ children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MessageSquare, {}), children] })
915
643
  }, props),
916
644
  state: { slot: "quoted-message-card-thread" }
917
645
  });
@@ -1293,7 +1021,7 @@ const lightbox = tv({
1293
1021
  title: ["text-foreground-strong"],
1294
1022
  media: ["border-line-strong bg-layer-panel shadow-xl"]
1295
1023
  },
1296
- elegant: {}
1024
+ elegant: { backdrop: ["backdrop-blur-[2px]"] }
1297
1025
  } }
1298
1026
  });
1299
1027
  function Lightbox({ closeOnModW = true, defaultOpen = false, modal = true, onOpenChange, open, children, ...props }) {
@@ -1305,7 +1033,7 @@ function Lightbox({ closeOnModW = true, defaultOpen = false, modal = true, onOpe
1305
1033
  onOpenChange?.(nextOpen, eventDetails);
1306
1034
  }, [onOpenChange, open]);
1307
1035
  const modWClose = closeOnModW && effectiveOpen ? /* @__PURE__ */ jsx(LightboxModWClose, { dialogRef }) : null;
1308
- return /* @__PURE__ */ jsxs(Dialog$1.Root, {
1036
+ return /* @__PURE__ */ jsxs(Dialog.Root, {
1309
1037
  actionsRef: dialogRef,
1310
1038
  defaultOpen,
1311
1039
  modal,
@@ -1327,23 +1055,25 @@ function LightboxModWClose({ dialogRef }) {
1327
1055
  return null;
1328
1056
  }
1329
1057
  function LightboxTrigger(props) {
1330
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
1058
+ return /* @__PURE__ */ jsx(Dialog.Trigger, {
1331
1059
  "data-slot": "lightbox-trigger",
1332
1060
  ...props
1333
1061
  });
1334
1062
  }
1335
1063
  function LightboxPortal(props) {
1336
- return /* @__PURE__ */ jsx(Dialog$1.Portal, {
1064
+ return /* @__PURE__ */ jsx(Dialog.Portal, {
1337
1065
  "data-slot": "lightbox-portal",
1338
1066
  ...props
1339
1067
  });
1340
1068
  }
1341
1069
  function LightboxContent({ className, initialFocus = false, finalFocus = false, ...props }) {
1342
- const { backdrop, content } = lightbox({ theme: useThemeFamily() });
1343
- return /* @__PURE__ */ jsxs(LightboxPortal, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, {
1070
+ const theme = useThemeFamily();
1071
+ const { backdrop, content } = lightbox({ theme });
1072
+ return /* @__PURE__ */ jsxs(LightboxPortal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {
1344
1073
  "data-slot": "lightbox-backdrop",
1074
+ "data-theme": theme,
1345
1075
  className: backdrop()
1346
- }), /* @__PURE__ */ jsx(Dialog$1.Popup, {
1076
+ }), /* @__PURE__ */ jsx(Dialog.Popup, {
1347
1077
  "data-slot": "lightbox-content",
1348
1078
  initialFocus,
1349
1079
  finalFocus,
@@ -1398,7 +1128,7 @@ function LightboxMedia({ render, className, ...props }) {
1398
1128
  }
1399
1129
  function LightboxClose({ className, ...props }) {
1400
1130
  const { close } = lightbox({ theme: useThemeFamily() });
1401
- return /* @__PURE__ */ jsx(Dialog$1.Close, {
1131
+ return /* @__PURE__ */ jsx(Dialog.Close, {
1402
1132
  "data-slot": "lightbox-close",
1403
1133
  className: close({ className }),
1404
1134
  ...props
@@ -1408,45 +1138,133 @@ function LightboxClose({ className, ...props }) {
1408
1138
  //#region src/components/bottom-sheet/bottom-sheet.tsx
1409
1139
  const bottomSheet = tv({
1410
1140
  slots: {
1411
- content: ["fixed inset-x-3 bottom-[max(12px,env(safe-area-inset-bottom))] z-50 mx-auto max-w-md"],
1412
- header: ["flex flex-col gap-1 p-4"],
1413
- footer: ["mt-auto flex flex-col gap-2 p-4"],
1414
- title: ["text-base font-bold text-foreground-strong"],
1415
- description: ["text-sm text-foreground/60"]
1141
+ portal: [],
1142
+ overlay: ["fixed inset-0 z-50", "![animation-duration:0.2s]"],
1143
+ positioner: ["contents"],
1144
+ content: [
1145
+ "fixed z-50 flex h-auto flex-col outline-none",
1146
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 md:data-[vaul-drawer-direction=bottom]:inset-x-3",
1147
+ "data-[vaul-drawer-direction=bottom]:mx-auto data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:min-h-64 data-[vaul-drawer-direction=bottom]:max-h-[82vh] data-[vaul-drawer-direction=bottom]:max-w-lg md:data-[vaul-drawer-direction=bottom]:max-w-md",
1148
+ "data-[vaul-drawer-direction=top]:inset-x-3 data-[vaul-drawer-direction=top]:top-3",
1149
+ "data-[vaul-drawer-direction=top]:mx-auto data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:max-w-md",
1150
+ "data-[vaul-drawer-direction=left]:inset-y-3 data-[vaul-drawer-direction=left]:left-3 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:max-w-sm",
1151
+ "data-[vaul-drawer-direction=right]:inset-y-3 data-[vaul-drawer-direction=right]:right-3 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:max-w-sm",
1152
+ "!duration-200 ![animation-duration:0.2s]"
1153
+ ],
1154
+ header: ["flex flex-col items-center px-6 pt-8 pb-2 text-center"],
1155
+ body: ["flex flex-1 flex-col items-center px-6 pt-4 pb-6 text-center"],
1156
+ footer: ["mt-auto px-6 py-5 md:pb-11"],
1157
+ actions: ["mx-auto w-full items-center justify-center gap-2.5", "[&_[data-slot=button]]:w-full"],
1158
+ title: ["max-w-sm text-pretty text-center text-2xl leading-8 text-foreground-strong"],
1159
+ description: ["max-w-sm text-pretty text-center text-sm leading-5 text-foreground/60"]
1416
1160
  },
1417
1161
  variants: { theme: {
1418
- brutal: { content: ["border-2 border-line-strong bg-layer-panel shadow-xl"] },
1419
- elegant: {}
1162
+ brutal: {
1163
+ overlay: ["bg-layer-backdrop"],
1164
+ title: ["font-bold"],
1165
+ content: [
1166
+ "border-2 border-black bg-white text-black shadow-[var(--shadow-lg)]",
1167
+ "data-[vaul-drawer-direction=bottom]:border-x-0 md:data-[vaul-drawer-direction=bottom]:border-x-2",
1168
+ "data-[vaul-drawer-direction=bottom]:border-b-0 md:data-[vaul-drawer-direction=bottom]:border-b-2"
1169
+ ]
1170
+ },
1171
+ elegant: {
1172
+ overlay: ["bg-layer-backdrop backdrop-blur-[2px]"],
1173
+ content: [
1174
+ "overflow-clip rounded-lg bg-layer-popover text-foreground shadow-xl md:rounded-xl",
1175
+ "data-[vaul-drawer-direction=bottom]:rounded-b-none",
1176
+ "md:data-[vaul-drawer-direction=bottom]:max-w-md",
1177
+ "md:data-[vaul-drawer-direction=top]:max-w-md",
1178
+ "md:data-[vaul-drawer-direction=left]:max-w-md",
1179
+ "md:data-[vaul-drawer-direction=right]:max-w-md"
1180
+ ],
1181
+ header: ["bg-white px-8 pt-9 pb-2"],
1182
+ body: ["bg-white px-8 pt-4 pb-7"],
1183
+ footer: ["mt-0 px-8 py-5 md:pb-11"],
1184
+ actions: ["flex w-fit max-w-none flex-row justify-center", "[&_[data-slot=button]]:w-auto"],
1185
+ title: ["font-sans text-2xl leading-8 font-semibold text-[oklch(0.22_0_0)]"],
1186
+ description: ["font-sans text-sm leading-5 text-[oklch(0.48_0_0)]"]
1187
+ }
1420
1188
  } }
1421
1189
  });
1422
- function BottomSheet(props) {
1423
- return /* @__PURE__ */ jsx(Dialog$1.Root, { ...props });
1190
+ function BottomSheet({ direction = "bottom", ...props }) {
1191
+ return /* @__PURE__ */ jsx(Drawer.Root, {
1192
+ direction,
1193
+ ...props
1194
+ });
1424
1195
  }
1425
- function BottomSheetTrigger(props) {
1426
- return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
1196
+ function BottomSheetTrigger({ children, render, ...props }) {
1197
+ if (render) return /* @__PURE__ */ jsx(Drawer.Trigger, {
1427
1198
  "data-slot": "bottom-sheet-trigger",
1199
+ asChild: true,
1200
+ ...props,
1201
+ children: cloneElement(render, void 0, children ?? render.props.children)
1202
+ });
1203
+ return /* @__PURE__ */ jsx(Drawer.Trigger, {
1204
+ "data-slot": "bottom-sheet-trigger",
1205
+ ...props,
1206
+ children
1207
+ });
1208
+ }
1209
+ function BottomSheetPortal({ className, children, ...props }) {
1210
+ const portalChildren = Children.map(children, (child) => {
1211
+ if (isValidElement(child) && child.type === BottomSheetPositioner) return Children.map(child.props.children, (positionerChild) => withPortalClassName(positionerChild, className));
1212
+ return withPortalClassName(child, className);
1213
+ });
1214
+ return /* @__PURE__ */ jsx(Drawer.Portal, {
1215
+ ...props,
1216
+ children: portalChildren
1217
+ });
1218
+ }
1219
+ function withPortalClassName(child, className) {
1220
+ if (!className || !isValidElement(child)) return child;
1221
+ return cloneElement(child, { className: cn(child.props.className, className) });
1222
+ }
1223
+ function BottomSheetPositioner({ className, ...props }) {
1224
+ const { positioner } = bottomSheet({ theme: useThemeFamily() });
1225
+ return /* @__PURE__ */ jsx("div", {
1226
+ "data-slot": "bottom-sheet-positioner",
1227
+ className: positioner({ className }),
1428
1228
  ...props
1429
1229
  });
1430
1230
  }
1431
- function BottomSheetPortal(props) {
1432
- return /* @__PURE__ */ jsx(Dialog$1.Portal, {
1433
- "data-slot": "bottom-sheet-portal",
1231
+ function BottomSheetOverlay({ className, ...props }) {
1232
+ const theme = useThemeFamily();
1233
+ const { overlay } = bottomSheet({ theme });
1234
+ return /* @__PURE__ */ jsx(Drawer.Overlay, {
1235
+ "data-slot": "bottom-sheet-overlay",
1236
+ "data-theme": theme,
1237
+ className: overlay({ className }),
1434
1238
  ...props
1435
1239
  });
1436
1240
  }
1437
1241
  function BottomSheetContent({ className, ...props }) {
1438
1242
  const { content } = bottomSheet({ theme: useThemeFamily() });
1439
- return /* @__PURE__ */ jsx(BottomSheetPortal, { children: /* @__PURE__ */ jsx(Dialog$1.Popup, {
1243
+ return /* @__PURE__ */ jsx(Drawer.Content, {
1440
1244
  "data-slot": "bottom-sheet-content",
1441
- "data-side": "bottom",
1442
1245
  className: content({ className }),
1443
1246
  ...props
1444
- }) });
1247
+ });
1445
1248
  }
1446
- function BottomSheetClose(props) {
1447
- return /* @__PURE__ */ jsx(Dialog$1.Close, {
1249
+ function BottomSheetClose({ className, variant, size, children, render, ...props }) {
1250
+ const isBrutal = useThemeFamily() === "brutal";
1251
+ if (render) return /* @__PURE__ */ jsx(Drawer.Close, {
1448
1252
  "data-slot": "bottom-sheet-close",
1449
- ...props
1253
+ asChild: true,
1254
+ ...props,
1255
+ children: cloneElement(render, void 0, children ?? render.props.children)
1256
+ });
1257
+ return /* @__PURE__ */ jsx(Drawer.Close, {
1258
+ "data-slot": "bottom-sheet-close",
1259
+ asChild: true,
1260
+ ...props,
1261
+ children: /* @__PURE__ */ jsx(Button$1, {
1262
+ variant: variant ?? (isBrutal ? "outline" : "ghost"),
1263
+ size: size ?? (isBrutal ? "icon-sm" : "icon-sm"),
1264
+ "aria-label": "Close",
1265
+ className: cn(isBrutal ? "absolute top-3 right-3" : "absolute top-4 right-6", isBrutal ? "bg-white" : "p-0 text-foreground-placeholder hover:bg-transparent hover:text-foreground", className),
1266
+ children: children ?? /* @__PURE__ */ jsx(X, { className: "size-4" })
1267
+ })
1450
1268
  });
1451
1269
  }
1452
1270
  function BottomSheetHeader({ className, render, ...props }) {
@@ -1467,9 +1285,38 @@ function BottomSheetFooter({ className, render, ...props }) {
1467
1285
  state: { slot: "bottom-sheet-footer" }
1468
1286
  });
1469
1287
  }
1288
+ function BottomSheetBody({ className, render, ...props }) {
1289
+ const { body } = bottomSheet({ theme: useThemeFamily() });
1290
+ return useRender({
1291
+ defaultTagName: "div",
1292
+ render,
1293
+ props: mergeProps({ className: body({ className }) }, props),
1294
+ state: { slot: "bottom-sheet-body" }
1295
+ });
1296
+ }
1297
+ function BottomSheetActions({ className, render, children, ...props }) {
1298
+ const theme = useThemeFamily();
1299
+ const { actions } = bottomSheet({ theme });
1300
+ const count = Math.min(3, countActionChildren(children));
1301
+ return useRender({
1302
+ defaultTagName: "div",
1303
+ render,
1304
+ props: mergeProps({
1305
+ className: actions({ className: cn(theme === "elegant" ? "flex-row" : count <= 1 ? "flex max-w-64 flex-col" : count === 2 ? "flex max-w-64 flex-col-reverse" : "grid max-w-[32rem] grid-cols-3", className) }),
1306
+ children
1307
+ }, props),
1308
+ state: { slot: "bottom-sheet-actions" }
1309
+ });
1310
+ }
1311
+ function countActionChildren(children) {
1312
+ return Children.toArray(children).reduce((count, child) => {
1313
+ if (isValidElement(child) && child.type === Fragment) return count + countActionChildren(child.props.children);
1314
+ return count + 1;
1315
+ }, 0);
1316
+ }
1470
1317
  function BottomSheetTitle({ className, ...props }) {
1471
1318
  const { title } = bottomSheet({ theme: useThemeFamily() });
1472
- return /* @__PURE__ */ jsx(Dialog$1.Title, {
1319
+ return /* @__PURE__ */ jsx(Drawer.Title, {
1473
1320
  "data-slot": "bottom-sheet-title",
1474
1321
  className: title({ className }),
1475
1322
  ...props
@@ -1477,11 +1324,11 @@ function BottomSheetTitle({ className, ...props }) {
1477
1324
  }
1478
1325
  function BottomSheetDescription({ className, ...props }) {
1479
1326
  const { description } = bottomSheet({ theme: useThemeFamily() });
1480
- return /* @__PURE__ */ jsx(Dialog$1.Description, {
1327
+ return /* @__PURE__ */ jsx(Drawer.Description, {
1481
1328
  "data-slot": "bottom-sheet-description",
1482
1329
  className: description({ className }),
1483
1330
  ...props
1484
1331
  });
1485
1332
  }
1486
1333
  //#endregion
1487
- export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, BottomSheet, BottomSheetClose, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetPortal, BottomSheetTitle, BottomSheetTrigger, ConversationPreviewCard, ConversationPreviewCardAction, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, ConversationPreviewCardAuthorSubtitle, ConversationPreviewCardChannel, ConversationPreviewCardContent, ConversationPreviewCardFooter, ConversationPreviewCardMeta, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, ConversationPreviewCardPreviewLeading, ConversationPreviewCardSecondaryPreview, ConversationPreviewCardTimestamp, DescriptionAction, DescriptionDetails, DescriptionItem, DescriptionList, DescriptionTerm, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Lightbox, LightboxActions, LightboxClose, LightboxContent, LightboxHeader, LightboxMedia, LightboxPortal, LightboxStage, LightboxTitle, LightboxTrigger, ListItem, ListItemActionGroup, ListItemBody, ListItemDescription, ListItemIcon, ListItemMeta, ListItemRow, ListItemTitle, MediaListItem, MediaListItemActionGroup, MediaListItemAside, MediaListItemBody, MediaListItemSubtitle, MediaListItemText, MediaListItemTitle, MediaListItemVisual, PanelHeader, PanelHeaderActions, PanelHeaderContent, PanelHeaderIcon, PanelHeaderSubtitle, PanelHeaderSuffix, PanelHeaderTitle, PanelHeaderTitleRow, PanelHeaderVisual, PreviewShell, QuotedMessageCard, QuotedMessageCardAttachments, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, QuotedMessageCardAuthorSubtitle, QuotedMessageCardBody, QuotedMessageCardChannel, QuotedMessageCardContent, QuotedMessageCardContentWrap, QuotedMessageCardHeader, QuotedMessageCardMeta, QuotedMessageCardSeparator, QuotedMessageCardTag, QuotedMessageCardThread, QuotedMessageCardTimestamp, QuotedMessageCardUnavailable, SectionHeader, SectionHeaderActions, SectionHeaderContent, SectionHeaderCount, SectionHeaderIcon, SectionHeaderTitle, SectionLabel, ToggleGroup, ToggleGroupCount, ToggleGroupItem, ToggleGroupLabel };
1334
+ export { BottomSheet, BottomSheetActions, BottomSheetBody, BottomSheetClose, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetOverlay, BottomSheetPortal, BottomSheetPositioner, BottomSheetTitle, BottomSheetTrigger, ConversationPreviewCard, ConversationPreviewCardAction, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, ConversationPreviewCardAuthorSubtitle, ConversationPreviewCardChannel, ConversationPreviewCardContent, ConversationPreviewCardFooter, ConversationPreviewCardMeta, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, ConversationPreviewCardPreviewLeading, ConversationPreviewCardSecondaryPreview, ConversationPreviewCardTimestamp, DescriptionAction, DescriptionDetails, DescriptionItem, DescriptionList, DescriptionTerm, Lightbox, LightboxActions, LightboxClose, LightboxContent, LightboxHeader, LightboxMedia, LightboxPortal, LightboxStage, LightboxTitle, LightboxTrigger, ListItem, ListItemActionGroup, ListItemBody, ListItemDescription, ListItemIcon, ListItemMeta, ListItemRow, ListItemTitle, MediaListItem, MediaListItemActionGroup, MediaListItemAside, MediaListItemBody, MediaListItemSubtitle, MediaListItemText, MediaListItemTitle, MediaListItemVisual, PanelHeader, PanelHeaderActions, PanelHeaderContent, PanelHeaderIcon, PanelHeaderSubtitle, PanelHeaderSuffix, PanelHeaderTitle, PanelHeaderTitleRow, PanelHeaderVisual, PreviewShell, QuotedMessageCard, QuotedMessageCardAttachments, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, QuotedMessageCardAuthorSubtitle, QuotedMessageCardBody, QuotedMessageCardChannel, QuotedMessageCardContent, QuotedMessageCardContentWrap, QuotedMessageCardHeader, QuotedMessageCardMeta, QuotedMessageCardSeparator, QuotedMessageCardTag, QuotedMessageCardThread, QuotedMessageCardTimestamp, QuotedMessageCardUnavailable, SectionHeader, SectionHeaderActions, SectionHeaderContent, SectionHeaderCount, SectionHeaderIcon, SectionHeaderTitle, SectionLabel, ToggleGroup, ToggleGroupCount, ToggleGroupItem, ToggleGroupLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raft-ui",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "React UI components for Raft.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -39,8 +39,10 @@
39
39
  "@dnd-kit/utilities": "^3.2.2",
40
40
  "@tanstack/react-hotkeys": "^0.10.0",
41
41
  "cnfast": "^0.0.7",
42
+ "foxact": "^0.3.7",
42
43
  "lucide-react": "^1.21.0",
43
- "tailwind-variants": "^3.2.2"
44
+ "tailwind-variants": "^3.2.2",
45
+ "vaul": "^1.1.2"
44
46
  },
45
47
  "devDependencies": {
46
48
  "@types/node": "^26.0.0",