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