@enya-learning/nova 0.4.2 → 0.5.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 +7 -16
- package/dist/chunks/dist-fahbq1psobj0ox6s.js +1327 -0
- package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -0
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +37 -0
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js.map +1 -0
- package/dist/components/accordion.js +59 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.js +108 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.js +49 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.js +16 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.js +81 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.js +47 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.js +48 -3
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +3000 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +65 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.js +1191 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.js +10596 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.js +22 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.js +28 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.js +179 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.js +656 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +149 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.js +103 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.js +6 -0
- package/dist/components/drawer.js +1042 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.js +153 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.js +67 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/enya-logo.js +42 -42
- package/dist/components/enya-logo.js.map +1 -1
- package/dist/components/field.js +119 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/hover-card.js +40 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.js +85 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.js +416 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.js +18 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.js +133 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.js +23 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.js +16 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.js +153 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/native-select.js +43 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.js +93 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.js +95 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +62 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.js +50 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.js +30 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.js +1562 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.js +40 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.js +109 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.js +98 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.js +395 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +15 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.js +722 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.js +17 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.js +21 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +76 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +51 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.js +55 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.js +39 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.js +46 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/index.js +17 -23241
- package/dist/src/components/badge/badge.d.ts +1 -1
- package/dist/src/components/button/button.d.ts +1 -1
- package/dist/src/components/item/item.d.ts +1 -1
- package/dist/src/components/tabs/tabs.d.ts +1 -1
- package/dist/src/index.d.ts +1 -53
- package/dist/styles/nova-binding.css +102 -0
- package/dist/styles/nova.css +106 -48
- package/dist/styles/theme-nova.css +77 -81
- package/dist/styles/typography.css +34 -22
- package/package.json +30 -9
- package/src/eslint/no-primitive-colors.test.ts +97 -0
- package/dist/chunks/button-kvgr8g13fe959ju0.js +0 -81
- package/dist/chunks/button-kvgr8g13fe959ju0.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/styles/globals.css +0 -77
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t } from "../chunks/utils-kyb5nny4y41y7hd8.js";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon as d } from "lucide-react";
|
|
5
|
+
import { Checkbox as e } from "@base-ui/react/checkbox";
|
|
6
|
+
function l({ className: i, ...a }) {
|
|
7
|
+
return /* @__PURE__ */ r(e.Root, {
|
|
8
|
+
"data-slot": "checkbox",
|
|
9
|
+
className: t("peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] 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),
|
|
10
|
+
...a,
|
|
11
|
+
children: /* @__PURE__ */ r(e.Indicator, {
|
|
12
|
+
"data-slot": "checkbox-indicator",
|
|
13
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
14
|
+
children: /* @__PURE__ */ r(d, {})
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
l as Checkbox
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"../../lib/utils\"\nimport { CheckIcon } from \"lucide-react\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[6px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] 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\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":";;;;;AAOA,SAAS,EAAS,EAAE,WAAA,GAAW,GAAG,EAAA,GAAuC;AACvE,SACE,gBAAA,EAAC,EAAkB,MAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EACT,6qBACA,CACF;AAAA,IACA,GAAI;AAAA,cAEJ,gBAAA,EAAC,EAAkB,WAAnB;AAAA,MACE,aAAU;AAAA,MACV,WAAU;AAAA,gBAEV,gBAAA,EAAC,GAAD,CAAY,CAAA;AAAA,IACe,CAAA;AAAA,EACP,CAAA;AAE5B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible as t } from "@base-ui/react/collapsible";
|
|
4
|
+
function r({ ...l }) {
|
|
5
|
+
return /* @__PURE__ */ o(t.Root, {
|
|
6
|
+
"data-slot": "collapsible",
|
|
7
|
+
...l
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function a({ ...l }) {
|
|
11
|
+
return /* @__PURE__ */ o(t.Trigger, {
|
|
12
|
+
"data-slot": "collapsible-trigger",
|
|
13
|
+
...l
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function n({ ...l }) {
|
|
17
|
+
return /* @__PURE__ */ o(t.Panel, {
|
|
18
|
+
"data-slot": "collapsible-content",
|
|
19
|
+
...l
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as Collapsible,
|
|
24
|
+
n as CollapsibleContent,
|
|
25
|
+
a as CollapsibleTrigger
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.js","names":[],"sources":["../../src/components/collapsible/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\"\n\nfunction Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />\n}\n\nfunction CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {\n return (\n <CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />\n )\n}\n\nfunction CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {\n return (\n <CollapsiblePrimitive.Panel data-slot=\"collapsible-content\" {...props} />\n )\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n"],"mappings":";;;AAEA,SAAS,EAAY,EAAE,GAAG,EAAA,GAA0C;AAClE,SAAO,gBAAA,EAAC,EAAqB,MAAtB;AAAA,IAA2B,aAAU;AAAA,IAAc,GAAI;AAAA,EAAQ,CAAA;AACxE;AAEA,SAAS,EAAmB,EAAE,GAAG,EAAA,GAA6C;AAC5E,SACE,gBAAA,EAAC,EAAqB,SAAtB;AAAA,IAA8B,aAAU;AAAA,IAAsB,GAAI;AAAA,EAAQ,CAAA;AAE9E;AAEA,SAAS,EAAmB,EAAE,GAAG,EAAA,GAA2C;AAC1E,SACE,gBAAA,EAAC,EAAqB,OAAtB;AAAA,IAA4B,aAAU;AAAA,IAAsB,GAAI;AAAA,EAAQ,CAAA;AAE5E"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as n } from "../chunks/utils-kyb5nny4y41y7hd8.js";
|
|
3
|
+
import { Button as p } from "./button.js";
|
|
4
|
+
import { InputGroup as b, InputGroupAddon as x, InputGroupButton as c, InputGroupInput as h } from "./input-group.js";
|
|
5
|
+
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon as g, ChevronDownIcon as f, XIcon as u } from "lucide-react";
|
|
7
|
+
import * as v from "react";
|
|
8
|
+
import { Combobox as a } from "@base-ui/react";
|
|
9
|
+
var k = a.Root;
|
|
10
|
+
function L({ ...o }) {
|
|
11
|
+
return /* @__PURE__ */ t(a.Value, {
|
|
12
|
+
"data-slot": "combobox-value",
|
|
13
|
+
...o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function C({ className: o, children: e, ...r }) {
|
|
17
|
+
return /* @__PURE__ */ s(a.Trigger, {
|
|
18
|
+
"data-slot": "combobox-trigger",
|
|
19
|
+
className: n("[&_svg:not([class*='size-'])]:size-4", o),
|
|
20
|
+
...r,
|
|
21
|
+
children: [e, /* @__PURE__ */ t(f, { className: "pointer-events-none size-4 text-muted-foreground" })]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function w({ className: o, ...e }) {
|
|
25
|
+
return /* @__PURE__ */ t(a.Clear, {
|
|
26
|
+
"data-slot": "combobox-clear",
|
|
27
|
+
render: /* @__PURE__ */ t(c, {
|
|
28
|
+
variant: "ghost",
|
|
29
|
+
size: "icon-xs"
|
|
30
|
+
}),
|
|
31
|
+
className: n(o),
|
|
32
|
+
...e,
|
|
33
|
+
children: /* @__PURE__ */ t(u, { className: "pointer-events-none" })
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function R({ className: o, children: e, disabled: r = !1, showTrigger: i = !0, showClear: l = !1, ...d }) {
|
|
37
|
+
return /* @__PURE__ */ s(b, {
|
|
38
|
+
className: n("w-auto", o),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ t(a.Input, {
|
|
41
|
+
render: /* @__PURE__ */ t(h, { disabled: r }),
|
|
42
|
+
...d
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ s(x, {
|
|
45
|
+
align: "inline-end",
|
|
46
|
+
children: [i && /* @__PURE__ */ t(c, {
|
|
47
|
+
size: "icon-xs",
|
|
48
|
+
variant: "ghost",
|
|
49
|
+
render: /* @__PURE__ */ t(C, {}),
|
|
50
|
+
"data-slot": "input-group-button",
|
|
51
|
+
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
52
|
+
disabled: r
|
|
53
|
+
}), l && /* @__PURE__ */ t(w, { disabled: r })]
|
|
54
|
+
}),
|
|
55
|
+
e
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function _({ className: o, side: e = "bottom", sideOffset: r = 6, align: i = "start", alignOffset: l = 0, anchor: d, ...m }) {
|
|
60
|
+
return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ t(a.Positioner, {
|
|
61
|
+
side: e,
|
|
62
|
+
sideOffset: r,
|
|
63
|
+
align: i,
|
|
64
|
+
alignOffset: l,
|
|
65
|
+
anchor: d,
|
|
66
|
+
className: "isolate z-50",
|
|
67
|
+
children: /* @__PURE__ */ t(a.Popup, {
|
|
68
|
+
"data-slot": "combobox-content",
|
|
69
|
+
"data-chips": !!d,
|
|
70
|
+
className: n("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-2xl bg-popover text-popover-foreground shadow-2xl ring-1 ring-foreground/5 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-9 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", o),
|
|
71
|
+
...m
|
|
72
|
+
})
|
|
73
|
+
}) });
|
|
74
|
+
}
|
|
75
|
+
function P({ className: o, ...e }) {
|
|
76
|
+
return /* @__PURE__ */ t(a.List, {
|
|
77
|
+
"data-slot": "combobox-list",
|
|
78
|
+
className: n("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", o),
|
|
79
|
+
...e
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function A({ className: o, children: e, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ s(a.Item, {
|
|
84
|
+
"data-slot": "combobox-item",
|
|
85
|
+
className: n("relative flex w-full cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 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", o),
|
|
86
|
+
...r,
|
|
87
|
+
children: [e, /* @__PURE__ */ t(a.ItemIndicator, {
|
|
88
|
+
render: /* @__PURE__ */ t("span", { className: "pointer-events-none absolute end-2 flex size-4 items-center justify-center" }),
|
|
89
|
+
children: /* @__PURE__ */ t(g, { className: "pointer-events-none" })
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function B({ className: o, ...e }) {
|
|
94
|
+
return /* @__PURE__ */ t(a.Group, {
|
|
95
|
+
"data-slot": "combobox-group",
|
|
96
|
+
className: n(o),
|
|
97
|
+
...e
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function E({ className: o, ...e }) {
|
|
101
|
+
return /* @__PURE__ */ t(a.GroupLabel, {
|
|
102
|
+
"data-slot": "combobox-label",
|
|
103
|
+
className: n("px-3.5 py-2.5 text-xs text-muted-foreground", o),
|
|
104
|
+
...e
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function S({ ...o }) {
|
|
108
|
+
return /* @__PURE__ */ t(a.Collection, {
|
|
109
|
+
"data-slot": "combobox-collection",
|
|
110
|
+
...o
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function T({ className: o, ...e }) {
|
|
114
|
+
return /* @__PURE__ */ t(a.Empty, {
|
|
115
|
+
"data-slot": "combobox-empty",
|
|
116
|
+
className: n("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", o),
|
|
117
|
+
...e
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function V({ className: o, ...e }) {
|
|
121
|
+
return /* @__PURE__ */ t(a.Separator, {
|
|
122
|
+
"data-slot": "combobox-separator",
|
|
123
|
+
className: n("-mx-1 my-1 h-px bg-border/50", o),
|
|
124
|
+
...e
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function $({ className: o, ...e }) {
|
|
128
|
+
return /* @__PURE__ */ t(a.Chips, {
|
|
129
|
+
"data-slot": "combobox-chips",
|
|
130
|
+
className: n("flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-input bg-input/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[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:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", o),
|
|
131
|
+
...e
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function D({ className: o, children: e, showRemove: r = !0, ...i }) {
|
|
135
|
+
return /* @__PURE__ */ s(a.Chip, {
|
|
136
|
+
"data-slot": "combobox-chip",
|
|
137
|
+
className: n("flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-4xl bg-muted-foreground/10 px-2 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0", o),
|
|
138
|
+
...i,
|
|
139
|
+
children: [e, r && /* @__PURE__ */ t(a.ChipRemove, {
|
|
140
|
+
render: /* @__PURE__ */ t(p, {
|
|
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__ */ t(u, { className: "pointer-events-none" })
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function X({ className: o, ...e }) {
|
|
151
|
+
return /* @__PURE__ */ t(a.Input, {
|
|
152
|
+
"data-slot": "combobox-chip-input",
|
|
153
|
+
className: n("min-w-16 flex-1 outline-none", o),
|
|
154
|
+
...e
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function q() {
|
|
158
|
+
return v.useRef(null);
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
k as Combobox,
|
|
162
|
+
D as ComboboxChip,
|
|
163
|
+
$ as ComboboxChips,
|
|
164
|
+
X as ComboboxChipsInput,
|
|
165
|
+
S as ComboboxCollection,
|
|
166
|
+
_ as ComboboxContent,
|
|
167
|
+
T as ComboboxEmpty,
|
|
168
|
+
B as ComboboxGroup,
|
|
169
|
+
R as ComboboxInput,
|
|
170
|
+
A as ComboboxItem,
|
|
171
|
+
E as ComboboxLabel,
|
|
172
|
+
P as ComboboxList,
|
|
173
|
+
V as ComboboxSeparator,
|
|
174
|
+
C as ComboboxTrigger,
|
|
175
|
+
L as ComboboxValue,
|
|
176
|
+
q as useComboboxAnchor
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","names":[],"sources":["../../src/components/combobox/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"../button\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"../input-group\"\nimport { ChevronDownIcon, XIcon, CheckIcon } from \"lucide-react\"\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...props}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-2xl bg-popover text-popover-foreground shadow-2xl ring-1 ring-foreground/5 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-9 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"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\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2.5 rounded-xl py-2 ps-3 pe-8 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\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute end-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"px-3.5 py-2.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n )\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border/50\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"flex min-h-9 flex-wrap items-center gap-1.5 rounded-4xl border border-input bg-input/30 bg-clip-padding px-2.5 py-1.5 text-sm transition-colors focus-within:border-ring focus-within:ring-[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:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-4xl bg-muted-foreground/10 px-2 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0\",\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ms-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({\n className,\n ...props\n}: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"],"mappings":";;;;;;;;AAaA,IAAM,IAAW,EAAkB;AAEnC,SAAS,EAAc,EAAE,GAAG,EAAA,GAAwC;AAClE,SAAO,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IAAyB,aAAU;AAAA,IAAiB,GAAI;AAAA,EAAQ,CAAA;AACzE;AAEA,SAAS,EAAgB,EACvB,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GAC+B;AAClC,SACE,gBAAA,EAAC,EAAkB,SAAnB;AAAA,IACE,aAAU;AAAA,IACV,WAAW,EAAG,wCAAwC,CAAS;AAAA,IAC/D,GAAI;AAAA,cAHN,CAKG,GACD,gBAAA,EAAC,GAAD,EAAiB,WAAU,mDAAoD,CAAA,CACtD;AAAA;AAE/B;AAEA,SAAS,EAAc,EAAE,WAAA,GAAW,GAAG,EAAA,GAAwC;AAC7E,SACE,gBAAA,EAAC,EAAkB,OAAnB;AAAA,IACE,aAAU;AAAA,IACV,QAAQ,gBAAA,EAAC,GAAD;AAAA,MAAkB,SAAQ;AAAA,MAAQ,MAAK;AAAA,IAAW,CAAA;AAAA,IAC1D,WAAW,EAAG,CAAS;AAAA,IACvB,GAAI;AAAA,cAEJ,gBAAA,EAAC,GAAD,EAAO,WAAU,sBAAuB,CAAA;AAAA,EACjB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