@constructive-io/ui 0.4.1 → 0.6.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/LICENSE +21 -0
- package/README.md +17 -22
- package/dist/components/alert-dialog.cjs +333 -0
- package/dist/components/alert-dialog.cjs.map +1 -0
- package/dist/components/alert-dialog.d.cts +32 -0
- package/dist/components/alert-dialog.d.ts +16 -15
- package/dist/components/alert-dialog.js +89 -102
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.cjs +119 -0
- package/dist/components/alert.cjs.map +1 -0
- package/dist/components/alert.d.cts +19 -0
- package/dist/components/alert.d.ts +10 -5
- package/dist/components/alert.js +62 -6
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-bar.cjs +367 -0
- package/dist/components/app-bar.cjs.map +1 -0
- package/dist/components/app-bar.d.cts +26 -0
- package/dist/components/app-bar.d.ts +26 -0
- package/dist/components/app-bar.js +344 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-shell.cjs +1792 -0
- package/dist/components/app-shell.cjs.map +1 -0
- package/dist/components/app-shell.d.cts +106 -0
- package/dist/components/app-shell.d.ts +106 -0
- package/dist/components/app-shell.js +1771 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.cjs +418 -0
- package/dist/components/autocomplete.cjs.map +1 -0
- package/dist/components/autocomplete.d.cts +28 -0
- package/dist/components/autocomplete.d.ts +15 -15
- package/dist/components/autocomplete.js +9 -30
- package/dist/components/autocomplete.js.map +1 -1
- package/dist/components/avatar.cjs +51 -0
- package/dist/components/avatar.cjs.map +1 -0
- package/dist/components/avatar.d.cts +12 -0
- package/dist/components/avatar.d.ts +3 -4
- package/dist/components/avatar.js +11 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +66 -0
- package/dist/components/badge.cjs.map +1 -0
- package/dist/components/badge.d.cts +15 -0
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.cjs +118 -0
- package/dist/components/breadcrumb.cjs.map +1 -0
- package/dist/components/breadcrumb.d.cts +14 -0
- package/dist/components/breadcrumb.d.ts +9 -9
- package/dist/components/breadcrumb.js +19 -83
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.cjs +169 -0
- package/dist/components/button.cjs.map +1 -0
- package/dist/components/button.d.cts +20 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +105 -21
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar-rac.cjs +85 -0
- package/dist/components/calendar-rac.cjs.map +1 -0
- package/dist/components/calendar-rac.d.cts +13 -0
- package/dist/components/calendar-rac.d.ts +3 -3
- package/dist/components/card.cjs +99 -0
- package/dist/components/card.cjs.map +1 -0
- package/dist/components/card.d.cts +18 -0
- package/dist/components/card.d.ts +7 -8
- package/dist/components/card.js +23 -8
- package/dist/components/card.js.map +1 -1
- package/dist/components/checkbox-group.cjs +18 -0
- package/dist/components/checkbox-group.cjs.map +1 -0
- package/dist/components/checkbox-group.d.cts +7 -0
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox.cjs +121 -0
- package/dist/components/checkbox.cjs.map +1 -0
- package/dist/components/checkbox.d.cts +8 -0
- package/dist/components/checkbox.d.ts +3 -3
- package/dist/components/checkbox.js +73 -41
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.cjs +127 -0
- package/dist/components/collapsible.cjs.map +1 -0
- package/dist/components/collapsible.d.cts +44 -0
- package/dist/components/collapsible.d.ts +8 -18
- package/dist/components/collapsible.js +7 -27
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.cjs +551 -0
- package/dist/components/combobox.cjs.map +1 -0
- package/dist/components/combobox.d.cts +43 -0
- package/dist/components/combobox.d.ts +17 -18
- package/dist/components/combobox.js +37 -48
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.cjs +236 -0
- package/dist/components/command.cjs.map +1 -0
- package/dist/components/command.d.cts +23 -0
- package/dist/components/command.d.ts +14 -15
- package/dist/components/command.js +5 -38
- package/dist/components/command.js.map +1 -1
- package/dist/components/dialog.cjs +431 -0
- package/dist/components/dialog.cjs.map +1 -0
- package/dist/components/dialog.d.cts +30 -0
- package/dist/components/dialog.d.ts +13 -18
- package/dist/components/dialog.js +75 -119
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dock.cjs +121 -0
- package/dist/components/dock.cjs.map +1 -0
- package/dist/components/dock.d.cts +30 -0
- package/dist/components/dock.d.ts +1 -2
- package/dist/components/dock.js +7 -5
- package/dist/components/dock.js.map +1 -1
- package/dist/components/drawer.cjs +149 -0
- package/dist/components/drawer.cjs.map +1 -0
- package/dist/components/drawer.d.cts +15 -0
- package/dist/components/drawer.d.ts +10 -11
- package/dist/components/drawer.js +11 -40
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.cjs +292 -0
- package/dist/components/dropdown-menu.cjs.map +1 -0
- package/dist/components/dropdown-menu.d.cts +52 -0
- package/dist/components/dropdown-menu.d.ts +23 -21
- package/dist/components/dropdown-menu.js +67 -191
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.cjs +106 -0
- package/dist/components/empty.cjs.map +1 -0
- package/dist/components/empty.d.cts +15 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +99 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.cjs +295 -0
- package/dist/components/field.cjs.map +1 -0
- package/dist/components/field.d.cts +46 -0
- package/dist/components/field.d.ts +34 -39
- package/dist/components/field.js +220 -72
- package/dist/components/field.js.map +1 -1
- package/dist/components/flickering-grid.cjs +176 -0
- package/dist/components/flickering-grid.cjs.map +1 -0
- package/dist/components/flickering-grid.d.cts +15 -0
- package/dist/components/flickering-grid.js +25 -2
- package/dist/components/flickering-grid.js.map +1 -1
- package/dist/components/flow-zoom-panel.cjs +194 -0
- package/dist/components/flow-zoom-panel.cjs.map +1 -0
- package/dist/components/flow-zoom-panel.d.cts +12 -0
- package/dist/components/flow-zoom-panel.d.ts +12 -0
- package/dist/components/flow-zoom-panel.js +173 -0
- package/dist/components/flow-zoom-panel.js.map +1 -0
- package/dist/components/form-control.cjs +193 -0
- package/dist/components/form-control.cjs.map +1 -0
- package/dist/components/form-control.d.cts +14 -0
- package/dist/components/form-control.d.ts +1 -2
- package/dist/components/form-control.js +2 -4
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/form.cjs +208 -0
- package/dist/components/form.cjs.map +1 -0
- package/dist/components/form.d.cts +36 -0
- package/dist/components/form.d.ts +7 -8
- package/dist/components/input-group.cjs +184 -0
- package/dist/components/input-group.cjs.map +1 -0
- package/dist/components/input-group.d.cts +17 -0
- package/dist/components/input-group.d.ts +6 -7
- package/dist/components/input-group.js +3 -2
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input.cjs +62 -0
- package/dist/components/input.cjs.map +1 -0
- package/dist/components/input.d.cts +10 -0
- package/dist/components/input.d.ts +1 -2
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/json-input.cjs +351 -0
- package/dist/components/json-input.cjs.map +1 -0
- package/dist/components/json-input.d.cts +25 -0
- package/dist/components/json-input.d.ts +3 -3
- package/dist/components/json-input.js +89 -112
- package/dist/components/json-input.js.map +1 -1
- package/dist/components/label.cjs +29 -0
- package/dist/components/label.cjs.map +1 -0
- package/dist/components/label.d.cts +10 -0
- package/dist/components/label.d.ts +1 -2
- package/dist/components/motion-grid.cjs +108 -0
- package/dist/components/motion-grid.cjs.map +1 -0
- package/dist/components/motion-grid.d.cts +19 -0
- package/dist/components/motion-grid.d.ts +1 -2
- package/dist/components/motion-grid.js +9 -4
- package/dist/components/motion-grid.js.map +1 -1
- package/dist/components/multi-select.cjs +796 -0
- package/dist/components/multi-select.cjs.map +1 -0
- package/dist/components/multi-select.d.cts +198 -0
- package/dist/components/multi-select.js +54 -162
- package/dist/components/multi-select.js.map +1 -1
- package/dist/components/page-header.cjs +19 -0
- package/dist/components/page-header.cjs.map +1 -0
- package/dist/components/page-header.d.cts +17 -0
- package/dist/components/page-header.d.ts +2 -2
- package/dist/components/pagination.cjs +295 -0
- package/dist/components/pagination.cjs.map +1 -0
- package/dist/components/pagination.d.cts +18 -0
- package/dist/components/pagination.d.ts +7 -8
- package/dist/components/pagination.js +152 -29
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.cjs +140 -0
- package/dist/components/popover.cjs.map +1 -0
- package/dist/components/popover.d.cts +39 -0
- package/dist/components/popover.d.ts +13 -9
- package/dist/components/popover.js +56 -132
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal.cjs +109 -0
- package/dist/components/portal.cjs.map +1 -0
- package/dist/components/portal.d.cts +117 -0
- package/dist/components/portal.d.ts +16 -7
- package/dist/components/portal.js +13 -8
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.cjs +31 -0
- package/dist/components/progress.cjs.map +1 -0
- package/dist/components/progress.d.cts +9 -0
- package/dist/components/progress.d.ts +1 -2
- package/dist/components/progress.js +1 -2
- package/dist/components/progress.js.map +1 -1
- package/dist/components/progressive-blur-scroll-container.cjs +144 -0
- package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
- package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
- package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
- package/dist/components/progressive-blur.cjs +70 -0
- package/dist/components/progressive-blur.cjs.map +1 -0
- package/dist/components/progressive-blur.d.cts +16 -0
- package/dist/components/progressive-blur.d.ts +2 -2
- package/dist/components/radio-group.cjs +52 -0
- package/dist/components/radio-group.cjs.map +1 -0
- package/dist/components/radio-group.d.cts +10 -0
- package/dist/components/radio-group.d.ts +3 -3
- package/dist/components/radio-group.js +21 -10
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/record-picker.cjs +420 -0
- package/dist/components/record-picker.cjs.map +1 -0
- package/dist/components/record-picker.d.cts +16 -0
- package/dist/components/record-picker.d.ts +2 -2
- package/dist/components/record-picker.js +76 -43
- package/dist/components/record-picker.js.map +1 -1
- package/dist/components/resizable.cjs +76 -0
- package/dist/components/resizable.cjs.map +1 -0
- package/dist/components/resizable.d.cts +10 -0
- package/dist/components/resizable.d.ts +3 -4
- package/dist/components/responsive-diagram.cjs +67 -0
- package/dist/components/responsive-diagram.cjs.map +1 -0
- package/dist/components/responsive-diagram.d.cts +10 -0
- package/dist/components/responsive-diagram.d.ts +2 -2
- package/dist/components/scroll-area.cjs +92 -0
- package/dist/components/scroll-area.cjs.map +1 -0
- package/dist/components/scroll-area.d.cts +11 -0
- package/dist/components/scroll-area.d.ts +5 -6
- package/dist/components/select.cjs +329 -0
- package/dist/components/select.cjs.map +1 -0
- package/dist/components/select.d.cts +46 -0
- package/dist/components/select.d.ts +13 -14
- package/dist/components/select.js +76 -67
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.cjs +26 -0
- package/dist/components/separator.cjs.map +1 -0
- package/dist/components/separator.d.cts +10 -0
- package/dist/components/separator.d.ts +1 -2
- package/dist/components/sheet.cjs +489 -0
- package/dist/components/sheet.cjs.map +1 -0
- package/dist/components/sheet.d.cts +107 -0
- package/dist/components/sheet.d.ts +14 -19
- package/dist/components/sheet.js +119 -264
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.cjs +1300 -0
- package/dist/components/sidebar.cjs.map +1 -0
- package/dist/components/sidebar.d.cts +70 -0
- package/dist/components/sidebar.d.ts +32 -39
- package/dist/components/sidebar.js +401 -362
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.cjs +36 -0
- package/dist/components/skeleton.cjs.map +1 -0
- package/dist/components/skeleton.d.cts +10 -0
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +19 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/sonner.cjs +25 -0
- package/dist/components/sonner.cjs.map +1 -0
- package/dist/components/sonner.d.cts +10 -0
- package/dist/components/sonner.d.ts +2 -2
- package/dist/components/stack/index.cjs +1516 -0
- package/dist/components/stack/index.cjs.map +1 -0
- package/dist/components/stack/index.d.cts +672 -0
- package/dist/components/stack/index.d.ts +36 -38
- package/dist/components/stack/index.js +42 -31
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/stepper.cjs +314 -0
- package/dist/components/stepper.cjs.map +1 -0
- package/dist/components/stepper.d.cts +31 -0
- package/dist/components/stepper.d.ts +9 -8
- package/dist/components/stepper.js +22 -15
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +46 -0
- package/dist/components/switch.cjs.map +1 -0
- package/dist/components/switch.d.cts +7 -0
- package/dist/components/switch.d.ts +1 -2
- package/dist/components/switch.js +9 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.cjs +133 -0
- package/dist/components/table.cjs.map +1 -0
- package/dist/components/table.d.cts +22 -0
- package/dist/components/table.d.ts +19 -12
- package/dist/components/table.js +72 -13
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.cjs +53 -0
- package/dist/components/tabs.cjs.map +1 -0
- package/dist/components/tabs.d.cts +9 -0
- package/dist/components/tabs.d.ts +4 -5
- package/dist/components/tabs.js +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tags.cjs +451 -0
- package/dist/components/tags.cjs.map +1 -0
- package/dist/components/tags.d.cts +40 -0
- package/dist/components/tags.d.ts +10 -10
- package/dist/components/tags.js +129 -154
- package/dist/components/tags.js.map +1 -1
- package/dist/components/textarea.cjs +56 -0
- package/dist/components/textarea.cjs.map +1 -0
- package/dist/components/textarea.d.cts +9 -0
- package/dist/components/textarea.d.ts +1 -2
- package/dist/components/toast/index.cjs +612 -0
- package/dist/components/toast/index.cjs.map +1 -0
- package/dist/components/toast/index.d.cts +52 -0
- package/dist/components/toast/index.js +90 -127
- package/dist/components/toast/index.js.map +1 -1
- package/dist/components/tooltip.cjs +92 -0
- package/dist/components/tooltip.cjs.map +1 -0
- package/dist/components/tooltip.d.cts +28 -0
- package/dist/components/tooltip.d.ts +5 -6
- package/dist/components/tooltip.js +23 -130
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unlink-button.cjs +197 -0
- package/dist/components/unlink-button.cjs.map +1 -0
- package/dist/components/unlink-button.d.cts +14 -0
- package/dist/components/unlink-button.d.ts +2 -2
- package/dist/components/unlink-button.js +105 -21
- package/dist/components/unlink-button.js.map +1 -1
- package/dist/index.cjs +2074 -2723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +492 -904
- package/dist/index.d.ts +492 -904
- package/dist/index.js +1897 -2569
- package/dist/index.js.map +1 -1
- package/package.json +286 -45
- package/src/styles/globals.css +155 -203
- package/dist/components/org-chart/index.d.ts +0 -54
- package/dist/components/org-chart/index.js +0 -861
- package/dist/components/org-chart/index.js.map +0 -1
package/dist/components/tags.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React2 from 'react';
|
|
3
3
|
import { createContext, useState, useRef, useEffect, useContext } from 'react';
|
|
4
4
|
import { XIcon, SearchIcon } from 'lucide-react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -7,13 +7,14 @@ import { twMerge } from 'tailwind-merge';
|
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
import { Command as Command$1 } from 'cmdk';
|
|
10
|
+
import { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';
|
|
10
11
|
import { Popover as Popover$1 } from '@base-ui/react/popover';
|
|
11
12
|
|
|
12
13
|
function cn(...inputs) {
|
|
13
14
|
return twMerge(clsx(inputs));
|
|
14
15
|
}
|
|
15
16
|
var badgeVariants = cva(
|
|
16
|
-
"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:
|
|
17
|
+
"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:min-h-11 [button,a&]:pointer-coarse:min-w-11",
|
|
17
18
|
{
|
|
18
19
|
defaultVariants: {
|
|
19
20
|
size: "default",
|
|
@@ -38,27 +39,105 @@ var badgeVariants = cva(
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
|
-
var Badge =
|
|
42
|
+
var Badge = React2.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx("span", { ref, "data-slot": "badge", className: cn(badgeVariants({ variant, size }), className), ...props }));
|
|
42
43
|
Badge.displayName = "Badge";
|
|
44
|
+
function composeRefs(...refs) {
|
|
45
|
+
return (node) => {
|
|
46
|
+
refs.forEach((ref) => {
|
|
47
|
+
if (typeof ref === "function") {
|
|
48
|
+
ref(node);
|
|
49
|
+
} else if (ref != null) {
|
|
50
|
+
ref.current = node;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function mergeProps(slotProps, childProps) {
|
|
56
|
+
const overrideProps = { ...childProps };
|
|
57
|
+
for (const propName in childProps) {
|
|
58
|
+
if (propName === "ref") continue;
|
|
59
|
+
const slotPropValue = slotProps[propName];
|
|
60
|
+
const childPropValue = childProps[propName];
|
|
61
|
+
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
62
|
+
overrideProps[propName] = (...args) => {
|
|
63
|
+
childPropValue(...args);
|
|
64
|
+
slotPropValue(...args);
|
|
65
|
+
};
|
|
66
|
+
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
67
|
+
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
68
|
+
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
69
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { ...slotProps, ...overrideProps };
|
|
73
|
+
}
|
|
74
|
+
function isSlottable(child) {
|
|
75
|
+
return React2.isValidElement(child);
|
|
76
|
+
}
|
|
77
|
+
var Slot = React2.forwardRef((props, forwardedRef) => {
|
|
78
|
+
const { children, ...slotProps } = props;
|
|
79
|
+
if (isSlottable(children)) {
|
|
80
|
+
const childProps = children.props;
|
|
81
|
+
const childRef = childProps.ref;
|
|
82
|
+
return React2.cloneElement(children, {
|
|
83
|
+
...mergeProps(slotProps, childProps),
|
|
84
|
+
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (React2.Children.count(children) > 1) {
|
|
88
|
+
const childrenArray = React2.Children.toArray(children);
|
|
89
|
+
const slottableChild = childrenArray.find(
|
|
90
|
+
(child) => React2.isValidElement(child) && child.type === Slottable
|
|
91
|
+
);
|
|
92
|
+
if (slottableChild) {
|
|
93
|
+
const newElement = slottableChild.props.children;
|
|
94
|
+
if (isSlottable(newElement)) {
|
|
95
|
+
const newElementProps = newElement.props;
|
|
96
|
+
const newChildren = childrenArray.map((child) => {
|
|
97
|
+
if (child === slottableChild) {
|
|
98
|
+
return React2.Children.count(newElementProps.children) > 1 ? React2.Children.only(null) : newElementProps.children;
|
|
99
|
+
}
|
|
100
|
+
return child;
|
|
101
|
+
});
|
|
102
|
+
const childRef = newElementProps.ref;
|
|
103
|
+
return React2.cloneElement(newElement, {
|
|
104
|
+
...mergeProps(slotProps, newElementProps),
|
|
105
|
+
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
106
|
+
children: newChildren
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
112
|
+
});
|
|
113
|
+
Slot.displayName = "Slot";
|
|
114
|
+
function Slottable({ children }) {
|
|
115
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
116
|
+
}
|
|
43
117
|
var buttonVariants = cva(
|
|
44
|
-
"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-
|
|
118
|
+
"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
45
119
|
{
|
|
46
120
|
defaultVariants: {
|
|
47
121
|
size: "default",
|
|
122
|
+
static: false,
|
|
48
123
|
variant: "default"
|
|
49
124
|
},
|
|
50
125
|
variants: {
|
|
126
|
+
static: {
|
|
127
|
+
false: "motion-safe:active:not-disabled:scale-[0.96]",
|
|
128
|
+
true: null
|
|
129
|
+
},
|
|
51
130
|
size: {
|
|
52
|
-
default: "h-
|
|
53
|
-
icon: "size-
|
|
54
|
-
"icon-lg": "size-
|
|
55
|
-
"icon-sm": "size-8
|
|
56
|
-
"icon-xl": 'size-11
|
|
57
|
-
"icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)]
|
|
58
|
-
lg: "h-
|
|
59
|
-
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)]
|
|
60
|
-
xl: 'h-
|
|
61
|
-
xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-
|
|
131
|
+
default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
132
|
+
icon: "size-10 pointer-coarse:size-11",
|
|
133
|
+
"icon-lg": "size-11",
|
|
134
|
+
"icon-sm": "size-8 pointer-coarse:size-11",
|
|
135
|
+
"icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
|
|
136
|
+
"icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
|
|
137
|
+
lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
|
|
138
|
+
sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
139
|
+
xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
|
|
140
|
+
xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
|
|
62
141
|
},
|
|
63
142
|
variant: {
|
|
64
143
|
default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
|
|
@@ -72,43 +151,27 @@ var buttonVariants = cva(
|
|
|
72
151
|
}
|
|
73
152
|
}
|
|
74
153
|
);
|
|
75
|
-
var Button =
|
|
76
|
-
({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
|
|
77
|
-
const buttonClasses = cn(buttonVariants({ className, size, variant }));
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
154
|
+
var Button = React2.forwardRef(
|
|
155
|
+
({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
|
|
156
|
+
const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
|
|
157
|
+
const Comp = asChild ? Slot : "button";
|
|
158
|
+
if (asChild) {
|
|
159
|
+
const SlottedComp = Comp;
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
SlottedComp,
|
|
162
|
+
{
|
|
163
|
+
ref,
|
|
164
|
+
className: buttonClasses,
|
|
165
|
+
"data-slot": "button",
|
|
166
|
+
...props,
|
|
167
|
+
children
|
|
168
|
+
}
|
|
169
|
+
);
|
|
85
170
|
}
|
|
86
171
|
return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
|
|
87
172
|
}
|
|
88
173
|
);
|
|
89
174
|
Button.displayName = "Button";
|
|
90
|
-
var PORTAL_ROOT_ID = "portal-root";
|
|
91
|
-
var PortalContext = React4.createContext({
|
|
92
|
-
layer: "base",
|
|
93
|
-
depth: 0,
|
|
94
|
-
floatingPortalStrategy: "root",
|
|
95
|
-
floatingZIndex: "default"
|
|
96
|
-
});
|
|
97
|
-
function useRootPortalContainer() {
|
|
98
|
-
const [container, setContainer] = React4.useState(null);
|
|
99
|
-
React4.useLayoutEffect(() => {
|
|
100
|
-
const el = document.getElementById(PORTAL_ROOT_ID);
|
|
101
|
-
setContainer(el);
|
|
102
|
-
}, []);
|
|
103
|
-
return container;
|
|
104
|
-
}
|
|
105
|
-
function useFloatingOverlayPortalProps() {
|
|
106
|
-
const rootContainer = useRootPortalContainer();
|
|
107
|
-
const { floatingPortalStrategy, floatingZIndex } = React4.useContext(PortalContext);
|
|
108
|
-
const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
|
|
109
|
-
const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
|
|
110
|
-
return { container, zIndexClass };
|
|
111
|
-
}
|
|
112
175
|
function Command({
|
|
113
176
|
className,
|
|
114
177
|
...props
|
|
@@ -206,7 +269,7 @@ function CommandItem({
|
|
|
206
269
|
Command$1.Item,
|
|
207
270
|
{
|
|
208
271
|
className: cn(
|
|
209
|
-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
|
|
272
|
+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none pointer-coarse:min-h-11 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
|
|
210
273
|
className
|
|
211
274
|
),
|
|
212
275
|
"data-slot": "command-item",
|
|
@@ -214,111 +277,21 @@ function CommandItem({
|
|
|
214
277
|
}
|
|
215
278
|
);
|
|
216
279
|
}
|
|
217
|
-
function composeRefs(...refs) {
|
|
218
|
-
return (node) => {
|
|
219
|
-
refs.forEach((ref) => {
|
|
220
|
-
if (typeof ref === "function") {
|
|
221
|
-
ref(node);
|
|
222
|
-
} else if (ref != null) {
|
|
223
|
-
ref.current = node;
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
function mergeProps(slotProps, childProps) {
|
|
229
|
-
const overrideProps = { ...childProps };
|
|
230
|
-
for (const propName in childProps) {
|
|
231
|
-
if (propName === "ref") continue;
|
|
232
|
-
const slotPropValue = slotProps[propName];
|
|
233
|
-
const childPropValue = childProps[propName];
|
|
234
|
-
if (/^on[A-Z]/.test(propName) && typeof slotPropValue === "function" && typeof childPropValue === "function") {
|
|
235
|
-
overrideProps[propName] = (...args) => {
|
|
236
|
-
childPropValue(...args);
|
|
237
|
-
slotPropValue(...args);
|
|
238
|
-
};
|
|
239
|
-
} else if (propName === "className" && typeof slotPropValue === "string" && typeof childPropValue === "string") {
|
|
240
|
-
overrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();
|
|
241
|
-
} else if (propName === "style" && typeof slotPropValue === "object" && typeof childPropValue === "object") {
|
|
242
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return { ...slotProps, ...overrideProps };
|
|
246
|
-
}
|
|
247
|
-
function mergePropsWithRef(parentProps, childElement) {
|
|
248
|
-
const childProps = childElement.props;
|
|
249
|
-
const parentRef = parentProps.ref;
|
|
250
|
-
const childRef = childProps.ref;
|
|
251
|
-
const mergedProps = mergeProps(parentProps, childProps);
|
|
252
|
-
if (parentRef || childRef) {
|
|
253
|
-
mergedProps.ref = composeRefs(parentRef, childRef);
|
|
254
|
-
}
|
|
255
|
-
return mergedProps;
|
|
256
|
-
}
|
|
257
|
-
function isSlottable(child) {
|
|
258
|
-
return React4.isValidElement(child);
|
|
259
|
-
}
|
|
260
|
-
var Slot = React4.forwardRef((props, forwardedRef) => {
|
|
261
|
-
const { children, ...slotProps } = props;
|
|
262
|
-
if (isSlottable(children)) {
|
|
263
|
-
const childProps = children.props;
|
|
264
|
-
const childRef = childProps.ref;
|
|
265
|
-
return React4.cloneElement(children, {
|
|
266
|
-
...mergeProps(slotProps, childProps),
|
|
267
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
if (React4.Children.count(children) > 1) {
|
|
271
|
-
const childrenArray = React4.Children.toArray(children);
|
|
272
|
-
const slottableChild = childrenArray.find(
|
|
273
|
-
(child) => React4.isValidElement(child) && child.type === Slottable
|
|
274
|
-
);
|
|
275
|
-
if (slottableChild) {
|
|
276
|
-
const newElement = slottableChild.props.children;
|
|
277
|
-
if (isSlottable(newElement)) {
|
|
278
|
-
const newElementProps = newElement.props;
|
|
279
|
-
const newChildren = childrenArray.map((child) => {
|
|
280
|
-
if (child === slottableChild) {
|
|
281
|
-
return React4.Children.count(newElementProps.children) > 1 ? React4.Children.only(null) : newElementProps.children;
|
|
282
|
-
}
|
|
283
|
-
return child;
|
|
284
|
-
});
|
|
285
|
-
const childRef = newElementProps.ref;
|
|
286
|
-
return React4.cloneElement(newElement, {
|
|
287
|
-
...mergeProps(slotProps, newElementProps),
|
|
288
|
-
ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
|
|
289
|
-
children: newChildren
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
295
|
-
});
|
|
296
|
-
Slot.displayName = "Slot";
|
|
297
|
-
function Slottable({ children }) {
|
|
298
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
299
|
-
}
|
|
300
280
|
function Popover({ ...props }) {
|
|
301
281
|
return /* @__PURE__ */ jsx(Popover$1.Root, { "data-slot": "popover", ...props });
|
|
302
282
|
}
|
|
303
|
-
function PopoverTrigger({ asChild,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
mergePropsWithRef(rest, children)
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
return /* @__PURE__ */ jsx(Popover$1.Trigger, { "data-slot": "popover-trigger", nativeButton, ...props, children });
|
|
283
|
+
function PopoverTrigger({ asChild, children, render, nativeButton, ...props }) {
|
|
284
|
+
const childRender = render === void 0 && asChild && React2.isValidElement(children) ? children : void 0;
|
|
285
|
+
return /* @__PURE__ */ jsx(
|
|
286
|
+
Popover$1.Trigger,
|
|
287
|
+
{
|
|
288
|
+
"data-slot": "popover-trigger",
|
|
289
|
+
nativeButton: nativeButton ?? (childRender ? true : void 0),
|
|
290
|
+
render: render ?? childRender,
|
|
291
|
+
...props,
|
|
292
|
+
children: childRender ? void 0 : children
|
|
293
|
+
}
|
|
294
|
+
);
|
|
322
295
|
}
|
|
323
296
|
function PopoverContent({
|
|
324
297
|
className,
|
|
@@ -346,11 +319,13 @@ function PopoverContent({
|
|
|
346
319
|
{
|
|
347
320
|
"data-slot": "popover-content",
|
|
348
321
|
className: cn(
|
|
349
|
-
`bg-popover text-popover-foreground
|
|
350
|
-
|
|
351
|
-
data-
|
|
352
|
-
data-[side=
|
|
353
|
-
|
|
322
|
+
`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden
|
|
323
|
+
transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
|
|
324
|
+
data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
|
|
325
|
+
data-[side=bottom]:data-starting-style:-translate-y-2
|
|
326
|
+
data-[side=left]:data-starting-style:translate-x-2
|
|
327
|
+
data-[side=right]:data-starting-style:-translate-x-2
|
|
328
|
+
data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
|
|
354
329
|
className
|
|
355
330
|
),
|
|
356
331
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/badge.tsx","../../src/components/button.tsx","../../src/components/portal.tsx","../../src/components/command.tsx","../../src/lib/slot.tsx","../../src/components/popover.tsx","../../src/components/tags.tsx"],"names":["React","cva","React2","jsx","React3","CommandPrimitive","Fragment","PopoverPrimitive","React5","jsxs","createContext","useContext","useState"],"mappings":";;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACA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AA,EAAM,qBACrEA,GAAAA,CAAC,YAAA,EAAA,EAAc,GAAG,KAAA,EAAQ,sBAAY,gBAAA,EAAiB;AAKjD,IAAM,SAAA,GAAY;AAIlB,IAAM,WAAW,CAAC,EAAE,SAAA,EAAW,GAAG,OAAM,qBAC9CA,GAAAA,CAAC,WAAA,EAAA,EAAY,WAAW,EAAA,CAAG,6CAAA,EAA+C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO","file":"tags.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst badgeVariants = cva(\n\t\"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'px-[calc(--spacing(1)-1px)] text-xs',\n\t\t\t\tlg: 'px-[calc(--spacing(1.5)-1px)] text-sm',\n\t\t\t\tsm: 'rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-[.625rem]',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault: 'bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90',\n\t\t\t\tdestructive: 'bg-destructive text-white [button,a&]:hover:bg-destructive/90',\n\t\t\t\terror: 'bg-destructive/8 text-destructive dark:bg-destructive/16',\n\t\t\t\tinfo: 'bg-info/8 text-info-foreground dark:bg-info/16',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border/60 bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48',\n\t\t\t\tsecondary: 'bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90',\n\t\t\t\tsuccess: 'bg-success/8 text-success-foreground dark:bg-success/16',\n\t\t\t\twarning: 'bg-warning/8 text-warning-foreground dark:bg-warning/16',\n\t\t\t},\n\t\t},\n\t},\n);\n\ntype BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, size, ...props }, ref) => (\n\t<span ref={ref} data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props} />\n));\n\nBadge.displayName = 'Badge';\n\nexport { Badge, badgeVariants };\nexport type { BadgeProps };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-9 px-[calc(--spacing(3)-1px)] sm:h-8',\n\t\t\t\ticon: 'size-9 sm:size-8',\n\t\t\t\t'icon-lg': 'size-10 sm:size-9',\n\t\t\t\t'icon-sm': 'size-8 sm:size-7',\n\t\t\t\t'icon-xl': 'size-11 sm:size-10 [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t\tlg: 'h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9',\n\t\t\t\tsm: 'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7',\n\t\t\t\txl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\txs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*=\"size-\"])]:size-4 sm:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\tdestructive:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, variant }));\n\n\t\t// If asChild, render children with merged props (for wrapping Links, etc.)\n\t\tif (asChild && React.isValidElement(children)) {\n\t\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t\treturn React.cloneElement(children as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t...props,\n\t\t\t\tclassName: cn(buttonClasses, childProps.className as string | undefined),\n\t\t\t\t'data-slot': 'button',\n\t\t\t});\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","\"use client\";\n\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { ModalPortalScope, useRootPortalContainer } from \"./portal\";\nimport { cn } from \"../lib/utils\";\n\nfunction CommandDialog({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Dialog>) {\n const container = useRootPortalContainer();\n\n return (\n <CommandPrimitive.Dialog\n container={container ?? undefined}\n overlayClassName={cn(\n \"fixed inset-0 z-[var(--z-layer-toast)] bg-black/32 backdrop-blur-sm transition-all duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n )}\n contentClassName={cn(\n \"fixed left-1/2 top-[max(--spacing(4),4vh)] sm:top-[10vh] z-[var(--z-layer-toast)] -translate-x-1/2 flex max-h-100 min-h-0 w-full min-w-0 max-w-xl flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/50 before:shadow-[0_1px_--theme(--color-black/4%)] **:data-[slot=scroll-area-viewport]:data-has-overflow-y:pe-1 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]\",\n className,\n )}\n loop\n {...props}\n >\n <ModalPortalScope>{children}</ModalPortalScope>\n </CommandPrimitive.Dialog>\n );\n}\n\nfunction CommandDialogPopup({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"command-dialog-popup\" className={className} {...props}>\n {children}\n </div>\n );\n}\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-2xl\",\n className,\n )}\n data-slot=\"command\"\n {...props}\n />\n );\n}\n\nfunction CommandInput({\n className,\n placeholder,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div className=\"px-2.5 py-1.5\" data-slot=\"command-input-wrapper\">\n <div\n className={cn(\n \"flex items-center gap-2 rounded-lg px-3 text-base\",\n className,\n )}\n >\n <SearchIcon className=\"size-4 shrink-0 text-muted-foreground\" />\n <CommandPrimitive.Input\n className=\"flex h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n placeholder={placeholder}\n data-slot=\"command-input\"\n {...props}\n />\n </div>\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n className={cn(\"not-empty:scroll-py-2 not-empty:p-2 max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n data-slot=\"command-list\"\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n className={cn(\"not-empty:py-6\", className)}\n data-slot=\"command-empty\"\n {...props}\n />\n );\n}\n\nfunction CommandPanel({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"-mx-px relative min-h-0 rounded-t-xl border bg-popover bg-clip-padding shadow-xs [clip-path:inset(0_1px)] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]\",\n className,\n )}\n data-slot=\"command-panel\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n heading,\n children,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group> & {\n heading?: React.ReactNode;\n}) {\n return (\n <CommandPrimitive.Group\n className={cn(\n \"overflow-hidden text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n heading={heading}\n data-slot=\"command-group\"\n {...props}\n >\n {children}\n </CommandPrimitive.Group>\n );\n}\n\nfunction CommandGroupLabel({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"px-2 py-1.5 text-xs font-medium text-muted-foreground\",\n className,\n )}\n data-slot=\"command-group-label\"\n {...props}\n />\n );\n}\n\nfunction CommandCollection({ children }: { children: React.ReactNode }) {\n return <>{children}</>;\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50\",\n className,\n )}\n data-slot=\"command-item\"\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n className={cn(\"-mx-1 my-2 h-px bg-border\", className)}\n data-slot=\"command-separator\"\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<\"kbd\">) {\n return (\n <span\n className={cn(\n \"ms-auto font-medium text-muted-foreground/72 text-xs tracking-widest\",\n className,\n )}\n data-slot=\"command-shortcut\"\n {...props}\n />\n );\n}\n\nfunction CommandFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] px-5 py-3 text-muted-foreground text-xs\",\n className,\n )}\n data-slot=\"command-footer\"\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandCollection,\n CommandDialog,\n CommandDialogPopup,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandGroupLabel,\n CommandInput,\n CommandItem,\n CommandList,\n CommandPanel,\n CommandSeparator,\n CommandShortcut,\n};\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = Omit<React.ComponentProps<typeof PopoverPrimitive.Trigger>, 'render' | 'nativeButton'> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n\t/** Whether the child renders a native button. Defaults to true when asChild is used. */\n\tnativeButton?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, nativeButton, children, ...props }: PopoverTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<PopoverPrimitive.Trigger\n\t\t\t\tdata-slot=\"popover-trigger\"\n\t\t\t\tnativeButton={nativeButton ?? true}\n\t\t\t\t{...props}\n\t\t\trender={(triggerProps) => {\n\t\t\t\tconst { nativeButton: _, ...rest } = triggerProps as Record<string, unknown>;\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\tmergePropsWithRef(rest, children as React.ReactElement),\n\t\t\t\t);\n\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<PopoverPrimitive.Trigger data-slot=\"popover-trigger\" nativeButton={nativeButton} {...props}>\n\t\t\t{children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out\n\t\t\t\t\t\tdata-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-72 rounded-md border p-4\n\t\t\t\t\t\tshadow-md outline-hidden`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };\n","'use client';\n\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\ttype ComponentProps,\n\ttype MouseEventHandler,\n\ttype ReactNode,\n} from 'react';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '../lib/utils';\nimport { Badge } from './badge';\nimport { Button } from './button';\nimport { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from './command';\nimport { Popover, PopoverContent, PopoverTrigger } from './popover';\n\ntype TagsContextType = {\n\tvalue?: string;\n\tsetValue?: (value: string) => void;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\twidth?: number;\n\tsetWidth?: (width: number) => void;\n};\n\nconst TagsContext = createContext<TagsContextType>({\n\tvalue: undefined,\n\tsetValue: undefined,\n\topen: false,\n\tonOpenChange: () => {},\n\twidth: undefined,\n\tsetWidth: undefined,\n});\n\nconst useTagsContext = () => {\n\tconst context = useContext(TagsContext);\n\n\tif (!context) {\n\t\tthrow new Error('useTagsContext must be used within a TagsProvider');\n\t}\n\n\treturn context;\n};\n\nexport type TagsProps = {\n\tvalue?: string;\n\tsetValue?: (value: string) => void;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tchildren?: ReactNode;\n\tclassName?: string;\n};\n\nexport const Tags = ({\n\tvalue,\n\tsetValue,\n\topen: controlledOpen,\n\tonOpenChange: controlledOnOpenChange,\n\tchildren,\n\tclassName,\n}: TagsProps) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n\tconst [width, setWidth] = useState<number>();\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst open = controlledOpen ?? uncontrolledOpen;\n\tconst onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;\n\n\tuseEffect(() => {\n\t\tif (!ref.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver((entries) => {\n\t\t\tsetWidth(entries[0].contentRect.width);\n\t\t});\n\n\t\tresizeObserver.observe(ref.current);\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, []);\n\n\treturn (\n\t\t<TagsContext.Provider value={{ value, setValue, open, onOpenChange, width, setWidth }}>\n\t\t\t<Popover onOpenChange={onOpenChange} open={open}>\n\t\t\t\t<div className={cn('relative w-full', className)} ref={ref}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t</TagsContext.Provider>\n\t);\n};\n\nexport type TagsTriggerProps = ComponentProps<typeof Button>;\n\nexport const TagsTrigger = ({ className, children, ...props }: TagsTriggerProps) => (\n\t<PopoverTrigger asChild>\n\t\t<Button\n\t\t\tclassName={cn('h-auto w-full justify-between p-2', className)}\n\t\t\t// biome-ignore lint/a11y/useSemanticElements: \"Required\"\n\t\t\trole='combobox'\n\t\t\tvariant='outline'\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className='flex flex-wrap items-center gap-1'>\n\t\t\t\t{children}\n\t\t\t\t<span className='text-muted-foreground px-2 py-px'>Select a tag...</span>\n\t\t\t</div>\n\t\t</Button>\n\t</PopoverTrigger>\n);\n\nexport type TagsValueProps = ComponentProps<typeof Badge>;\n\nexport const TagsValue = ({ className, children, onRemove, ...props }: TagsValueProps & { onRemove?: () => void }) => {\n\tconst handleRemove: MouseEventHandler<HTMLDivElement> = (event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tonRemove?.();\n\t};\n\n\treturn (\n\t\t<Badge className={cn('flex items-center gap-2', className)} {...props}>\n\t\t\t{children}\n\t\t\t{onRemove && (\n\t\t\t\t// biome-ignore lint/a11y/noStaticElementInteractions: \"This is a clickable badge\"\n\t\t\t\t// biome-ignore lint/a11y/useKeyWithClickEvents: \"This is a clickable badge\"\n\t\t\t\t<div className='hover:text-muted-foreground size-auto cursor-pointer' onClick={handleRemove}>\n\t\t\t\t\t<XIcon size={12} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Badge>\n\t);\n};\n\nexport type TagsContentProps = ComponentProps<typeof PopoverContent>;\n\nexport const TagsContent = ({ className, children, ...props }: TagsContentProps) => {\n\tconst { width } = useTagsContext();\n\n\treturn (\n\t\t<PopoverContent className={cn('p-0', className)} style={{ width }} {...props}>\n\t\t\t<Command>{children}</Command>\n\t\t</PopoverContent>\n\t);\n};\n\nexport type TagsInputProps = ComponentProps<typeof CommandInput>;\n\nexport const TagsInput = ({ className, ...props }: TagsInputProps) => (\n\t<CommandInput className={cn('h-9', className)} {...props} />\n);\n\nexport type TagsListProps = ComponentProps<typeof CommandList>;\n\nexport const TagsList = ({ className, ...props }: TagsListProps) => (\n\t<CommandList className={cn('max-h-[200px]', className)} {...props} />\n);\n\nexport type TagsEmptyProps = ComponentProps<typeof CommandEmpty>;\n\nexport const TagsEmpty = ({ children, className: _className, ...props }: TagsEmptyProps) => (\n\t<CommandEmpty {...props}>{children ?? 'No tags found.'}</CommandEmpty>\n);\n\nexport type TagsGroupProps = ComponentProps<typeof CommandGroup>;\n\nexport const TagsGroup = CommandGroup;\n\nexport type TagsItemProps = ComponentProps<typeof CommandItem>;\n\nexport const TagsItem = ({ className, ...props }: TagsItemProps) => (\n\t<CommandItem className={cn('cursor-pointer items-center justify-between', className)} {...props} />\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/badge.tsx","../../src/lib/slot.tsx","../../src/components/button.tsx","../../src/components/command.tsx","../../src/components/popover.tsx","../../src/components/tags.tsx"],"names":["React","jsx","cva","React3","CommandPrimitive","PopoverPrimitive","React4","jsxs"],"mappings":";;;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACAA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACrB,ufAAA;AAAA,EACA;AAAA,IACC,eAAA,EAAiB;AAAA,MAChB,IAAA,EAAM,SAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACV;AAAA,IACA,QAAA,EAA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C,SAAS,CAAA,EAAI,GAAG,KAAA,EAAO","file":"tags.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst badgeVariants = cva(\n\t\"relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:min-h-11 [button,a&]:pointer-coarse:min-w-11\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'px-[calc(--spacing(1)-1px)] text-xs',\n\t\t\t\tlg: 'px-[calc(--spacing(1.5)-1px)] text-sm',\n\t\t\t\tsm: 'rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-[.625rem]',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault: 'bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90',\n\t\t\t\tdestructive: 'bg-destructive text-white [button,a&]:hover:bg-destructive/90',\n\t\t\t\terror: 'bg-destructive/8 text-destructive dark:bg-destructive/16',\n\t\t\t\tinfo: 'bg-info/8 text-info-foreground dark:bg-info/16',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border/60 bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48',\n\t\t\t\tsecondary: 'bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90',\n\t\t\t\tsuccess: 'bg-success/8 text-success-foreground dark:bg-success/16',\n\t\t\t\twarning: 'bg-warning/8 text-warning-foreground dark:bg-warning/16',\n\t\t\t},\n\t\t},\n\t},\n);\n\ntype BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, size, ...props }, ref) => (\n\t<span ref={ref} data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props} />\n));\n\nBadge.displayName = 'Badge';\n\nexport { Badge, badgeVariants };\nexport type { BadgeProps };\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { Slot } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tstatic: false,\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tstatic: {\n\t\t\t\tfalse: 'motion-safe:active:not-disabled:scale-[0.96]',\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11',\n\t\t\t\ticon: 'size-10 pointer-coarse:size-11',\n\t\t\t\t'icon-lg': 'size-11',\n\t\t\t\t'icon-sm': 'size-8 pointer-coarse:size-11',\n\t\t\t\t'icon-xl': 'size-11 [&_svg:not([class*=\"size-\"])]:size-5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-4',\n\t\t\t\tlg: 'h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]',\n\t\t\t\tsm:\n\t\t\t\t\t'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11',\n\t\t\t\txl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*=\"size-\"])]:size-5',\n\t\t\t\txs:\n\t\t\t\t\t'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\tdestructive:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** Disables tactile press scaling when motion would distract from the interaction. */\n\tstatic?: boolean;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, static: isStatic, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));\n\t\tconst Comp = asChild ? Slot : 'button';\n\n\t\tif (asChild) {\n\t\t\tconst SlottedComp = Comp as typeof Slot;\n\t\t\treturn (\n\t\t\t\t<SlottedComp\n\t\t\t\t\tref={ref as React.Ref<HTMLElement>}\n\t\t\t\t\tclassName={buttonClasses}\n\t\t\t\t\tdata-slot=\"button\"\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SlottedComp>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","\"use client\";\n\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { SearchIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { ModalPortalScope, useRootPortalContainer } from \"@constructive-io/ui/portal\";\nimport { cn } from \"../lib/utils\";\n\nfunction CommandDialog({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Dialog>) {\n const container = useRootPortalContainer();\n\n return (\n <CommandPrimitive.Dialog\n container={container ?? undefined}\n overlayClassName={cn(\n\t\t\"fixed inset-0 z-[var(--z-layer-toast)] bg-black/32 backdrop-blur-sm data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_150ms_ease-in] motion-reduce:animate-none\",\n )}\n contentClassName={cn(\n \"fixed left-1/2 top-[max(--spacing(4),4vh)] sm:top-[10vh] z-[var(--z-layer-toast)] -translate-x-1/2 flex max-h-100 min-h-0 w-full min-w-0 max-w-xl flex-col rounded-2xl border bg-popover bg-clip-padding text-popover-foreground shadow-lg data-[state=open]:animate-[command-in_200ms_ease-out] data-[state=closed]:animate-[command-out_150ms_ease-in] motion-reduce:animate-none before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:bg-muted/50 before:shadow-[0_1px_--theme(--color-black/4%)] **:data-[slot=scroll-area-viewport]:data-has-overflow-y:pe-1 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]\",\n className,\n )}\n loop\n {...props}\n >\n <ModalPortalScope>{children}</ModalPortalScope>\n </CommandPrimitive.Dialog>\n );\n}\n\nfunction CommandDialogPopup({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"command-dialog-popup\" className={className} {...props}>\n {children}\n </div>\n );\n}\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-2xl\",\n className,\n )}\n data-slot=\"command\"\n {...props}\n />\n );\n}\n\nfunction CommandInput({\n className,\n placeholder,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div className=\"px-2.5 py-1.5\" data-slot=\"command-input-wrapper\">\n <div\n className={cn(\n \"flex items-center gap-2 rounded-lg px-3 text-base\",\n className,\n )}\n >\n <SearchIcon className=\"size-4 shrink-0 text-muted-foreground\" />\n <CommandPrimitive.Input\n className=\"flex h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\"\n placeholder={placeholder}\n data-slot=\"command-input\"\n {...props}\n />\n </div>\n </div>\n );\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n className={cn(\"not-empty:scroll-py-2 not-empty:p-2 max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n data-slot=\"command-list\"\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n className={cn(\"not-empty:py-6\", className)}\n data-slot=\"command-empty\"\n {...props}\n />\n );\n}\n\nfunction CommandPanel({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"-mx-px relative min-h-0 rounded-t-xl border bg-popover bg-clip-padding shadow-xs [clip-path:inset(0_1px)] before:pointer-events-none before:absolute before:inset-0 before:rounded-t-[calc(var(--radius-xl)-1px)] **:data-[slot=scroll-area-scrollbar]:mt-2 dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]\",\n className,\n )}\n data-slot=\"command-panel\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n heading,\n children,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group> & {\n heading?: React.ReactNode;\n}) {\n return (\n <CommandPrimitive.Group\n className={cn(\n \"overflow-hidden text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n heading={heading}\n data-slot=\"command-group\"\n {...props}\n >\n {children}\n </CommandPrimitive.Group>\n );\n}\n\nfunction CommandGroupLabel({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"px-2 py-1.5 text-xs font-medium text-muted-foreground\",\n className,\n )}\n data-slot=\"command-group-label\"\n {...props}\n />\n );\n}\n\nfunction CommandCollection({ children }: { children: React.ReactNode }) {\n return <>{children}</>;\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none pointer-coarse:min-h-11 data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50\",\n className,\n )}\n data-slot=\"command-item\"\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n className={cn(\"-mx-1 my-2 h-px bg-border\", className)}\n data-slot=\"command-separator\"\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<\"kbd\">) {\n return (\n <span\n className={cn(\n \"ms-auto font-medium text-muted-foreground/72 text-xs tracking-widest\",\n className,\n )}\n data-slot=\"command-shortcut\"\n {...props}\n />\n );\n}\n\nfunction CommandFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"flex items-center justify-between gap-2 rounded-b-[calc(var(--radius-2xl)-1px)] px-5 py-3 text-muted-foreground text-xs\",\n className,\n )}\n data-slot=\"command-footer\"\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandCollection,\n CommandDialog,\n CommandDialogPopup,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandGroupLabel,\n CommandInput,\n CommandItem,\n CommandList,\n CommandPanel,\n CommandSeparator,\n CommandShortcut,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverTrigger({ asChild, children, render, nativeButton, ...props }: PopoverTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Trigger\n\t\t\tdata-slot=\"popover-trigger\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Trigger>\n\t);\n}\n\ntype PopoverCloseProps = React.ComponentProps<typeof PopoverPrimitive.Close> & {\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction PopoverClose({ asChild, children, render, nativeButton, ...props }: PopoverCloseProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<PopoverPrimitive.Close\n\t\t\tdata-slot=\"popover-close\"\n\t\t\tnativeButton={nativeButton ?? (childRender ? true : undefined)}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</PopoverPrimitive.Close>\n\t);\n}\n\ntype PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Popup> & {\n\talign?: 'start' | 'center' | 'end';\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\t/** @deprecated Base UI uses different focus management */\n\tonOpenAutoFocus?: (e: Event) => void;\n\t/** @deprecated Base UI uses different focus management */\n\tonCloseAutoFocus?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonFocusOutside?: (e: Event) => void;\n\t/** @deprecated Use onOpenChange on Root instead */\n\tonEscapeKeyDown?: () => void;\n};\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'bottom',\n\tchildren,\n\tonOpenAutoFocus: _onOpenAutoFocus,\n\tonCloseAutoFocus: _onCloseAutoFocus,\n\tonFocusOutside: _onFocusOutside,\n\tonEscapeKeyDown: _onEscapeKeyDown,\n\t...props\n}: PopoverContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<PopoverPrimitive.Portal container={container}>\n\t\t\t<PopoverPrimitive.Positioner\n\t\t\t\tside={side}\n\t\t\t\talign={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={zIndexClass}\n\t\t\t>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) w-72 rounded-md border p-4 shadow-md outline-hidden\n\t\t\t\t\t\ttransition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_var(--border)]' />\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * PopoverAnchor - placeholder for positioning anchor.\n * @deprecated Base UI Popover positions relative to Trigger by default.\n * For custom anchoring, use Popover.Positioner with anchor prop.\n */\nfunction PopoverAnchor({ ...props }: React.HTMLAttributes<HTMLDivElement>) {\n\treturn <div data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {\n\treturn (\n\t\t<PopoverPrimitive.Title\n\t\t\tdata-slot=\"popover-title\"\n\t\t\tclassName={cn('font-medium leading-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {\n\treturn (\n\t\t<PopoverPrimitive.Description\n\t\t\tdata-slot=\"popover-description\"\n\t\t\tclassName={cn('text-muted-foreground text-sm', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n","'use client';\n\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\ttype ComponentProps,\n\ttype MouseEventHandler,\n\ttype ReactNode,\n} from 'react';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '../lib/utils';\nimport { Badge } from './badge';\nimport { Button } from './button';\nimport { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from './command';\nimport { Popover, PopoverContent, PopoverTrigger } from './popover';\n\ntype TagsContextType = {\n\tvalue?: string;\n\tsetValue?: (value: string) => void;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\twidth?: number;\n\tsetWidth?: (width: number) => void;\n};\n\nconst TagsContext = createContext<TagsContextType>({\n\tvalue: undefined,\n\tsetValue: undefined,\n\topen: false,\n\tonOpenChange: () => {},\n\twidth: undefined,\n\tsetWidth: undefined,\n});\n\nconst useTagsContext = () => {\n\tconst context = useContext(TagsContext);\n\n\tif (!context) {\n\t\tthrow new Error('useTagsContext must be used within a TagsProvider');\n\t}\n\n\treturn context;\n};\n\nexport type TagsProps = {\n\tvalue?: string;\n\tsetValue?: (value: string) => void;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tchildren?: ReactNode;\n\tclassName?: string;\n};\n\nexport const Tags = ({\n\tvalue,\n\tsetValue,\n\topen: controlledOpen,\n\tonOpenChange: controlledOnOpenChange,\n\tchildren,\n\tclassName,\n}: TagsProps) => {\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n\tconst [width, setWidth] = useState<number>();\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst open = controlledOpen ?? uncontrolledOpen;\n\tconst onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;\n\n\tuseEffect(() => {\n\t\tif (!ref.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver((entries) => {\n\t\t\tsetWidth(entries[0].contentRect.width);\n\t\t});\n\n\t\tresizeObserver.observe(ref.current);\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, []);\n\n\treturn (\n\t\t<TagsContext.Provider value={{ value, setValue, open, onOpenChange, width, setWidth }}>\n\t\t\t<Popover onOpenChange={onOpenChange} open={open}>\n\t\t\t\t<div className={cn('relative w-full', className)} ref={ref}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t</TagsContext.Provider>\n\t);\n};\n\nexport type TagsTriggerProps = ComponentProps<typeof Button>;\n\nexport const TagsTrigger = ({ className, children, ...props }: TagsTriggerProps) => (\n\t<PopoverTrigger asChild>\n\t\t<Button\n\t\t\tclassName={cn('h-auto w-full justify-between p-2', className)}\n\t\t\t// biome-ignore lint/a11y/useSemanticElements: \"Required\"\n\t\t\trole='combobox'\n\t\t\tvariant='outline'\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className='flex flex-wrap items-center gap-1'>\n\t\t\t\t{children}\n\t\t\t\t<span className='text-muted-foreground px-2 py-px'>Select a tag...</span>\n\t\t\t</div>\n\t\t</Button>\n\t</PopoverTrigger>\n);\n\nexport type TagsValueProps = ComponentProps<typeof Badge>;\n\nexport const TagsValue = ({ className, children, onRemove, ...props }: TagsValueProps & { onRemove?: () => void }) => {\n\tconst handleRemove: MouseEventHandler<HTMLDivElement> = (event) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\t\tonRemove?.();\n\t};\n\n\treturn (\n\t\t<Badge className={cn('flex items-center gap-2', className)} {...props}>\n\t\t\t{children}\n\t\t\t{onRemove && (\n\t\t\t\t// biome-ignore lint/a11y/noStaticElementInteractions: \"This is a clickable badge\"\n\t\t\t\t// biome-ignore lint/a11y/useKeyWithClickEvents: \"This is a clickable badge\"\n\t\t\t\t<div className='hover:text-muted-foreground size-auto cursor-pointer' onClick={handleRemove}>\n\t\t\t\t\t<XIcon size={12} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Badge>\n\t);\n};\n\nexport type TagsContentProps = ComponentProps<typeof PopoverContent>;\n\nexport const TagsContent = ({ className, children, ...props }: TagsContentProps) => {\n\tconst { width } = useTagsContext();\n\n\treturn (\n\t\t<PopoverContent className={cn('p-0', className)} style={{ width }} {...props}>\n\t\t\t<Command>{children}</Command>\n\t\t</PopoverContent>\n\t);\n};\n\nexport type TagsInputProps = ComponentProps<typeof CommandInput>;\n\nexport const TagsInput = ({ className, ...props }: TagsInputProps) => (\n\t<CommandInput className={cn('h-9', className)} {...props} />\n);\n\nexport type TagsListProps = ComponentProps<typeof CommandList>;\n\nexport const TagsList = ({ className, ...props }: TagsListProps) => (\n\t<CommandList className={cn('max-h-[200px]', className)} {...props} />\n);\n\nexport type TagsEmptyProps = ComponentProps<typeof CommandEmpty>;\n\nexport const TagsEmpty = ({ children, className: _className, ...props }: TagsEmptyProps) => (\n\t<CommandEmpty {...props}>{children ?? 'No tags found.'}</CommandEmpty>\n);\n\nexport type TagsGroupProps = ComponentProps<typeof CommandGroup>;\n\nexport const TagsGroup = CommandGroup;\n\nexport type TagsItemProps = ComponentProps<typeof CommandItem>;\n\nexport const TagsItem = ({ className, ...props }: TagsItemProps) => (\n\t<CommandItem className={cn('cursor-pointer items-center justify-between', className)} {...props} />\n);\n"]}
|