@almanaclabs/blaze-ui 0.3.1 → 0.4.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.
Files changed (67) hide show
  1. package/README.md +23 -0
  2. package/dist/components/accordion/accordion.js +53 -0
  3. package/dist/components/alert/alert.js +43 -0
  4. package/dist/components/alert-dialog/alert-dialog.js +94 -0
  5. package/dist/components/aspect-ratio/aspect-ratio.js +13 -0
  6. package/dist/components/attachment/attachment.js +104 -0
  7. package/dist/components/avatar/avatar.js +50 -0
  8. package/dist/components/badge/badge.js +29 -0
  9. package/dist/components/breadcrumb/breadcrumb.js +72 -0
  10. package/dist/components/bubble/bubble.js +73 -0
  11. package/dist/components/button/button.js +46 -0
  12. package/dist/components/button-group/button-group.js +41 -0
  13. package/dist/components/calendar/calendar.js +92 -0
  14. package/dist/components/card/card.js +56 -0
  15. package/dist/components/carousel/carousel.js +110 -0
  16. package/dist/components/chart/chart.js +131 -0
  17. package/dist/components/checkbox/checkbox.js +20 -0
  18. package/dist/components/collapsible/collapsible.js +23 -0
  19. package/dist/components/combobox/combobox.js +165 -0
  20. package/dist/components/data-table/data-table.js +30 -0
  21. package/dist/components/date-picker/date-picker.js +39 -0
  22. package/dist/components/dialog/dialog.js +92 -0
  23. package/dist/components/drawer/drawer.js +121 -0
  24. package/dist/components/dropdown-menu/dropdown-menu.js +136 -0
  25. package/dist/components/empty/empty.js +59 -0
  26. package/dist/components/field/field.js +107 -0
  27. package/dist/components/hover-card/hover-card.js +36 -0
  28. package/dist/components/input/input.js +15 -0
  29. package/dist/components/input-group/input-group.js +77 -0
  30. package/dist/components/item/item.js +121 -0
  31. package/dist/components/label/label.js +13 -0
  32. package/dist/components/marker/marker.js +43 -0
  33. package/dist/components/message/message.js +49 -0
  34. package/dist/components/native-select/native-select.js +39 -0
  35. package/dist/components/pagination/pagination.js +80 -0
  36. package/dist/components/popover/popover.js +54 -0
  37. package/dist/components/progress/progress.js +45 -0
  38. package/dist/components/questionnaire/questionnaire-primitive.js +353 -0
  39. package/dist/components/questionnaire/questionnaire.js +169 -0
  40. package/dist/components/radio-group/radio-group.js +26 -0
  41. package/dist/components/scroll-area/scroll-area.js +37 -0
  42. package/dist/components/select/select.js +98 -0
  43. package/dist/components/separator/separator.js +15 -0
  44. package/dist/components/sheet/sheet.js +89 -0
  45. package/dist/components/sidebar/sidebar.js +358 -0
  46. package/dist/components/skeleton/skeleton.js +12 -0
  47. package/dist/components/slider/slider.js +37 -0
  48. package/dist/components/spinner/spinner.js +15 -0
  49. package/dist/components/switch/switch.js +19 -0
  50. package/dist/components/table/table.js +66 -0
  51. package/dist/components/tabs/tabs.js +46 -0
  52. package/dist/components/textarea/textarea.js +13 -0
  53. package/dist/components/toast/toast.js +116 -0
  54. package/dist/components/toggle/toggle.js +35 -0
  55. package/dist/components/toggle-group/toggle-group.js +52 -0
  56. package/dist/components/tooltip/tooltip.js +41 -0
  57. package/dist/hooks/use-mobile.js +14 -0
  58. package/dist/index.js +56 -3699
  59. package/dist/lib/utils.js +8 -0
  60. package/dist/recipes/recipe-runtime.d.ts +6 -0
  61. package/dist/recipes/recipe-runtime.d.ts.map +1 -0
  62. package/package.json +2 -1
  63. package/recipes/README.md +22 -0
  64. package/recipes/manifest.json +12 -0
  65. package/recipes/workspace-shell/README.md +41 -0
  66. package/recipes/workspace-shell/workspace-shell.tsx +386 -0
  67. package/src/styles/globals.css +5 -0
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { Button as t, buttonVariants as n } from "../button/button.js";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import * as i from "react";
6
+ import { IconChevronDown as a, IconChevronLeft as o, IconChevronRight as s } from "@tabler/icons-react";
7
+ import { DayPicker as c, getDefaultClassNames as l } from "react-day-picker";
8
+ //#region src/components/calendar/calendar.tsx
9
+ function u({ className: t, classNames: i, showOutsideDays: u = !0, captionLayout: f = "label", buttonVariant: p = "ghost", locale: m, formatters: h, components: g, ..._ }) {
10
+ let v = l();
11
+ return /* @__PURE__ */ r(c, {
12
+ showOutsideDays: u,
13
+ className: e("group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-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
+ locale: m,
16
+ formatters: {
17
+ formatMonthDropdown: (e) => e.toLocaleString(m?.code, { month: "short" }),
18
+ ...h
19
+ },
20
+ classNames: {
21
+ root: e("w-fit", v.root),
22
+ months: e("relative flex flex-col gap-4 md:flex-row", v.months),
23
+ month: e("flex w-full flex-col gap-4", v.month),
24
+ nav: e("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", v.nav),
25
+ button_previous: e(n({ variant: p }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", v.button_previous),
26
+ button_next: e(n({ variant: p }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", v.button_next),
27
+ month_caption: e("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", v.month_caption),
28
+ dropdowns: e("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", v.dropdowns),
29
+ dropdown_root: e("relative rounded-(--cell-radius)", v.dropdown_root),
30
+ dropdown: e("absolute inset-0 bg-popover opacity-0", v.dropdown),
31
+ caption_label: e("font-medium select-none", f === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", v.caption_label),
32
+ month_grid: e("w-full border-collapse", v.month_grid),
33
+ weekdays: e("flex", v.weekdays),
34
+ weekday: e("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", v.weekday),
35
+ week: e("mt-2 flex w-full", v.week),
36
+ week_number_header: e("w-(--cell-size) select-none", v.week_number_header),
37
+ week_number: e("text-[0.8rem] text-muted-foreground select-none", v.week_number),
38
+ day: e("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", _.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", v.day),
39
+ range_start: e("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", v.range_start),
40
+ range_middle: e("rounded-none", v.range_middle),
41
+ range_end: e("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", v.range_end),
42
+ today: e("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", v.today),
43
+ outside: e("text-muted-foreground aria-selected:text-muted-foreground", v.outside),
44
+ disabled: e("text-muted-foreground opacity-50", v.disabled),
45
+ hidden: e("invisible", v.hidden),
46
+ ...i
47
+ },
48
+ components: {
49
+ Root: ({ className: t, rootRef: n, ...i }) => /* @__PURE__ */ r("div", {
50
+ "data-slot": "calendar",
51
+ ref: n,
52
+ className: e(t),
53
+ ...i
54
+ }),
55
+ Chevron: ({ className: t, orientation: n, ...i }) => r(n === "left" ? o : n === "right" ? s : a, {
56
+ className: e("size-4", t),
57
+ ...i
58
+ }),
59
+ DayButton: ({ ...e }) => /* @__PURE__ */ r(d, {
60
+ locale: m,
61
+ ...e
62
+ }),
63
+ WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ r("th", {
64
+ ...t,
65
+ children: /* @__PURE__ */ r("div", {
66
+ className: "flex size-(--cell-size) items-center justify-center text-center",
67
+ children: e
68
+ })
69
+ }),
70
+ ...g
71
+ },
72
+ ..._
73
+ });
74
+ }
75
+ function d({ className: n, day: a, modifiers: o, locale: s, ...c }) {
76
+ let u = l(), d = i.useRef(null);
77
+ return i.useEffect(() => {
78
+ o.focused && d.current?.focus();
79
+ }, [o.focused]), /* @__PURE__ */ r(t, {
80
+ variant: "ghost",
81
+ size: "icon",
82
+ "data-day": a.date.toLocaleDateString(s?.code),
83
+ "data-selected-single": o.selected && !o.range_start && !o.range_end && !o.range_middle,
84
+ "data-range-start": o.range_start,
85
+ "data-range-end": o.range_end,
86
+ "data-range-middle": o.range_middle,
87
+ className: e("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 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-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) 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-foreground [&>span]:text-xs [&>span]:opacity-70", u.day, n),
88
+ ...c
89
+ });
90
+ }
91
+ //#endregion
92
+ export { u as Calendar, d as CalendarDayButton };
@@ -0,0 +1,56 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import "react";
4
+ //#region src/components/card/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-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[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-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", 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-(--card-spacing)", 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-(--card-spacing)", 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,110 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import * as i from "react";
5
+ import { IconChevronLeft as a, IconChevronRight as o } from "@tabler/icons-react";
6
+ import s from "embla-carousel-react";
7
+ //#region src/components/carousel/carousel.tsx
8
+ var c = i.createContext(null);
9
+ function l() {
10
+ let e = i.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: a, plugins: o, className: l, children: u, ...d }) {
15
+ let [f, p] = s({
16
+ ...r,
17
+ axis: t === "horizontal" ? "x" : "y"
18
+ }, o), [m, h] = i.useState(!1), [g, _] = i.useState(!1), v = i.useCallback((e) => {
19
+ e && (h(e.canScrollPrev()), _(e.canScrollNext()));
20
+ }, []), y = i.useCallback(() => {
21
+ p?.scrollPrev();
22
+ }, [p]), b = i.useCallback(() => {
23
+ p?.scrollNext();
24
+ }, [p]), x = i.useCallback((e) => {
25
+ e.key === "ArrowLeft" ? (e.preventDefault(), y()) : e.key === "ArrowRight" && (e.preventDefault(), b());
26
+ }, [y, b]);
27
+ return i.useEffect(() => {
28
+ !p || !a || a(p);
29
+ }, [p, a]), i.useEffect(() => {
30
+ if (p) return v(p), p.on("reInit", v), p.on("select", v), () => {
31
+ p?.off("reInit", v), p?.off("select", v);
32
+ };
33
+ }, [p, v]), /* @__PURE__ */ n(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__ */ n("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, ...r }) {
56
+ let { carouselRef: i, orientation: a } = l();
57
+ return /* @__PURE__ */ n("div", {
58
+ ref: i,
59
+ className: "overflow-hidden",
60
+ "data-slot": "carousel-content",
61
+ children: /* @__PURE__ */ n("div", {
62
+ className: e("flex", a === "horizontal" ? "-ml-4" : "-mt-4 flex-col", t),
63
+ ...r
64
+ })
65
+ });
66
+ }
67
+ function f({ className: t, ...r }) {
68
+ let { orientation: i } = l();
69
+ return /* @__PURE__ */ n("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", i === "horizontal" ? "pl-4" : "pt-4", t),
74
+ ...r
75
+ });
76
+ }
77
+ function p({ className: i, variant: o = "outline", size: s = "icon-sm", ...c }) {
78
+ let { orientation: u, scrollPrev: d, canScrollPrev: f } = l();
79
+ return /* @__PURE__ */ r(t, {
80
+ "data-slot": "carousel-previous",
81
+ variant: o,
82
+ size: s,
83
+ className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", i),
84
+ disabled: !f,
85
+ onClick: d,
86
+ ...c,
87
+ children: [/* @__PURE__ */ n(a, {}), /* @__PURE__ */ n("span", {
88
+ className: "sr-only",
89
+ children: "Previous slide"
90
+ })]
91
+ });
92
+ }
93
+ function m({ className: i, variant: a = "outline", size: s = "icon-sm", ...c }) {
94
+ let { orientation: u, scrollNext: d, canScrollNext: f } = l();
95
+ return /* @__PURE__ */ r(t, {
96
+ "data-slot": "carousel-next",
97
+ variant: a,
98
+ size: s,
99
+ className: e("absolute touch-manipulation rounded-full", u === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", i),
100
+ disabled: !f,
101
+ onClick: d,
102
+ ...c,
103
+ children: [/* @__PURE__ */ n(o, {}), /* @__PURE__ */ n("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, l as useCarousel };
@@ -0,0 +1,131 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import * as i from "react";
5
+ import * as a from "recharts";
6
+ //#region src/components/chart/chart.tsx
7
+ var o = {
8
+ light: "",
9
+ dark: ".dark"
10
+ }, s = {
11
+ width: 320,
12
+ height: 200
13
+ }, c = i.createContext(null);
14
+ function l() {
15
+ let e = i.useContext(c);
16
+ if (!e) throw Error("useChart must be used within a <ChartContainer />");
17
+ return e;
18
+ }
19
+ function u({ id: t, className: o, children: l, config: u, initialDimension: f = s, ...p }) {
20
+ let m = i.useId(), h = `chart-${t ?? m.replace(/:/g, "")}`;
21
+ return /* @__PURE__ */ n(c.Provider, {
22
+ value: { config: u },
23
+ children: /* @__PURE__ */ r("div", {
24
+ "data-slot": "chart",
25
+ "data-chart": h,
26
+ 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),
27
+ ...p,
28
+ children: [/* @__PURE__ */ n(d, {
29
+ id: h,
30
+ config: u
31
+ }), /* @__PURE__ */ n(a.ResponsiveContainer, {
32
+ initialDimension: f,
33
+ children: l
34
+ })]
35
+ })
36
+ });
37
+ }
38
+ var d = ({ id: e, config: t }) => {
39
+ let r = Object.entries(t).filter(([, e]) => e.theme ?? e.color);
40
+ return r.length ? /* @__PURE__ */ n("style", { dangerouslySetInnerHTML: { __html: Object.entries(o).map(([t, n]) => `
41
+ ${n} [data-chart=${e}] {
42
+ ${r.map(([e, n]) => {
43
+ let r = n.theme?.[t] ?? n.color;
44
+ return r ? ` --color-${e}: ${r};` : null;
45
+ }).join("\n")}
46
+ }
47
+ `).join("\n") } }) : null;
48
+ }, f = a.Tooltip;
49
+ 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 }) {
50
+ let { config: b } = l(), x = i.useMemo(() => {
51
+ if (u || !o?.length) return null;
52
+ let [t] = o, r = `${y ?? t?.dataKey ?? t?.name ?? "value"}`, i = g(b, t, r), a = !y && typeof f == "string" ? b[f]?.label ?? f : i?.label;
53
+ return p ? /* @__PURE__ */ n("div", {
54
+ className: e("font-medium", m),
55
+ children: p(a, o)
56
+ }) : a ? /* @__PURE__ */ n("div", {
57
+ className: e("font-medium", m),
58
+ children: a
59
+ }) : null;
60
+ }, [
61
+ f,
62
+ p,
63
+ o,
64
+ u,
65
+ m,
66
+ b,
67
+ y
68
+ ]);
69
+ if (!a || !o?.length) return null;
70
+ let S = o.length === 1 && c !== "dot";
71
+ return /* @__PURE__ */ r("div", {
72
+ 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),
73
+ children: [S ? null : x, /* @__PURE__ */ n("div", {
74
+ className: "grid gap-1.5",
75
+ children: o.filter((e) => e.type !== "none").map((i, a) => {
76
+ let o = `${v ?? i.name ?? i.dataKey ?? "value"}`, s = g(b, i, o), l = _ ?? i.payload?.fill ?? i.color;
77
+ return /* @__PURE__ */ n("div", {
78
+ 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"),
79
+ children: h && i?.value !== void 0 && i.name ? h(i.value, i.name, i, a, i.payload) : /* @__PURE__ */ r(t, { children: [s?.icon ? /* @__PURE__ */ n(s.icon, {}) : !d && /* @__PURE__ */ n("div", {
80
+ className: e("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
81
+ "h-2.5 w-2.5": c === "dot",
82
+ "w-1": c === "line",
83
+ "w-0 border-[1.5px] border-dashed bg-transparent": c === "dashed",
84
+ "my-0.5": S && c === "dashed"
85
+ }),
86
+ style: {
87
+ "--color-bg": l,
88
+ "--color-border": l
89
+ }
90
+ }), /* @__PURE__ */ r("div", {
91
+ className: e("flex flex-1 justify-between leading-none", S ? "items-end" : "items-center"),
92
+ children: [/* @__PURE__ */ r("div", {
93
+ className: "grid gap-1.5",
94
+ children: [S ? x : null, /* @__PURE__ */ n("span", {
95
+ className: "text-muted-foreground",
96
+ children: s?.label ?? i.name
97
+ })]
98
+ }), i.value != null && /* @__PURE__ */ n("span", {
99
+ className: "font-mono font-medium text-foreground tabular-nums",
100
+ children: typeof i.value == "number" ? i.value.toLocaleString() : String(i.value)
101
+ })]
102
+ })] })
103
+ }, a);
104
+ })
105
+ })]
106
+ });
107
+ }
108
+ var m = a.Legend;
109
+ function h({ className: t, hideIcon: i = !1, payload: a, verticalAlign: o = "bottom", nameKey: s }) {
110
+ let { config: c } = l();
111
+ return a?.length ? /* @__PURE__ */ n("div", {
112
+ className: e("flex items-center justify-center gap-4", o === "top" ? "pb-3" : "pt-3", t),
113
+ children: a.filter((e) => e.type !== "none").map((t, a) => {
114
+ let o = `${s ?? t.dataKey ?? "value"}`, l = g(c, t, o);
115
+ return /* @__PURE__ */ r("div", {
116
+ className: e("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
117
+ children: [l?.icon && !i ? /* @__PURE__ */ n(l.icon, {}) : /* @__PURE__ */ n("div", {
118
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
119
+ style: { backgroundColor: t.color }
120
+ }), l?.label]
121
+ }, a);
122
+ })
123
+ }) : null;
124
+ }
125
+ function g(e, t, n) {
126
+ if (typeof t != "object" || !t) return;
127
+ let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
128
+ 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];
129
+ }
130
+ //#endregion
131
+ 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 { IconCheck as n } from "@tabler/icons-react";
5
+ import { Checkbox as r } from "@base-ui/react/checkbox";
6
+ //#region src/components/checkbox/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 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", 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,23 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Collapsible as t } from "@base-ui/react/collapsible";
3
+ //#region src/components/collapsible/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,165 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "../button/button.js";
3
+ import { InputGroup as n, InputGroupAddon as r, InputGroupButton as i, InputGroupInput as a } from "../input-group/input-group.js";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import * as c from "react";
6
+ import { IconCheck as l, IconChevronDown as u, IconX as d } from "@tabler/icons-react";
7
+ import { Combobox as f } from "@base-ui/react";
8
+ //#region src/components/combobox/combobox.tsx
9
+ var p = f.Root;
10
+ function m({ ...e }) {
11
+ return /* @__PURE__ */ o(f.Value, {
12
+ "data-slot": "combobox-value",
13
+ ...e
14
+ });
15
+ }
16
+ function h({ className: t, children: n, ...r }) {
17
+ return /* @__PURE__ */ s(f.Trigger, {
18
+ "data-slot": "combobox-trigger",
19
+ className: e("[&_svg:not([class*='size-'])]:size-4", t),
20
+ ...r,
21
+ children: [n, /* @__PURE__ */ o(u, { className: "pointer-events-none size-4 text-muted-foreground" })]
22
+ });
23
+ }
24
+ function g({ className: t, "aria-label": n = "Clear selection", ...r }) {
25
+ return /* @__PURE__ */ o(f.Clear, {
26
+ "data-slot": "combobox-clear",
27
+ render: /* @__PURE__ */ o(i, {
28
+ variant: "ghost",
29
+ size: "icon-xs"
30
+ }),
31
+ className: e(t),
32
+ "aria-label": n,
33
+ ...r,
34
+ children: /* @__PURE__ */ o(d, { className: "pointer-events-none" })
35
+ });
36
+ }
37
+ function _({ className: t, children: c, disabled: l = !1, showTrigger: u = !0, showClear: d = !1, triggerAriaLabel: p = "Toggle suggestions", ...m }) {
38
+ return /* @__PURE__ */ s(n, {
39
+ className: e("w-auto", t),
40
+ children: [
41
+ /* @__PURE__ */ o(f.Input, {
42
+ render: /* @__PURE__ */ o(a, { disabled: l }),
43
+ ...m
44
+ }),
45
+ /* @__PURE__ */ s(r, {
46
+ align: "inline-end",
47
+ children: [u && /* @__PURE__ */ o(i, {
48
+ size: "icon-xs",
49
+ variant: "ghost",
50
+ render: /* @__PURE__ */ o(h, {}),
51
+ "data-slot": "input-group-button",
52
+ className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
53
+ disabled: l,
54
+ "aria-label": p
55
+ }), d && /* @__PURE__ */ o(g, { disabled: l })]
56
+ }),
57
+ c
58
+ ]
59
+ });
60
+ }
61
+ function v({ className: t, side: n = "bottom", sideOffset: r = 6, align: i = "start", alignOffset: a = 0, anchor: s, ...c }) {
62
+ return /* @__PURE__ */ o(f.Portal, { children: /* @__PURE__ */ o(f.Positioner, {
63
+ side: n,
64
+ sideOffset: r,
65
+ align: i,
66
+ alignOffset: a,
67
+ anchor: s,
68
+ className: "isolate z-50",
69
+ children: /* @__PURE__ */ o(f.Popup, {
70
+ "data-slot": "combobox-content",
71
+ "data-chips": !!s,
72
+ 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-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", t),
73
+ ...c
74
+ })
75
+ }) });
76
+ }
77
+ function y({ className: t, ...n }) {
78
+ return /* @__PURE__ */ o(f.List, {
79
+ "data-slot": "combobox-list",
80
+ 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),
81
+ ...n
82
+ });
83
+ }
84
+ function b({ className: t, children: n, ...r }) {
85
+ return /* @__PURE__ */ s(f.Item, {
86
+ "data-slot": "combobox-item",
87
+ className: e("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", t),
88
+ ...r,
89
+ children: [n, /* @__PURE__ */ o(f.ItemIndicator, {
90
+ render: /* @__PURE__ */ o("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
91
+ children: /* @__PURE__ */ o(l, { className: "pointer-events-none" })
92
+ })]
93
+ });
94
+ }
95
+ function x({ className: t, ...n }) {
96
+ return /* @__PURE__ */ o(f.Group, {
97
+ "data-slot": "combobox-group",
98
+ className: e(t),
99
+ ...n
100
+ });
101
+ }
102
+ function S({ className: t, ...n }) {
103
+ return /* @__PURE__ */ o(f.GroupLabel, {
104
+ "data-slot": "combobox-label",
105
+ className: e("px-2 py-1.5 text-xs text-muted-foreground", t),
106
+ ...n
107
+ });
108
+ }
109
+ function C({ ...e }) {
110
+ return /* @__PURE__ */ o(f.Collection, {
111
+ "data-slot": "combobox-collection",
112
+ ...e
113
+ });
114
+ }
115
+ function w({ className: t, ...n }) {
116
+ return /* @__PURE__ */ o(f.Empty, {
117
+ "data-slot": "combobox-empty",
118
+ className: e("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", t),
119
+ ...n
120
+ });
121
+ }
122
+ function T({ className: t, ...n }) {
123
+ return /* @__PURE__ */ o(f.Separator, {
124
+ "data-slot": "combobox-separator",
125
+ className: e("-mx-1 my-1 h-px bg-border", t),
126
+ ...n
127
+ });
128
+ }
129
+ function E({ className: t, ...n }) {
130
+ return /* @__PURE__ */ o(f.Chips, {
131
+ "data-slot": "combobox-chips",
132
+ 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),
133
+ ...n
134
+ });
135
+ }
136
+ function D({ className: n, children: r, showRemove: i = !0, ...a }) {
137
+ return /* @__PURE__ */ s(f.Chip, {
138
+ "data-slot": "combobox-chip",
139
+ 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]:pr-0", n),
140
+ ...a,
141
+ children: [r, i && /* @__PURE__ */ o(f.ChipRemove, {
142
+ render: /* @__PURE__ */ o(t, {
143
+ variant: "ghost",
144
+ size: "icon-xs"
145
+ }),
146
+ className: "-ml-1 opacity-50 hover:opacity-100",
147
+ "data-slot": "combobox-chip-remove",
148
+ "aria-label": "Remove item",
149
+ children: /* @__PURE__ */ o(d, { className: "pointer-events-none" })
150
+ })]
151
+ });
152
+ }
153
+ function O({ className: t, "aria-label": n = "Search options", ...r }) {
154
+ return /* @__PURE__ */ o(f.Input, {
155
+ "data-slot": "combobox-chip-input",
156
+ "aria-label": n,
157
+ className: e("min-w-16 flex-1 outline-none", t),
158
+ ...r
159
+ });
160
+ }
161
+ function k() {
162
+ return c.useRef(null);
163
+ }
164
+ //#endregion
165
+ 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,30 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Table as t, TableBody as n, TableCell as r, TableHead as i, TableHeader as a, TableRow as o } from "../table/table.js";
3
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
+ import "react";
5
+ import { flexRender as l, getCoreRowModel as u, useReactTable as d } from "@tanstack/react-table";
6
+ //#region src/components/data-table/data-table.tsx
7
+ function f({ columns: f, data: p, emptyMessage: m = "No results.", className: h }) {
8
+ let g = d({
9
+ columns: f,
10
+ data: p,
11
+ getCoreRowModel: u()
12
+ });
13
+ return /* @__PURE__ */ s("div", {
14
+ "data-slot": "data-table",
15
+ className: e("overflow-hidden rounded-lg border", h),
16
+ children: /* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(a, { children: g.getHeaderGroups().map((e) => /* @__PURE__ */ s(o, { children: e.headers.map((e) => /* @__PURE__ */ s(i, {
17
+ colSpan: e.colSpan,
18
+ children: e.isPlaceholder ? null : l(e.column.columnDef.header, e.getContext())
19
+ }, e.id)) }, e.id)) }), /* @__PURE__ */ s(n, { children: g.getRowModel().rows.length ? g.getRowModel().rows.map((e) => /* @__PURE__ */ s(o, {
20
+ "data-state": e.getIsSelected() && "selected",
21
+ children: e.getVisibleCells().map((e) => /* @__PURE__ */ s(r, { children: l(e.column.columnDef.cell, e.getContext()) }, e.id))
22
+ }, e.id)) : /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s(r, {
23
+ colSpan: Math.max(f.length, 1),
24
+ className: "h-24 text-center",
25
+ children: m
26
+ }) }) })] })
27
+ });
28
+ }
29
+ //#endregion
30
+ export { f as DataTable };