@ravenopsnet/ui 0.0.1 → 0.0.2
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/README.md +1 -1
- package/dist/components/theme-provider.d.ts +15 -0
- package/dist/components/ui/accordion.d.ts +6 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert-dialog.js +95 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.js +43 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/badge.js +29 -0
- package/dist/components/ui/breadcrumb.d.ts +10 -0
- package/dist/components/ui/breadcrumb.js +72 -0
- package/dist/components/ui/button-group.d.ts +10 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/button.js +44 -0
- package/dist/components/ui/calendar.d.ts +10 -0
- package/dist/components/ui/calendar.js +96 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +56 -0
- package/dist/components/ui/carousel.d.ts +28 -0
- package/dist/components/ui/carousel.js +111 -0
- package/dist/components/ui/chart.d.ts +44 -0
- package/dist/components/ui/chart.js +130 -0
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +23 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/combobox.js +161 -0
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/context-menu.d.ts +29 -0
- package/dist/components/ui/context-menu.js +133 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/direction.d.ts +1 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/drawer.d.ts +13 -0
- package/dist/components/ui/drawer.js +78 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +107 -0
- package/dist/components/ui/hover-card.d.ts +5 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-group.d.ts +18 -0
- package/dist/components/ui/input-group.js +78 -0
- package/dist/components/ui/input-otp.d.ts +11 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +15 -0
- package/dist/components/ui/item.d.ts +22 -0
- package/dist/components/ui/item.js +121 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/label.js +14 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/menubar.js +136 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/native-select.js +38 -0
- package/dist/components/ui/navigation-menu.d.ts +11 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +86 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +54 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +7 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/scroll-area.js +35 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +98 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/separator.js +14 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.js +89 -0
- package/dist/components/ui/sidebar.d.ts +63 -0
- package/dist/components/ui/sidebar.js +358 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +3 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/sonner.js +30 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +14 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.js +18 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +67 -0
- package/dist/components/ui/tabs.d.ts +10 -0
- package/dist/components/ui/tabs.js +44 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +13 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.js +52 -0
- package/dist/components/ui/toggle.d.ts +8 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/tooltip.d.ts +6 -0
- package/dist/components/ui/tooltip.js +40 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +52 -1
- package/dist/index.js +54 -40132
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/package.json +1 -1
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/card.tsx
|
|
5
|
+
function n({ className: n, size: r = "default", ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
"data-size": r,
|
|
9
|
+
className: e("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", n),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function r({ className: n, ...r }) {
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
|
+
"data-slot": "card-header",
|
|
16
|
+
className: e("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3", n),
|
|
17
|
+
...r
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function i({ className: n, ...r }) {
|
|
21
|
+
return /* @__PURE__ */ t("div", {
|
|
22
|
+
"data-slot": "card-title",
|
|
23
|
+
className: e("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", n),
|
|
24
|
+
...r
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function a({ className: n, ...r }) {
|
|
28
|
+
return /* @__PURE__ */ t("div", {
|
|
29
|
+
"data-slot": "card-description",
|
|
30
|
+
className: e("text-sm text-muted-foreground", n),
|
|
31
|
+
...r
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function o({ className: n, ...r }) {
|
|
35
|
+
return /* @__PURE__ */ t("div", {
|
|
36
|
+
"data-slot": "card-action",
|
|
37
|
+
className: e("col-start-2 row-span-2 row-start-1 self-start justify-self-end", n),
|
|
38
|
+
...r
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function s({ className: n, ...r }) {
|
|
42
|
+
return /* @__PURE__ */ t("div", {
|
|
43
|
+
"data-slot": "card-content",
|
|
44
|
+
className: e("px-4 group-data-[size=sm]/card:px-3", n),
|
|
45
|
+
...r
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function c({ className: n, ...r }) {
|
|
49
|
+
return /* @__PURE__ */ t("div", {
|
|
50
|
+
"data-slot": "card-footer",
|
|
51
|
+
className: e("flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3", n),
|
|
52
|
+
...r
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { n as Card, o as CardAction, s as CardContent, a as CardDescription, c as CardFooter, r as CardHeader, i as CardTitle };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as useEmblaCarousel, UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
7
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
8
|
+
type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugin;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
setApi?: (api: CarouselApi) => void;
|
|
13
|
+
};
|
|
14
|
+
type CarouselContextProps = {
|
|
15
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
16
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
17
|
+
scrollPrev: () => void;
|
|
18
|
+
scrollNext: () => void;
|
|
19
|
+
canScrollPrev: boolean;
|
|
20
|
+
canScrollNext: boolean;
|
|
21
|
+
} & CarouselProps;
|
|
22
|
+
declare function useCarousel(): CarouselContextProps;
|
|
23
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
|
24
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
25
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
26
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
27
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
28
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel, };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronLeftIcon as a, ChevronRightIcon as o } from "lucide-react";
|
|
7
|
+
import s from "embla-carousel-react";
|
|
8
|
+
//#region src/components/ui/carousel.tsx
|
|
9
|
+
var c = n.createContext(null);
|
|
10
|
+
function l() {
|
|
11
|
+
let e = n.useContext(c);
|
|
12
|
+
if (!e) throw Error("useCarousel must be used within a <Carousel />");
|
|
13
|
+
return e;
|
|
14
|
+
}
|
|
15
|
+
function u({ orientation: t = "horizontal", opts: i, setApi: a, plugins: o, className: l, children: u, ...d }) {
|
|
16
|
+
let [f, p] = s({
|
|
17
|
+
...i,
|
|
18
|
+
axis: t === "horizontal" ? "x" : "y"
|
|
19
|
+
}, o), [m, h] = n.useState(!1), [g, _] = n.useState(!1), v = n.useCallback((e) => {
|
|
20
|
+
e && (h(e.canScrollPrev()), _(e.canScrollNext()));
|
|
21
|
+
}, []), y = n.useCallback(() => {
|
|
22
|
+
p?.scrollPrev();
|
|
23
|
+
}, [p]), b = n.useCallback(() => {
|
|
24
|
+
p?.scrollNext();
|
|
25
|
+
}, [p]), x = n.useCallback((e) => {
|
|
26
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), y()) : e.key === "ArrowRight" && (e.preventDefault(), b());
|
|
27
|
+
}, [y, b]);
|
|
28
|
+
return n.useEffect(() => {
|
|
29
|
+
!p || !a || a(p);
|
|
30
|
+
}, [p, a]), n.useEffect(() => {
|
|
31
|
+
if (p) return v(p), p.on("reInit", v), p.on("select", v), () => {
|
|
32
|
+
p?.off("select", v);
|
|
33
|
+
};
|
|
34
|
+
}, [p, v]), /* @__PURE__ */ r(c.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
carouselRef: f,
|
|
37
|
+
api: p,
|
|
38
|
+
opts: i,
|
|
39
|
+
orientation: t || (i?.axis === "y" ? "vertical" : "horizontal"),
|
|
40
|
+
scrollPrev: y,
|
|
41
|
+
scrollNext: b,
|
|
42
|
+
canScrollPrev: m,
|
|
43
|
+
canScrollNext: g
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ r("div", {
|
|
46
|
+
onKeyDownCapture: x,
|
|
47
|
+
className: e("relative", l),
|
|
48
|
+
role: "region",
|
|
49
|
+
"aria-roledescription": "carousel",
|
|
50
|
+
"data-slot": "carousel",
|
|
51
|
+
...d,
|
|
52
|
+
children: u
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function d({ className: t, ...n }) {
|
|
57
|
+
let { carouselRef: i, orientation: a } = l();
|
|
58
|
+
return /* @__PURE__ */ r("div", {
|
|
59
|
+
ref: i,
|
|
60
|
+
className: "overflow-hidden",
|
|
61
|
+
"data-slot": "carousel-content",
|
|
62
|
+
children: /* @__PURE__ */ r("div", {
|
|
63
|
+
className: e("flex", a === "horizontal" ? "-ms-4" : "-mt-4 flex-col", t),
|
|
64
|
+
...n
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function f({ className: t, ...n }) {
|
|
69
|
+
let { orientation: i } = l();
|
|
70
|
+
return /* @__PURE__ */ r("div", {
|
|
71
|
+
role: "group",
|
|
72
|
+
"aria-roledescription": "slide",
|
|
73
|
+
"data-slot": "carousel-item",
|
|
74
|
+
className: e("min-w-0 shrink-0 grow-0 basis-full", i === "horizontal" ? "ps-4" : "pt-4", t),
|
|
75
|
+
...n
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function p({ className: n, variant: o = "outline", size: s = "icon-sm", ...c }) {
|
|
79
|
+
let { orientation: u, scrollPrev: d, canScrollPrev: f } = l();
|
|
80
|
+
return /* @__PURE__ */ i(t, {
|
|
81
|
+
"data-slot": "carousel-previous",
|
|
82
|
+
variant: o,
|
|
83
|
+
size: s,
|
|
84
|
+
className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "top-1/2 -start-12 -translate-y-1/2" : "-top-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", n),
|
|
85
|
+
disabled: !f,
|
|
86
|
+
onClick: d,
|
|
87
|
+
...c,
|
|
88
|
+
children: [/* @__PURE__ */ r(a, { className: "rtl:rotate-180" }), /* @__PURE__ */ r("span", {
|
|
89
|
+
className: "sr-only",
|
|
90
|
+
children: "Previous slide"
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function m({ className: n, variant: a = "outline", size: s = "icon-sm", ...c }) {
|
|
95
|
+
let { orientation: u, scrollNext: d, canScrollNext: f } = l();
|
|
96
|
+
return /* @__PURE__ */ i(t, {
|
|
97
|
+
"data-slot": "carousel-next",
|
|
98
|
+
variant: a,
|
|
99
|
+
size: s,
|
|
100
|
+
className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "top-1/2 -end-12 -translate-y-1/2" : "-bottom-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", n),
|
|
101
|
+
disabled: !f,
|
|
102
|
+
onClick: d,
|
|
103
|
+
...c,
|
|
104
|
+
children: [/* @__PURE__ */ r(o, { className: "rtl:rotate-180" }), /* @__PURE__ */ r("span", {
|
|
105
|
+
className: "sr-only",
|
|
106
|
+
children: "Next slide"
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { u as Carousel, d as CarouselContent, f as CarouselItem, m as CarouselNext, p as CarouselPrevious, l as useCarousel };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TooltipValueType } from 'recharts';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
declare const THEMES: {
|
|
5
|
+
readonly light: "";
|
|
6
|
+
readonly dark: ".dark";
|
|
7
|
+
};
|
|
8
|
+
type TooltipNameType = number | string;
|
|
9
|
+
export type ChartConfig = Record<string, {
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
icon?: React.ComponentType;
|
|
12
|
+
} & ({
|
|
13
|
+
color?: string;
|
|
14
|
+
theme?: never;
|
|
15
|
+
} | {
|
|
16
|
+
color?: never;
|
|
17
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
18
|
+
})>;
|
|
19
|
+
declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
|
|
20
|
+
config: ChartConfig;
|
|
21
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
22
|
+
initialDimension?: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare const ChartStyle: ({ id, config }: {
|
|
28
|
+
id: string;
|
|
29
|
+
config: ChartConfig;
|
|
30
|
+
}) => React.JSX.Element | null;
|
|
31
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
32
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
33
|
+
hideLabel?: boolean;
|
|
34
|
+
hideIndicator?: boolean;
|
|
35
|
+
indicator?: "line" | "dot" | "dashed";
|
|
36
|
+
nameKey?: string;
|
|
37
|
+
labelKey?: string;
|
|
38
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, "accessibilityLayer">): React.JSX.Element | null;
|
|
39
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
40
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
|
|
41
|
+
hideIcon?: boolean;
|
|
42
|
+
nameKey?: string;
|
|
43
|
+
} & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
|
|
44
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import * as a from "recharts";
|
|
5
|
+
//#region src/components/ui/chart.tsx
|
|
6
|
+
var o = {
|
|
7
|
+
light: "",
|
|
8
|
+
dark: ".dark"
|
|
9
|
+
}, s = {
|
|
10
|
+
width: 320,
|
|
11
|
+
height: 200
|
|
12
|
+
}, c = t.createContext(null);
|
|
13
|
+
function l() {
|
|
14
|
+
let e = t.useContext(c);
|
|
15
|
+
if (!e) throw Error("useChart must be used within a <ChartContainer />");
|
|
16
|
+
return e;
|
|
17
|
+
}
|
|
18
|
+
function u({ id: n, className: o, children: l, config: u, initialDimension: f = s, ...p }) {
|
|
19
|
+
let m = t.useId(), h = `chart-${n ?? m.replace(/:/g, "")}`;
|
|
20
|
+
return /* @__PURE__ */ r(c.Provider, {
|
|
21
|
+
value: { config: u },
|
|
22
|
+
children: /* @__PURE__ */ i("div", {
|
|
23
|
+
"data-slot": "chart",
|
|
24
|
+
"data-chart": h,
|
|
25
|
+
className: e("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", o),
|
|
26
|
+
...p,
|
|
27
|
+
children: [/* @__PURE__ */ r(d, {
|
|
28
|
+
id: h,
|
|
29
|
+
config: u
|
|
30
|
+
}), /* @__PURE__ */ r(a.ResponsiveContainer, {
|
|
31
|
+
initialDimension: f,
|
|
32
|
+
children: l
|
|
33
|
+
})]
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
var d = ({ id: e, config: t }) => {
|
|
38
|
+
let n = Object.entries(t).filter(([, e]) => e.theme ?? e.color);
|
|
39
|
+
return n.length ? /* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: Object.entries(o).map(([t, r]) => `
|
|
40
|
+
${r} [data-chart=${e}] {
|
|
41
|
+
${n.map(([e, n]) => {
|
|
42
|
+
let r = n.theme?.[t] ?? n.color;
|
|
43
|
+
return r ? ` --color-${e}: ${r};` : null;
|
|
44
|
+
}).join("\n")}
|
|
45
|
+
}
|
|
46
|
+
`).join("\n") } }) : null;
|
|
47
|
+
}, f = a.Tooltip;
|
|
48
|
+
function p({ active: a, payload: o, className: s, indicator: c = "dot", hideLabel: u = !1, hideIndicator: d = !1, label: f, labelFormatter: p, labelClassName: m, formatter: h, color: _, nameKey: v, labelKey: y }) {
|
|
49
|
+
let { config: b } = l(), x = t.useMemo(() => {
|
|
50
|
+
if (u || !o?.length) return null;
|
|
51
|
+
let [t] = o, n = g(b, t, `${y ?? t?.dataKey ?? t?.name ?? "value"}`), i = !y && typeof f == "string" ? b[f]?.label ?? f : n?.label;
|
|
52
|
+
return p ? /* @__PURE__ */ r("div", {
|
|
53
|
+
className: e("font-medium", m),
|
|
54
|
+
children: p(i, o)
|
|
55
|
+
}) : i ? /* @__PURE__ */ r("div", {
|
|
56
|
+
className: e("font-medium", m),
|
|
57
|
+
children: i
|
|
58
|
+
}) : null;
|
|
59
|
+
}, [
|
|
60
|
+
f,
|
|
61
|
+
p,
|
|
62
|
+
o,
|
|
63
|
+
u,
|
|
64
|
+
m,
|
|
65
|
+
b,
|
|
66
|
+
y
|
|
67
|
+
]);
|
|
68
|
+
if (!a || !o?.length) return null;
|
|
69
|
+
let S = o.length === 1 && c !== "dot";
|
|
70
|
+
return /* @__PURE__ */ i("div", {
|
|
71
|
+
className: e("grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", s),
|
|
72
|
+
children: [S ? null : x, /* @__PURE__ */ r("div", {
|
|
73
|
+
className: "grid gap-1.5",
|
|
74
|
+
children: o.filter((e) => e.type !== "none").map((t, a) => {
|
|
75
|
+
let o = g(b, t, `${v ?? t.name ?? t.dataKey ?? "value"}`), s = _ ?? t.payload?.fill ?? t.color;
|
|
76
|
+
return /* @__PURE__ */ r("div", {
|
|
77
|
+
className: e("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", c === "dot" && "items-center"),
|
|
78
|
+
children: h && t?.value !== void 0 && t.name ? h(t.value, t.name, t, a, t.payload) : /* @__PURE__ */ i(n, { children: [o?.icon ? /* @__PURE__ */ r(o.icon, {}) : !d && /* @__PURE__ */ r("div", {
|
|
79
|
+
className: e("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
80
|
+
"h-2.5 w-2.5": c === "dot",
|
|
81
|
+
"w-1": c === "line",
|
|
82
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": c === "dashed",
|
|
83
|
+
"my-0.5": S && c === "dashed"
|
|
84
|
+
}),
|
|
85
|
+
style: {
|
|
86
|
+
"--color-bg": s,
|
|
87
|
+
"--color-border": s
|
|
88
|
+
}
|
|
89
|
+
}), /* @__PURE__ */ i("div", {
|
|
90
|
+
className: e("flex flex-1 justify-between leading-none", S ? "items-end" : "items-center"),
|
|
91
|
+
children: [/* @__PURE__ */ i("div", {
|
|
92
|
+
className: "grid gap-1.5",
|
|
93
|
+
children: [S ? x : null, /* @__PURE__ */ r("span", {
|
|
94
|
+
className: "text-muted-foreground",
|
|
95
|
+
children: o?.label ?? t.name
|
|
96
|
+
})]
|
|
97
|
+
}), t.value != null && /* @__PURE__ */ r("span", {
|
|
98
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
99
|
+
children: typeof t.value == "number" ? t.value.toLocaleString() : String(t.value)
|
|
100
|
+
})]
|
|
101
|
+
})] })
|
|
102
|
+
}, a);
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
var m = a.Legend;
|
|
108
|
+
function h({ className: t, hideIcon: n = !1, payload: a, verticalAlign: o = "bottom", nameKey: s }) {
|
|
109
|
+
let { config: c } = l();
|
|
110
|
+
return a?.length ? /* @__PURE__ */ r("div", {
|
|
111
|
+
className: e("flex items-center justify-center gap-4", o === "top" ? "pb-3" : "pt-3", t),
|
|
112
|
+
children: a.filter((e) => e.type !== "none").map((t, a) => {
|
|
113
|
+
let o = g(c, t, `${s ?? t.dataKey ?? "value"}`);
|
|
114
|
+
return /* @__PURE__ */ i("div", {
|
|
115
|
+
className: e("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
116
|
+
children: [o?.icon && !n ? /* @__PURE__ */ r(o.icon, {}) : /* @__PURE__ */ r("div", {
|
|
117
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
118
|
+
style: { backgroundColor: t.color }
|
|
119
|
+
}), o?.label]
|
|
120
|
+
}, a);
|
|
121
|
+
})
|
|
122
|
+
}) : null;
|
|
123
|
+
}
|
|
124
|
+
function g(e, t, n) {
|
|
125
|
+
if (typeof t != "object" || !t) return;
|
|
126
|
+
let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
|
|
127
|
+
return n in t && typeof t[n] == "string" ? i = t[n] : r && n in r && typeof r[n] == "string" && (i = r[n]), i in e ? e[i] : e[n];
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { u as ChartContainer, m as ChartLegend, h as ChartLegendContent, d as ChartStyle, f as ChartTooltip, p as ChartTooltipContent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon as n } from "lucide-react";
|
|
5
|
+
import { Checkbox as r } from "@base-ui/react/checkbox";
|
|
6
|
+
//#region src/components/ui/checkbox.tsx
|
|
7
|
+
function i({ className: i, ...a }) {
|
|
8
|
+
return /* @__PURE__ */ t(r.Root, {
|
|
9
|
+
"data-slot": "checkbox",
|
|
10
|
+
className: e("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 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 dark:data-checked:bg-primary", i),
|
|
11
|
+
...a,
|
|
12
|
+
children: /* @__PURE__ */ t(r.Indicator, {
|
|
13
|
+
"data-slot": "checkbox-indicator",
|
|
14
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
15
|
+
children: /* @__PURE__ */ t(n, {})
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as Checkbox };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible';
|
|
2
|
+
declare function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props): import("react").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Collapsible as t } from "@base-ui/react/collapsible";
|
|
3
|
+
//#region src/components/ui/collapsible.tsx
|
|
4
|
+
function n({ ...n }) {
|
|
5
|
+
return /* @__PURE__ */ e(t.Root, {
|
|
6
|
+
"data-slot": "collapsible",
|
|
7
|
+
...n
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function r({ ...n }) {
|
|
11
|
+
return /* @__PURE__ */ e(t.Trigger, {
|
|
12
|
+
"data-slot": "collapsible-trigger",
|
|
13
|
+
...n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function i({ ...n }) {
|
|
17
|
+
return /* @__PURE__ */ e(t.Panel, {
|
|
18
|
+
"data-slot": "collapsible-content",
|
|
19
|
+
...n
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as Collapsible, i as CollapsibleContent, r as CollapsibleTrigger };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from '@base-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Combobox: typeof ComboboxPrimitive.Root;
|
|
4
|
+
declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): React.JSX.Element;
|
|
5
|
+
declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
|
+
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
|
|
7
|
+
showTrigger?: boolean;
|
|
8
|
+
showClear?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): React.JSX.Element;
|
|
11
|
+
declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): React.JSX.Element;
|
|
12
|
+
declare function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props): React.JSX.Element;
|
|
13
|
+
declare function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props): React.JSX.Element;
|
|
14
|
+
declare function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props): React.JSX.Element;
|
|
15
|
+
declare function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props): React.JSX.Element;
|
|
16
|
+
declare function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props): React.JSX.Element;
|
|
17
|
+
declare function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props): React.JSX.Element;
|
|
18
|
+
declare function ComboboxChips({ className, ...props }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props): React.JSX.Element;
|
|
19
|
+
declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxPrimitive.Chip.Props & {
|
|
20
|
+
showRemove?: boolean;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props): React.JSX.Element;
|
|
23
|
+
declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
|
|
24
|
+
export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "./button.js";
|
|
3
|
+
import { InputGroup as n, InputGroupAddon as r, InputGroupButton as i, InputGroupInput as a } from "./input-group.js";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon as l, ChevronDownIcon as u, XIcon as d } from "lucide-react";
|
|
7
|
+
import { Combobox as f } from "@base-ui/react";
|
|
8
|
+
//#region src/components/ui/combobox.tsx
|
|
9
|
+
var p = f.Root;
|
|
10
|
+
function m({ ...e }) {
|
|
11
|
+
return /* @__PURE__ */ s(f.Value, {
|
|
12
|
+
"data-slot": "combobox-value",
|
|
13
|
+
...e
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function h({ className: t, children: n, ...r }) {
|
|
17
|
+
return /* @__PURE__ */ c(f.Trigger, {
|
|
18
|
+
"data-slot": "combobox-trigger",
|
|
19
|
+
className: e("[&_svg:not([class*='size-'])]:size-4", t),
|
|
20
|
+
...r,
|
|
21
|
+
children: [n, /* @__PURE__ */ s(u, { className: "pointer-events-none size-4 text-muted-foreground" })]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function g({ className: t, ...n }) {
|
|
25
|
+
return /* @__PURE__ */ s(f.Clear, {
|
|
26
|
+
"data-slot": "combobox-clear",
|
|
27
|
+
render: /* @__PURE__ */ s(i, {
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
size: "icon-xs"
|
|
30
|
+
}),
|
|
31
|
+
className: e(t),
|
|
32
|
+
...n,
|
|
33
|
+
children: /* @__PURE__ */ s(d, { className: "pointer-events-none" })
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function _({ className: t, children: o, disabled: l = !1, showTrigger: u = !0, showClear: d = !1, ...p }) {
|
|
37
|
+
return /* @__PURE__ */ c(n, {
|
|
38
|
+
className: e("w-auto", t),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ s(f.Input, {
|
|
41
|
+
render: /* @__PURE__ */ s(a, { disabled: l }),
|
|
42
|
+
...p
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ c(r, {
|
|
45
|
+
align: "inline-end",
|
|
46
|
+
children: [u && /* @__PURE__ */ s(i, {
|
|
47
|
+
size: "icon-xs",
|
|
48
|
+
variant: "ghost",
|
|
49
|
+
render: /* @__PURE__ */ s(h, {}),
|
|
50
|
+
"data-slot": "input-group-button",
|
|
51
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
52
|
+
disabled: l
|
|
53
|
+
}), d && /* @__PURE__ */ s(g, { disabled: l })]
|
|
54
|
+
}),
|
|
55
|
+
o
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function v({ className: t, side: n = "bottom", sideOffset: r = 6, align: i = "start", alignOffset: a = 0, anchor: o, ...c }) {
|
|
60
|
+
return /* @__PURE__ */ s(f.Portal, { children: /* @__PURE__ */ s(f.Positioner, {
|
|
61
|
+
side: n,
|
|
62
|
+
sideOffset: r,
|
|
63
|
+
align: i,
|
|
64
|
+
alignOffset: a,
|
|
65
|
+
anchor: o,
|
|
66
|
+
className: "isolate z-50",
|
|
67
|
+
children: /* @__PURE__ */ s(f.Popup, {
|
|
68
|
+
"data-slot": "combobox-content",
|
|
69
|
+
"data-chips": !!o,
|
|
70
|
+
className: e("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-start-2 data-[side=inline-start]:slide-in-from-end-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", t),
|
|
71
|
+
...c
|
|
72
|
+
})
|
|
73
|
+
}) });
|
|
74
|
+
}
|
|
75
|
+
function y({ className: t, ...n }) {
|
|
76
|
+
return /* @__PURE__ */ s(f.List, {
|
|
77
|
+
"data-slot": "combobox-list",
|
|
78
|
+
className: e("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", t),
|
|
79
|
+
...n
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function b({ className: t, children: n, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ c(f.Item, {
|
|
84
|
+
"data-slot": "combobox-item",
|
|
85
|
+
className: e("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pe-8 ps-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", t),
|
|
86
|
+
...r,
|
|
87
|
+
children: [n, /* @__PURE__ */ s(f.ItemIndicator, {
|
|
88
|
+
render: /* @__PURE__ */ s("span", { className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center" }),
|
|
89
|
+
children: /* @__PURE__ */ s(l, { className: "pointer-events-none" })
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function x({ className: t, ...n }) {
|
|
94
|
+
return /* @__PURE__ */ s(f.Group, {
|
|
95
|
+
"data-slot": "combobox-group",
|
|
96
|
+
className: e(t),
|
|
97
|
+
...n
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function S({ className: t, ...n }) {
|
|
101
|
+
return /* @__PURE__ */ s(f.GroupLabel, {
|
|
102
|
+
"data-slot": "combobox-label",
|
|
103
|
+
className: e("px-2 py-1.5 text-xs text-muted-foreground", t),
|
|
104
|
+
...n
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function C({ ...e }) {
|
|
108
|
+
return /* @__PURE__ */ s(f.Collection, {
|
|
109
|
+
"data-slot": "combobox-collection",
|
|
110
|
+
...e
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function w({ className: t, ...n }) {
|
|
114
|
+
return /* @__PURE__ */ s(f.Empty, {
|
|
115
|
+
"data-slot": "combobox-empty",
|
|
116
|
+
className: e("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", t),
|
|
117
|
+
...n
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function T({ className: t, ...n }) {
|
|
121
|
+
return /* @__PURE__ */ s(f.Separator, {
|
|
122
|
+
"data-slot": "combobox-separator",
|
|
123
|
+
className: e("-mx-1 my-1 h-px bg-border", t),
|
|
124
|
+
...n
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function E({ className: t, ...n }) {
|
|
128
|
+
return /* @__PURE__ */ s(f.Chips, {
|
|
129
|
+
"data-slot": "combobox-chips",
|
|
130
|
+
className: e("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", t),
|
|
131
|
+
...n
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function D({ className: n, children: r, showRemove: i = !0, ...a }) {
|
|
135
|
+
return /* @__PURE__ */ c(f.Chip, {
|
|
136
|
+
"data-slot": "combobox-chip",
|
|
137
|
+
className: e("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]:pe-0", n),
|
|
138
|
+
...a,
|
|
139
|
+
children: [r, i && /* @__PURE__ */ s(f.ChipRemove, {
|
|
140
|
+
render: /* @__PURE__ */ s(t, {
|
|
141
|
+
variant: "ghost",
|
|
142
|
+
size: "icon-xs"
|
|
143
|
+
}),
|
|
144
|
+
className: "-ms-1 opacity-50 hover:opacity-100",
|
|
145
|
+
"data-slot": "combobox-chip-remove",
|
|
146
|
+
children: /* @__PURE__ */ s(d, { className: "pointer-events-none" })
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function O({ className: t, ...n }) {
|
|
151
|
+
return /* @__PURE__ */ s(f.Input, {
|
|
152
|
+
"data-slot": "combobox-chip-input",
|
|
153
|
+
className: e("min-w-16 flex-1 outline-none", t),
|
|
154
|
+
...n
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function k() {
|
|
158
|
+
return o.useRef(null);
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { p as Combobox, D as ComboboxChip, E as ComboboxChips, O as ComboboxChipsInput, C as ComboboxCollection, v as ComboboxContent, w as ComboboxEmpty, x as ComboboxGroup, _ as ComboboxInput, b as ComboboxItem, S as ComboboxLabel, y as ComboboxList, T as ComboboxSeparator, h as ComboboxTrigger, m as ComboboxValue, k as useComboboxAnchor };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Dialog } from './dialog';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
|
13
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
14
|
+
declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
15
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
16
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
17
|
+
declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
18
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
19
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|