create-disposabl-app 0.9.1 → 0.10.1

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 (90) hide show
  1. package/dist/disposabl.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/templates/default/.github/workflows/pipeline.yml +1 -1
  4. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
  5. package/dist/templates/default/bun.lock +77 -1397
  6. package/dist/templates/default/package.json +1 -2
  7. package/dist/templates/default/packages/backend/README.md +3 -1
  8. package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +6 -0
  9. package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +0 -2
  10. package/dist/templates/default/packages/backend/convex/auth.config.ts +2 -10
  11. package/dist/templates/default/packages/backend/convex/convex.config.ts +3 -14
  12. package/dist/templates/default/packages/backend/convex/mcpEnterprise/README.md +42 -0
  13. package/dist/templates/default/packages/backend/convex/mcpEnterprise/internal.ts +153 -0
  14. package/dist/templates/default/packages/backend/convex/mcpEnterprise/provision.ts +102 -0
  15. package/dist/templates/default/packages/backend/convex/mcpEnterprise/validator.ts +35 -0
  16. package/dist/templates/default/packages/backend/convex/schema.ts +18 -0
  17. package/dist/templates/default/packages/backend/package.json +0 -1
  18. package/dist/templates/default/packages/cli/README.md +9 -24
  19. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
  20. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
  21. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +71 -13
  22. package/dist/templates/default/packages/disposabl-kit/package.json +4 -14
  23. package/dist/templates/default/packages/disposabl-kit/server/http.ts +19 -12
  24. package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +12 -0
  25. package/dist/templates/default/packages/disposabl-kit/server/mcp/enterprise.ts +267 -0
  26. package/dist/templates/default/packages/disposabl-kit/server/mcp/identity.ts +33 -0
  27. package/dist/templates/default/vendor/README.md +30 -0
  28. package/dist/templates/default/vendor/convex-auth-6c0ebf3f.tgz +0 -0
  29. package/package.json +1 -1
  30. package/dist/templates/default/apps/web/src/components/connections/expo-connection.tsx +0 -97
  31. package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +0 -44
  32. package/dist/templates/default/apps/web/src/components/connections/use-connection-setup.ts +0 -169
  33. package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +0 -77
  34. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +0 -185
  35. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +0 -75
  36. package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +0 -22
  37. package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +0 -207
  38. package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +0 -106
  39. package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +0 -51
  40. package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +0 -121
  41. package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +0 -127
  42. package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +0 -87
  43. package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +0 -241
  44. package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +0 -239
  45. package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +0 -368
  46. package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +0 -27
  47. package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +0 -243
  48. package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +0 -19
  49. package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +0 -300
  50. package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +0 -194
  51. package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +0 -271
  52. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +0 -156
  53. package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +0 -4
  54. package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +0 -224
  55. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +0 -269
  56. package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +0 -103
  57. package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +0 -50
  58. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +0 -158
  59. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +0 -83
  60. package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +0 -201
  61. package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +0 -26
  62. package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +0 -70
  63. package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +0 -284
  64. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +0 -128
  65. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +0 -91
  66. package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +0 -64
  67. package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +0 -170
  68. package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +0 -133
  69. package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +0 -87
  70. package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +0 -82
  71. package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +0 -330
  72. package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +0 -35
  73. package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +0 -49
  74. package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +0 -51
  75. package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +0 -201
  76. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +0 -132
  77. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +0 -723
  78. package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +0 -13
  79. package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +0 -51
  80. package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +0 -31
  81. package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +0 -113
  82. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +0 -81
  83. package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +0 -17
  84. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +0 -229
  85. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +0 -87
  86. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +0 -42
  87. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +0 -65
  88. package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +0 -161
  89. package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +0 -21
  90. package/dist/templates/default/patches/@convex-dev%2Fauth@2.0.0-beta.0.patch +0 -310
@@ -1,271 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
5
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
6
- import { ChevronRightIcon, CheckIcon } from "lucide-react";
7
-
8
- function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
9
- return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
10
- }
11
-
12
- function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
13
- return (
14
- <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
15
- );
16
- }
17
-
18
- function ContextMenuTrigger({
19
- className,
20
- ...props
21
- }: ContextMenuPrimitive.Trigger.Props) {
22
- return (
23
- <ContextMenuPrimitive.Trigger
24
- data-slot="context-menu-trigger"
25
- className={cn("select-none", className)}
26
- {...props}
27
- />
28
- );
29
- }
30
-
31
- function ContextMenuContent({
32
- className,
33
- align = "start",
34
- alignOffset = 4,
35
- side = "right",
36
- sideOffset = 0,
37
- ...props
38
- }: ContextMenuPrimitive.Popup.Props &
39
- Pick<
40
- ContextMenuPrimitive.Positioner.Props,
41
- "align" | "alignOffset" | "side" | "sideOffset"
42
- >) {
43
- return (
44
- <ContextMenuPrimitive.Portal>
45
- <ContextMenuPrimitive.Positioner
46
- className="isolate z-50 outline-none"
47
- align={align}
48
- alignOffset={alignOffset}
49
- side={side}
50
- sideOffset={sideOffset}
51
- >
52
- <ContextMenuPrimitive.Popup
53
- data-slot="context-menu-content"
54
- className={cn(
55
- "z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
56
- className,
57
- )}
58
- {...props}
59
- />
60
- </ContextMenuPrimitive.Positioner>
61
- </ContextMenuPrimitive.Portal>
62
- );
63
- }
64
-
65
- function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
66
- return (
67
- <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
68
- );
69
- }
70
-
71
- function ContextMenuLabel({
72
- className,
73
- inset,
74
- ...props
75
- }: ContextMenuPrimitive.GroupLabel.Props & {
76
- inset?: boolean;
77
- }) {
78
- return (
79
- <ContextMenuPrimitive.GroupLabel
80
- data-slot="context-menu-label"
81
- data-inset={inset}
82
- className={cn(
83
- "px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8",
84
- className,
85
- )}
86
- {...props}
87
- />
88
- );
89
- }
90
-
91
- function ContextMenuItem({
92
- className,
93
- inset,
94
- variant = "default",
95
- ...props
96
- }: ContextMenuPrimitive.Item.Props & {
97
- inset?: boolean;
98
- variant?: "default" | "destructive";
99
- }) {
100
- return (
101
- <ContextMenuPrimitive.Item
102
- data-slot="context-menu-item"
103
- data-inset={inset}
104
- data-variant={variant}
105
- className={cn(
106
- "group/context-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
107
- className,
108
- )}
109
- {...props}
110
- />
111
- );
112
- }
113
-
114
- function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
115
- return (
116
- <ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
117
- );
118
- }
119
-
120
- function ContextMenuSubTrigger({
121
- className,
122
- inset,
123
- children,
124
- ...props
125
- }: ContextMenuPrimitive.SubmenuTrigger.Props & {
126
- inset?: boolean;
127
- }) {
128
- return (
129
- <ContextMenuPrimitive.SubmenuTrigger
130
- data-slot="context-menu-sub-trigger"
131
- data-inset={inset}
132
- className={cn(
133
- "flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
134
- className,
135
- )}
136
- {...props}
137
- >
138
- {children}
139
- <ChevronRightIcon className="ml-auto" />
140
- </ContextMenuPrimitive.SubmenuTrigger>
141
- );
142
- }
143
-
144
- function ContextMenuSubContent({
145
- ...props
146
- }: React.ComponentProps<typeof ContextMenuContent>) {
147
- return (
148
- <ContextMenuContent
149
- data-slot="context-menu-sub-content"
150
- className="shadow-lg"
151
- side="right"
152
- {...props}
153
- />
154
- );
155
- }
156
-
157
- function ContextMenuCheckboxItem({
158
- className,
159
- children,
160
- checked,
161
- inset,
162
- ...props
163
- }: ContextMenuPrimitive.CheckboxItem.Props & {
164
- inset?: boolean;
165
- }) {
166
- return (
167
- <ContextMenuPrimitive.CheckboxItem
168
- data-slot="context-menu-checkbox-item"
169
- data-inset={inset}
170
- className={cn(
171
- "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
172
- className,
173
- )}
174
- checked={checked}
175
- {...props}
176
- >
177
- <span className="pointer-events-none absolute right-2">
178
- <ContextMenuPrimitive.CheckboxItemIndicator>
179
- <CheckIcon />
180
- </ContextMenuPrimitive.CheckboxItemIndicator>
181
- </span>
182
- {children}
183
- </ContextMenuPrimitive.CheckboxItem>
184
- );
185
- }
186
-
187
- function ContextMenuRadioGroup({
188
- ...props
189
- }: ContextMenuPrimitive.RadioGroup.Props) {
190
- return (
191
- <ContextMenuPrimitive.RadioGroup
192
- data-slot="context-menu-radio-group"
193
- {...props}
194
- />
195
- );
196
- }
197
-
198
- function ContextMenuRadioItem({
199
- className,
200
- children,
201
- inset,
202
- ...props
203
- }: ContextMenuPrimitive.RadioItem.Props & {
204
- inset?: boolean;
205
- }) {
206
- return (
207
- <ContextMenuPrimitive.RadioItem
208
- data-slot="context-menu-radio-item"
209
- data-inset={inset}
210
- className={cn(
211
- "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
212
- className,
213
- )}
214
- {...props}
215
- >
216
- <span className="pointer-events-none absolute right-2">
217
- <ContextMenuPrimitive.RadioItemIndicator>
218
- <CheckIcon />
219
- </ContextMenuPrimitive.RadioItemIndicator>
220
- </span>
221
- {children}
222
- </ContextMenuPrimitive.RadioItem>
223
- );
224
- }
225
-
226
- function ContextMenuSeparator({
227
- className,
228
- ...props
229
- }: ContextMenuPrimitive.Separator.Props) {
230
- return (
231
- <ContextMenuPrimitive.Separator
232
- data-slot="context-menu-separator"
233
- className={cn("-mx-1 my-1 h-px bg-border", className)}
234
- {...props}
235
- />
236
- );
237
- }
238
-
239
- function ContextMenuShortcut({
240
- className,
241
- ...props
242
- }: React.ComponentProps<"span">) {
243
- return (
244
- <span
245
- data-slot="context-menu-shortcut"
246
- className={cn(
247
- "ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",
248
- className,
249
- )}
250
- {...props}
251
- />
252
- );
253
- }
254
-
255
- export {
256
- ContextMenu,
257
- ContextMenuTrigger,
258
- ContextMenuContent,
259
- ContextMenuItem,
260
- ContextMenuCheckboxItem,
261
- ContextMenuRadioItem,
262
- ContextMenuLabel,
263
- ContextMenuSeparator,
264
- ContextMenuShortcut,
265
- ContextMenuGroup,
266
- ContextMenuPortal,
267
- ContextMenuSub,
268
- ContextMenuSubContent,
269
- ContextMenuSubTrigger,
270
- ContextMenuRadioGroup,
271
- };
@@ -1,156 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
5
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
6
-
7
- import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
8
- import { XIcon } from "lucide-react";
9
-
10
- function Dialog({ ...props }: DialogPrimitive.Root.Props) {
11
- return <DialogPrimitive.Root data-slot="dialog" {...props} />;
12
- }
13
-
14
- function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
15
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
16
- }
17
-
18
- function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
19
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
20
- }
21
-
22
- function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
23
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
24
- }
25
-
26
- function DialogOverlay({
27
- className,
28
- ...props
29
- }: DialogPrimitive.Backdrop.Props) {
30
- return (
31
- <DialogPrimitive.Backdrop
32
- data-slot="dialog-overlay"
33
- className={cn(
34
- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
35
- className,
36
- )}
37
- {...props}
38
- />
39
- );
40
- }
41
-
42
- function DialogContent({
43
- className,
44
- children,
45
- showCloseButton = true,
46
- ...props
47
- }: DialogPrimitive.Popup.Props & {
48
- showCloseButton?: boolean;
49
- }) {
50
- return (
51
- <DialogPortal>
52
- <DialogOverlay />
53
- <DialogPrimitive.Popup
54
- data-slot="dialog-content"
55
- className={cn(
56
- "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
57
- className,
58
- )}
59
- {...props}
60
- >
61
- {children}
62
- {showCloseButton && (
63
- <DialogPrimitive.Close
64
- data-slot="dialog-close"
65
- render={
66
- <Button
67
- variant="ghost"
68
- className="absolute top-4 right-4"
69
- size="icon-sm"
70
- />
71
- }
72
- >
73
- <XIcon />
74
- <span className="sr-only">Close</span>
75
- </DialogPrimitive.Close>
76
- )}
77
- </DialogPrimitive.Popup>
78
- </DialogPortal>
79
- );
80
- }
81
-
82
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
83
- return (
84
- <div
85
- data-slot="dialog-header"
86
- className={cn("flex flex-col gap-2", className)}
87
- {...props}
88
- />
89
- );
90
- }
91
-
92
- function DialogFooter({
93
- className,
94
- showCloseButton = false,
95
- children,
96
- ...props
97
- }: React.ComponentProps<"div"> & {
98
- showCloseButton?: boolean;
99
- }) {
100
- return (
101
- <div
102
- data-slot="dialog-footer"
103
- className={cn(
104
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
105
- className,
106
- )}
107
- {...props}
108
- >
109
- {children}
110
- {showCloseButton && (
111
- <DialogPrimitive.Close render={<Button variant="outline" />}>
112
- Close
113
- </DialogPrimitive.Close>
114
- )}
115
- </div>
116
- );
117
- }
118
-
119
- function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
120
- return (
121
- <DialogPrimitive.Title
122
- data-slot="dialog-title"
123
- className={cn("font-heading leading-none font-medium", className)}
124
- {...props}
125
- />
126
- );
127
- }
128
-
129
- function DialogDescription({
130
- className,
131
- ...props
132
- }: DialogPrimitive.Description.Props) {
133
- return (
134
- <DialogPrimitive.Description
135
- data-slot="dialog-description"
136
- className={cn(
137
- "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
138
- className,
139
- )}
140
- {...props}
141
- />
142
- );
143
- }
144
-
145
- export {
146
- Dialog,
147
- DialogClose,
148
- DialogContent,
149
- DialogDescription,
150
- DialogFooter,
151
- DialogHeader,
152
- DialogOverlay,
153
- DialogPortal,
154
- DialogTitle,
155
- DialogTrigger,
156
- };
@@ -1,4 +0,0 @@
1
- export {
2
- DirectionProvider,
3
- useDirection,
4
- } from "@base-ui/react/direction-provider";
@@ -1,224 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
5
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
6
-
7
- type DrawerContextProps = {
8
- hasSnapPoints: boolean;
9
- modal: DrawerPrimitive.Root.Props["modal"];
10
- showSwipeHandle: boolean;
11
- swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>;
12
- };
13
-
14
- const DrawerContext = React.createContext<DrawerContextProps | null>(null);
15
-
16
- function useDrawer() {
17
- const context = React.useContext(DrawerContext);
18
-
19
- if (!context) {
20
- throw new Error("useDrawer must be used within a Drawer.");
21
- }
22
-
23
- return context;
24
- }
25
-
26
- function Drawer({
27
- modal = true,
28
- showSwipeHandle = false,
29
- snapPoints,
30
- swipeDirection = "down",
31
- ...props
32
- }: DrawerPrimitive.Root.Props & {
33
- showSwipeHandle?: boolean;
34
- }) {
35
- const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
36
- const contextValue = React.useMemo(
37
- () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
38
- [hasSnapPoints, modal, showSwipeHandle, swipeDirection],
39
- );
40
-
41
- return (
42
- <DrawerContext.Provider value={contextValue}>
43
- <DrawerPrimitive.Root
44
- data-slot="drawer"
45
- modal={modal}
46
- snapPoints={snapPoints}
47
- swipeDirection={swipeDirection}
48
- {...props}
49
- />
50
- </DrawerContext.Provider>
51
- );
52
- }
53
-
54
- function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
55
- return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
56
- }
57
-
58
- function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
59
- return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
60
- }
61
-
62
- function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
63
- return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
64
- }
65
-
66
- function DrawerOverlay({
67
- className,
68
- ...props
69
- }: DrawerPrimitive.Backdrop.Props) {
70
- return (
71
- <DrawerPrimitive.Backdrop
72
- data-slot="drawer-overlay"
73
- className={cn(
74
- "fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",
75
- className,
76
- )}
77
- {...props}
78
- />
79
- );
80
- }
81
-
82
- function DrawerSwipeHandle({
83
- className,
84
- ...props
85
- }: React.ComponentProps<"div">) {
86
- return (
87
- <div
88
- data-slot="drawer-swipe-handle"
89
- aria-hidden="true"
90
- className={cn(
91
- "relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-[100px] group-data-[swipe-axis=x]/drawer-popup:after:w-1.5 group-data-[swipe-axis=y]/drawer-popup:after:h-1.5 group-data-[swipe-axis=y]/drawer-popup:after:w-[100px] active:cursor-grabbing",
92
- className,
93
- )}
94
- {...props}
95
- />
96
- );
97
- }
98
-
99
- function DrawerContent({
100
- className,
101
- children,
102
- ...props
103
- }: DrawerPrimitive.Popup.Props) {
104
- const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
105
- const swipeAxis =
106
- swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
107
-
108
- return (
109
- <DrawerPortal data-slot="drawer-portal">
110
- {modal === true && (
111
- <DrawerOverlay data-snap-points={hasSnapPoints ? "" : undefined} />
112
- )}
113
- <DrawerPrimitive.Viewport
114
- data-slot="drawer-viewport"
115
- data-modal={modal}
116
- className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
117
- >
118
- <DrawerPrimitive.Popup
119
- data-slot="drawer-popup"
120
- data-swipe-axis={swipeAxis}
121
- data-snap-points={hasSnapPoints ? "" : undefined}
122
- className={cn(
123
- // Base.
124
- "group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
125
- // Nested.
126
- "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
127
- // Bleed.
128
- "after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
129
- // Sizing.
130
- "[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
131
- // Stack.
132
- "[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
133
- // Transitions.
134
- "data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
135
- // Axis: y.
136
- "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
137
- // Axis: x.
138
- "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
139
- // Direction: down.
140
- "data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
141
- // Direction: up.
142
- "data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
143
- // Direction: left.
144
- "data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
145
- // Direction: right.
146
- "data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]",
147
- className,
148
- )}
149
- {...props}
150
- >
151
- {showSwipeHandle && <DrawerSwipeHandle />}
152
- <DrawerPrimitive.Content
153
- data-slot="drawer-content"
154
- className={cn(
155
- "flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none",
156
- )}
157
- >
158
- {children}
159
- </DrawerPrimitive.Content>
160
- </DrawerPrimitive.Popup>
161
- </DrawerPrimitive.Viewport>
162
- </DrawerPortal>
163
- );
164
- }
165
-
166
- function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
167
- return (
168
- <div
169
- data-slot="drawer-header"
170
- className={cn(
171
- "flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-1.5 md:text-left",
172
- className,
173
- )}
174
- {...props}
175
- />
176
- );
177
- }
178
-
179
- function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
180
- return (
181
- <div
182
- data-slot="drawer-footer"
183
- className={cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className)}
184
- {...props}
185
- />
186
- );
187
- }
188
-
189
- function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
190
- return (
191
- <DrawerPrimitive.Title
192
- data-slot="drawer-title"
193
- className={cn("font-heading font-medium text-foreground", className)}
194
- {...props}
195
- />
196
- );
197
- }
198
-
199
- function DrawerDescription({
200
- className,
201
- ...props
202
- }: DrawerPrimitive.Description.Props) {
203
- return (
204
- <DrawerPrimitive.Description
205
- data-slot="drawer-description"
206
- className={cn("text-sm text-balance text-muted-foreground", className)}
207
- {...props}
208
- />
209
- );
210
- }
211
-
212
- export {
213
- Drawer,
214
- DrawerPortal,
215
- DrawerOverlay,
216
- DrawerSwipeHandle,
217
- DrawerTrigger,
218
- DrawerClose,
219
- DrawerContent,
220
- DrawerHeader,
221
- DrawerFooter,
222
- DrawerTitle,
223
- DrawerDescription,
224
- };