@middag-io/react 0.33.0 → 0.35.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/README.md +28 -8
- package/dist-lib/base/shell/AuthShell.js +39 -0
- package/dist-lib/base/shell/BasicShell.js +207 -0
- package/dist-lib/base/shell/ImmersiveShell.js +55 -0
- package/dist-lib/base/shell/partials/InspectorContext.js +60 -0
- package/dist-lib/base/shell/partials/InspectorPanel.js +22 -0
- package/dist-lib/base/shell/partials/NavErrorBoundary.js +66 -0
- package/dist-lib/base/shell/partials/OverlayScreen.js +36 -0
- package/dist-lib/base/shell/partials/PageActionButton.js +4 -0
- package/dist-lib/base/theme/appearance.js +39 -0
- package/dist-lib/base/theme/host-layout-detector.js +39 -0
- package/dist-lib/base/theme/host-theme-detector.js +131 -0
- package/dist-lib/base/theme/sidebar-safelist.txt +20 -0
- package/dist-lib/base/theme/tailwind-theme.css +136 -0
- package/dist-lib/base/theme/theme-bridge.css +164 -0
- package/dist-lib/base/theme/theme-context.js +103 -0
- package/dist-lib/base/theme/themes/classic.css +174 -0
- package/dist-lib/base/theme/tokens.css +290 -0
- package/dist-lib/base/theme/useHostTheme.js +34 -0
- package/dist-lib/base/utils/clipboard.js +16 -0
- package/dist-lib/base/utils/conditions.js +13 -0
- package/dist-lib/base/utils/icon-registry.js +16 -0
- package/dist-lib/base/utils/icons.js +11 -0
- package/dist-lib/base/utils/interpolate.js +6 -0
- package/dist-lib/base/utils/register-default-icons.js +9 -0
- package/dist-lib/base/utils/storage.js +30 -0
- package/dist-lib/base/utils/time.js +59 -0
- package/dist-lib/chunks/subpath-BD_PKGUX.js +146 -0
- package/dist-lib/chunks/subpath-DLFO_UGQ.js +604 -0
- package/dist-lib/components/reui/accordion.js +43 -0
- package/dist-lib/components/reui/alert-dialog.js +101 -0
- package/dist-lib/components/reui/alert.js +55 -0
- package/dist-lib/components/reui/aspect-ratio.js +11 -0
- package/dist-lib/components/reui/autocomplete.js +170 -0
- package/dist-lib/components/reui/avatar.js +51 -0
- package/dist-lib/components/reui/badge.js +64 -0
- package/dist-lib/components/reui/breadcrumb.js +69 -0
- package/dist-lib/components/reui/button-group.js +38 -0
- package/dist-lib/components/reui/button.js +47 -0
- package/dist-lib/components/reui/calendar.js +89 -0
- package/dist-lib/components/reui/card.js +55 -0
- package/dist-lib/components/reui/carousel.js +110 -0
- package/dist-lib/components/reui/chart.js +130 -0
- package/dist-lib/components/reui/checkbox.js +20 -0
- package/dist-lib/components/reui/collapsible.js +23 -0
- package/dist-lib/components/reui/combobox.js +166 -0
- package/dist-lib/components/reui/command.js +85 -0
- package/dist-lib/components/reui/context-menu.js +121 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.js +108 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.js +217 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.js +25 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.js +132 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.js +183 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.js +125 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.js +130 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.js +156 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.js +546 -0
- package/dist-lib/components/reui/data-grid/data-grid.js +113 -0
- package/dist-lib/components/reui/data-grid-pagination.js +131 -0
- package/dist-lib/components/reui/date-selector.js +642 -0
- package/dist-lib/components/reui/dialog.js +94 -0
- package/dist-lib/components/reui/drawer.js +77 -0
- package/dist-lib/components/reui/dropdown-menu.js +123 -0
- package/dist-lib/components/reui/empty.js +59 -0
- package/dist-lib/components/reui/field.js +115 -0
- package/dist-lib/components/reui/filters.js +873 -0
- package/dist-lib/components/reui/frame.js +97 -0
- package/dist-lib/components/reui/hover-card.js +31 -0
- package/dist-lib/components/reui/icon-placeholder.js +14 -0
- package/dist-lib/components/reui/index.js +18 -0
- package/dist-lib/components/reui/input-group.js +78 -0
- package/dist-lib/components/reui/input-otp.js +44 -0
- package/dist-lib/components/reui/input.js +14 -0
- package/dist-lib/components/reui/item.js +116 -0
- package/dist-lib/components/reui/kanban.js +316 -0
- package/dist-lib/components/reui/kbd.js +19 -0
- package/dist-lib/components/reui/label.js +14 -0
- package/dist-lib/components/reui/menubar.js +132 -0
- package/dist-lib/components/reui/native-select.js +37 -0
- package/dist-lib/components/reui/navigation-menu.js +80 -0
- package/dist-lib/components/reui/number-field.js +126 -0
- package/dist-lib/components/reui/pagination.js +78 -0
- package/dist-lib/components/reui/phone-input.js +124 -0
- package/dist-lib/components/reui/popover.js +55 -0
- package/dist-lib/components/reui/progress.js +20 -0
- package/dist-lib/components/reui/radio-group.js +27 -0
- package/dist-lib/components/reui/rating.js +81 -0
- package/dist-lib/components/reui/resizable.js +31 -0
- package/dist-lib/components/reui/scroll-area.js +36 -0
- package/dist-lib/components/reui/scrollspy.js +104 -0
- package/dist-lib/components/reui/select.js +97 -0
- package/dist-lib/components/reui/separator.js +17 -0
- package/dist-lib/components/reui/sheet.js +81 -0
- package/dist-lib/components/reui/sidebar.js +350 -0
- package/dist-lib/components/reui/skeleton.js +12 -0
- package/dist-lib/components/reui/slider.js +35 -0
- package/dist-lib/components/reui/sonner.js +28 -0
- package/dist-lib/components/reui/sortable.js +172 -0
- package/dist-lib/components/reui/spinner.js +14 -0
- package/dist-lib/components/reui/stepper.js +193 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.js +13 -0
- package/dist-lib/components/reui/svgs/gemini.js +257 -0
- package/dist-lib/components/reui/svgs/openai.js +10 -0
- package/dist-lib/components/reui/svgs/openaiDark.js +13 -0
- package/dist-lib/components/reui/switch.js +19 -0
- package/dist-lib/components/reui/table.js +66 -0
- package/dist-lib/components/reui/tabs.js +47 -0
- package/dist-lib/components/reui/textarea.js +13 -0
- package/dist-lib/components/reui/timeline.js +84 -0
- package/dist-lib/components/reui/toggle-group.js +48 -0
- package/dist-lib/components/reui/toggle.js +36 -0
- package/dist-lib/components/reui/tooltip.js +35 -0
- package/dist-lib/components/reui/tree.js +102 -0
- package/dist-lib/i18n/I18nProvider.js +23 -0
- package/dist-lib/i18n/host-resolver.js +10 -0
- package/dist-lib/i18n/instance.js +2 -0
- package/dist-lib/i18n/locales/en/ui.json +266 -0
- package/dist-lib/i18n/locales/en/validators.json +13 -0
- package/dist-lib/i18n/locales/pt-BR/ui.json +266 -0
- package/dist-lib/i18n/locales/pt-BR/validators.json +13 -0
- package/dist-lib/i18n/register-strings.js +7 -0
- package/dist-lib/i18n/render-label.js +13 -0
- package/dist-lib/i18n/resolve-field-error.js +10 -0
- package/dist-lib/i18n/useHostString.js +31 -0
- package/dist-lib/i18n/useTranslation.js +48 -0
- package/dist-lib/lib/actions/resolve-action-target.js +48 -0
- package/dist-lib/lib/hooks/use-copy-to-clipboard.js +18 -0
- package/dist-lib/lib/hooks/use-file-upload.js +171 -0
- package/dist-lib/lib/hooks/use-mobile.js +18 -0
- package/dist-lib/lib/portal-container.js +7 -0
- package/dist-lib/lib/utils.js +8 -0
- package/dist-lib/middag-react.css +1 -1
- package/package.json +41 -8
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t, buttonVariants as n } from "./button.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { ChevronDownIcon as i, ChevronLeftIcon as a, ChevronRightIcon as o } from "lucide-react";
|
|
6
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
7
|
+
import { DayPicker as c, getDefaultClassNames as l } from "react-day-picker";
|
|
8
|
+
//#region src/components/reui/calendar.tsx
|
|
9
|
+
function u({ className: t, classNames: r, showOutsideDays: u = !0, captionLayout: f = "label", buttonVariant: p = "ghost", formatters: m, components: h, ...g }) {
|
|
10
|
+
let _ = l();
|
|
11
|
+
return /* @__PURE__ */ s(c, {
|
|
12
|
+
showOutsideDays: u,
|
|
13
|
+
className: e("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, t),
|
|
14
|
+
captionLayout: f,
|
|
15
|
+
formatters: {
|
|
16
|
+
formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
|
|
17
|
+
...m
|
|
18
|
+
},
|
|
19
|
+
classNames: {
|
|
20
|
+
root: e("w-fit", _.root),
|
|
21
|
+
months: e("relative flex flex-col gap-4 md:flex-row", _.months),
|
|
22
|
+
month: e("flex w-full flex-col gap-4", _.month),
|
|
23
|
+
nav: e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", _.nav),
|
|
24
|
+
button_previous: e(n({ variant: p }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", _.button_previous),
|
|
25
|
+
button_next: e(n({ variant: p }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", _.button_next),
|
|
26
|
+
month_caption: e("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", _.month_caption),
|
|
27
|
+
dropdowns: e("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", _.dropdowns),
|
|
28
|
+
dropdown_root: e("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50", _.dropdown_root),
|
|
29
|
+
dropdown: e("absolute inset-0 bg-popover opacity-0", _.dropdown),
|
|
30
|
+
caption_label: e("font-medium select-none", f === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", _.caption_label),
|
|
31
|
+
table: "w-full border-collapse",
|
|
32
|
+
weekdays: e("flex", _.weekdays),
|
|
33
|
+
weekday: e("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", _.weekday),
|
|
34
|
+
week: e("mt-2 flex w-full", _.week),
|
|
35
|
+
week_number_header: e("w-(--cell-size) select-none", _.week_number_header),
|
|
36
|
+
week_number: e("text-[0.8rem] text-muted-foreground select-none", _.week_number),
|
|
37
|
+
day: e("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", g.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", _.day),
|
|
38
|
+
range_start: e("rounded-l-md bg-accent", _.range_start),
|
|
39
|
+
range_middle: e("rounded-none", _.range_middle),
|
|
40
|
+
range_end: e("rounded-r-md bg-accent", _.range_end),
|
|
41
|
+
today: e("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", _.today),
|
|
42
|
+
outside: e("text-muted-foreground aria-selected:text-muted-foreground", _.outside),
|
|
43
|
+
disabled: e("text-muted-foreground opacity-50", _.disabled),
|
|
44
|
+
hidden: e("invisible", _.hidden),
|
|
45
|
+
...r
|
|
46
|
+
},
|
|
47
|
+
components: {
|
|
48
|
+
Root: ({ className: t, rootRef: n, ...r }) => /* @__PURE__ */ s("div", {
|
|
49
|
+
"data-slot": "calendar",
|
|
50
|
+
ref: n,
|
|
51
|
+
className: e(t),
|
|
52
|
+
...r
|
|
53
|
+
}),
|
|
54
|
+
Chevron: ({ className: t, orientation: n, ...r }) => s(n === "left" ? a : n === "right" ? o : i, {
|
|
55
|
+
className: e("size-4", t),
|
|
56
|
+
...r
|
|
57
|
+
}),
|
|
58
|
+
DayButton: d,
|
|
59
|
+
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ s("td", {
|
|
60
|
+
...t,
|
|
61
|
+
children: /* @__PURE__ */ s("div", {
|
|
62
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
63
|
+
children: e
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
...h
|
|
67
|
+
},
|
|
68
|
+
...g
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function d({ className: n, day: i, modifiers: a, ...o }) {
|
|
72
|
+
let c = l(), u = r.useRef(null);
|
|
73
|
+
return r.useEffect(() => {
|
|
74
|
+
a.focused && u.current?.focus();
|
|
75
|
+
}, [a.focused]), /* @__PURE__ */ s(t, {
|
|
76
|
+
ref: u,
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
size: "icon",
|
|
79
|
+
"data-day": i.date.toLocaleDateString(),
|
|
80
|
+
"data-selected-single": a.selected && !a.range_start && !a.range_end && !a.range_middle,
|
|
81
|
+
"data-range-start": a.range_start,
|
|
82
|
+
"data-range-end": a.range_end,
|
|
83
|
+
"data-range-middle": a.range_middle,
|
|
84
|
+
className: e("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", c.day, n),
|
|
85
|
+
...o
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { u as Calendar, d as CalendarDayButton };
|
|
@@ -0,0 +1,55 @@
|
|
|
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/reui/card.tsx
|
|
5
|
+
function n({ className: n, ...r }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
className: e("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm", n),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function r({ className: n, ...r }) {
|
|
13
|
+
return /* @__PURE__ */ t("div", {
|
|
14
|
+
"data-slot": "card-header",
|
|
15
|
+
className: e("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", n),
|
|
16
|
+
...r
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function i({ className: n, ...r }) {
|
|
20
|
+
return /* @__PURE__ */ t("div", {
|
|
21
|
+
"data-slot": "card-title",
|
|
22
|
+
className: e("leading-none font-semibold", n),
|
|
23
|
+
...r
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function a({ className: n, ...r }) {
|
|
27
|
+
return /* @__PURE__ */ t("div", {
|
|
28
|
+
"data-slot": "card-description",
|
|
29
|
+
className: e("text-sm text-muted-foreground", n),
|
|
30
|
+
...r
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function o({ className: n, ...r }) {
|
|
34
|
+
return /* @__PURE__ */ t("div", {
|
|
35
|
+
"data-slot": "card-action",
|
|
36
|
+
className: e("col-start-2 row-span-2 row-start-1 self-start justify-self-end", n),
|
|
37
|
+
...r
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function s({ className: n, ...r }) {
|
|
41
|
+
return /* @__PURE__ */ t("div", {
|
|
42
|
+
"data-slot": "card-content",
|
|
43
|
+
className: e("px-6", n),
|
|
44
|
+
...r
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function c({ className: n, ...r }) {
|
|
48
|
+
return /* @__PURE__ */ t("div", {
|
|
49
|
+
"data-slot": "card-footer",
|
|
50
|
+
className: e("flex items-center px-6 [.border-t]:pt-6", n),
|
|
51
|
+
...r
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
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,110 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "./button.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { ArrowLeft as r, ArrowRight as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import s from "embla-carousel-react";
|
|
7
|
+
//#region src/components/reui/carousel.tsx
|
|
8
|
+
var c = n.createContext(null);
|
|
9
|
+
function l() {
|
|
10
|
+
let e = n.useContext(c);
|
|
11
|
+
if (!e) throw Error("useCarousel must be used within a <Carousel />");
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
function u({ orientation: t = "horizontal", opts: r, setApi: i, plugins: o, className: l, children: u, ...d }) {
|
|
15
|
+
let [f, p] = s({
|
|
16
|
+
...r,
|
|
17
|
+
axis: t === "horizontal" ? "x" : "y"
|
|
18
|
+
}, o), [m, h] = n.useState(!1), [g, _] = n.useState(!1), v = n.useCallback((e) => {
|
|
19
|
+
e && (h(e.canScrollPrev()), _(e.canScrollNext()));
|
|
20
|
+
}, []), y = n.useCallback(() => {
|
|
21
|
+
p?.scrollPrev();
|
|
22
|
+
}, [p]), b = n.useCallback(() => {
|
|
23
|
+
p?.scrollNext();
|
|
24
|
+
}, [p]), x = n.useCallback((e) => {
|
|
25
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), y()) : e.key === "ArrowRight" && (e.preventDefault(), b());
|
|
26
|
+
}, [y, b]);
|
|
27
|
+
return n.useEffect(() => {
|
|
28
|
+
!p || !i || i(p);
|
|
29
|
+
}, [p, i]), n.useEffect(() => {
|
|
30
|
+
if (p) return v(p), p.on("reInit", v), p.on("select", v), () => {
|
|
31
|
+
p?.off("select", v);
|
|
32
|
+
};
|
|
33
|
+
}, [p, v]), /* @__PURE__ */ a(c.Provider, {
|
|
34
|
+
value: {
|
|
35
|
+
carouselRef: f,
|
|
36
|
+
api: p,
|
|
37
|
+
opts: r,
|
|
38
|
+
orientation: t || (r?.axis === "y" ? "vertical" : "horizontal"),
|
|
39
|
+
scrollPrev: y,
|
|
40
|
+
scrollNext: b,
|
|
41
|
+
canScrollPrev: m,
|
|
42
|
+
canScrollNext: g
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ a("div", {
|
|
45
|
+
onKeyDownCapture: x,
|
|
46
|
+
className: e("relative", l),
|
|
47
|
+
role: "region",
|
|
48
|
+
"aria-roledescription": "carousel",
|
|
49
|
+
"data-slot": "carousel",
|
|
50
|
+
...d,
|
|
51
|
+
children: u
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function d({ className: t, ...n }) {
|
|
56
|
+
let { carouselRef: r, orientation: i } = l();
|
|
57
|
+
return /* @__PURE__ */ a("div", {
|
|
58
|
+
ref: r,
|
|
59
|
+
className: "overflow-hidden",
|
|
60
|
+
"data-slot": "carousel-content",
|
|
61
|
+
children: /* @__PURE__ */ a("div", {
|
|
62
|
+
className: e("flex", i === "horizontal" ? "-ml-4" : "-mt-4 flex-col", t),
|
|
63
|
+
...n
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function f({ className: t, ...n }) {
|
|
68
|
+
let { orientation: r } = l();
|
|
69
|
+
return /* @__PURE__ */ a("div", {
|
|
70
|
+
role: "group",
|
|
71
|
+
"aria-roledescription": "slide",
|
|
72
|
+
"data-slot": "carousel-item",
|
|
73
|
+
className: e("min-w-0 shrink-0 grow-0 basis-full", r === "horizontal" ? "pl-4" : "pt-4", t),
|
|
74
|
+
...n
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function p({ className: n, variant: i = "outline", size: s = "icon", ...c }) {
|
|
78
|
+
let { orientation: u, scrollPrev: d, canScrollPrev: f } = l();
|
|
79
|
+
return /* @__PURE__ */ o(t, {
|
|
80
|
+
"data-slot": "carousel-previous",
|
|
81
|
+
variant: i,
|
|
82
|
+
size: s,
|
|
83
|
+
className: e("absolute size-8 rounded-full", u === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", n),
|
|
84
|
+
disabled: !f,
|
|
85
|
+
onClick: d,
|
|
86
|
+
...c,
|
|
87
|
+
children: [/* @__PURE__ */ a(r, {}), /* @__PURE__ */ a("span", {
|
|
88
|
+
className: "sr-only",
|
|
89
|
+
children: "Previous slide"
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function m({ className: n, variant: r = "outline", size: s = "icon", ...c }) {
|
|
94
|
+
let { orientation: u, scrollNext: d, canScrollNext: f } = l();
|
|
95
|
+
return /* @__PURE__ */ o(t, {
|
|
96
|
+
"data-slot": "carousel-next",
|
|
97
|
+
variant: r,
|
|
98
|
+
size: s,
|
|
99
|
+
className: e("absolute size-8 rounded-full", u === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", n),
|
|
100
|
+
disabled: !f,
|
|
101
|
+
onClick: d,
|
|
102
|
+
...c,
|
|
103
|
+
children: [/* @__PURE__ */ a(i, {}), /* @__PURE__ */ a("span", {
|
|
104
|
+
className: "sr-only",
|
|
105
|
+
children: "Next slide"
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { u as Carousel, d as CarouselContent, f as CarouselItem, m as CarouselNext, p as CarouselPrevious };
|
|
@@ -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/reui/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-[8rem] 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
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { CheckIcon as t } from "lucide-react";
|
|
4
|
+
import { Checkbox as n } from "radix-ui";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/checkbox.tsx
|
|
7
|
+
function i({ className: i, ...a }) {
|
|
8
|
+
return /* @__PURE__ */ r(n.Root, {
|
|
9
|
+
"data-slot": "checkbox",
|
|
10
|
+
className: e("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary", i),
|
|
11
|
+
...a,
|
|
12
|
+
children: /* @__PURE__ */ r(n.Indicator, {
|
|
13
|
+
"data-slot": "checkbox-indicator",
|
|
14
|
+
className: "grid place-content-center text-current transition-none",
|
|
15
|
+
children: /* @__PURE__ */ r(t, { className: "size-3.5" })
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as Checkbox };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Collapsible as e } from "radix-ui";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/reui/collapsible.tsx
|
|
4
|
+
function n({ ...n }) {
|
|
5
|
+
return /* @__PURE__ */ t(e.Root, {
|
|
6
|
+
"data-slot": "collapsible",
|
|
7
|
+
...n
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function r({ ...n }) {
|
|
11
|
+
return /* @__PURE__ */ t(e.CollapsibleTrigger, {
|
|
12
|
+
"data-slot": "collapsible-trigger",
|
|
13
|
+
...n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function i({ ...n }) {
|
|
17
|
+
return /* @__PURE__ */ t(e.CollapsibleContent, {
|
|
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,166 @@
|
|
|
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 { CheckIcon as s, ChevronDownIcon as c, XIcon as l } from "lucide-react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { Combobox as f } from "@base-ui/react";
|
|
8
|
+
//#region src/components/reui/combobox.tsx
|
|
9
|
+
var p = f.Root;
|
|
10
|
+
function m({ ...e }) {
|
|
11
|
+
return /* @__PURE__ */ u(f.Value, {
|
|
12
|
+
"data-slot": "combobox-value",
|
|
13
|
+
...e
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function h({ className: t, children: n, ...r }) {
|
|
17
|
+
return /* @__PURE__ */ d(f.Trigger, {
|
|
18
|
+
"data-slot": "combobox-trigger",
|
|
19
|
+
className: e("[&_svg:not([class*='size-'])]:size-4", t),
|
|
20
|
+
...r,
|
|
21
|
+
children: [n, /* @__PURE__ */ u(c, {
|
|
22
|
+
"data-slot": "combobox-trigger-icon",
|
|
23
|
+
className: "pointer-events-none size-4 text-muted-foreground"
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function g({ className: t, ...n }) {
|
|
28
|
+
return /* @__PURE__ */ u(f.Clear, {
|
|
29
|
+
"data-slot": "combobox-clear",
|
|
30
|
+
render: /* @__PURE__ */ u(i, {
|
|
31
|
+
variant: "ghost",
|
|
32
|
+
size: "icon-xs"
|
|
33
|
+
}),
|
|
34
|
+
className: e(t),
|
|
35
|
+
...n,
|
|
36
|
+
children: /* @__PURE__ */ u(l, { className: "pointer-events-none" })
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function _({ className: t, children: o, disabled: s = !1, showTrigger: c = !0, showClear: l = !1, ...p }) {
|
|
40
|
+
return /* @__PURE__ */ d(n, {
|
|
41
|
+
className: e("w-auto", t),
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ u(f.Input, {
|
|
44
|
+
render: /* @__PURE__ */ u(a, { disabled: s }),
|
|
45
|
+
...p
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ d(r, {
|
|
48
|
+
align: "inline-end",
|
|
49
|
+
children: [c && /* @__PURE__ */ u(i, {
|
|
50
|
+
size: "icon-xs",
|
|
51
|
+
variant: "ghost",
|
|
52
|
+
asChild: !0,
|
|
53
|
+
"data-slot": "input-group-button",
|
|
54
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
55
|
+
disabled: s,
|
|
56
|
+
children: /* @__PURE__ */ u(h, {})
|
|
57
|
+
}), l && /* @__PURE__ */ u(g, { disabled: s })]
|
|
58
|
+
}),
|
|
59
|
+
o
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function v({ className: t, side: n = "bottom", sideOffset: r = 6, align: i = "start", alignOffset: a = 0, anchor: o, ...s }) {
|
|
64
|
+
return /* @__PURE__ */ u(f.Portal, { children: /* @__PURE__ */ u(f.Positioner, {
|
|
65
|
+
side: n,
|
|
66
|
+
sideOffset: r,
|
|
67
|
+
align: i,
|
|
68
|
+
alignOffset: a,
|
|
69
|
+
anchor: o,
|
|
70
|
+
className: "isolate z-50",
|
|
71
|
+
children: /* @__PURE__ */ u(f.Popup, {
|
|
72
|
+
"data-slot": "combobox-content",
|
|
73
|
+
"data-chips": !!o,
|
|
74
|
+
className: e("group/combobox-content relative max-h-96 w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", t),
|
|
75
|
+
...s
|
|
76
|
+
})
|
|
77
|
+
}) });
|
|
78
|
+
}
|
|
79
|
+
function y({ className: t, ...n }) {
|
|
80
|
+
return /* @__PURE__ */ u(f.List, {
|
|
81
|
+
"data-slot": "combobox-list",
|
|
82
|
+
className: e("max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0", t),
|
|
83
|
+
...n
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function b({ className: t, children: n, ...r }) {
|
|
87
|
+
return /* @__PURE__ */ d(f.Item, {
|
|
88
|
+
"data-slot": "combobox-item",
|
|
89
|
+
className: e("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
90
|
+
...r,
|
|
91
|
+
children: [n, /* @__PURE__ */ u(f.ItemIndicator, {
|
|
92
|
+
"data-slot": "combobox-item-indicator",
|
|
93
|
+
render: /* @__PURE__ */ u("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
|
|
94
|
+
children: /* @__PURE__ */ u(s, { className: "pointer-events-none size-4 pointer-coarse:size-5" })
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function x({ className: t, ...n }) {
|
|
99
|
+
return /* @__PURE__ */ u(f.Group, {
|
|
100
|
+
"data-slot": "combobox-group",
|
|
101
|
+
className: e(t),
|
|
102
|
+
...n
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function S({ className: t, ...n }) {
|
|
106
|
+
return /* @__PURE__ */ u(f.GroupLabel, {
|
|
107
|
+
"data-slot": "combobox-label",
|
|
108
|
+
className: e("px-2 py-1.5 text-xs text-muted-foreground pointer-coarse:px-3 pointer-coarse:py-2 pointer-coarse:text-sm", t),
|
|
109
|
+
...n
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function C({ ...e }) {
|
|
113
|
+
return /* @__PURE__ */ u(f.Collection, {
|
|
114
|
+
"data-slot": "combobox-collection",
|
|
115
|
+
...e
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function w({ className: t, ...n }) {
|
|
119
|
+
return /* @__PURE__ */ u(f.Empty, {
|
|
120
|
+
"data-slot": "combobox-empty",
|
|
121
|
+
className: e("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", t),
|
|
122
|
+
...n
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function T({ className: t, ...n }) {
|
|
126
|
+
return /* @__PURE__ */ u(f.Separator, {
|
|
127
|
+
"data-slot": "combobox-separator",
|
|
128
|
+
className: e("-mx-1 my-1 h-px bg-border", t),
|
|
129
|
+
...n
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function E({ className: t, ...n }) {
|
|
133
|
+
return /* @__PURE__ */ u(f.Chips, {
|
|
134
|
+
"data-slot": "combobox-chips",
|
|
135
|
+
className: e("flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-[3px] has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", t),
|
|
136
|
+
...n
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function D({ className: n, children: r, showRemove: i = !0, ...a }) {
|
|
140
|
+
return /* @__PURE__ */ d(f.Chip, {
|
|
141
|
+
"data-slot": "combobox-chip",
|
|
142
|
+
className: e("flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", n),
|
|
143
|
+
...a,
|
|
144
|
+
children: [r, i && /* @__PURE__ */ u(f.ChipRemove, {
|
|
145
|
+
render: /* @__PURE__ */ u(t, {
|
|
146
|
+
variant: "ghost",
|
|
147
|
+
size: "icon-xs"
|
|
148
|
+
}),
|
|
149
|
+
className: "-ml-1 opacity-50 hover:opacity-100",
|
|
150
|
+
"data-slot": "combobox-chip-remove",
|
|
151
|
+
children: /* @__PURE__ */ u(l, { className: "pointer-events-none" })
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function O({ className: t, children: n, ...r }) {
|
|
156
|
+
return /* @__PURE__ */ u(f.Input, {
|
|
157
|
+
"data-slot": "combobox-chip-input",
|
|
158
|
+
className: e("min-w-16 flex-1 outline-none", t),
|
|
159
|
+
...r
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function k() {
|
|
163
|
+
return o.useRef(null);
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
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 };
|