@codefast/ui 0.0.6 → 0.0.8
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/alert-dialog.js +3 -3
- package/dist/alert-dialog.mjs +1 -1
- package/dist/badge.js +4 -4
- package/dist/badge.js.map +1 -1
- package/dist/badge.mjs +4 -4
- package/dist/badge.mjs.map +1 -1
- package/dist/blockquote.d.mts +7 -0
- package/dist/blockquote.d.ts +7 -0
- package/dist/blockquote.js +13 -0
- package/dist/blockquote.js.map +1 -0
- package/dist/blockquote.mjs +13 -0
- package/dist/blockquote.mjs.map +1 -0
- package/dist/box.d.mts +14 -0
- package/dist/box.d.ts +14 -0
- package/dist/box.js +15 -0
- package/dist/box.js.map +1 -0
- package/dist/box.mjs +15 -0
- package/dist/box.mjs.map +1 -0
- package/dist/button.d.mts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +2 -2
- package/dist/button.mjs +1 -1
- package/dist/calendar.js +3 -3
- package/dist/calendar.mjs +1 -1
- package/dist/carousel.js +3 -3
- package/dist/carousel.mjs +1 -1
- package/dist/chunk-2D7SRYKN.js +135 -0
- package/dist/chunk-2D7SRYKN.js.map +1 -0
- package/dist/chunk-EDVCMWDT.mjs +158 -0
- package/dist/chunk-EDVCMWDT.mjs.map +1 -0
- package/dist/chunk-ESWGFN3R.mjs +135 -0
- package/dist/chunk-ESWGFN3R.mjs.map +1 -0
- package/dist/{chunk-Z524G4RY.mjs → chunk-KW5FJ62U.mjs} +6 -2
- package/dist/chunk-KW5FJ62U.mjs.map +1 -0
- package/dist/chunk-OCLLX7EY.js +158 -0
- package/dist/chunk-OCLLX7EY.js.map +1 -0
- package/dist/{chunk-4K26QLS2.js → chunk-U2WDUCW3.js} +6 -2
- package/dist/chunk-U2WDUCW3.js.map +1 -0
- package/dist/code.d.mts +7 -0
- package/dist/code.d.ts +7 -0
- package/dist/code.js +13 -0
- package/dist/code.js.map +1 -0
- package/dist/code.mjs +13 -0
- package/dist/code.mjs.map +1 -0
- package/dist/container.d.mts +7 -0
- package/dist/container.d.ts +7 -0
- package/dist/container.js +17 -0
- package/dist/container.js.map +1 -0
- package/dist/container.mjs +17 -0
- package/dist/container.mjs.map +1 -0
- package/dist/data-table.d.mts +16 -0
- package/dist/data-table.d.ts +16 -0
- package/dist/data-table.js +255 -0
- package/dist/data-table.js.map +1 -0
- package/dist/data-table.mjs +255 -0
- package/dist/data-table.mjs.map +1 -0
- package/dist/dropdown-menu.js +34 -157
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/dropdown-menu.mjs +16 -139
- package/dist/dropdown-menu.mjs.map +1 -1
- package/dist/em.d.mts +7 -0
- package/dist/em.d.ts +7 -0
- package/dist/em.js +13 -0
- package/dist/em.js.map +1 -0
- package/dist/em.mjs +13 -0
- package/dist/em.mjs.map +1 -0
- package/dist/heading.d.mts +8 -0
- package/dist/heading.d.ts +8 -0
- package/dist/heading.js +13 -0
- package/dist/heading.js.map +1 -0
- package/dist/heading.mjs +13 -0
- package/dist/heading.mjs.map +1 -0
- package/dist/input-otp.d.mts +2 -2
- package/dist/input-otp.d.ts +2 -2
- package/dist/input.d.mts +58 -1
- package/dist/input.d.ts +58 -1
- package/dist/input.js +17 -6
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +18 -7
- package/dist/input.mjs.map +1 -1
- package/dist/kbd.d.mts +7 -0
- package/dist/kbd.d.ts +7 -0
- package/dist/kbd.js +27 -0
- package/dist/kbd.js.map +1 -0
- package/dist/kbd.mjs +27 -0
- package/dist/kbd.mjs.map +1 -0
- package/dist/pagination.js +2 -2
- package/dist/pagination.mjs +1 -1
- package/dist/pre.d.mts +7 -0
- package/dist/pre.d.ts +7 -0
- package/dist/pre.js +13 -0
- package/dist/pre.js.map +1 -0
- package/dist/pre.mjs +13 -0
- package/dist/pre.mjs.map +1 -0
- package/dist/quote.d.mts +7 -0
- package/dist/quote.d.ts +7 -0
- package/dist/quote.js +13 -0
- package/dist/quote.js.map +1 -0
- package/dist/quote.mjs +13 -0
- package/dist/quote.mjs.map +1 -0
- package/dist/section.d.mts +7 -0
- package/dist/section.d.ts +7 -0
- package/dist/section.js +13 -0
- package/dist/section.js.map +1 -0
- package/dist/section.mjs +13 -0
- package/dist/section.mjs.map +1 -0
- package/dist/select.js +26 -134
- package/dist/select.js.map +1 -1
- package/dist/select.mjs +12 -120
- package/dist/select.mjs.map +1 -1
- package/dist/sheet.d.mts +1 -1
- package/dist/sheet.d.ts +1 -1
- package/dist/strong.d.mts +7 -0
- package/dist/strong.d.ts +7 -0
- package/dist/strong.js +13 -0
- package/dist/strong.js.map +1 -0
- package/dist/strong.mjs +13 -0
- package/dist/strong.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/table.js +2 -5
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +2 -5
- package/dist/table.mjs.map +1 -1
- package/dist/text.d.mts +14 -0
- package/dist/text.d.ts +14 -0
- package/dist/text.js +15 -0
- package/dist/text.js.map +1 -0
- package/dist/text.mjs +15 -0
- package/dist/text.mjs.map +1 -0
- package/package.json +69 -3
- package/src/badge.tsx +4 -6
- package/src/blockquote.tsx +24 -0
- package/src/box.tsx +33 -0
- package/src/button.tsx +4 -0
- package/src/code.tsx +22 -0
- package/src/container.tsx +25 -0
- package/src/data-table.tsx +255 -0
- package/src/em.tsx +22 -0
- package/src/heading.tsx +25 -0
- package/src/input.tsx +26 -8
- package/src/kbd.tsx +32 -0
- package/src/pre.tsx +22 -0
- package/src/quote.tsx +22 -0
- package/src/section.tsx +24 -0
- package/src/strong.tsx +22 -0
- package/src/table.tsx +2 -5
- package/src/text.tsx +34 -0
- package/dist/chunk-4K26QLS2.js.map +0 -1
- package/dist/chunk-Z524G4RY.mjs.map +0 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-UG3URV2Z.mjs";
|
|
4
|
+
|
|
5
|
+
// src/dropdown-menu.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
8
|
+
import {
|
|
9
|
+
CheckIcon,
|
|
10
|
+
ChevronRightIcon,
|
|
11
|
+
DotFilledIcon
|
|
12
|
+
} from "@radix-ui/react-icons";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
15
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
16
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
17
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
18
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
19
|
+
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
20
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: cn(
|
|
24
|
+
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",
|
|
25
|
+
inset && "pl-8",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
36
|
+
var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
37
|
+
DropdownMenuPrimitive.SubContent,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: cn(
|
|
41
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
) }));
|
|
47
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
48
|
+
var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
49
|
+
DropdownMenuPrimitive.Content,
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
sideOffset,
|
|
53
|
+
className: cn(
|
|
54
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
) }));
|
|
60
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
61
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
+
DropdownMenuPrimitive.Item,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: cn(
|
|
66
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
67
|
+
inset && "pl-8",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
74
|
+
var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
75
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: cn(
|
|
79
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
checked,
|
|
83
|
+
...props,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
86
|
+
children
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
91
|
+
var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
92
|
+
DropdownMenuPrimitive.RadioItem,
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
className: cn(
|
|
96
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotFilledIcon, { className: "size-4 fill-current" }) }) }),
|
|
102
|
+
children
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
));
|
|
106
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
107
|
+
var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
108
|
+
DropdownMenuPrimitive.Label,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
className: cn(
|
|
112
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
113
|
+
inset && "pl-8",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
120
|
+
var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
121
|
+
DropdownMenuPrimitive.Separator,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: cn("bg-muted -mx-1 my-1 h-px", className),
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
));
|
|
128
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
129
|
+
function DropdownMenuShortcut({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
"span",
|
|
135
|
+
{
|
|
136
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
DropdownMenu,
|
|
144
|
+
DropdownMenuTrigger,
|
|
145
|
+
DropdownMenuGroup,
|
|
146
|
+
DropdownMenuSub,
|
|
147
|
+
DropdownMenuRadioGroup,
|
|
148
|
+
DropdownMenuSubTrigger,
|
|
149
|
+
DropdownMenuSubContent,
|
|
150
|
+
DropdownMenuContent,
|
|
151
|
+
DropdownMenuItem,
|
|
152
|
+
DropdownMenuCheckboxItem,
|
|
153
|
+
DropdownMenuRadioItem,
|
|
154
|
+
DropdownMenuLabel,
|
|
155
|
+
DropdownMenuSeparator,
|
|
156
|
+
DropdownMenuShortcut
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=chunk-EDVCMWDT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuPrimitive.DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuPrimitive.DropdownMenuContentProps\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuPrimitive.DropdownMenuItemProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuPrimitive.DropdownMenuCheckboxItemProps\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuPrimitive.DropdownMenuRadioItemProps\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuPrimitive.DropdownMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuPrimitive.DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-muted -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-UG3URV2Z.mjs";
|
|
4
|
+
|
|
5
|
+
// src/select.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import {
|
|
8
|
+
CaretSortIcon,
|
|
9
|
+
CheckIcon,
|
|
10
|
+
ChevronDownIcon,
|
|
11
|
+
ChevronUpIcon
|
|
12
|
+
} from "@radix-ui/react-icons";
|
|
13
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var Select = SelectPrimitive.Root;
|
|
16
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
17
|
+
var SelectValue = SelectPrimitive.Value;
|
|
18
|
+
var SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
19
|
+
SelectPrimitive.Trigger,
|
|
20
|
+
{
|
|
21
|
+
ref,
|
|
22
|
+
className: cn(
|
|
23
|
+
"border-input placeholder:text-muted-foreground focus:ring-offset-background focus:ring-ring flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
children,
|
|
29
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(CaretSortIcon, { className: "size-4 opacity-50" }) })
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
34
|
+
var SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
35
|
+
SelectPrimitive.ScrollUpButton,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
className: cn(
|
|
39
|
+
"flex cursor-default items-center justify-center py-1",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props,
|
|
43
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
47
|
+
var SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
48
|
+
SelectPrimitive.ScrollDownButton,
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
className: cn(
|
|
52
|
+
"flex cursor-default items-center justify-center py-1",
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...props,
|
|
56
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
57
|
+
}
|
|
58
|
+
));
|
|
59
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
60
|
+
var SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
61
|
+
SelectPrimitive.Content,
|
|
62
|
+
{
|
|
63
|
+
ref,
|
|
64
|
+
className: cn(
|
|
65
|
+
"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-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",
|
|
66
|
+
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",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
position,
|
|
70
|
+
...props,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
SelectPrimitive.Viewport,
|
|
75
|
+
{
|
|
76
|
+
className: cn(
|
|
77
|
+
"p-1",
|
|
78
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
79
|
+
),
|
|
80
|
+
children
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) }));
|
|
87
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
88
|
+
var SelectLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
89
|
+
SelectPrimitive.Label,
|
|
90
|
+
{
|
|
91
|
+
ref,
|
|
92
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
));
|
|
96
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
97
|
+
var SelectItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
98
|
+
SelectPrimitive.Item,
|
|
99
|
+
{
|
|
100
|
+
ref,
|
|
101
|
+
className: cn(
|
|
102
|
+
"focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
103
|
+
className
|
|
104
|
+
),
|
|
105
|
+
...props,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
108
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
));
|
|
112
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
113
|
+
var SelectSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
114
|
+
SelectPrimitive.Separator,
|
|
115
|
+
{
|
|
116
|
+
ref,
|
|
117
|
+
className: cn("bg-muted -mx-1 my-1 h-px", className),
|
|
118
|
+
...props
|
|
119
|
+
}
|
|
120
|
+
));
|
|
121
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
Select,
|
|
125
|
+
SelectGroup,
|
|
126
|
+
SelectValue,
|
|
127
|
+
SelectTrigger,
|
|
128
|
+
SelectScrollUpButton,
|
|
129
|
+
SelectScrollDownButton,
|
|
130
|
+
SelectContent,
|
|
131
|
+
SelectLabel,
|
|
132
|
+
SelectItem,
|
|
133
|
+
SelectSeparator
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=chunk-ESWGFN3R.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/select.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Select\n * -------------------------------------------------------------------------- */\n\nconst Select = SelectPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectGroup\n * -------------------------------------------------------------------------- */\n\nconst SelectGroup = SelectPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectValue\n * -------------------------------------------------------------------------- */\n\nconst SelectValue = SelectPrimitive.Value;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectTrigger\n * -------------------------------------------------------------------------- */\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n SelectPrimitive.SelectTriggerProps\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"border-input placeholder:text-muted-foreground focus:ring-offset-background focus:ring-ring flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border bg-transparent px-3 text-sm shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretSortIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollUpButton\n * -------------------------------------------------------------------------- */\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n SelectPrimitive.SelectScrollUpButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectScrollDownButton\n * -------------------------------------------------------------------------- */\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n SelectPrimitive.SelectScrollDownButtonProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectContent\n * -------------------------------------------------------------------------- */\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n SelectPrimitive.SelectContentProps\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"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-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectLabel\n * -------------------------------------------------------------------------- */\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n SelectPrimitive.SelectLabelProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectItem\n * -------------------------------------------------------------------------- */\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n SelectPrimitive.SelectItemProps\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: SelectSeparator\n * -------------------------------------------------------------------------- */\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n SelectPrimitive.SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"bg-muted -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,YAAY,qBAAqB;AA6B/B,SAUI,KAVJ;AAtBF,IAAM,SAAyB;AAM/B,IAAM,cAA8B;AAMpC,IAAM,cAA8B;AAMpC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEH;AAAA;AAAA,MACD,oBAAiB,sBAAhB,EAAqB,SAAO,MAC3B,8BAAC,iBAAc,WAAU,qBAAoB,GAC/C;AAAA;AAAA;AACF,CACD;AACD,cAAc,cAA8B,wBAAQ;AAMpD,IAAM,uBAA6B,iBAGjC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ,8BAAC,iBAAc;AAAA;AACjB,CACD;AACD,qBAAqB,cAA8B,+BAAe;AAMlE,IAAM,yBAA+B,iBAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ,8BAAC,mBAAgB;AAAA;AACnB,CACD;AACD,uBAAuB,cACL,iCAAiB;AAMnC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,WAAW,UAAU,GAAG,MAAM,GAAG,QACzD,oBAAiB,wBAAhB,EACC;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,aAAa,YACX;AAAA,MACF;AAAA,IACF;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,0BAAC,wBAAqB;AAAA,MACtB;AAAA,QAAiB;AAAA,QAAhB;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,aAAa,YACX;AAAA,UACJ;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,MACA,oBAAC,0BAAuB;AAAA;AAAA;AAC1B,GACF,CACD;AACD,cAAc,cAA8B,wBAAQ;AAMpD,IAAM,cAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qCAAqC,SAAS;AAAA,IAC3D,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAA8B,sBAAM;AAMhD,IAAM,aAAmB,iBAGvB,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,0BAAC,UAAK,WAAU,8DACd,8BAAiB,+BAAhB,EACC,8BAAC,aAAU,WAAU,UAAS,GAChC,GACF;AAAA,MACA,oBAAiB,0BAAhB,EAA0B,UAAS;AAAA;AAAA;AACtC,CACD;AACD,WAAW,cAA8B,qBAAK;AAM9C,IAAM,kBAAwB,iBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAiB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,4BAA4B,SAAS;AAAA,IAClD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAA8B,0BAAU;","names":[]}
|
|
@@ -19,9 +19,13 @@ var buttonVariants = cva({
|
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
21
|
default: "h-10 px-4",
|
|
22
|
+
xs: "h-8 px-2",
|
|
22
23
|
sm: "h-9 px-3",
|
|
23
24
|
lg: "h-11 px-8",
|
|
24
|
-
icon: "size-10"
|
|
25
|
+
icon: "size-10",
|
|
26
|
+
"icon-xs": "size-8",
|
|
27
|
+
"icon-sm": "size-9",
|
|
28
|
+
"icon-lg": "size-11"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
defaultVariants: {
|
|
@@ -49,4 +53,4 @@ export {
|
|
|
49
53
|
buttonVariants,
|
|
50
54
|
Button
|
|
51
55
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-KW5FJ62U.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = cva({\n base: \"focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n outline:\n \"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm\",\n },\n size: {\n default: \"h-10 px-4\",\n xs: \"h-8 px-2\",\n sm: \"h-9 px-3\",\n lg: \"h-11 px-8\",\n icon: \"size-10\",\n \"icon-xs\": \"size-8\",\n \"icon-sm\": \"size-9\",\n \"icon-lg\": \"size-11\",\n },\n },\n defaultVariants: {\n size: \"default\",\n variant: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : \"button\"}\n className={buttonVariants({ variant, size, className })}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAsDf;AA9CN,IAAM,iBAAiB,IAAI;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aACE;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SACE;AAAA,MACF,WACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF,CAAC;AAYD,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,UAAU,SAAY;AAAA,QAC5B,WAAW,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC;AAAA,QACrD,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
|
|
2
|
+
|
|
3
|
+
var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
|
|
4
|
+
|
|
5
|
+
// src/dropdown-menu.tsx
|
|
6
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
7
|
+
var _reactdropdownmenu = require('@radix-ui/react-dropdown-menu'); var DropdownMenuPrimitive = _interopRequireWildcard(_reactdropdownmenu);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _reacticons = require('@radix-ui/react-icons');
|
|
13
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
14
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
15
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
16
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
17
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
18
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
19
|
+
var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
20
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
24
|
+
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",
|
|
25
|
+
inset && "pl-8",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
children,
|
|
31
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon, { className: "ml-auto size-4" })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
36
|
+
var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
37
|
+
DropdownMenuPrimitive.SubContent,
|
|
38
|
+
{
|
|
39
|
+
ref,
|
|
40
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
41
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
) }));
|
|
47
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
48
|
+
var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
49
|
+
DropdownMenuPrimitive.Content,
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
sideOffset,
|
|
53
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
54
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
) }));
|
|
60
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
61
|
+
var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
62
|
+
DropdownMenuPrimitive.Item,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
66
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
67
|
+
inset && "pl-8",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
74
|
+
var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
75
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
79
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
checked,
|
|
83
|
+
...props,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CheckIcon, { className: "size-4" }) }) }),
|
|
86
|
+
children
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
91
|
+
var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
92
|
+
DropdownMenuPrimitive.RadioItem,
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
96
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon, { className: "size-4 fill-current" }) }) }),
|
|
102
|
+
children
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
));
|
|
106
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
107
|
+
var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
108
|
+
DropdownMenuPrimitive.Label,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
112
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
113
|
+
inset && "pl-8",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
120
|
+
var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
121
|
+
DropdownMenuPrimitive.Separator,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "bg-muted -mx-1 my-1 h-px", className),
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
));
|
|
128
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
129
|
+
function DropdownMenuShortcut({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
134
|
+
"span",
|
|
135
|
+
{
|
|
136
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "ml-auto text-xs tracking-widest opacity-60", className),
|
|
137
|
+
...props
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
exports.DropdownMenu = DropdownMenu; exports.DropdownMenuTrigger = DropdownMenuTrigger; exports.DropdownMenuGroup = DropdownMenuGroup; exports.DropdownMenuSub = DropdownMenuSub; exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup; exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger; exports.DropdownMenuSubContent = DropdownMenuSubContent; exports.DropdownMenuContent = DropdownMenuContent; exports.DropdownMenuItem = DropdownMenuItem; exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem; exports.DropdownMenuRadioItem = DropdownMenuRadioItem; exports.DropdownMenuLabel = DropdownMenuLabel; exports.DropdownMenuSeparator = DropdownMenuSeparator; exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
158
|
+
//# sourceMappingURL=chunk-OCLLX7EY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dropdown-menu.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenu\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSub\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n DropdownMenuPrimitive.DropdownMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n DropdownMenuPrimitive.DropdownMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuContent\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuPrimitive.DropdownMenuContentProps\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuPrimitive.DropdownMenuItemProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuPrimitive.DropdownMenuCheckboxItemProps\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n DropdownMenuPrimitive.DropdownMenuRadioItemProps\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuPrimitive.DropdownMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuPrimitive.DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-muted -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DropdownMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"]}
|
|
@@ -19,9 +19,13 @@ var buttonVariants = _chunkG3NP7M2Njs.cva.call(void 0, {
|
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
21
|
default: "h-10 px-4",
|
|
22
|
+
xs: "h-8 px-2",
|
|
22
23
|
sm: "h-9 px-3",
|
|
23
24
|
lg: "h-11 px-8",
|
|
24
|
-
icon: "size-10"
|
|
25
|
+
icon: "size-10",
|
|
26
|
+
"icon-xs": "size-8",
|
|
27
|
+
"icon-sm": "size-9",
|
|
28
|
+
"icon-lg": "size-11"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
defaultVariants: {
|
|
@@ -49,4 +53,4 @@ Button.displayName = "Button";
|
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
exports.buttonVariants = buttonVariants; exports.Button = Button;
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-U2WDUCW3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button.tsx"],"names":[],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAsDf;AA9CN,IAAM,iBAAiB,IAAI;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aACE;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SACE;AAAA,MACF,WACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF,CAAC;AAYD,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,UAAU,SAAY;AAAA,QAC5B,WAAW,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC;AAAA,QACrD,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = cva({\n base: \"focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n outline:\n \"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm\",\n },\n size: {\n default: \"h-10 px-4\",\n xs: \"h-8 px-2\",\n sm: \"h-9 px-3\",\n lg: \"h-11 px-8\",\n icon: \"size-10\",\n \"icon-xs\": \"size-8\",\n \"icon-sm\": \"size-9\",\n \"icon-lg\": \"size-11\",\n },\n },\n defaultVariants: {\n size: \"default\",\n variant: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : \"button\"}\n className={buttonVariants({ variant, size, className })}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps };\n"]}
|
package/dist/code.d.mts
ADDED
package/dist/code.d.ts
ADDED
package/dist/code.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }// src/code.tsx
|
|
2
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
3
|
+
var _reactslot = require('@radix-ui/react-slot');
|
|
4
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
5
|
+
var Code = React.forwardRef(({ asChild, ...props }, ref) => {
|
|
6
|
+
const Comp = asChild ? _reactslot.Slot : "code";
|
|
7
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comp, { ref, ...props });
|
|
8
|
+
});
|
|
9
|
+
Code.displayName = "Code";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.Code = Code;
|
|
13
|
+
//# sourceMappingURL=code.js.map
|
package/dist/code.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/code.tsx"],"names":[],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAYZ;AANT,IAAM,OAAa,iBAGjB,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAChC,QAAM,OAAO,UAAU,OAAO;AAE9B,SAAO,oBAAC,QAAK,KAAW,GAAG,OAAO;AACpC,CAAC;AACD,KAAK,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Code\n * -------------------------------------------------------------------------- */\n\nconst Code = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement> & { asChild?: boolean }\n>(({ asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : \"code\";\n\n return <Comp ref={ref} {...props} />;\n});\nCode.displayName = \"Code\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Code };\n"]}
|