@ngrok/mantle 0.79.3 → 0.81.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 +158 -19
- package/dist/accordion.js +1 -1
- package/dist/agent.json +5 -1
- package/dist/alert-dialog.d.ts +465 -32
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +116 -14
- package/dist/alert.js +1 -1
- package/dist/anchor-DfeXTpKW.js +1 -0
- package/dist/anchor.d.ts +2 -2
- package/dist/anchor.js +1 -1
- package/dist/area-chart.d.ts +504 -0
- package/dist/area-chart.js +1 -0
- package/dist/as-child-D23mGo4f.d.ts +49 -0
- package/dist/badge.d.ts +44 -5
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +491 -0
- package/dist/bar-chart.js +1 -0
- package/dist/breadcrumb.d.ts +196 -14
- package/dist/breadcrumb.js +1 -1
- package/dist/button-BAno7KIU.js +1 -0
- package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
- package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
- package/dist/button-D9n09xUg.js +1 -0
- package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
- package/dist/button-DjpEKt2X.js +1 -0
- package/dist/button-DvHMWAPl.js +1 -0
- package/dist/button.d.ts +5 -5
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +0 -3
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +131 -9
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +209 -8
- package/dist/centered-layout.js +1 -1
- package/dist/chart-BROa2gqt.js +2 -0
- package/dist/chart-BcOC6Qj0.d.ts +275 -0
- package/dist/checkbox-0EoxOyMA.js +1 -0
- package/dist/checkbox.d.ts +13 -11
- package/dist/checkbox.js +1 -1
- package/dist/choice-BHwFSSyv.js +1 -0
- package/dist/choice-BNRQXszu.d.ts +254 -0
- package/dist/choice.d.ts +1 -252
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +242 -52
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -2
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +171 -16
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +279 -81
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdBMM9ga.js +1 -0
- package/dist/data-table.d.ts +28 -6
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +67 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-BM4wPCft.d.ts +24 -0
- package/dist/dialog-DWZWd5Jt.js +1 -0
- package/dist/dialog.d.ts +226 -35
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
- package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
- package/dist/dropdown-menu-RyDWoKHx.js +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +7 -22
- package/dist/empty.js +1 -1
- package/dist/field-B1wqeZr4.js +1 -0
- package/dist/field.d.ts +568 -47
- 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 +48 -7
- package/dist/hover-card.js +1 -1
- package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
- package/dist/icon-d-nMCfAI.js +1 -0
- package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
- package/dist/icon-lZ48P8Nn.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
- package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
- package/dist/icons-DLCs1hLP.js +1 -0
- package/dist/icons.d.ts +7 -15
- package/dist/icons.js +1 -1
- package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
- package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
- package/dist/input-BnlpQF0c.js +1 -0
- package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
- package/dist/input.d.ts +5 -56
- 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/line-chart.d.ts +490 -0
- package/dist/line-chart.js +1 -0
- package/dist/list-51KQvENW.js +1 -0
- package/dist/list.d.ts +135 -6
- package/dist/list.js +1 -1
- package/dist/llms.txt +5 -1
- package/dist/main.d.ts +20 -4
- package/dist/main.js +1 -1
- package/dist/mantle-dark-high-contrast.css +17 -0
- package/dist/mantle-dark.css +13 -0
- package/dist/mantle-light-high-contrast.css +15 -0
- package/dist/mantle.css +29 -0
- package/dist/media-object.d.ts +18 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +282 -24
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +118 -6
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +61 -6
- package/dist/pagination.js +1 -1
- package/dist/popover-CE4OlWkd.d.ts +208 -0
- package/dist/popover-CQ9s7jG5.js +1 -0
- package/dist/popover.d.ts +1 -181
- package/dist/popover.js +1 -1
- package/dist/primitive-trJDqIXJ.js +1 -0
- package/dist/progress.d.ts +2 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +101 -5
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +110 -35
- 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/scatter-plot.d.ts +495 -0
- package/dist/scatter-plot.js +1 -0
- package/dist/select-0z7HVS6r.d.ts +579 -0
- package/dist/select-BCHWvmyC.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +225 -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 +285 -38
- 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/slider.js +1 -1
- package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
- package/dist/slot-CDk0Bb9z.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +14 -14
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +10 -7
- package/dist/switch.js +1 -1
- package/dist/table-Bo0vNxIJ.d.ts +848 -0
- package/dist/table-CGxJwtbL.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +124 -25
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-C26-Xolp.js +1 -0
- package/dist/theme-switcher.d.ts +105 -33
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +54 -15
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +86 -10
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +50 -5
- package/dist/tooltip.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/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/package.json +9 -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/field-context-BR01g789.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/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
- /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
- /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
- /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
- /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
- /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
- /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
package/dist/command.d.ts
CHANGED
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentProps, ComponentPropsWithoutRef, ReactNode } from "react";
|
|
1
|
+
import { a as Root } from "./dialog-BM4wPCft.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: ({ className, ...props }: CommandRootProps) => import("react").JSX.Element;
|
|
6
39
|
/**
|
|
7
40
|
* The props for the CommandDialog.Content component.
|
|
8
41
|
*
|
|
@@ -81,10 +114,240 @@ type CommandDialogContentProps = {
|
|
|
81
114
|
* </Command.DialogRoot>
|
|
82
115
|
* ```
|
|
83
116
|
*/
|
|
84
|
-
declare const CommandDialogContent: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
117
|
+
declare const CommandDialogContent: ({ children, className, description, filter, shouldFilter, showCloseButton, title }: CommandDialogContentProps) => import("react").JSX.Element;
|
|
118
|
+
/**
|
|
119
|
+
* The input component for the Command. It provides the input for the command palette.
|
|
120
|
+
*
|
|
121
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandinput
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
126
|
+
* <Command.DialogTrigger asChild>
|
|
127
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
128
|
+
* </Command.DialogTrigger>
|
|
129
|
+
* <Command.DialogContent>
|
|
130
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
131
|
+
* <Command.List>
|
|
132
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
133
|
+
* <Command.Group heading="Suggestions">
|
|
134
|
+
* <Command.Item>
|
|
135
|
+
* <span>Calendar</span>
|
|
136
|
+
* </Command.Item>
|
|
137
|
+
* </Command.Group>
|
|
138
|
+
* <Command.Separator />
|
|
139
|
+
* <Command.Group heading="Settings">
|
|
140
|
+
* <Command.Item>
|
|
141
|
+
* <span>Profile</span>
|
|
142
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
143
|
+
* </Command.Item>
|
|
144
|
+
* </Command.Group>
|
|
145
|
+
* </Command.List>
|
|
146
|
+
* </Command.DialogContent>
|
|
147
|
+
* </Command.DialogRoot>
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare const CommandInput: ({ className, ref, ...props }: ComponentPropsWithoutRef<typeof Command$1.Input> & {
|
|
151
|
+
ref?: Ref<HTMLDivElement>;
|
|
152
|
+
}) => import("react").JSX.Element;
|
|
153
|
+
/**
|
|
154
|
+
* The list component for the Command. It provides the list for the command palette.
|
|
155
|
+
*
|
|
156
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandlist
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```tsx
|
|
160
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
161
|
+
* <Command.DialogTrigger asChild>
|
|
162
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
163
|
+
* </Command.DialogTrigger>
|
|
164
|
+
* <Command.DialogContent>
|
|
165
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
166
|
+
* <Command.List>
|
|
167
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
168
|
+
* <Command.Group heading="Suggestions">
|
|
169
|
+
* <Command.Item>
|
|
170
|
+
* <span>Calendar</span>
|
|
171
|
+
* </Command.Item>
|
|
172
|
+
* </Command.Group>
|
|
173
|
+
* <Command.Separator />
|
|
174
|
+
* <Command.Group heading="Settings">
|
|
175
|
+
* <Command.Item>
|
|
176
|
+
* <span>Profile</span>
|
|
177
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
178
|
+
* </Command.Item>
|
|
179
|
+
* </Command.Group>
|
|
180
|
+
* </Command.List>
|
|
181
|
+
* </Command.DialogContent>
|
|
182
|
+
* </Command.DialogRoot>
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
declare const CommandList: ({ className, ...props }: ComponentProps<typeof Command$1.List>) => import("react").JSX.Element;
|
|
186
|
+
/**
|
|
187
|
+
* The empty component for the Command. It provides the empty state for the command palette.
|
|
188
|
+
*
|
|
189
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandempty
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```tsx
|
|
193
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
194
|
+
* <Command.DialogTrigger asChild>
|
|
195
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
196
|
+
* </Command.DialogTrigger>
|
|
197
|
+
* <Command.DialogContent>
|
|
198
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
199
|
+
* <Command.List>
|
|
200
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
201
|
+
* <Command.Group heading="Suggestions">
|
|
202
|
+
* <Command.Item>
|
|
203
|
+
* <span>Calendar</span>
|
|
204
|
+
* </Command.Item>
|
|
205
|
+
* </Command.Group>
|
|
206
|
+
* <Command.Separator />
|
|
207
|
+
* <Command.Group heading="Settings">
|
|
208
|
+
* <Command.Item>
|
|
209
|
+
* <span>Profile</span>
|
|
210
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
211
|
+
* </Command.Item>
|
|
212
|
+
* </Command.Group>
|
|
213
|
+
* </Command.List>
|
|
214
|
+
* </Command.DialogContent>
|
|
215
|
+
* </Command.DialogRoot>
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
declare const CommandEmpty: ({ className, ...props }: ComponentProps<typeof Command$1.Empty>) => import("react").JSX.Element;
|
|
219
|
+
/**
|
|
220
|
+
* The group component for the Command. It provides the group for the command palette.
|
|
221
|
+
*
|
|
222
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandgroup
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```tsx
|
|
226
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
227
|
+
* <Command.DialogTrigger asChild>
|
|
228
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
229
|
+
* </Command.DialogTrigger>
|
|
230
|
+
* <Command.DialogContent>
|
|
231
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
232
|
+
* <Command.List>
|
|
233
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
234
|
+
* <Command.Group heading="Suggestions">
|
|
235
|
+
* <Command.Item>
|
|
236
|
+
* <span>Calendar</span>
|
|
237
|
+
* </Command.Item>
|
|
238
|
+
* </Command.Group>
|
|
239
|
+
* <Command.Separator />
|
|
240
|
+
* <Command.Group heading="Settings">
|
|
241
|
+
* <Command.Item>
|
|
242
|
+
* <span>Profile</span>
|
|
243
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
244
|
+
* </Command.Item>
|
|
245
|
+
* </Command.Group>
|
|
246
|
+
* </Command.List>
|
|
247
|
+
* </Command.DialogContent>
|
|
248
|
+
* </Command.DialogRoot>
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
declare const CommandGroup: ({ className, ...props }: ComponentProps<typeof Command$1.Group>) => import("react").JSX.Element;
|
|
252
|
+
/**
|
|
253
|
+
* The separator component for the Command. It provides the separator for the command palette.
|
|
254
|
+
*
|
|
255
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandseparator
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
260
|
+
* <Command.DialogTrigger asChild>
|
|
261
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
262
|
+
* </Command.DialogTrigger>
|
|
263
|
+
* <Command.DialogContent>
|
|
264
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
265
|
+
* <Command.List>
|
|
266
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
267
|
+
* <Command.Group heading="Suggestions">
|
|
268
|
+
* <Command.Item>
|
|
269
|
+
* <span>Calendar</span>
|
|
270
|
+
* </Command.Item>
|
|
271
|
+
* </Command.Group>
|
|
272
|
+
* <Command.Separator />
|
|
273
|
+
* <Command.Group heading="Settings">
|
|
274
|
+
* <Command.Item>
|
|
275
|
+
* <span>Profile</span>
|
|
276
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
277
|
+
* </Command.Item>
|
|
278
|
+
* </Command.Group>
|
|
279
|
+
* </Command.List>
|
|
280
|
+
* </Command.DialogContent>
|
|
281
|
+
* </Command.DialogRoot>
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
declare const CommandSeparator: ({ className, ...props }: ComponentProps<typeof Command$1.Separator>) => import("react").JSX.Element;
|
|
285
|
+
/**
|
|
286
|
+
* The item component for the Command. It provides the item for the command palette.
|
|
287
|
+
*
|
|
288
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commanditem
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```tsx
|
|
292
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
293
|
+
* <Command.DialogTrigger asChild>
|
|
294
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
295
|
+
* </Command.DialogTrigger>
|
|
296
|
+
* <Command.DialogContent>
|
|
297
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
298
|
+
* <Command.List>
|
|
299
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
300
|
+
* <Command.Group heading="Suggestions">
|
|
301
|
+
* <Command.Item>
|
|
302
|
+
* <span>Calendar</span>
|
|
303
|
+
* </Command.Item>
|
|
304
|
+
* </Command.Group>
|
|
305
|
+
* <Command.Separator />
|
|
306
|
+
* <Command.Group heading="Settings">
|
|
307
|
+
* <Command.Item>
|
|
308
|
+
* <span>Profile</span>
|
|
309
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
310
|
+
* </Command.Item>
|
|
311
|
+
* </Command.Group>
|
|
312
|
+
* </Command.List>
|
|
313
|
+
* </Command.DialogContent>
|
|
314
|
+
* </Command.DialogRoot>
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
declare const CommandItem: ({ className, ...props }: ComponentProps<typeof Command$1.Item>) => import("react").JSX.Element;
|
|
318
|
+
/**
|
|
319
|
+
* The shortcut component for the Command. It provides the shortcut for the command palette.
|
|
320
|
+
*
|
|
321
|
+
* @see https://mantle.ngrok.com/components/navigation/command#commandshortcut
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```tsx
|
|
325
|
+
* <Command.DialogRoot open={open} onOpenChange={setOpen}>
|
|
326
|
+
* <Command.DialogTrigger asChild>
|
|
327
|
+
* <Button type="button" appearance="outlined" intent="neutral">Open Command Palette</Button>
|
|
328
|
+
* </Command.DialogTrigger>
|
|
329
|
+
* <Command.DialogContent>
|
|
330
|
+
* <Command.Input placeholder="Type a command or search..." />
|
|
331
|
+
* <Command.List>
|
|
332
|
+
* <Command.Empty>No results found.</Command.Empty>
|
|
333
|
+
* <Command.Group heading="Suggestions">
|
|
334
|
+
* <Command.Item>
|
|
335
|
+
* <span>Calendar</span>
|
|
336
|
+
* </Command.Item>
|
|
337
|
+
* </Command.Group>
|
|
338
|
+
* <Command.Separator />
|
|
339
|
+
* <Command.Group heading="Settings">
|
|
340
|
+
* <Command.Item>
|
|
341
|
+
* <span>Profile</span>
|
|
342
|
+
* <Command.Shortcut>⌘,</Command.Shortcut>
|
|
343
|
+
* </Command.Item>
|
|
344
|
+
* </Command.Group>
|
|
345
|
+
* </Command.List>
|
|
346
|
+
* </Command.DialogContent>
|
|
347
|
+
* </Command.DialogRoot>
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
declare const CommandShortcut: ({ className, ...props }: ComponentProps<"span">) => import("react").JSX.Element;
|
|
88
351
|
/**
|
|
89
352
|
* The command component for the Command. It provides the command for the command palette.
|
|
90
353
|
*
|
|
@@ -165,23 +428,7 @@ declare const Command: {
|
|
|
165
428
|
* </Command.DialogRoot>
|
|
166
429
|
* ```
|
|
167
430
|
*/
|
|
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>>;
|
|
431
|
+
readonly Root: typeof CommandRoot;
|
|
185
432
|
/**
|
|
186
433
|
* The root stateful component for the Command dialog. Manages open/closed state.
|
|
187
434
|
*
|
|
@@ -215,7 +462,7 @@ declare const Command: {
|
|
|
215
462
|
* </Command.DialogTrigger>
|
|
216
463
|
* ```
|
|
217
464
|
*/
|
|
218
|
-
readonly DialogTrigger: import("react").ForwardRefExoticComponent<
|
|
465
|
+
readonly DialogTrigger: (props: ComponentProps<import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>>) => import("react").JSX.Element;
|
|
219
466
|
/**
|
|
220
467
|
* The visible content of the Command dialog. Renders inside the dialog portal.
|
|
221
468
|
*
|
|
@@ -264,14 +511,7 @@ declare const Command: {
|
|
|
264
511
|
* </Command.DialogRoot>
|
|
265
512
|
* ```
|
|
266
513
|
*/
|
|
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>>;
|
|
514
|
+
readonly Input: typeof CommandInput;
|
|
275
515
|
/**
|
|
276
516
|
* The list component for the Command component.
|
|
277
517
|
*
|
|
@@ -304,15 +544,7 @@ declare const Command: {
|
|
|
304
544
|
* </Command.DialogRoot>
|
|
305
545
|
* ```
|
|
306
546
|
*/
|
|
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>>;
|
|
547
|
+
readonly List: typeof CommandList;
|
|
316
548
|
/**
|
|
317
549
|
* The empty component for the Command component.
|
|
318
550
|
*
|
|
@@ -345,13 +577,7 @@ declare const Command: {
|
|
|
345
577
|
* </Command.DialogRoot>
|
|
346
578
|
* ```
|
|
347
579
|
*/
|
|
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>>;
|
|
580
|
+
readonly Empty: typeof CommandEmpty;
|
|
355
581
|
/**
|
|
356
582
|
* The group component for the Command component.
|
|
357
583
|
*
|
|
@@ -384,17 +610,7 @@ declare const Command: {
|
|
|
384
610
|
* </Command.DialogRoot>
|
|
385
611
|
* ```
|
|
386
612
|
*/
|
|
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>>;
|
|
613
|
+
readonly Group: typeof CommandGroup;
|
|
398
614
|
/**
|
|
399
615
|
* The item component for the Command component.
|
|
400
616
|
*
|
|
@@ -427,19 +643,7 @@ declare const Command: {
|
|
|
427
643
|
* </Command.DialogRoot>
|
|
428
644
|
* ```
|
|
429
645
|
*/
|
|
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>>;
|
|
646
|
+
readonly Item: typeof CommandItem;
|
|
443
647
|
/**
|
|
444
648
|
* The shortcut component for the Command component.
|
|
445
649
|
*
|
|
@@ -472,7 +676,7 @@ declare const Command: {
|
|
|
472
676
|
* </Command.DialogRoot>
|
|
473
677
|
* ```
|
|
474
678
|
*/
|
|
475
|
-
readonly Shortcut:
|
|
679
|
+
readonly Shortcut: typeof CommandShortcut;
|
|
476
680
|
/**
|
|
477
681
|
* The separator component for the Command component.
|
|
478
682
|
*
|
|
@@ -505,13 +709,7 @@ declare const Command: {
|
|
|
505
709
|
* </Command.DialogRoot>
|
|
506
710
|
* ```
|
|
507
711
|
*/
|
|
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>>;
|
|
712
|
+
readonly Separator: typeof CommandSeparator;
|
|
515
713
|
};
|
|
516
714
|
//#endregion
|
|
517
715
|
//#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-DWZWd5Jt.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}),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
|
-
import { t as ButtonIntent } from "./
|
|
2
|
-
import { n as ButtonAppearance, t as Button } from "./button-
|
|
3
|
-
import {
|
|
1
|
+
import { t as ButtonIntent } from "./button-DdSKSj1c.js";
|
|
2
|
+
import { n as ButtonAppearance, t as Button } from "./button-DARFK2KJ.js";
|
|
3
|
+
import { r as IconButtonAppearance, t as IconButton } from "./button-C7vAl6lS.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-Bo0vNxIJ.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,28 @@ 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: (props: ComponentProps<typeof Table$1.Body>) => import("react").JSX.Element;
|
|
161
183
|
type DataTableHeadProps = Omit<ComponentProps<typeof Table$1.Head>, "children">;
|
|
162
184
|
/**
|
|
163
185
|
* The `<thead>` container that renders column headers automatically from
|
|
@@ -926,7 +948,7 @@ declare const DataTable: {
|
|
|
926
948
|
* });
|
|
927
949
|
* ```
|
|
928
950
|
*/
|
|
929
|
-
readonly Cell:
|
|
951
|
+
readonly Cell: ({ children, className, ref, ...props }: ComponentProps<"td">) => import("react").JSX.Element;
|
|
930
952
|
/**
|
|
931
953
|
* The `<tbody>` container for rows of data. Typically wraps a map of
|
|
932
954
|
* `DataTable.Row`, with a `DataTable.EmptyRow` fallback when there is
|
|
@@ -943,7 +965,7 @@ declare const DataTable: {
|
|
|
943
965
|
* </DataTable.Body>
|
|
944
966
|
* ```
|
|
945
967
|
*/
|
|
946
|
-
readonly Body:
|
|
968
|
+
readonly Body: typeof Body;
|
|
947
969
|
/**
|
|
948
970
|
* An empty-state row that spans every column. Render this as the `else`
|
|
949
971
|
* 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"./
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-BAno7KIU.js";import{t as n}from"./button-DjpEKt2X.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./icons-B_DDQcVD.js";import{t as a}from"./table-CGxJwtbL.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})})}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};
|