@pixpilot/shadcn 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.cjs +25 -1
- package/dist/components/index.cjs +30 -1
- package/dist/components/index.js +30 -1
- package/dist/components/ui/OrContinueWithSeparator.cjs +30 -1
- package/dist/components/ui/OrContinueWithSeparator.js +27 -1
- package/dist/components/ui/alert-dialog.cjs +101 -1
- package/dist/components/ui/alert-dialog.js +87 -1
- package/dist/components/ui/alert.cjs +45 -1
- package/dist/components/ui/alert.d.cts +4 -4
- package/dist/components/ui/alert.js +39 -1
- package/dist/components/ui/avatar.cjs +37 -1
- package/dist/components/ui/avatar.js +31 -1
- package/dist/components/ui/badge.cjs +33 -1
- package/dist/components/ui/badge.js +27 -1
- package/dist/components/ui/button.cjs +52 -1
- package/dist/components/ui/button.js +46 -1
- package/dist/components/ui/calendar.cjs +113 -1
- package/dist/components/ui/calendar.js +107 -1
- package/dist/components/ui/card.cjs +67 -1
- package/dist/components/ui/card.js +58 -1
- package/dist/components/ui/checkbox.cjs +31 -1
- package/dist/components/ui/checkbox.js +26 -1
- package/dist/components/ui/command.cjs +104 -1
- package/dist/components/ui/command.js +91 -1
- package/dist/components/ui/dialog.cjs +102 -1
- package/dist/components/ui/dialog.js +88 -1
- package/dist/components/ui/dropdown-menu.cjs +144 -1
- package/dist/components/ui/dropdown-menu.js +125 -1
- package/dist/components/ui/file-upload.cjs +926 -1
- package/dist/components/ui/file-upload.js +910 -1
- package/dist/components/ui/form.cjs +101 -1
- package/dist/components/ui/form.js +89 -1
- package/dist/components/ui/index.cjs +29 -1
- package/dist/components/ui/index.js +29 -1
- package/dist/components/ui/input.cjs +20 -1
- package/dist/components/ui/input.js +17 -1
- package/dist/components/ui/label.cjs +21 -1
- package/dist/components/ui/label.js +17 -1
- package/dist/components/ui/pagination.cjs +92 -1
- package/dist/components/ui/pagination.js +82 -1
- package/dist/components/ui/popover.cjs +44 -1
- package/dist/components/ui/popover.js +37 -1
- package/dist/components/ui/radio-group.cjs +36 -1
- package/dist/components/ui/radio-group.js +30 -1
- package/dist/components/ui/select.cjs +116 -1
- package/dist/components/ui/select.js +102 -1
- package/dist/components/ui/separator.cjs +23 -1
- package/dist/components/ui/separator.js +19 -1
- package/dist/components/ui/shadcn-io/tags/index.cjs +146 -1
- package/dist/components/ui/shadcn-io/tags/index.js +134 -1
- package/dist/components/ui/shadcn-io/tags-input-inline/index.cjs +66 -1
- package/dist/components/ui/shadcn-io/tags-input-inline/index.js +57 -1
- package/dist/components/ui/sheet.cjs +96 -1
- package/dist/components/ui/sheet.js +84 -1
- package/dist/components/ui/slider.cjs +42 -1
- package/dist/components/ui/slider.js +38 -1
- package/dist/components/ui/switch.cjs +28 -1
- package/dist/components/ui/switch.js +24 -1
- package/dist/components/ui/tabs.cjs +45 -1
- package/dist/components/ui/tabs.js +38 -1
- package/dist/components/ui/textarea.cjs +19 -1
- package/dist/components/ui/textarea.js +16 -1
- package/dist/components/ui/tooltip.cjs +45 -1
- package/dist/components/ui/tooltip.d.cts +5 -5
- package/dist/components/ui/tooltip.js +38 -1
- package/dist/index.cjs +189 -1
- package/dist/index.js +34 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/utils.cjs +13 -1
- package/dist/lib/utils.js +10 -1
- package/package.json +1 -1
|
@@ -1 +1,36 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
3
|
+
require('../../lib/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
let lucide_react = require("lucide-react");
|
|
9
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
10
|
+
let __radix_ui_react_radio_group = require("@radix-ui/react-radio-group");
|
|
11
|
+
__radix_ui_react_radio_group = require_rolldown_runtime.__toESM(__radix_ui_react_radio_group);
|
|
12
|
+
|
|
13
|
+
//#region src/components/ui/radio-group.tsx
|
|
14
|
+
function RadioGroup({ className,...props }) {
|
|
15
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_radio_group.Root, {
|
|
16
|
+
"data-slot": "radio-group",
|
|
17
|
+
className: require_utils.cn("grid gap-3", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function RadioGroupItem({ className,...props }) {
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_radio_group.Item, {
|
|
23
|
+
"data-slot": "radio-group-item",
|
|
24
|
+
className: require_utils.cn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
25
|
+
...props,
|
|
26
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_radio_group.Indicator, {
|
|
27
|
+
"data-slot": "radio-group-indicator",
|
|
28
|
+
className: "relative flex items-center justify-center",
|
|
29
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.RadioGroup = RadioGroup;
|
|
36
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
import{cn
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "../../lib/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { CircleIcon } from "lucide-react";
|
|
6
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
7
|
+
|
|
8
|
+
//#region src/components/ui/radio-group.tsx
|
|
9
|
+
function RadioGroup({ className,...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
11
|
+
"data-slot": "radio-group",
|
|
12
|
+
className: cn("grid gap-3", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function RadioGroupItem({ className,...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
18
|
+
"data-slot": "radio-group-item",
|
|
19
|
+
className: cn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
22
|
+
"data-slot": "radio-group-indicator",
|
|
23
|
+
className: "relative flex items-center justify-center",
|
|
24
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -1 +1,116 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
6
|
+
require('../../lib/index.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
11
|
+
let lucide_react = require("lucide-react");
|
|
12
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
13
|
+
let __radix_ui_react_select = require("@radix-ui/react-select");
|
|
14
|
+
__radix_ui_react_select = require_rolldown_runtime.__toESM(__radix_ui_react_select);
|
|
15
|
+
|
|
16
|
+
//#region src/components/ui/select.tsx
|
|
17
|
+
function Select({ ...props }) {
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Root, {
|
|
19
|
+
"data-slot": "select",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function SelectGroup({ ...props }) {
|
|
24
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Group, {
|
|
25
|
+
"data-slot": "select-group",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function SelectValue({ ...props }) {
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Value, {
|
|
31
|
+
"data-slot": "select-value",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function SelectTrigger({ className, size = "default", children,...props }) {
|
|
36
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__radix_ui_react_select.Trigger, {
|
|
37
|
+
"data-slot": "select-trigger",
|
|
38
|
+
"data-size": size,
|
|
39
|
+
className: require_utils.cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
40
|
+
...props,
|
|
41
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Icon, {
|
|
42
|
+
asChild: true,
|
|
43
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function SelectContent({ className, children, position = "popper", align = "center",...props }) {
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__radix_ui_react_select.Content, {
|
|
49
|
+
"data-slot": "select-content",
|
|
50
|
+
className: require_utils.cn("bg-popover text-popover-foreground 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-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
51
|
+
position,
|
|
52
|
+
align,
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollUpButton, {}),
|
|
56
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Viewport, {
|
|
57
|
+
className: require_utils.cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
58
|
+
children
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectScrollDownButton, {})
|
|
61
|
+
]
|
|
62
|
+
}) });
|
|
63
|
+
}
|
|
64
|
+
function SelectLabel({ className,...props }) {
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Label, {
|
|
66
|
+
"data-slot": "select-label",
|
|
67
|
+
className: require_utils.cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function SelectItem({ className, children,...props }) {
|
|
72
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__radix_ui_react_select.Item, {
|
|
73
|
+
"data-slot": "select-item",
|
|
74
|
+
className: require_utils.cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
75
|
+
...props,
|
|
76
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
77
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
78
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckIcon, { className: "size-4" }) })
|
|
79
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.ItemText, { children })]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function SelectSeparator({ className,...props }) {
|
|
83
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.Separator, {
|
|
84
|
+
"data-slot": "select-separator",
|
|
85
|
+
className: require_utils.cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function SelectScrollUpButton({ className,...props }) {
|
|
90
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.ScrollUpButton, {
|
|
91
|
+
"data-slot": "select-scroll-up-button",
|
|
92
|
+
className: require_utils.cn("flex cursor-default items-center justify-center py-1", className),
|
|
93
|
+
...props,
|
|
94
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronUpIcon, { className: "size-4" })
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function SelectScrollDownButton({ className,...props }) {
|
|
98
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_select.ScrollDownButton, {
|
|
99
|
+
"data-slot": "select-scroll-down-button",
|
|
100
|
+
className: require_utils.cn("flex cursor-default items-center justify-center py-1", className),
|
|
101
|
+
...props,
|
|
102
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, { className: "size-4" })
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
exports.Select = Select;
|
|
108
|
+
exports.SelectContent = SelectContent;
|
|
109
|
+
exports.SelectGroup = SelectGroup;
|
|
110
|
+
exports.SelectItem = SelectItem;
|
|
111
|
+
exports.SelectLabel = SelectLabel;
|
|
112
|
+
exports.SelectScrollDownButton = SelectScrollDownButton;
|
|
113
|
+
exports.SelectScrollUpButton = SelectScrollUpButton;
|
|
114
|
+
exports.SelectSeparator = SelectSeparator;
|
|
115
|
+
exports.SelectTrigger = SelectTrigger;
|
|
116
|
+
exports.SelectValue = SelectValue;
|
|
@@ -1 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import "../../lib/index.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
9
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
10
|
+
|
|
11
|
+
//#region src/components/ui/select.tsx
|
|
12
|
+
function Select({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
14
|
+
"data-slot": "select",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function SelectGroup({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
20
|
+
"data-slot": "select-group",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function SelectValue({ ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
26
|
+
"data-slot": "select-value",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function SelectTrigger({ className, size = "default", children,...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
32
|
+
"data-slot": "select-trigger",
|
|
33
|
+
"data-size": size,
|
|
34
|
+
className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
35
|
+
...props,
|
|
36
|
+
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
37
|
+
asChild: true,
|
|
38
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function SelectContent({ className, children, position = "popper", align = "center",...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
44
|
+
"data-slot": "select-content",
|
|
45
|
+
className: cn("bg-popover text-popover-foreground 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-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
46
|
+
position,
|
|
47
|
+
align,
|
|
48
|
+
...props,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
51
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
52
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
53
|
+
children
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
56
|
+
]
|
|
57
|
+
}) });
|
|
58
|
+
}
|
|
59
|
+
function SelectLabel({ className,...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
61
|
+
"data-slot": "select-label",
|
|
62
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function SelectItem({ className, children,...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
68
|
+
"data-slot": "select-item",
|
|
69
|
+
className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
70
|
+
...props,
|
|
71
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
73
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
74
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function SelectSeparator({ className,...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
79
|
+
"data-slot": "select-separator",
|
|
80
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function SelectScrollUpButton({ className,...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
86
|
+
"data-slot": "select-scroll-up-button",
|
|
87
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
88
|
+
...props,
|
|
89
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function SelectScrollDownButton({ className,...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
94
|
+
"data-slot": "select-scroll-down-button",
|
|
95
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
96
|
+
...props,
|
|
97
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -1 +1,23 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
3
|
+
require('../../lib/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
let __radix_ui_react_separator = require("@radix-ui/react-separator");
|
|
9
|
+
__radix_ui_react_separator = require_rolldown_runtime.__toESM(__radix_ui_react_separator);
|
|
10
|
+
|
|
11
|
+
//#region src/components/ui/separator.tsx
|
|
12
|
+
function Separator({ className, orientation = "horizontal", decorative = true,...props }) {
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_separator.Root, {
|
|
14
|
+
"data-slot": "separator",
|
|
15
|
+
decorative,
|
|
16
|
+
orientation,
|
|
17
|
+
className: require_utils.cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.Separator = Separator;
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
import{cn
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "../../lib/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
6
|
+
|
|
7
|
+
//#region src/components/ui/separator.tsx
|
|
8
|
+
function Separator({ className, orientation = "horizontal", decorative = true,...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
10
|
+
"data-slot": "separator",
|
|
11
|
+
decorative,
|
|
12
|
+
orientation,
|
|
13
|
+
className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Separator };
|
|
@@ -1 +1,146 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_utils = require('../../../../lib/utils.cjs');
|
|
6
|
+
require('../../../../lib/index.cjs');
|
|
7
|
+
const require_badge = require('../../badge.cjs');
|
|
8
|
+
const require_button = require('../../button.cjs');
|
|
9
|
+
const require_command = require('../../command.cjs');
|
|
10
|
+
const require_popover = require('../../popover.cjs');
|
|
11
|
+
let react = require("react");
|
|
12
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
15
|
+
let lucide_react = require("lucide-react");
|
|
16
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
17
|
+
|
|
18
|
+
//#region src/components/ui/shadcn-io/tags/index.tsx
|
|
19
|
+
const TagsContext = (0, react.createContext)({
|
|
20
|
+
value: void 0,
|
|
21
|
+
setValue: void 0,
|
|
22
|
+
open: false,
|
|
23
|
+
onOpenChange: () => {},
|
|
24
|
+
width: void 0,
|
|
25
|
+
setWidth: void 0
|
|
26
|
+
});
|
|
27
|
+
function useTagsContext() {
|
|
28
|
+
const context = (0, react.use)(TagsContext);
|
|
29
|
+
if (!context) throw new Error("useTagsContext must be used within a TagsProvider");
|
|
30
|
+
return context;
|
|
31
|
+
}
|
|
32
|
+
function Tags({ value, setValue, open: controlledOpen, onOpenChange: controlledOnOpenChange, children, className }) {
|
|
33
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(false);
|
|
34
|
+
const [width, setWidth] = (0, react.useState)();
|
|
35
|
+
const ref = (0, react.useRef)(null);
|
|
36
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
37
|
+
const onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;
|
|
38
|
+
(0, react.useEffect)(() => {
|
|
39
|
+
if (!ref.current) return;
|
|
40
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
41
|
+
if (entries[0]) setWidth(entries[0].contentRect.width);
|
|
42
|
+
});
|
|
43
|
+
resizeObserver.observe(ref.current);
|
|
44
|
+
return () => {
|
|
45
|
+
resizeObserver.disconnect();
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TagsContext.Provider, {
|
|
49
|
+
value: {
|
|
50
|
+
value,
|
|
51
|
+
setValue,
|
|
52
|
+
open,
|
|
53
|
+
onOpenChange,
|
|
54
|
+
width,
|
|
55
|
+
setWidth
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.Popover, {
|
|
58
|
+
onOpenChange,
|
|
59
|
+
open,
|
|
60
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
61
|
+
className: require_utils.cn("relative w-full", className),
|
|
62
|
+
ref,
|
|
63
|
+
children
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function TagsTrigger({ className, children,...props }) {
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.PopoverTrigger, {
|
|
70
|
+
asChild: true,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
72
|
+
className: require_utils.cn("h-auto w-full justify-between p-2", className),
|
|
73
|
+
role: "combobox",
|
|
74
|
+
variant: "outline",
|
|
75
|
+
...props,
|
|
76
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
77
|
+
className: "flex flex-wrap items-center gap-1",
|
|
78
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
79
|
+
className: "px-2 py-px text-muted-foreground",
|
|
80
|
+
children: "Select a tag..."
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function TagsValue({ className, children, onRemove,...props }) {
|
|
87
|
+
const handleRemove = (event) => {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
onRemove?.();
|
|
91
|
+
};
|
|
92
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_badge.Badge, {
|
|
93
|
+
className: require_utils.cn("flex items-center gap-2", className),
|
|
94
|
+
...props,
|
|
95
|
+
children: [children, onRemove && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
96
|
+
className: "size-auto cursor-pointer hover:text-muted-foreground",
|
|
97
|
+
onClick: handleRemove,
|
|
98
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon, { size: 12 })
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function TagsContent({ className, children,...props }) {
|
|
103
|
+
const { width } = useTagsContext();
|
|
104
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_popover.PopoverContent, {
|
|
105
|
+
className: require_utils.cn("p-0", className),
|
|
106
|
+
style: { width },
|
|
107
|
+
...props,
|
|
108
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.Command, { children })
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function TagsInput({ className,...props }) {
|
|
112
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandInput, {
|
|
113
|
+
className: require_utils.cn("h-9", className),
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function TagsList({ className,...props }) {
|
|
118
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandList, {
|
|
119
|
+
className: require_utils.cn("max-h-[200px]", className),
|
|
120
|
+
...props
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function TagsEmpty({ children, className,...props }) {
|
|
124
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandEmpty, {
|
|
125
|
+
...props,
|
|
126
|
+
children: children ?? "No tags found."
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
const TagsGroup = require_command.CommandGroup;
|
|
130
|
+
function TagsItem({ className,...props }) {
|
|
131
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_command.CommandItem, {
|
|
132
|
+
className: require_utils.cn("cursor-pointer items-center justify-between", className),
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
exports.Tags = Tags;
|
|
139
|
+
exports.TagsContent = TagsContent;
|
|
140
|
+
exports.TagsEmpty = TagsEmpty;
|
|
141
|
+
exports.TagsGroup = TagsGroup;
|
|
142
|
+
exports.TagsInput = TagsInput;
|
|
143
|
+
exports.TagsItem = TagsItem;
|
|
144
|
+
exports.TagsList = TagsList;
|
|
145
|
+
exports.TagsTrigger = TagsTrigger;
|
|
146
|
+
exports.TagsValue = TagsValue;
|
|
@@ -1 +1,134 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../../lib/utils.js";
|
|
5
|
+
import "../../../../lib/index.js";
|
|
6
|
+
import { Badge } from "../../badge.js";
|
|
7
|
+
import { Button } from "../../button.js";
|
|
8
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "../../command.js";
|
|
9
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover.js";
|
|
10
|
+
import { createContext, use, useEffect, useRef, useState } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { XIcon } from "lucide-react";
|
|
13
|
+
|
|
14
|
+
//#region src/components/ui/shadcn-io/tags/index.tsx
|
|
15
|
+
const TagsContext = createContext({
|
|
16
|
+
value: void 0,
|
|
17
|
+
setValue: void 0,
|
|
18
|
+
open: false,
|
|
19
|
+
onOpenChange: () => {},
|
|
20
|
+
width: void 0,
|
|
21
|
+
setWidth: void 0
|
|
22
|
+
});
|
|
23
|
+
function useTagsContext() {
|
|
24
|
+
const context = use(TagsContext);
|
|
25
|
+
if (!context) throw new Error("useTagsContext must be used within a TagsProvider");
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
function Tags({ value, setValue, open: controlledOpen, onOpenChange: controlledOnOpenChange, children, className }) {
|
|
29
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
|
|
30
|
+
const [width, setWidth] = useState();
|
|
31
|
+
const ref = useRef(null);
|
|
32
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
33
|
+
const onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!ref.current) return;
|
|
36
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
37
|
+
if (entries[0]) setWidth(entries[0].contentRect.width);
|
|
38
|
+
});
|
|
39
|
+
resizeObserver.observe(ref.current);
|
|
40
|
+
return () => {
|
|
41
|
+
resizeObserver.disconnect();
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
return /* @__PURE__ */ jsx(TagsContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
value,
|
|
47
|
+
setValue,
|
|
48
|
+
open,
|
|
49
|
+
onOpenChange,
|
|
50
|
+
width,
|
|
51
|
+
setWidth
|
|
52
|
+
},
|
|
53
|
+
children: /* @__PURE__ */ jsx(Popover, {
|
|
54
|
+
onOpenChange,
|
|
55
|
+
open,
|
|
56
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: cn("relative w-full", className),
|
|
58
|
+
ref,
|
|
59
|
+
children
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function TagsTrigger({ className, children,...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
66
|
+
asChild: true,
|
|
67
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
68
|
+
className: cn("h-auto w-full justify-between p-2", className),
|
|
69
|
+
role: "combobox",
|
|
70
|
+
variant: "outline",
|
|
71
|
+
...props,
|
|
72
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "flex flex-wrap items-center gap-1",
|
|
74
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: "px-2 py-px text-muted-foreground",
|
|
76
|
+
children: "Select a tag..."
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function TagsValue({ className, children, onRemove,...props }) {
|
|
83
|
+
const handleRemove = (event) => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
event.stopPropagation();
|
|
86
|
+
onRemove?.();
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ jsxs(Badge, {
|
|
89
|
+
className: cn("flex items-center gap-2", className),
|
|
90
|
+
...props,
|
|
91
|
+
children: [children, onRemove && /* @__PURE__ */ jsx("div", {
|
|
92
|
+
className: "size-auto cursor-pointer hover:text-muted-foreground",
|
|
93
|
+
onClick: handleRemove,
|
|
94
|
+
children: /* @__PURE__ */ jsx(XIcon, { size: 12 })
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function TagsContent({ className, children,...props }) {
|
|
99
|
+
const { width } = useTagsContext();
|
|
100
|
+
return /* @__PURE__ */ jsx(PopoverContent, {
|
|
101
|
+
className: cn("p-0", className),
|
|
102
|
+
style: { width },
|
|
103
|
+
...props,
|
|
104
|
+
children: /* @__PURE__ */ jsx(Command, { children })
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function TagsInput({ className,...props }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(CommandInput, {
|
|
109
|
+
className: cn("h-9", className),
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function TagsList({ className,...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx(CommandList, {
|
|
115
|
+
className: cn("max-h-[200px]", className),
|
|
116
|
+
...props
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function TagsEmpty({ children, className,...props }) {
|
|
120
|
+
return /* @__PURE__ */ jsx(CommandEmpty, {
|
|
121
|
+
...props,
|
|
122
|
+
children: children ?? "No tags found."
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const TagsGroup = CommandGroup;
|
|
126
|
+
function TagsItem({ className,...props }) {
|
|
127
|
+
return /* @__PURE__ */ jsx(CommandItem, {
|
|
128
|
+
className: cn("cursor-pointer items-center justify-between", className),
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
export { Tags, TagsContent, TagsEmpty, TagsGroup, TagsInput, TagsItem, TagsList, TagsTrigger, TagsValue };
|