@jbpark/ui-kit 2.3.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +0 -1
- package/README.md +0 -1
- package/dist/Menu.d.mts +62 -2
- package/dist/Menu.d.mts.map +1 -0
- package/dist/Menu.mjs +66 -5
- package/dist/Menu.mjs.map +1 -0
- package/dist/Reveals.d.mts +43 -2
- package/dist/Reveals.d.mts.map +1 -0
- package/dist/Reveals.mjs +28 -3
- package/dist/Reveals.mjs.map +1 -0
- package/dist/Typography.d.mts +40 -2
- package/dist/Typography.d.mts.map +1 -0
- package/dist/Typography.mjs +20 -3
- package/dist/Typography.mjs.map +1 -0
- package/dist/{chunk-BWyCjowX.mjs → _virtual/_rolldown/runtime.mjs} +4 -4
- package/dist/components/atoms/Button/index.d.mts +40 -0
- package/dist/components/atoms/Button/index.d.mts.map +1 -0
- package/dist/components/atoms/Button/index.mjs +69 -0
- package/dist/components/atoms/Button/index.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/Group/index.d.mts +21 -0
- package/dist/components/atoms/Checkbox/Group/index.d.mts.map +1 -0
- package/dist/components/atoms/Checkbox/Group/index.mjs +41 -0
- package/dist/components/atoms/Checkbox/Group/index.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/index.d.mts +44 -0
- package/dist/components/atoms/Checkbox/index.d.mts.map +1 -0
- package/dist/components/atoms/Checkbox/index.mjs +70 -0
- package/dist/components/atoms/Checkbox/index.mjs.map +1 -0
- package/dist/components/atoms/ColorPicker/index.d.mts +18 -0
- package/dist/components/atoms/ColorPicker/index.d.mts.map +1 -0
- package/dist/components/atoms/ColorPicker/index.mjs +39 -0
- package/dist/components/atoms/ColorPicker/index.mjs.map +1 -0
- package/dist/components/atoms/FloatButton/BackTop/index.d.mts +12 -0
- package/dist/components/atoms/FloatButton/BackTop/index.d.mts.map +1 -0
- package/dist/components/atoms/FloatButton/BackTop/index.mjs +27 -0
- package/dist/components/atoms/FloatButton/BackTop/index.mjs.map +1 -0
- package/dist/components/atoms/FloatButton/index.d.mts +22 -0
- package/dist/components/atoms/FloatButton/index.d.mts.map +1 -0
- package/dist/components/atoms/FloatButton/index.mjs +19 -0
- package/dist/components/atoms/FloatButton/index.mjs.map +1 -0
- package/dist/components/atoms/Input/Search/index.d.mts +15 -0
- package/dist/components/atoms/Input/Search/index.d.mts.map +1 -0
- package/dist/components/atoms/Input/Search/index.mjs +57 -0
- package/dist/components/atoms/Input/Search/index.mjs.map +1 -0
- package/dist/components/atoms/Input/TextArea/index.d.mts +1 -0
- package/dist/components/atoms/Input/TextArea/index.mjs +18 -0
- package/dist/components/atoms/Input/TextArea/index.mjs.map +1 -0
- package/dist/components/atoms/Input/index.d.mts +31 -0
- package/dist/components/atoms/Input/index.d.mts.map +1 -0
- package/dist/components/atoms/Input/index.mjs +17 -0
- package/dist/components/atoms/Input/index.mjs.map +1 -0
- package/dist/components/atoms/Popover/index.d.mts +19 -0
- package/dist/components/atoms/Popover/index.d.mts.map +1 -0
- package/dist/components/atoms/Popover/index.mjs +229 -0
- package/dist/components/atoms/Popover/index.mjs.map +1 -0
- package/dist/components/atoms/Progress/index.d.mts +20 -0
- package/dist/components/atoms/Progress/index.d.mts.map +1 -0
- package/dist/components/atoms/Progress/index.mjs +25 -0
- package/dist/components/atoms/Progress/index.mjs.map +1 -0
- package/dist/components/atoms/Radio/Group/index.d.mts +26 -0
- package/dist/components/atoms/Radio/Group/index.d.mts.map +1 -0
- package/dist/components/atoms/Radio/Group/index.mjs +52 -0
- package/dist/components/atoms/Radio/Group/index.mjs.map +1 -0
- package/dist/components/atoms/Radio/index.d.mts +50 -0
- package/dist/components/atoms/Radio/index.d.mts.map +1 -0
- package/dist/components/atoms/Radio/index.mjs +78 -0
- package/dist/components/atoms/Radio/index.mjs.map +1 -0
- package/dist/components/atoms/Select/index.d.mts +31 -0
- package/dist/components/atoms/Select/index.d.mts.map +1 -0
- package/dist/components/atoms/Select/index.mjs +31 -0
- package/dist/components/atoms/Select/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/Button/index.d.mts +2 -0
- package/dist/components/atoms/Skeleton/Button/index.mjs +15 -0
- package/dist/components/atoms/Skeleton/Button/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/Node/index.d.mts +2 -0
- package/dist/components/atoms/Skeleton/Node/index.mjs +16 -0
- package/dist/components/atoms/Skeleton/Node/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/index.d.mts +51 -0
- package/dist/components/atoms/Skeleton/index.d.mts.map +1 -0
- package/dist/components/atoms/Skeleton/index.mjs +46 -0
- package/dist/components/atoms/Skeleton/index.mjs.map +1 -0
- package/dist/components/atoms/Spin/index.d.mts +14 -0
- package/dist/components/atoms/Spin/index.d.mts.map +1 -0
- package/dist/components/atoms/Spin/index.mjs +17 -0
- package/dist/components/atoms/Spin/index.mjs.map +1 -0
- package/dist/components/atoms/Switch/index.d.mts +30 -0
- package/dist/components/atoms/Switch/index.d.mts.map +1 -0
- package/dist/components/atoms/Switch/index.mjs +65 -0
- package/dist/components/atoms/Switch/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Link/index.d.mts +12 -0
- package/dist/components/atoms/Typography/Link/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Link/index.mjs +15 -0
- package/dist/components/atoms/Typography/Link/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Paragraph/index.d.mts +12 -0
- package/dist/components/atoms/Typography/Paragraph/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Paragraph/index.mjs +15 -0
- package/dist/components/atoms/Typography/Paragraph/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Text/index.d.mts +17 -0
- package/dist/components/atoms/Typography/Text/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Text/index.mjs +15 -0
- package/dist/components/atoms/Typography/Text/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Title/index.d.mts +15 -0
- package/dist/components/atoms/Typography/Title/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Title/index.mjs +24 -0
- package/dist/components/atoms/Typography/Title/index.mjs.map +1 -0
- package/dist/components/atoms/index.d.mts +13 -0
- package/dist/components/atoms/index.mjs +15 -0
- package/dist/components/molecules/Card/index.d.mts +22 -0
- package/dist/components/molecules/Card/index.d.mts.map +1 -0
- package/dist/components/molecules/Card/index.mjs +21 -0
- package/dist/components/molecules/Card/index.mjs.map +1 -0
- package/dist/components/molecules/Collapse/index.d.mts +36 -0
- package/dist/components/molecules/Collapse/index.d.mts.map +1 -0
- package/dist/components/molecules/Collapse/index.mjs +53 -0
- package/dist/components/molecules/Collapse/index.mjs.map +1 -0
- package/dist/components/molecules/Dropdown/index.d.mts +23 -0
- package/dist/components/molecules/Dropdown/index.d.mts.map +1 -0
- package/dist/components/molecules/Dropdown/index.mjs +66 -0
- package/dist/components/molecules/Dropdown/index.mjs.map +1 -0
- package/dist/components/molecules/Marquees/Item/index.d.mts +17 -0
- package/dist/components/molecules/Marquees/Item/index.d.mts.map +1 -0
- package/dist/components/molecules/Marquees/Item/index.mjs +103 -0
- package/dist/components/molecules/Marquees/Item/index.mjs.map +1 -0
- package/dist/components/molecules/Marquees/index.d.mts +31 -0
- package/dist/components/molecules/Marquees/index.d.mts.map +1 -0
- package/dist/components/molecules/Marquees/index.mjs +63 -0
- package/dist/components/molecules/Marquees/index.mjs.map +1 -0
- package/dist/components/molecules/Menu/Item/Label/index.mjs +18 -0
- package/dist/components/molecules/Menu/Item/Label/index.mjs.map +1 -0
- package/dist/components/molecules/Menu/Item/index.mjs +122 -0
- package/dist/components/molecules/Menu/Item/index.mjs.map +1 -0
- package/dist/{index-CsjsTuId.d.mts → components/molecules/Reveals/Item/index.d.mts} +4 -41
- package/dist/components/molecules/Reveals/Item/index.d.mts.map +1 -0
- package/dist/{Reveals-Cqo3i2hh.mjs → components/molecules/Reveals/Item/index.mjs} +5 -27
- package/dist/components/molecules/Reveals/Item/index.mjs.map +1 -0
- package/dist/components/molecules/Space/index.d.mts +34 -0
- package/dist/components/molecules/Space/index.d.mts.map +1 -0
- package/dist/components/molecules/Space/index.mjs +41 -0
- package/dist/components/molecules/Space/index.mjs.map +1 -0
- package/dist/components/molecules/index.d.mts +7 -0
- package/dist/components/molecules/index.mjs +9 -0
- package/dist/components/organisms/Drawer/index.d.mts +54 -0
- package/dist/components/organisms/Drawer/index.d.mts.map +1 -0
- package/dist/components/organisms/Drawer/index.mjs +72 -0
- package/dist/components/organisms/Drawer/index.mjs.map +1 -0
- package/dist/components/organisms/List/Item/index.mjs +15 -0
- package/dist/components/organisms/List/Item/index.mjs.map +1 -0
- package/dist/components/organisms/List/index.d.mts +52 -0
- package/dist/components/organisms/List/index.d.mts.map +1 -0
- package/dist/components/organisms/List/index.mjs +77 -0
- package/dist/components/organisms/List/index.mjs.map +1 -0
- package/dist/components/organisms/Modal/index.d.mts +66 -0
- package/dist/components/organisms/Modal/index.d.mts.map +1 -0
- package/dist/components/organisms/Modal/index.mjs +197 -0
- package/dist/components/organisms/Modal/index.mjs.map +1 -0
- package/dist/components/organisms/Swiper/Slide/index.mjs +17 -0
- package/dist/components/organisms/Swiper/Slide/index.mjs.map +1 -0
- package/dist/components/organisms/Swiper/index.d.mts +42 -0
- package/dist/components/organisms/Swiper/index.d.mts.map +1 -0
- package/dist/components/organisms/Swiper/index.mjs +58 -0
- package/dist/components/organisms/Swiper/index.mjs.map +1 -0
- package/dist/components/organisms/index.d.mts +4 -0
- package/dist/components/organisms/index.mjs +6 -0
- package/dist/components/templates/Layout/Content/index.d.mts +1 -0
- package/dist/components/templates/Layout/Content/index.mjs +15 -0
- package/dist/components/templates/Layout/Content/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Footer/index.d.mts +1 -0
- package/dist/components/templates/Layout/Footer/index.mjs +15 -0
- package/dist/components/templates/Layout/Footer/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Header/index.d.mts +7 -0
- package/dist/components/templates/Layout/Header/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/Header/index.mjs +15 -0
- package/dist/components/templates/Layout/Header/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Sider/index.d.mts +1 -0
- package/dist/components/templates/Layout/Sider/index.mjs +15 -0
- package/dist/components/templates/Layout/Sider/index.mjs.map +1 -0
- package/dist/components/templates/Layout/index.d.mts +38 -0
- package/dist/components/templates/Layout/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/index.mjs +23 -0
- package/dist/components/templates/Layout/index.mjs.map +1 -0
- package/dist/components/templates/index.d.mts +1 -0
- package/dist/components/templates/index.mjs +3 -0
- package/dist/core/accordion.d.mts +32 -0
- package/dist/core/accordion.d.mts.map +1 -0
- package/dist/core/accordion.mjs +59 -0
- package/dist/core/accordion.mjs.map +1 -0
- package/dist/core/button.d.mts +26 -0
- package/dist/core/button.d.mts.map +1 -0
- package/dist/core/button.mjs +55 -0
- package/dist/core/button.mjs.map +1 -0
- package/dist/core/checkbox.d.mts +15 -0
- package/dist/core/checkbox.d.mts.map +1 -0
- package/dist/core/checkbox.mjs +34 -0
- package/dist/core/checkbox.mjs.map +1 -0
- package/dist/core/dialog.d.mts +68 -0
- package/dist/core/dialog.d.mts.map +1 -0
- package/dist/core/dialog.mjs +124 -0
- package/dist/core/dialog.mjs.map +1 -0
- package/dist/core/drawer.d.mts +60 -0
- package/dist/core/drawer.d.mts.map +1 -0
- package/dist/core/drawer.mjs +120 -0
- package/dist/core/drawer.mjs.map +1 -0
- package/dist/core/field.d.mts +68 -0
- package/dist/core/field.d.mts.map +1 -0
- package/dist/core/field.mjs +145 -0
- package/dist/core/field.mjs.map +1 -0
- package/dist/core/input.d.mts +15 -0
- package/dist/core/input.d.mts.map +1 -0
- package/dist/core/input.mjs +27 -0
- package/dist/core/input.mjs.map +1 -0
- package/dist/core/label.d.mts +15 -0
- package/dist/core/label.d.mts.map +1 -0
- package/dist/core/label.mjs +24 -0
- package/dist/core/label.mjs.map +1 -0
- package/dist/core/popover.d.mts +38 -0
- package/dist/core/popover.d.mts.map +1 -0
- package/dist/core/popover.mjs +78 -0
- package/dist/core/popover.mjs.map +1 -0
- package/dist/core/progress.d.mts +22 -0
- package/dist/core/progress.d.mts.map +1 -0
- package/dist/core/progress.mjs +29 -0
- package/dist/core/progress.mjs.map +1 -0
- package/dist/core/radio-group.d.mts +19 -0
- package/dist/core/radio-group.d.mts.map +1 -0
- package/dist/core/radio-group.mjs +43 -0
- package/dist/core/radio-group.mjs.map +1 -0
- package/dist/core/select.d.mts +56 -0
- package/dist/core/select.d.mts.map +1 -0
- package/dist/core/select.mjs +144 -0
- package/dist/core/select.mjs.map +1 -0
- package/dist/core/separator.d.mts +17 -0
- package/dist/core/separator.d.mts.map +1 -0
- package/dist/core/separator.mjs +25 -0
- package/dist/core/separator.mjs.map +1 -0
- package/dist/core/skeleton.d.mts +13 -0
- package/dist/core/skeleton.d.mts.map +1 -0
- package/dist/core/skeleton.mjs +17 -0
- package/dist/core/skeleton.mjs.map +1 -0
- package/dist/core/switch.d.mts +24 -0
- package/dist/core/switch.d.mts.map +1 -0
- package/dist/core/switch.mjs +39 -0
- package/dist/core/switch.mjs.map +1 -0
- package/dist/core/textarea.d.mts +14 -0
- package/dist/core/textarea.d.mts.map +1 -0
- package/dist/core/textarea.mjs +25 -0
- package/dist/core/textarea.mjs.map +1 -0
- package/dist/core.d.mts +16 -1
- package/dist/core.mjs +16 -4
- package/dist/enums.d.mts +2 -1
- package/dist/enums.d.mts.map +1 -0
- package/dist/enums.mjs +2 -1
- package/dist/enums.mjs.map +1 -0
- package/dist/index.d.mts +29 -714
- package/dist/index.mjs +31 -5
- package/dist/node_modules/gsap/CSSPlugin.mjs +920 -0
- package/dist/node_modules/gsap/CSSPlugin.mjs.map +1 -0
- package/dist/node_modules/gsap/gsap-core.mjs +2723 -0
- package/dist/node_modules/gsap/gsap-core.mjs.map +1 -0
- package/dist/node_modules/gsap/index.mjs +9 -0
- package/dist/node_modules/gsap/index.mjs.map +1 -0
- package/dist/{output.css → style.css} +99 -215
- package/dist/style.css.map +1 -0
- package/dist/style.mjs +1 -0
- package/dist/utils.d.mts +2 -1
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +16 -2
- package/dist/utils.mjs.map +1 -0
- package/package.json +10 -11
- package/dist/Typography-Dznhj8uL.mjs +0 -71
- package/dist/index-BNAJ1QtH.d.mts +0 -75
- package/dist/index-tclrN3ts.d.mts +0 -61
- package/dist/index-y5n1p7t3.d.mts +0 -390
- package/dist/src-B6Kaolt3.mjs +0 -6158
- package/dist/src-BzCZ9O6j.css +0 -211
- package/dist/utils-1s_37TSX.mjs +0 -16
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../utils.mjs";
|
|
4
|
+
import { dialog_exports } from "../../../core/dialog.mjs";
|
|
5
|
+
import "../../../core.mjs";
|
|
6
|
+
import Button from "../../atoms/Button/index.mjs";
|
|
7
|
+
import "../../../index.mjs";
|
|
8
|
+
import { Check, CircleQuestionMark, Info, OctagonAlert, OctagonX } from "lucide-react";
|
|
9
|
+
import React, { useEffect, useState } from "react";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { createPortal } from "react-dom";
|
|
12
|
+
import { createRoot } from "react-dom/client";
|
|
13
|
+
import { v4 } from "uuid";
|
|
14
|
+
|
|
15
|
+
//#region src/components/organisms/Modal/index.tsx
|
|
16
|
+
const { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } = dialog_exports;
|
|
17
|
+
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
18
|
+
let modalRoot = null;
|
|
19
|
+
let modalStack = [];
|
|
20
|
+
let updateStack = null;
|
|
21
|
+
const createModalRoot = (container) => {
|
|
22
|
+
if (!isBrowser) return null;
|
|
23
|
+
const targetContainer = container || document.body;
|
|
24
|
+
let rootEl = targetContainer.querySelector("#modal-root");
|
|
25
|
+
if (!rootEl) {
|
|
26
|
+
rootEl = document.createElement("div");
|
|
27
|
+
rootEl.setAttribute("id", "modal-root");
|
|
28
|
+
rootEl.setAttribute("role", "dialog");
|
|
29
|
+
rootEl.setAttribute("aria-modal", "true");
|
|
30
|
+
rootEl.style.zIndex = "10000";
|
|
31
|
+
rootEl.style.position = "absolute";
|
|
32
|
+
targetContainer.appendChild(rootEl);
|
|
33
|
+
}
|
|
34
|
+
return rootEl;
|
|
35
|
+
};
|
|
36
|
+
const Modal = ({ open = false, maskClosable = false, closable = false, closeIcon, className, classNames, style, title, footer, container, children, okText = "OK", cancelText = "Cancel", onOk, onCancel, ...props }) => {
|
|
37
|
+
if (typeof window === "undefined") return null;
|
|
38
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
39
|
+
open,
|
|
40
|
+
onOpenChange: (open) => {
|
|
41
|
+
if (!open && maskClosable) onCancel?.();
|
|
42
|
+
},
|
|
43
|
+
...props,
|
|
44
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
45
|
+
className: cn("rounded-lg p-4 max-sm:max-w-[80%]", "border-none outline-none", className),
|
|
46
|
+
classNames: {
|
|
47
|
+
...classNames,
|
|
48
|
+
mask: cn("bg-black/60", classNames?.mask)
|
|
49
|
+
},
|
|
50
|
+
style,
|
|
51
|
+
showCloseButton: !!closable,
|
|
52
|
+
closeIcon,
|
|
53
|
+
container,
|
|
54
|
+
onCancel,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(DialogHeader, {
|
|
57
|
+
className: cn(classNames?.header, !title && "hidden"),
|
|
58
|
+
children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { className: "hidden" })]
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: cn("break-all", classNames?.body),
|
|
62
|
+
children
|
|
63
|
+
}),
|
|
64
|
+
footer !== null && /* @__PURE__ */ jsx(DialogFooter, {
|
|
65
|
+
className: cn("flex-row justify-end gap-x-2", classNames?.footer),
|
|
66
|
+
children: footer || /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
67
|
+
onClick: onOk,
|
|
68
|
+
children: okText
|
|
69
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
70
|
+
variant: "outlined",
|
|
71
|
+
onClick: onCancel,
|
|
72
|
+
children: cancelText
|
|
73
|
+
})] })
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const STATIC_ICONS = {
|
|
80
|
+
info: /* @__PURE__ */ jsx(Info, { className: "text-blue-400" }),
|
|
81
|
+
success: /* @__PURE__ */ jsx(Check, { className: "text-green-400" }),
|
|
82
|
+
error: /* @__PURE__ */ jsx(OctagonX, { className: "text-red-400" }),
|
|
83
|
+
warning: /* @__PURE__ */ jsx(OctagonAlert, { className: "text-yellow-400" }),
|
|
84
|
+
confirm: /* @__PURE__ */ jsx(CircleQuestionMark, {})
|
|
85
|
+
};
|
|
86
|
+
const StaticModal = ({ type, title, content, okText = "OK", cancelText = "Cancel", id, container, icon, onOk, onCancel, ...props }) => {
|
|
87
|
+
const [open, setOpen] = useState(true);
|
|
88
|
+
const closeModal = (callback) => {
|
|
89
|
+
callback?.();
|
|
90
|
+
setOpen(false);
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
Modal.destroy(id);
|
|
93
|
+
}, 200);
|
|
94
|
+
};
|
|
95
|
+
const footer = type === "confirm" ? /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: "grid w-full grid-cols-5 gap-x-2",
|
|
97
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
98
|
+
variant: "outlined",
|
|
99
|
+
className: "col-span-2",
|
|
100
|
+
onClick: () => closeModal(onCancel),
|
|
101
|
+
children: cancelText
|
|
102
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
103
|
+
className: "col-span-3",
|
|
104
|
+
onClick: () => closeModal(onOk),
|
|
105
|
+
children: okText
|
|
106
|
+
})]
|
|
107
|
+
}) : /* @__PURE__ */ jsx(Button, {
|
|
108
|
+
className: cn("grow"),
|
|
109
|
+
onClick: () => closeModal(onOk),
|
|
110
|
+
children: okText
|
|
111
|
+
});
|
|
112
|
+
if (!isBrowser) return null;
|
|
113
|
+
return createPortal(/* @__PURE__ */ jsx(Modal, {
|
|
114
|
+
open,
|
|
115
|
+
footer,
|
|
116
|
+
className: cn("z-10000", "box-content w-100", "rounded-3xl p-4", "gap-y-0"),
|
|
117
|
+
classNames: {
|
|
118
|
+
mask: "z-10000 bg-black/[.6]",
|
|
119
|
+
body: cn("text-black-70 whitespace-pre-wrap text-center", content && "mt-3"),
|
|
120
|
+
footer: "mt-9"
|
|
121
|
+
},
|
|
122
|
+
title: /* @__PURE__ */ jsxs("p", {
|
|
123
|
+
className: cn("text-center text-lg leading-normal whitespace-pre-wrap", "flex items-center justify-center gap-x-2"),
|
|
124
|
+
children: [icon || type && STATIC_ICONS[type], title]
|
|
125
|
+
}),
|
|
126
|
+
container,
|
|
127
|
+
onCancel: () => closeModal(onOk),
|
|
128
|
+
...props,
|
|
129
|
+
children: content
|
|
130
|
+
}), createModalRoot(container));
|
|
131
|
+
};
|
|
132
|
+
const ModalStackRenderer = () => {
|
|
133
|
+
const [, forceUpdate] = useState({});
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
updateStack = () => forceUpdate({});
|
|
136
|
+
return () => {
|
|
137
|
+
updateStack = null;
|
|
138
|
+
};
|
|
139
|
+
}, []);
|
|
140
|
+
return /* @__PURE__ */ jsx(Fragment, { children: modalStack.map(({ id, ...props }) => /* @__PURE__ */ jsx(StaticModal, {
|
|
141
|
+
id,
|
|
142
|
+
...props
|
|
143
|
+
}, id)) });
|
|
144
|
+
};
|
|
145
|
+
const modalRoots = /* @__PURE__ */ new Map();
|
|
146
|
+
const renderModal = (props) => {
|
|
147
|
+
if (!isBrowser) return;
|
|
148
|
+
const targetContainer = props.container || document.body;
|
|
149
|
+
const rootElement = createModalRoot(targetContainer);
|
|
150
|
+
if (!modalRoots.has(targetContainer)) {
|
|
151
|
+
const root = createRoot(rootElement);
|
|
152
|
+
modalRoots.set(targetContainer, root);
|
|
153
|
+
root.render(/* @__PURE__ */ jsx(ModalStackRenderer, {}));
|
|
154
|
+
}
|
|
155
|
+
const id = props.id || v4();
|
|
156
|
+
modalStack.push({
|
|
157
|
+
...props,
|
|
158
|
+
id
|
|
159
|
+
});
|
|
160
|
+
updateStack?.();
|
|
161
|
+
return id;
|
|
162
|
+
};
|
|
163
|
+
Modal.destroy = (id) => {
|
|
164
|
+
modalStack = id ? modalStack.filter((modal) => modal.id !== id) : [];
|
|
165
|
+
updateStack?.();
|
|
166
|
+
if (!modalStack.length && modalRoot) {
|
|
167
|
+
modalRoot.unmount();
|
|
168
|
+
modalRoot = null;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
Modal.destroyAll = () => {
|
|
172
|
+
Modal.destroy();
|
|
173
|
+
};
|
|
174
|
+
Modal.info = (props) => renderModal({
|
|
175
|
+
type: "info",
|
|
176
|
+
...props
|
|
177
|
+
});
|
|
178
|
+
Modal.success = (props) => renderModal({
|
|
179
|
+
type: "success",
|
|
180
|
+
...props
|
|
181
|
+
});
|
|
182
|
+
Modal.error = (props) => renderModal({
|
|
183
|
+
type: "error",
|
|
184
|
+
...props
|
|
185
|
+
});
|
|
186
|
+
Modal.warning = (props) => renderModal({
|
|
187
|
+
type: "warning",
|
|
188
|
+
...props
|
|
189
|
+
});
|
|
190
|
+
Modal.confirm = (props) => renderModal({
|
|
191
|
+
type: "confirm",
|
|
192
|
+
...props
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
export { Modal as default };
|
|
197
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["dialog","uuid"],"sources":["../../../../src/components/organisms/Modal/index.tsx"],"sourcesContent":["'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { Root, createRoot } from 'react-dom/client';\n\nimport {\n Check,\n CircleQuestionMark,\n Info,\n OctagonAlert,\n OctagonX,\n} from 'lucide-react';\nimport { v4 as uuid } from 'uuid';\n\nimport { Button } from '@repo/ui';\nimport { dialog } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nconst {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} = dialog;\n\ninterface Props {\n open?: boolean;\n maskClosable?: boolean;\n closable?:\n | boolean\n | {\n closeIcon?: React.ReactNode;\n disabled?: boolean;\n };\n closeIcon?: React.ReactNode;\n title?: React.ReactNode;\n content?: React.ReactNode;\n footer?: React.ReactNode;\n className?: string;\n classNames?: {\n mask?: string;\n header?: string;\n body?: string;\n footer?: string;\n };\n style?: React.CSSProperties;\n okText?: string;\n cancelText?: string;\n container?: HTMLElement;\n children?: React.ReactNode;\n onOk?: () => void;\n onCancel?: () => void;\n}\n\ninterface StaticProps extends Props {\n type?: 'info' | 'success' | 'error' | 'warning' | 'confirm';\n id?: string;\n icon?: React.ReactNode;\n container?: HTMLElement;\n}\n\nconst isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\nlet modalRoot: Root | null = null;\nlet modalStack: StaticProps[] = [];\nlet updateStack: (() => void) | null = null;\n\nconst createModalRoot = (container?: HTMLElement) => {\n if (!isBrowser) {\n return null;\n }\n\n const targetContainer = container || document.body;\n let rootEl = targetContainer.querySelector(\n '#modal-root',\n ) as HTMLElement | null;\n\n if (!rootEl) {\n rootEl = document.createElement('div');\n rootEl.setAttribute('id', 'modal-root');\n rootEl.setAttribute('role', 'dialog');\n rootEl.setAttribute('aria-modal', 'true');\n rootEl.style.zIndex = '10000';\n rootEl.style.position = 'absolute';\n targetContainer.appendChild(rootEl);\n }\n\n return rootEl;\n};\n\nconst Modal = ({\n open = false,\n maskClosable = false,\n closable = false,\n closeIcon,\n className,\n classNames,\n style,\n title,\n footer,\n container,\n children,\n okText = 'OK',\n cancelText = 'Cancel',\n onOk,\n onCancel,\n ...props\n}: Props) => {\n if (typeof window === 'undefined') {\n return null;\n }\n\n return (\n <Dialog\n open={open}\n onOpenChange={(open: boolean) => {\n if (!open && maskClosable) {\n onCancel?.();\n }\n }}\n {...props}\n >\n <DialogContent\n className={cn(\n 'rounded-lg p-4 max-sm:max-w-[80%]',\n 'border-none outline-none',\n className,\n )}\n classNames={{\n ...classNames,\n mask: cn('bg-black/60', classNames?.mask),\n }}\n style={style}\n showCloseButton={!!closable}\n closeIcon={closeIcon}\n container={container}\n onCancel={onCancel}\n >\n {/**\n * @todo [Dialog & AlertDialog] fix: can't get id correctly in shadow dom\n * @see https://github.com/radix-ui/primitives/pull/3384\n **/}\n <DialogHeader\n className={cn(\n classNames?.header,\n !title && 'hidden',\n //\n )}\n >\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription className=\"hidden\" />\n </DialogHeader>\n <div className={cn('break-all', classNames?.body)}>{children}</div>\n {footer !== null && (\n <DialogFooter\n className={cn('flex-row justify-end gap-x-2', classNames?.footer)}\n >\n {footer || (\n <>\n <Button onClick={onOk}>{okText}</Button>\n <Button variant=\"outlined\" onClick={onCancel}>\n {cancelText}\n </Button>\n </>\n )}\n </DialogFooter>\n )}\n </DialogContent>\n </Dialog>\n );\n};\n\nconst STATIC_ICONS = {\n info: <Info className=\"text-blue-400\" />,\n success: <Check className=\"text-green-400\" />,\n error: <OctagonX className=\"text-red-400\" />,\n warning: <OctagonAlert className=\"text-yellow-400\" />,\n confirm: <CircleQuestionMark />,\n};\n\nconst StaticModal = ({\n type,\n title,\n content,\n okText = 'OK',\n cancelText = 'Cancel',\n id,\n container,\n icon,\n onOk,\n onCancel,\n ...props\n}: StaticProps) => {\n const [open, setOpen] = useState(true);\n\n const closeModal = (callback?: () => void) => {\n callback?.();\n setOpen(false);\n setTimeout(() => {\n Modal.destroy(id);\n }, 200);\n };\n\n const footer =\n type === 'confirm' ? (\n <div className=\"grid w-full grid-cols-5 gap-x-2\">\n <Button\n variant=\"outlined\"\n className=\"col-span-2\"\n onClick={() => closeModal(onCancel)}\n >\n {cancelText}\n </Button>\n <Button className=\"col-span-3\" onClick={() => closeModal(onOk)}>\n {okText}\n </Button>\n </div>\n ) : (\n <Button\n className={cn(\n 'grow',\n //\n )}\n onClick={() => closeModal(onOk)}\n >\n {okText}\n </Button>\n );\n\n if (!isBrowser) {\n return null;\n }\n\n return createPortal(\n <Modal\n open={open}\n footer={footer}\n className={cn(\n 'z-10000',\n 'box-content w-100',\n 'rounded-3xl p-4',\n 'gap-y-0',\n )}\n classNames={{\n mask: 'z-10000 bg-black/[.6]',\n body: cn(\n 'text-black-70 whitespace-pre-wrap text-center',\n content && 'mt-3',\n ),\n footer: 'mt-9',\n }}\n title={\n <p\n className={cn(\n 'text-center text-lg leading-normal whitespace-pre-wrap',\n 'flex items-center justify-center gap-x-2',\n //\n )}\n >\n {icon || (type && STATIC_ICONS[type])}\n {title}\n </p>\n }\n container={container}\n onCancel={() => closeModal(onOk)}\n {...props}\n >\n {content}\n </Modal>,\n createModalRoot(container)!,\n );\n};\n\nconst ModalStackRenderer = () => {\n const [, forceUpdate] = useState({});\n\n useEffect(() => {\n updateStack = () => forceUpdate({});\n return () => {\n updateStack = null;\n };\n }, []);\n\n return (\n <>\n {modalStack.map(({ id, ...props }) => (\n <StaticModal key={id} id={id} {...props} />\n ))}\n </>\n );\n};\n\nconst modalRoots = new Map<HTMLElement, Root>();\n\nconst renderModal = (props: StaticProps) => {\n if (!isBrowser) {\n return;\n }\n\n const targetContainer = props.container || document.body;\n const rootElement = createModalRoot(targetContainer)!;\n\n if (!modalRoots.has(targetContainer)) {\n const root = createRoot(rootElement);\n modalRoots.set(targetContainer, root);\n root.render(<ModalStackRenderer />);\n }\n\n const id = props.id || uuid();\n modalStack.push({ ...props, id });\n updateStack?.();\n\n return id;\n};\n\nModal.destroy = (id?: string) => {\n modalStack = id ? modalStack.filter(modal => modal.id !== id) : [];\n\n updateStack?.();\n\n if (!modalStack.length && modalRoot) {\n modalRoot.unmount();\n modalRoot = null;\n }\n};\n\nModal.destroyAll = () => {\n Modal.destroy();\n};\n\nModal.info = (props: StaticProps) => renderModal({ type: 'info', ...props });\nModal.success = (props: StaticProps) =>\n renderModal({ type: 'success', ...props });\nModal.error = (props: StaticProps) => renderModal({ type: 'error', ...props });\nModal.warning = (props: StaticProps) =>\n renderModal({ type: 'warning', ...props });\nModal.confirm = (props: StaticProps) =>\n renderModal({ type: 'confirm', ...props });\n\nexport default Modal;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { SwiperSlide } from "swiper/react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/organisms/Swiper/Slide/index.tsx
|
|
6
|
+
const Slide = ({ children, className, ...props }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(SwiperSlide, {
|
|
8
|
+
className: cn(className),
|
|
9
|
+
...props,
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
Slide.displayName = "SwiperSlide";
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Slide as default };
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/organisms/Swiper/Slide/index.tsx"],"sourcesContent":["import { SwiperSlide, type SwiperSlideProps } from 'swiper/react';\n\nimport { cn } from '@repo/ui/utils';\n\nconst Slide = ({ children, className, ...props }: SwiperSlideProps) => {\n return (\n <SwiperSlide className={cn(className)} {...props}>\n {children}\n </SwiperSlide>\n );\n};\n\nSlide.displayName = 'SwiperSlide';\n\nexport default Slide;\n"],"mappings":";;;;;AAIA,MAAM,SAAS,EAAE,UAAU,WAAW,GAAG,YAA8B;AACrE,QACE,oBAAC;EAAY,WAAW,GAAG,UAAU;EAAE,GAAI;EACxC;GACW;;AAIlB,MAAM,cAAc"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import * as swiper_react0 from "swiper/react";
|
|
3
|
+
import { SwiperProps } from "swiper/react";
|
|
4
|
+
import "swiper/css";
|
|
5
|
+
import "swiper/css/autoplay";
|
|
6
|
+
import "swiper/css/effect-cards";
|
|
7
|
+
import "swiper/css/navigation";
|
|
8
|
+
import "swiper/css/scrollbar";
|
|
9
|
+
import { SwiperOptions } from "swiper/types";
|
|
10
|
+
|
|
11
|
+
//#region src/components/organisms/Swiper/index.d.ts
|
|
12
|
+
interface Props<T> extends SwiperProps {
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
loader?: React.ReactNode;
|
|
15
|
+
loadingClassName?: string;
|
|
16
|
+
options?: SwiperOptions;
|
|
17
|
+
data: T[];
|
|
18
|
+
renderItem(item: T, key: number): React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
declare const Swiper$1: {
|
|
21
|
+
<T>({
|
|
22
|
+
loading,
|
|
23
|
+
loader,
|
|
24
|
+
options,
|
|
25
|
+
data,
|
|
26
|
+
style,
|
|
27
|
+
renderItem,
|
|
28
|
+
loadingClassName,
|
|
29
|
+
...props
|
|
30
|
+
}: Props<T>): react_jsx_runtime0.JSX.Element;
|
|
31
|
+
Slide: {
|
|
32
|
+
({
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}: swiper_react0.SwiperSlideProps): react_jsx_runtime0.JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Swiper$1 as Swiper };
|
|
42
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/organisms/Swiper/index.tsx"],"mappings":";;;;;;;;;;;UA8BU,KAAA,YAAiB,WAAA;EACzB,OAAA;EACA,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,gBAAA;EACA,OAAA,GAAU,aAAA;EACV,IAAA,EAAM,CAAA;EACN,UAAA,CAAW,IAAA,EAAM,CAAA,EAAG,GAAA,WAAc,KAAA,CAAM,SAAA;AAAA;AAAA,cAGpC,QAAA;EAAA;IAAW,OAAA;IAAA,MAAA;IAAA,OAAA;IAAA,IAAA;IAAA,KAAA;IAAA,UAAA;IAAA,gBAAA;IAAA,GAAA;EAAA,GASd,KAAA,CAAM,CAAA,IAAE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../utils.mjs";
|
|
4
|
+
import Spin from "../../atoms/Spin/index.mjs";
|
|
5
|
+
import "../../atoms/index.mjs";
|
|
6
|
+
import Slide from "./Slide/index.mjs";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Autoplay, EffectCards, Navigation, Scrollbar } from "swiper/modules";
|
|
9
|
+
import { Swiper } from "swiper/react";
|
|
10
|
+
import "swiper/css";
|
|
11
|
+
import "swiper/css/autoplay";
|
|
12
|
+
import "swiper/css/effect-cards";
|
|
13
|
+
import "swiper/css/navigation";
|
|
14
|
+
import "swiper/css/scrollbar";
|
|
15
|
+
|
|
16
|
+
//#region src/components/organisms/Swiper/index.tsx
|
|
17
|
+
const initialOptions = {
|
|
18
|
+
loop: false,
|
|
19
|
+
spaceBetween: 8,
|
|
20
|
+
slidesPerView: "auto",
|
|
21
|
+
navigation: false,
|
|
22
|
+
autoplay: {
|
|
23
|
+
delay: 2500,
|
|
24
|
+
disableOnInteraction: false
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const initialStyle = {
|
|
28
|
+
width: "100%",
|
|
29
|
+
maxWidth: "100vw",
|
|
30
|
+
overflow: "hidden"
|
|
31
|
+
};
|
|
32
|
+
const Swiper$1 = ({ loading, loader, options = {}, data = [], style, renderItem, loadingClassName, ...props }) => {
|
|
33
|
+
if (loading) return /* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: cn("h-32", loadingClassName),
|
|
35
|
+
children: loader || /* @__PURE__ */ jsx(Spin, { spinning: true })
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ jsx(Swiper, {
|
|
38
|
+
modules: [
|
|
39
|
+
Navigation,
|
|
40
|
+
Scrollbar,
|
|
41
|
+
Autoplay,
|
|
42
|
+
EffectCards
|
|
43
|
+
],
|
|
44
|
+
...initialOptions,
|
|
45
|
+
...options,
|
|
46
|
+
style: {
|
|
47
|
+
...initialStyle,
|
|
48
|
+
...style
|
|
49
|
+
},
|
|
50
|
+
...props,
|
|
51
|
+
children: data.map((item, i) => renderItem(item, i))
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
Swiper$1.Slide = Slide;
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { Swiper$1 as default };
|
|
58
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Swiper","SwiperCore"],"sources":["../../../../src/components/organisms/Swiper/index.tsx"],"sourcesContent":["'use client';\n\nimport { Autoplay, EffectCards, Navigation, Scrollbar } from 'swiper/modules';\nimport { Swiper as SwiperCore, SwiperProps } from 'swiper/react';\nimport { SwiperOptions } from 'swiper/types';\n\nimport { cn } from '@repo/ui/utils';\n\nimport 'swiper/css';\nimport 'swiper/css/autoplay';\nimport 'swiper/css/effect-cards';\nimport 'swiper/css/navigation';\nimport 'swiper/css/scrollbar';\n\nimport { Spin } from '../../atoms';\nimport Slide from './Slide';\n\nexport const initialOptions: SwiperOptions = {\n loop: false,\n spaceBetween: 8,\n slidesPerView: 'auto',\n navigation: false,\n autoplay: {\n delay: 2500,\n disableOnInteraction: false,\n },\n};\n\nconst initialStyle = { width: '100%', maxWidth: '100vw', overflow: 'hidden' };\n\ninterface Props<T> extends SwiperProps {\n loading?: boolean;\n loader?: React.ReactNode;\n loadingClassName?: string;\n options?: SwiperOptions;\n data: T[];\n renderItem(item: T, key: number): React.ReactNode;\n}\n\nconst Swiper = <T,>({\n loading,\n loader,\n options = {},\n data = [],\n style,\n renderItem,\n loadingClassName,\n ...props\n}: Props<T>) => {\n if (loading) {\n return (\n <div className={cn('h-32', loadingClassName)}>\n {loader || <Spin spinning />}\n </div>\n );\n }\n\n return (\n <SwiperCore\n modules={[Navigation, Scrollbar, Autoplay, EffectCards]}\n {...initialOptions}\n {...options}\n style={{ ...initialStyle, ...style }}\n {...props}\n >\n {data.map((item: T, i) => renderItem(item, i))}\n </SwiperCore>\n );\n};\n\nSwiper.Slide = Slide;\n\nexport default Swiper;\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAa,iBAAgC;CAC3C,MAAM;CACN,cAAc;CACd,eAAe;CACf,YAAY;CACZ,UAAU;EACR,OAAO;EACP,sBAAsB;EACvB;CACF;AAED,MAAM,eAAe;CAAE,OAAO;CAAQ,UAAU;CAAS,UAAU;CAAU;AAW7E,MAAMA,YAAc,EAClB,SACA,QACA,UAAU,EAAE,EACZ,OAAO,EAAE,EACT,OACA,YACA,kBACA,GAAG,YACW;AACd,KAAI,QACF,QACE,oBAAC;EAAI,WAAW,GAAG,QAAQ,iBAAiB;YACzC,UAAU,oBAAC,QAAK,iBAAW;GACxB;AAIV,QACE,oBAACC;EACC,SAAS;GAAC;GAAY;GAAW;GAAU;GAAY;EACvD,GAAI;EACJ,GAAI;EACJ,OAAO;GAAE,GAAG;GAAc,GAAG;GAAO;EACpC,GAAI;YAEH,KAAK,KAAK,MAAS,MAAM,WAAW,MAAM,EAAE,CAAC;GACnC;;AAIjB,SAAO,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/templates/Layout/Content/index.tsx
|
|
5
|
+
const Content = ({ children, className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cn("shrink grow basis-0", className),
|
|
8
|
+
...props,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Content as default };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/templates/Layout/Content/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nconst Content = ({\n children,\n className,\n ...props\n}: React.ComponentPropsWithoutRef<'div'>) => {\n return (\n <div className={cn('shrink grow basis-0', className)} {...props}>\n {children}\n </div>\n );\n};\n\nexport default Content;\n"],"mappings":";;;;AAEA,MAAM,WAAW,EACf,UACA,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EAAI,WAAW,GAAG,uBAAuB,UAAU;EAAE,GAAI;EACvD;GACG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/templates/Layout/Footer/index.tsx
|
|
5
|
+
const Footer = ({ children, className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cn(className, "w-full"),
|
|
8
|
+
...props,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Footer as default };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/templates/Layout/Footer/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nconst Footer = ({\n children,\n className,\n ...props\n}: React.ComponentPropsWithoutRef<'div'>) => {\n return (\n <div className={cn(className, 'w-full')} {...props}>\n {children}\n </div>\n );\n};\n\nexport default Footer;\n"],"mappings":";;;;AAEA,MAAM,UAAU,EACd,UACA,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EAAI,WAAW,GAAG,WAAW,SAAS;EAAE,GAAI;EAC1C;GACG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/components/templates/Layout/Header/index.tsx"],"mappings":";;;UAEiB,KAAA,SAAc,KAAA,CAAM,wBAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/templates/Layout/Header/index.tsx
|
|
5
|
+
const Header = ({ children, className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cn("sticky top-0 z-50", "flex w-full items-center justify-center px-5", className),
|
|
8
|
+
...props,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Header as default };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/templates/Layout/Header/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst Header = ({ children, className, ...props }: Props) => {\n return (\n <div\n className={cn(\n 'sticky top-0 z-50',\n 'flex w-full items-center justify-center px-5',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n};\n\nexport default Header;\n"],"mappings":";;;;AAIA,MAAM,UAAU,EAAE,UAAU,WAAW,GAAG,YAAmB;AAC3D,QACE,oBAAC;EACC,WAAW,GACT,qBACA,gDACA,UACD;EACD,GAAI;EAEH;GACG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/templates/Layout/Sider/index.tsx
|
|
5
|
+
const Sider = ({ children, className, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: cn("z-100", "w-50", className),
|
|
8
|
+
...props,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Sider as default };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/templates/Layout/Sider/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nconst Sider = ({\n children,\n className,\n ...props\n}: React.ComponentPropsWithoutRef<'div'>) => {\n return (\n <div\n className={cn(\n 'z-100',\n 'w-50',\n className,\n //\n )}\n {...props}\n >\n {children}\n </div>\n );\n};\n\nexport default Sider;\n"],"mappings":";;;;AAEA,MAAM,SAAS,EACb,UACA,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EACC,WAAW,GACT,SACA,QACA,UAED;EACD,GAAI;EAEH;GACG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Props as Props$1 } from "./Header/index.mjs";
|
|
2
|
+
import "./Content/index.mjs";
|
|
3
|
+
import "./Footer/index.mjs";
|
|
4
|
+
import "./Sider/index.mjs";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/templates/Layout/index.d.ts
|
|
8
|
+
interface Props extends React.ComponentPropsWithoutRef<'div'> {}
|
|
9
|
+
declare const Layout: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: Props): react_jsx_runtime0.JSX.Element;
|
|
15
|
+
Content: ({
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
|
|
20
|
+
Footer: ({
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
|
|
25
|
+
Header: ({
|
|
26
|
+
children,
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}: Props$1) => react_jsx_runtime0.JSX.Element;
|
|
30
|
+
Sider: ({
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentPropsWithoutRef<"div">) => react_jsx_runtime0.JSX.Element;
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Layout };
|
|
38
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/templates/Layout/index.tsx"],"mappings":";;;;;;;UAOiB,KAAA,SAAc,KAAA,CAAM,wBAAA;AAAA,cAE/B,MAAA;EAAA;;;;KAA6C,KAAA,GAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../../../utils.mjs";
|
|
2
|
+
import Content from "./Content/index.mjs";
|
|
3
|
+
import Footer from "./Footer/index.mjs";
|
|
4
|
+
import Header from "./Header/index.mjs";
|
|
5
|
+
import Sider from "./Sider/index.mjs";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/templates/Layout/index.tsx
|
|
9
|
+
const Layout = ({ children, className, ...props }) => {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: cn("flex w-full flex-wrap content-start", className),
|
|
12
|
+
...props,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
Layout.Content = Content;
|
|
17
|
+
Layout.Footer = Footer;
|
|
18
|
+
Layout.Header = Header;
|
|
19
|
+
Layout.Sider = Sider;
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Layout as default };
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/templates/Layout/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nimport Content from './Content';\nimport Footer from './Footer';\nimport Header from './Header';\nimport Sider from './Sider';\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst Layout = ({ children, className, ...props }: Props) => {\n return (\n <div\n className={cn('flex w-full flex-wrap content-start', className)}\n {...props}\n >\n {children}\n </div>\n );\n};\n\nLayout.Content = Content;\nLayout.Footer = Footer;\nLayout.Header = Header;\nLayout.Sider = Sider;\n\nexport { Content, Footer, Header, Sider };\n\nexport default Layout;\n"],"mappings":";;;;;;;;AASA,MAAM,UAAU,EAAE,UAAU,WAAW,GAAG,YAAmB;AAC3D,QACE,oBAAC;EACC,WAAW,GAAG,uCAAuC,UAAU;EAC/D,GAAI;EAEH;GACG;;AAIV,OAAO,UAAU;AACjB,OAAO,SAAS;AAChB,OAAO,SAAS;AAChB,OAAO,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Layout } from "./Layout/index.mjs";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/core/accordion.d.ts
|
|
6
|
+
declare namespace accordion_d_exports {
|
|
7
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
8
|
+
}
|
|
9
|
+
declare function Accordion({
|
|
10
|
+
...props
|
|
11
|
+
}: React$1.ComponentProps<typeof AccordionPrimitive.Root>): react_jsx_runtime0.JSX.Element;
|
|
12
|
+
declare function AccordionItem({
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}: React$1.ComponentProps<typeof AccordionPrimitive.Item>): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
interface CustomTriggerProps {
|
|
17
|
+
expandIcon?: React$1.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare function AccordionTrigger({
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
expandIcon,
|
|
23
|
+
...props
|
|
24
|
+
}: React$1.ComponentProps<typeof AccordionPrimitive.Trigger> & CustomTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
25
|
+
declare function AccordionContent({
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
...props
|
|
29
|
+
}: React$1.ComponentProps<typeof AccordionPrimitive.Content>): react_jsx_runtime0.JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { accordion_d_exports };
|
|
32
|
+
//# sourceMappingURL=accordion.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.mts","names":[],"sources":["../../src/core/accordion.tsx"],"mappings":";;;;;;;;iBASS,SAAA,CAAA;EAAA,GACJ;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,IAAA,IAAK,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAI9C,aAAA,CAAA;EACP,SAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,IAAA,IAAK,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,UAU7C,kBAAA;EACR,UAAA,GAAa,OAAA,CAAM,SAAA;AAAA;AAAA,iBAGZ,gBAAA,CAAA;EACP,SAAA;EACA,QAAA;EACA,UAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,OAAA,IAChD,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA2BX,gBAAA,CAAA;EACP,SAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,OAAA,IAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|