@cryptlex/web-components 1.3.5 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/components/data-table/data-table.es.js +102 -88
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-content.es.js +19 -18
- package/dist/components/data-table/table-content.es.js.map +1 -1
- package/dist/components/data-table/table-filter.es.js +264 -0
- package/dist/components/data-table/table-filter.es.js.map +1 -0
- package/dist/components/data-table/table-utils/constants.es.js +20 -6
- package/dist/components/data-table/table-utils/constants.es.js.map +1 -1
- package/dist/components/data-table/table-utils/link-display.es.js +4 -4
- package/dist/components/data-table/table-utils/link-display.es.js.map +1 -1
- package/dist/components/key-value-card/key-value-card.es.js +4 -2
- package/dist/components/key-value-card/key-value-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +43 -39
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/sidebar/breadcrumb.es.js +58 -0
- package/dist/components/sidebar/breadcrumb.es.js.map +1 -0
- package/dist/components/sidebar/nav-main.es.js +51 -39
- package/dist/components/sidebar/nav-main.es.js.map +1 -1
- package/dist/components/static-data-table/data-table.es.js +5 -5
- package/dist/components/static-data-table/data-table.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +1 -1
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/badge.es.js +1 -1
- package/dist/components/ui/badge.es.js.map +1 -1
- package/dist/components/ui/button.es.js +8 -8
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/calendar.es.js +3 -3
- package/dist/components/ui/chart.es.js +24 -24
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/checkbox.es.js +1 -1
- package/dist/components/ui/checkbox.es.js.map +1 -1
- package/dist/components/ui/command.es.js +28 -28
- package/dist/components/ui/command.es.js.map +1 -1
- package/dist/components/ui/copy-button.es.js +38 -34
- package/dist/components/ui/copy-button.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +8 -8
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/dropdown-menu.es.js +38 -38
- package/dist/components/ui/dropdown-menu.es.js.map +1 -1
- package/dist/components/ui/form.es.js +4 -4
- package/dist/components/ui/input-otp.es.js +2 -2
- package/dist/components/ui/input-otp.es.js.map +1 -1
- package/dist/components/ui/input.es.js +7 -7
- package/dist/components/ui/input.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +13 -13
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/navigation-menu.es.js +3 -3
- package/dist/components/ui/navigation-menu.es.js.map +1 -1
- package/dist/components/ui/pagination.es.js +20 -20
- package/dist/components/ui/password-input.es.js +10 -10
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/popover.es.js +1 -1
- package/dist/components/ui/popover.es.js.map +1 -1
- package/dist/components/ui/radio-group.es.js +7 -7
- package/dist/components/ui/radio-group.es.js.map +1 -1
- package/dist/components/ui/select.es.js +17 -17
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +8 -8
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sidebar.es.js +76 -76
- package/dist/components/ui/sidebar.es.js.map +1 -1
- package/dist/components/ui/table-page-layout.es.js +8 -8
- package/dist/components/ui/table-page-layout.es.js.map +1 -1
- package/dist/components/ui/table.es.js +1 -1
- package/dist/components/ui/table.es.js.map +1 -1
- package/dist/components/ui/tabs.es.js +11 -11
- package/dist/components/ui/tabs.es.js.map +1 -1
- package/dist/index.es.d.ts +12 -7
- package/dist/index.es.js +59 -58
- package/lib/index.css +15 -87
- package/lib/tailwind.preset.css +220 -0
- package/lib/tokens.css +54 -54
- package/package.json +7 -7
- package/tailwind.preset.ts +0 -191
|
@@ -3,14 +3,14 @@ import * as s from "react";
|
|
|
3
3
|
import * as e from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { ChevronRightIcon as c, CheckIcon as m, DotFilledIcon as p } from "@radix-ui/react-icons";
|
|
5
5
|
import { cn as r } from "../../utils/index.es.js";
|
|
6
|
-
const I = e.Root, R = e.Trigger, S = e.Group, C = e.Portal, z = e.Sub, k = e.RadioGroup, u = s.forwardRef(({ className:
|
|
6
|
+
const I = e.Root, R = e.Trigger, S = e.Group, C = e.Portal, z = e.Sub, k = e.RadioGroup, u = s.forwardRef(({ className: t, inset: o, children: a, ...d }, i) => /* @__PURE__ */ l(
|
|
7
7
|
e.SubTrigger,
|
|
8
8
|
{
|
|
9
9
|
ref: i,
|
|
10
10
|
className: r(
|
|
11
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-hidden focus:bg-accent data-[state=open]:bg-accent",
|
|
12
|
+
o && "pl-8",
|
|
13
|
+
t
|
|
14
14
|
),
|
|
15
15
|
...d,
|
|
16
16
|
children: [
|
|
@@ -20,121 +20,121 @@ const I = e.Root, R = e.Trigger, S = e.Group, C = e.Portal, z = e.Sub, k = e.Rad
|
|
|
20
20
|
}
|
|
21
21
|
));
|
|
22
22
|
u.displayName = e.SubTrigger.displayName;
|
|
23
|
-
const f = s.forwardRef(({ className:
|
|
23
|
+
const f = s.forwardRef(({ className: t, ...o }, a) => /* @__PURE__ */ n(
|
|
24
24
|
e.SubContent,
|
|
25
25
|
{
|
|
26
26
|
ref: a,
|
|
27
27
|
className: r(
|
|
28
28
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-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",
|
|
29
|
-
|
|
29
|
+
t
|
|
30
30
|
),
|
|
31
|
-
...
|
|
31
|
+
...o
|
|
32
32
|
}
|
|
33
33
|
));
|
|
34
34
|
f.displayName = e.SubContent.displayName;
|
|
35
|
-
const b = s.forwardRef(({ className:
|
|
35
|
+
const b = s.forwardRef(({ className: t, sideOffset: o = 4, ...a }, d) => /* @__PURE__ */ n(e.Portal, { children: /* @__PURE__ */ n(
|
|
36
36
|
e.Content,
|
|
37
37
|
{
|
|
38
38
|
ref: d,
|
|
39
|
-
sideOffset:
|
|
39
|
+
sideOffset: o,
|
|
40
40
|
className: r(
|
|
41
41
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
42
42
|
"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",
|
|
43
|
-
|
|
43
|
+
t
|
|
44
44
|
),
|
|
45
45
|
...a
|
|
46
46
|
}
|
|
47
47
|
) }));
|
|
48
48
|
b.displayName = e.Content.displayName;
|
|
49
|
-
const w = s.forwardRef(({ className:
|
|
49
|
+
const w = s.forwardRef(({ className: t, inset: o, ...a }, d) => /* @__PURE__ */ n(
|
|
50
50
|
e.Item,
|
|
51
51
|
{
|
|
52
52
|
ref: d,
|
|
53
53
|
className: r(
|
|
54
|
-
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
55
|
+
o && "pl-8",
|
|
56
|
+
t
|
|
57
57
|
),
|
|
58
58
|
...a
|
|
59
59
|
}
|
|
60
60
|
));
|
|
61
61
|
w.displayName = e.Item.displayName;
|
|
62
|
-
const
|
|
62
|
+
const h = s.forwardRef(({ className: t, children: o, checked: a, ...d }, i) => /* @__PURE__ */ l(
|
|
63
63
|
e.CheckboxItem,
|
|
64
64
|
{
|
|
65
65
|
ref: i,
|
|
66
66
|
className: r(
|
|
67
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-
|
|
68
|
-
|
|
67
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
68
|
+
t
|
|
69
69
|
),
|
|
70
70
|
checked: a,
|
|
71
71
|
...d,
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(m, { className: "h-4 w-4" }) }) }),
|
|
74
|
-
|
|
74
|
+
o
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
77
|
));
|
|
78
|
-
|
|
79
|
-
const
|
|
78
|
+
h.displayName = e.CheckboxItem.displayName;
|
|
79
|
+
const y = s.forwardRef(({ className: t, children: o, ...a }, d) => /* @__PURE__ */ l(
|
|
80
80
|
e.RadioItem,
|
|
81
81
|
{
|
|
82
82
|
ref: d,
|
|
83
83
|
className: r(
|
|
84
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-
|
|
85
|
-
|
|
84
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
85
|
+
t
|
|
86
86
|
),
|
|
87
87
|
...a,
|
|
88
88
|
children: [
|
|
89
89
|
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(p, { className: "h-4 w-4 fill-current" }) }) }),
|
|
90
|
-
|
|
90
|
+
o
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
));
|
|
94
|
-
|
|
95
|
-
const
|
|
94
|
+
y.displayName = e.RadioItem.displayName;
|
|
95
|
+
const g = s.forwardRef(({ className: t, inset: o, ...a }, d) => /* @__PURE__ */ n(
|
|
96
96
|
e.Label,
|
|
97
97
|
{
|
|
98
98
|
ref: d,
|
|
99
99
|
className: r(
|
|
100
100
|
"px-2 py-1.5 text-body font-semibold",
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
o && "pl-8",
|
|
102
|
+
t
|
|
103
103
|
),
|
|
104
104
|
...a
|
|
105
105
|
}
|
|
106
106
|
));
|
|
107
|
-
|
|
108
|
-
const N = s.forwardRef(({ className:
|
|
107
|
+
g.displayName = e.Label.displayName;
|
|
108
|
+
const N = s.forwardRef(({ className: t, ...o }, a) => /* @__PURE__ */ n(
|
|
109
109
|
e.Separator,
|
|
110
110
|
{
|
|
111
111
|
ref: a,
|
|
112
|
-
className: r("-mx-1 my-1 h-px bg-muted",
|
|
113
|
-
...
|
|
112
|
+
className: r("-mx-1 my-1 h-px bg-muted", t),
|
|
113
|
+
...o
|
|
114
114
|
}
|
|
115
115
|
));
|
|
116
116
|
N.displayName = e.Separator.displayName;
|
|
117
117
|
const x = ({
|
|
118
|
-
className:
|
|
119
|
-
...
|
|
118
|
+
className: t,
|
|
119
|
+
...o
|
|
120
120
|
}) => /* @__PURE__ */ n(
|
|
121
121
|
"span",
|
|
122
122
|
{
|
|
123
|
-
className: r("ml-auto text-caption tracking-widest opacity-60",
|
|
124
|
-
...
|
|
123
|
+
className: r("ml-auto text-caption tracking-widest opacity-60", t),
|
|
124
|
+
...o
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
x.displayName = "DropdownMenuShortcut";
|
|
128
128
|
export {
|
|
129
129
|
I as DropdownMenu,
|
|
130
|
-
|
|
130
|
+
h as DropdownMenuCheckboxItem,
|
|
131
131
|
b as DropdownMenuContent,
|
|
132
132
|
S as DropdownMenuGroup,
|
|
133
133
|
w as DropdownMenuItem,
|
|
134
|
-
|
|
134
|
+
g as DropdownMenuLabel,
|
|
135
135
|
C as DropdownMenuPortal,
|
|
136
136
|
k as DropdownMenuRadioGroup,
|
|
137
|
-
|
|
137
|
+
y as DropdownMenuRadioItem,
|
|
138
138
|
N as DropdownMenuSeparator,
|
|
139
139
|
x as DropdownMenuShortcut,
|
|
140
140
|
z as DropdownMenuSub,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.es.js","sources":["../../../lib/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * 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\"\n\nimport { cn } from \"@/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-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\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"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\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\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-body font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-caption tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DotFilledIcon","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;AAUA,MAAMA,IAAeC,EAAsB,MAErCC,IAAsBD,EAAsB,SAE5CE,IAAoBF,EAAsB,OAE1CG,IAAqBH,EAAsB,QAE3CI,IAAkBJ,EAAsB,KAExCK,IAAyBL,EAAsB,YAE/CM,IAAyBC,EAAM,WAKnC,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,KAASC,MAC3C,gBAAAC;AAAA,EAACb,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA,MACTD;AAAA,IACF;AAAA,IACC,GAAGG;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACD,gBAAAK,EAACC,GAAiB,EAAA,WAAU,kBAAkB,CAAA;AAAA,IAAA;AAAA,EAAA;AAChD,CACD;AACDV,EAAuB,cACrBN,EAAsB,WAAW;AAE7B,MAAAiB,IAAyBV,EAAM,WAGnC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAM,GAAGC,MAC1B,gBAAAG;AAAA,EAACf,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;A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,mDAAmDN,CAAS;AAAA,IACzE,GAAGG;AAAA,EAAA;AACN;AAGJiB,EAAqB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.es.js","sources":["../../../lib/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * 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\"\n\nimport { cn } from \"@/utils\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-hidden focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-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\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"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\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-body outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\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-body font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-caption tracking-widest opacity-60\", className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","jsxs","cn","jsx","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenu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uB,CAAA,EAClD,CAAA,GACF;AAAA,MACCf;AAAA,IAAA;AAAA,EAAA;AACH,CACD;AACDc,EAAsB,cAAcxB,EAAsB,UAAU;AAE9D,MAAA0B,IAAoBnB,EAAM,WAK9B,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,GAAGE,KAASC,MACjC,gBAAAG;AAAA,EAACf,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAL,KAAS;AAAA,MACTD;AAAA,IACF;AAAA,IACC,GAAGG;AAAA,EAAA;AACN,CACD;AACDe,EAAkB,cAAc1B,EAAsB,MAAM;AAEtD,MAAA2B,IAAwBpB,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAM,GAAGC,MAC1B,gBAAAG;AAAA,EAACf,EAAsB;AAAA,EAAtB;AAAA,IACC,KAAAY;AAAA,IACA,WAAWE,EAAG,4BAA4BN,CAAS;AAAA,IAClD,GAAGG;AAAA,EAAA;AACN,CACD;AACDgB,EAAsB,cAAc3B,EAAsB,UAAU;AAEpE,MAAM4B,IAAuB,CAAC;AAAA,EAC5B,WAAApB;AAAA,EACA,GAAGG;AACL,MAEI,gBAAAI;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWD,EAAG,mDAAmDN,CAAS;AAAA,IACzE,GAAGG;AAAA,EAAA;AACN;AAGJiB,EAAqB,cAAc;"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import { Slot as F } from "@radix-ui/react-slot";
|
|
4
4
|
import * as s from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { useFormContext as u, FormProvider as p, Controller as x } from "react-hook-form";
|
|
6
6
|
import { Label as I } from "./label.es.js";
|
|
7
7
|
import { cn as a } from "../../utils/index.es.js";
|
|
8
|
-
const D =
|
|
8
|
+
const D = p, l = s.createContext({}), M = ({
|
|
9
9
|
...e
|
|
10
|
-
}) => /* @__PURE__ */ i(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ i(
|
|
11
|
-
const e = s.useContext(l), t = s.useContext(f), { getFieldState: r, formState: o } =
|
|
10
|
+
}) => /* @__PURE__ */ i(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ i(x, { ...e }) }), d = () => {
|
|
11
|
+
const e = s.useContext(l), t = s.useContext(f), { getFieldState: r, formState: o } = u(), m = r(e.name, o);
|
|
12
12
|
if (!e)
|
|
13
13
|
throw new Error("useFormField should be used within <FormField>");
|
|
14
14
|
const { id: n } = t;
|
|
@@ -8,7 +8,7 @@ const x = o.forwardRef(({ className: e, containerClassName: t, ...a }, n) => /*
|
|
|
8
8
|
{
|
|
9
9
|
ref: n,
|
|
10
10
|
containerClassName: s(
|
|
11
|
-
"flex items-center gap-2 has-
|
|
11
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
12
12
|
t
|
|
13
13
|
),
|
|
14
14
|
className: s("disabled:cursor-not-allowed", e),
|
|
@@ -25,7 +25,7 @@ const O = o.forwardRef(({ index: e, className: t, ...a }, n) => {
|
|
|
25
25
|
{
|
|
26
26
|
ref: n,
|
|
27
27
|
className: s(
|
|
28
|
-
"relative flex h-9 w-9 items-center justify-center border-2 border-input text-body shadow-
|
|
28
|
+
"relative flex h-9 w-9 items-center justify-center border-2 border-input text-body shadow-xs transition-all first:rounded-l-md last:rounded-r-md",
|
|
29
29
|
p ? "z-10 border-2 border-primary" : "",
|
|
30
30
|
t
|
|
31
31
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.es.js","sources":["../../../lib/components/ui/input-otp.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { cn } from \"@/utils\"\nimport { MinusIcon } from \"@radix-ui/react-icons\"\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-
|
|
1
|
+
{"version":3,"file":"input-otp.es.js","sources":["../../../lib/components/ui/input-otp.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { cn } from \"@/utils\"\nimport { MinusIcon } from \"@radix-ui/react-icons\"\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n))\nInputOTP.displayName = \"InputOTP\"\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n))\nInputOTPGroup.displayName = \"InputOTPGroup\"\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-9 w-9 items-center justify-center border-2 border-input text-body shadow-xs transition-all first:rounded-l-md last:rounded-r-md\",\n isActive ? \"z-10 border-2 border-primary\" : \"\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = \"InputOTPSlot\"\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n))\nInputOTPSeparator.displayName = \"InputOTPSeparator\"\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"],"names":["InputOTP","React","className","containerClassName","props","ref","jsx","OTPInput","cn","InputOTPGroup","InputOTPSlot","index","inputOTPContext","OTPInputContext","char","hasFakeCaret","isActive","jsxs","InputOTPSeparator","MinusIcon"],"mappings":";;;;;AAKM,MAAAA,IAAWC,EAAM,WAGrB,CAAC,EAAE,WAAAC,GAAW,oBAAAC,GAAoB,GAAGC,KAASC,MAC9C,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,oBAAoBG;AAAA,MAClB;AAAA,MACAL;AAAA,IACF;AAAA,IACA,WAAWK,EAAG,+BAA+BN,CAAS;AAAA,IACrD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAS,cAAc;AAEjB,MAAAS,IAAgBR,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAS,GAAAC,wBACzB,OAAI,EAAA,KAAAA,GAAU,WAAWG,EAAG,qBAAqBN,CAAS,GAAI,GAAGE,GAAO,CAC1E;AACDK,EAAc,cAAc;AAEtB,MAAAC,IAAeT,EAAM,WAGzB,CAAC,EAAE,OAAAU,GAAO,WAAAT,GAAW,GAAGE,EAAM,GAAGC,MAAQ;AACnC,QAAAO,IAAkBX,EAAM,WAAWY,CAAe,GAClD,EAAE,MAAAC,GAAM,cAAAC,GAAc,UAAAC,EAAa,IAAAJ,EAAgB,MAAMD,CAAK;AAGlE,SAAA,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAQ,IAAW,kCAAkC;AAAA,QAC7Cd;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAU;AAAA,QACAC,uBACE,OAAI,EAAA,WAAU,yEACb,UAAC,gBAAAT,EAAA,OAAA,EAAI,WAAU,2DAA2D,CAAA,EAC5E,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ;AAEJ,CAAC;AACDI,EAAa,cAAc;AAE3B,MAAMQ,IAAoBjB,EAAM,WAG9B,CAAC,EAAE,GAAGG,KAASC,wBACd,OAAI,EAAA,KAAAA,GAAU,MAAK,aAAa,GAAGD,GAClC,UAAC,gBAAAE,EAAAa,GAAA,CAAU,CAAA,GACb,CACD;AACDD,EAAkB,cAAc;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
3
|
import { cn as l } from "../../utils/index.es.js";
|
|
4
|
-
const
|
|
5
|
-
({ className: e, type: r, ...o }, t) => /* @__PURE__ */
|
|
4
|
+
const a = i.forwardRef(
|
|
5
|
+
({ className: e, type: r, ...o }, t) => /* @__PURE__ */ d(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
8
|
type: r,
|
|
9
9
|
className: l(
|
|
10
|
-
"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-
|
|
10
|
+
"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:border-2 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50",
|
|
11
11
|
e
|
|
12
12
|
),
|
|
13
13
|
ref: t,
|
|
@@ -15,8 +15,8 @@ const n = d.forwardRef(
|
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
a.displayName = "Input";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
a as Input
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=input.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.es.js","sources":["../../../lib/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n//Input\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-
|
|
1
|
+
{"version":3,"file":"input.es.js","sources":["../../../lib/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@/utils\"\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n//Input\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-body file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:border-2 focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n ref={ref}\n {...props}\n />\n );\n }\n);\nInput.displayName = \"Input\";\n\nexport { Input };"],"names":["Input","React","className","type","props","ref","jsx","cn"],"mappings":";;;AAOA,MAAMA,IAAQC,EAAM;AAAA,EAClB,CAAC,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,EAAA,GAASC,MAE5B,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAAH;AAAA,MACA,WAAWI;AAAA,QACT;AAAA,QACAL;AAAA,MACF;AAAA,MACA,KAAAG;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EACN;AAGN;AACAJ,EAAM,cAAc;"}
|
|
@@ -12,7 +12,7 @@ import "./chart.es.js";
|
|
|
12
12
|
import "./checkbox.es.js";
|
|
13
13
|
import "@radix-ui/react-collapsible";
|
|
14
14
|
import { XIcon as D, ChevronDown as g, Command as O, CheckIcon as B } from "lucide-react";
|
|
15
|
-
import * as
|
|
15
|
+
import * as c from "react";
|
|
16
16
|
import "./dialog.es.js";
|
|
17
17
|
import "./drawer.es.js";
|
|
18
18
|
import "./dropdown-menu.es.js";
|
|
@@ -28,7 +28,7 @@ import "./password-input.es.js";
|
|
|
28
28
|
import "./popover.es.js";
|
|
29
29
|
import "./radio-group.es.js";
|
|
30
30
|
import "./select.es.js";
|
|
31
|
-
import { Separator as
|
|
31
|
+
import { Separator as x } from "./separator.es.js";
|
|
32
32
|
import "./sheet.es.js";
|
|
33
33
|
import "./sidebar.es.js";
|
|
34
34
|
import "sonner";
|
|
@@ -53,23 +53,23 @@ G(
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
const L =
|
|
56
|
+
const L = c.forwardRef(
|
|
57
57
|
({
|
|
58
58
|
className: T,
|
|
59
59
|
variant: X,
|
|
60
60
|
asChild: _ = !1,
|
|
61
61
|
options: p,
|
|
62
|
-
defaultValue:
|
|
62
|
+
defaultValue: m,
|
|
63
63
|
onValueChange: l,
|
|
64
64
|
disabled: q,
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: y,
|
|
66
66
|
animation: z = 0,
|
|
67
67
|
...b
|
|
68
68
|
}, w) => {
|
|
69
|
-
const [t, s] =
|
|
70
|
-
|
|
71
|
-
s(
|
|
72
|
-
}, [
|
|
69
|
+
const [t, s] = c.useState(m || []), i = c.useRef(new Set(t)), [u, a] = c.useState(!1);
|
|
70
|
+
c.useEffect(() => {
|
|
71
|
+
s(m || []), i.current = new Set(m);
|
|
72
|
+
}, [m]);
|
|
73
73
|
const N = (r) => {
|
|
74
74
|
r.key === "Enter" ? a(!0) : r.key === "Backspace" && !r.target.value && (t.pop(), s([...t]), i.current.delete(t[t.length - 1]), l([...t]));
|
|
75
75
|
}, C = (r) => {
|
|
@@ -102,11 +102,11 @@ const L = m.forwardRef(
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ e(
|
|
105
|
+
/* @__PURE__ */ e(x, { orientation: "vertical", className: "flex min-h-6 h-full" }),
|
|
106
106
|
/* @__PURE__ */ e(g, { className: "h-4 mx-2 cursor-pointer text-muted-foreground" })
|
|
107
107
|
] })
|
|
108
108
|
] }) : /* @__PURE__ */ n("div", { className: "flex items-center justify-between w-full mx-auto", children: [
|
|
109
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground mx-3", children:
|
|
109
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground mx-3", children: y }),
|
|
110
110
|
/* @__PURE__ */ e(g, { className: "h-4 cursor-pointer text-muted-foreground mx-2" })
|
|
111
111
|
] })
|
|
112
112
|
}
|
|
@@ -114,7 +114,7 @@ const L = m.forwardRef(
|
|
|
114
114
|
/* @__PURE__ */ e(
|
|
115
115
|
A,
|
|
116
116
|
{
|
|
117
|
-
className: "w-[200px] p-0 drop-shadow-
|
|
117
|
+
className: "w-[200px] p-0 drop-shadow-xs",
|
|
118
118
|
align: "start",
|
|
119
119
|
onEscapeKeyDown: () => a(!1),
|
|
120
120
|
children: /* @__PURE__ */ n(O, { children: [
|
|
@@ -167,7 +167,7 @@ const L = m.forwardRef(
|
|
|
167
167
|
children: "Clear"
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
|
-
/* @__PURE__ */ e(
|
|
170
|
+
/* @__PURE__ */ e(x, { orientation: "vertical", className: "flex min-h-6 h-full" })
|
|
171
171
|
] }),
|
|
172
172
|
/* @__PURE__ */ e(v, {}),
|
|
173
173
|
/* @__PURE__ */ e(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutli-select.es.js","sources":["../../../lib/components/ui/mutli-select.tsx"],"sourcesContent":["'use client';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport {\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '@/components/ui/command';\nimport { Separator } from '@/index';\nimport { cn } from '@/utils';\nimport { Popover, PopoverContent, PopoverTrigger } from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CheckIcon, ChevronDown, Command, XIcon } from 'lucide-react';\nimport * as React from 'react';\n\nconst multiSelectVariants = cva(\n 'm-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300',\n {\n variants: {\n variant: {\n default: 'border-foreground/10 drop-shadow-md text-foreground bg-card hover:bg-card/80',\n secondary:\n 'border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n inverted: 'inverted',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ninterface MultiSelectFormFieldProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof multiSelectVariants> {\n asChild?: boolean;\n options: {\n label: string;\n value: string;\n icon?: React.ComponentType<{ className?: string }>;\n }[];\n defaultValue?: string[];\n disabled?: boolean;\n placeholder: string;\n className?: string;\n animation?: number;\n onValueChange: (value: string[]) => void;\n}\n\nconst MultiSelectFormField = React.forwardRef<HTMLButtonElement, MultiSelectFormFieldProps>(\n (\n {\n className,\n variant,\n asChild = false,\n options,\n defaultValue,\n onValueChange,\n disabled,\n placeholder,\n animation = 0,\n ...props\n },\n ref,\n ) => {\n const [selectedValues, setSelectedValues] = React.useState<string[]>(defaultValue || []);\n const selectedValuesSet = React.useRef(new Set(selectedValues));\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n setSelectedValues(defaultValue || []);\n selectedValuesSet.current = new Set(defaultValue);\n }, [defaultValue]);\n\n const handleInputKeyDown = (event: any) => {\n if (event.key === 'Enter') {\n setIsPopoverOpen(true);\n } else if (event.key === 'Backspace' && !event.target.value) {\n selectedValues.pop();\n setSelectedValues([...selectedValues]);\n selectedValuesSet.current.delete(selectedValues[selectedValues.length - 1]);\n onValueChange([...selectedValues]);\n }\n };\n\n const toggleOption = (value: string) => {\n if (selectedValuesSet.current.has(value)) {\n selectedValuesSet.current.delete(value);\n setSelectedValues(selectedValues.filter((v) => v !== value));\n } else {\n selectedValuesSet.current.add(value);\n setSelectedValues([...selectedValues, value]);\n }\n onValueChange(Array.from(selectedValuesSet.current));\n };\n\n return (\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n {...props}\n onClick={() => setIsPopoverOpen(!isPopoverOpen)}\n variant={'ghost'}\n className=\"flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-card\"\n >\n {selectedValues.length > 0 ? (\n <div className=\"flex justify-between items-center w-full\">\n <div className=\"flex flex-wrap items-center\">\n {selectedValues.map((value) => {\n const option = options.find((o) => o.value === value);\n const IconComponent = option?.icon;\n return (\n <Badge key={value}>\n {IconComponent && <IconComponent className=\"h-6 w-6 mr-2\" />}\n {option?.label}\n </Badge>\n );\n })}\n </div>\n <div className=\"flex items-center justify-between\">\n <XIcon\n className=\"h-4 mx-2 cursor-pointer text-muted-foreground\"\n onClick={(event) => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n event.stopPropagation();\n }}\n />\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n <ChevronDown className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-between w-full mx-auto\">\n <span className=\"text-sm text-muted-foreground mx-3\">{placeholder}</span>\n <ChevronDown className=\"h-4 cursor-pointer text-muted-foreground mx-2\" />\n </div>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[200px] p-0 drop-shadow-sm\"\n align=\"start\"\n onEscapeKeyDown={() => setIsPopoverOpen(false)}\n >\n <Command>\n <CommandInput placeholder=\"Search...\" onKeyDown={handleInputKeyDown} />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup>\n {options.map((option) => {\n const isSelected = selectedValuesSet.current.has(option.value);\n return (\n <CommandItem\n key={option.value}\n onSelect={() => toggleOption(option.value)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n 'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',\n isSelected\n ? 'bg-primary text-primary-foreground'\n : 'opacity-50 [&_svg]:invisible',\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n {option.icon && (\n <option.icon className=\"mr-2 h-4 w-4 text-muted-foreground\" />\n )}\n <span>{option.label}</span>\n </CommandItem>\n );\n })}\n </CommandGroup>\n <CommandSeparator />\n <CommandGroup>\n <div className=\"flex items-center justify-between\">\n {selectedValues.length > 0 && (\n <>\n <CommandItem\n onSelect={() => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n }}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Clear\n </CommandItem>\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n </>\n )}\n <CommandSeparator />\n <CommandItem\n onSelect={() => setIsPopoverOpen(false)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Close\n </CommandItem>\n </div>\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nMultiSelectFormField.displayName = 'MultiSelectFormField';\n\nexport default MultiSelectFormField;\n"],"names":["cva","MultiSelectFormField","React","className","variant","asChild","options","defaultValue","onValueChange","disabled","placeholder","animation","props","ref","selectedValues","setSelectedValues","selectedValuesSet","isPopoverOpen","setIsPopoverOpen","handleInputKeyDown","event","toggleOption","value","v","jsxs","Popover","jsx","PopoverTrigger","Button","option","o","IconComponent","Badge","XIcon","Separator","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","isSelected","CommandItem","cn","CheckIcon","CommandSeparator","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkB4BA;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,aACE;AAAA,QACF,UAAU;AAAA,MAAA;AAAA,IAEd;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAmBA,MAAMC,IAAuBC,EAAM;AAAA,EACjC,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,KAELC,MACG;AACG,UAAA,CAACC,GAAgBC,CAAiB,IAAIb,EAAM,SAAmBK,KAAgB,EAAE,GACjFS,IAAoBd,EAAM,OAAO,IAAI,IAAIY,CAAc,CAAC,GACxD,CAACG,GAAeC,CAAgB,IAAIhB,EAAM,SAAS,EAAK;AAE9D,IAAAA,EAAM,UAAU,MAAM;AACF,MAAAa,EAAAR,KAAgB,EAAE,GAClBS,EAAA,UAAU,IAAI,IAAIT,CAAY;AAAA,IAAA,GAC/C,CAACA,CAAY,CAAC;AAEX,UAAAY,IAAqB,CAACC,MAAe;AACrC,MAAAA,EAAM,QAAQ,UAChBF,EAAiB,EAAI,IACZE,EAAM,QAAQ,eAAe,CAACA,EAAM,OAAO,UACpDN,EAAe,IAAI,GACDC,EAAA,CAAC,GAAGD,CAAc,CAAC,GACrCE,EAAkB,QAAQ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ACX,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED,EAAA,CACF,EACF,CAAA;AAAA,YAAA,EACF,CAAA;AAAA,UAAA,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAAA;AAGN;AAEAjB,EAAqB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"mutli-select.es.js","sources":["../../../lib/components/ui/mutli-select.tsx"],"sourcesContent":["'use client';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport {\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from '@/components/ui/command';\nimport { Separator } from '@/index';\nimport { cn } from '@/utils';\nimport { Popover, PopoverContent, PopoverTrigger } from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CheckIcon, ChevronDown, Command, XIcon } from 'lucide-react';\nimport * as React from 'react';\n\nconst multiSelectVariants = cva(\n 'm-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300',\n {\n variants: {\n variant: {\n default: 'border-foreground/10 drop-shadow-md text-foreground bg-card hover:bg-card/80',\n secondary:\n 'border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n inverted: 'inverted',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\ninterface MultiSelectFormFieldProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof multiSelectVariants> {\n asChild?: boolean;\n options: {\n label: string;\n value: string;\n icon?: React.ComponentType<{ className?: string }>;\n }[];\n defaultValue?: string[];\n disabled?: boolean;\n placeholder: string;\n className?: string;\n animation?: number;\n onValueChange: (value: string[]) => void;\n}\n\nconst MultiSelectFormField = React.forwardRef<HTMLButtonElement, MultiSelectFormFieldProps>(\n (\n {\n className,\n variant,\n asChild = false,\n options,\n defaultValue,\n onValueChange,\n disabled,\n placeholder,\n animation = 0,\n ...props\n },\n ref,\n ) => {\n const [selectedValues, setSelectedValues] = React.useState<string[]>(defaultValue || []);\n const selectedValuesSet = React.useRef(new Set(selectedValues));\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n\n React.useEffect(() => {\n setSelectedValues(defaultValue || []);\n selectedValuesSet.current = new Set(defaultValue);\n }, [defaultValue]);\n\n const handleInputKeyDown = (event: any) => {\n if (event.key === 'Enter') {\n setIsPopoverOpen(true);\n } else if (event.key === 'Backspace' && !event.target.value) {\n selectedValues.pop();\n setSelectedValues([...selectedValues]);\n selectedValuesSet.current.delete(selectedValues[selectedValues.length - 1]);\n onValueChange([...selectedValues]);\n }\n };\n\n const toggleOption = (value: string) => {\n if (selectedValuesSet.current.has(value)) {\n selectedValuesSet.current.delete(value);\n setSelectedValues(selectedValues.filter((v) => v !== value));\n } else {\n selectedValuesSet.current.add(value);\n setSelectedValues([...selectedValues, value]);\n }\n onValueChange(Array.from(selectedValuesSet.current));\n };\n\n return (\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n {...props}\n onClick={() => setIsPopoverOpen(!isPopoverOpen)}\n variant={'ghost'}\n className=\"flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-card\"\n >\n {selectedValues.length > 0 ? (\n <div className=\"flex justify-between items-center w-full\">\n <div className=\"flex flex-wrap items-center\">\n {selectedValues.map((value) => {\n const option = options.find((o) => o.value === value);\n const IconComponent = option?.icon;\n return (\n <Badge key={value}>\n {IconComponent && <IconComponent className=\"h-6 w-6 mr-2\" />}\n {option?.label}\n </Badge>\n );\n })}\n </div>\n <div className=\"flex items-center justify-between\">\n <XIcon\n className=\"h-4 mx-2 cursor-pointer text-muted-foreground\"\n onClick={(event) => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n event.stopPropagation();\n }}\n />\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n <ChevronDown className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-between w-full mx-auto\">\n <span className=\"text-sm text-muted-foreground mx-3\">{placeholder}</span>\n <ChevronDown className=\"h-4 cursor-pointer text-muted-foreground mx-2\" />\n </div>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"w-[200px] p-0 drop-shadow-xs\"\n align=\"start\"\n onEscapeKeyDown={() => setIsPopoverOpen(false)}\n >\n <Command>\n <CommandInput placeholder=\"Search...\" onKeyDown={handleInputKeyDown} />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup>\n {options.map((option) => {\n const isSelected = selectedValuesSet.current.has(option.value);\n return (\n <CommandItem\n key={option.value}\n onSelect={() => toggleOption(option.value)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"cursor-pointer\"\n >\n <div\n className={cn(\n 'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',\n isSelected\n ? 'bg-primary text-primary-foreground'\n : 'opacity-50 [&_svg]:invisible',\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n {option.icon && (\n <option.icon className=\"mr-2 h-4 w-4 text-muted-foreground\" />\n )}\n <span>{option.label}</span>\n </CommandItem>\n );\n })}\n </CommandGroup>\n <CommandSeparator />\n <CommandGroup>\n <div className=\"flex items-center justify-between\">\n {selectedValues.length > 0 && (\n <>\n <CommandItem\n onSelect={() => {\n setSelectedValues([]);\n selectedValuesSet.current.clear();\n onValueChange([]);\n }}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Clear\n </CommandItem>\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n </>\n )}\n <CommandSeparator />\n <CommandItem\n onSelect={() => setIsPopoverOpen(false)}\n style={{\n pointerEvents: 'auto',\n opacity: 1,\n }}\n className=\"flex-1 justify-center cursor-pointer\"\n >\n Close\n </CommandItem>\n </div>\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n },\n);\n\nMultiSelectFormField.displayName = 'MultiSelectFormField';\n\nexport default MultiSelectFormField;\n"],"names":["cva","MultiSelectFormField","React","className","variant","asChild","options","defaultValue","onValueChange","disabled","placeholder","animation","props","ref","selectedValues","setSelectedValues","selectedValuesSet","isPopoverOpen","setIsPopoverOpen","handleInputKeyDown","event","toggleOption","value","v","jsxs","Popover","jsx","PopoverTrigger","Button","option","o","IconComponent","Badge","XIcon","Separator","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","isSelected","CommandItem","cn","CheckIcon","CommandSeparator","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkB4BA;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,aACE;AAAA,QACF,UAAU;AAAA,MAAA;AAAA,IAEd;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAmBA,MAAMC,IAAuBC,EAAM;AAAA,EACjC,CACE;AAAA,IACE,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,KAELC,MACG;AACG,UAAA,CAACC,GAAgBC,CAAiB,IAAIb,EAAM,SAAmBK,KAAgB,EAAE,GACjFS,IAAoBd,EAAM,OAAO,IAAI,IAAIY,CAAc,CAAC,GACxD,CAACG,GAAeC,CAAgB,IAAIhB,EAAM,SAAS,EAAK;AAE9D,IAAAA,EAAM,UAAU,MAAM;AACF,MAAAa,EAAAR,KA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B,EAAAQ,GAAA,EAAU,aAAY,YAAW,WAAU,sBAAsB,CAAA;AAAA,gBAAA,GACpE;AAAA,kCAEDY,GAAiB,EAAA;AAAA,gBAClB,gBAAApB;AAAA,kBAACiB;AAAA,kBAAA;AAAA,oBACC,UAAU,MAAMzB,EAAiB,EAAK;AAAA,oBACtC,OAAO;AAAA,sBACL,eAAe;AAAA,sBACf,SAAS;AAAA,oBACX;AAAA,oBACA,WAAU;AAAA,oBACX,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED,EAAA,CACF,EACF,CAAA;AAAA,YAAA,EACF,CAAA;AAAA,UAAA,EACF,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,GACF;AAAA,EAAA;AAGN;AAEAjB,EAAqB,cAAc;"}
|
|
@@ -69,7 +69,7 @@ const w = t.Link, m = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ *
|
|
|
69
69
|
t.Viewport,
|
|
70
70
|
{
|
|
71
71
|
className: n(
|
|
72
|
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
72
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
73
73
|
e
|
|
74
74
|
),
|
|
75
75
|
ref: o,
|
|
@@ -82,7 +82,7 @@ const x = r.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ i(
|
|
|
82
82
|
{
|
|
83
83
|
ref: o,
|
|
84
84
|
className: n(
|
|
85
|
-
"top-full z-
|
|
85
|
+
"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
|
86
86
|
e
|
|
87
87
|
),
|
|
88
88
|
...a,
|
|
@@ -95,7 +95,7 @@ const y = r.forwardRef(({ className: e, title: a, children: o, ...d }, l) => /*
|
|
|
95
95
|
{
|
|
96
96
|
ref: l,
|
|
97
97
|
className: n(
|
|
98
|
-
"block select-none text-accent space-y-1 rounded-md p-3 leading-none no-underline outline-
|
|
98
|
+
"block select-none text-accent space-y-1 rounded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
99
99
|
e
|
|
100
100
|
),
|
|
101
101
|
...d,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.es.js","sources":["../../../lib/components/ui/navigation-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\nimport { buttonVariants } from \"./button\"\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1 flex-wrap\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst navigationMenuTriggerStyle = cva(buttonVariants({size:'sm', variant: 'outline'}))\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n))\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n )}\n {...props}\n />\n))\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n))\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-
|
|
1
|
+
{"version":3,"file":"navigation-menu.es.js","sources":["../../../lib/components/ui/navigation-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils\"\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\"\nimport { buttonVariants } from \"./button\"\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1 flex-wrap\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst navigationMenuTriggerStyle = cva(buttonVariants({size:'sm', variant: 'outline'}))\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n))\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className\n )}\n {...props}\n />\n))\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n))\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n))\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName\n\nconst NavigationMenuListItem = React.forwardRef<\n React.ElementRef<\"a\">,\n React.ComponentPropsWithoutRef<\"a\">\n>(({ className, title, children, ...props }, ref) => {\n return (\n <li>\n <NavigationMenuLink asChild>\n <a\n ref={ref}\n className={cn(\n \"block select-none text-accent space-y-1 rounded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground\",\n className\n )}\n {...props}\n >\n <div className=\"text-body font-medium leading-none\">{title}</div>\n <p className=\"line-clamp-2 text-body leading-snug text-muted-foreground\">\n {children}\n </p>\n </a>\n </NavigationMenuLink>\n </li>\n )\n})\nNavigationMenuListItem.displayName = \"NavigationItemListItem\"\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n NavigationMenuListItem\n}\n"],"names":["NavigationMenu","React","className","children","props","ref","jsxs","NavigationMenuPrimitive","cn","NavigationMenuViewport","NavigationMenuList","jsx","NavigationMenuItem","navigationMenuTriggerStyle","cva","buttonVariants","NavigationMenuTrigger","ChevronDownIcon","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator","NavigationMenuListItem","title"],"mappings":";;;;;;;AAOM,MAAAA,IAAiBC,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EAACC,EAAwB;AAAA,EAAxB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAN;AAAA,IACF;AAAA,IACC,GAAGE;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,wBACAM,GAAuB,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA;AAC1B,CACD;AACDT,EAAe,cAAcO,EAAwB,KAAK;AAEpD,MAAAG,IAAqBT,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAM,GAAGC,MAC1B,gBAAAM;AAAA,EAACJ,EAAwB;AAAA,EAAxB;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAN;AAAA,IACF;AAAA,IACC,GAAGE;AAAA,EAAA;AACN,CACD;AACDM,EAAmB,cAAcH,EAAwB,KAAK;AAE9D,MAAMK,IAAqBL,EAAwB,MAE7CM,IAA6BC,EAAIC,EAAe,EAAC,MAAK,MAAM,SAAS,WAAU,CAAC,GAEhFC,IAAwBf,EAAM,WAGlC,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpC,gBAAAC;AAAA,EA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