@ngrok/mantle 0.79.3 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +169 -12
- package/dist/accordion.js +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +496 -30
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +129 -9
- package/dist/alert.js +1 -1
- package/dist/anchor-_2meGDfj.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +214 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-5WsvzIQ6.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-BPMwa2jN.d.ts} +3 -3
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +146 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +224 -8
- package/dist/centered-layout.js +1 -1
- package/dist/checkbox-Cq17y0-R.js +1 -0
- package/dist/checkbox.d.ts +12 -10
- package/dist/checkbox.js +1 -1
- package/dist/choice-Cc8dA5r8.js +1 -0
- package/dist/choice-Ct0KK8jw.d.ts +269 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +270 -50
- package/dist/code-block.js +6 -6
- package/dist/code.d.ts +3 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +190 -11
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +285 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +33 -5
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +79 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-CQ2C6vkE.js +1 -0
- package/dist/dialog.d.ts +239 -18
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-CSCDdA3K.js +1 -0
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-CoyozLzy.d.ts} +170 -29
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +596 -45
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +0 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +54 -4
- package/dist/hover-card.js +1 -1
- package/dist/{icon-Cevjo93X.d.ts → icon-BDqpcZ-n.d.ts} +1 -1
- package/dist/icon-CGgMKpJg.js +1 -0
- package/dist/{icon-button-BvQvT790.d.ts → icon-button-C1AfGnQx.d.ts} +6 -60
- package/dist/icon-button-DiOhreJD.js +1 -0
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +5 -13
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/index-B8mIWKIU.d.ts +211 -0
- package/dist/{index-Rv8RL7xy.d.ts → index-BtwKJTLq.d.ts} +1 -1
- package/dist/{index-BSAizFod.d.ts → index-C2jj8U4a.d.ts} +5 -5
- package/dist/index-CdPXa9h1.d.ts +1 -0
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-CVyAVbim.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-DV9M6K4v.d.ts} +42 -2
- package/dist/input.d.ts +4 -55
- package/dist/input.js +1 -1
- package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
- package/dist/label-D-D11mlp.js +1 -0
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +150 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +1 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/media-object.d.ts +27 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +312 -15
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +129 -5
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +70 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CBMADtjV.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-CJRIlrLz.d.ts +31 -0
- package/dist/primitive-DCPHJsRs.js +1 -0
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +113 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +128 -23
- package/dist/radio-group.js +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/select-SR_9-bxA.js +1 -0
- package/dist/select-idm1jy7y.d.ts +600 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +252 -298
- package/dist/selectable-list.js +1 -1
- package/dist/separator-B5UmkVRL.d.ts +75 -0
- package/dist/separator-bpE_kooz.js +1 -0
- package/dist/separator.d.ts +1 -52
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +295 -21
- package/dist/sheet.js +1 -1
- package/dist/skeleton-CsbUHbBA.js +1 -0
- package/dist/skeleton.d.ts +4 -7
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +24 -4
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → sort-B_DDQcVD.js} +1 -1
- package/dist/split-button.d.ts +28 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → svg-only-CdI_v82i.d.ts} +1 -1
- package/dist/svg-only-d-nMCfAI.js +1 -0
- package/dist/switch.d.ts +9 -6
- package/dist/switch.js +1 -1
- package/dist/table-DUSvU_Jw.d.ts +875 -0
- package/dist/table-GDkapNFi.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +135 -21
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-provider-BftkIiZn.js +1 -0
- package/dist/theme-switcher.d.ts +110 -29
- package/dist/theme-switcher.js +1 -1
- package/dist/theme-wVnzzx2F.js +1 -0
- package/dist/theme.d.ts +53 -14
- package/dist/theme.js +1 -1
- package/dist/toast-DKgMRv4F.js +1 -0
- package/dist/toast.d.ts +98 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +28 -1
- package/dist/tooltip.js +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → traffic-policy-file-CF1lbWtp.js} +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/virtual-UrzmaSQm.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +3 -3
- package/dist/anchor-C_tjSVy6.js +0 -1
- package/dist/as-child-CYEVu1WY.d.ts +0 -23
- package/dist/button-5t6-JS_I.js +0 -1
- package/dist/button-ClC60Nzg.js +0 -1
- package/dist/checkbox-DJ2xl7Rc.js +0 -1
- package/dist/choice-DOdyNzFC.js +0 -1
- package/dist/compose-refs-Cjf2gfB8.js +0 -1
- package/dist/dialog-vxLIvB8M.js +0 -1
- package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
- package/dist/icon-CDtYjF_H.js +0 -1
- package/dist/icon-button-DV2-GZHf.js +0 -1
- package/dist/index-g2rfwNCH.d.ts +0 -1
- package/dist/input-Ct1YOqSy.js +0 -1
- package/dist/label-BMlHW_2D.js +0 -1
- package/dist/popover-D5WxxnBY.js +0 -1
- package/dist/primitive-C64-m48O.d.ts +0 -13
- package/dist/primitive-IKruV2iB.js +0 -1
- package/dist/select-Bwt2YduR.d.ts +0 -345
- package/dist/select-D-5u0Blc.js +0 -1
- package/dist/separator-kBnnv3Cw.js +0 -1
- package/dist/skeleton-Bu3tgNcW.js +0 -1
- package/dist/slot-DmPrjM7N.js +0 -1
- package/dist/svg-only-DDx6FtJd.js +0 -1
- package/dist/table-CPH2md2-.js +0 -1
- package/dist/table-CwFHXC-G.d.ts +0 -414
- package/dist/theme-D3MDng6U.js +0 -1
- package/dist/theme-provider-C9zpDyJW.js +0 -1
- package/dist/toast-BsCjaMVS.js +0 -1
- package/dist/virtual-DZMBu7Ch.js +0 -1
package/dist/command.d.ts
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentProps, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import { a as Root } from "./primitive-CJRIlrLz.js";
|
|
2
|
+
import { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from "react";
|
|
3
3
|
import { Command as Command$1, useCommandState } from "cmdk";
|
|
4
4
|
//#region src/components/command/command.d.ts
|
|
5
|
-
type CommandRootProps =
|
|
5
|
+
type CommandRootProps = ComponentProps<typeof Command$1>;
|
|
6
|
+
/**
|
|
7
|
+
* The root component for the Command. It provides the context for all other command sub-components.
|
|
8
|
+
*
|
|
9
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandroot
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
14
|
+
* <Command.DialogTrigger asChild>
|
|
15
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
16
|
+
* </Command.DialogTrigger>
|
|
17
|
+
* <Command.DialogContent>
|
|
18
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
19
|
+
* <Command.List>
|
|
20
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
21
|
+
* <Command.Group heading="Suggestions">
|
|
22
|
+
* <Command.Item>
|
|
23
|
+
* <span>Calendar</span>
|
|
24
|
+
* </Command.Item>
|
|
25
|
+
* </Command.Group>
|
|
26
|
+
* <Command.Separator />
|
|
27
|
+
* <Command.Group heading="Settings">
|
|
28
|
+
* <Command.Item>
|
|
29
|
+
* <span>Profile</span>
|
|
30
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
31
|
+
* </Command.Item>
|
|
32
|
+
* </Command.Group>
|
|
33
|
+
* </Command.List>
|
|
34
|
+
* </Command.DialogContent>
|
|
35
|
+
* </Command.DialogRoot>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare const CommandRoot: {
|
|
39
|
+
({ className, ...props }: CommandRootProps): import("react").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
6
42
|
/**
|
|
7
43
|
* The props for the CommandDialog.Content component.
|
|
8
44
|
*
|
|
@@ -81,10 +117,240 @@ type CommandDialogContentProps = {
|
|
|
81
117
|
* </Command.DialogRoot>
|
|
82
118
|
* ```
|
|
83
119
|
*/
|
|
84
|
-
declare const CommandDialogContent: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
120
|
+
declare const CommandDialogContent: ({ children, className, description, filter, shouldFilter, showCloseButton, title }: CommandDialogContentProps) => import("react").JSX.Element;
|
|
121
|
+
/**
|
|
122
|
+
* The input component for the Command. It provides the input for the command palette.
|
|
123
|
+
*
|
|
124
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandinput
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
129
|
+
* <Command.DialogTrigger asChild>
|
|
130
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
131
|
+
* </Command.DialogTrigger>
|
|
132
|
+
* <Command.DialogContent>
|
|
133
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
134
|
+
* <Command.List>
|
|
135
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
136
|
+
* <Command.Group heading="Suggestions">
|
|
137
|
+
* <Command.Item>
|
|
138
|
+
* <span>Calendar</span>
|
|
139
|
+
* </Command.Item>
|
|
140
|
+
* </Command.Group>
|
|
141
|
+
* <Command.Separator />
|
|
142
|
+
* <Command.Group heading="Settings">
|
|
143
|
+
* <Command.Item>
|
|
144
|
+
* <span>Profile</span>
|
|
145
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
146
|
+
* </Command.Item>
|
|
147
|
+
* </Command.Group>
|
|
148
|
+
* </Command.List>
|
|
149
|
+
* </Command.DialogContent>
|
|
150
|
+
* </Command.DialogRoot>
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
declare const CommandInput: ({ className, ref, ...props }: ComponentPropsWithoutRef<typeof Command$1.Input> & {
|
|
154
|
+
ref?: Ref<HTMLDivElement>;
|
|
155
|
+
}) => import("react").JSX.Element;
|
|
156
|
+
/**
|
|
157
|
+
* The list component for the Command. It provides the list for the command palette.
|
|
158
|
+
*
|
|
159
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandlist
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
164
|
+
* <Command.DialogTrigger asChild>
|
|
165
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
166
|
+
* </Command.DialogTrigger>
|
|
167
|
+
* <Command.DialogContent>
|
|
168
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
169
|
+
* <Command.List>
|
|
170
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
171
|
+
* <Command.Group heading="Suggestions">
|
|
172
|
+
* <Command.Item>
|
|
173
|
+
* <span>Calendar</span>
|
|
174
|
+
* </Command.Item>
|
|
175
|
+
* </Command.Group>
|
|
176
|
+
* <Command.Separator />
|
|
177
|
+
* <Command.Group heading="Settings">
|
|
178
|
+
* <Command.Item>
|
|
179
|
+
* <span>Profile</span>
|
|
180
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
181
|
+
* </Command.Item>
|
|
182
|
+
* </Command.Group>
|
|
183
|
+
* </Command.List>
|
|
184
|
+
* </Command.DialogContent>
|
|
185
|
+
* </Command.DialogRoot>
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
declare const CommandList: ({ className, ...props }: ComponentProps<typeof Command$1.List>) => import("react").JSX.Element;
|
|
189
|
+
/**
|
|
190
|
+
* The empty component for the Command. It provides the empty state for the command palette.
|
|
191
|
+
*
|
|
192
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandempty
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```tsx
|
|
196
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
197
|
+
* <Command.DialogTrigger asChild>
|
|
198
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
199
|
+
* </Command.DialogTrigger>
|
|
200
|
+
* <Command.DialogContent>
|
|
201
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
202
|
+
* <Command.List>
|
|
203
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
204
|
+
* <Command.Group heading="Suggestions">
|
|
205
|
+
* <Command.Item>
|
|
206
|
+
* <span>Calendar</span>
|
|
207
|
+
* </Command.Item>
|
|
208
|
+
* </Command.Group>
|
|
209
|
+
* <Command.Separator />
|
|
210
|
+
* <Command.Group heading="Settings">
|
|
211
|
+
* <Command.Item>
|
|
212
|
+
* <span>Profile</span>
|
|
213
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
214
|
+
* </Command.Item>
|
|
215
|
+
* </Command.Group>
|
|
216
|
+
* </Command.List>
|
|
217
|
+
* </Command.DialogContent>
|
|
218
|
+
* </Command.DialogRoot>
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare const CommandEmpty: ({ className, ...props }: ComponentProps<typeof Command$1.Empty>) => import("react").JSX.Element;
|
|
222
|
+
/**
|
|
223
|
+
* The group component for the Command. It provides the group for the command palette.
|
|
224
|
+
*
|
|
225
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandgroup
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```tsx
|
|
229
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
230
|
+
* <Command.DialogTrigger asChild>
|
|
231
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
232
|
+
* </Command.DialogTrigger>
|
|
233
|
+
* <Command.DialogContent>
|
|
234
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
235
|
+
* <Command.List>
|
|
236
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
237
|
+
* <Command.Group heading="Suggestions">
|
|
238
|
+
* <Command.Item>
|
|
239
|
+
* <span>Calendar</span>
|
|
240
|
+
* </Command.Item>
|
|
241
|
+
* </Command.Group>
|
|
242
|
+
* <Command.Separator />
|
|
243
|
+
* <Command.Group heading="Settings">
|
|
244
|
+
* <Command.Item>
|
|
245
|
+
* <span>Profile</span>
|
|
246
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
247
|
+
* </Command.Item>
|
|
248
|
+
* </Command.Group>
|
|
249
|
+
* </Command.List>
|
|
250
|
+
* </Command.DialogContent>
|
|
251
|
+
* </Command.DialogRoot>
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
declare const CommandGroup: ({ className, ...props }: ComponentProps<typeof Command$1.Group>) => import("react").JSX.Element;
|
|
255
|
+
/**
|
|
256
|
+
* The separator component for the Command. It provides the separator for the command palette.
|
|
257
|
+
*
|
|
258
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandseparator
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```tsx
|
|
262
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
263
|
+
* <Command.DialogTrigger asChild>
|
|
264
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
265
|
+
* </Command.DialogTrigger>
|
|
266
|
+
* <Command.DialogContent>
|
|
267
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
268
|
+
* <Command.List>
|
|
269
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
270
|
+
* <Command.Group heading="Suggestions">
|
|
271
|
+
* <Command.Item>
|
|
272
|
+
* <span>Calendar</span>
|
|
273
|
+
* </Command.Item>
|
|
274
|
+
* </Command.Group>
|
|
275
|
+
* <Command.Separator />
|
|
276
|
+
* <Command.Group heading="Settings">
|
|
277
|
+
* <Command.Item>
|
|
278
|
+
* <span>Profile</span>
|
|
279
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
280
|
+
* </Command.Item>
|
|
281
|
+
* </Command.Group>
|
|
282
|
+
* </Command.List>
|
|
283
|
+
* </Command.DialogContent>
|
|
284
|
+
* </Command.DialogRoot>
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
declare const CommandSeparator: ({ className, ...props }: ComponentProps<typeof Command$1.Separator>) => import("react").JSX.Element;
|
|
288
|
+
/**
|
|
289
|
+
* The item component for the Command. It provides the item for the command palette.
|
|
290
|
+
*
|
|
291
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanditem
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```tsx
|
|
295
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
296
|
+
* <Command.DialogTrigger asChild>
|
|
297
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
298
|
+
* </Command.DialogTrigger>
|
|
299
|
+
* <Command.DialogContent>
|
|
300
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
301
|
+
* <Command.List>
|
|
302
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
303
|
+
* <Command.Group heading="Suggestions">
|
|
304
|
+
* <Command.Item>
|
|
305
|
+
* <span>Calendar</span>
|
|
306
|
+
* </Command.Item>
|
|
307
|
+
* </Command.Group>
|
|
308
|
+
* <Command.Separator />
|
|
309
|
+
* <Command.Group heading="Settings">
|
|
310
|
+
* <Command.Item>
|
|
311
|
+
* <span>Profile</span>
|
|
312
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
313
|
+
* </Command.Item>
|
|
314
|
+
* </Command.Group>
|
|
315
|
+
* </Command.List>
|
|
316
|
+
* </Command.DialogContent>
|
|
317
|
+
* </Command.DialogRoot>
|
|
318
|
+
* ```
|
|
319
|
+
*/
|
|
320
|
+
declare const CommandItem: ({ className, ...props }: ComponentProps<typeof Command$1.Item>) => import("react").JSX.Element;
|
|
321
|
+
/**
|
|
322
|
+
* The shortcut component for the Command. It provides the shortcut for the command palette.
|
|
323
|
+
*
|
|
324
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandshortcut
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```tsx
|
|
328
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
329
|
+
* <Command.DialogTrigger asChild>
|
|
330
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
331
|
+
* </Command.DialogTrigger>
|
|
332
|
+
* <Command.DialogContent>
|
|
333
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
334
|
+
* <Command.List>
|
|
335
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
336
|
+
* <Command.Group heading="Suggestions">
|
|
337
|
+
* <Command.Item>
|
|
338
|
+
* <span>Calendar</span>
|
|
339
|
+
* </Command.Item>
|
|
340
|
+
* </Command.Group>
|
|
341
|
+
* <Command.Separator />
|
|
342
|
+
* <Command.Group heading="Settings">
|
|
343
|
+
* <Command.Item>
|
|
344
|
+
* <span>Profile</span>
|
|
345
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
346
|
+
* </Command.Item>
|
|
347
|
+
* </Command.Group>
|
|
348
|
+
* </Command.List>
|
|
349
|
+
* </Command.DialogContent>
|
|
350
|
+
* </Command.DialogRoot>
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
declare const CommandShortcut: ({ className, ...props }: ComponentProps<"span">) => import("react").JSX.Element;
|
|
88
354
|
/**
|
|
89
355
|
* The command component for the Command. It provides the command for the command palette.
|
|
90
356
|
*
|
|
@@ -165,23 +431,7 @@ declare const Command: {
|
|
|
165
431
|
* </Command.DialogRoot>
|
|
166
432
|
* ```
|
|
167
433
|
*/
|
|
168
|
-
readonly Root:
|
|
169
|
-
children?: React.ReactNode;
|
|
170
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
171
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
172
|
-
} & {
|
|
173
|
-
asChild?: boolean;
|
|
174
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
175
|
-
label?: string;
|
|
176
|
-
shouldFilter?: boolean;
|
|
177
|
-
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
178
|
-
defaultValue?: string;
|
|
179
|
-
value?: string;
|
|
180
|
-
onValueChange?: (value: string) => void;
|
|
181
|
-
loop?: boolean;
|
|
182
|
-
disablePointerSelection?: boolean;
|
|
183
|
-
vimBindings?: boolean;
|
|
184
|
-
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
434
|
+
readonly Root: typeof CommandRoot;
|
|
185
435
|
/**
|
|
186
436
|
* The root stateful component for the Command dialog. Manages open/closed state.
|
|
187
437
|
*
|
|
@@ -215,7 +465,10 @@ declare const Command: {
|
|
|
215
465
|
* </Command.DialogTrigger>
|
|
216
466
|
* ```
|
|
217
467
|
*/
|
|
218
|
-
readonly DialogTrigger:
|
|
468
|
+
readonly DialogTrigger: {
|
|
469
|
+
(props: ComponentProps<import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>): import("react").JSX.Element;
|
|
470
|
+
displayName: string;
|
|
471
|
+
};
|
|
219
472
|
/**
|
|
220
473
|
* The visible content of the Command dialog. Renders inside the dialog portal.
|
|
221
474
|
*
|
|
@@ -264,14 +517,7 @@ declare const Command: {
|
|
|
264
517
|
* </Command.DialogRoot>
|
|
265
518
|
* ```
|
|
266
519
|
*/
|
|
267
|
-
readonly Input:
|
|
268
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
269
|
-
} & {
|
|
270
|
-
asChild?: boolean;
|
|
271
|
-
}, "asChild" | "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
272
|
-
value?: string;
|
|
273
|
-
onValueChange?: (search: string) => void;
|
|
274
|
-
} & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
520
|
+
readonly Input: typeof CommandInput;
|
|
275
521
|
/**
|
|
276
522
|
* The list component for the Command component.
|
|
277
523
|
*
|
|
@@ -304,15 +550,7 @@ declare const Command: {
|
|
|
304
550
|
* </Command.DialogRoot>
|
|
305
551
|
* ```
|
|
306
552
|
*/
|
|
307
|
-
readonly List:
|
|
308
|
-
children?: React.ReactNode;
|
|
309
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
310
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
311
|
-
} & {
|
|
312
|
-
asChild?: boolean;
|
|
313
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
314
|
-
label?: string;
|
|
315
|
-
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
553
|
+
readonly List: typeof CommandList;
|
|
316
554
|
/**
|
|
317
555
|
* The empty component for the Command component.
|
|
318
556
|
*
|
|
@@ -345,13 +583,7 @@ declare const Command: {
|
|
|
345
583
|
* </Command.DialogRoot>
|
|
346
584
|
* ```
|
|
347
585
|
*/
|
|
348
|
-
readonly Empty:
|
|
349
|
-
children?: React.ReactNode;
|
|
350
|
-
} & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
351
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
352
|
-
} & {
|
|
353
|
-
asChild?: boolean;
|
|
354
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
586
|
+
readonly Empty: typeof CommandEmpty;
|
|
355
587
|
/**
|
|
356
588
|
* The group component for the Command component.
|
|
357
589
|
*
|
|
@@ -384,17 +616,7 @@ declare const Command: {
|
|
|
384
616
|
* </Command.DialogRoot>
|
|
385
617
|
* ```
|
|
386
618
|
*/
|
|
387
|
-
readonly Group:
|
|
388
|
-
children?: React.ReactNode;
|
|
389
|
-
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
390
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
391
|
-
} & {
|
|
392
|
-
asChild?: boolean;
|
|
393
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
|
|
394
|
-
heading?: React.ReactNode;
|
|
395
|
-
value?: string;
|
|
396
|
-
forceMount?: boolean;
|
|
397
|
-
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
619
|
+
readonly Group: typeof CommandGroup;
|
|
398
620
|
/**
|
|
399
621
|
* The item component for the Command component.
|
|
400
622
|
*
|
|
@@ -427,19 +649,7 @@ declare const Command: {
|
|
|
427
649
|
* </Command.DialogRoot>
|
|
428
650
|
* ```
|
|
429
651
|
*/
|
|
430
|
-
readonly Item:
|
|
431
|
-
children?: React.ReactNode;
|
|
432
|
-
} & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
433
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
434
|
-
} & {
|
|
435
|
-
asChild?: boolean;
|
|
436
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "disabled" | "onSelect" | "value"> & {
|
|
437
|
-
disabled?: boolean;
|
|
438
|
-
onSelect?: (value: string) => void;
|
|
439
|
-
value?: string;
|
|
440
|
-
keywords?: string[];
|
|
441
|
-
forceMount?: boolean;
|
|
442
|
-
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
652
|
+
readonly Item: typeof CommandItem;
|
|
443
653
|
/**
|
|
444
654
|
* The shortcut component for the Command component.
|
|
445
655
|
*
|
|
@@ -472,7 +682,7 @@ declare const Command: {
|
|
|
472
682
|
* </Command.DialogRoot>
|
|
473
683
|
* ```
|
|
474
684
|
*/
|
|
475
|
-
readonly Shortcut:
|
|
685
|
+
readonly Shortcut: typeof CommandShortcut;
|
|
476
686
|
/**
|
|
477
687
|
* The separator component for the Command component.
|
|
478
688
|
*
|
|
@@ -505,13 +715,7 @@ declare const Command: {
|
|
|
505
715
|
* </Command.DialogRoot>
|
|
506
716
|
* ```
|
|
507
717
|
*/
|
|
508
|
-
readonly Separator:
|
|
509
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
510
|
-
} & {
|
|
511
|
-
asChild?: boolean;
|
|
512
|
-
}, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
513
|
-
alwaysRender?: boolean;
|
|
514
|
-
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
718
|
+
readonly Separator: typeof CommandSeparator;
|
|
515
719
|
};
|
|
516
720
|
//#endregion
|
|
517
721
|
//#region src/components/command/meta-key.d.ts
|
package/dist/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./separator-bpE_kooz.js";import{t as n}from"./dialog-CQ2C6vkE.js";import{t as r}from"./kbd-K8iaZ-Ti.js";import{useEffect as i,useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{MagnifyingGlassIcon as c}from"@phosphor-icons/react/MagnifyingGlass";import{Command as l,useCommandState as u}from"cmdk";const d=({className:t,...n})=>o(l,{"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n});d.displayName=`Command`;const f={Root:d,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:c,showCloseButton:l=!0,title:u=`Command Palette`})=>s(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[s(n.Header,{className:`sr-only absolute`,children:[o(n.Title,{children:u}),o(n.Description,{children:i})]}),o(d,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:c,children:t}),l&&o(`div`,{className:`absolute top-1.5 right-1.5`,children:o(n.CloseIconButton,{})})]}),Input:({className:t,ref:n,...r})=>s(`div`,{ref:n,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[o(c,{className:`size-5 shrink-0 opacity-50`}),o(l.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...r})]}),List:({className:t,...n})=>o(l.List,{"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}),Empty:({className:t,...n})=>o(l.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}),Group:({className:t,...n})=>o(l.Group,{"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}),Item:({className:t,...n})=>o(l.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}),Shortcut:({className:t,...n})=>o(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}),Separator:({className:n,...r})=>o(l.Separator,{"data-slot":`command-separator`,asChild:!0,...r,children:o(t,{className:e(`-mx-1 my-1 w-auto`,n)})})};function p({className:t,...n}){let[c,l]=a(`⌃`);i(()=>{l(h())},[]);let u=c===`⌘`?`Command`:`Control`;return s(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(c===`⌃`&&`font-medium`,t),children:[o(`span`,{className:`sr-only`,children:u}),c]})}function m(e){return`userAgentData`in e}function h(){if(typeof navigator>`u`)return`⌃`;let e=``;return m(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{f as Command,p as MetaKey,u as useCommandState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as e,useRef as t}from"react";function n(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function r(...e){return t=>{let r=!1,i=e.map(e=>{let i=n(e,t);return typeof i==`function`&&(r=!0),i});if(r)return()=>{for(let t=0;t<i.length;t++){let r=i[t];typeof r==`function`?r():n(e[t],null)}}}}function i(...n){let i=t(n);return i.current=n,e(e=>r(...i.current)(e),[])}export{i as n,r as t};
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
|
|
2
|
-
import { n as ButtonAppearance, t as Button } from "./button-
|
|
3
|
-
import { n as IconButtonAppearance, t as IconButton } from "./icon-button-
|
|
2
|
+
import { n as ButtonAppearance, t as Button } from "./button-BPMwa2jN.js";
|
|
3
|
+
import { n as IconButtonAppearance, t as IconButton } from "./icon-button-C1AfGnQx.js";
|
|
4
4
|
import { s as SortingMode } from "./direction-BjU0bPST.js";
|
|
5
|
-
import { t as Table$1 } from "./table-
|
|
5
|
+
import { t as Table$1 } from "./table-DUSvU_Jw.js";
|
|
6
6
|
import { ComponentProps, ReactNode } from "react";
|
|
7
7
|
import { HeaderContext, Row, Table } from "@tanstack/react-table";
|
|
8
8
|
export * from "@tanstack/react-table";
|
|
@@ -158,6 +158,31 @@ type DataTableHeaderProps = ComponentProps<typeof Table$1.Header>;
|
|
|
158
158
|
* ```
|
|
159
159
|
*/
|
|
160
160
|
declare function Header({ children, className, ...props }: DataTableHeaderProps): import("react").JSX.Element;
|
|
161
|
+
/**
|
|
162
|
+
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
163
|
+
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is no data.
|
|
164
|
+
*
|
|
165
|
+
* @see https://mantle.ngrok.com/components/data-display/data-table#datatablebody
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```tsx
|
|
169
|
+
* const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel() });
|
|
170
|
+
* const rows = table.getRowModel().rows;
|
|
171
|
+
*
|
|
172
|
+
* <DataTable.Root table={table}>
|
|
173
|
+
* <DataTable.Head />
|
|
174
|
+
* <DataTable.Body>
|
|
175
|
+
* {rows.length > 0
|
|
176
|
+
* ? rows.map((row) => <DataTable.Row key={row.id} row={row} />)
|
|
177
|
+
* : <DataTable.EmptyRow>No results.</DataTable.EmptyRow>}
|
|
178
|
+
* </DataTable.Body>
|
|
179
|
+
* </DataTable.Root>
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
declare const Body: {
|
|
183
|
+
(props: ComponentProps<typeof Table$1.Body>): import("react").JSX.Element;
|
|
184
|
+
displayName: string;
|
|
185
|
+
};
|
|
161
186
|
type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children">;
|
|
162
187
|
/**
|
|
163
188
|
* The `<thead>` container that renders column headers automatically from
|
|
@@ -926,7 +951,10 @@ declare const DataTable: {
|
|
|
926
951
|
* });
|
|
927
952
|
* ```
|
|
928
953
|
*/
|
|
929
|
-
readonly Cell:
|
|
954
|
+
readonly Cell: {
|
|
955
|
+
({ children, className, ref, ...props }: ComponentProps<"td">): import("react").JSX.Element;
|
|
956
|
+
displayName: string;
|
|
957
|
+
};
|
|
930
958
|
/**
|
|
931
959
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
932
960
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
|
@@ -943,7 +971,7 @@ declare const DataTable: {
|
|
|
943
971
|
* </DataTable.Body>
|
|
944
972
|
* ```
|
|
945
973
|
*/
|
|
946
|
-
readonly Body:
|
|
974
|
+
readonly Body: typeof Body;
|
|
947
975
|
/**
|
|
948
976
|
* An empty-state row that spans every column. Render this as the `else`
|
|
949
977
|
* branch when `rows.length === 0` to keep the table's frame intact instead
|
package/dist/data-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-button-DiOhreJD.js";import{t as n}from"./button-5WsvzIQ6.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-B_DDQcVD.js";import{t as a}from"./table-GDkapNFi.js";import{Fragment as o,createContext as s,useContext as c,useMemo as l}from"react";import u from"tiny-invariant";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{flexRender as m}from"@tanstack/react-table";import{MinusIcon as h}from"@phosphor-icons/react/Minus";import{PlusIcon as g}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const _=[`unsorted`,`asc`,`desc`],v=[`unsorted`,`desc`,`asc`];function y(e,t){return b(t===`alphanumeric`?_:v,e)??`unsorted`}function b(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const x=s(null);function S(){let e=c(x);return u(e,`useDataTableContext should only be used within a DataTable child component`),e}function C({children:e,table:t,...n}){let r=l(()=>({table:t}),[t]);return f(x.Provider,{value:r,children:f(a.Root,{"data-slot":`data-table`,...n,children:f(a.Element,{children:e})})})}function w({appearance:t=`ghost`,children:i,className:a,column:o,disableSorting:s=!1,iconPlacement:c=`end`,intent:l=`neutral`,sortingMode:u,sortIcon:d,onClick:m,...h}){let g=o.getIsSorted(),_=!s&&o.getCanSort(),v=_&&typeof g==`string`?g:`unsorted`,y=d?.(v)??f(B,{mode:u,direction:v});return p(n,{appearance:t,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none`,t===`ghost`&&l===`neutral`&&`text-muted`,a),"data-sort-direction":v,"data-table-header-action":!0,icon:y,iconPlacement:c,onClick:e=>{m?.(e),!e.defaultPrevented&&(!_||s||u===void 0||V(o,u))},intent:l,type:`button`,...h,children:[_&&v!==`unsorted`&&p(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,u===`alphanumeric`?v===`asc`?`ascending`:`descending`:r(v),` `,`order`]}),i]})}function T({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const E=e=>f(a.Body,{"data-slot":`data-table-body`,...e});function D(e){let{table:t}=S();return f(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>f(a.Row,{children:e.headers.map(e=>f(o,{children:e.isPlaceholder?f(a.Header,{},e.id):m(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function O({className:t,renderExpanded:n,row:r,...i}){let s=f(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>f(o,{children:m(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:p(d,{children:[s,r.getIsExpanded()&&f(R,{row:r,children:n(r)})]})}function k({children:e,...t}){let{table:n}=S(),r=n.getAllColumns().length;return f(a.Row,{"data-slot":`data-table-empty-row`,...t,children:f(a.Cell,{colSpan:r,children:e})})}function A(){return f(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function j({children:t,className:n,...r}){return p(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[f(A,{}),t]})}function M({children:t,className:n,...r}){let{table:i}=S(),o=i.getRowModel().rows.length>0;return p(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&f(A,{}),t]})}function N(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function P({children:t,className:n,...r}){return f(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??f(`span`,{className:`sr-only`,children:`Row details`})})}const F=f(g,{weight:`bold`,className:`size-3.5`}),I=f(h,{weight:`bold`,className:`size-3.5`});function L({appearance:n=`ghost`,className:r,collapseIcon:i=I,expandIcon:a=F,intent:o=`neutral`,label:s,onClick:c,row:l,size:u=`sm`,...d}){if(!l.getCanExpand())return null;let p=l.getIsExpanded(),m=l.getToggleExpandedHandler();return f(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,intent:o,size:u,className:e(`rounded`,r),"aria-expanded":p,"aria-controls":p?N(l):void 0,icon:p?i:a,label:`${p?`Hide`:`Show`} details for ${s}`,onClick:e=>{e.stopPropagation(),c?.(e),!e.defaultPrevented&&m()},...d})}function R({children:t,className:n,colSpan:r,row:i,...o}){return f(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:f(a.Cell,{id:N(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}C.displayName=`DataTable`,j.displayName=`DataTableActionCell`,M.displayName=`DataTableActionHeader`,E.displayName=`DataTableBody`,k.displayName=`DataTableEmptyRow`,P.displayName=`DataTableExpandHeader`,R.displayName=`DataTableExpandedRow`,D.displayName=`DataTableHead`,T.displayName=`DataTableHeader`,w.displayName=`DataTableHeaderSortButton`,O.displayName=`DataTableRow`,L.displayName=`DataTableRowExpandButton`;const z={Root:C,ActionCell:j,ActionHeader:M,Cell:a.Cell,Body:E,EmptyRow:k,Head:D,Header:T,HeaderSortButton:w,Row:O,ExpandHeader:P,RowExpandButton:L,ExpandedRow:R};function B({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?f(`svg`,{"aria-hidden":!0,...n}):f(i,{mode:t,direction:e,...n})}function V(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(y(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{z as DataTable,N as expandedRowId};
|