arxatec-ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -60
- package/dist/arxatec-ui.css +2 -0
- package/dist/components/date_range_picker/index.d.ts +1 -1
- package/dist/components/description_markdown_editor/components/index.d.ts +1 -0
- package/dist/components/description_markdown_editor/components/toolbar_button/index.d.ts +12 -0
- package/dist/components/description_markdown_editor/index.d.ts +17 -0
- package/dist/components/description_markdown_editor/utils/index.d.ts +6 -0
- package/dist/components/form_input/index.d.ts +15 -0
- package/dist/components/form_select/index.d.ts +25 -0
- package/dist/components/form_textarea/index.d.ts +14 -0
- package/dist/components/rich_text_editor/components/document_dialog/index.d.ts +8 -0
- package/dist/components/rich_text_editor/components/index.d.ts +1 -0
- package/dist/components/rich_text_editor/extensions/floating_menu/index.d.ts +4 -0
- package/dist/components/rich_text_editor/extensions/floating_toolbar/index.d.ts +4 -0
- package/dist/components/rich_text_editor/extensions/image/image-extension.d.ts +1 -0
- package/dist/components/rich_text_editor/extensions/image/index.d.ts +1 -0
- package/dist/components/rich_text_editor/extensions/image/tiptap-image.d.ts +2 -0
- package/dist/components/rich_text_editor/extensions/image_placeholder/index.d.ts +17 -0
- package/dist/components/rich_text_editor/extensions/index.d.ts +5 -0
- package/dist/components/rich_text_editor/extensions/search_and_replace/index.d.ts +54 -0
- package/dist/components/rich_text_editor/index.d.ts +13 -0
- package/dist/components/rich_text_editor/lib/tiptap-utils.d.ts +15 -0
- package/dist/components/rich_text_editor/toolbars/alignment/index.d.ts +1 -0
- package/dist/components/rich_text_editor/toolbars/blockquote/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/bold/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/bullet_list/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/code/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/code_block/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/color_and_highlight/index.d.ts +1 -0
- package/dist/components/rich_text_editor/toolbars/editor_toolbar/index.d.ts +7 -0
- package/dist/components/rich_text_editor/toolbars/hard_break/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/headings/index.d.ts +2 -0
- package/dist/components/rich_text_editor/toolbars/horizontal_rule/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/image_placeholder_toolbar/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/index.d.ts +22 -0
- package/dist/components/rich_text_editor/toolbars/italic/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/link/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/mobile_toolbar_group/index.d.ts +12 -0
- package/dist/components/rich_text_editor/toolbars/ordered_list/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/redo/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/search_and_replace_toolbar/index.d.ts +1 -0
- package/dist/components/rich_text_editor/toolbars/strikethrough/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/toolbar_provider/context.d.ts +7 -0
- package/dist/components/rich_text_editor/toolbars/toolbar_provider/index.d.ts +2 -0
- package/dist/components/rich_text_editor/toolbars/toolbar_provider/toolbar_provider.d.ts +8 -0
- package/dist/components/rich_text_editor/toolbars/underline/index.d.ts +3 -0
- package/dist/components/rich_text_editor/toolbars/undo/index.d.ts +3 -0
- package/dist/components/rich_text_editor/ui/floating-element.d.ts +20 -0
- package/dist/exports/index.d.ts +1 -0
- package/dist/exports/sidebar.d.ts +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use_image_upload/index.d.ts +15 -0
- package/dist/hooks/use_media_query/index.d.ts +1 -0
- package/dist/icons_data-BHKds1ja-BPOjhDPB-CoyEcb95.js +22025 -0
- package/dist/icons_data-BHKds1ja-BPOjhDPB-CoyEcb95.js.map +1 -0
- package/dist/icons_data-BHKds1ja-BPOjhDPB-O5bUR24H-DnafVe1n-Dkf4m7h1.js +22025 -0
- package/dist/icons_data-BHKds1ja-BPOjhDPB-O5bUR24H-DnafVe1n-Dkf4m7h1.js.map +1 -0
- package/dist/icons_data-BHKds1ja-Cqx-AFTA-DUeHq_rP-DVyOjjT-.js +22025 -0
- package/dist/icons_data-BHKds1ja-Cqx-AFTA-DUeHq_rP-DVyOjjT-.js.map +1 -0
- package/dist/icons_data-BHKds1ja-Cqx-AFTA-DUeHq_rP-dXd2WO7V-D1ANykD3-BvOdc1OQ.js +22025 -0
- package/dist/icons_data-BHKds1ja-Cqx-AFTA-DUeHq_rP-dXd2WO7V-D1ANykD3-BvOdc1OQ.js.map +1 -0
- package/dist/icons_data-BHKds1ja-CsVC001U.js +22025 -0
- package/dist/icons_data-BHKds1ja-CsVC001U.js.map +1 -0
- package/dist/icons_data-BHKds1ja-Cwl6KKva-BIDtxJa6-th7L9zrq-BwlsX6V6-DerXw7lM-BZuU3kG0.js +22025 -0
- package/dist/icons_data-BHKds1ja-Cwl6KKva-BIDtxJa6-th7L9zrq-BwlsX6V6-DerXw7lM-BZuU3kG0.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24688 -2452
- package/dist/index.js.map +1 -1
- package/dist/sheet-BAH_9-wM.js +222 -0
- package/dist/sheet-BAH_9-wM.js.map +1 -0
- package/dist/sidebar.js +347 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/styles.css +25 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/tiptap/index.d.ts +7 -0
- package/package.json +51 -9
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { clsx as t } from "clsx";
|
|
3
|
+
import { twMerge as n } from "tailwind-merge";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { EyeIcon as a, EyeOffIcon as o, XIcon as s } from "lucide-react";
|
|
6
|
+
import * as c from "@radix-ui/react-dialog";
|
|
7
|
+
import { Slot as l } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva as u } from "class-variance-authority";
|
|
9
|
+
import * as d from "@radix-ui/react-separator";
|
|
10
|
+
import * as f from "@radix-ui/react-tooltip";
|
|
11
|
+
//#region src/utilities/class/index.ts
|
|
12
|
+
function p(...e) {
|
|
13
|
+
return n(t(e));
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/button/index.tsx
|
|
17
|
+
var m = u("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
21
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
22
|
+
outline: "border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
23
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
24
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
25
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
29
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
30
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
31
|
+
icon: "size-9"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default"
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
function h({ className: e, variant: t, size: n, asChild: i = !1, ...a }) {
|
|
40
|
+
return /* @__PURE__ */ r(i ? l : "button", {
|
|
41
|
+
"data-slot": "button",
|
|
42
|
+
className: p(m({
|
|
43
|
+
variant: t,
|
|
44
|
+
size: n,
|
|
45
|
+
className: e
|
|
46
|
+
})),
|
|
47
|
+
...a
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/separator/index.tsx
|
|
52
|
+
function g({ className: e, orientation: t = "horizontal", decorative: n = !0, ...i }) {
|
|
53
|
+
return /* @__PURE__ */ r(d.Root, {
|
|
54
|
+
"data-slot": "separator",
|
|
55
|
+
decorative: n,
|
|
56
|
+
orientation: t,
|
|
57
|
+
className: p("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", e),
|
|
58
|
+
...i
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/input/index.tsx
|
|
63
|
+
var _ = u("file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-card px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-card file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
64
|
+
variants: { size: {
|
|
65
|
+
default: "h-9",
|
|
66
|
+
sm: "h-8"
|
|
67
|
+
} },
|
|
68
|
+
defaultVariants: { size: "default" }
|
|
69
|
+
});
|
|
70
|
+
function v({ className: t, type: n, size: s, ref: c, ...l }) {
|
|
71
|
+
let [u, d] = e.useState(!1);
|
|
72
|
+
return n === "password" ? /* @__PURE__ */ i("div", {
|
|
73
|
+
className: "relative",
|
|
74
|
+
children: [/* @__PURE__ */ r("input", {
|
|
75
|
+
type: u ? "text" : "password",
|
|
76
|
+
className: p(_({
|
|
77
|
+
size: s,
|
|
78
|
+
className: t
|
|
79
|
+
})),
|
|
80
|
+
ref: c,
|
|
81
|
+
...l
|
|
82
|
+
}), /* @__PURE__ */ r("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
className: "absolute inset-y-0 right-0 flex items-center justify-center w-10 text-muted-foreground focus:outline-none",
|
|
85
|
+
onClick: () => d(!u),
|
|
86
|
+
children: r(u ? a : o, { className: "w-4 h-4" })
|
|
87
|
+
})]
|
|
88
|
+
}) : /* @__PURE__ */ r("input", {
|
|
89
|
+
type: n,
|
|
90
|
+
"data-slot": "input",
|
|
91
|
+
className: p(_({
|
|
92
|
+
size: s,
|
|
93
|
+
className: t
|
|
94
|
+
})),
|
|
95
|
+
ref: c,
|
|
96
|
+
...l
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/skeleton/index.tsx
|
|
101
|
+
function y({ className: e, ...t }) {
|
|
102
|
+
return /* @__PURE__ */ r("div", {
|
|
103
|
+
"data-slot": "skeleton",
|
|
104
|
+
className: p("bg-accent animate-pulse rounded-md", e),
|
|
105
|
+
...t
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/tooltip/index.tsx
|
|
110
|
+
function b({ delayDuration: e = 0, ...t }) {
|
|
111
|
+
return /* @__PURE__ */ r(f.Provider, {
|
|
112
|
+
"data-slot": "tooltip-provider",
|
|
113
|
+
delayDuration: e,
|
|
114
|
+
...t
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function x({ ...e }) {
|
|
118
|
+
return /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(f.Root, {
|
|
119
|
+
"data-slot": "tooltip",
|
|
120
|
+
...e
|
|
121
|
+
}) });
|
|
122
|
+
}
|
|
123
|
+
function S({ ...e }) {
|
|
124
|
+
return /* @__PURE__ */ r(f.Trigger, {
|
|
125
|
+
"data-slot": "tooltip-trigger",
|
|
126
|
+
...e
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function C({ className: e, sideOffset: t = 0, children: n, ...a }) {
|
|
130
|
+
return /* @__PURE__ */ r(f.Portal, { children: /* @__PURE__ */ i(f.Content, {
|
|
131
|
+
"data-slot": "tooltip-content",
|
|
132
|
+
sideOffset: t,
|
|
133
|
+
className: p("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", e),
|
|
134
|
+
...a,
|
|
135
|
+
children: [n, /* @__PURE__ */ r(f.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
|
|
136
|
+
}) });
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/components/sheet/index.tsx
|
|
140
|
+
function w({ ...e }) {
|
|
141
|
+
return /* @__PURE__ */ r(c.Root, {
|
|
142
|
+
"data-slot": "sheet",
|
|
143
|
+
...e
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function T({ ...e }) {
|
|
147
|
+
return /* @__PURE__ */ r(c.Trigger, {
|
|
148
|
+
"data-slot": "sheet-trigger",
|
|
149
|
+
...e
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function E({ ...e }) {
|
|
153
|
+
return /* @__PURE__ */ r(c.Close, {
|
|
154
|
+
"data-slot": "sheet-close",
|
|
155
|
+
...e
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function D({ ...e }) {
|
|
159
|
+
return /* @__PURE__ */ r(c.Portal, {
|
|
160
|
+
"data-slot": "sheet-portal",
|
|
161
|
+
...e
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function O({ className: e, onContextMenu: t, ...n }) {
|
|
165
|
+
return /* @__PURE__ */ r(c.Overlay, {
|
|
166
|
+
"data-slot": "sheet-overlay",
|
|
167
|
+
className: p("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
|
|
168
|
+
onContextMenu: (e) => {
|
|
169
|
+
e.stopPropagation(), t?.(e);
|
|
170
|
+
},
|
|
171
|
+
...n
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function k({ className: e, children: t, side: n = "right", onContextMenu: a, ...o }) {
|
|
175
|
+
return /* @__PURE__ */ i(D, { children: [/* @__PURE__ */ r(O, {}), /* @__PURE__ */ i(c.Content, {
|
|
176
|
+
"data-slot": "sheet-content",
|
|
177
|
+
className: p("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", n === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", n === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
|
|
178
|
+
onContextMenu: (e) => {
|
|
179
|
+
e.stopPropagation(), a?.(e);
|
|
180
|
+
},
|
|
181
|
+
...o,
|
|
182
|
+
children: [t, /* @__PURE__ */ i(c.Close, {
|
|
183
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-[13px] right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none z-50",
|
|
184
|
+
children: [/* @__PURE__ */ r(s, { className: "size-4" }), /* @__PURE__ */ r("span", {
|
|
185
|
+
className: "sr-only",
|
|
186
|
+
children: "Close"
|
|
187
|
+
})]
|
|
188
|
+
})]
|
|
189
|
+
})] });
|
|
190
|
+
}
|
|
191
|
+
function A({ className: e, ...t }) {
|
|
192
|
+
return /* @__PURE__ */ r("div", {
|
|
193
|
+
"data-slot": "sheet-header",
|
|
194
|
+
className: p("flex border-b pb-2 flex-col gap-1.5 px-4 py-2 ", e),
|
|
195
|
+
...t
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function j({ className: e, ...t }) {
|
|
199
|
+
return /* @__PURE__ */ r("div", {
|
|
200
|
+
"data-slot": "sheet-footer",
|
|
201
|
+
className: p("mt-auto flex flex-col gap-2 p-4 border-t", e),
|
|
202
|
+
...t
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function M({ className: e, ...t }) {
|
|
206
|
+
return /* @__PURE__ */ r(c.Title, {
|
|
207
|
+
"data-slot": "sheet-title",
|
|
208
|
+
className: p("text-base font-normal text-foreground", e),
|
|
209
|
+
...t
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function N({ className: e, ...t }) {
|
|
213
|
+
return /* @__PURE__ */ r(c.Description, {
|
|
214
|
+
"data-slot": "sheet-description",
|
|
215
|
+
className: p("text-muted-foreground text-sm", e),
|
|
216
|
+
...t
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
//#endregion
|
|
220
|
+
export { h as _, j as a, T as c, b as d, S as f, g, _ as h, N as i, x as l, v as m, E as n, A as o, y as p, k as r, M as s, w as t, C as u, m as v, p as y };
|
|
221
|
+
|
|
222
|
+
//# sourceMappingURL=sheet-BAH_9-wM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-BAH_9-wM.js","names":[],"sources":["../src/utilities/class/index.ts","../src/components/button/index.tsx","../src/components/separator/index.tsx","../src/components/input/index.tsx","../src/components/skeleton/index.tsx","../src/components/tooltip/index.tsx","../src/components/sheet/index.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst buttonVariants = cva(\n \"inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n","import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Separator }\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\nimport { EyeIcon, EyeOffIcon } from \"lucide-react\";\n\nconst inputVariants = cva(\n \"file:text-foreground placeholder:text-muted-foreground dark:bg-input/30 border-input flex w-full min-w-0 rounded-md border bg-card px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-card file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n size: {\n default: \"h-9\",\n sm: \"h-8\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n);\n\nfunction Input({\n className,\n type,\n size,\n ref,\n ...props\n}: Omit<React.ComponentProps<\"input\">, \"size\"> &\n VariantProps<typeof inputVariants>) {\n const [showPassword, setShowPassword] = React.useState(false);\n\n if (type === \"password\") {\n return (\n <div className=\"relative\">\n <input\n type={showPassword ? \"text\" : \"password\"}\n className={cn(inputVariants({ size, className }))}\n ref={ref}\n {...props}\n />\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-0 flex items-center justify-center w-10 text-muted-foreground focus:outline-none\"\n onClick={() => setShowPassword(!showPassword)}\n >\n {showPassword ? (\n <EyeIcon className=\"w-4 h-4\" />\n ) : (\n <EyeOffIcon className=\"w-4 h-4\" />\n )}\n </button>\n </div>\n );\n }\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(inputVariants({ size, className }))}\n ref={ref}\n {...props}\n />\n );\n}\n\nexport { Input, inputVariants };\n","import { cn } from \"@/utilities/\";\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\"bg-accent animate-pulse rounded-md\", className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","import * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { cn } from \"@/utilities/\";\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance\",\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","import * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {\n return (\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n />\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-[13px] right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none z-50\">\n <XIcon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\n \"flex border-b pb-2 flex-col gap-1.5 px-4 py-2 \",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4 border-t\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-base font-normal text-foreground\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":"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"}
|
package/dist/sidebar.js
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { _ as e, d as t, f as n, g as r, i, l as a, m as o, o as s, p as c, r as l, s as u, t as d, u as f, y as p } from "./sheet-BAH_9-wM.js";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
4
|
+
import { PanelLeftIcon as _ } from "lucide-react";
|
|
5
|
+
import { Slot as v } from "@radix-ui/react-slot";
|
|
6
|
+
import { cva as y } from "class-variance-authority";
|
|
7
|
+
//#region src/components/sidebar/index.tsx
|
|
8
|
+
var b = "sidebar_state", x = 3600 * 24 * 7, S = "16rem", C = "18rem", w = "3rem", T = "b", E = 1280, D = m.createContext(null);
|
|
9
|
+
function O() {
|
|
10
|
+
let e = m.useContext(D);
|
|
11
|
+
if (!e) throw Error("useSidebar must be used within a SidebarProvider.");
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
function k({ defaultOpen: e = !0, open: n, onOpenChange: r, className: i, style: a, children: o, ...s }) {
|
|
15
|
+
let [c, l] = m.useState(() => typeof window > "u" ? !1 : !window.matchMedia(`(min-width: ${E}px)`).matches);
|
|
16
|
+
m.useEffect(() => {
|
|
17
|
+
let e = window.matchMedia(`(min-width: ${E}px)`), t = (e) => {
|
|
18
|
+
l(!e.matches);
|
|
19
|
+
};
|
|
20
|
+
return e.addEventListener("change", t), l(!e.matches), () => e.removeEventListener("change", t);
|
|
21
|
+
}, []);
|
|
22
|
+
let [u, d] = m.useState(!1), [f, g] = m.useState(e), _ = n ?? f, v = m.useCallback((e) => {
|
|
23
|
+
let t = typeof e == "function" ? e(_) : e;
|
|
24
|
+
r ? r(t) : g(t), document.cookie = `${b}=${t}; path=/; max-age=${x}`;
|
|
25
|
+
}, [r, _]), y = m.useCallback(() => c ? d((e) => !e) : v((e) => !e), [
|
|
26
|
+
c,
|
|
27
|
+
v,
|
|
28
|
+
d
|
|
29
|
+
]);
|
|
30
|
+
m.useEffect(() => {
|
|
31
|
+
let e = (e) => {
|
|
32
|
+
e.key === T && (e.metaKey || e.ctrlKey) && (e.preventDefault(), y());
|
|
33
|
+
};
|
|
34
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
35
|
+
}, [y]);
|
|
36
|
+
let C = _ ? "expanded" : "collapsed", O = m.useMemo(() => ({
|
|
37
|
+
state: C,
|
|
38
|
+
open: _,
|
|
39
|
+
setOpen: v,
|
|
40
|
+
isMobile: c,
|
|
41
|
+
openMobile: u,
|
|
42
|
+
setOpenMobile: d,
|
|
43
|
+
toggleSidebar: y
|
|
44
|
+
}), [
|
|
45
|
+
C,
|
|
46
|
+
_,
|
|
47
|
+
v,
|
|
48
|
+
c,
|
|
49
|
+
u,
|
|
50
|
+
d,
|
|
51
|
+
y
|
|
52
|
+
]);
|
|
53
|
+
return /* @__PURE__ */ h(D.Provider, {
|
|
54
|
+
value: O,
|
|
55
|
+
children: /* @__PURE__ */ h(t, {
|
|
56
|
+
delayDuration: 0,
|
|
57
|
+
children: /* @__PURE__ */ h("div", {
|
|
58
|
+
"data-slot": "sidebar-wrapper",
|
|
59
|
+
style: {
|
|
60
|
+
"--sidebar-width": S,
|
|
61
|
+
"--sidebar-width-icon": w,
|
|
62
|
+
...a
|
|
63
|
+
},
|
|
64
|
+
className: p("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", i),
|
|
65
|
+
...s,
|
|
66
|
+
children: o
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function A({ side: e = "left", variant: t = "sidebar", collapsible: n = "offcanvas", className: r, children: a, ...o }) {
|
|
72
|
+
let { isMobile: c, state: f, openMobile: m, setOpenMobile: _ } = O();
|
|
73
|
+
return n === "none" ? /* @__PURE__ */ h("div", {
|
|
74
|
+
"data-slot": "sidebar",
|
|
75
|
+
className: p("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", r),
|
|
76
|
+
...o,
|
|
77
|
+
children: a
|
|
78
|
+
}) : c ? /* @__PURE__ */ h(d, {
|
|
79
|
+
open: m,
|
|
80
|
+
onOpenChange: _,
|
|
81
|
+
...o,
|
|
82
|
+
children: /* @__PURE__ */ g(l, {
|
|
83
|
+
"data-sidebar": "sidebar",
|
|
84
|
+
"data-slot": "sidebar",
|
|
85
|
+
"data-mobile": "true",
|
|
86
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
87
|
+
style: { "--sidebar-width": C },
|
|
88
|
+
side: e,
|
|
89
|
+
children: [/* @__PURE__ */ g(s, {
|
|
90
|
+
className: "sr-only",
|
|
91
|
+
children: [/* @__PURE__ */ h(u, { children: "Sidebar" }), /* @__PURE__ */ h(i, { children: "Displays the mobile sidebar." })]
|
|
92
|
+
}), /* @__PURE__ */ h("div", {
|
|
93
|
+
className: "flex h-full w-full flex-col",
|
|
94
|
+
children: a
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
}) : /* @__PURE__ */ g("div", {
|
|
98
|
+
className: "group peer text-sidebar-foreground hidden xl:block",
|
|
99
|
+
"data-state": f,
|
|
100
|
+
"data-collapsible": f === "collapsed" ? n : "",
|
|
101
|
+
"data-variant": t,
|
|
102
|
+
"data-side": e,
|
|
103
|
+
"data-slot": "sidebar",
|
|
104
|
+
children: [/* @__PURE__ */ h("div", {
|
|
105
|
+
"data-slot": "sidebar-gap",
|
|
106
|
+
className: p("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", t === "floating" || t === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
107
|
+
}), /* @__PURE__ */ h("div", {
|
|
108
|
+
"data-slot": "sidebar-container",
|
|
109
|
+
className: p("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", e === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", t === "floating" || t === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", r),
|
|
110
|
+
...o,
|
|
111
|
+
children: /* @__PURE__ */ h("div", {
|
|
112
|
+
"data-sidebar": "sidebar",
|
|
113
|
+
"data-slot": "sidebar-inner",
|
|
114
|
+
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-md group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
115
|
+
children: a
|
|
116
|
+
})
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function j({ className: t, onClick: n, ...r }) {
|
|
121
|
+
let { toggleSidebar: i } = O();
|
|
122
|
+
return /* @__PURE__ */ g(e, {
|
|
123
|
+
"data-sidebar": "trigger",
|
|
124
|
+
"data-slot": "sidebar-trigger",
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
size: "icon",
|
|
127
|
+
className: p("size-7", t),
|
|
128
|
+
onClick: (e) => {
|
|
129
|
+
n?.(e), i();
|
|
130
|
+
},
|
|
131
|
+
...r,
|
|
132
|
+
children: [/* @__PURE__ */ h(_, {}), /* @__PURE__ */ h("span", {
|
|
133
|
+
className: "sr-only",
|
|
134
|
+
children: "Toggle Sidebar"
|
|
135
|
+
})]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function M({ className: e, ...t }) {
|
|
139
|
+
let { toggleSidebar: n } = O();
|
|
140
|
+
return /* @__PURE__ */ h("button", {
|
|
141
|
+
"data-sidebar": "rail",
|
|
142
|
+
"data-slot": "sidebar-rail",
|
|
143
|
+
"aria-label": "Toggle Sidebar",
|
|
144
|
+
tabIndex: -1,
|
|
145
|
+
onClick: n,
|
|
146
|
+
title: "Toggle Sidebar",
|
|
147
|
+
className: p("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", e),
|
|
148
|
+
...t
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function N({ className: e, ...t }) {
|
|
152
|
+
return /* @__PURE__ */ h("main", {
|
|
153
|
+
"data-slot": "sidebar-inset",
|
|
154
|
+
className: p("bg-background relative flex w-full flex-1 flex-col", "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-md md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", e),
|
|
155
|
+
...t
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function P({ className: e, ...t }) {
|
|
159
|
+
return /* @__PURE__ */ h(o, {
|
|
160
|
+
"data-slot": "sidebar-input",
|
|
161
|
+
"data-sidebar": "input",
|
|
162
|
+
className: p("bg-background h-8 w-full shadow-none", e),
|
|
163
|
+
...t
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function F({ className: e, ...t }) {
|
|
167
|
+
return /* @__PURE__ */ h("div", {
|
|
168
|
+
"data-slot": "sidebar-header",
|
|
169
|
+
"data-sidebar": "header",
|
|
170
|
+
className: p("flex flex-col gap-2 px-2 pt-2", e),
|
|
171
|
+
...t
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function I({ className: e, ...t }) {
|
|
175
|
+
return /* @__PURE__ */ h("div", {
|
|
176
|
+
"data-slot": "sidebar-footer",
|
|
177
|
+
"data-sidebar": "footer",
|
|
178
|
+
className: p("flex flex-col gap-2 p-2", e),
|
|
179
|
+
...t
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function L({ className: e, ...t }) {
|
|
183
|
+
return /* @__PURE__ */ h(r, {
|
|
184
|
+
"data-slot": "sidebar-separator",
|
|
185
|
+
"data-sidebar": "separator",
|
|
186
|
+
className: p("bg-sidebar-border mx-2 w-auto", e),
|
|
187
|
+
...t
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function R({ className: e, ...t }) {
|
|
191
|
+
return /* @__PURE__ */ h("div", {
|
|
192
|
+
"data-slot": "sidebar-content",
|
|
193
|
+
"data-sidebar": "content",
|
|
194
|
+
className: p("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", e),
|
|
195
|
+
...t
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function z({ className: e, ...t }) {
|
|
199
|
+
return /* @__PURE__ */ h("div", {
|
|
200
|
+
"data-slot": "sidebar-group",
|
|
201
|
+
"data-sidebar": "group",
|
|
202
|
+
className: p("relative flex w-full min-w-0 flex-col p-2", e),
|
|
203
|
+
...t
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function B({ className: e, asChild: t = !1, ...n }) {
|
|
207
|
+
return /* @__PURE__ */ h(t ? v : "div", {
|
|
208
|
+
"data-slot": "sidebar-group-label",
|
|
209
|
+
"data-sidebar": "group-label",
|
|
210
|
+
className: p("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", e),
|
|
211
|
+
...n
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function V({ className: e, asChild: t = !1, ...n }) {
|
|
215
|
+
return /* @__PURE__ */ h(t ? v : "button", {
|
|
216
|
+
"data-slot": "sidebar-group-action",
|
|
217
|
+
"data-sidebar": "group-action",
|
|
218
|
+
className: p("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", e),
|
|
219
|
+
...n
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function H({ className: e, ...t }) {
|
|
223
|
+
return /* @__PURE__ */ h("div", {
|
|
224
|
+
"data-slot": "sidebar-group-content",
|
|
225
|
+
"data-sidebar": "group-content",
|
|
226
|
+
className: p("w-full text-sm", e),
|
|
227
|
+
...t
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function U({ className: e, ...t }) {
|
|
231
|
+
return /* @__PURE__ */ h("ul", {
|
|
232
|
+
"data-slot": "sidebar-menu",
|
|
233
|
+
"data-sidebar": "menu",
|
|
234
|
+
className: p("flex w-full min-w-0 flex-col", e),
|
|
235
|
+
...t
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
function W({ className: e, ...t }) {
|
|
239
|
+
return /* @__PURE__ */ h("li", {
|
|
240
|
+
"data-slot": "sidebar-menu-item",
|
|
241
|
+
"data-sidebar": "menu-item",
|
|
242
|
+
className: p("group/menu-item relative", e),
|
|
243
|
+
...t
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
var G = y("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
|
247
|
+
variants: {
|
|
248
|
+
variant: {
|
|
249
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
250
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
251
|
+
},
|
|
252
|
+
size: {
|
|
253
|
+
default: "h-8 text-sm",
|
|
254
|
+
sm: "h-7 text-xs",
|
|
255
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
defaultVariants: {
|
|
259
|
+
variant: "default",
|
|
260
|
+
size: "default"
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
function K({ asChild: e = !1, isActive: t = !1, variant: r = "default", size: i = "default", tooltip: o, className: s, ...c }) {
|
|
264
|
+
let l = e ? v : "button", { isMobile: u, state: d } = O(), m = /* @__PURE__ */ h(l, {
|
|
265
|
+
"data-slot": "sidebar-menu-button",
|
|
266
|
+
"data-sidebar": "menu-button",
|
|
267
|
+
"data-size": i,
|
|
268
|
+
"data-active": t,
|
|
269
|
+
className: p(G({
|
|
270
|
+
variant: r,
|
|
271
|
+
size: i
|
|
272
|
+
}), s),
|
|
273
|
+
...c
|
|
274
|
+
});
|
|
275
|
+
return o ? (typeof o == "string" && (o = { children: o }), /* @__PURE__ */ g(a, { children: [/* @__PURE__ */ h(n, {
|
|
276
|
+
asChild: !0,
|
|
277
|
+
children: m
|
|
278
|
+
}), /* @__PURE__ */ h(f, {
|
|
279
|
+
side: "right",
|
|
280
|
+
align: "center",
|
|
281
|
+
hidden: d !== "collapsed" || u,
|
|
282
|
+
...o
|
|
283
|
+
})] })) : m;
|
|
284
|
+
}
|
|
285
|
+
function q({ className: e, asChild: t = !1, showOnHover: n = !1, ...r }) {
|
|
286
|
+
return /* @__PURE__ */ h(t ? v : "button", {
|
|
287
|
+
"data-slot": "sidebar-menu-action",
|
|
288
|
+
"data-sidebar": "menu-action",
|
|
289
|
+
className: p("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", n && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0", e),
|
|
290
|
+
...r
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function J({ className: e, ...t }) {
|
|
294
|
+
return /* @__PURE__ */ h("div", {
|
|
295
|
+
"data-slot": "sidebar-menu-badge",
|
|
296
|
+
"data-sidebar": "menu-badge",
|
|
297
|
+
className: p("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", e),
|
|
298
|
+
...t
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function Y({ className: e, showIcon: t = !1, ...n }) {
|
|
302
|
+
let r = m.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
303
|
+
return /* @__PURE__ */ g("div", {
|
|
304
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
305
|
+
"data-sidebar": "menu-skeleton",
|
|
306
|
+
className: p("flex h-8 items-center gap-2 rounded-md px-2", e),
|
|
307
|
+
...n,
|
|
308
|
+
children: [t && /* @__PURE__ */ h(c, {
|
|
309
|
+
className: "size-4 rounded-md",
|
|
310
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
311
|
+
}), /* @__PURE__ */ h(c, {
|
|
312
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
313
|
+
"data-sidebar": "menu-skeleton-text",
|
|
314
|
+
style: { "--skeleton-width": r }
|
|
315
|
+
})]
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function X({ className: e, ...t }) {
|
|
319
|
+
return /* @__PURE__ */ h("ul", {
|
|
320
|
+
"data-slot": "sidebar-menu-sub",
|
|
321
|
+
"data-sidebar": "menu-sub",
|
|
322
|
+
className: p("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col border-l px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", e),
|
|
323
|
+
...t
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
function Z({ className: e, ...t }) {
|
|
327
|
+
return /* @__PURE__ */ h("li", {
|
|
328
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
329
|
+
"data-sidebar": "menu-sub-item",
|
|
330
|
+
className: p("group/menu-sub-item relative", e),
|
|
331
|
+
...t
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function Q({ asChild: e = !1, size: t = "md", isActive: n = !1, className: r, ...i }) {
|
|
335
|
+
return /* @__PURE__ */ h(e ? v : "a", {
|
|
336
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
337
|
+
"data-sidebar": "menu-sub-button",
|
|
338
|
+
"data-size": t,
|
|
339
|
+
"data-active": n,
|
|
340
|
+
className: p("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", t === "sm" && "text-xs", t === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", r),
|
|
341
|
+
...i
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
export { A as Sidebar, R as SidebarContent, I as SidebarFooter, z as SidebarGroup, V as SidebarGroupAction, H as SidebarGroupContent, B as SidebarGroupLabel, F as SidebarHeader, P as SidebarInput, N as SidebarInset, U as SidebarMenu, q as SidebarMenuAction, J as SidebarMenuBadge, K as SidebarMenuButton, W as SidebarMenuItem, Y as SidebarMenuSkeleton, X as SidebarMenuSub, Q as SidebarMenuSubButton, Z as SidebarMenuSubItem, k as SidebarProvider, M as SidebarRail, L as SidebarSeparator, j as SidebarTrigger, O as useSidebar };
|
|
346
|
+
|
|
347
|
+
//# sourceMappingURL=sidebar.js.map
|