@recanica/ui 0.0.0-stage → 0.1.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/LICENSE +9 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +65 -0
- package/dist/components/alert-dialog.d.ts +18 -0
- package/dist/components/alert-dialog.js +178 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.js +66 -0
- package/dist/components/app-shell.d.ts +15 -0
- package/dist/components/app-shell.js +27 -0
- package/dist/components/aspect-ratio.d.ts +3 -0
- package/dist/components/aspect-ratio.js +11 -0
- package/dist/components/attachment.d.ts +24 -0
- package/dist/components/attachment.js +192 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +104 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +63 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +103 -0
- package/dist/components/bubble.d.ts +17 -0
- package/dist/components/bubble.js +110 -0
- package/dist/components/button-group.d.ts +11 -0
- package/dist/components/button-group.js +76 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +59 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.js +195 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +90 -0
- package/dist/components/carousel.d.ts +19 -0
- package/dist/components/carousel.js +199 -0
- package/dist/components/chart.d.ts +44 -0
- package/dist/components/chart.js +253 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/choice-card.d.ts +18 -0
- package/dist/components/choice-card.js +43 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +35 -0
- package/dist/components/combobox.d.ts +24 -0
- package/dist/components/combobox.js +297 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.js +177 -0
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.js +224 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +147 -0
- package/dist/components/direction.d.ts +7 -0
- package/dist/components/direction.js +15 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.js +129 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +232 -0
- package/dist/components/empty.d.ts +11 -0
- package/dist/components/empty.js +102 -0
- package/dist/components/field.d.ts +52 -0
- package/dist/components/field.js +261 -0
- package/dist/components/form.d.ts +24 -0
- package/dist/components/form.js +126 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.js +39 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.js +160 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input-otp.js +67 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +25 -0
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.js +187 -0
- package/dist/components/kbd.d.ts +3 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +23 -0
- package/dist/components/layout.d.ts +34 -0
- package/dist/components/layout.js +46 -0
- package/dist/components/loader.d.ts +38 -0
- package/dist/components/loader.js +90 -0
- package/dist/components/marker.d.ts +11 -0
- package/dist/components/marker.js +66 -0
- package/dist/components/menubar.d.ts +26 -0
- package/dist/components/menubar.js +252 -0
- package/dist/components/message-scroller.d.ts +10 -0
- package/dist/components/message-scroller.js +118 -0
- package/dist/components/message.d.ts +10 -0
- package/dist/components/message.js +90 -0
- package/dist/components/native-select.d.ts +7 -0
- package/dist/components/native-select.js +71 -0
- package/dist/components/nav-item.d.ts +17 -0
- package/dist/components/nav-item.js +36 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.js +170 -0
- package/dist/components/page.d.ts +80 -0
- package/dist/components/page.js +84 -0
- package/dist/components/pagination.d.ts +13 -0
- package/dist/components/pagination.js +122 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.js +81 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.js +32 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +46 -0
- package/dist/components/resizable.d.ts +7 -0
- package/dist/components/resizable.js +47 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +61 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +179 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +27 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +128 -0
- package/dist/components/sidebar.d.ts +69 -0
- package/dist/components/sidebar.js +650 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +15 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.js +64 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.js +38 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.js +17 -0
- package/dist/components/stat.d.ts +47 -0
- package/dist/components/stat.js +120 -0
- package/dist/components/surface.d.ts +28 -0
- package/dist/components/surface.js +39 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +34 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +115 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +92 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +22 -0
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle-group.js +69 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.js +44 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/web-section.d.ts +40 -0
- package/dist/components/web-section.js +72 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/package.json +79 -3
- package/README.md +0 -3
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
5
|
+
import { cn } from "@recanica/ui/lib/utils";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
7
|
+
import { Button } from "@recanica/ui/components/button";
|
|
8
|
+
import {
|
|
9
|
+
InputGroup,
|
|
10
|
+
InputGroupAddon,
|
|
11
|
+
InputGroupButton,
|
|
12
|
+
InputGroupInput
|
|
13
|
+
} from "@recanica/ui/components/input-group";
|
|
14
|
+
const Combobox = ComboboxPrimitive.Root;
|
|
15
|
+
function ComboboxValue({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
|
|
17
|
+
}
|
|
18
|
+
function ComboboxTrigger({
|
|
19
|
+
className,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
ComboboxPrimitive.Trigger,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "combobox-trigger",
|
|
27
|
+
className: cn("[&_svg:not([class*='size-'])]:size-4", className),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
ChevronDownIcon,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "combobox-trigger-icon",
|
|
35
|
+
className: "pointer-events-none size-4 text-muted-foreground"
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function ComboboxClear({ className, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
ComboboxPrimitive.Clear,
|
|
45
|
+
{
|
|
46
|
+
"data-slot": "combobox-clear",
|
|
47
|
+
render: /* @__PURE__ */ jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }),
|
|
48
|
+
className: cn(className),
|
|
49
|
+
...props,
|
|
50
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function ComboboxInput({
|
|
55
|
+
className,
|
|
56
|
+
children,
|
|
57
|
+
disabled = false,
|
|
58
|
+
showTrigger = true,
|
|
59
|
+
showClear = false,
|
|
60
|
+
...props
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ jsxs(InputGroup, { className: cn("w-auto", className), children: [
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
ComboboxPrimitive.Input,
|
|
65
|
+
{
|
|
66
|
+
render: /* @__PURE__ */ jsx(InputGroupInput, { disabled }),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, { align: "inline-end", children: [
|
|
71
|
+
showTrigger && /* @__PURE__ */ jsx(
|
|
72
|
+
InputGroupButton,
|
|
73
|
+
{
|
|
74
|
+
size: "icon-xs",
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
asChild: true,
|
|
77
|
+
"data-slot": "input-group-button",
|
|
78
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
79
|
+
disabled,
|
|
80
|
+
children: /* @__PURE__ */ jsx(ComboboxTrigger, {})
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled })
|
|
84
|
+
] }),
|
|
85
|
+
children
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
function ComboboxContent({
|
|
89
|
+
className,
|
|
90
|
+
side = "bottom",
|
|
91
|
+
sideOffset = 6,
|
|
92
|
+
align = "start",
|
|
93
|
+
alignOffset = 0,
|
|
94
|
+
anchor,
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ jsx(ComboboxPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
98
|
+
ComboboxPrimitive.Positioner,
|
|
99
|
+
{
|
|
100
|
+
side,
|
|
101
|
+
sideOffset,
|
|
102
|
+
align,
|
|
103
|
+
alignOffset,
|
|
104
|
+
anchor,
|
|
105
|
+
className: "isolate z-50",
|
|
106
|
+
children: /* @__PURE__ */ jsx(
|
|
107
|
+
ComboboxPrimitive.Popup,
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "combobox-content",
|
|
110
|
+
"data-chips": !!anchor,
|
|
111
|
+
className: cn(
|
|
112
|
+
"group/combobox-content relative max-h-96 w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
113
|
+
className
|
|
114
|
+
),
|
|
115
|
+
...props
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
) });
|
|
120
|
+
}
|
|
121
|
+
function ComboboxList({ className, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx(
|
|
123
|
+
ComboboxPrimitive.List,
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "combobox-list",
|
|
126
|
+
className: cn(
|
|
127
|
+
"max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0",
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
function ComboboxItem({
|
|
135
|
+
className,
|
|
136
|
+
children,
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ jsxs(
|
|
140
|
+
ComboboxPrimitive.Item,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "combobox-item",
|
|
143
|
+
className: cn(
|
|
144
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
...props,
|
|
148
|
+
children: [
|
|
149
|
+
children,
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
ComboboxPrimitive.ItemIndicator,
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "combobox-item-indicator",
|
|
154
|
+
render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
155
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none size-4 pointer-coarse:size-5" })
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function ComboboxGroup({ className, ...props }) {
|
|
163
|
+
return /* @__PURE__ */ jsx(
|
|
164
|
+
ComboboxPrimitive.Group,
|
|
165
|
+
{
|
|
166
|
+
"data-slot": "combobox-group",
|
|
167
|
+
className: cn(className),
|
|
168
|
+
...props
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
function ComboboxLabel({
|
|
173
|
+
className,
|
|
174
|
+
...props
|
|
175
|
+
}) {
|
|
176
|
+
return /* @__PURE__ */ jsx(
|
|
177
|
+
ComboboxPrimitive.GroupLabel,
|
|
178
|
+
{
|
|
179
|
+
"data-slot": "combobox-label",
|
|
180
|
+
className: cn(
|
|
181
|
+
"px-2 py-1.5 text-xs text-muted-foreground pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-sm",
|
|
182
|
+
className
|
|
183
|
+
),
|
|
184
|
+
...props
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
function ComboboxCollection({ ...props }) {
|
|
189
|
+
return /* @__PURE__ */ jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props });
|
|
190
|
+
}
|
|
191
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
192
|
+
return /* @__PURE__ */ jsx(
|
|
193
|
+
ComboboxPrimitive.Empty,
|
|
194
|
+
{
|
|
195
|
+
"data-slot": "combobox-empty",
|
|
196
|
+
className: cn(
|
|
197
|
+
"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",
|
|
198
|
+
className
|
|
199
|
+
),
|
|
200
|
+
...props
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
function ComboboxSeparator({
|
|
205
|
+
className,
|
|
206
|
+
...props
|
|
207
|
+
}) {
|
|
208
|
+
return /* @__PURE__ */ jsx(
|
|
209
|
+
ComboboxPrimitive.Separator,
|
|
210
|
+
{
|
|
211
|
+
"data-slot": "combobox-separator",
|
|
212
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
213
|
+
...props
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function ComboboxChips({
|
|
218
|
+
className,
|
|
219
|
+
...props
|
|
220
|
+
}) {
|
|
221
|
+
return /* @__PURE__ */ jsx(
|
|
222
|
+
ComboboxPrimitive.Chips,
|
|
223
|
+
{
|
|
224
|
+
"data-slot": "combobox-chips",
|
|
225
|
+
className: cn(
|
|
226
|
+
"flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
|
|
227
|
+
className
|
|
228
|
+
),
|
|
229
|
+
...props
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
function ComboboxChip({
|
|
234
|
+
className,
|
|
235
|
+
children,
|
|
236
|
+
showRemove = true,
|
|
237
|
+
...props
|
|
238
|
+
}) {
|
|
239
|
+
return /* @__PURE__ */ jsxs(
|
|
240
|
+
ComboboxPrimitive.Chip,
|
|
241
|
+
{
|
|
242
|
+
"data-slot": "combobox-chip",
|
|
243
|
+
className: cn(
|
|
244
|
+
"flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",
|
|
245
|
+
className
|
|
246
|
+
),
|
|
247
|
+
...props,
|
|
248
|
+
children: [
|
|
249
|
+
children,
|
|
250
|
+
showRemove && /* @__PURE__ */ jsx(
|
|
251
|
+
ComboboxPrimitive.ChipRemove,
|
|
252
|
+
{
|
|
253
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-xs" }),
|
|
254
|
+
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
255
|
+
"data-slot": "combobox-chip-remove",
|
|
256
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
function ComboboxChipsInput({
|
|
264
|
+
className,
|
|
265
|
+
children,
|
|
266
|
+
...props
|
|
267
|
+
}) {
|
|
268
|
+
return /* @__PURE__ */ jsx(
|
|
269
|
+
ComboboxPrimitive.Input,
|
|
270
|
+
{
|
|
271
|
+
"data-slot": "combobox-chip-input",
|
|
272
|
+
className: cn("min-w-16 flex-1 outline-none", className),
|
|
273
|
+
...props
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
function useComboboxAnchor() {
|
|
278
|
+
return React.useRef(null);
|
|
279
|
+
}
|
|
280
|
+
export {
|
|
281
|
+
Combobox,
|
|
282
|
+
ComboboxChip,
|
|
283
|
+
ComboboxChips,
|
|
284
|
+
ComboboxChipsInput,
|
|
285
|
+
ComboboxCollection,
|
|
286
|
+
ComboboxContent,
|
|
287
|
+
ComboboxEmpty,
|
|
288
|
+
ComboboxGroup,
|
|
289
|
+
ComboboxInput,
|
|
290
|
+
ComboboxItem,
|
|
291
|
+
ComboboxLabel,
|
|
292
|
+
ComboboxList,
|
|
293
|
+
ComboboxSeparator,
|
|
294
|
+
ComboboxTrigger,
|
|
295
|
+
ComboboxValue,
|
|
296
|
+
useComboboxAnchor
|
|
297
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
3
|
+
import { Dialog } from "@recanica/ui/components/dialog";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
4
|
+
import { cn } from "@recanica/ui/lib/utils";
|
|
5
|
+
import { SearchIcon } from "lucide-react";
|
|
6
|
+
import {
|
|
7
|
+
Dialog,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogHeader,
|
|
11
|
+
DialogTitle
|
|
12
|
+
} from "@recanica/ui/components/dialog";
|
|
13
|
+
function Command({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
CommandPrimitive,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "command",
|
|
21
|
+
className: cn(
|
|
22
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function CommandDialog({
|
|
30
|
+
title = "Command Palette",
|
|
31
|
+
description = "Search for a command to run...",
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
showCloseButton = true,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
|
|
38
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
|
|
39
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
40
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
DialogContent,
|
|
44
|
+
{
|
|
45
|
+
className: cn("overflow-hidden p-0", className),
|
|
46
|
+
showCloseButton,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
function CommandInput({
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
}) {
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "command-input-wrapper",
|
|
60
|
+
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
CommandPrimitive.Input,
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "command-input",
|
|
67
|
+
className: cn(
|
|
68
|
+
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function CommandList({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
CommandPrimitive.List,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "command-list",
|
|
86
|
+
className: cn(
|
|
87
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function CommandEmpty({
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ jsx(
|
|
98
|
+
CommandPrimitive.Empty,
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "command-empty",
|
|
101
|
+
className: "py-6 text-center text-sm",
|
|
102
|
+
...props
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function CommandGroup({
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}) {
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
CommandPrimitive.Group,
|
|
112
|
+
{
|
|
113
|
+
"data-slot": "command-group",
|
|
114
|
+
className: cn(
|
|
115
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
116
|
+
className
|
|
117
|
+
),
|
|
118
|
+
...props
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function CommandSeparator({
|
|
123
|
+
className,
|
|
124
|
+
...props
|
|
125
|
+
}) {
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
CommandPrimitive.Separator,
|
|
128
|
+
{
|
|
129
|
+
"data-slot": "command-separator",
|
|
130
|
+
className: cn("-mx-1 h-px bg-border", className),
|
|
131
|
+
...props
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
function CommandItem({
|
|
136
|
+
className,
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
CommandPrimitive.Item,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "command-item",
|
|
143
|
+
className: cn(
|
|
144
|
+
"relative flex cursor-default 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 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
...props
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function CommandShortcut({
|
|
152
|
+
className,
|
|
153
|
+
...props
|
|
154
|
+
}) {
|
|
155
|
+
return /* @__PURE__ */ jsx(
|
|
156
|
+
"span",
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "command-shortcut",
|
|
159
|
+
className: cn(
|
|
160
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
161
|
+
className
|
|
162
|
+
),
|
|
163
|
+
...props
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
Command,
|
|
169
|
+
CommandDialog,
|
|
170
|
+
CommandEmpty,
|
|
171
|
+
CommandGroup,
|
|
172
|
+
CommandInput,
|
|
173
|
+
CommandItem,
|
|
174
|
+
CommandList,
|
|
175
|
+
CommandSeparator,
|
|
176
|
+
CommandShortcut
|
|
177
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
|
|
3
|
+
declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): React.JSX.Element;
|
|
6
|
+
declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): React.JSX.Element;
|
|
7
|
+
declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): React.JSX.Element;
|
|
8
|
+
declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
9
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): React.JSX.Element;
|
|
13
|
+
declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): React.JSX.Element;
|
|
14
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
variant?: "default" | "destructive";
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
19
|
+
declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
20
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): React.JSX.Element;
|
|
24
|
+
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
25
|
+
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|