@siyahi/ui 0.1.9-next.34 → 0.1.9-next.35
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/DESIGN.md +6 -5
- package/README.md +5 -5
- package/agents/examples/app-sidebar.tsx +0 -2
- package/agents/manifest.json +0 -2
- package/dist/components/registry/niko-table/core/data-table-error-boundary.js +1 -1
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +2 -2
- package/dist/components/siyahi/scatter-chart.js +1 -1
- package/dist/components/siyahi/status-badge.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +94 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +104 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +73 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +162 -0
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +1 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +121 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +43 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +136 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +60 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +49 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +38 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +80 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +170 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +123 -0
- package/dist/components/ui/trace.d.ts +20 -0
- package/dist/components/ui/trace.js +75 -0
- package/dist/index.d.ts +31 -1
- package/dist/index.js +34 -4
- package/package.json +5 -3
- package/styles/siyahi.css +198 -47
- package/agents/report-rules.json +0 -7
- package/report.css +0 -146
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
7
|
+
//#region src/components/ui/carousel.tsx
|
|
8
|
+
const CarouselContext = React$1.createContext(null);
|
|
9
|
+
function useCarousel() {
|
|
10
|
+
const context = React$1.useContext(CarouselContext);
|
|
11
|
+
if (!context) throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
|
|
15
|
+
const [carouselRef, api] = useEmblaCarousel({
|
|
16
|
+
...opts,
|
|
17
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
18
|
+
}, plugins);
|
|
19
|
+
const [canScrollPrev, setCanScrollPrev] = React$1.useState(false);
|
|
20
|
+
const [canScrollNext, setCanScrollNext] = React$1.useState(false);
|
|
21
|
+
const onSelect = React$1.useCallback((api) => {
|
|
22
|
+
if (!api) return;
|
|
23
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
24
|
+
setCanScrollNext(api.canScrollNext());
|
|
25
|
+
}, []);
|
|
26
|
+
const scrollPrev = React$1.useCallback(() => {
|
|
27
|
+
api?.scrollPrev();
|
|
28
|
+
}, [api]);
|
|
29
|
+
const scrollNext = React$1.useCallback(() => {
|
|
30
|
+
api?.scrollNext();
|
|
31
|
+
}, [api]);
|
|
32
|
+
const handleKeyDown = React$1.useCallback((event) => {
|
|
33
|
+
if (event.key === "ArrowLeft") {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
scrollPrev();
|
|
36
|
+
} else if (event.key === "ArrowRight") {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
scrollNext();
|
|
39
|
+
}
|
|
40
|
+
}, [scrollPrev, scrollNext]);
|
|
41
|
+
React$1.useEffect(() => {
|
|
42
|
+
if (!api || !setApi) return;
|
|
43
|
+
setApi(api);
|
|
44
|
+
}, [api, setApi]);
|
|
45
|
+
React$1.useEffect(() => {
|
|
46
|
+
if (!api) return;
|
|
47
|
+
onSelect(api);
|
|
48
|
+
api.on("reInit", onSelect);
|
|
49
|
+
api.on("select", onSelect);
|
|
50
|
+
return () => {
|
|
51
|
+
api?.off("select", onSelect);
|
|
52
|
+
};
|
|
53
|
+
}, [api, onSelect]);
|
|
54
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, {
|
|
55
|
+
value: {
|
|
56
|
+
carouselRef,
|
|
57
|
+
api,
|
|
58
|
+
opts,
|
|
59
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
60
|
+
scrollPrev,
|
|
61
|
+
scrollNext,
|
|
62
|
+
canScrollPrev,
|
|
63
|
+
canScrollNext
|
|
64
|
+
},
|
|
65
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
66
|
+
onKeyDownCapture: handleKeyDown,
|
|
67
|
+
className: cn("relative", className),
|
|
68
|
+
role: "region",
|
|
69
|
+
"aria-roledescription": "carousel",
|
|
70
|
+
"data-slot": "carousel",
|
|
71
|
+
...props,
|
|
72
|
+
children
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function CarouselContent({ className, ...props }) {
|
|
77
|
+
const { carouselRef, orientation } = useCarousel();
|
|
78
|
+
return /* @__PURE__ */ jsx("div", {
|
|
79
|
+
ref: carouselRef,
|
|
80
|
+
className: "overflow-hidden",
|
|
81
|
+
"data-slot": "carousel-content",
|
|
82
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
83
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
|
|
84
|
+
...props
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function CarouselItem({ className, ...props }) {
|
|
89
|
+
const { orientation } = useCarousel();
|
|
90
|
+
return /* @__PURE__ */ jsx("div", {
|
|
91
|
+
role: "group",
|
|
92
|
+
"aria-roledescription": "slide",
|
|
93
|
+
"data-slot": "carousel-item",
|
|
94
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
99
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
100
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
101
|
+
"data-slot": "carousel-previous",
|
|
102
|
+
variant,
|
|
103
|
+
size,
|
|
104
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
105
|
+
disabled: !canScrollPrev,
|
|
106
|
+
onClick: scrollPrev,
|
|
107
|
+
...props,
|
|
108
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
109
|
+
className: "sr-only",
|
|
110
|
+
children: "Previous slide"
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
|
|
115
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
116
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
117
|
+
"data-slot": "carousel-next",
|
|
118
|
+
variant,
|
|
119
|
+
size,
|
|
120
|
+
className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
121
|
+
disabled: !canScrollNext,
|
|
122
|
+
onClick: scrollNext,
|
|
123
|
+
...props,
|
|
124
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: "sr-only",
|
|
126
|
+
children: "Next slide"
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { CheckIcon } from "lucide-react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
6
|
+
//#region src/components/ui/checkbox.tsx
|
|
7
|
+
function Checkbox({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
9
|
+
"data-slot": "checkbox",
|
|
10
|
+
className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 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 group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", className),
|
|
11
|
+
...props,
|
|
12
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
13
|
+
"data-slot": "checkbox-indicator",
|
|
14
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
15
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Checkbox };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Combobox as Combobox$1 } from "@base-ui/react";
|
|
3
|
+
//#region src/components/ui/combobox.d.ts
|
|
4
|
+
declare const Combobox: typeof Combobox$1.Root;
|
|
5
|
+
declare function ComboboxValue({ ...props }: Combobox$1.Value.Props): React$1.JSX.Element;
|
|
6
|
+
declare function ComboboxTrigger({ className, children, ...props }: Combobox$1.Trigger.Props): React$1.JSX.Element;
|
|
7
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: Combobox$1.Input.Props & {
|
|
8
|
+
showTrigger?: boolean;
|
|
9
|
+
showClear?: boolean;
|
|
10
|
+
}): React$1.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$1.JSX.Element;
|
|
12
|
+
declare function ComboboxList({ className, ...props }: Combobox$1.List.Props): React$1.JSX.Element;
|
|
13
|
+
declare function ComboboxItem({ className, children, ...props }: Combobox$1.Item.Props): React$1.JSX.Element;
|
|
14
|
+
declare function ComboboxGroup({ className, ...props }: Combobox$1.Group.Props): React$1.JSX.Element;
|
|
15
|
+
declare function ComboboxLabel({ className, ...props }: Combobox$1.GroupLabel.Props): React$1.JSX.Element;
|
|
16
|
+
declare function ComboboxCollection({ ...props }: Combobox$1.Collection.Props): React$1.JSX.Element;
|
|
17
|
+
declare function ComboboxEmpty({ className, ...props }: Combobox$1.Empty.Props): React$1.JSX.Element;
|
|
18
|
+
declare function ComboboxSeparator({ className, ...props }: Combobox$1.Separator.Props): React$1.JSX.Element;
|
|
19
|
+
declare function ComboboxChips({ className, ...props }: React$1.ComponentPropsWithRef<typeof Combobox$1.Chips> & Combobox$1.Chips.Props): React$1.JSX.Element;
|
|
20
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: Combobox$1.Chip.Props & {
|
|
21
|
+
showRemove?: boolean;
|
|
22
|
+
}): React$1.JSX.Element;
|
|
23
|
+
declare function ComboboxChipsInput({ className, ...props }: Combobox$1.Input.Props): React$1.JSX.Element;
|
|
24
|
+
declare function useComboboxAnchor(): React$1.RefObject<HTMLDivElement | null>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { Combobox as Combobox$1 } from "@base-ui/react";
|
|
9
|
+
//#region src/components/ui/combobox.tsx
|
|
10
|
+
const Combobox = Combobox$1.Root;
|
|
11
|
+
function ComboboxValue({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Combobox$1.Value, {
|
|
13
|
+
"data-slot": "combobox-value",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function ComboboxTrigger({ className, children, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
|
|
19
|
+
"data-slot": "combobox-trigger",
|
|
20
|
+
className: cn("[&_svg:not([class*='size-'])]:size-4", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function ComboboxClear({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Combobox$1.Clear, {
|
|
27
|
+
"data-slot": "combobox-clear",
|
|
28
|
+
render: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
size: "icon-xs"
|
|
31
|
+
}),
|
|
32
|
+
className: cn(className),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
39
|
+
className: cn("w-auto", className),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
42
|
+
render: /* @__PURE__ */ jsx(InputGroupInput, { disabled }),
|
|
43
|
+
...props
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsxs(InputGroupAddon, {
|
|
46
|
+
align: "inline-end",
|
|
47
|
+
children: [showTrigger && /* @__PURE__ */ jsx(InputGroupButton, {
|
|
48
|
+
size: "icon-xs",
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
render: /* @__PURE__ */ jsx(ComboboxTrigger, {}),
|
|
51
|
+
"data-slot": "input-group-button",
|
|
52
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
53
|
+
disabled
|
|
54
|
+
}), showClear && /* @__PURE__ */ jsx(ComboboxClear, { disabled })]
|
|
55
|
+
}),
|
|
56
|
+
children
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
|
|
62
|
+
side,
|
|
63
|
+
sideOffset,
|
|
64
|
+
align,
|
|
65
|
+
alignOffset,
|
|
66
|
+
anchor,
|
|
67
|
+
className: "isolate z-50",
|
|
68
|
+
children: /* @__PURE__ */ jsx(Combobox$1.Popup, {
|
|
69
|
+
"data-slot": "combobox-content",
|
|
70
|
+
"data-chips": !!anchor,
|
|
71
|
+
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-lg 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=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-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", className),
|
|
72
|
+
...props
|
|
73
|
+
})
|
|
74
|
+
}) });
|
|
75
|
+
}
|
|
76
|
+
function ComboboxList({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(Combobox$1.List, {
|
|
78
|
+
"data-slot": "combobox-list",
|
|
79
|
+
className: cn("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", className),
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function ComboboxItem({ className, children, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsxs(Combobox$1.Item, {
|
|
85
|
+
"data-slot": "combobox-item",
|
|
86
|
+
className: cn("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 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", className),
|
|
87
|
+
...props,
|
|
88
|
+
children: [children, /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, {
|
|
89
|
+
render: /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
90
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "pointer-events-none" })
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function ComboboxGroup({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(Combobox$1.Group, {
|
|
96
|
+
"data-slot": "combobox-group",
|
|
97
|
+
className: cn(className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function ComboboxLabel({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx(Combobox$1.GroupLabel, {
|
|
103
|
+
"data-slot": "combobox-label",
|
|
104
|
+
className: cn("px-2 py-1.5 text-xs text-muted-foreground", className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function ComboboxCollection({ ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx(Combobox$1.Collection, {
|
|
110
|
+
"data-slot": "combobox-collection",
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx(Combobox$1.Empty, {
|
|
116
|
+
"data-slot": "combobox-empty",
|
|
117
|
+
className: cn("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className),
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx(Combobox$1.Separator, {
|
|
123
|
+
"data-slot": "combobox-separator",
|
|
124
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
125
|
+
...props
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function ComboboxChips({ className, ...props }) {
|
|
129
|
+
return /* @__PURE__ */ jsx(Combobox$1.Chips, {
|
|
130
|
+
"data-slot": "combobox-chips",
|
|
131
|
+
className: cn("flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", className),
|
|
132
|
+
...props
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function ComboboxChip({ className, children, showRemove = true, ...props }) {
|
|
136
|
+
return /* @__PURE__ */ jsxs(Combobox$1.Chip, {
|
|
137
|
+
"data-slot": "combobox-chip",
|
|
138
|
+
className: cn("flex h-[calc(--spacing(5.25))] 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", className),
|
|
139
|
+
...props,
|
|
140
|
+
children: [children, showRemove && /* @__PURE__ */ jsx(Combobox$1.ChipRemove, {
|
|
141
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
142
|
+
variant: "ghost",
|
|
143
|
+
size: "icon-xs"
|
|
144
|
+
}),
|
|
145
|
+
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
146
|
+
"data-slot": "combobox-chip-remove",
|
|
147
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "pointer-events-none" })
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function ComboboxChipsInput({ className, ...props }) {
|
|
152
|
+
return /* @__PURE__ */ jsx(Combobox$1.Input, {
|
|
153
|
+
"data-slot": "combobox-chip-input",
|
|
154
|
+
className: cn("min-w-16 flex-1 outline-none", className),
|
|
155
|
+
...props
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function useComboboxAnchor() {
|
|
159
|
+
return React$1.useRef(null);
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.js";
|
|
3
2
|
import { InputGroup, InputGroupAddon } from "./input-group.js";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./dialog.js";
|
|
4
4
|
import { cn } from "cn";
|
|
5
5
|
import { CheckIcon, SearchIcon } from "lucide-react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DirectionProvider, useDirection } from "@base-ui/react/direction-provider";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
|
|
3
|
+
//#region src/components/ui/drawer.d.ts
|
|
4
|
+
declare function Drawer({ modal, showSwipeHandle, snapPoints, swipeDirection, ...props }: Drawer$1.Root.Props & {
|
|
5
|
+
showSwipeHandle?: boolean;
|
|
6
|
+
}): React$1.JSX.Element;
|
|
7
|
+
declare function DrawerTrigger({ ...props }: Drawer$1.Trigger.Props): React$1.JSX.Element;
|
|
8
|
+
declare function DrawerPortal({ ...props }: Drawer$1.Portal.Props): React$1.JSX.Element;
|
|
9
|
+
declare function DrawerClose({ ...props }: Drawer$1.Close.Props): React$1.JSX.Element;
|
|
10
|
+
declare function DrawerOverlay({ className, ...props }: Drawer$1.Backdrop.Props): React$1.JSX.Element;
|
|
11
|
+
declare function DrawerSwipeHandle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
12
|
+
declare function DrawerContent({ className, children, ...props }: Drawer$1.Popup.Props): React$1.JSX.Element;
|
|
13
|
+
declare function DrawerHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function DrawerFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
15
|
+
declare function DrawerTitle({ className, ...props }: Drawer$1.Title.Props): React$1.JSX.Element;
|
|
16
|
+
declare function DrawerDescription({ className, ...props }: Drawer$1.Description.Props): React$1.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
|
|
6
|
+
//#region src/components/ui/drawer.tsx
|
|
7
|
+
const DrawerContext = React$1.createContext(null);
|
|
8
|
+
function useDrawer() {
|
|
9
|
+
const context = React$1.useContext(DrawerContext);
|
|
10
|
+
if (!context) throw new Error("useDrawer must be used within a Drawer.");
|
|
11
|
+
return context;
|
|
12
|
+
}
|
|
13
|
+
function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }) {
|
|
14
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
15
|
+
const contextValue = React$1.useMemo(() => ({
|
|
16
|
+
hasSnapPoints,
|
|
17
|
+
modal,
|
|
18
|
+
showSwipeHandle,
|
|
19
|
+
swipeDirection
|
|
20
|
+
}), [
|
|
21
|
+
hasSnapPoints,
|
|
22
|
+
modal,
|
|
23
|
+
showSwipeHandle,
|
|
24
|
+
swipeDirection
|
|
25
|
+
]);
|
|
26
|
+
return /* @__PURE__ */ jsx(DrawerContext.Provider, {
|
|
27
|
+
value: contextValue,
|
|
28
|
+
children: /* @__PURE__ */ jsx(Drawer$1.Root, {
|
|
29
|
+
"data-slot": "drawer",
|
|
30
|
+
modal,
|
|
31
|
+
snapPoints,
|
|
32
|
+
swipeDirection,
|
|
33
|
+
...props
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function DrawerTrigger({ ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
|
|
39
|
+
"data-slot": "drawer-trigger",
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function DrawerPortal({ ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, {
|
|
45
|
+
"data-slot": "drawer-portal",
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function DrawerClose({ ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, {
|
|
51
|
+
"data-slot": "drawer-close",
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function DrawerOverlay({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx(Drawer$1.Backdrop, {
|
|
57
|
+
"data-slot": "drawer-overlay",
|
|
58
|
+
className: cn("fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function DrawerSwipeHandle({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", {
|
|
64
|
+
"data-slot": "drawer-swipe-handle",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
className: cn("relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function DrawerContent({ className, children, ...props }) {
|
|
71
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
72
|
+
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
73
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
74
|
+
"data-slot": "drawer-portal",
|
|
75
|
+
children: [modal === true && /* @__PURE__ */ jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : void 0 }), /* @__PURE__ */ jsx(Drawer$1.Viewport, {
|
|
76
|
+
"data-slot": "drawer-viewport",
|
|
77
|
+
"data-modal": modal,
|
|
78
|
+
className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto",
|
|
79
|
+
children: /* @__PURE__ */ jsxs(Drawer$1.Popup, {
|
|
80
|
+
"data-slot": "drawer-popup",
|
|
81
|
+
"data-swipe-axis": swipeAxis,
|
|
82
|
+
"data-snap-points": hasSnapPoints ? "" : void 0,
|
|
83
|
+
className: cn("group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b", "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95", "after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full", "[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]", "[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]", "data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]", "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)", "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row", "data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]", "data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]", "data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]", "data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]", className),
|
|
84
|
+
...props,
|
|
85
|
+
children: [showSwipeHandle && /* @__PURE__ */ jsx(DrawerSwipeHandle, {}), /* @__PURE__ */ jsx(Drawer$1.Content, {
|
|
86
|
+
"data-slot": "drawer-content",
|
|
87
|
+
className: cn("flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"),
|
|
88
|
+
children
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function DrawerHeader({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("div", {
|
|
96
|
+
"data-slot": "drawer-header",
|
|
97
|
+
className: cn("flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function DrawerFooter({ className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx("div", {
|
|
103
|
+
"data-slot": "drawer-footer",
|
|
104
|
+
className: cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function DrawerTitle({ className, ...props }) {
|
|
109
|
+
return /* @__PURE__ */ jsx(Drawer$1.Title, {
|
|
110
|
+
"data-slot": "drawer-title",
|
|
111
|
+
className: cn("font-heading text-base font-medium text-foreground", className),
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function DrawerDescription({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(Drawer$1.Description, {
|
|
117
|
+
"data-slot": "drawer-description",
|
|
118
|
+
className: cn("text-sm text-balance text-muted-foreground", className),
|
|
119
|
+
...props
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
//#region src/components/ui/empty.d.ts
|
|
3
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
4
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
5
|
+
declare const emptyMediaVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "icon" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react").JSX.Element;
|
|
9
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
10
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react").JSX.Element;
|
|
11
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/components/ui/empty.tsx
|
|
5
|
+
function Empty({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
"data-slot": "empty",
|
|
8
|
+
className: cn("flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function EmptyHeader({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
"data-slot": "empty-header",
|
|
15
|
+
className: cn("flex max-w-sm flex-col items-center gap-2", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
20
|
+
variants: { variant: {
|
|
21
|
+
default: "bg-transparent",
|
|
22
|
+
icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
25
|
+
});
|
|
26
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
"data-slot": "empty-icon",
|
|
29
|
+
"data-variant": variant,
|
|
30
|
+
className: cn(emptyMediaVariants({
|
|
31
|
+
variant,
|
|
32
|
+
className
|
|
33
|
+
})),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function EmptyTitle({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
"data-slot": "empty-title",
|
|
40
|
+
className: cn("font-heading text-sm font-medium tracking-tight", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function EmptyDescription({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx("div", {
|
|
46
|
+
"data-slot": "empty-description",
|
|
47
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function EmptyContent({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("div", {
|
|
53
|
+
"data-slot": "empty-content",
|
|
54
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
2
|
+
//#region src/components/ui/hover-card.d.ts
|
|
3
|
+
declare function HoverCard({ ...props }: PreviewCard.Root.Props): import("react").JSX.Element;
|
|
4
|
+
declare function HoverCardTrigger({ ...props }: PreviewCard.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
declare function HoverCardContent({ className, side, sideOffset, align, alignOffset, ...props }: PreviewCard.Popup.Props & Pick<PreviewCard.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
5
|
+
//#region src/components/ui/hover-card.tsx
|
|
6
|
+
function HoverCard({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(PreviewCard.Root, {
|
|
8
|
+
"data-slot": "hover-card",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function HoverCardTrigger({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(PreviewCard.Trigger, {
|
|
14
|
+
"data-slot": "hover-card-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function HoverCardContent({ className, side = "bottom", sideOffset = 4, align = "center", alignOffset = 4, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(PreviewCard.Portal, {
|
|
20
|
+
"data-slot": "hover-card-portal",
|
|
21
|
+
children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
|
|
22
|
+
align,
|
|
23
|
+
alignOffset,
|
|
24
|
+
side,
|
|
25
|
+
sideOffset,
|
|
26
|
+
className: "isolate z-50",
|
|
27
|
+
children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
|
|
28
|
+
"data-slot": "hover-card-content",
|
|
29
|
+
className: cn("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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-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),
|
|
30
|
+
...props
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|