@ngrok/mantle 0.22.0 → 0.22.2
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/sheet.d.ts +559 -24
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/package.json +5 -5
package/dist/sheet.d.ts
CHANGED
|
@@ -11,76 +11,611 @@ import './variant-props-oDo2u-We.js';
|
|
|
11
11
|
import './deep-non-nullable-SmpSvoSd.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* The root component for a
|
|
15
|
-
* Acts as a stateful provider for the
|
|
14
|
+
* The root component for a `Sheet`. Should compose the `SheetTrigger` and `SheetContent`.
|
|
15
|
+
* Acts as a stateful provider for the Sheet's open/closed state.
|
|
16
|
+
*
|
|
17
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // Triggering a stateful sheet
|
|
22
|
+
* <Sheet>
|
|
23
|
+
* <SheetTrigger asChild>
|
|
24
|
+
* <Button type="button" appearance="filled">
|
|
25
|
+
* Open Sheet
|
|
26
|
+
* </Button>
|
|
27
|
+
* </SheetTrigger>
|
|
28
|
+
* <SheetContent>
|
|
29
|
+
* <SheetHeader>
|
|
30
|
+
* <SheetTitleGroup>
|
|
31
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
32
|
+
* <SheetActions>
|
|
33
|
+
* <IconButton
|
|
34
|
+
* appearance="ghost"
|
|
35
|
+
* type="button"
|
|
36
|
+
* icon={<TrashSimple />}
|
|
37
|
+
* label="Delete"
|
|
38
|
+
* />
|
|
39
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
40
|
+
* <SheetCloseIconButton />
|
|
41
|
+
* </SheetActions>
|
|
42
|
+
* </SheetTitleGroup>
|
|
43
|
+
* <SheetDescription>
|
|
44
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
45
|
+
* </SheetDescription>
|
|
46
|
+
* </SheetHeader>
|
|
47
|
+
* <SheetBody>
|
|
48
|
+
* <p>
|
|
49
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
50
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
51
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
52
|
+
* proident amet.
|
|
53
|
+
* </p>
|
|
54
|
+
* </SheetBody>
|
|
55
|
+
* <SheetFooter>
|
|
56
|
+
* <SheetClose asChild>
|
|
57
|
+
* <Button type="button">Close</Button>
|
|
58
|
+
* </SheetClose>
|
|
59
|
+
* <Button type="button" appearance="filled">
|
|
60
|
+
* Save
|
|
61
|
+
* </Button>
|
|
62
|
+
* </SheetFooter>
|
|
63
|
+
* </SheetContent>
|
|
64
|
+
* </Sheet>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
70
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
71
|
+
* <SheetContent>
|
|
72
|
+
* <SheetHeader>
|
|
73
|
+
* <SheetTitleGroup>
|
|
74
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
75
|
+
* <SheetActions>
|
|
76
|
+
* <IconButton
|
|
77
|
+
* appearance="ghost"
|
|
78
|
+
* type="button"
|
|
79
|
+
* icon={<TrashSimple />}
|
|
80
|
+
* label="Delete"
|
|
81
|
+
* />
|
|
82
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
83
|
+
* <SheetCloseIconButton />
|
|
84
|
+
* </SheetActions>
|
|
85
|
+
* </SheetTitleGroup>
|
|
86
|
+
* <SheetDescription>
|
|
87
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
88
|
+
* </SheetDescription>
|
|
89
|
+
* </SheetHeader>
|
|
90
|
+
* <SheetBody>
|
|
91
|
+
* <p>
|
|
92
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
93
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
94
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
95
|
+
* proident amet.
|
|
96
|
+
* </p>
|
|
97
|
+
* </SheetBody>
|
|
98
|
+
* <SheetFooter>
|
|
99
|
+
* <SheetClose asChild>
|
|
100
|
+
* <Button type="button">Close</Button>
|
|
101
|
+
* </SheetClose>
|
|
102
|
+
* <Button type="button" appearance="filled">
|
|
103
|
+
* Save
|
|
104
|
+
* </Button>
|
|
105
|
+
* </SheetFooter>
|
|
106
|
+
* </SheetContent>
|
|
107
|
+
* </Sheet>
|
|
108
|
+
* ```
|
|
16
109
|
*/
|
|
17
110
|
declare const Sheet: typeof Root;
|
|
18
111
|
/**
|
|
19
|
-
* The trigger for a
|
|
112
|
+
* The button trigger for a `Sheet`. Should be rendered as a child of the `Sheet` component.
|
|
20
113
|
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
114
|
+
*
|
|
115
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-trigger
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* <Sheet>
|
|
120
|
+
* <SheetTrigger asChild>
|
|
121
|
+
* <Button type="button" appearance="filled">
|
|
122
|
+
* Open Sheet
|
|
123
|
+
* </Button>
|
|
124
|
+
* </SheetTrigger>
|
|
125
|
+
* <SheetContent>
|
|
126
|
+
* <p>
|
|
127
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
128
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
129
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
130
|
+
* proident amet.
|
|
131
|
+
* </p>
|
|
132
|
+
* </SheetContent>
|
|
133
|
+
* </Sheet>
|
|
134
|
+
* ```
|
|
21
135
|
*/
|
|
22
136
|
declare const SheetTrigger: react.ForwardRefExoticComponent<_radix_ui_react_dialog.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
23
137
|
/**
|
|
24
|
-
* The close button for a
|
|
138
|
+
* The close button for a `Sheet`. Should be rendered as a child of the `SheetContent` component.
|
|
139
|
+
* Usually contained within the `SheetFooter` component.
|
|
25
140
|
* Renders an unstyled button by default, but can be customized with the `asChild` prop.
|
|
141
|
+
*
|
|
142
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-close
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* <Sheet>
|
|
147
|
+
* <SheetTrigger asChild>
|
|
148
|
+
* <Button type="button" appearance="filled">
|
|
149
|
+
* Open Sheet
|
|
150
|
+
* </Button>
|
|
151
|
+
* </SheetTrigger>
|
|
152
|
+
* <SheetContent>
|
|
153
|
+
* <p>
|
|
154
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
155
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
156
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
157
|
+
* proident amet.
|
|
158
|
+
* </p>
|
|
159
|
+
* <SheetFooter>
|
|
160
|
+
* <SheetClose asChild>
|
|
161
|
+
* <Button type="button">Close</Button>
|
|
162
|
+
* </SheetClose>
|
|
163
|
+
* </SheetFooter>
|
|
164
|
+
* </SheetContent>
|
|
165
|
+
* </Sheet>
|
|
166
|
+
* ```
|
|
26
167
|
*/
|
|
27
168
|
declare const SheetClose: react.ForwardRefExoticComponent<_radix_ui_react_dialog.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
28
169
|
/**
|
|
29
|
-
* The
|
|
30
|
-
* Renders
|
|
170
|
+
* The main container for a `Sheet`. Should be rendered as a child of the `Sheet` component.
|
|
171
|
+
* Renders on top of the overlay backdrop.
|
|
172
|
+
* Should contain the `SheetHeader`, `SheetBody`, and `SheetFooter`.
|
|
31
173
|
*
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
declare const SheetPortal: react.FC<_radix_ui_react_dialog.DialogPortalProps>;
|
|
35
|
-
/**
|
|
36
|
-
* The overlay backdrop for a sheet. Should be rendered as a child of the `SheetPortal` component.
|
|
174
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-content
|
|
37
175
|
*
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```tsx
|
|
178
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
179
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
180
|
+
* <SheetContent>
|
|
181
|
+
* <SheetHeader>
|
|
182
|
+
* <SheetTitleGroup>
|
|
183
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
184
|
+
* <SheetActions>
|
|
185
|
+
* <IconButton
|
|
186
|
+
* appearance="ghost"
|
|
187
|
+
* type="button"
|
|
188
|
+
* icon={<TrashSimple />}
|
|
189
|
+
* label="Delete"
|
|
190
|
+
* />
|
|
191
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
192
|
+
* <SheetCloseIconButton />
|
|
193
|
+
* </SheetActions>
|
|
194
|
+
* </SheetTitleGroup>
|
|
195
|
+
* <SheetDescription>
|
|
196
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
197
|
+
* </SheetDescription>
|
|
198
|
+
* </SheetHeader>
|
|
199
|
+
* <SheetBody>
|
|
200
|
+
* <p>
|
|
201
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
202
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
203
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
204
|
+
* proident amet.
|
|
205
|
+
* </p>
|
|
206
|
+
* </SheetBody>
|
|
207
|
+
* <SheetFooter>
|
|
208
|
+
* <SheetClose asChild>
|
|
209
|
+
* <Button type="button">Close</Button>
|
|
210
|
+
* </SheetClose>
|
|
211
|
+
* <Button type="button" appearance="filled">
|
|
212
|
+
* Save
|
|
213
|
+
* </Button>
|
|
214
|
+
* </SheetFooter>
|
|
215
|
+
* </SheetContent>
|
|
216
|
+
* </Sheet>
|
|
217
|
+
* ```
|
|
44
218
|
*/
|
|
45
219
|
declare const SheetContent: react.ForwardRefExoticComponent<Omit<Omit<_radix_ui_react_dialog.DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
|
|
46
220
|
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
47
221
|
} & class_variance_authority_types.ClassProp) | undefined) => string> & react.RefAttributes<HTMLDivElement>>;
|
|
48
222
|
type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon">>;
|
|
49
223
|
/**
|
|
50
|
-
* An icon button that closes the
|
|
224
|
+
* An icon button that closes the `Sheet` when clicked.
|
|
225
|
+
* Should be rendered within the `SheetHeader` as a child of `SheetActions`.
|
|
226
|
+
*
|
|
227
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-close-icon-button
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```tsx
|
|
231
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
232
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
233
|
+
* <SheetContent>
|
|
234
|
+
* <SheetHeader>
|
|
235
|
+
* <SheetTitleGroup>
|
|
236
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
237
|
+
* <SheetActions>
|
|
238
|
+
* <IconButton
|
|
239
|
+
* appearance="ghost"
|
|
240
|
+
* type="button"
|
|
241
|
+
* icon={<TrashSimple />}
|
|
242
|
+
* label="Delete"
|
|
243
|
+
* />
|
|
244
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
245
|
+
* <SheetCloseIconButton />
|
|
246
|
+
* </SheetActions>
|
|
247
|
+
* </SheetTitleGroup>
|
|
248
|
+
* <SheetDescription>
|
|
249
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
250
|
+
* </SheetDescription>
|
|
251
|
+
* </SheetHeader>
|
|
252
|
+
* <SheetBody>
|
|
253
|
+
* <p>
|
|
254
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
255
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
256
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
257
|
+
* proident amet.
|
|
258
|
+
* </p>
|
|
259
|
+
* </SheetBody>
|
|
260
|
+
* <SheetFooter>
|
|
261
|
+
* <SheetClose asChild>
|
|
262
|
+
* <Button type="button">Close</Button>
|
|
263
|
+
* </SheetClose>
|
|
264
|
+
* <Button type="button" appearance="filled">
|
|
265
|
+
* Save
|
|
266
|
+
* </Button>
|
|
267
|
+
* </SheetFooter>
|
|
268
|
+
* </SheetContent>
|
|
269
|
+
* </Sheet>
|
|
270
|
+
* ```
|
|
51
271
|
*/
|
|
52
272
|
declare const SheetCloseIconButton: ({ size, type, label, appearance, ...props }: SheetCloseIconButtonProps) => react_jsx_runtime.JSX.Element;
|
|
53
273
|
/**
|
|
54
|
-
* The body container for a
|
|
274
|
+
* The body container for a `Sheet`. This is where you would typically place the main content of the sheet, such as forms or text.
|
|
55
275
|
* Should be rendered as a child of `SheetContent`.
|
|
276
|
+
*
|
|
277
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-body
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```tsx
|
|
281
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
282
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
283
|
+
* <SheetContent>
|
|
284
|
+
* <SheetHeader>
|
|
285
|
+
* <SheetTitleGroup>
|
|
286
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
287
|
+
* <SheetActions>
|
|
288
|
+
* <IconButton
|
|
289
|
+
* appearance="ghost"
|
|
290
|
+
* type="button"
|
|
291
|
+
* icon={<TrashSimple />}
|
|
292
|
+
* label="Delete"
|
|
293
|
+
* />
|
|
294
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
295
|
+
* <SheetCloseIconButton />
|
|
296
|
+
* </SheetActions>
|
|
297
|
+
* </SheetTitleGroup>
|
|
298
|
+
* <SheetDescription>
|
|
299
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
300
|
+
* </SheetDescription>
|
|
301
|
+
* </SheetHeader>
|
|
302
|
+
* <SheetBody>
|
|
303
|
+
* <p>
|
|
304
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
305
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
306
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
307
|
+
* proident amet.
|
|
308
|
+
* </p>
|
|
309
|
+
* </SheetBody>
|
|
310
|
+
* <SheetFooter>
|
|
311
|
+
* <SheetClose asChild>
|
|
312
|
+
* <Button type="button">Close</Button>
|
|
313
|
+
* </SheetClose>
|
|
314
|
+
* <Button type="button" appearance="filled">
|
|
315
|
+
* Save
|
|
316
|
+
* </Button>
|
|
317
|
+
* </SheetFooter>
|
|
318
|
+
* </SheetContent>
|
|
319
|
+
* </Sheet>
|
|
320
|
+
* ```
|
|
56
321
|
*/
|
|
57
322
|
declare const SheetBody: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
58
323
|
/**
|
|
59
|
-
* The header container for a
|
|
324
|
+
* The header container for a `Sheet`. This is where you would typically place the title, description, and actions.
|
|
60
325
|
* Should be rendered as a child of `SheetContent`.
|
|
326
|
+
*
|
|
327
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-header
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```tsx
|
|
331
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
332
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
333
|
+
* <SheetContent>
|
|
334
|
+
* <SheetHeader>
|
|
335
|
+
* <SheetTitleGroup>
|
|
336
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
337
|
+
* <SheetActions>
|
|
338
|
+
* <IconButton
|
|
339
|
+
* appearance="ghost"
|
|
340
|
+
* type="button"
|
|
341
|
+
* icon={<TrashSimple />}
|
|
342
|
+
* label="Delete"
|
|
343
|
+
* />
|
|
344
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
345
|
+
* <SheetCloseIconButton />
|
|
346
|
+
* </SheetActions>
|
|
347
|
+
* </SheetTitleGroup>
|
|
348
|
+
* <SheetDescription>
|
|
349
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
350
|
+
* </SheetDescription>
|
|
351
|
+
* </SheetHeader>
|
|
352
|
+
* <SheetBody>
|
|
353
|
+
* <p>
|
|
354
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
355
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
356
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
357
|
+
* proident amet.
|
|
358
|
+
* </p>
|
|
359
|
+
* </SheetBody>
|
|
360
|
+
* <SheetFooter>
|
|
361
|
+
* <SheetClose asChild>
|
|
362
|
+
* <Button type="button">Close</Button>
|
|
363
|
+
* </SheetClose>
|
|
364
|
+
* <Button type="button" appearance="filled">
|
|
365
|
+
* Save
|
|
366
|
+
* </Button>
|
|
367
|
+
* </SheetFooter>
|
|
368
|
+
* </SheetContent>
|
|
369
|
+
* </Sheet>
|
|
370
|
+
* ```
|
|
61
371
|
*/
|
|
62
372
|
declare const SheetHeader: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
63
373
|
/**
|
|
64
|
-
* The footer container for a
|
|
374
|
+
* The footer container for a `Sheet`. This is where you would typically place close and submit buttons.
|
|
65
375
|
* Should be rendered as a child of `SheetContent`.
|
|
376
|
+
*
|
|
377
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-footer
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```tsx
|
|
381
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
382
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
383
|
+
* <SheetContent>
|
|
384
|
+
* <SheetHeader>
|
|
385
|
+
* <SheetTitleGroup>
|
|
386
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
387
|
+
* <SheetActions>
|
|
388
|
+
* <IconButton
|
|
389
|
+
* appearance="ghost"
|
|
390
|
+
* type="button"
|
|
391
|
+
* icon={<TrashSimple />}
|
|
392
|
+
* label="Delete"
|
|
393
|
+
* />
|
|
394
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
395
|
+
* <SheetCloseIconButton />
|
|
396
|
+
* </SheetActions>
|
|
397
|
+
* </SheetTitleGroup>
|
|
398
|
+
* <SheetDescription>
|
|
399
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
400
|
+
* </SheetDescription>
|
|
401
|
+
* </SheetHeader>
|
|
402
|
+
* <SheetBody>
|
|
403
|
+
* <p>
|
|
404
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
405
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
406
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
407
|
+
* proident amet.
|
|
408
|
+
* </p>
|
|
409
|
+
* </SheetBody>
|
|
410
|
+
* <SheetFooter>
|
|
411
|
+
* <SheetClose asChild>
|
|
412
|
+
* <Button type="button">Close</Button>
|
|
413
|
+
* </SheetClose>
|
|
414
|
+
* <Button type="button" appearance="filled">
|
|
415
|
+
* Save
|
|
416
|
+
* </Button>
|
|
417
|
+
* </SheetFooter>
|
|
418
|
+
* </SheetContent>
|
|
419
|
+
* </Sheet>
|
|
420
|
+
* ```
|
|
66
421
|
*/
|
|
67
422
|
declare const SheetFooter: ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => react_jsx_runtime.JSX.Element;
|
|
68
423
|
/**
|
|
69
|
-
* The title for a
|
|
424
|
+
* The title for a `Sheet`. Typically rendered as a child of `SheetTitleGroup`.
|
|
70
425
|
* Defaults to an `h2` element, but can be changed via the `asChild` prop.
|
|
426
|
+
*
|
|
427
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-title
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```tsx
|
|
431
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
432
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
433
|
+
* <SheetContent>
|
|
434
|
+
* <SheetHeader>
|
|
435
|
+
* <SheetTitleGroup>
|
|
436
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
437
|
+
* <SheetActions>
|
|
438
|
+
* <IconButton
|
|
439
|
+
* appearance="ghost"
|
|
440
|
+
* type="button"
|
|
441
|
+
* icon={<TrashSimple />}
|
|
442
|
+
* label="Delete"
|
|
443
|
+
* />
|
|
444
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
445
|
+
* <SheetCloseIconButton />
|
|
446
|
+
* </SheetActions>
|
|
447
|
+
* </SheetTitleGroup>
|
|
448
|
+
* <SheetDescription>
|
|
449
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
450
|
+
* </SheetDescription>
|
|
451
|
+
* </SheetHeader>
|
|
452
|
+
* <SheetBody>
|
|
453
|
+
* <p>
|
|
454
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
455
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
456
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
457
|
+
* proident amet.
|
|
458
|
+
* </p>
|
|
459
|
+
* </SheetBody>
|
|
460
|
+
* <SheetFooter>
|
|
461
|
+
* <SheetClose asChild>
|
|
462
|
+
* <Button type="button">Close</Button>
|
|
463
|
+
* </SheetClose>
|
|
464
|
+
* <Button type="button" appearance="filled">
|
|
465
|
+
* Save
|
|
466
|
+
* </Button>
|
|
467
|
+
* </SheetFooter>
|
|
468
|
+
* </SheetContent>
|
|
469
|
+
* </Sheet>
|
|
470
|
+
* ```
|
|
71
471
|
*/
|
|
72
472
|
declare const SheetTitle: react.ForwardRefExoticComponent<Omit<_radix_ui_react_dialog.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
73
473
|
/**
|
|
74
474
|
* A group container for the title and actions of a sheet. Typically rendered as a child of `SheetHeader`.
|
|
475
|
+
*
|
|
476
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-title-group
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```tsx
|
|
480
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
481
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
482
|
+
* <SheetContent>
|
|
483
|
+
* <SheetHeader>
|
|
484
|
+
* <SheetTitleGroup>
|
|
485
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
486
|
+
* <SheetActions>
|
|
487
|
+
* <IconButton
|
|
488
|
+
* appearance="ghost"
|
|
489
|
+
* type="button"
|
|
490
|
+
* icon={<TrashSimple />}
|
|
491
|
+
* label="Delete"
|
|
492
|
+
* />
|
|
493
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
494
|
+
* <SheetCloseIconButton />
|
|
495
|
+
* </SheetActions>
|
|
496
|
+
* </SheetTitleGroup>
|
|
497
|
+
* <SheetDescription>
|
|
498
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
499
|
+
* </SheetDescription>
|
|
500
|
+
* </SheetHeader>
|
|
501
|
+
* <SheetBody>
|
|
502
|
+
* <p>
|
|
503
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
504
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
505
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
506
|
+
* proident amet.
|
|
507
|
+
* </p>
|
|
508
|
+
* </SheetBody>
|
|
509
|
+
* <SheetFooter>
|
|
510
|
+
* <SheetClose asChild>
|
|
511
|
+
* <Button type="button">Close</Button>
|
|
512
|
+
* </SheetClose>
|
|
513
|
+
* <Button type="button" appearance="filled">
|
|
514
|
+
* Save
|
|
515
|
+
* </Button>
|
|
516
|
+
* </SheetFooter>
|
|
517
|
+
* </SheetContent>
|
|
518
|
+
* </Sheet>
|
|
519
|
+
* ```
|
|
75
520
|
*/
|
|
76
521
|
declare const SheetTitleGroup: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
77
522
|
/**
|
|
78
523
|
* A description for a sheet. Typically rendered as a child of `SheetHeader`.
|
|
524
|
+
*
|
|
525
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-description
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```tsx
|
|
529
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
530
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
531
|
+
* <SheetContent>
|
|
532
|
+
* <SheetHeader>
|
|
533
|
+
* <SheetTitleGroup>
|
|
534
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
535
|
+
* <SheetActions>
|
|
536
|
+
* <IconButton
|
|
537
|
+
* appearance="ghost"
|
|
538
|
+
* type="button"
|
|
539
|
+
* icon={<TrashSimple />}
|
|
540
|
+
* label="Delete"
|
|
541
|
+
* />
|
|
542
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
543
|
+
* <SheetCloseIconButton />
|
|
544
|
+
* </SheetActions>
|
|
545
|
+
* </SheetTitleGroup>
|
|
546
|
+
* <SheetDescription>
|
|
547
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
548
|
+
* </SheetDescription>
|
|
549
|
+
* </SheetHeader>
|
|
550
|
+
* <SheetBody>
|
|
551
|
+
* <p>
|
|
552
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
553
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
554
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
555
|
+
* proident amet.
|
|
556
|
+
* </p>
|
|
557
|
+
* </SheetBody>
|
|
558
|
+
* <SheetFooter>
|
|
559
|
+
* <SheetClose asChild>
|
|
560
|
+
* <Button type="button">Close</Button>
|
|
561
|
+
* </SheetClose>
|
|
562
|
+
* <Button type="button" appearance="filled">
|
|
563
|
+
* Save
|
|
564
|
+
* </Button>
|
|
565
|
+
* </SheetFooter>
|
|
566
|
+
* </SheetContent>
|
|
567
|
+
* </Sheet>
|
|
568
|
+
* ```
|
|
79
569
|
*/
|
|
80
570
|
declare const SheetDescription: react.ForwardRefExoticComponent<Omit<Omit<_radix_ui_react_dialog.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
81
571
|
/**
|
|
82
|
-
* A group container for the actions of a
|
|
572
|
+
* A group container for the actions of a `Sheet`. Typically rendered as a child of `SheetTitleGroup`.
|
|
573
|
+
*
|
|
574
|
+
* @see https://mantle.ngrok.com/components/sheet#api-sheet-actions
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
* ```tsx
|
|
578
|
+
* // Sheet without a trigger (e.g. router controlled)
|
|
579
|
+
* <Sheet open opOpenChange={() => onClose()}>
|
|
580
|
+
* <SheetContent>
|
|
581
|
+
* <SheetHeader>
|
|
582
|
+
* <SheetTitleGroup>
|
|
583
|
+
* <SheetTitle>Are you absolutely sure?</SheetTitle>
|
|
584
|
+
* <SheetActions>
|
|
585
|
+
* <IconButton
|
|
586
|
+
* appearance="ghost"
|
|
587
|
+
* type="button"
|
|
588
|
+
* icon={<TrashSimple />}
|
|
589
|
+
* label="Delete"
|
|
590
|
+
* />
|
|
591
|
+
* <Separator orientation="vertical" className="h-[80%]" />
|
|
592
|
+
* <SheetCloseIconButton />
|
|
593
|
+
* </SheetActions>
|
|
594
|
+
* </SheetTitleGroup>
|
|
595
|
+
* <SheetDescription>
|
|
596
|
+
* This action cannot be undone. This will permanently delete your account and remove your data from our servers.
|
|
597
|
+
* </SheetDescription>
|
|
598
|
+
* </SheetHeader>
|
|
599
|
+
* <SheetBody>
|
|
600
|
+
* <p>
|
|
601
|
+
* Consequat do voluptate culpa fugiat consequat nostrud duis
|
|
602
|
+
* aliqua minim. Tempor voluptate cillum elit velit. Voluptate
|
|
603
|
+
* aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit
|
|
604
|
+
* proident amet.
|
|
605
|
+
* </p>
|
|
606
|
+
* </SheetBody>
|
|
607
|
+
* <SheetFooter>
|
|
608
|
+
* <SheetClose asChild>
|
|
609
|
+
* <Button type="button">Close</Button>
|
|
610
|
+
* </SheetClose>
|
|
611
|
+
* <Button type="button" appearance="filled">
|
|
612
|
+
* Save
|
|
613
|
+
* </Button>
|
|
614
|
+
* </SheetFooter>
|
|
615
|
+
* </SheetContent>
|
|
616
|
+
* </Sheet>
|
|
617
|
+
* ```
|
|
83
618
|
*/
|
|
84
619
|
declare const SheetActions: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
85
620
|
|
|
86
|
-
export { Sheet, SheetActions, SheetBody, SheetClose, SheetCloseIconButton, SheetContent, SheetDescription, SheetFooter, SheetHeader,
|
|
621
|
+
export { Sheet, SheetActions, SheetBody, SheetClose, SheetCloseIconButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTitleGroup, SheetTrigger };
|
package/dist/sheet.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S,b as u,c as v,d as m,e as d,f as p,g as h,h as f}from"./chunk-PBARMKNJ.js";import{g as c}from"./chunk-5WFRLY2G.js";import"./chunk-DOTYPWKO.js";import"./chunk-D3XF6J5A.js";import{a as P}from"./chunk-ESJ3HLYJ.js";import"./chunk-4LSFAAZW.js";import"./chunk-3C5O3AQA.js";import"./chunk-72TJUKMV.js";import"./chunk-DJGIRPRQ.js";import"./chunk-HDPLH5HC.js";import{a as r}from"./chunk-AZ56JGNY.js";import{X as H}from"@phosphor-icons/react/X";import{cva as D}from"class-variance-authority";import{forwardRef as s}from"react";import{jsx as i,jsxs as W}from"react/jsx-runtime";var L=S,M=u,w=m,A=v,y=s(({className:e,...t},o)=>i(d,{className:r("bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-sm",e),...t,ref:o}));y.displayName=d.displayName;var B=D("bg-dialog data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in fixed z-40 flex flex-col shadow-lg outline-none transition ease-in-out focus-within:outline-none",{variants:{side:{top:"border-dialog data-state-closed:slide-out-to-top data-state-open:slide-in-from-top inset-x-0 top-0 border-b",bottom:"border-dialog data-state-closed:slide-out-to-bottom data-state-open:slide-in-from-bottom inset-x-0 bottom-0 border-t",left:"border-dialog data-state-closed:slide-out-to-left data-state-open:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-[30rem]",right:"border-dialog data-state-closed:slide-out-to-right data-state-open:slide-in-from-right inset-y-0 right-0 h-full w-full border-l sm:max-w-[30rem]"}},defaultVariants:{side:"right"}}),b=s(({children:e,className:t,onInteractOutside:o,onPointerDownOutside:a,side:l="right",...N},R)=>W(A,{children:[i(y,{}),i(p,{className:r(B({side:l}),t),onInteractOutside:n=>{c(n),o?.(n)},onPointerDownOutside:n=>{c(n),a?.(n)},ref:R,...N,children:e})]}));b.displayName=p.displayName;var I=({size:e="md",type:t="button",label:o="Close Sheet",appearance:a="ghost",...l})=>i(m,{asChild:!0,children:i(P,{appearance:a,icon:i(H,{}),label:o,size:e,type:t,...l})}),O=({className:e,...t})=>i("div",{className:r("scrollbar text-body flex-1 overflow-y-auto p-6",e),...t}),E=({className:e,...t})=>i("div",{className:r("border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4","has-[.icon-button]:pr-4",e),...t}),V=({className:e,...t})=>i("div",{className:r("border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5",e),...t}),C=s(({className:e,...t},o)=>i(h,{ref:o,className:r("text-strong flex-1 truncate text-lg font-medium",e),...t}));C.displayName=h.displayName;var g=s(({children:e,className:t,...o},a)=>i("div",{className:r("flex items-center justify-between gap-2",t),...o,ref:a,children:e}));g.displayName="SheetTitleGroup";var x=s(({className:e,...t},o)=>i(f,{ref:o,className:r("text-body text-sm",e),...t}));x.displayName=f.displayName;var T=s(({children:e,className:t,...o},a)=>i("div",{className:r("flex h-full items-center gap-2",t),...o,ref:a,children:e}));T.displayName="SheetActions";export{L as Sheet,T as SheetActions,O as SheetBody,w as SheetClose,I as SheetCloseIconButton,b as SheetContent,x as SheetDescription,V as SheetFooter,E as SheetHeader,C as SheetTitle,g as SheetTitleGroup,M as SheetTrigger};
|
|
2
2
|
//# sourceMappingURL=sheet.js.map
|
package/dist/sheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/sheet/sheet.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react/X\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type {\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tHTMLAttributes,\n} from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { IconButton, type IconButtonProps } from \"../button/icon-button.js\";\nimport * as SheetPrimitive from \"../dialog/primitive.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.js\";\n\n/**\n * The root component for a sheet. Should compose the `SheetTrigger` and `SheetContent`.\n * Acts as a stateful provider for the sheet's open/closed state.\n */\nconst Sheet = SheetPrimitive.Root;\n\n/**\n * The trigger for a sheet. Should be rendered as a child of the `Sheet` component.\n * Renders an unstyled button by default, but can be customized with the `asChild` prop.\n */\nconst SheetTrigger = SheetPrimitive.Trigger;\n\n/**\n * The close button for a sheet. Should be rendered as a child of the `SheetContent` component.\n * Renders an unstyled button by default, but can be customized with the `asChild` prop.\n */\nconst SheetClose = SheetPrimitive.Close;\n\n/**\n * The portal for a sheet. Should be rendered as a child of the `Sheet` component.\n * Renders a portal that the `SheetOverlay` and `SheetContent` is rendered into.\n *\n * You likely don't need to use this component directly, as it is used internally by the `SheetContent` component.\n */\nconst SheetPortal = SheetPrimitive.Portal;\n\n/**\n * The overlay backdrop for a sheet. Should be rendered as a child of the `SheetPortal` component.\n *\n * You likely don't need to use this component directly, as it is used internally by the `SheetContent` component.\n */\nconst SheetOverlay = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst SheetVariants = cva(\n\t\"bg-dialog data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in fixed z-40 flex flex-col shadow-lg outline-none transition ease-in-out focus-within:outline-none\",\n\t{\n\t\tvariants: {\n\t\t\tside: {\n\t\t\t\ttop: \"border-dialog data-state-closed:slide-out-to-top data-state-open:slide-in-from-top inset-x-0 top-0 border-b\",\n\t\t\t\tbottom:\n\t\t\t\t\t\"border-dialog data-state-closed:slide-out-to-bottom data-state-open:slide-in-from-bottom inset-x-0 bottom-0 border-t\",\n\t\t\t\tleft: \"border-dialog data-state-closed:slide-out-to-left data-state-open:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-[30rem]\",\n\t\t\t\tright:\n\t\t\t\t\t\"border-dialog data-state-closed:slide-out-to-right data-state-open:slide-in-from-right inset-y-0 right-0 h-full w-full border-l sm:max-w-[30rem]\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tside: \"right\",\n\t\t},\n\t},\n);\n\ntype SheetContentProps = {} & ComponentPropsWithoutRef<\n\ttypeof SheetPrimitive.Content\n> &\n\tVariantProps<typeof SheetVariants>;\n\n/**\n * The main container for a sheet. Renders on top of the overlay backdrop.\n * Should compose the `SheetHeader`, `SheetBody`, and `SheetFooter`.\n */\nconst SheetContent = forwardRef<ComponentRef<\"div\">, SheetContentProps>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tonInteractOutside,\n\t\t\tonPointerDownOutside,\n\t\t\tside = \"right\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<SheetPortal>\n\t\t\t<SheetOverlay />\n\t\t\t<SheetPrimitive.Content\n\t\t\t\tclassName={cx(SheetVariants({ side }), className)}\n\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</SheetPrimitive.Content>\n\t\t</SheetPortal>\n\t),\n);\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\ntype SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\n\n/**\n * An icon button that closes the sheet when clicked. Should be rendered within the `SheetHeader` as a child of `SheetActions`.\n */\nconst SheetCloseIconButton = ({\n\tsize = \"md\",\n\ttype = \"button\",\n\tlabel = \"Close Sheet\",\n\tappearance = \"ghost\",\n\t...props\n}: SheetCloseIconButtonProps) => (\n\t<SheetPrimitive.Close asChild>\n\t\t<IconButton\n\t\t\tappearance={appearance}\n\t\t\ticon={<X />}\n\t\t\tlabel={label}\n\t\t\tsize={size}\n\t\t\ttype={type}\n\t\t\t{...props}\n\t\t/>\n\t</SheetPrimitive.Close>\n);\n\n/**\n * The body container for a sheet. This is where you would typically place the main content of the sheet.\n * Should be rendered as a child of `SheetContent`.\n */\nconst SheetBody = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\"scrollbar text-body flex-1 overflow-y-auto p-6\", className)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The header container for a sheet. This is where you would typically place the title, description, and actions.\n * Should be rendered as a child of `SheetContent`.\n */\nconst SheetHeader = ({\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4\",\n\t\t\t\"has-[.icon-button]:pr-4\", // when there are actions in the header, shorten the padding\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The footer container for a sheet. This is where you would typically place close and submit buttons.\n * Should be rendered as a child of `SheetContent`.\n */\nconst SheetFooter = ({\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The title for a sheet. Typically rendered as a child of `SheetTitleGroup`.\n * Defaults to an `h2` element, but can be changed via the `asChild` prop.\n */\nconst SheetTitle = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong flex-1 truncate text-lg font-medium\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\n/**\n * A group container for the title and actions of a sheet. Typically rendered as a child of `SheetHeader`.\n */\nconst SheetTitleGroup = forwardRef<\n\tComponentRef<\"div\">,\n\tHTMLAttributes<HTMLDivElement>\n>(({ children, className, ...props }, ref) => (\n\t<div\n\t\tclassName={cx(\"flex items-center justify-between gap-2\", className)}\n\t\t{...props}\n\t\tref={ref}\n\t>\n\t\t{children}\n\t</div>\n));\nSheetTitleGroup.displayName = \"SheetTitleGroup\";\n\n/**\n * A description for a sheet. Typically rendered as a child of `SheetHeader`.\n */\nconst SheetDescription = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\n/**\n * A group container for the actions of a sheet. Typically rendered as a child of `SheetTitleGroup`.\n */\nconst SheetActions = forwardRef<\n\tComponentRef<\"div\">,\n\tHTMLAttributes<HTMLDivElement>\n>(({ children, className, ...props }, ref) => (\n\t<div\n\t\tclassName={cx(\"flex h-full items-center gap-2\", className)}\n\t\t{...props}\n\t\tref={ref}\n\t>\n\t\t{children}\n\t</div>\n));\nSheetActions.displayName = \"SheetActions\";\n\nexport {\n\tSheet,\n\tSheetActions,\n\tSheetBody,\n\tSheetClose,\n\tSheetCloseIconButton,\n\tSheetContent,\n\tSheetDescription,\n\tSheetFooter,\n\tSheetHeader,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,EAAG,iCAAkCJ,CAAS,EACxD,GAAGC,EACJ,IAAKC,EAEJ,SAAAM,EACF,CACA,EACDsB,EAAa,YAAc","names":["X","cva","forwardRef","jsx","jsxs","Sheet","Root","SheetTrigger","Trigger","SheetClose","Close","SheetPortal","Portal","SheetOverlay","forwardRef","className","props","ref","Overlay","cx","SheetVariants","cva","SheetContent","children","onInteractOutside","onPointerDownOutside","side","Content","event","preventCloseOnPromptInteraction","SheetCloseIconButton","size","type","label","appearance","IconButton","X","SheetBody","SheetHeader","SheetFooter","SheetTitle","Title","SheetTitleGroup","SheetDescription","Description","SheetActions"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/sheet/sheet.tsx"],"sourcesContent":["import { X } from \"@phosphor-icons/react/X\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type {\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tHTMLAttributes,\n} from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { IconButton, type IconButtonProps } from \"../button/icon-button.js\";\nimport * as SheetPrimitive from \"../dialog/primitive.js\";\nimport { preventCloseOnPromptInteraction } from \"../toast/toast.js\";\n\n/**\n * The root component for a `Sheet`. Should compose the `SheetTrigger` and `SheetContent`.\n * Acts as a stateful provider for the Sheet's open/closed state.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet\n *\n * @example\n * ```tsx\n * // Triggering a stateful sheet\n * <Sheet>\n * <SheetTrigger asChild>\n * <Button type=\"button\" appearance=\"filled\">\n * Open Sheet\n * </Button>\n * </SheetTrigger>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst Sheet = SheetPrimitive.Root;\n\n/**\n * The button trigger for a `Sheet`. Should be rendered as a child of the `Sheet` component.\n * Renders an unstyled button by default, but can be customized with the `asChild` prop.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-trigger\n *\n * @example\n * ```tsx\n * <Sheet>\n * <SheetTrigger asChild>\n * <Button type=\"button\" appearance=\"filled\">\n * Open Sheet\n * </Button>\n * </SheetTrigger>\n * <SheetContent>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetTrigger = SheetPrimitive.Trigger;\n\n/**\n * The close button for a `Sheet`. Should be rendered as a child of the `SheetContent` component.\n * Usually contained within the `SheetFooter` component.\n * Renders an unstyled button by default, but can be customized with the `asChild` prop.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-close\n *\n * @example\n * ```tsx\n * <Sheet>\n * <SheetTrigger asChild>\n * <Button type=\"button\" appearance=\"filled\">\n * Open Sheet\n * </Button>\n * </SheetTrigger>\n * <SheetContent>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetClose = SheetPrimitive.Close;\n\n/**\n * The portal for a sheet. Should be rendered as a child of the `Sheet` component.\n * Renders a portal that the `SheetOverlay` and `SheetContent` is rendered into.\n *\n * @private\n */\nconst SheetPortal = SheetPrimitive.Portal;\n\n/**\n * The overlay backdrop for a sheet. Should be rendered as a child of the `SheetPortal` component.\n *\n * You likely don't need to use this component directly, as it is used internally by the `SheetContent` component.\n *\n * @private\n */\nconst SheetOverlay = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Overlay\n\t\tclassName={cx(\n\t\t\t\"bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-sm\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t\tref={ref}\n\t/>\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst SheetVariants = cva(\n\t\"bg-dialog data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in fixed z-40 flex flex-col shadow-lg outline-none transition ease-in-out focus-within:outline-none\",\n\t{\n\t\tvariants: {\n\t\t\t/**\n\t\t\t * The side of the screen the sheet should slide in from.\n\t\t\t */\n\t\t\tside: {\n\t\t\t\ttop: \"border-dialog data-state-closed:slide-out-to-top data-state-open:slide-in-from-top inset-x-0 top-0 border-b\",\n\t\t\t\tbottom:\n\t\t\t\t\t\"border-dialog data-state-closed:slide-out-to-bottom data-state-open:slide-in-from-bottom inset-x-0 bottom-0 border-t\",\n\t\t\t\tleft: \"border-dialog data-state-closed:slide-out-to-left data-state-open:slide-in-from-left inset-y-0 left-0 h-full w-full border-r sm:max-w-[30rem]\",\n\t\t\t\tright:\n\t\t\t\t\t\"border-dialog data-state-closed:slide-out-to-right data-state-open:slide-in-from-right inset-y-0 right-0 h-full w-full border-l sm:max-w-[30rem]\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tside: \"right\",\n\t\t},\n\t},\n);\n\ntype SheetContentProps = {} & ComponentPropsWithoutRef<\n\ttypeof SheetPrimitive.Content\n> &\n\tVariantProps<typeof SheetVariants>;\n\n/**\n * The main container for a `Sheet`. Should be rendered as a child of the `Sheet` component.\n * Renders on top of the overlay backdrop.\n * Should contain the `SheetHeader`, `SheetBody`, and `SheetFooter`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-content\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetContent = forwardRef<ComponentRef<\"div\">, SheetContentProps>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tonInteractOutside,\n\t\t\tonPointerDownOutside,\n\t\t\tside = \"right\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<SheetPortal>\n\t\t\t<SheetOverlay />\n\t\t\t<SheetPrimitive.Content\n\t\t\t\tclassName={cx(SheetVariants({ side }), className)}\n\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\tpreventCloseOnPromptInteraction(event);\n\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</SheetPrimitive.Content>\n\t\t</SheetPortal>\n\t),\n);\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\ntype SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, \"icon\">>;\n\n/**\n * An icon button that closes the `Sheet` when clicked.\n * Should be rendered within the `SheetHeader` as a child of `SheetActions`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-close-icon-button\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetCloseIconButton = ({\n\tsize = \"md\",\n\ttype = \"button\",\n\tlabel = \"Close Sheet\",\n\tappearance = \"ghost\",\n\t...props\n}: SheetCloseIconButtonProps) => (\n\t<SheetPrimitive.Close asChild>\n\t\t<IconButton\n\t\t\tappearance={appearance}\n\t\t\ticon={<X />}\n\t\t\tlabel={label}\n\t\t\tsize={size}\n\t\t\ttype={type}\n\t\t\t{...props}\n\t\t/>\n\t</SheetPrimitive.Close>\n);\n\n/**\n * The body container for a `Sheet`. This is where you would typically place the main content of the sheet, such as forms or text.\n * Should be rendered as a child of `SheetContent`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-body\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetBody = ({ className, ...props }: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\"scrollbar text-body flex-1 overflow-y-auto p-6\", className)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The header container for a `Sheet`. This is where you would typically place the title, description, and actions.\n * Should be rendered as a child of `SheetContent`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-header\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetHeader = ({\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4\",\n\t\t\t\"has-[.icon-button]:pr-4\", // when there are actions in the header, shorten the padding\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The footer container for a `Sheet`. This is where you would typically place close and submit buttons.\n * Should be rendered as a child of `SheetContent`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-footer\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetFooter = ({\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cx(\n\t\t\t\"border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n);\n\n/**\n * The title for a `Sheet`. Typically rendered as a child of `SheetTitleGroup`.\n * Defaults to an `h2` element, but can be changed via the `asChild` prop.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-title\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetTitle = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-strong flex-1 truncate text-lg font-medium\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\n/**\n * A group container for the title and actions of a sheet. Typically rendered as a child of `SheetHeader`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-title-group\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetTitleGroup = forwardRef<\n\tComponentRef<\"div\">,\n\tHTMLAttributes<HTMLDivElement>\n>(({ children, className, ...props }, ref) => (\n\t<div\n\t\tclassName={cx(\"flex items-center justify-between gap-2\", className)}\n\t\t{...props}\n\t\tref={ref}\n\t>\n\t\t{children}\n\t</div>\n));\nSheetTitleGroup.displayName = \"SheetTitleGroup\";\n\n/**\n * A description for a sheet. Typically rendered as a child of `SheetHeader`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-description\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetDescription = forwardRef<\n\tComponentRef<typeof SheetPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<SheetPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cx(\"text-body text-sm\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\n/**\n * A group container for the actions of a `Sheet`. Typically rendered as a child of `SheetTitleGroup`.\n *\n * @see https://mantle.ngrok.com/components/sheet#api-sheet-actions\n *\n * @example\n * ```tsx\n * // Sheet without a trigger (e.g. router controlled)\n * <Sheet open opOpenChange={() => onClose()}>\n * <SheetContent>\n * <SheetHeader>\n * <SheetTitleGroup>\n * <SheetTitle>Are you absolutely sure?</SheetTitle>\n * <SheetActions>\n * <IconButton\n * appearance=\"ghost\"\n * type=\"button\"\n * icon={<TrashSimple />}\n * label=\"Delete\"\n * />\n * <Separator orientation=\"vertical\" className=\"h-[80%]\" />\n * <SheetCloseIconButton />\n * </SheetActions>\n * </SheetTitleGroup>\n * <SheetDescription>\n * This action cannot be undone. This will permanently delete your account and remove your data from our servers.\n * </SheetDescription>\n * </SheetHeader>\n * <SheetBody>\n * <p>\n * Consequat do voluptate culpa fugiat consequat nostrud duis\n * aliqua minim. Tempor voluptate cillum elit velit. Voluptate\n * aliqua ipsum aliqua dolore in nisi ea fugiat aliqua velit\n * proident amet.\n * </p>\n * </SheetBody>\n * <SheetFooter>\n * <SheetClose asChild>\n * <Button type=\"button\">Close</Button>\n * </SheetClose>\n * <Button type=\"button\" appearance=\"filled\">\n * Save\n * </Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n * ```\n */\nconst SheetActions = forwardRef<\n\tComponentRef<\"div\">,\n\tHTMLAttributes<HTMLDivElement>\n>(({ children, className, ...props }, ref) => (\n\t<div\n\t\tclassName={cx(\"flex h-full items-center gap-2\", className)}\n\t\t{...props}\n\t\tref={ref}\n\t>\n\t\t{children}\n\t</div>\n));\nSheetActions.displayName = \"SheetActions\";\n\nexport {\n\t//,\n\tSheet,\n\tSheetActions,\n\tSheetBody,\n\tSheetClose,\n\tSheetCloseIconButton,\n\tSheetContent,\n\tSheetDescription,\n\tSheetFooter,\n\tSheetH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AkCJ,CAAS,EACxD,GAAGC,EACJ,IAAKC,EAEJ,SAAAM,EACF,CACA,EACDsB,EAAa,YAAc","names":["X","cva","forwardRef","jsx","jsxs","Sheet","Root","SheetTrigger","Trigger","SheetClose","Close","SheetPortal","Portal","SheetOverlay","forwardRef","className","props","ref","Overlay","cx","SheetVariants","cva","SheetContent","children","onInteractOutside","onPointerDownOutside","side","Content","event","preventCloseOnPromptInteraction","SheetCloseIconButton","size","type","label","appearance","IconButton","X","SheetBody","SheetHeader","SheetFooter","SheetTitle","Title","SheetTitleGroup","SheetDescription","Description","SheetActions"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "mantle is ngrok's UI library and design system.",
|
|
4
4
|
"author": "ngrok",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.22.
|
|
6
|
+
"version": "0.22.2",
|
|
7
7
|
"homepage": "https://mantle.ngrok.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"clsx": "2.1.1",
|
|
45
45
|
"prismjs": "1.30.0",
|
|
46
46
|
"react-day-picker": "8.10.1",
|
|
47
|
-
"sonner": "2.0.
|
|
47
|
+
"sonner": "2.0.2",
|
|
48
48
|
"tailwind-merge": "2.6.0",
|
|
49
49
|
"tailwindcss-animate": "1.0.7",
|
|
50
50
|
"tiny-invariant": "1.3.3"
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"@testing-library/jest-dom": "6.6.3",
|
|
56
56
|
"@testing-library/react": "16.2.0",
|
|
57
57
|
"@testing-library/user-event": "14.6.1",
|
|
58
|
-
"@types/node": "22.13.
|
|
58
|
+
"@types/node": "22.13.14",
|
|
59
59
|
"@types/prismjs": "1.26.5",
|
|
60
|
-
"@types/react": "18.3.
|
|
60
|
+
"@types/react": "18.3.20",
|
|
61
61
|
"@types/react-dom": "18.3.5",
|
|
62
62
|
"@vitejs/plugin-react": "4.3.4",
|
|
63
63
|
"autoprefixer": "10.4.21",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"postcss": "8.5.3",
|
|
68
68
|
"react": "18.3.1",
|
|
69
69
|
"react-dom": "18.3.1",
|
|
70
|
-
"react-router": "7.
|
|
70
|
+
"react-router": "7.4.1",
|
|
71
71
|
"tailwindcss": "3.4.17",
|
|
72
72
|
"tsup": "8.4.0",
|
|
73
73
|
"typescript": "5.8.2",
|