@jbpark/ui-kit 2.0.0 → 2.1.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/dist/Menu.d.mts +2 -2
- package/dist/Menu.mjs +5 -5
- package/dist/{Reveals-BpnYZJUk.mjs → Reveals-BMHeo2nr.mjs} +1 -1
- package/dist/Reveals.mjs +2 -2
- package/dist/{Typography-LYvEW-c8.mjs → Typography-DJSakhLz.mjs} +1 -1
- package/dist/Typography.d.mts +1 -1
- package/dist/Typography.mjs +2 -2
- package/dist/{index-BO7hcWjo.d.mts → index-CbElazGe.d.mts} +12 -10
- package/dist/{index-BqaluEQ4.d.mts → index-DX9rV4ki.d.mts} +10 -10
- package/dist/index.d.mts +67 -43
- package/dist/index.mjs +5 -5
- package/dist/output.css +185 -33
- package/dist/{src-C3CveHCK.mjs → src-Da3Y-f7V.mjs} +648 -461
- package/dist/utils-CssUrKWE.mjs +16 -0
- package/dist/utils.d.mts +3 -1
- package/dist/utils.mjs +2 -2
- package/package.json +2 -1
- package/dist/utils-DEenfsJ-.mjs +0 -10
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { t as cn } from "./utils-
|
|
2
|
-
import { t as Typography_default } from "./Typography-
|
|
1
|
+
import { n as renderConditional, t as cn } from "./utils-CssUrKWE.mjs";
|
|
2
|
+
import { t as Typography_default } from "./Typography-DJSakhLz.mjs";
|
|
3
3
|
import { ArrowUp, Check, ChevronDown, CircleQuestionMark, CircleX, Info, Loader2, LoaderCircle, OctagonAlert, OctagonX, Search, Square, SquareCheck, X, XIcon } from "lucide-react";
|
|
4
4
|
import * as React$1 from "react";
|
|
5
|
-
import React, { Children, createElement, forwardRef, useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import React, { Children, createElement, forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
6
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
7
9
|
import { cva } from "class-variance-authority";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
11
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
12
|
+
import { Drawer } from "vaul";
|
|
10
13
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
11
|
-
import
|
|
14
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
12
15
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
13
16
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
14
|
-
import
|
|
17
|
+
import { useIntersectionObserver, useThrottle, useWindowScroll } from "@uidotdev/usehooks";
|
|
15
18
|
import { AnimatePresence, motion } from "motion/react";
|
|
16
19
|
import { useResponsiveSize } from "@jbpark/use-hooks";
|
|
17
20
|
import { useGSAP } from "@gsap/react";
|
|
18
|
-
import { Drawer } from "vaul";
|
|
19
21
|
import { createPortal } from "react-dom";
|
|
20
22
|
import { createRoot } from "react-dom/client";
|
|
21
23
|
import { v4 } from "uuid";
|
|
22
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
23
24
|
import { Autoplay, EffectCards, Navigation, Scrollbar } from "swiper/modules";
|
|
24
25
|
import { Swiper, SwiperSlide } from "swiper/react";
|
|
25
26
|
import "swiper/css";
|
|
@@ -28,6 +29,61 @@ import "swiper/css/effect-cards";
|
|
|
28
29
|
import "swiper/css/navigation";
|
|
29
30
|
import "swiper/css/scrollbar";
|
|
30
31
|
|
|
32
|
+
//#region rolldown:runtime
|
|
33
|
+
var __defProp = Object.defineProperty;
|
|
34
|
+
var __exportAll = (all, symbols) => {
|
|
35
|
+
let target = {};
|
|
36
|
+
for (var name in all) {
|
|
37
|
+
__defProp(target, name, {
|
|
38
|
+
get: all[name],
|
|
39
|
+
enumerable: true
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (symbols) {
|
|
43
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
44
|
+
}
|
|
45
|
+
return target;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/core/accordion.tsx
|
|
50
|
+
var accordion_exports = /* @__PURE__ */ __exportAll({
|
|
51
|
+
Accordion: () => Accordion$1,
|
|
52
|
+
AccordionContent: () => AccordionContent$1,
|
|
53
|
+
AccordionItem: () => AccordionItem$1,
|
|
54
|
+
AccordionTrigger: () => AccordionTrigger$1
|
|
55
|
+
});
|
|
56
|
+
const Accordion$1 = AccordionPrimitive.Root;
|
|
57
|
+
const AccordionItem$1 = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
|
|
58
|
+
ref,
|
|
59
|
+
className: cn("border-b", className),
|
|
60
|
+
...props
|
|
61
|
+
}));
|
|
62
|
+
AccordionItem$1.displayName = "AccordionItem";
|
|
63
|
+
const AccordionTrigger$1 = React$1.forwardRef(({ expandIcon, className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
|
|
64
|
+
className: "flex",
|
|
65
|
+
children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
|
|
66
|
+
ref,
|
|
67
|
+
className: cn(`flex flex-1 items-center justify-between py-4 text-left text-sm
|
|
68
|
+
font-medium transition-all hover:underline
|
|
69
|
+
[&[data-state=open]>svg]:rotate-180`, className),
|
|
70
|
+
...props,
|
|
71
|
+
children: [children, expandIcon || /* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground h-4 w-4 shrink-0 transition-transform\n duration-200" })]
|
|
72
|
+
})
|
|
73
|
+
}));
|
|
74
|
+
AccordionTrigger$1.displayName = AccordionPrimitive.Trigger.displayName;
|
|
75
|
+
const AccordionContent$1 = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
76
|
+
ref,
|
|
77
|
+
className: "data-[state=closed]:animate-accordion-up\n data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
78
|
+
...props,
|
|
79
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: cn("pt-0 pb-4", className),
|
|
81
|
+
children
|
|
82
|
+
})
|
|
83
|
+
}));
|
|
84
|
+
AccordionContent$1.displayName = AccordionPrimitive.Content.displayName;
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
31
87
|
//#region src/core/button.tsx
|
|
32
88
|
const buttonVariants = cva("inline-flex 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", {
|
|
33
89
|
variants: {
|
|
@@ -63,8 +119,363 @@ function Button$2({ className, variant, size, asChild = false, ...props }) {
|
|
|
63
119
|
});
|
|
64
120
|
}
|
|
65
121
|
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/core/checkbox.tsx
|
|
124
|
+
var checkbox_exports = /* @__PURE__ */ __exportAll({ Checkbox: () => Checkbox$1 });
|
|
125
|
+
const Checkbox$1 = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
126
|
+
ref,
|
|
127
|
+
className: cn(`peer border-primary focus-visible:ring-ring
|
|
128
|
+
data-[state=checked]:bg-primary
|
|
129
|
+
data-[state=checked]:text-primary-foreground grid h-4 w-4 shrink-0
|
|
130
|
+
place-content-center rounded-sm border shadow focus-visible:ring-1
|
|
131
|
+
focus-visible:outline-none disabled:cursor-not-allowed
|
|
132
|
+
disabled:opacity-50`, className),
|
|
133
|
+
...props,
|
|
134
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
135
|
+
className: cn("grid place-content-center text-current"),
|
|
136
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
|
|
137
|
+
})
|
|
138
|
+
}));
|
|
139
|
+
Checkbox$1.displayName = CheckboxPrimitive.Root.displayName;
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/core/dialog.tsx
|
|
143
|
+
var dialog_exports = /* @__PURE__ */ __exportAll({
|
|
144
|
+
Dialog: () => Dialog$1,
|
|
145
|
+
DialogClose: () => DialogClose,
|
|
146
|
+
DialogContent: () => DialogContent$1,
|
|
147
|
+
DialogDescription: () => DialogDescription$1,
|
|
148
|
+
DialogFooter: () => DialogFooter$1,
|
|
149
|
+
DialogHeader: () => DialogHeader$1,
|
|
150
|
+
DialogOverlay: () => DialogOverlay,
|
|
151
|
+
DialogPortal: () => DialogPortal,
|
|
152
|
+
DialogTitle: () => DialogTitle$1,
|
|
153
|
+
DialogTrigger: () => DialogTrigger
|
|
154
|
+
});
|
|
155
|
+
function Dialog$1({ ...props }) {
|
|
156
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
|
|
157
|
+
"data-slot": "dialog",
|
|
158
|
+
...props
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function DialogTrigger({ ...props }) {
|
|
162
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
|
|
163
|
+
"data-slot": "dialog-trigger",
|
|
164
|
+
...props
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function DialogPortal({ ...props }) {
|
|
168
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
|
|
169
|
+
"data-slot": "dialog-portal",
|
|
170
|
+
...props
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function DialogClose({ ...props }) {
|
|
174
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, {
|
|
175
|
+
"data-slot": "dialog-close",
|
|
176
|
+
...props
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function DialogOverlay({ className, ...props }) {
|
|
180
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
|
|
181
|
+
"data-slot": "dialog-overlay",
|
|
182
|
+
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
183
|
+
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
184
|
+
z-50 bg-black/50`, className),
|
|
185
|
+
...props
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function DialogContent$1({ className, children, showCloseButton = true, classNames, closeIcon, closable, container, onCancel, ...props }) {
|
|
189
|
+
return /* @__PURE__ */ jsxs(DialogPortal, {
|
|
190
|
+
"data-slot": "dialog-portal",
|
|
191
|
+
container,
|
|
192
|
+
children: [/* @__PURE__ */ jsx(DialogOverlay, { className: cn(classNames?.mask) }), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
193
|
+
"data-slot": "dialog-content",
|
|
194
|
+
className: cn(`bg-background data-[state=open]:animate-in
|
|
195
|
+
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
196
|
+
data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
|
197
|
+
data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid
|
|
198
|
+
w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%]
|
|
199
|
+
gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`, className),
|
|
200
|
+
...props,
|
|
201
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
202
|
+
"data-slot": "dialog-close",
|
|
203
|
+
className: "ring-offset-background focus:ring-ring\n data-[state=open]:bg-accent\n data-[state=open]:text-muted-foreground absolute top-4 right-4\n rounded-xs opacity-70 transition-opacity hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-hidden\n disabled:pointer-events-none [&_svg]:pointer-events-none\n [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
204
|
+
disabled: typeof closable === "object" && closable.disabled,
|
|
205
|
+
onClick: onCancel,
|
|
206
|
+
children: [closeIcon || /* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
207
|
+
className: "sr-only",
|
|
208
|
+
children: "Close"
|
|
209
|
+
})]
|
|
210
|
+
})]
|
|
211
|
+
})]
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function DialogHeader$1({ className, ...props }) {
|
|
215
|
+
return /* @__PURE__ */ jsx("div", {
|
|
216
|
+
"data-slot": "dialog-header",
|
|
217
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
218
|
+
...props
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function DialogFooter$1({ className, ...props }) {
|
|
222
|
+
return /* @__PURE__ */ jsx("div", {
|
|
223
|
+
"data-slot": "dialog-footer",
|
|
224
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
225
|
+
...props
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function DialogTitle$1({ className, ...props }) {
|
|
229
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
|
|
230
|
+
"data-slot": "dialog-title",
|
|
231
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
232
|
+
...props
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function DialogDescription$1({ className, ...props }) {
|
|
236
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
|
|
237
|
+
"data-slot": "dialog-description",
|
|
238
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
239
|
+
...props
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/core/drawer.tsx
|
|
245
|
+
var drawer_exports = /* @__PURE__ */ __exportAll({
|
|
246
|
+
Drawer: () => Drawer$2,
|
|
247
|
+
DrawerClose: () => DrawerClose,
|
|
248
|
+
DrawerContent: () => DrawerContent$1,
|
|
249
|
+
DrawerDescription: () => DrawerDescription$1,
|
|
250
|
+
DrawerFooter: () => DrawerFooter$1,
|
|
251
|
+
DrawerHeader: () => DrawerHeader$1,
|
|
252
|
+
DrawerOverlay: () => DrawerOverlay,
|
|
253
|
+
DrawerPortal: () => DrawerPortal,
|
|
254
|
+
DrawerTitle: () => DrawerTitle$1,
|
|
255
|
+
DrawerTrigger: () => DrawerTrigger
|
|
256
|
+
});
|
|
257
|
+
function Drawer$2({ ...props }) {
|
|
258
|
+
return /* @__PURE__ */ jsx(Drawer.Root, {
|
|
259
|
+
"data-slot": "drawer",
|
|
260
|
+
...props
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function DrawerTrigger({ ...props }) {
|
|
264
|
+
return /* @__PURE__ */ jsx(Drawer.Trigger, {
|
|
265
|
+
"data-slot": "drawer-trigger",
|
|
266
|
+
...props
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function DrawerPortal({ ...props }) {
|
|
270
|
+
return /* @__PURE__ */ jsx(Drawer.Portal, {
|
|
271
|
+
"data-slot": "drawer-portal",
|
|
272
|
+
...props
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function DrawerClose({ ...props }) {
|
|
276
|
+
return /* @__PURE__ */ jsx(Drawer.Close, {
|
|
277
|
+
"data-slot": "drawer-close",
|
|
278
|
+
...props
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
function DrawerOverlay({ className, ...props }) {
|
|
282
|
+
return /* @__PURE__ */ jsx(Drawer.Overlay, {
|
|
283
|
+
"data-slot": "drawer-overlay",
|
|
284
|
+
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
285
|
+
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
286
|
+
z-50 bg-black/50`, className),
|
|
287
|
+
...props
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function DrawerContent$1({ className, classNames = {}, handlebar, mask, children, ...props }) {
|
|
291
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
292
|
+
"data-slot": "drawer-portal",
|
|
293
|
+
children: [/* @__PURE__ */ jsx(DrawerOverlay, { className: cn(classNames?.mask, !mask && "hidden") }), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
294
|
+
"data-slot": "drawer-content",
|
|
295
|
+
className: cn("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", `data-[vaul-drawer-direction=top]:inset-x-0
|
|
296
|
+
data-[vaul-drawer-direction=top]:top-0
|
|
297
|
+
data-[vaul-drawer-direction=top]:mb-24
|
|
298
|
+
data-[vaul-drawer-direction=top]:max-h-[80vh]
|
|
299
|
+
data-[vaul-drawer-direction=top]:rounded-b-lg
|
|
300
|
+
data-[vaul-drawer-direction=top]:border-b`, `data-[vaul-drawer-direction=bottom]:inset-x-0
|
|
301
|
+
data-[vaul-drawer-direction=bottom]:bottom-0
|
|
302
|
+
data-[vaul-drawer-direction=bottom]:mt-24
|
|
303
|
+
data-[vaul-drawer-direction=bottom]:max-h-[80vh]
|
|
304
|
+
data-[vaul-drawer-direction=bottom]:rounded-t-lg
|
|
305
|
+
data-[vaul-drawer-direction=bottom]:border-t`, `data-[vaul-drawer-direction=right]:inset-y-0
|
|
306
|
+
data-[vaul-drawer-direction=right]:right-0
|
|
307
|
+
data-[vaul-drawer-direction=right]:w-3/4
|
|
308
|
+
data-[vaul-drawer-direction=right]:border-l
|
|
309
|
+
data-[vaul-drawer-direction=right]:sm:max-w-sm`, `data-[vaul-drawer-direction=left]:inset-y-0
|
|
310
|
+
data-[vaul-drawer-direction=left]:left-0
|
|
311
|
+
data-[vaul-drawer-direction=left]:w-3/4
|
|
312
|
+
data-[vaul-drawer-direction=left]:border-r
|
|
313
|
+
data-[vaul-drawer-direction=left]:sm:max-w-sm`, className),
|
|
314
|
+
...props,
|
|
315
|
+
children: [/* @__PURE__ */ jsx("div", { className: cn(`bg-muted mx-auto mt-4 hidden h-2 w-25 shrink-0 rounded-full
|
|
316
|
+
group-data-[vaul-drawer-direction=bottom]/drawer-content:block`, classNames?.handlebar, !handlebar && "hidden") }), children]
|
|
317
|
+
})]
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function DrawerHeader$1({ className, ...props }) {
|
|
321
|
+
return /* @__PURE__ */ jsx("div", {
|
|
322
|
+
"data-slot": "drawer-header",
|
|
323
|
+
className: cn(`flex flex-col gap-0.5 p-4
|
|
324
|
+
group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center
|
|
325
|
+
group-data-[vaul-drawer-direction=top]/drawer-content:text-center
|
|
326
|
+
md:gap-1.5 md:text-left`, className),
|
|
327
|
+
...props
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function DrawerFooter$1({ className, ...props }) {
|
|
331
|
+
return /* @__PURE__ */ jsx("div", {
|
|
332
|
+
"data-slot": "drawer-footer",
|
|
333
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
334
|
+
...props
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
function DrawerTitle$1({ className, ...props }) {
|
|
338
|
+
return /* @__PURE__ */ jsx(Drawer.Title, {
|
|
339
|
+
"data-slot": "drawer-title",
|
|
340
|
+
className: cn("text-foreground font-semibold", className),
|
|
341
|
+
...props
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function DrawerDescription$1({ className, ...props }) {
|
|
345
|
+
return /* @__PURE__ */ jsx(Drawer.Description, {
|
|
346
|
+
"data-slot": "drawer-description",
|
|
347
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
348
|
+
...props
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/core/input.tsx
|
|
354
|
+
var input_exports = /* @__PURE__ */ __exportAll({ Input: () => Input$1 });
|
|
355
|
+
const Input$1 = React$1.forwardRef(({ className, type, ...props }, ref) => {
|
|
356
|
+
return /* @__PURE__ */ jsx("input", {
|
|
357
|
+
type,
|
|
358
|
+
className: cn(`border-input file:text-foreground placeholder:text-muted-foreground
|
|
359
|
+
focus-visible:ring-ring flex h-9 w-full rounded-md border
|
|
360
|
+
bg-transparent px-3 py-1 text-base shadow-sm transition-colors
|
|
361
|
+
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
362
|
+
focus-visible:ring-1 focus-visible:outline-none
|
|
363
|
+
disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`, className),
|
|
364
|
+
ref,
|
|
365
|
+
...props
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
Input$1.displayName = "Input";
|
|
369
|
+
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/core/label.tsx
|
|
372
|
+
var label_exports = /* @__PURE__ */ __exportAll({ Label: () => Label$1 });
|
|
373
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
374
|
+
const Label$1 = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
375
|
+
ref,
|
|
376
|
+
className: cn(labelVariants(), className),
|
|
377
|
+
...props
|
|
378
|
+
}));
|
|
379
|
+
Label$1.displayName = LabelPrimitive.Root.displayName;
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/core/popover.tsx
|
|
383
|
+
var popover_exports = /* @__PURE__ */ __exportAll({
|
|
384
|
+
Popover: () => Popover$1,
|
|
385
|
+
PopoverAnchor: () => PopoverAnchor,
|
|
386
|
+
PopoverContent: () => PopoverContent$1,
|
|
387
|
+
PopoverTrigger: () => PopoverTrigger$1
|
|
388
|
+
});
|
|
389
|
+
const Popover$1 = PopoverPrimitive.Root;
|
|
390
|
+
const PopoverTrigger$1 = PopoverPrimitive.Trigger;
|
|
391
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
392
|
+
const PopoverContent$1 = React$1.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
393
|
+
ref,
|
|
394
|
+
align,
|
|
395
|
+
sideOffset,
|
|
396
|
+
className: cn(`bg-popover text-popover-foreground data-[state=open]:animate-in
|
|
397
|
+
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
398
|
+
data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
|
399
|
+
data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2
|
|
400
|
+
data-[side=left]:slide-in-from-right-2
|
|
401
|
+
data-[side=right]:slide-in-from-left-2
|
|
402
|
+
data-[side=top]:slide-in-from-bottom-2 z-50 w-72
|
|
403
|
+
origin-[--radix-popover-content-transform-origin] rounded-md border p-4
|
|
404
|
+
shadow-md outline-none`, className),
|
|
405
|
+
...props
|
|
406
|
+
}) }));
|
|
407
|
+
PopoverContent$1.displayName = PopoverPrimitive.Content.displayName;
|
|
408
|
+
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/core/progress.tsx
|
|
411
|
+
var progress_exports = /* @__PURE__ */ __exportAll({ Progress: () => Progress$1 });
|
|
412
|
+
const Progress$1 = React$1.forwardRef(({ className, barClassName, barStyle, value, ...props }, ref) => /* @__PURE__ */ jsx(ProgressPrimitive.Root, {
|
|
413
|
+
ref,
|
|
414
|
+
className: cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className),
|
|
415
|
+
...props,
|
|
416
|
+
children: /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
|
|
417
|
+
className: cn("bg-primary h-full w-full flex-1 transition-all", barClassName),
|
|
418
|
+
style: {
|
|
419
|
+
transform: `translateX(-${100 - (value || 0)}%)`,
|
|
420
|
+
...barStyle
|
|
421
|
+
}
|
|
422
|
+
})
|
|
423
|
+
}));
|
|
424
|
+
Progress$1.displayName = ProgressPrimitive.Root.displayName;
|
|
425
|
+
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/core/skeleton.tsx
|
|
428
|
+
var skeleton_exports = /* @__PURE__ */ __exportAll({ Skeleton: () => Skeleton$1 });
|
|
429
|
+
function Skeleton$1({ className, ...props }) {
|
|
430
|
+
return /* @__PURE__ */ jsx("div", {
|
|
431
|
+
"data-slot": "skeleton",
|
|
432
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
433
|
+
...props
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/core/switch.tsx
|
|
439
|
+
var switch_exports = /* @__PURE__ */ __exportAll({ Switch: () => Switch$1 });
|
|
440
|
+
function Switch$1({ className, handleClassName, ...props }) {
|
|
441
|
+
return /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
|
|
442
|
+
"data-slot": "switch",
|
|
443
|
+
className: cn(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input
|
|
444
|
+
focus-visible:border-ring focus-visible:ring-ring/50
|
|
445
|
+
dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8
|
|
446
|
+
shrink-0 items-center rounded-full border border-transparent shadow-xs
|
|
447
|
+
transition-all outline-none focus-visible:ring-[3px]
|
|
448
|
+
disabled:cursor-not-allowed disabled:opacity-50`, className),
|
|
449
|
+
...props,
|
|
450
|
+
children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, {
|
|
451
|
+
"data-slot": "switch-thumb",
|
|
452
|
+
className: cn(`bg-background dark:data-[state=unchecked]:bg-foreground
|
|
453
|
+
dark:data-[state=checked]:bg-primary-foreground pointer-events-none
|
|
454
|
+
block size-4 rounded-full ring-0 transition-transform
|
|
455
|
+
data-[state=checked]:translate-x-[calc(100%-2px)]
|
|
456
|
+
data-[state=unchecked]:translate-x-0`, handleClassName)
|
|
457
|
+
})
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/core/textarea.tsx
|
|
463
|
+
var textarea_exports = /* @__PURE__ */ __exportAll({ Textarea: () => Textarea });
|
|
464
|
+
const Textarea = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
465
|
+
return /* @__PURE__ */ jsx("textarea", {
|
|
466
|
+
className: cn(`border-input placeholder:text-muted-foreground focus-visible:ring-ring
|
|
467
|
+
flex min-h-15 w-full rounded-md border bg-transparent px-3 py-2
|
|
468
|
+
text-base shadow-sm focus-visible:ring-1 focus-visible:outline-none
|
|
469
|
+
disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`, className),
|
|
470
|
+
ref,
|
|
471
|
+
...props
|
|
472
|
+
});
|
|
473
|
+
});
|
|
474
|
+
Textarea.displayName = "Textarea";
|
|
475
|
+
|
|
66
476
|
//#endregion
|
|
67
477
|
//#region src/components/atoms/Button/index.tsx
|
|
478
|
+
const Core$6 = Button$2;
|
|
68
479
|
const variantClasses = {
|
|
69
480
|
solid: "",
|
|
70
481
|
outlined: cn("border border-[rgb(var(--btn-border)/0.5)]", "bg-background text-foreground", "hover:bg-accent"),
|
|
@@ -87,7 +498,8 @@ const Button$1 = ({ icon, className, variant = "solid", size = "medium", color =
|
|
|
87
498
|
const iconOnly = icon && !children;
|
|
88
499
|
const computedColor = danger ? "danger" : color;
|
|
89
500
|
const colored = computedColor && computedColor !== "default";
|
|
90
|
-
|
|
501
|
+
const displayIcon = loading ? typeof loading === "object" ? loading.icon : /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin" }) : icon;
|
|
502
|
+
return /* @__PURE__ */ jsxs(Core$6, {
|
|
91
503
|
disabled,
|
|
92
504
|
variant: "default",
|
|
93
505
|
"data-color": computedColor,
|
|
@@ -103,39 +515,11 @@ const Button$1 = ({ icon, className, variant = "solid", size = "medium", color =
|
|
|
103
515
|
onMouseDown?.(e);
|
|
104
516
|
},
|
|
105
517
|
...props,
|
|
106
|
-
children: [
|
|
518
|
+
children: [displayIcon, children]
|
|
107
519
|
});
|
|
108
520
|
};
|
|
109
521
|
var Button_default$1 = Button$1;
|
|
110
522
|
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/core/checkbox.tsx
|
|
113
|
-
const Checkbox$1 = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
114
|
-
ref,
|
|
115
|
-
className: cn(`peer border-primary focus-visible:ring-ring
|
|
116
|
-
data-[state=checked]:bg-primary
|
|
117
|
-
data-[state=checked]:text-primary-foreground grid h-4 w-4 shrink-0
|
|
118
|
-
place-content-center rounded-sm border shadow focus-visible:ring-1
|
|
119
|
-
focus-visible:outline-none disabled:cursor-not-allowed
|
|
120
|
-
disabled:opacity-50`, className),
|
|
121
|
-
...props,
|
|
122
|
-
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
123
|
-
className: cn("grid place-content-center text-current"),
|
|
124
|
-
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
|
|
125
|
-
})
|
|
126
|
-
}));
|
|
127
|
-
Checkbox$1.displayName = CheckboxPrimitive.Root.displayName;
|
|
128
|
-
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/core/label.tsx
|
|
131
|
-
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
132
|
-
const Label$1 = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, {
|
|
133
|
-
ref,
|
|
134
|
-
className: cn(labelVariants(), className),
|
|
135
|
-
...props
|
|
136
|
-
}));
|
|
137
|
-
Label$1.displayName = LabelPrimitive.Root.displayName;
|
|
138
|
-
|
|
139
523
|
//#endregion
|
|
140
524
|
//#region src/components/atoms/Checkbox/Group/index.tsx
|
|
141
525
|
const Group = ({ direction = "vertical", placement = "left", className, classNames = {}, options: _options, onChange = () => {} }) => {
|
|
@@ -173,6 +557,8 @@ var Group_default = Group;
|
|
|
173
557
|
|
|
174
558
|
//#endregion
|
|
175
559
|
//#region src/components/atoms/Checkbox/index.tsx
|
|
560
|
+
const { Checkbox: CoreCheckbox } = checkbox_exports;
|
|
561
|
+
const { Label: CoreLabel } = label_exports;
|
|
176
562
|
const Checkbox = ({ placement = "left", value = "", children, className, icons, checked: _checked, onChange: _onChange = () => {}, ...props }) => {
|
|
177
563
|
const [checked, setChecked] = useState(false);
|
|
178
564
|
const reactId = useId();
|
|
@@ -203,12 +589,12 @@ const Checkbox = ({ placement = "left", value = "", children, className, icons,
|
|
|
203
589
|
htmlFor: id,
|
|
204
590
|
children
|
|
205
591
|
})
|
|
206
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
592
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CoreCheckbox, {
|
|
207
593
|
id,
|
|
208
594
|
checked,
|
|
209
595
|
className: "cursor-pointer",
|
|
210
596
|
onCheckedChange: onChange
|
|
211
|
-
}), children && /* @__PURE__ */ jsx(
|
|
597
|
+
}), children && /* @__PURE__ */ jsx(CoreLabel, {
|
|
212
598
|
htmlFor: id,
|
|
213
599
|
className: "cursor-pointer text-left",
|
|
214
600
|
children
|
|
@@ -258,31 +644,15 @@ const FloatButton = ({ className, children, ...props }) => {
|
|
|
258
644
|
FloatButton.BackTop = BackTop_default;
|
|
259
645
|
var FloatButton_default = FloatButton;
|
|
260
646
|
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region src/core/input.tsx
|
|
263
|
-
const Input$1 = React$1.forwardRef(({ className, type, ...props }, ref) => {
|
|
264
|
-
return /* @__PURE__ */ jsx("input", {
|
|
265
|
-
type,
|
|
266
|
-
className: cn(`border-input file:text-foreground placeholder:text-muted-foreground
|
|
267
|
-
focus-visible:ring-ring flex h-9 w-full rounded-md border
|
|
268
|
-
bg-transparent px-3 py-1 text-base shadow-sm transition-colors
|
|
269
|
-
file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
270
|
-
focus-visible:ring-1 focus-visible:outline-none
|
|
271
|
-
disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`, className),
|
|
272
|
-
ref,
|
|
273
|
-
...props
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
Input$1.displayName = "Input";
|
|
277
|
-
|
|
278
647
|
//#endregion
|
|
279
648
|
//#region src/components/atoms/Input/Search/index.tsx
|
|
649
|
+
const { Input: Core$5 } = input_exports;
|
|
280
650
|
const Search$1 = forwardRef(({ className, value, allowClear = true, onChange = () => {}, onPressEnter, ...props }, ref) => {
|
|
281
651
|
return /* @__PURE__ */ jsxs("div", {
|
|
282
652
|
className: cn("relative flex items-center gap-x-2", "rounded-md", "p-3", className),
|
|
283
653
|
children: [
|
|
284
654
|
/* @__PURE__ */ jsx(Search, { className: "absolute size-5" }),
|
|
285
|
-
/* @__PURE__ */ jsx(
|
|
655
|
+
/* @__PURE__ */ jsx(Core$5, {
|
|
286
656
|
ref,
|
|
287
657
|
inputMode: "search",
|
|
288
658
|
type: "search",
|
|
@@ -305,24 +675,11 @@ const Search$1 = forwardRef(({ className, value, allowClear = true, onChange = (
|
|
|
305
675
|
Search$1.displayName = "Search";
|
|
306
676
|
var Search_default = Search$1;
|
|
307
677
|
|
|
308
|
-
//#endregion
|
|
309
|
-
//#region src/core/textarea.tsx
|
|
310
|
-
const Textarea = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
311
|
-
return /* @__PURE__ */ jsx("textarea", {
|
|
312
|
-
className: cn(`border-input placeholder:text-muted-foreground focus-visible:ring-ring
|
|
313
|
-
flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2
|
|
314
|
-
text-base shadow-sm focus-visible:ring-1 focus-visible:outline-none
|
|
315
|
-
disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`, className),
|
|
316
|
-
ref,
|
|
317
|
-
...props
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
Textarea.displayName = "Textarea";
|
|
321
|
-
|
|
322
678
|
//#endregion
|
|
323
679
|
//#region src/components/atoms/Input/TextArea/index.tsx
|
|
680
|
+
const { Textarea: Core$4 } = textarea_exports;
|
|
324
681
|
const TextArea = ({ className, ref, ...props }) => {
|
|
325
|
-
return /* @__PURE__ */ jsx(
|
|
682
|
+
return /* @__PURE__ */ jsx(Core$4, {
|
|
326
683
|
ref,
|
|
327
684
|
className: cn(className),
|
|
328
685
|
...props
|
|
@@ -332,36 +689,129 @@ var TextArea_default = TextArea;
|
|
|
332
689
|
|
|
333
690
|
//#endregion
|
|
334
691
|
//#region src/components/atoms/Input/index.tsx
|
|
692
|
+
const { Input: Core$3 } = input_exports;
|
|
335
693
|
const Input = ({ ...props }) => {
|
|
336
|
-
return /* @__PURE__ */ jsx(
|
|
694
|
+
return /* @__PURE__ */ jsx(Core$3, { ...props });
|
|
337
695
|
};
|
|
338
696
|
Input.Search = Search_default;
|
|
339
697
|
Input.TextArea = TextArea_default;
|
|
340
698
|
var Input_default = Input;
|
|
341
699
|
|
|
342
700
|
//#endregion
|
|
343
|
-
//#region src/
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
701
|
+
//#region src/components/atoms/Popover/index.tsx
|
|
702
|
+
const { Popover: CorePopover, PopoverContent, PopoverTrigger } = popover_exports;
|
|
703
|
+
const placementMap = {
|
|
704
|
+
top: {
|
|
705
|
+
side: "top",
|
|
706
|
+
align: "center"
|
|
707
|
+
},
|
|
708
|
+
left: {
|
|
709
|
+
side: "left",
|
|
710
|
+
align: "center"
|
|
711
|
+
},
|
|
712
|
+
right: {
|
|
713
|
+
side: "right",
|
|
714
|
+
align: "center"
|
|
715
|
+
},
|
|
716
|
+
bottom: {
|
|
717
|
+
side: "bottom",
|
|
718
|
+
align: "center"
|
|
719
|
+
},
|
|
720
|
+
topLeft: {
|
|
721
|
+
side: "top",
|
|
722
|
+
align: "start"
|
|
723
|
+
},
|
|
724
|
+
topRight: {
|
|
725
|
+
side: "top",
|
|
726
|
+
align: "end"
|
|
727
|
+
},
|
|
728
|
+
bottomLeft: {
|
|
729
|
+
side: "bottom",
|
|
730
|
+
align: "start"
|
|
731
|
+
},
|
|
732
|
+
bottomRight: {
|
|
733
|
+
side: "bottom",
|
|
734
|
+
align: "end"
|
|
735
|
+
},
|
|
736
|
+
leftTop: {
|
|
737
|
+
side: "left",
|
|
738
|
+
align: "start"
|
|
739
|
+
},
|
|
740
|
+
leftBottom: {
|
|
741
|
+
side: "left",
|
|
742
|
+
align: "end"
|
|
743
|
+
},
|
|
744
|
+
rightTop: {
|
|
745
|
+
side: "right",
|
|
746
|
+
align: "start"
|
|
747
|
+
},
|
|
748
|
+
rightBottom: {
|
|
749
|
+
side: "right",
|
|
750
|
+
align: "end"
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
const arrowBase = "absolute h-0 w-0 drop-shadow-md";
|
|
754
|
+
const arrowShape = {
|
|
755
|
+
vertical: "border-l-8 border-r-8 border-l-transparent border-r-transparent",
|
|
756
|
+
horizontal: "border-t-8 border-b-8 border-t-transparent border-b-transparent"
|
|
757
|
+
};
|
|
758
|
+
const arrowAlign = {
|
|
759
|
+
center: {
|
|
760
|
+
x: "left-1/2 -translate-x-1/2",
|
|
761
|
+
y: "top-1/2 -translate-y-1/2"
|
|
762
|
+
},
|
|
763
|
+
start: {
|
|
764
|
+
x: "left-4",
|
|
765
|
+
y: "top-4"
|
|
766
|
+
},
|
|
767
|
+
end: {
|
|
768
|
+
x: "right-4",
|
|
769
|
+
y: "bottom-4"
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
const arrowStyles = {
|
|
773
|
+
top: cn(arrowShape.vertical, arrowAlign.center.x, "top-full border-t-8 border-t-white"),
|
|
774
|
+
topLeft: cn(arrowShape.vertical, arrowAlign.start.x, "top-full border-t-8 border-t-white"),
|
|
775
|
+
topRight: cn(arrowShape.vertical, arrowAlign.end.x, "top-full border-t-8 border-t-white"),
|
|
776
|
+
bottom: cn(arrowShape.vertical, arrowAlign.center.x, "bottom-full border-b-8 border-b-white"),
|
|
777
|
+
bottomLeft: cn(arrowShape.vertical, arrowAlign.start.x, "bottom-full border-b-8 border-b-white"),
|
|
778
|
+
bottomRight: cn(arrowShape.vertical, arrowAlign.end.x, "bottom-full border-b-8 border-b-white"),
|
|
779
|
+
left: cn(arrowShape.horizontal, arrowAlign.center.y, "left-full border-l-8 border-l-white"),
|
|
780
|
+
leftTop: cn(arrowShape.horizontal, arrowAlign.start.y, "left-full border-l-8 border-l-white"),
|
|
781
|
+
leftBottom: cn(arrowShape.horizontal, arrowAlign.end.y, "left-full border-l-8 border-l-white"),
|
|
782
|
+
right: cn(arrowShape.horizontal, arrowAlign.center.y, "right-full border-r-8 border-r-white"),
|
|
783
|
+
rightTop: cn(arrowShape.horizontal, arrowAlign.start.y, "right-full border-r-8 border-r-white"),
|
|
784
|
+
rightBottom: cn(arrowShape.horizontal, arrowAlign.end.y, "right-full border-r-8 border-r-white")
|
|
785
|
+
};
|
|
786
|
+
const Popover = ({ title, placement = "top", className, content, children }) => {
|
|
787
|
+
return /* @__PURE__ */ jsxs(CorePopover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
788
|
+
asChild: true,
|
|
789
|
+
children
|
|
790
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
791
|
+
align: placementMap[placement].align,
|
|
792
|
+
side: placementMap[placement].side,
|
|
793
|
+
sideOffset: 16,
|
|
794
|
+
className: cn("relative w-auto", className),
|
|
795
|
+
children: [
|
|
796
|
+
renderConditional(title, (v) => /* @__PURE__ */ jsx(Typography_default.Title, {
|
|
797
|
+
level: 6,
|
|
798
|
+
children: v
|
|
799
|
+
})),
|
|
800
|
+
content,
|
|
801
|
+
/* @__PURE__ */ jsx("div", { className: cn(arrowBase, arrowStyles[placement]) })
|
|
802
|
+
]
|
|
803
|
+
})] });
|
|
804
|
+
};
|
|
805
|
+
var Popover_default = Popover;
|
|
357
806
|
|
|
358
807
|
//#endregion
|
|
359
808
|
//#region src/components/atoms/Progress/index.tsx
|
|
809
|
+
const { Progress: Core$2 } = progress_exports;
|
|
360
810
|
const Progress = ({ value, className, direction = "horizontal", classNames }) => {
|
|
361
811
|
const isHorizontal = direction === "horizontal";
|
|
362
812
|
const dimension = isHorizontal ? "width" : "height";
|
|
363
813
|
const percent = isNaN(value) ? 0 : value;
|
|
364
|
-
return /* @__PURE__ */ jsx(
|
|
814
|
+
return /* @__PURE__ */ jsx(Core$2, {
|
|
365
815
|
value,
|
|
366
816
|
className: cn(isHorizontal ? "h-4 w-full" : "flex h-full w-4 flex-col justify-end", className, classNames?.background),
|
|
367
817
|
barClassName: cn("flex-none", classNames?.bar),
|
|
@@ -373,16 +823,6 @@ const Progress = ({ value, className, direction = "horizontal", classNames }) =>
|
|
|
373
823
|
};
|
|
374
824
|
var Progress_default = Progress;
|
|
375
825
|
|
|
376
|
-
//#endregion
|
|
377
|
-
//#region src/core/skeleton.tsx
|
|
378
|
-
function Skeleton$1({ className, ...props }) {
|
|
379
|
-
return /* @__PURE__ */ jsx("div", {
|
|
380
|
-
"data-slot": "skeleton",
|
|
381
|
-
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
382
|
-
...props
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
826
|
//#endregion
|
|
387
827
|
//#region src/components/atoms/Skeleton/Button/index.tsx
|
|
388
828
|
const Button = ({ className, ...props }) => {
|
|
@@ -406,6 +846,7 @@ var Node_default = Node;
|
|
|
406
846
|
|
|
407
847
|
//#endregion
|
|
408
848
|
//#region src/components/atoms/Skeleton/index.tsx
|
|
849
|
+
const { Skeleton: Core$1 } = skeleton_exports;
|
|
409
850
|
const getValueAtIndex = (value, index) => {
|
|
410
851
|
return Array.isArray(value) ? value[index] ?? value[0] : value;
|
|
411
852
|
};
|
|
@@ -418,13 +859,13 @@ const Skeleton = ({ active = true, loading = true, avatar, size = "default", dir
|
|
|
418
859
|
if (!loading) return children;
|
|
419
860
|
return /* @__PURE__ */ jsxs("div", {
|
|
420
861
|
className: cn("flex items-center gap-3"),
|
|
421
|
-
children: [avatar && /* @__PURE__ */ jsx(
|
|
862
|
+
children: [avatar && /* @__PURE__ */ jsx(Core$1, { className: cn("h-12 w-12", "rounded-xl", !active && "animate-none", classNames.avatar) }), /* @__PURE__ */ jsx("div", {
|
|
422
863
|
className: cn("flex grow", direction === "vertical" && "flex-col", classNames.wrapper),
|
|
423
864
|
style: { gap },
|
|
424
865
|
children: Array.from({ length: count }).map((_, index) => {
|
|
425
866
|
const itemWidth = getValueAtIndex(width, index);
|
|
426
867
|
const itemHeight = getValueAtIndex(height, index);
|
|
427
|
-
return /* @__PURE__ */ jsx(
|
|
868
|
+
return /* @__PURE__ */ jsx(Core$1, {
|
|
428
869
|
className: cn("rounded-md", !active && "animate-none", SIZES[size], className, classNames.item),
|
|
429
870
|
style: {
|
|
430
871
|
...style,
|
|
@@ -449,37 +890,15 @@ const Spin = ({ spinning, className, ...props }) => {
|
|
|
449
890
|
...props,
|
|
450
891
|
children: /* @__PURE__ */ jsx(Loader2, { className: cn("animate-spin", className) })
|
|
451
892
|
});
|
|
452
|
-
return null;
|
|
453
|
-
};
|
|
454
|
-
var Spin_default = Spin;
|
|
455
|
-
|
|
456
|
-
//#endregion
|
|
457
|
-
//#region src/core/switch.tsx
|
|
458
|
-
function Switch$1({ className, handleClassName, ...props }) {
|
|
459
|
-
return /* @__PURE__ */ jsx(SwitchPrimitive.Root, {
|
|
460
|
-
"data-slot": "switch",
|
|
461
|
-
className: cn(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input
|
|
462
|
-
focus-visible:border-ring focus-visible:ring-ring/50
|
|
463
|
-
dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8
|
|
464
|
-
shrink-0 items-center rounded-full border border-transparent shadow-xs
|
|
465
|
-
transition-all outline-none focus-visible:ring-[3px]
|
|
466
|
-
disabled:cursor-not-allowed disabled:opacity-50`, className),
|
|
467
|
-
...props,
|
|
468
|
-
children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, {
|
|
469
|
-
"data-slot": "switch-thumb",
|
|
470
|
-
className: cn(`bg-background dark:data-[state=unchecked]:bg-foreground
|
|
471
|
-
dark:data-[state=checked]:bg-primary-foreground pointer-events-none
|
|
472
|
-
block size-4 rounded-full ring-0 transition-transform
|
|
473
|
-
data-[state=checked]:translate-x-[calc(100%-2px)]
|
|
474
|
-
data-[state=unchecked]:translate-x-0`, handleClassName)
|
|
475
|
-
})
|
|
476
|
-
});
|
|
477
|
-
}
|
|
893
|
+
return null;
|
|
894
|
+
};
|
|
895
|
+
var Spin_default = Spin;
|
|
478
896
|
|
|
479
897
|
//#endregion
|
|
480
898
|
//#region src/components/atoms/Switch/index.tsx
|
|
899
|
+
const { Switch: Core } = switch_exports;
|
|
481
900
|
const Switch = ({ onChange, className, classNames, ...props }) => {
|
|
482
|
-
return /* @__PURE__ */ jsx(
|
|
901
|
+
return /* @__PURE__ */ jsx(Core, {
|
|
483
902
|
className: cn(className, classNames?.track),
|
|
484
903
|
handleClassName: cn(classNames?.handle),
|
|
485
904
|
onCheckedChange: (checked) => {
|
|
@@ -496,10 +915,10 @@ const Card = ({ title, children, className, classNames, variant = "outlined", ..
|
|
|
496
915
|
return /* @__PURE__ */ jsxs("div", {
|
|
497
916
|
className: cn("w-full", "rounded-lg p-4", "bg-white shadow-sm transition-all", variant === "outlined" && "border border-gray-200", className),
|
|
498
917
|
...props,
|
|
499
|
-
children: [title
|
|
918
|
+
children: [renderConditional(title, (v) => /* @__PURE__ */ jsx("div", {
|
|
500
919
|
className: cn("mb-4 font-bold", classNames?.title),
|
|
501
|
-
children:
|
|
502
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
920
|
+
children: v
|
|
921
|
+
})), /* @__PURE__ */ jsx("div", {
|
|
503
922
|
className: cn(classNames?.body),
|
|
504
923
|
children
|
|
505
924
|
})]
|
|
@@ -507,40 +926,9 @@ const Card = ({ title, children, className, classNames, variant = "outlined", ..
|
|
|
507
926
|
};
|
|
508
927
|
var Card_default = Card;
|
|
509
928
|
|
|
510
|
-
//#endregion
|
|
511
|
-
//#region src/core/accordion.tsx
|
|
512
|
-
const Accordion = AccordionPrimitive.Root;
|
|
513
|
-
const AccordionItem = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Item, {
|
|
514
|
-
ref,
|
|
515
|
-
className: cn("border-b", className),
|
|
516
|
-
...props
|
|
517
|
-
}));
|
|
518
|
-
AccordionItem.displayName = "AccordionItem";
|
|
519
|
-
const AccordionTrigger = React$1.forwardRef(({ expandIcon, className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, {
|
|
520
|
-
className: "flex",
|
|
521
|
-
children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
|
|
522
|
-
ref,
|
|
523
|
-
className: cn(`flex flex-1 items-center justify-between py-4 text-left text-sm
|
|
524
|
-
font-medium transition-all hover:underline
|
|
525
|
-
[&[data-state=open]>svg]:rotate-180`, className),
|
|
526
|
-
...props,
|
|
527
|
-
children: [children, expandIcon || /* @__PURE__ */ jsx(ChevronDown, { className: "text-muted-foreground h-4 w-4 shrink-0 transition-transform\n duration-200" })]
|
|
528
|
-
})
|
|
529
|
-
}));
|
|
530
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
531
|
-
const AccordionContent = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Content, {
|
|
532
|
-
ref,
|
|
533
|
-
className: "data-[state=closed]:animate-accordion-up\n data-[state=open]:animate-accordion-down overflow-hidden text-sm",
|
|
534
|
-
...props,
|
|
535
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
536
|
-
className: cn("pt-0 pb-4", className),
|
|
537
|
-
children
|
|
538
|
-
})
|
|
539
|
-
}));
|
|
540
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
541
|
-
|
|
542
929
|
//#endregion
|
|
543
930
|
//#region src/components/molecules/Collapse/index.tsx
|
|
931
|
+
const { Accordion, AccordionItem, AccordionTrigger, AccordionContent } = accordion_exports;
|
|
544
932
|
const Collapse = ({ expandIcon, accordion = false, items: _items = [], className, classNames, defaultActiveKey }) => {
|
|
545
933
|
const [items, setItems] = useState([]);
|
|
546
934
|
useEffect(() => {
|
|
@@ -574,24 +962,7 @@ const Collapse = ({ expandIcon, accordion = false, items: _items = [], className
|
|
|
574
962
|
var Collapse_default = Collapse;
|
|
575
963
|
|
|
576
964
|
//#endregion
|
|
577
|
-
//#region src/components/molecules/Menu/index.tsx
|
|
578
|
-
const MENU_CLASSNAMES = [
|
|
579
|
-
"p-0",
|
|
580
|
-
"bg-white",
|
|
581
|
-
"shadow-md",
|
|
582
|
-
"rounded-md"
|
|
583
|
-
];
|
|
584
|
-
const OPEN_CLASSNAMES = ["underline", "underline-offset-8"];
|
|
585
|
-
const HOVER_CLASSNAMES = ["hover:underline", "hover:underline-offset-8"];
|
|
586
|
-
const OFFSET = [8, 8];
|
|
587
|
-
const INLINE_OFFSET = 16;
|
|
588
|
-
function findKey(menu, targetKeys) {
|
|
589
|
-
if (targetKeys.includes(menu.key)) return true;
|
|
590
|
-
if (menu.children && Array.isArray(menu.children)) {
|
|
591
|
-
for (const child of menu.children) if (findKey(child, targetKeys)) return true;
|
|
592
|
-
}
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
965
|
+
//#region src/components/molecules/Menu/Item/Label/index.tsx
|
|
595
966
|
const Label = ({ children, level = 4, className, ...props }) => {
|
|
596
967
|
if (typeof children === "string") return /* @__PURE__ */ jsx(Typography_default.Text, {
|
|
597
968
|
level,
|
|
@@ -601,94 +972,39 @@ const Label = ({ children, level = 4, className, ...props }) => {
|
|
|
601
972
|
});
|
|
602
973
|
return children;
|
|
603
974
|
};
|
|
604
|
-
|
|
975
|
+
var Label_default = Label;
|
|
976
|
+
|
|
977
|
+
//#endregion
|
|
978
|
+
//#region src/components/molecules/Menu/Item/index.tsx
|
|
979
|
+
const OFFSET = [8, 8];
|
|
980
|
+
const INLINE_OFFSET = 16;
|
|
981
|
+
const STYLES = {
|
|
982
|
+
hover: { classes: ["hover:underline", "hover:underline-offset-8"] },
|
|
983
|
+
open: { classes: ["underline", "underline-offset-8"] }
|
|
984
|
+
};
|
|
985
|
+
const getItemClasses = (root, isHorizontal, isInline, hasChildren, customClasses) => cn("px-4 py-2", "cursor-pointer", "whitespace-nowrap", root && isHorizontal ? "inline-flex" : "flex", ...root ? [
|
|
986
|
+
"h-full",
|
|
987
|
+
"rounded-none border-transparent",
|
|
988
|
+
hasChildren && "hover:border-current",
|
|
989
|
+
isHorizontal ? "border-b-2" : "border-r-2",
|
|
990
|
+
isInline && "border-none"
|
|
991
|
+
] : ["rounded-md", ...STYLES.hover.classes], customClasses);
|
|
992
|
+
const Item$2 = ({ itemKey, keyPath, root = false, mode, label, children, selectedKeys = [], selectionMap, classNames, styles, offset = OFFSET, inlineOffset = INLINE_OFFSET, onClick, onSelect, ...props }) => {
|
|
605
993
|
const [open, setOpen] = useState(false);
|
|
606
|
-
const [position, setPosition] = useState({
|
|
607
|
-
top: 0,
|
|
608
|
-
left: 0
|
|
609
|
-
});
|
|
610
994
|
const itemRef = useRef(null);
|
|
611
995
|
const isHorizontal = mode === "horizontal";
|
|
612
996
|
const isInline = mode === "inline";
|
|
613
997
|
const [left, top] = offset;
|
|
998
|
+
const selected = selectionMap?.get(itemKey) ?? false;
|
|
614
999
|
const item = {
|
|
615
1000
|
...props,
|
|
616
1001
|
label,
|
|
617
1002
|
key: itemKey,
|
|
618
1003
|
children
|
|
619
1004
|
};
|
|
620
|
-
const itemClassNames =
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
!!children?.length && "hover:border-current",
|
|
624
|
-
isHorizontal ? "border-b-2" : "border-r-2",
|
|
625
|
-
isInline && "border-none",
|
|
626
|
-
classNames?.rootItem
|
|
627
|
-
] : [
|
|
628
|
-
"rounded-md",
|
|
629
|
-
...HOVER_CLASSNAMES,
|
|
630
|
-
classNames?.item
|
|
631
|
-
]);
|
|
632
|
-
const childrenContainerClassNames = cn(isInline ? "relative overflow-hidden" : "absolute min-w-[200px]", !isInline && root && isHorizontal ? "left-0 top-full pt-2 pl-0" : !isInline ? "left-full top-0 pl-2 pt-0" : "pl-4", ...fullSize ? [
|
|
633
|
-
...MENU_CLASSNAMES,
|
|
634
|
-
"fixed flex justify-center items-start",
|
|
635
|
-
isHorizontal ? "inset-x-0 w-screen" : "inset-y-0 h-screen"
|
|
636
|
-
] : []);
|
|
637
|
-
const childrenContainerStyle = fullSize ? isHorizontal ? {
|
|
638
|
-
top: position.top,
|
|
639
|
-
marginTop: top
|
|
640
|
-
} : {
|
|
641
|
-
left: position.left,
|
|
642
|
-
marginLeft: left
|
|
643
|
-
} : isInline ? { paddingLeft: inlineOffset } : root && isHorizontal ? { paddingTop: top } : { paddingLeft: left };
|
|
644
|
-
useEffect(() => {
|
|
645
|
-
if (!itemRef.current) return;
|
|
646
|
-
const $item = itemRef.current;
|
|
647
|
-
const onResize = () => {
|
|
648
|
-
setPosition({
|
|
649
|
-
top: $item.offsetTop + $item.offsetHeight,
|
|
650
|
-
left: $item.offsetLeft + $item.offsetWidth
|
|
651
|
-
});
|
|
652
|
-
};
|
|
653
|
-
onResize();
|
|
654
|
-
window.addEventListener("resize", onResize);
|
|
655
|
-
return () => window.removeEventListener("resize", onResize);
|
|
656
|
-
}, []);
|
|
657
|
-
if (!root && fullSize) return /* @__PURE__ */ jsxs("li", {
|
|
658
|
-
className: cn("basis-1/6", "min-w-[180px]"),
|
|
659
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
660
|
-
className: cn(itemClassNames, "justify-center"),
|
|
661
|
-
onClick: (e) => {
|
|
662
|
-
e.stopPropagation();
|
|
663
|
-
onClick?.({
|
|
664
|
-
domEvent: e,
|
|
665
|
-
key: itemKey,
|
|
666
|
-
keyPath,
|
|
667
|
-
item
|
|
668
|
-
});
|
|
669
|
-
},
|
|
670
|
-
children: /* @__PURE__ */ jsx(Label, {
|
|
671
|
-
className: "font-semibold",
|
|
672
|
-
children: label
|
|
673
|
-
})
|
|
674
|
-
}), /* @__PURE__ */ jsx("ul", { children: children?.map((child) => /* @__PURE__ */ jsx("li", {
|
|
675
|
-
className: cn(itemClassNames, "justify-center", ...findKey(child, selectedKeys) ? [...OPEN_CLASSNAMES, ...HOVER_CLASSNAMES] : []),
|
|
676
|
-
onClick: (e) => {
|
|
677
|
-
e.stopPropagation();
|
|
678
|
-
onClick?.({
|
|
679
|
-
domEvent: e,
|
|
680
|
-
key: child.key,
|
|
681
|
-
keyPath: [...keyPath, child.key],
|
|
682
|
-
item: child
|
|
683
|
-
});
|
|
684
|
-
},
|
|
685
|
-
children: /* @__PURE__ */ jsx(Label, {
|
|
686
|
-
level: 5,
|
|
687
|
-
className: "text-center text-wrap",
|
|
688
|
-
children: child.label
|
|
689
|
-
})
|
|
690
|
-
}, child.key)) })]
|
|
691
|
-
});
|
|
1005
|
+
const itemClassNames = getItemClasses(root, isHorizontal, isInline, !!children?.length, root ? classNames?.rootItem : classNames?.item);
|
|
1006
|
+
const childrenContainerClassNames = cn(isInline ? "relative overflow-hidden" : "absolute min-w-[200px]", !isInline && root && isHorizontal ? "left-0 top-full pt-2 pl-0" : !isInline ? "left-full top-0 pl-2 pt-0" : "pl-4");
|
|
1007
|
+
const childrenContainerStyle = isInline ? { paddingLeft: inlineOffset } : root && isHorizontal ? { paddingTop: top } : { paddingLeft: left };
|
|
692
1008
|
return /* @__PURE__ */ jsxs("li", {
|
|
693
1009
|
ref: itemRef,
|
|
694
1010
|
className: cn("group", "relative", root && isHorizontal ? "inline-block" : "block"),
|
|
@@ -701,23 +1017,29 @@ const Item$2 = ({ itemKey = "", keyPath = [], root = false, mode, label, childre
|
|
|
701
1017
|
setOpen(false);
|
|
702
1018
|
},
|
|
703
1019
|
children: [/* @__PURE__ */ jsx("div", {
|
|
704
|
-
|
|
1020
|
+
role: "menuitem",
|
|
1021
|
+
"aria-expanded": children?.length ? open : void 0,
|
|
1022
|
+
"aria-haspopup": children?.length ? "menu" : void 0,
|
|
1023
|
+
"aria-selected": selected,
|
|
1024
|
+
className: cn(itemClassNames, ...selected ? root ? ["border-current"] : [...STYLES.open.classes, ...STYLES.hover.classes] : root && !!children?.length ? ["group-hover:border-current"] : []),
|
|
705
1025
|
style: root ? styles?.rootItem : styles?.item,
|
|
706
1026
|
onClick: (e) => {
|
|
707
1027
|
e.stopPropagation();
|
|
708
1028
|
if (isInline) setOpen(!open);
|
|
709
|
-
|
|
1029
|
+
const params = {
|
|
710
1030
|
domEvent: e,
|
|
711
1031
|
key: itemKey,
|
|
712
1032
|
keyPath,
|
|
713
1033
|
item
|
|
714
|
-
}
|
|
1034
|
+
};
|
|
1035
|
+
onClick?.(params);
|
|
1036
|
+
if (!selected) onSelect?.(params);
|
|
715
1037
|
},
|
|
716
1038
|
children: /* @__PURE__ */ jsxs("div", {
|
|
717
1039
|
className: cn("w-full", "inline-flex items-center justify-between"),
|
|
718
1040
|
children: [
|
|
719
|
-
/* @__PURE__ */ jsx(
|
|
720
|
-
className: cn(classNames?.label
|
|
1041
|
+
/* @__PURE__ */ jsx(Label_default, {
|
|
1042
|
+
className: cn(classNames?.label),
|
|
721
1043
|
style: styles?.label,
|
|
722
1044
|
children: label
|
|
723
1045
|
}),
|
|
@@ -742,59 +1064,85 @@ const Item$2 = ({ itemKey = "", keyPath = [], root = false, mode, label, childre
|
|
|
742
1064
|
} : { opacity: 0 },
|
|
743
1065
|
transition: { duration: .2 },
|
|
744
1066
|
children: /* @__PURE__ */ jsx("ul", {
|
|
745
|
-
className: cn(
|
|
746
|
-
"h-auto",
|
|
747
|
-
"flex flex-nowrap gap-y-4",
|
|
748
|
-
"p-8"
|
|
749
|
-
] : MENU_CLASSNAMES, isInline && "shadow-none", classNames?.subMenu),
|
|
1067
|
+
className: cn(MENU_CLASSNAMES, isInline && "shadow-none", classNames?.subMenu),
|
|
750
1068
|
style: styles?.subMenu,
|
|
751
1069
|
children: children.map((child) => /* @__PURE__ */ createElement(Item$2, {
|
|
752
1070
|
...child,
|
|
753
1071
|
key: child.key,
|
|
754
1072
|
itemKey: child.key,
|
|
755
1073
|
keyPath: [...keyPath, child.key],
|
|
1074
|
+
selectionMap,
|
|
756
1075
|
mode,
|
|
757
1076
|
selectedKeys,
|
|
758
|
-
fullSize,
|
|
759
1077
|
classNames,
|
|
760
1078
|
styles,
|
|
761
1079
|
offset,
|
|
762
1080
|
inlineOffset,
|
|
763
|
-
onClick
|
|
1081
|
+
onClick,
|
|
1082
|
+
onSelect
|
|
764
1083
|
}))
|
|
765
1084
|
})
|
|
766
1085
|
}) })]
|
|
767
1086
|
});
|
|
768
1087
|
};
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
1088
|
+
var Item_default$2 = Item$2;
|
|
1089
|
+
|
|
1090
|
+
//#endregion
|
|
1091
|
+
//#region src/components/molecules/Menu/index.tsx
|
|
1092
|
+
const MENU_CLASSNAMES = [
|
|
1093
|
+
"p-0",
|
|
1094
|
+
"bg-white",
|
|
1095
|
+
"shadow-md",
|
|
1096
|
+
"rounded-md"
|
|
1097
|
+
];
|
|
1098
|
+
function buildSelectionMap(items, selectedKeysSet) {
|
|
1099
|
+
const map = /* @__PURE__ */ new Map();
|
|
1100
|
+
const dfs = (node) => {
|
|
1101
|
+
const self = selectedKeysSet.has(node.key);
|
|
1102
|
+
const hasSelectedChild = node.children?.some((child) => dfs(child)) ?? false;
|
|
1103
|
+
const isSelected = self || hasSelectedChild;
|
|
1104
|
+
map.set(node.key, isSelected);
|
|
1105
|
+
return isSelected;
|
|
1106
|
+
};
|
|
1107
|
+
items.forEach(dfs);
|
|
1108
|
+
return map;
|
|
1109
|
+
}
|
|
1110
|
+
function findKey(menu, targetKeys) {
|
|
1111
|
+
if (targetKeys.has(menu.key)) return true;
|
|
1112
|
+
if (menu.children && Array.isArray(menu.children)) {
|
|
1113
|
+
for (const child of menu.children) if (findKey(child, targetKeys)) return true;
|
|
1114
|
+
}
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
const Menu = ({ items, mode = "vertical", defaultSelectedKeys = [], selectedKeys: _selectedKeys, className, classNames, styles, offset, inlineOffset, onClick, onSelect: _onSelect, ...props }) => {
|
|
1118
|
+
const isControlled = _selectedKeys !== void 0;
|
|
1119
|
+
const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] = useState(defaultSelectedKeys ?? []);
|
|
1120
|
+
const selectedKeys = isControlled ? _selectedKeys : uncontrolledSelectedKeys;
|
|
1121
|
+
const selectedKeysSet = useMemo(() => new Set(selectedKeys ?? []), [selectedKeys]);
|
|
1122
|
+
const selectionMap = useMemo(() => buildSelectionMap(items ?? [], selectedKeysSet), [items, selectedKeysSet]);
|
|
1123
|
+
const onSelect = (params) => {
|
|
1124
|
+
if (!isControlled) setUncontrolledSelectedKeys([params.key]);
|
|
1125
|
+
_onSelect?.(params);
|
|
1126
|
+
};
|
|
781
1127
|
return /* @__PURE__ */ jsx("ul", {
|
|
1128
|
+
role: "menu",
|
|
782
1129
|
className: cn(MENU_CLASSNAMES, mode === "horizontal" ? "flex" : "inline-block", className),
|
|
783
1130
|
...props,
|
|
784
|
-
children: items?.map((item) => /* @__PURE__ */ createElement(
|
|
1131
|
+
children: items?.map((item) => /* @__PURE__ */ createElement(Item_default$2, {
|
|
785
1132
|
root: true,
|
|
786
1133
|
...item,
|
|
787
1134
|
key: item.key,
|
|
788
1135
|
itemKey: item.key,
|
|
789
1136
|
keyPath: [item.key],
|
|
790
1137
|
selectedKeys,
|
|
1138
|
+
selectionMap,
|
|
791
1139
|
mode,
|
|
792
|
-
fullSize,
|
|
793
1140
|
classNames,
|
|
794
1141
|
styles,
|
|
795
1142
|
offset,
|
|
796
1143
|
inlineOffset,
|
|
797
|
-
onClick
|
|
1144
|
+
onClick,
|
|
1145
|
+
onSelect
|
|
798
1146
|
}))
|
|
799
1147
|
});
|
|
800
1148
|
};
|
|
@@ -4681,93 +5029,9 @@ const Space = ({ loading, loader, children, size = "middle", orientation = "hori
|
|
|
4681
5029
|
};
|
|
4682
5030
|
var Space_default = Space;
|
|
4683
5031
|
|
|
4684
|
-
//#endregion
|
|
4685
|
-
//#region src/core/drawer.tsx
|
|
4686
|
-
function Drawer$2({ ...props }) {
|
|
4687
|
-
return /* @__PURE__ */ jsx(Drawer.Root, {
|
|
4688
|
-
"data-slot": "drawer",
|
|
4689
|
-
...props
|
|
4690
|
-
});
|
|
4691
|
-
}
|
|
4692
|
-
function DrawerPortal({ ...props }) {
|
|
4693
|
-
return /* @__PURE__ */ jsx(Drawer.Portal, {
|
|
4694
|
-
"data-slot": "drawer-portal",
|
|
4695
|
-
...props
|
|
4696
|
-
});
|
|
4697
|
-
}
|
|
4698
|
-
function DrawerOverlay({ className, ...props }) {
|
|
4699
|
-
return /* @__PURE__ */ jsx(Drawer.Overlay, {
|
|
4700
|
-
"data-slot": "drawer-overlay",
|
|
4701
|
-
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
4702
|
-
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
4703
|
-
z-50 bg-black/50`, className),
|
|
4704
|
-
...props
|
|
4705
|
-
});
|
|
4706
|
-
}
|
|
4707
|
-
function DrawerContent({ className, classNames = {}, handlebar, mask, children, ...props }) {
|
|
4708
|
-
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
4709
|
-
"data-slot": "drawer-portal",
|
|
4710
|
-
children: [/* @__PURE__ */ jsx(DrawerOverlay, { className: cn(classNames?.mask, !mask && "hidden") }), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
4711
|
-
"data-slot": "drawer-content",
|
|
4712
|
-
className: cn("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", `data-[vaul-drawer-direction=top]:inset-x-0
|
|
4713
|
-
data-[vaul-drawer-direction=top]:top-0
|
|
4714
|
-
data-[vaul-drawer-direction=top]:mb-24
|
|
4715
|
-
data-[vaul-drawer-direction=top]:max-h-[80vh]
|
|
4716
|
-
data-[vaul-drawer-direction=top]:rounded-b-lg
|
|
4717
|
-
data-[vaul-drawer-direction=top]:border-b`, `data-[vaul-drawer-direction=bottom]:inset-x-0
|
|
4718
|
-
data-[vaul-drawer-direction=bottom]:bottom-0
|
|
4719
|
-
data-[vaul-drawer-direction=bottom]:mt-24
|
|
4720
|
-
data-[vaul-drawer-direction=bottom]:max-h-[80vh]
|
|
4721
|
-
data-[vaul-drawer-direction=bottom]:rounded-t-lg
|
|
4722
|
-
data-[vaul-drawer-direction=bottom]:border-t`, `data-[vaul-drawer-direction=right]:inset-y-0
|
|
4723
|
-
data-[vaul-drawer-direction=right]:right-0
|
|
4724
|
-
data-[vaul-drawer-direction=right]:w-3/4
|
|
4725
|
-
data-[vaul-drawer-direction=right]:border-l
|
|
4726
|
-
data-[vaul-drawer-direction=right]:sm:max-w-sm`, `data-[vaul-drawer-direction=left]:inset-y-0
|
|
4727
|
-
data-[vaul-drawer-direction=left]:left-0
|
|
4728
|
-
data-[vaul-drawer-direction=left]:w-3/4
|
|
4729
|
-
data-[vaul-drawer-direction=left]:border-r
|
|
4730
|
-
data-[vaul-drawer-direction=left]:sm:max-w-sm`, className),
|
|
4731
|
-
...props,
|
|
4732
|
-
children: [/* @__PURE__ */ jsx("div", { className: cn(`bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full
|
|
4733
|
-
group-data-[vaul-drawer-direction=bottom]/drawer-content:block`, classNames?.handlebar, !handlebar && "hidden") }), children]
|
|
4734
|
-
})]
|
|
4735
|
-
});
|
|
4736
|
-
}
|
|
4737
|
-
function DrawerHeader({ className, ...props }) {
|
|
4738
|
-
return /* @__PURE__ */ jsx("div", {
|
|
4739
|
-
"data-slot": "drawer-header",
|
|
4740
|
-
className: cn(`flex flex-col gap-0.5 p-4
|
|
4741
|
-
group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center
|
|
4742
|
-
group-data-[vaul-drawer-direction=top]/drawer-content:text-center
|
|
4743
|
-
md:gap-1.5 md:text-left`, className),
|
|
4744
|
-
...props
|
|
4745
|
-
});
|
|
4746
|
-
}
|
|
4747
|
-
function DrawerFooter({ className, ...props }) {
|
|
4748
|
-
return /* @__PURE__ */ jsx("div", {
|
|
4749
|
-
"data-slot": "drawer-footer",
|
|
4750
|
-
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
4751
|
-
...props
|
|
4752
|
-
});
|
|
4753
|
-
}
|
|
4754
|
-
function DrawerTitle({ className, ...props }) {
|
|
4755
|
-
return /* @__PURE__ */ jsx(Drawer.Title, {
|
|
4756
|
-
"data-slot": "drawer-title",
|
|
4757
|
-
className: cn("text-foreground font-semibold", className),
|
|
4758
|
-
...props
|
|
4759
|
-
});
|
|
4760
|
-
}
|
|
4761
|
-
function DrawerDescription({ className, ...props }) {
|
|
4762
|
-
return /* @__PURE__ */ jsx(Drawer.Description, {
|
|
4763
|
-
"data-slot": "drawer-description",
|
|
4764
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
4765
|
-
...props
|
|
4766
|
-
});
|
|
4767
|
-
}
|
|
4768
|
-
|
|
4769
5032
|
//#endregion
|
|
4770
5033
|
//#region src/components/organisms/Drawer/index.tsx
|
|
5034
|
+
const { DrawerContent, Drawer: DrawerCore, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle } = drawer_exports;
|
|
4771
5035
|
const Drawer$1 = ({ open, title, footer, closable = true, closeIcon, direction = "bottom", maskClosable = true, handlebar = true, draggable = false, rounded = false, mask = true, className, classNames, style, children, container, onClose, ...props }) => {
|
|
4772
5036
|
useEffect(() => {
|
|
4773
5037
|
if (!open) return;
|
|
@@ -4783,7 +5047,7 @@ const Drawer$1 = ({ open, title, footer, closable = true, closeIcon, direction =
|
|
|
4783
5047
|
}
|
|
4784
5048
|
}, [open, mask]);
|
|
4785
5049
|
if (typeof window === "undefined") return null;
|
|
4786
|
-
return /* @__PURE__ */ jsx(
|
|
5050
|
+
return /* @__PURE__ */ jsx(DrawerCore, {
|
|
4787
5051
|
open,
|
|
4788
5052
|
direction,
|
|
4789
5053
|
handleOnly: !draggable,
|
|
@@ -4806,21 +5070,21 @@ const Drawer$1 = ({ open, title, footer, closable = true, closeIcon, direction =
|
|
|
4806
5070
|
className: cn(classNames?.header, !title && "p-0"),
|
|
4807
5071
|
children: [/* @__PURE__ */ jsxs(DrawerTitle, {
|
|
4808
5072
|
className: cn("flex justify-between", classNames?.title),
|
|
4809
|
-
children: [/* @__PURE__ */ jsx("span", { children: title }), closable
|
|
4810
|
-
className: cn("absolute right-5
|
|
5073
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), renderConditional(closable ? closeIcon || /* @__PURE__ */ jsx(X, {}) : null, (v) => /* @__PURE__ */ jsx("span", {
|
|
5074
|
+
className: cn("absolute top-3 right-5 cursor-pointer", classNames?.close),
|
|
4811
5075
|
onClick: onClose,
|
|
4812
|
-
children:
|
|
4813
|
-
})]
|
|
5076
|
+
children: v
|
|
5077
|
+
}))]
|
|
4814
5078
|
}), /* @__PURE__ */ jsx(DrawerDescription, { className: "hidden" })]
|
|
4815
5079
|
}),
|
|
4816
5080
|
/* @__PURE__ */ jsx("div", {
|
|
4817
5081
|
className: cn("overflow-auto p-5", classNames?.body),
|
|
4818
5082
|
children
|
|
4819
5083
|
}),
|
|
4820
|
-
footer
|
|
5084
|
+
renderConditional(footer, (v) => /* @__PURE__ */ jsx(DrawerFooter, {
|
|
4821
5085
|
className: cn(classNames?.footer),
|
|
4822
|
-
children:
|
|
4823
|
-
})
|
|
5086
|
+
children: v
|
|
5087
|
+
}))
|
|
4824
5088
|
]
|
|
4825
5089
|
})
|
|
4826
5090
|
});
|
|
@@ -4878,10 +5142,10 @@ const List = ({ loading, loaderProps, loader, header, title, empty, scroll, data
|
|
|
4878
5142
|
className: cn(className),
|
|
4879
5143
|
...props,
|
|
4880
5144
|
children: [
|
|
4881
|
-
/* @__PURE__ */ jsx("
|
|
4882
|
-
className: cn(
|
|
4883
|
-
children:
|
|
4884
|
-
}),
|
|
5145
|
+
renderConditional(title, (v) => /* @__PURE__ */ jsx("h2", {
|
|
5146
|
+
className: cn("px-1.5 py-4", "text-black-90 text-lg leading-5.75 font-bold"),
|
|
5147
|
+
children: v
|
|
5148
|
+
})),
|
|
4885
5149
|
/* @__PURE__ */ jsx("div", {
|
|
4886
5150
|
className: cn(classNames?.header),
|
|
4887
5151
|
children: header
|
|
@@ -4904,86 +5168,9 @@ const List = ({ loading, loaderProps, loader, header, title, empty, scroll, data
|
|
|
4904
5168
|
List.Item = Item_default;
|
|
4905
5169
|
var List_default = List;
|
|
4906
5170
|
|
|
4907
|
-
//#endregion
|
|
4908
|
-
//#region src/core/dialog.tsx
|
|
4909
|
-
function Dialog({ ...props }) {
|
|
4910
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
|
|
4911
|
-
"data-slot": "dialog",
|
|
4912
|
-
...props
|
|
4913
|
-
});
|
|
4914
|
-
}
|
|
4915
|
-
function DialogPortal({ ...props }) {
|
|
4916
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, {
|
|
4917
|
-
"data-slot": "dialog-portal",
|
|
4918
|
-
...props
|
|
4919
|
-
});
|
|
4920
|
-
}
|
|
4921
|
-
function DialogOverlay({ className, ...props }) {
|
|
4922
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
|
|
4923
|
-
"data-slot": "dialog-overlay",
|
|
4924
|
-
className: cn(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
4925
|
-
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
4926
|
-
z-50 bg-black/50`, className),
|
|
4927
|
-
...props
|
|
4928
|
-
});
|
|
4929
|
-
}
|
|
4930
|
-
function DialogContent({ className, children, showCloseButton = true, classNames, closeIcon, closable, container, onCancel, ...props }) {
|
|
4931
|
-
return /* @__PURE__ */ jsxs(DialogPortal, {
|
|
4932
|
-
"data-slot": "dialog-portal",
|
|
4933
|
-
container,
|
|
4934
|
-
children: [/* @__PURE__ */ jsx(DialogOverlay, { className: cn(classNames?.mask) }), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
4935
|
-
"data-slot": "dialog-content",
|
|
4936
|
-
className: cn(`bg-background data-[state=open]:animate-in
|
|
4937
|
-
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
4938
|
-
data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
|
4939
|
-
data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid
|
|
4940
|
-
w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%]
|
|
4941
|
-
gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`, className),
|
|
4942
|
-
...props,
|
|
4943
|
-
children: [children, showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
|
|
4944
|
-
"data-slot": "dialog-close",
|
|
4945
|
-
className: "ring-offset-background focus:ring-ring\n data-[state=open]:bg-accent\n data-[state=open]:text-muted-foreground absolute top-4 right-4\n rounded-xs opacity-70 transition-opacity hover:opacity-100\n focus:ring-2 focus:ring-offset-2 focus:outline-hidden\n disabled:pointer-events-none [&_svg]:pointer-events-none\n [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
4946
|
-
disabled: typeof closable === "object" && closable.disabled,
|
|
4947
|
-
onClick: onCancel,
|
|
4948
|
-
children: [closeIcon || /* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
4949
|
-
className: "sr-only",
|
|
4950
|
-
children: "Close"
|
|
4951
|
-
})]
|
|
4952
|
-
})]
|
|
4953
|
-
})]
|
|
4954
|
-
});
|
|
4955
|
-
}
|
|
4956
|
-
function DialogHeader({ className, ...props }) {
|
|
4957
|
-
return /* @__PURE__ */ jsx("div", {
|
|
4958
|
-
"data-slot": "dialog-header",
|
|
4959
|
-
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
4960
|
-
...props
|
|
4961
|
-
});
|
|
4962
|
-
}
|
|
4963
|
-
function DialogFooter({ className, ...props }) {
|
|
4964
|
-
return /* @__PURE__ */ jsx("div", {
|
|
4965
|
-
"data-slot": "dialog-footer",
|
|
4966
|
-
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
4967
|
-
...props
|
|
4968
|
-
});
|
|
4969
|
-
}
|
|
4970
|
-
function DialogTitle({ className, ...props }) {
|
|
4971
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
|
|
4972
|
-
"data-slot": "dialog-title",
|
|
4973
|
-
className: cn("text-lg leading-none font-semibold", className),
|
|
4974
|
-
...props
|
|
4975
|
-
});
|
|
4976
|
-
}
|
|
4977
|
-
function DialogDescription({ className, ...props }) {
|
|
4978
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
|
|
4979
|
-
"data-slot": "dialog-description",
|
|
4980
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
4981
|
-
...props
|
|
4982
|
-
});
|
|
4983
|
-
}
|
|
4984
|
-
|
|
4985
5171
|
//#endregion
|
|
4986
5172
|
//#region src/components/organisms/Modal/index.tsx
|
|
5173
|
+
const { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } = dialog_exports;
|
|
4987
5174
|
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
4988
5175
|
let modalRoot = null;
|
|
4989
5176
|
let modalStack = [];
|
|
@@ -5277,4 +5464,4 @@ Layout.Sider = Sider_default;
|
|
|
5277
5464
|
var Layout_default = Layout;
|
|
5278
5465
|
|
|
5279
5466
|
//#endregion
|
|
5280
|
-
export {
|
|
5467
|
+
export { Button_default$1 as C, Checkbox_default as S, Skeleton_default as _, Drawer_default as a, Input_default as b, Dropdown_default as c, buildSelectionMap as d, findKey as f, Spin_default as g, Switch_default as h, List_default as i, MENU_CLASSNAMES as l, Card_default as m, Swiper_default as n, Space_default as o, Collapse_default as p, Modal_default as r, Marquees_default as s, Layout_default as t, Menu_default as u, Progress_default as v, FloatButton_default as x, Popover_default as y };
|