orbital-ds 0.1.0 → 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 +98 -18
- package/dist/themes/qratia.css +13 -13
- 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 +50 -12
- package/scripts/doctor.mjs +142 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
const CarouselContext = React.createContext(null);
|
|
8
|
+
function useCarousel() {
|
|
9
|
+
const context = React.useContext(CarouselContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
function Carousel({
|
|
16
|
+
orientation = "horizontal",
|
|
17
|
+
opts,
|
|
18
|
+
setApi,
|
|
19
|
+
plugins,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
25
|
+
{
|
|
26
|
+
...opts,
|
|
27
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
28
|
+
},
|
|
29
|
+
plugins
|
|
30
|
+
);
|
|
31
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
32
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
33
|
+
const onSelect = React.useCallback((api2) => {
|
|
34
|
+
if (!api2) return;
|
|
35
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
36
|
+
setCanScrollNext(api2.canScrollNext());
|
|
37
|
+
}, []);
|
|
38
|
+
const scrollPrev = React.useCallback(() => {
|
|
39
|
+
api?.scrollPrev();
|
|
40
|
+
}, [api]);
|
|
41
|
+
const scrollNext = React.useCallback(() => {
|
|
42
|
+
api?.scrollNext();
|
|
43
|
+
}, [api]);
|
|
44
|
+
const handleKeyDown = React.useCallback(
|
|
45
|
+
(event) => {
|
|
46
|
+
if (event.key === "ArrowLeft") {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
scrollPrev();
|
|
49
|
+
} else if (event.key === "ArrowRight") {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
scrollNext();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[scrollPrev, scrollNext]
|
|
55
|
+
);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (!api || !setApi) return;
|
|
58
|
+
setApi(api);
|
|
59
|
+
}, [api, setApi]);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (!api) return;
|
|
62
|
+
onSelect(api);
|
|
63
|
+
api.on("reInit", onSelect);
|
|
64
|
+
api.on("select", onSelect);
|
|
65
|
+
return () => {
|
|
66
|
+
api?.off("select", onSelect);
|
|
67
|
+
};
|
|
68
|
+
}, [api, onSelect]);
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
CarouselContext.Provider,
|
|
71
|
+
{
|
|
72
|
+
value: {
|
|
73
|
+
carouselRef,
|
|
74
|
+
api,
|
|
75
|
+
opts,
|
|
76
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
77
|
+
scrollPrev,
|
|
78
|
+
scrollNext,
|
|
79
|
+
canScrollPrev,
|
|
80
|
+
canScrollNext
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
onKeyDownCapture: handleKeyDown,
|
|
86
|
+
className: cn("relative", className),
|
|
87
|
+
role: "region",
|
|
88
|
+
"aria-roledescription": "carousel",
|
|
89
|
+
"data-slot": "carousel",
|
|
90
|
+
...props,
|
|
91
|
+
children
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function CarouselContent({ className, ...props }) {
|
|
98
|
+
const { carouselRef, orientation } = useCarousel();
|
|
99
|
+
return /* @__PURE__ */ jsx(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
ref: carouselRef,
|
|
103
|
+
className: "overflow-hidden",
|
|
104
|
+
"data-slot": "carousel-content",
|
|
105
|
+
children: /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
className: cn(
|
|
109
|
+
"flex",
|
|
110
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
111
|
+
className
|
|
112
|
+
),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function CarouselItem({ className, ...props }) {
|
|
120
|
+
const { orientation } = useCarousel();
|
|
121
|
+
return /* @__PURE__ */ jsx(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
role: "group",
|
|
125
|
+
"aria-roledescription": "slide",
|
|
126
|
+
"data-slot": "carousel-item",
|
|
127
|
+
className: cn(
|
|
128
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
129
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function CarouselPrevious({
|
|
137
|
+
className,
|
|
138
|
+
variant = "outline",
|
|
139
|
+
size = "icon-sm",
|
|
140
|
+
...props
|
|
141
|
+
}) {
|
|
142
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
143
|
+
return /* @__PURE__ */ jsxs(
|
|
144
|
+
Button,
|
|
145
|
+
{
|
|
146
|
+
"data-slot": "carousel-previous",
|
|
147
|
+
variant,
|
|
148
|
+
size,
|
|
149
|
+
className: cn(
|
|
150
|
+
"absolute touch-manipulation rounded-full",
|
|
151
|
+
orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
152
|
+
className
|
|
153
|
+
),
|
|
154
|
+
disabled: !canScrollPrev,
|
|
155
|
+
onClick: scrollPrev,
|
|
156
|
+
...props,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
159
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function CarouselNext({
|
|
165
|
+
className,
|
|
166
|
+
variant = "outline",
|
|
167
|
+
size = "icon-sm",
|
|
168
|
+
...props
|
|
169
|
+
}) {
|
|
170
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
171
|
+
return /* @__PURE__ */ jsxs(
|
|
172
|
+
Button,
|
|
173
|
+
{
|
|
174
|
+
"data-slot": "carousel-next",
|
|
175
|
+
variant,
|
|
176
|
+
size,
|
|
177
|
+
className: cn(
|
|
178
|
+
"absolute touch-manipulation rounded-full",
|
|
179
|
+
orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
disabled: !canScrollNext,
|
|
183
|
+
onClick: scrollNext,
|
|
184
|
+
...props,
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
187
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
Carousel,
|
|
194
|
+
CarouselContent,
|
|
195
|
+
CarouselItem,
|
|
196
|
+
CarouselNext,
|
|
197
|
+
CarouselPrevious,
|
|
198
|
+
useCarousel
|
|
199
|
+
};
|
package/dist/ui/checkbox.js
CHANGED
|
@@ -9,7 +9,7 @@ function Checkbox({ className, ...props }) {
|
|
|
9
9
|
{
|
|
10
10
|
"data-slot": "checkbox",
|
|
11
11
|
className: cn(
|
|
12
|
-
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-(length:--ring-width) focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-(length:--ring-width) aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
12
|
+
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
13
13
|
className
|
|
14
14
|
),
|
|
15
15
|
...props,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Combobox as Combobox$1 } from '@base-ui/react';
|
|
3
|
+
|
|
4
|
+
declare const Combobox: typeof Combobox$1.Root;
|
|
5
|
+
declare function ComboboxValue({ ...props }: Combobox$1.Value.Props): React.JSX.Element;
|
|
6
|
+
declare function ComboboxTrigger({ className, children, ...props }: Combobox$1.Trigger.Props): React.JSX.Element;
|
|
7
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: Combobox$1.Input.Props & {
|
|
8
|
+
showTrigger?: boolean;
|
|
9
|
+
showClear?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: Combobox$1.Popup.Props & Pick<Combobox$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): React.JSX.Element;
|
|
12
|
+
declare function ComboboxList({ className, ...props }: Combobox$1.List.Props): React.JSX.Element;
|
|
13
|
+
declare function ComboboxItem({ className, children, ...props }: Combobox$1.Item.Props): React.JSX.Element;
|
|
14
|
+
declare function ComboboxGroup({ className, ...props }: Combobox$1.Group.Props): React.JSX.Element;
|
|
15
|
+
declare function ComboboxLabel({ className, ...props }: Combobox$1.GroupLabel.Props): React.JSX.Element;
|
|
16
|
+
declare function ComboboxCollection({ ...props }: Combobox$1.Collection.Props): React.JSX.Element;
|
|
17
|
+
declare function ComboboxEmpty({ className, ...props }: Combobox$1.Empty.Props): React.JSX.Element;
|
|
18
|
+
declare function ComboboxSeparator({ className, ...props }: Combobox$1.Separator.Props): React.JSX.Element;
|
|
19
|
+
declare function ComboboxChips({ className, ...props }: React.ComponentPropsWithRef<typeof Combobox$1.Chips> & Combobox$1.Chips.Props): React.JSX.Element;
|
|
20
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: Combobox$1.Chip.Props & {
|
|
21
|
+
showRemove?: boolean;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function ComboboxChipsInput({ className, ...props }: Combobox$1.Input.Props): React.JSX.Element;
|
|
24
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
25
|
+
|
|
26
|
+
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -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 };
|