@tipp/ui 1.2.13 → 1.2.15
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/atoms/badge.cjs +2 -0
- package/dist/atoms/badge.cjs.map +1 -1
- package/dist/atoms/badge.d.cts +2 -2
- package/dist/atoms/badge.d.ts +2 -2
- package/dist/atoms/badge.js +1 -1
- package/dist/atoms/dialog.cjs +24 -58
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +1 -3
- package/dist/atoms/drawer.cjs +7 -50
- package/dist/atoms/drawer.cjs.map +1 -1
- package/dist/atoms/drawer.d.cts +1 -1
- package/dist/atoms/drawer.d.ts +1 -1
- package/dist/atoms/drawer.js +1 -4
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/index.cjs +116 -131
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.js +46 -47
- package/dist/atoms/pagination.js +2 -2
- package/dist/atoms/toast.cjs +7 -10
- package/dist/atoms/toast.cjs.map +1 -1
- package/dist/atoms/toast.js +1 -2
- package/dist/chunk-2FIAJ3FS.js +59 -0
- package/dist/chunk-2FIAJ3FS.js.map +1 -0
- package/dist/chunk-2QDLO3YM.js +97 -0
- package/dist/chunk-2QDLO3YM.js.map +1 -0
- package/dist/chunk-33YXJNZC.js +39 -0
- package/dist/chunk-33YXJNZC.js.map +1 -0
- package/dist/chunk-3PKH6B5Q.js +90 -0
- package/dist/chunk-3PKH6B5Q.js.map +1 -0
- package/dist/chunk-3QK6FAST.js +88 -0
- package/dist/chunk-3QK6FAST.js.map +1 -0
- package/dist/chunk-4BPB2XGG.js +94 -0
- package/dist/chunk-4BPB2XGG.js.map +1 -0
- package/dist/chunk-4LU6NFEH.js +59 -0
- package/dist/chunk-4LU6NFEH.js.map +1 -0
- package/dist/chunk-4SMYMKD7.js +59 -0
- package/dist/chunk-4SMYMKD7.js.map +1 -0
- package/dist/chunk-5T5OBKU6.js +38 -0
- package/dist/chunk-5T5OBKU6.js.map +1 -0
- package/dist/chunk-6IUPU7DC.js +44 -0
- package/dist/chunk-6IUPU7DC.js.map +1 -0
- package/dist/chunk-6MWBFGPV.js +44 -0
- package/dist/chunk-6MWBFGPV.js.map +1 -0
- package/dist/chunk-7JIZ5JRE.js +97 -0
- package/dist/chunk-7JIZ5JRE.js.map +1 -0
- package/dist/chunk-7MGIYERY.js +340 -0
- package/dist/chunk-7MGIYERY.js.map +1 -0
- package/dist/chunk-7MGKSZWD.js +59 -0
- package/dist/chunk-7MGKSZWD.js.map +1 -0
- package/dist/chunk-7NEEBOE5.js +59 -0
- package/dist/chunk-7NEEBOE5.js.map +1 -0
- package/dist/chunk-7TLF23E7.js +50 -0
- package/dist/chunk-7TLF23E7.js.map +1 -0
- package/dist/chunk-AAAQKCFX.js +39 -0
- package/dist/chunk-AAAQKCFX.js.map +1 -0
- package/dist/chunk-AOUTNRVR.js +94 -0
- package/dist/chunk-AOUTNRVR.js.map +1 -0
- package/dist/chunk-AOY2722L.js +43 -0
- package/dist/chunk-AOY2722L.js.map +1 -0
- package/dist/chunk-CA3KCVF3.js +44 -0
- package/dist/chunk-CA3KCVF3.js.map +1 -0
- package/dist/chunk-DWRAPSVA.js +94 -0
- package/dist/chunk-DWRAPSVA.js.map +1 -0
- package/dist/chunk-E2EF6AJK.js +340 -0
- package/dist/chunk-E2EF6AJK.js.map +1 -0
- package/dist/chunk-EBIISCYP.js +59 -0
- package/dist/chunk-EBIISCYP.js.map +1 -0
- package/dist/chunk-EWD4AO5N.js +49 -0
- package/dist/chunk-EWD4AO5N.js.map +1 -0
- package/dist/chunk-EYP37NAX.js +39 -0
- package/dist/chunk-EYP37NAX.js.map +1 -0
- package/dist/chunk-FLPWMNPQ.js +340 -0
- package/dist/chunk-FLPWMNPQ.js.map +1 -0
- package/dist/chunk-FYQHXVVC.js +39 -0
- package/dist/chunk-FYQHXVVC.js.map +1 -0
- package/dist/chunk-G653JNTD.js +59 -0
- package/dist/chunk-G653JNTD.js.map +1 -0
- package/dist/chunk-G7BR6KSX.js +130 -0
- package/dist/chunk-G7BR6KSX.js.map +1 -0
- package/dist/chunk-GXID5CO5.js +92 -0
- package/dist/chunk-GXID5CO5.js.map +1 -0
- package/dist/chunk-HDIMW26M.js +40 -0
- package/dist/chunk-HDIMW26M.js.map +1 -0
- package/dist/chunk-HJQQMAUB.js +50 -0
- package/dist/chunk-HJQQMAUB.js.map +1 -0
- package/dist/chunk-HMLPXWJ6.js +94 -0
- package/dist/chunk-HMLPXWJ6.js.map +1 -0
- package/dist/chunk-HWJLK6WM.js +39 -0
- package/dist/chunk-HWJLK6WM.js.map +1 -0
- package/dist/chunk-I2PIGNYP.js +97 -0
- package/dist/chunk-I2PIGNYP.js.map +1 -0
- package/dist/chunk-IX7WVKHI.js +59 -0
- package/dist/chunk-IX7WVKHI.js.map +1 -0
- package/dist/chunk-J4DYXLNJ.js +88 -0
- package/dist/chunk-J4DYXLNJ.js.map +1 -0
- package/dist/chunk-JGEN42KT.js +35 -0
- package/dist/chunk-JGEN42KT.js.map +1 -0
- package/dist/chunk-KK5BCWBR.js +42 -0
- package/dist/chunk-KK5BCWBR.js.map +1 -0
- package/dist/chunk-KLOQQGZ3.js +42 -0
- package/dist/chunk-KLOQQGZ3.js.map +1 -0
- package/dist/chunk-KVGCDBJ4.js +42 -0
- package/dist/chunk-KVGCDBJ4.js.map +1 -0
- package/dist/chunk-L3UVJ67X.js +340 -0
- package/dist/chunk-L3UVJ67X.js.map +1 -0
- package/dist/chunk-LS64FVRE.js +59 -0
- package/dist/chunk-LS64FVRE.js.map +1 -0
- package/dist/chunk-LVXTFKVJ.js +49 -0
- package/dist/chunk-LVXTFKVJ.js.map +1 -0
- package/dist/chunk-MFVWAA4Y.js +56 -0
- package/dist/chunk-MFVWAA4Y.js.map +1 -0
- package/dist/chunk-MKYNSWMI.js +340 -0
- package/dist/chunk-MKYNSWMI.js.map +1 -0
- package/dist/chunk-NJTNP47L.js +340 -0
- package/dist/chunk-NJTNP47L.js.map +1 -0
- package/dist/chunk-NUEMI3QO.js +340 -0
- package/dist/chunk-NUEMI3QO.js.map +1 -0
- package/dist/chunk-NY6E6TKU.js +94 -0
- package/dist/chunk-NY6E6TKU.js.map +1 -0
- package/dist/chunk-OJQJLBBK.js +39 -0
- package/dist/chunk-OJQJLBBK.js.map +1 -0
- package/dist/chunk-P7633BEQ.js +340 -0
- package/dist/chunk-P7633BEQ.js.map +1 -0
- package/dist/chunk-P7NBEL7J.js +88 -0
- package/dist/chunk-P7NBEL7J.js.map +1 -0
- package/dist/chunk-PLXOVGG4.js +39 -0
- package/dist/chunk-PLXOVGG4.js.map +1 -0
- package/dist/chunk-PT5CZAR3.js +94 -0
- package/dist/chunk-PT5CZAR3.js.map +1 -0
- package/dist/chunk-PXABCUAT.js +44 -0
- package/dist/chunk-PXABCUAT.js.map +1 -0
- package/dist/chunk-QNYKTW7L.js +45 -0
- package/dist/chunk-QNYKTW7L.js.map +1 -0
- package/dist/chunk-QVQCTPDU.js +130 -0
- package/dist/chunk-QVQCTPDU.js.map +1 -0
- package/dist/chunk-RXCENPRG.js +38 -0
- package/dist/chunk-RXCENPRG.js.map +1 -0
- package/dist/chunk-SSI6JRBA.js +92 -0
- package/dist/chunk-SSI6JRBA.js.map +1 -0
- package/dist/chunk-T2DBM2OA.js +59 -0
- package/dist/chunk-T2DBM2OA.js.map +1 -0
- package/dist/chunk-TAU5LFOR.js +39 -0
- package/dist/chunk-TAU5LFOR.js.map +1 -0
- package/dist/chunk-UFW4DFY5.js +39 -0
- package/dist/chunk-UFW4DFY5.js.map +1 -0
- package/dist/chunk-US7J5XUZ.js +36 -0
- package/dist/chunk-US7J5XUZ.js.map +1 -0
- package/dist/chunk-VPHZV3J2.js +340 -0
- package/dist/chunk-VPHZV3J2.js.map +1 -0
- package/dist/chunk-WZJWP4AC.js +59 -0
- package/dist/chunk-WZJWP4AC.js.map +1 -0
- package/dist/chunk-X2VREBVY.js +39 -0
- package/dist/chunk-X2VREBVY.js.map +1 -0
- package/dist/chunk-X55DKUZS.js +39 -0
- package/dist/chunk-X55DKUZS.js.map +1 -0
- package/dist/chunk-XFPO6ULS.js +39 -0
- package/dist/chunk-XFPO6ULS.js.map +1 -0
- package/dist/chunk-XKOYSFH4.js +43 -0
- package/dist/chunk-XKOYSFH4.js.map +1 -0
- package/dist/chunk-XXKNNYIJ.js +59 -0
- package/dist/chunk-XXKNNYIJ.js.map +1 -0
- package/dist/chunk-Y3L7BYDF.js +169 -0
- package/dist/chunk-Y3L7BYDF.js.map +1 -0
- package/dist/chunk-YA3PXLPU.js +53 -0
- package/dist/chunk-YA3PXLPU.js.map +1 -0
- package/dist/chunk-YAAL4JEU.js +59 -0
- package/dist/chunk-YAAL4JEU.js.map +1 -0
- package/dist/chunk-YESWEUM2.js +1 -0
- package/dist/chunk-YESWEUM2.js.map +1 -0
- package/dist/chunk-YILB2DTL.js +39 -0
- package/dist/chunk-YILB2DTL.js.map +1 -0
- package/dist/chunk-YNVFLDKB.js +92 -0
- package/dist/chunk-YNVFLDKB.js.map +1 -0
- package/dist/chunk-YSBOFKXT.js +39 -0
- package/dist/chunk-YSBOFKXT.js.map +1 -0
- package/dist/chunk-YTYGMU6L.js +169 -0
- package/dist/chunk-YTYGMU6L.js.map +1 -0
- package/dist/chunk-ZC7IMWRE.js +38 -0
- package/dist/chunk-ZC7IMWRE.js.map +1 -0
- package/dist/chunk-ZUUS4QZE.js +59 -0
- package/dist/chunk-ZUUS4QZE.js.map +1 -0
- package/dist/chunk-ZYNW3VYG.js +53 -0
- package/dist/chunk-ZYNW3VYG.js.map +1 -0
- package/dist/index.cjs +244 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +67 -38
- package/dist/index.css.map +1 -1
- package/dist/index.js +72 -72
- package/dist/molecules/date-picker/index.js +2 -2
- package/dist/molecules/expand-table/index.js +24 -25
- package/dist/molecules/expand-table/row.js +21 -22
- package/dist/molecules/index.cjs +26 -24
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +28 -29
- package/dist/molecules/navigation.js +22 -23
- package/dist/molecules/stepper.js +3 -3
- package/dist/molecules/tag-selector.cjs +2 -0
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +22 -23
- package/package.json +1 -1
- package/src/atoms/badge.tsx +3 -1
- package/src/atoms/dialog.tsx +0 -2
- package/src/atoms/drawer.tsx +8 -14
- package/src/atoms/toast.tsx +12 -19
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-P3YCIJUP.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadProps,
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "./chunk-N552FDTV.js";
|
|
8
|
+
|
|
9
|
+
// src/atoms/toast.tsx
|
|
10
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
11
|
+
import { ToastContainer as ToastifyToastContainer } from "react-toastify";
|
|
12
|
+
import { toast as Toastify } from "react-toastify";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var toast = __spreadProps(__spreadValues({}, Toastify), {
|
|
15
|
+
info: (message, options) => {
|
|
16
|
+
return Toastify.info(message, __spreadValues({}, options));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
function CloseButton({ closeToast }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Button, { color: "gray", onClick: closeToast, variant: "transparent", children: /* @__PURE__ */ jsx(Cross1Icon, {}) });
|
|
21
|
+
}
|
|
22
|
+
function ToastContainer(props) {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
ToastifyToastContainer,
|
|
25
|
+
__spreadValues({
|
|
26
|
+
autoClose: 5e4,
|
|
27
|
+
closeButton: CloseButton,
|
|
28
|
+
closeOnClick: true,
|
|
29
|
+
draggable: true,
|
|
30
|
+
hideProgressBar: true,
|
|
31
|
+
newestOnTop: true,
|
|
32
|
+
pauseOnFocusLoss: true,
|
|
33
|
+
pauseOnHover: true,
|
|
34
|
+
position: "top-center",
|
|
35
|
+
icon: false,
|
|
36
|
+
rtl: false
|
|
37
|
+
}, props)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
toast,
|
|
43
|
+
ToastContainer
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=chunk-QNYKTW7L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/toast.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport type { Theme, ToastContainerProps, TypeOptions } from 'react-toastify';\nimport { ToastContainer as ToastifyToastContainer } from 'react-toastify';\nimport { Button } from './button';\nimport { toast as Toastify } from 'react-toastify';\n\nexport const toast: typeof Toastify = {\n ...Toastify,\n info: (message, options) => {\n return Toastify.info(message, { ...options });\n },\n};\n\ninterface CloseButtonProps {\n closeToast: (e: React.MouseEvent<HTMLElement>) => void;\n type: TypeOptions;\n ariaLabel?: string;\n theme: Theme;\n}\nfunction CloseButton({ closeToast }: CloseButtonProps): React.ReactNode {\n return (\n <Button color=\"gray\" onClick={closeToast} variant=\"transparent\">\n <Cross1Icon />\n </Button>\n );\n}\n\nexport function ToastContainer(props: ToastContainerProps): React.ReactElement {\n return (\n <ToastifyToastContainer\n autoClose={50000}\n closeButton={CloseButton}\n closeOnClick\n draggable\n hideProgressBar\n newestOnTop\n pauseOnFocusLoss\n pauseOnHover\n position=\"top-center\"\n icon={false}\n rtl={false}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB,8BAA8B;AAEzD,SAAS,SAAS,gBAAgB;AAkB5B;AAhBC,IAAM,QAAyB,iCACjC,WADiC;AAAA,EAEpC,MAAM,CAAC,SAAS,YAAY;AAC1B,WAAO,SAAS,KAAK,SAAS,mBAAK,QAAS;AAAA,EAC9C;AACF;AAQA,SAAS,YAAY,EAAE,WAAW,GAAsC;AACtE,SACE,oBAAC,UAAO,OAAM,QAAO,SAAS,YAAY,SAAQ,eAChD,8BAAC,cAAW,GACd;AAEJ;AAEO,SAAS,eAAe,OAAgD;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,cAAY;AAAA,MACZ,WAAS;AAAA,MACT,iBAAe;AAAA,MACf,aAAW;AAAA,MACX,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,UAAS;AAAA,MACT,MAAM;AAAA,MACN,KAAK;AAAA,OACD;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
import {
|
|
5
|
+
IconButton
|
|
6
|
+
} from "./chunk-O3DNDMV3.js";
|
|
7
|
+
import {
|
|
8
|
+
Typo
|
|
9
|
+
} from "./chunk-52MVZ6AN.js";
|
|
10
|
+
import {
|
|
11
|
+
ChevronLeftIcon,
|
|
12
|
+
ChevronRightIcon,
|
|
13
|
+
DoubleArrowLeftIcon,
|
|
14
|
+
DoubleArrowRightIcon
|
|
15
|
+
} from "./chunk-66C4U3BG.js";
|
|
16
|
+
import {
|
|
17
|
+
__spreadProps,
|
|
18
|
+
__spreadValues
|
|
19
|
+
} from "./chunk-N552FDTV.js";
|
|
20
|
+
|
|
21
|
+
// src/atoms/pagination.tsx
|
|
22
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
23
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
+
function Pagination(props) {
|
|
25
|
+
const { onChange, count = 0, siblingCount = 2 } = props;
|
|
26
|
+
const [page, setPage] = useState(() => props.page || props.defaultPage || 1);
|
|
27
|
+
const visibleItems = useMemo(() => {
|
|
28
|
+
let start = Math.max(1, page - siblingCount);
|
|
29
|
+
let end = Math.min(count, page + siblingCount);
|
|
30
|
+
if (page - siblingCount <= 0 && end < count) {
|
|
31
|
+
end = Math.min(count, end + Math.abs(page - siblingCount) + 1);
|
|
32
|
+
} else if (page + siblingCount > count && start > 1) {
|
|
33
|
+
start = Math.max(1, start - (page + siblingCount - count));
|
|
34
|
+
}
|
|
35
|
+
return Array.from({ length: end - start + 1 }, (_, i) => i + start);
|
|
36
|
+
}, [count, page, siblingCount]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
onChange == null ? void 0 : onChange(page);
|
|
39
|
+
}, [onChange, page]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (props.page) {
|
|
42
|
+
setPage(props.page);
|
|
43
|
+
}
|
|
44
|
+
}, [props.page]);
|
|
45
|
+
const prev = useMemo(() => {
|
|
46
|
+
const p = page - 1;
|
|
47
|
+
return p < 1 ? void 0 : p;
|
|
48
|
+
}, [page]);
|
|
49
|
+
const next = useMemo(() => {
|
|
50
|
+
const n = page + 1;
|
|
51
|
+
return n > count ? void 0 : n;
|
|
52
|
+
}, [count, page]);
|
|
53
|
+
const onClickPrev = useCallback(() => {
|
|
54
|
+
prev && setPage(prev);
|
|
55
|
+
}, [prev]);
|
|
56
|
+
const onClickNext = useCallback(() => {
|
|
57
|
+
next && setPage(next);
|
|
58
|
+
}, [next]);
|
|
59
|
+
const doublePrev = useMemo(() => {
|
|
60
|
+
if (!visibleItems.length)
|
|
61
|
+
return;
|
|
62
|
+
return Math.max(0, visibleItems[0] - 1);
|
|
63
|
+
}, [visibleItems]);
|
|
64
|
+
const onClickDoublePrev = useCallback(() => {
|
|
65
|
+
doublePrev && setPage(doublePrev);
|
|
66
|
+
}, [doublePrev]);
|
|
67
|
+
const doubleNext = useMemo(() => {
|
|
68
|
+
if (!visibleItems.length)
|
|
69
|
+
return;
|
|
70
|
+
const n = visibleItems[visibleItems.length - 1] + 1;
|
|
71
|
+
if (n > count)
|
|
72
|
+
return;
|
|
73
|
+
return Math.min(count, n);
|
|
74
|
+
}, [count, visibleItems]);
|
|
75
|
+
const onClickDoubleNext = useCallback(() => {
|
|
76
|
+
doubleNext && setPage(doubleNext);
|
|
77
|
+
}, [doubleNext]);
|
|
78
|
+
const iconSize = {
|
|
79
|
+
height: 24,
|
|
80
|
+
width: 24
|
|
81
|
+
};
|
|
82
|
+
const moveButtonProps = {
|
|
83
|
+
variant: "ghost",
|
|
84
|
+
size: "3",
|
|
85
|
+
style: { borderRadius: "50%" }
|
|
86
|
+
};
|
|
87
|
+
if (!page)
|
|
88
|
+
return null;
|
|
89
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", className: "tipp-pagination", gap: "4", children: [
|
|
90
|
+
/* @__PURE__ */ jsx(
|
|
91
|
+
IconButton,
|
|
92
|
+
__spreadProps(__spreadValues({
|
|
93
|
+
disabled: !doublePrev,
|
|
94
|
+
onClick: onClickDoublePrev
|
|
95
|
+
}, moveButtonProps), {
|
|
96
|
+
children: /* @__PURE__ */ jsx(DoubleArrowLeftIcon, __spreadValues({}, iconSize))
|
|
97
|
+
})
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(IconButton, __spreadProps(__spreadValues({ disabled: !prev, onClick: onClickPrev }, moveButtonProps), { children: /* @__PURE__ */ jsx(ChevronLeftIcon, __spreadValues({}, iconSize)) })),
|
|
100
|
+
/* @__PURE__ */ jsx(Flex, { gap: "1", children: visibleItems.map((item) => {
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
className: `page-button ${item === page ? "active" : ""}`,
|
|
105
|
+
onClick: () => {
|
|
106
|
+
setPage(item);
|
|
107
|
+
},
|
|
108
|
+
type: "button",
|
|
109
|
+
children: /* @__PURE__ */ jsx(Typo, { variant: "body", children: item })
|
|
110
|
+
},
|
|
111
|
+
item
|
|
112
|
+
);
|
|
113
|
+
}) }),
|
|
114
|
+
/* @__PURE__ */ jsx(IconButton, __spreadProps(__spreadValues({ disabled: !next, onClick: onClickNext }, moveButtonProps), { children: /* @__PURE__ */ jsx(ChevronRightIcon, __spreadValues({}, iconSize)) })),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
IconButton,
|
|
117
|
+
__spreadProps(__spreadValues({
|
|
118
|
+
disabled: !doubleNext,
|
|
119
|
+
onClick: onClickDoubleNext
|
|
120
|
+
}, moveButtonProps), {
|
|
121
|
+
children: /* @__PURE__ */ jsx(DoubleArrowRightIcon, __spreadValues({}, iconSize))
|
|
122
|
+
})
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
Pagination
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=chunk-QVQCTPDU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/pagination.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n} from '../icon';\nimport type { IconButtonProps } from './icon-button';\nimport { IconButton } from './icon-button';\nimport { Flex } from './flex';\nimport { Typo } from './typo';\n\nexport interface PaginationProps {\n /** 현재 선택된 페이지 */\n page?: number;\n /** 기본 선택 페이지, page보다 낮은 우선 순위를 갖는다 */\n defaultPage?: number;\n /** 선택한 페이지 변경 이벤트 cb */\n onChange?: (page: number) => void;\n /** 전체 페이지의 수 */\n count?: number;\n siblingCount?: number;\n}\n\nexport function Pagination(props: PaginationProps): React.ReactNode {\n const { onChange, count = 0, siblingCount = 2 } = props;\n\n const [page, setPage] = useState(() => props.page || props.defaultPage || 1);\n\n const visibleItems = useMemo(() => {\n let start = Math.max(1, page - siblingCount);\n let end = Math.min(count, page + siblingCount);\n if (page - siblingCount <= 0 && end < count) {\n end = Math.min(count, end + Math.abs(page - siblingCount) + 1);\n } else if (page + siblingCount > count && start > 1) {\n start = Math.max(1, start - (page + siblingCount - count));\n }\n\n return Array.from({ length: end - start + 1 }, (_, i) => i + start);\n }, [count, page, siblingCount]);\n\n useEffect(() => {\n onChange?.(page);\n }, [onChange, page]);\n\n useEffect(() => {\n if (props.page) {\n setPage(props.page);\n }\n }, [props.page]);\n\n const prev = useMemo<number | undefined>(() => {\n const p = page - 1;\n return p < 1 ? undefined : p;\n }, [page]);\n\n const next = useMemo<number | undefined>(() => {\n const n = page + 1;\n return n > count ? undefined : n;\n }, [count, page]);\n\n const onClickPrev = useCallback(() => {\n prev && setPage(prev);\n }, [prev]);\n\n const onClickNext = useCallback(() => {\n next && setPage(next);\n }, [next]);\n\n const doublePrev = useMemo<number | undefined>(() => {\n if (!visibleItems.length) return;\n return Math.max(0, visibleItems[0] - 1);\n }, [visibleItems]);\n\n const onClickDoublePrev = useCallback(() => {\n doublePrev && setPage(doublePrev);\n }, [doublePrev]);\n\n const doubleNext = useMemo<number | undefined>(() => {\n if (!visibleItems.length) return;\n const n = visibleItems[visibleItems.length - 1] + 1;\n if (n > count) return;\n return Math.min(count, n);\n }, [count, visibleItems]);\n\n const onClickDoubleNext = useCallback(() => {\n doubleNext && setPage(doubleNext);\n }, [doubleNext]);\n\n const iconSize = {\n height: 24,\n width: 24,\n };\n\n const moveButtonProps: IconButtonProps = {\n variant: 'ghost',\n size: '3',\n style: { borderRadius: '50%' },\n };\n\n if (!page) return null;\n\n return (\n <Flex align=\"center\" className=\"tipp-pagination\" gap=\"4\">\n <IconButton\n disabled={!doublePrev}\n onClick={onClickDoublePrev}\n {...moveButtonProps}\n >\n <DoubleArrowLeftIcon {...iconSize} />\n </IconButton>\n <IconButton disabled={!prev} onClick={onClickPrev} {...moveButtonProps}>\n <ChevronLeftIcon {...iconSize} />\n </IconButton>\n <Flex gap=\"1\">\n {visibleItems.map((item) => {\n return (\n <button\n className={`page-button ${item === page ? 'active' : ''}`}\n key={item}\n onClick={() => {\n setPage(item);\n }}\n type=\"button\"\n >\n <Typo variant=\"body\">{item}</Typo>\n </button>\n );\n })}\n </Flex>\n <IconButton disabled={!next} onClick={onClickNext} {...moveButtonProps}>\n <ChevronRightIcon {...iconSize} />\n </IconButton>\n <IconButton\n disabled={!doubleNext}\n onClick={onClickDoubleNext}\n {...moveButtonProps}\n >\n <DoubleArrowRightIcon {...iconSize} />\n </IconButton>\n </Flex>\n );\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconButton
|
|
3
|
+
} from "./chunk-O3DNDMV3.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "./chunk-N552FDTV.js";
|
|
7
|
+
|
|
8
|
+
// src/atoms/toast.tsx
|
|
9
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
10
|
+
import { ToastContainer as ToastifyToastContainer } from "react-toastify";
|
|
11
|
+
import { toast } from "react-toastify";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
function CloseButton({ closeToast }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(IconButton, { color: "gray", onClick: closeToast, variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) });
|
|
15
|
+
}
|
|
16
|
+
function ToastContainer(props) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
ToastifyToastContainer,
|
|
19
|
+
__spreadValues({
|
|
20
|
+
autoClose: 5e4,
|
|
21
|
+
closeButton: CloseButton,
|
|
22
|
+
closeOnClick: true,
|
|
23
|
+
draggable: true,
|
|
24
|
+
hideProgressBar: true,
|
|
25
|
+
newestOnTop: true,
|
|
26
|
+
pauseOnFocusLoss: true,
|
|
27
|
+
pauseOnHover: true,
|
|
28
|
+
position: "top-center",
|
|
29
|
+
rtl: false
|
|
30
|
+
}, props)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
ToastContainer,
|
|
36
|
+
toast
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=chunk-RXCENPRG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/toast.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport type { Theme, ToastContainerProps, TypeOptions } from 'react-toastify';\nimport { ToastContainer as ToastifyToastContainer } from 'react-toastify';\nimport { IconButton } from './icon-button';\n\nexport { toast } from 'react-toastify';\n\ninterface CloseButtonProps {\n closeToast: (e: React.MouseEvent<HTMLElement>) => void;\n type: TypeOptions;\n ariaLabel?: string;\n theme: Theme;\n}\nfunction CloseButton({ closeToast }: CloseButtonProps): React.ReactNode {\n return (\n <IconButton color=\"gray\" onClick={closeToast} variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n );\n}\n\nexport function ToastContainer(props: ToastContainerProps): React.ReactElement {\n return (\n <ToastifyToastContainer\n autoClose={50000}\n closeButton={CloseButton}\n closeOnClick\n draggable\n hideProgressBar\n newestOnTop\n pauseOnFocusLoss\n pauseOnHover\n position=\"top-center\"\n rtl={false}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB,8BAA8B;AAGzD,SAAS,aAAa;AAWhB;AAHN,SAAS,YAAY,EAAE,WAAW,GAAsC;AACtE,SACE,oBAAC,cAAW,OAAM,QAAO,SAAS,YAAY,SAAQ,SACpD,8BAAC,cAAW,GACd;AAEJ;AAEO,SAAS,eAAe,OAAgD;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,cAAY;AAAA,MACZ,WAAS;AAAA,MACT,iBAAe;AAAA,MACf,aAAW;AAAA,MACX,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,UAAS;AAAA,MACT,KAAK;AAAA,OACD;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toast
|
|
3
|
+
} from "./chunk-PLXOVGG4.js";
|
|
4
|
+
import {
|
|
5
|
+
Button
|
|
6
|
+
} from "./chunk-P3YCIJUP.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/dialog.tsx
|
|
14
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
15
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
16
|
+
import { Flex } from "@radix-ui/themes";
|
|
17
|
+
import { useEffect, useRef } from "react";
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function Content2(props) {
|
|
20
|
+
const _a = props, {
|
|
21
|
+
children,
|
|
22
|
+
style = {},
|
|
23
|
+
width,
|
|
24
|
+
maxWidth,
|
|
25
|
+
minWidth,
|
|
26
|
+
maxHeight,
|
|
27
|
+
height,
|
|
28
|
+
minHeight
|
|
29
|
+
} = _a, rest = __objRest(_a, [
|
|
30
|
+
"children",
|
|
31
|
+
"style",
|
|
32
|
+
"width",
|
|
33
|
+
"maxWidth",
|
|
34
|
+
"minWidth",
|
|
35
|
+
"maxHeight",
|
|
36
|
+
"height",
|
|
37
|
+
"minHeight"
|
|
38
|
+
]);
|
|
39
|
+
const containerRef = useRef(null);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
containerRef.current = document.getElementsByClassName("radix-themes")[0];
|
|
42
|
+
}, []);
|
|
43
|
+
toast.error("ajwld??");
|
|
44
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx(RadixDialog.Overlay, { className: "DialogOverlay", children: /* @__PURE__ */ jsx(
|
|
45
|
+
RadixDialog.Content,
|
|
46
|
+
__spreadProps(__spreadValues({
|
|
47
|
+
className: "DialogContent",
|
|
48
|
+
style: __spreadValues({
|
|
49
|
+
width,
|
|
50
|
+
maxWidth,
|
|
51
|
+
minWidth,
|
|
52
|
+
maxHeight,
|
|
53
|
+
height,
|
|
54
|
+
minHeight
|
|
55
|
+
}, style)
|
|
56
|
+
}, rest), {
|
|
57
|
+
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", style: { position: "relative" }, children: [
|
|
58
|
+
/* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, className: "DialogClose", children: /* @__PURE__ */ jsx(Button, { color: "gray", variant: "transparent", children: /* @__PURE__ */ jsx(Cross1Icon, { height: "18px", width: "18px" }) }) }),
|
|
59
|
+
children
|
|
60
|
+
] })
|
|
61
|
+
})
|
|
62
|
+
) }) });
|
|
63
|
+
}
|
|
64
|
+
function Close2(_a) {
|
|
65
|
+
var _b = _a, {
|
|
66
|
+
children
|
|
67
|
+
} = _b, rest = __objRest(_b, [
|
|
68
|
+
"children"
|
|
69
|
+
]);
|
|
70
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
71
|
+
}
|
|
72
|
+
function Trigger2(_a) {
|
|
73
|
+
var _b = _a, {
|
|
74
|
+
children
|
|
75
|
+
} = _b, rest = __objRest(_b, [
|
|
76
|
+
"children"
|
|
77
|
+
]);
|
|
78
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, __spreadProps(__spreadValues({ asChild: true }, rest), { children }));
|
|
79
|
+
}
|
|
80
|
+
var Dialog = {
|
|
81
|
+
Root: RadixDialog.Root,
|
|
82
|
+
Trigger: Trigger2,
|
|
83
|
+
Content: Content2,
|
|
84
|
+
Close: Close2,
|
|
85
|
+
Description: RadixDialog.Description,
|
|
86
|
+
Title: RadixDialog.Title
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
Dialog
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=chunk-SSI6JRBA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/dialog.tsx"],"sourcesContent":["import * as RadixDialog from '@radix-ui/react-dialog';\nimport { Cross1Icon } from '@radix-ui/react-icons';\nimport { Flex } from '@radix-ui/themes';\nimport { useEffect, useRef } from 'react';\nimport { Button } from './button';\nimport { toast, ToastContainer } from './toast';\n\ntype ContentProps = RadixDialog.DialogContentProps & {\n width?: string;\n maxWidth?: string;\n minWidth?: string;\n height?: string;\n maxHeight?: string;\n minHeight?: string;\n};\n\nfunction Content(props: ContentProps): React.ReactElement {\n const {\n children,\n style = {},\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...rest\n } = props;\n const containerRef = useRef<Element | null>(null);\n\n useEffect(() => {\n containerRef.current = document.getElementsByClassName('radix-themes')[0];\n }, []);\n\n toast.error('ajwld??');\n\n return (\n <RadixDialog.Portal container={containerRef.current}>\n <RadixDialog.Overlay className=\"DialogOverlay\">\n <RadixDialog.Content\n className=\"DialogContent\"\n style={{\n width,\n maxWidth,\n minWidth,\n maxHeight,\n height,\n minHeight,\n ...style,\n }}\n {...rest}\n >\n <Flex direction=\"column\" style={{ position: 'relative' }}>\n <RadixDialog.Close asChild className=\"DialogClose\">\n <Button color=\"gray\" variant=\"transparent\">\n <Cross1Icon height=\"18px\" width=\"18px\" />\n </Button>\n </RadixDialog.Close>\n {children}\n </Flex>\n </RadixDialog.Content>\n </RadixDialog.Overlay>\n </RadixDialog.Portal>\n );\n}\n\nfunction Close({\n children,\n ...rest\n}: RadixDialog.DialogCloseProps): React.ReactElement {\n return (\n <RadixDialog.Close asChild {...rest}>\n {children}\n </RadixDialog.Close>\n );\n}\n\nfunction Trigger({\n children,\n ...rest\n}: RadixDialog.DialogTriggerProps): React.ReactElement {\n return (\n <RadixDialog.Trigger asChild {...rest}>\n {children}\n </RadixDialog.Trigger>\n );\n}\n\nexport const Dialog = {\n Root: RadixDialog.Root,\n Trigger,\n Content,\n Close,\n Description: RadixDialog.Description,\n Title: RadixDialog.Title,\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,YAAY,iBAAiB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,WAAW,cAAc;AAiDxB,SAGM,KAHN;AApCV,SAASA,SAAQ,OAAyC;AACxD,QAUI,YATF;AAAA;AAAA,IACA,QAAQ,CAAC;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAzBJ,IA2BM,IADC,iBACD,IADC;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,QAAM,eAAe,OAAuB,IAAI;AAEhD,YAAU,MAAM;AACd,iBAAa,UAAU,SAAS,uBAAuB,cAAc,EAAE,CAAC;AAAA,EAC1E,GAAG,CAAC,CAAC;AAEL,QAAM,MAAM,SAAS;AAErB,SACE,oBAAa,oBAAZ,EAAmB,WAAW,aAAa,SAC1C,8BAAa,qBAAZ,EAAoB,WAAU,iBAC7B;AAAA,IAAa;AAAA,IAAZ;AAAA,MACC,WAAU;AAAA,MACV,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,SACG;AAAA,OAED,OAXL;AAAA,MAaC,+BAAC,QAAK,WAAU,UAAS,OAAO,EAAE,UAAU,WAAW,GACrD;AAAA,4BAAa,mBAAZ,EAAkB,SAAO,MAAC,WAAU,eACnC,8BAAC,UAAO,OAAM,QAAO,SAAQ,eAC3B,8BAAC,cAAW,QAAO,QAAO,OAAM,QAAO,GACzC,GACF;AAAA,QACC;AAAA,SACH;AAAA;AAAA,EACF,GACF,GACF;AAEJ;AAEA,SAASC,OAAM,IAGsC;AAHtC,eACb;AAAA;AAAA,EAnEF,IAkEe,IAEV,iBAFU,IAEV;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,mBAAZ,+BAAkB,SAAO,QAAK,OAA9B,EACE,WACH;AAEJ;AAEA,SAASC,SAAQ,IAGsC;AAHtC,eACf;AAAA;AAAA,EA9EF,IA6EiB,IAEZ,iBAFY,IAEZ;AAAA,IADH;AAAA;AAGA,SACE,oBAAa,qBAAZ,+BAAoB,SAAO,QAAK,OAAhC,EACE,WACH;AAEJ;AAEO,IAAM,SAAS;AAAA,EACpB,MAAkB;AAAA,EAClB,SAAAA;AAAA,EACA,SAAAF;AAAA,EACA,OAAAC;AAAA,EACA,aAAyB;AAAA,EACzB,OAAmB;AACrB;","names":["Content","Close","Trigger"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ThemeProvider
|
|
3
|
+
} from "./chunk-BVBX6IJ3.js";
|
|
4
|
+
import {
|
|
5
|
+
ToastContainer
|
|
6
|
+
} from "./chunk-EYP37NAX.js";
|
|
7
|
+
import {
|
|
8
|
+
__objRest,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues
|
|
11
|
+
} from "./chunk-N552FDTV.js";
|
|
12
|
+
|
|
13
|
+
// src/atoms/drawer.tsx
|
|
14
|
+
import { useEffect, useRef } from "react";
|
|
15
|
+
import * as Dialog from "@radix-ui/react-dialog";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function Root2(props) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
|
|
19
|
+
}
|
|
20
|
+
function Content2(props) {
|
|
21
|
+
const _a = props, { position = "right", className, children } = _a, rest = __objRest(_a, ["position", "className", "children"]);
|
|
22
|
+
const containerRef = useRef(null);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
containerRef.current = document.getElementsByClassName("radix-themes")[0];
|
|
25
|
+
}, []);
|
|
26
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
27
|
+
/* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
|
|
28
|
+
/* @__PURE__ */ jsxs(
|
|
29
|
+
Dialog.Content,
|
|
30
|
+
__spreadProps(__spreadValues({
|
|
31
|
+
className: `DrawerContent ${position} ${className || ""}`
|
|
32
|
+
}, rest), {
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(ToastContainer, {}),
|
|
35
|
+
children
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
)
|
|
39
|
+
] }) });
|
|
40
|
+
}
|
|
41
|
+
function Trigger2(props) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
|
|
43
|
+
}
|
|
44
|
+
var Drawer = {
|
|
45
|
+
Root: Dialog.Root,
|
|
46
|
+
Trigger: Trigger2,
|
|
47
|
+
Content: Content2,
|
|
48
|
+
Close: Dialog.Close,
|
|
49
|
+
Title: Dialog.Title,
|
|
50
|
+
Description: Dialog.Description
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
Root2 as Root,
|
|
55
|
+
Content2 as Content,
|
|
56
|
+
Trigger2 as Trigger,
|
|
57
|
+
Drawer
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=chunk-T2DBM2OA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport * as Dialog from '@radix-ui/react-dialog';\nimport { ThemeProvider } from '../theme/theme-provider';\nimport { ToastContainer } from './toast';\n\nexport function Root(props: Dialog.DialogProps): React.ReactNode {\n return <Dialog.Root {...props} />;\n}\n\ntype ContentProps = Dialog.DialogContentProps & {\n /** Drawer가 붙는 위치, 기본값 right */\n position?: 'left' | 'right' | 'bottom' | 'top';\n};\n\nexport function Content(props: ContentProps): React.ReactNode {\n const { position = 'right', className, children, ...rest } = props;\n\n const containerRef = useRef<Element | null>(null);\n\n useEffect(() => {\n containerRef.current = document.getElementsByClassName('radix-themes')[0];\n }, []);\n\n return (\n <Dialog.Portal container={containerRef.current}>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n >\n <ToastContainer />\n {children}\n </Dialog.Content>\n </ThemeProvider>\n </Dialog.Portal>\n );\n}\n\nexport function Trigger(props: Dialog.DialogTriggerProps): React.ReactNode {\n return <Dialog.Trigger asChild {...props} />;\n}\n\nexport const Drawer = {\n Root: Dialog.Root,\n Trigger,\n Content,\n Close: Dialog.Close,\n Title: Dialog.Title,\n Description: Dialog.Description,\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,WAAW,cAAc;AACzC,YAAY,YAAY;AAKf,cAqBD,YArBC;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAA6D,YAArD,aAAW,SAAS,WAAW,SAfzC,IAe+D,IAAT,iBAAS,IAAT,CAA5C,YAAoB,aAAW;AAEvC,QAAM,eAAe,OAAuB,IAAI;AAEhD,YAAU,MAAM;AACd,iBAAa,UAAU,SAAS,uBAAuB,cAAc,EAAE,CAAC;AAAA,EAC1E,GAAG,CAAC,CAAC;AAEL,SACE,oBAAQ,eAAP,EAAc,WAAW,aAAa,SACrC,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD,OAFL;AAAA,QAIC;AAAA,8BAAC,kBAAe;AAAA,UACf;AAAA;AAAA;AAAA,IACH;AAAA,KACF,GACF;AAEJ;AAEO,SAASC,SAAQ,OAAmD;AACzE,SAAO,oBAAQ,gBAAP,iBAAe,SAAO,QAAK,MAAO;AAC5C;AAEO,IAAM,SAAS;AAAA,EACpB,MAAa;AAAA,EACb,SAAAA;AAAA,EACA,SAAAD;AAAA,EACA,OAAc;AAAA,EACd,OAAc;AAAA,EACd,aAAoB;AACtB;","names":["Root","Content","Trigger"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconButton
|
|
3
|
+
} from "./chunk-O3DNDMV3.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "./chunk-N552FDTV.js";
|
|
7
|
+
|
|
8
|
+
// src/atoms/toast.tsx
|
|
9
|
+
import { Cross1Icon } from "@radix-ui/react-icons";
|
|
10
|
+
import { ToastContainer as ToastifyToastContainer } from "react-toastify";
|
|
11
|
+
import { toast } from "react-toastify";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
function CloseButton({ closeToast }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(IconButton, { color: "gray", onClick: closeToast, variant: "ghost", children: /* @__PURE__ */ jsx(Cross1Icon, {}) });
|
|
15
|
+
}
|
|
16
|
+
function ToastContainer(props) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
ToastifyToastContainer,
|
|
19
|
+
__spreadValues({
|
|
20
|
+
autoClose: 5e4,
|
|
21
|
+
closeButton: CloseButton,
|
|
22
|
+
closeOnClick: true,
|
|
23
|
+
draggable: true,
|
|
24
|
+
hideProgressBar: true,
|
|
25
|
+
newestOnTop: true,
|
|
26
|
+
pauseOnFocusLoss: true,
|
|
27
|
+
pauseOnHover: true,
|
|
28
|
+
position: "bottom-right",
|
|
29
|
+
rtl: false,
|
|
30
|
+
style: { zIndex: 999999 }
|
|
31
|
+
}, props)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
ToastContainer,
|
|
37
|
+
toast
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-TAU5LFOR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/toast.tsx"],"sourcesContent":["import { Cross1Icon } from '@radix-ui/react-icons';\nimport type { Theme, ToastContainerProps, TypeOptions } from 'react-toastify';\nimport { ToastContainer as ToastifyToastContainer } from 'react-toastify';\nimport { IconButton } from './icon-button';\n\nexport { toast } from 'react-toastify';\n\ninterface CloseButtonProps {\n closeToast: (e: React.MouseEvent<HTMLElement>) => void;\n type: TypeOptions;\n ariaLabel?: string;\n theme: Theme;\n}\nfunction CloseButton({ closeToast }: CloseButtonProps): React.ReactNode {\n return (\n <IconButton color=\"gray\" onClick={closeToast} variant=\"ghost\">\n <Cross1Icon />\n </IconButton>\n );\n}\n\nexport function ToastContainer(props: ToastContainerProps): React.ReactElement {\n return (\n <ToastifyToastContainer\n autoClose={50000}\n closeButton={CloseButton}\n closeOnClick\n draggable\n hideProgressBar\n newestOnTop\n pauseOnFocusLoss\n pauseOnHover\n position=\"bottom-right\"\n rtl={false}\n style={{ zIndex: 999999 }}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB,8BAA8B;AAGzD,SAAS,aAAa;AAWhB;AAHN,SAAS,YAAY,EAAE,WAAW,GAAsC;AACtE,SACE,oBAAC,cAAW,OAAM,QAAO,SAAS,YAAY,SAAQ,SACpD,8BAAC,cAAW,GACd;AAEJ;AAEO,SAAS,eAAe,OAAgD;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,cAAY;AAAA,MACZ,WAAS;AAAA,MACT,iBAAe;AAAA,MACf,aAAW;AAAA,MACX,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,UAAS;AAAA,MACT,KAAK;AAAA,MACL,OAAO,EAAE,QAAQ,OAAO;AAAA,OACpB;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-N552FDTV.js";
|
|
4
|
+
|
|
5
|
+
// src/atoms/toast.tsx
|
|
6
|
+
import { InfoCircledIcon } from "@radix-ui/react-icons";
|
|
7
|
+
import {
|
|
8
|
+
ToastContainer as ToastifyContainer
|
|
9
|
+
} from "react-toastify";
|
|
10
|
+
import { toast } from "react-toastify";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
function CloseButton() {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
function ToastContainer(props) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
ToastifyContainer,
|
|
18
|
+
__spreadValues({
|
|
19
|
+
autoClose: 5e4,
|
|
20
|
+
closeButton: CloseButton,
|
|
21
|
+
closeOnClick: true,
|
|
22
|
+
draggable: true,
|
|
23
|
+
hideProgressBar: true,
|
|
24
|
+
icon: /* @__PURE__ */ jsx(InfoCircledIcon, {}),
|
|
25
|
+
newestOnTop: true,
|
|
26
|
+
pauseOnFocusLoss: true,
|
|
27
|
+
pauseOnHover: true,
|
|
28
|
+
position: "top-center",
|
|
29
|
+
rtl: false,
|
|
30
|
+
style: { zIndex: 999999 }
|
|
31
|
+
}, props)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
ToastContainer,
|
|
37
|
+
toast
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=chunk-UFW4DFY5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/toast.tsx"],"sourcesContent":["import { InfoCircledIcon } from '@radix-ui/react-icons';\nimport {\n ToastContainer as ToastifyContainer,\n type ToastContainerProps,\n} from 'react-toastify';\n\nexport { toast } from 'react-toastify';\n\nfunction CloseButton(): React.ReactNode {\n return null;\n}\n\nexport function ToastContainer(props: ToastContainerProps): React.ReactElement {\n return (\n <ToastifyContainer\n autoClose={50000}\n closeButton={CloseButton}\n closeOnClick\n draggable\n hideProgressBar\n icon={<InfoCircledIcon />}\n newestOnTop\n pauseOnFocusLoss\n pauseOnHover\n position=\"top-center\"\n rtl={false}\n style={{ zIndex: 999999 }}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAChC;AAAA,EACE,kBAAkB;AAAA,OAEb;AAEP,SAAS,aAAa;AAcV;AAZZ,SAAS,cAA+B;AACtC,SAAO;AACT;AAEO,SAAS,eAAe,OAAgD;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,cAAY;AAAA,MACZ,WAAS;AAAA,MACT,iBAAe;AAAA,MACf,MAAM,oBAAC,mBAAgB;AAAA,MACvB,aAAW;AAAA,MACX,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,UAAS;AAAA,MACT,KAAK;AAAA,MACL,OAAO,EAAE,QAAQ,OAAO;AAAA,OACpB;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "./chunk-N552FDTV.js";
|
|
4
|
+
|
|
5
|
+
// src/atoms/toast.tsx
|
|
6
|
+
import { InfoCircledIcon } from "@radix-ui/react-icons";
|
|
7
|
+
import {
|
|
8
|
+
ToastContainer as ToastifyContainer
|
|
9
|
+
} from "react-toastify";
|
|
10
|
+
import { toast } from "react-toastify";
|
|
11
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
12
|
+
function ToastContainer(props) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
ToastifyContainer,
|
|
15
|
+
__spreadValues({
|
|
16
|
+
autoClose: 5e4,
|
|
17
|
+
closeButton: () => /* @__PURE__ */ jsx(Fragment, {}),
|
|
18
|
+
closeOnClick: true,
|
|
19
|
+
draggable: true,
|
|
20
|
+
hideProgressBar: true,
|
|
21
|
+
icon: /* @__PURE__ */ jsx(InfoCircledIcon, {}),
|
|
22
|
+
newestOnTop: true,
|
|
23
|
+
pauseOnFocusLoss: true,
|
|
24
|
+
pauseOnHover: true,
|
|
25
|
+
position: "top-center",
|
|
26
|
+
rtl: false,
|
|
27
|
+
style: { zIndex: 999999 }
|
|
28
|
+
}, props)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
ToastContainer,
|
|
34
|
+
toast
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-US7J5XUZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/atoms/toast.tsx"],"sourcesContent":["import { Cross1Icon, InfoCircledIcon } from '@radix-ui/react-icons';\nimport {\n ToastContainer as ToastifyContainer,\n type Theme,\n type ToastContainerProps,\n type TypeOptions,\n} from 'react-toastify';\nimport { IconButton } from './icon-button';\n\nexport { toast } from 'react-toastify';\n\ninterface CloseButtonProps {\n closeToast: (e: React.MouseEvent<HTMLElement>) => void;\n type: TypeOptions;\n ariaLabel?: string;\n theme: Theme;\n}\n\nexport function ToastContainer(props: ToastContainerProps): React.ReactElement {\n return (\n <ToastifyContainer\n autoClose={50000}\n closeButton={() => <></>}\n closeOnClick\n draggable\n hideProgressBar\n icon={<InfoCircledIcon />}\n newestOnTop\n pauseOnFocusLoss\n pauseOnHover\n position=\"top-center\"\n rtl={false}\n style={{ zIndex: 999999 }}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAAA,SAAqB,uBAAuB;AAC5C;AAAA,EACE,kBAAkB;AAAA,OAIb;AAGP,SAAS,aAAa;AAaG;AAJlB,SAAS,eAAe,OAAgD;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa,MAAM,gCAAE;AAAA,MACrB,cAAY;AAAA,MACZ,WAAS;AAAA,MACT,iBAAe;AAAA,MACf,MAAM,oBAAC,mBAAgB;AAAA,MACvB,aAAW;AAAA,MACX,kBAAgB;AAAA,MAChB,cAAY;AAAA,MACZ,UAAS;AAAA,MACT,KAAK;AAAA,MACL,OAAO,EAAE,QAAQ,OAAO;AAAA,OACpB;AAAA,EACN;AAEJ;","names":[]}
|