@tipp/ui 1.0.56 → 1.0.57

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.
Files changed (77) hide show
  1. package/dist/atoms/avatar.d.cts +1 -1
  2. package/dist/atoms/avatar.d.ts +1 -1
  3. package/dist/atoms/button.d.cts +1 -1
  4. package/dist/atoms/button.d.ts +1 -1
  5. package/dist/atoms/check-box.d.cts +1 -1
  6. package/dist/atoms/check-box.d.ts +1 -1
  7. package/dist/atoms/drawer.cjs +6 -1
  8. package/dist/atoms/drawer.cjs.map +1 -1
  9. package/dist/atoms/drawer.js +1 -1
  10. package/dist/atoms/index.cjs +11 -6
  11. package/dist/atoms/index.cjs.map +1 -1
  12. package/dist/atoms/index.js +1 -1
  13. package/dist/chunk-2DKHDTCD.js +50 -0
  14. package/dist/chunk-2DKHDTCD.js.map +1 -0
  15. package/dist/chunk-47OKVUBW.js +49 -0
  16. package/dist/chunk-47OKVUBW.js.map +1 -0
  17. package/dist/chunk-4MOKG756.js +49 -0
  18. package/dist/chunk-4MOKG756.js.map +1 -0
  19. package/dist/chunk-6XDM5UCM.js +63 -0
  20. package/dist/chunk-6XDM5UCM.js.map +1 -0
  21. package/dist/chunk-6YXNYTWG.js +60 -0
  22. package/dist/chunk-6YXNYTWG.js.map +1 -0
  23. package/dist/chunk-7JBA4THV.js +49 -0
  24. package/dist/chunk-7JBA4THV.js.map +1 -0
  25. package/dist/chunk-AX6DRGYF.js +50 -0
  26. package/dist/chunk-AX6DRGYF.js.map +1 -0
  27. package/dist/chunk-CJDOKOQE.js +57 -0
  28. package/dist/chunk-CJDOKOQE.js.map +1 -0
  29. package/dist/chunk-EAU6DKDJ.js +123 -0
  30. package/dist/chunk-EAU6DKDJ.js.map +1 -0
  31. package/dist/chunk-FFXK3WHX.js +51 -0
  32. package/dist/chunk-FFXK3WHX.js.map +1 -0
  33. package/dist/chunk-FUSEDVWI.js +130 -0
  34. package/dist/chunk-FUSEDVWI.js.map +1 -0
  35. package/dist/chunk-G6NZKQSK.js +123 -0
  36. package/dist/chunk-G6NZKQSK.js.map +1 -0
  37. package/dist/chunk-GAAYHQB7.js +56 -0
  38. package/dist/chunk-GAAYHQB7.js.map +1 -0
  39. package/dist/chunk-HM2WYL3T.js +54 -0
  40. package/dist/chunk-HM2WYL3T.js.map +1 -0
  41. package/dist/chunk-IUT2HS6J.js +130 -0
  42. package/dist/chunk-IUT2HS6J.js.map +1 -0
  43. package/dist/chunk-JWTX4UP4.js +57 -0
  44. package/dist/chunk-JWTX4UP4.js.map +1 -0
  45. package/dist/chunk-NFVB56JS.js +60 -0
  46. package/dist/chunk-NFVB56JS.js.map +1 -0
  47. package/dist/chunk-Q55OUI52.js +54 -0
  48. package/dist/chunk-Q55OUI52.js.map +1 -0
  49. package/dist/chunk-QH2XKKYB.js +50 -0
  50. package/dist/chunk-QH2XKKYB.js.map +1 -0
  51. package/dist/chunk-TGKZ3GXL.js +49 -0
  52. package/dist/chunk-TGKZ3GXL.js.map +1 -0
  53. package/dist/chunk-TJTNRHBA.js +57 -0
  54. package/dist/chunk-TJTNRHBA.js.map +1 -0
  55. package/dist/chunk-TULD3666.js +123 -0
  56. package/dist/chunk-TULD3666.js.map +1 -0
  57. package/dist/chunk-WLHGYNLP.js +57 -0
  58. package/dist/chunk-WLHGYNLP.js.map +1 -0
  59. package/dist/chunk-XRVSCJYE.js +56 -0
  60. package/dist/chunk-XRVSCJYE.js.map +1 -0
  61. package/dist/chunk-Y3ADBCSG.js +58 -0
  62. package/dist/chunk-Y3ADBCSG.js.map +1 -0
  63. package/dist/chunk-Y7LIV2SG.js +60 -0
  64. package/dist/chunk-Y7LIV2SG.js.map +1 -0
  65. package/dist/chunk-Z2ME4RO4.js +57 -0
  66. package/dist/chunk-Z2ME4RO4.js.map +1 -0
  67. package/dist/chunk-Z7UW7DSA.js +49 -0
  68. package/dist/chunk-Z7UW7DSA.js.map +1 -0
  69. package/dist/index.cjs +24 -19
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.js +9 -9
  72. package/dist/molecules/expand-table/index.js +3 -3
  73. package/dist/molecules/expand-table/row.js +1 -1
  74. package/dist/molecules/index.js +6 -6
  75. package/dist/molecules/navigation.js +1 -1
  76. package/package.json +1 -1
  77. package/src/atoms/drawer.tsx +9 -2
@@ -0,0 +1,63 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import { useEffect, useLayoutEffect, useRef } from "react";
14
+ import * as Dialog from "@radix-ui/react-dialog";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function Root2(props) {
17
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
18
+ }
19
+ function Content2(props) {
20
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
21
+ const container = useRef(null);
22
+ useEffect(() => {
23
+ if (document.querySelector("main")) {
24
+ console.log("\uBB50\uC9C0...", document.querySelector("main"));
25
+ container.current = document.querySelector("main");
26
+ }
27
+ }, []);
28
+ useLayoutEffect(() => {
29
+ if (document.querySelector("main")) {
30
+ console.log("\uBB50\uC9C0...", document.querySelector("main"));
31
+ container.current = document.querySelector("main");
32
+ }
33
+ }, []);
34
+ return /* @__PURE__ */ jsx(Dialog.Portal, { container, children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
35
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
36
+ /* @__PURE__ */ jsx(
37
+ Dialog.Content,
38
+ __spreadValues({
39
+ className: `DrawerContent ${position} ${className || ""}`
40
+ }, rest)
41
+ ),
42
+ /* @__PURE__ */ jsx(ToastContainer, {})
43
+ ] }) });
44
+ }
45
+ function Trigger2(props) {
46
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
47
+ }
48
+ var Drawer = {
49
+ Root: Dialog.Root,
50
+ Trigger: Trigger2,
51
+ Content: Content2,
52
+ Close: Dialog.Close,
53
+ Title: Dialog.Title,
54
+ Description: Dialog.Description
55
+ };
56
+
57
+ export {
58
+ Root2 as Root,
59
+ Content2 as Content,
60
+ Trigger2 as Trigger,
61
+ Drawer
62
+ };
63
+ //# sourceMappingURL=chunk-6XDM5UCM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React, { useEffect, useLayoutEffect, 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, ...rest } = props;\n const container = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n if (document.querySelector('main')) {\n console.log('뭐지...', document.querySelector('main'));\n container.current = document.querySelector('main');\n }\n }, []);\n\n useLayoutEffect(() => {\n if (document.querySelector('main')) {\n console.log('뭐지...', document.querySelector('main'));\n container.current = document.querySelector('main');\n }\n }, []);\n\n return (\n <Dialog.Portal container={container}>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\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,iBAAiB,cAAc;AAC1D,YAAY,YAAY;AAKf,cA4BH,YA5BG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UAf9B,IAeqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAC5B,QAAM,YAAY,OAA8B,IAAI;AAEpD,YAAU,MAAM;AACd,QAAI,SAAS,cAAc,MAAM,GAAG;AAClC,cAAQ,IAAI,mBAAS,SAAS,cAAc,MAAM,CAAC;AACnD,gBAAU,UAAU,SAAS,cAAc,MAAM;AAAA,IACnD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,kBAAgB,MAAM;AACpB,QAAI,SAAS,cAAc,MAAM,GAAG;AAClC,cAAQ,IAAI,mBAAS,SAAS,cAAc,MAAM,CAAC;AACnD,gBAAU,UAAU,SAAS,cAAc,MAAM;AAAA,IACnD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,oBAAQ,eAAP,EAAc,WACb,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,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,60 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import {
14
+ useEffect,
15
+ useRef
16
+ } from "react";
17
+ import * as Dialog from "@radix-ui/react-dialog";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ function Root2(props) {
20
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
21
+ }
22
+ function Content2(props) {
23
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
24
+ return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
25
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
26
+ /* @__PURE__ */ jsx(
27
+ Dialog.Content,
28
+ __spreadValues({
29
+ className: `DrawerContent ${position} ${className || ""}`
30
+ }, rest)
31
+ ),
32
+ /* @__PURE__ */ jsx(ToastContainer, {})
33
+ ] }) });
34
+ }
35
+ function Trigger2(props) {
36
+ const container = useRef(null);
37
+ useEffect(() => {
38
+ console.log("\uBB50\uC9C0...", document.querySelector("main"));
39
+ if (document.querySelector("main")) {
40
+ container.current = document.querySelector("main");
41
+ }
42
+ }, []);
43
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
44
+ }
45
+ var Drawer = {
46
+ Root: Dialog.Root,
47
+ Trigger: Trigger2,
48
+ Content: Content2,
49
+ Close: Dialog.Close,
50
+ Title: Dialog.Title,
51
+ Description: Dialog.Description
52
+ };
53
+
54
+ export {
55
+ Root2 as Root,
56
+ Content2 as Content,
57
+ Trigger2 as Trigger,
58
+ Drawer
59
+ };
60
+ //# sourceMappingURL=chunk-6YXNYTWG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React, {\n useEffect,\n useInsertionEffect,\n useLayoutEffect,\n useRef,\n} 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, ...rest } = props;\n\n return (\n <Dialog.Portal>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\n </ThemeProvider>\n </Dialog.Portal>\n );\n}\n\nexport function Trigger(props: Dialog.DialogTriggerProps): React.ReactNode {\n const container = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n console.log('뭐지...', document.querySelector('main'));\n if (document.querySelector('main')) {\n container.current = document.querySelector('main');\n }\n }, []);\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;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AACP,YAAY,YAAY;AAKf,cAaH,YAbG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UApB9B,IAoBqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAE5B,SACE,oBAAQ,eAAP,EACC,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,GACF;AAEJ;AAEO,SAASC,SAAQ,OAAmD;AACzE,QAAM,YAAY,OAA8B,IAAI;AAEpD,YAAU,MAAM;AACd,YAAQ,IAAI,mBAAS,SAAS,cAAc,MAAM,CAAC;AACnD,QAAI,SAAS,cAAc,MAAM,GAAG;AAClC,gBAAU,UAAU,SAAS,cAAc,MAAM;AAAA,IACnD;AAAA,EACF,GAAG,CAAC,CAAC;AACL,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,49 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import * as Dialog from "@radix-ui/react-dialog";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ function Root2(props) {
16
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
17
+ }
18
+ function Content2(props) {
19
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
20
+ return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
21
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
22
+ /* @__PURE__ */ jsx(
23
+ Dialog.Content,
24
+ __spreadValues({
25
+ className: `DrawerContent ${position} ${className || ""}`
26
+ }, rest)
27
+ ),
28
+ /* @__PURE__ */ jsx(ToastContainer, {})
29
+ ] }) });
30
+ }
31
+ function Trigger2(props) {
32
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
33
+ }
34
+ var Drawer = {
35
+ Root: Dialog.Root,
36
+ Trigger: Trigger2,
37
+ Content: Content2,
38
+ Close: Dialog.Close,
39
+ Title: Dialog.Title,
40
+ Description: Dialog.Description
41
+ };
42
+
43
+ export {
44
+ Root2 as Root,
45
+ Content2 as Content,
46
+ Trigger2 as Trigger,
47
+ Drawer
48
+ };
49
+ //# sourceMappingURL=chunk-7JBA4THV.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, ...rest } = props;\n\n return (\n <Dialog.Portal>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\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":";;;;;;;;;;;;AACA,YAAY,YAAY;AAKf,cAaH,YAbG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UAf9B,IAeqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAE5B,SACE,oBAAQ,eAAP,EACC,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,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,50 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import * as Dialog from "@radix-ui/react-dialog";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ function Root2(props) {
16
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
17
+ }
18
+ function Content2(props) {
19
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
20
+ console.log(document.querySelector(".radix-themes"));
21
+ return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
22
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
23
+ /* @__PURE__ */ jsx(
24
+ Dialog.Content,
25
+ __spreadValues({
26
+ className: `DrawerContent ${position} ${className || ""}`
27
+ }, rest)
28
+ ),
29
+ /* @__PURE__ */ jsx(ToastContainer, {})
30
+ ] }) });
31
+ }
32
+ function Trigger2(props) {
33
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
34
+ }
35
+ var Drawer = {
36
+ Root: Dialog.Root,
37
+ Trigger: Trigger2,
38
+ Content: Content2,
39
+ Close: Dialog.Close,
40
+ Title: Dialog.Title,
41
+ Description: Dialog.Description
42
+ };
43
+
44
+ export {
45
+ Root2 as Root,
46
+ Content2 as Content,
47
+ Trigger2 as Trigger,
48
+ Drawer
49
+ };
50
+ //# sourceMappingURL=chunk-AX6DRGYF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React 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, ...rest } = props;\n // console.log(document.getElementsByTagName('main'));\n console.log(document.querySelector('.radix-themes'));\n\n return (\n <Dialog.Portal>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\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":";;;;;;;;;;;;AACA,YAAY,YAAY;AAKf,cAeH,YAfG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UAf9B,IAeqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAE5B,UAAQ,IAAI,SAAS,cAAc,eAAe,CAAC;AAEnD,SACE,oBAAQ,eAAP,EACC,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,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,57 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import { useLayoutEffect, useRef } from "react";
14
+ import * as Dialog from "@radix-ui/react-dialog";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function Root2(props) {
17
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
18
+ }
19
+ function Content2(props) {
20
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
21
+ const container = useRef(null);
22
+ useLayoutEffect(() => {
23
+ if (document.querySelector("main")) {
24
+ console.log("\uBB50\uC9C0...", document.querySelector("main"));
25
+ container.current = document.querySelector("main");
26
+ }
27
+ }, []);
28
+ return /* @__PURE__ */ jsx(Dialog.Portal, { container, children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
29
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
30
+ /* @__PURE__ */ jsx(
31
+ Dialog.Content,
32
+ __spreadValues({
33
+ className: `DrawerContent ${position} ${className || ""}`
34
+ }, rest)
35
+ ),
36
+ /* @__PURE__ */ jsx(ToastContainer, {})
37
+ ] }) });
38
+ }
39
+ function Trigger2(props) {
40
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
41
+ }
42
+ var Drawer = {
43
+ Root: Dialog.Root,
44
+ Trigger: Trigger2,
45
+ Content: Content2,
46
+ Close: Dialog.Close,
47
+ Title: Dialog.Title,
48
+ Description: Dialog.Description
49
+ };
50
+
51
+ export {
52
+ Root2 as Root,
53
+ Content2 as Content,
54
+ Trigger2 as Trigger,
55
+ Drawer
56
+ };
57
+ //# sourceMappingURL=chunk-CJDOKOQE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React, { useEffect, useLayoutEffect, 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, ...rest } = props;\n const container = useRef<HTMLDivElement | null>(null);\n\n useLayoutEffect(() => {\n if (document.querySelector('main')) {\n console.log('뭐지...', document.querySelector('main'));\n container.current = document.querySelector('main');\n }\n }, []);\n\n return (\n <Dialog.Portal container={container}>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\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,SAA2B,iBAAiB,cAAc;AAC1D,YAAY,YAAY;AAKf,cAqBH,YArBG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UAf9B,IAeqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAC5B,QAAM,YAAY,OAA8B,IAAI;AAEpD,kBAAgB,MAAM;AACpB,QAAI,SAAS,cAAc,MAAM,GAAG;AAClC,cAAQ,IAAI,mBAAS,SAAS,cAAc,MAAM,CAAC;AACnD,gBAAU,UAAU,SAAS,cAAc,MAAM;AAAA,IACnD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,oBAAQ,eAAP,EAAc,WACb,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,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,123 @@
1
+ import {
2
+ Row
3
+ } from "./chunk-JFKC7O5G.js";
4
+ import {
5
+ Flex
6
+ } from "./chunk-25HMMI7R.js";
7
+ import {
8
+ Typo
9
+ } from "./chunk-O3XTRD7R.js";
10
+ import {
11
+ TriangleArrowDownIcon
12
+ } from "./chunk-BSTJBBEX.js";
13
+ import {
14
+ TriangleArrowUpIcon
15
+ } from "./chunk-NDUKDKGB.js";
16
+
17
+ // src/molecules/expand-table/index.tsx
18
+ import {
19
+ flexRender,
20
+ getCoreRowModel,
21
+ useReactTable,
22
+ getSortedRowModel,
23
+ createColumnHelper
24
+ } from "@tanstack/react-table";
25
+ import { useMemo, useState } from "react";
26
+ import { jsx, jsxs } from "react/jsx-runtime";
27
+ function ExpandTable(props) {
28
+ const { data, columns, ExpandComp, placeholder, onRowClick, tableStyle } = props;
29
+ const defaultAlign = "left";
30
+ const [sorting, setSorting] = useState([]);
31
+ const { getRowModel, getHeaderGroups } = useReactTable({
32
+ data: data || [],
33
+ columns,
34
+ getCoreRowModel: getCoreRowModel(),
35
+ getSortedRowModel: getSortedRowModel(),
36
+ state: {
37
+ sorting
38
+ },
39
+ onSortingChange: setSorting
40
+ });
41
+ const gridColTemp = useMemo(() => {
42
+ return columns.map((col) => {
43
+ var _a;
44
+ if ((_a = col.meta) == null ? void 0 : _a.autoSize)
45
+ return "1fr";
46
+ return `${col.size || 150}px`;
47
+ }).join(" ");
48
+ }, [columns]);
49
+ const rowModels = getRowModel();
50
+ return /* @__PURE__ */ jsxs("div", { className: "expand-table", style: tableStyle, children: [
51
+ /* @__PURE__ */ jsx("div", { className: "thead", children: getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ className: "tr",
55
+ style: { gridTemplateColumns: gridColTemp },
56
+ children: headerGroup.headers.map((header) => {
57
+ var _a;
58
+ const sortable = header.column.getCanSort();
59
+ const sortedState = header.column.getIsSorted();
60
+ const justifyContent = ((_a = header.column.columnDef.meta) == null ? void 0 : _a.align) || defaultAlign;
61
+ return /* @__PURE__ */ jsx("div", { className: `${justifyContent} th`, children: /* @__PURE__ */ jsxs(
62
+ "button",
63
+ {
64
+ onClick: header.column.getToggleSortingHandler(),
65
+ style: sortable ? { cursor: "pointer" } : void 0,
66
+ type: "button",
67
+ children: [
68
+ /* @__PURE__ */ jsx(Typo, { variant: "body", children: flexRender(
69
+ header.column.columnDef.header,
70
+ header.getContext()
71
+ ) }),
72
+ sortable ? /* @__PURE__ */ jsxs(
73
+ Flex,
74
+ {
75
+ direction: "column",
76
+ style: { marginLeft: "var(--space-2)" },
77
+ children: [
78
+ /* @__PURE__ */ jsx(
79
+ TriangleArrowUpIcon,
80
+ {
81
+ color: sortedState === "asc" ? "var(--iris-10)" : "var(--iris-6)"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ TriangleArrowDownIcon,
86
+ {
87
+ color: sortedState === "desc" ? "var(--iris-10)" : "var(--iris-6)"
88
+ }
89
+ )
90
+ ]
91
+ }
92
+ ) : null
93
+ ]
94
+ }
95
+ ) }, header.id);
96
+ })
97
+ },
98
+ headerGroup.id
99
+ )) }),
100
+ /* @__PURE__ */ jsxs("div", { className: "tbody", children: [
101
+ rowModels.rows.length === 0 && /* @__PURE__ */ jsx("div", { className: "tr", children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", children: placeholder || /* @__PURE__ */ jsx(Typo, { color: "gray", mb: "6", mt: "6", variant: "body", children: "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4" }) }) }, "expand_placeholder"),
102
+ rowModels.rows.map((row) => {
103
+ return /* @__PURE__ */ jsx(
104
+ Row,
105
+ {
106
+ ExpandComp,
107
+ defaultAlign,
108
+ gridColTemp,
109
+ onRowClick,
110
+ row
111
+ },
112
+ `row_${row.id}`
113
+ );
114
+ })
115
+ ] })
116
+ ] });
117
+ }
118
+
119
+ export {
120
+ createColumnHelper,
121
+ ExpandTable
122
+ };
123
+ //# sourceMappingURL=chunk-EAU6DKDJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/molecules/expand-table/index.tsx"],"sourcesContent":["import type {\n ColumnDef,\n SortingState,\n RowData,\n Row as RowType,\n} from '@tanstack/react-table';\nimport type { CSSProperties } from 'react';\nimport {\n flexRender,\n getCoreRowModel,\n useReactTable,\n getSortedRowModel,\n createColumnHelper,\n} from '@tanstack/react-table';\nimport React, { useMemo, useState } from 'react';\nimport { Flex, Typo } from '../../atoms';\nimport { TriangleArrowDownIcon } from '../../icons/down';\nimport { TriangleArrowUpIcon } from '../../icons/up';\nimport { Row, type ExpandComp, type OnRowClick } from './row';\n\nexport type { ExpandComp, OnRowClick, ColumnDef, RowType as Row };\nexport { createColumnHelper };\n\nexport interface ExpandTableProps<Datum extends RowData> {\n /** 렌더할 데이터 배열 */\n data?: Datum[];\n /** 테이블 컬럼의 메타 데이터 */\n columns: ColumnDef<Datum>[];\n /** Row의 open이 true인 경우 하단의 collapse에 렌더할 컴포넌트 */\n ExpandComp?: ExpandComp<Datum>;\n /** 데이테가 없을 시 화면에 표시할 컴포넌트 */\n placeholder?: React.ReactNode;\n /** 행 클릭 시 실행할 콜백 */\n onRowClick?: OnRowClick<Datum>;\n rowStyle?: CSSProperties;\n tableStyle?: CSSProperties;\n}\n\nexport function ExpandTable<Datum extends RowData>(\n props: ExpandTableProps<Datum>\n): React.ReactNode {\n const { data, columns, ExpandComp, placeholder, onRowClick, tableStyle } =\n props;\n const defaultAlign = 'left';\n const [sorting, setSorting] = useState<SortingState>([]);\n const { getRowModel, getHeaderGroups } = useReactTable({\n data: data || [],\n columns,\n getCoreRowModel: getCoreRowModel(),\n getSortedRowModel: getSortedRowModel(),\n state: {\n sorting,\n },\n onSortingChange: setSorting,\n });\n\n const gridColTemp = useMemo<string>(() => {\n return columns\n .map((col) => {\n if (col.meta?.autoSize) return '1fr';\n return `${col.size || 150}px`;\n })\n .join(' ');\n }, [columns]);\n\n const rowModels = getRowModel();\n\n return (\n <div className=\"expand-table\" style={tableStyle}>\n <div className=\"thead\">\n {getHeaderGroups().map((headerGroup) => (\n <div\n className=\"tr\"\n key={headerGroup.id}\n style={{ gridTemplateColumns: gridColTemp }}\n >\n {headerGroup.headers.map((header) => {\n const sortable = header.column.getCanSort();\n const sortedState = header.column.getIsSorted();\n const justifyContent =\n header.column.columnDef.meta?.align || defaultAlign;\n\n return (\n <div className={`${justifyContent} th`} key={header.id}>\n <button\n onClick={header.column.getToggleSortingHandler()}\n style={sortable ? { cursor: 'pointer' } : undefined}\n type=\"button\"\n >\n <Typo variant=\"body\">\n {flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </Typo>\n {sortable ? (\n <Flex\n direction=\"column\"\n style={{ marginLeft: 'var(--space-2)' }}\n >\n <TriangleArrowUpIcon\n color={\n sortedState === 'asc'\n ? 'var(--iris-10)'\n : 'var(--iris-6)'\n }\n />\n <TriangleArrowDownIcon\n color={\n sortedState === 'desc'\n ? 'var(--iris-10)'\n : 'var(--iris-6)'\n }\n />\n </Flex>\n ) : null}\n </button>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n <div className=\"tbody\">\n {/* 데이터가 없을 시 표시되는 노드 */}\n {rowModels.rows.length === 0 && (\n <div className=\"tr\" key=\"expand_placeholder\">\n <Flex align=\"center\" justify=\"center\">\n {placeholder || (\n <Typo color=\"gray\" mb=\"6\" mt=\"6\" variant=\"body\">\n 데이터가 없습니다\n </Typo>\n )}\n </Flex>\n </div>\n )}\n\n {/* 행을 렌더하는 로직 */}\n {rowModels.rows.map((row) => {\n return (\n <Row\n ExpandComp={ExpandComp}\n defaultAlign={defaultAlign}\n gridColTemp={gridColTemp}\n key={`row_${row.id}`}\n onRowClick={onRowClick}\n row={row}\n />\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAgB,SAAS,gBAAgB;AA2ErB,cAOE,YAPF;AAnDb,SAAS,YACd,OACiB;AACjB,QAAM,EAAE,MAAM,SAAS,YAAY,aAAa,YAAY,WAAW,IACrE;AACF,QAAM,eAAe;AACrB,QAAM,CAAC,SAAS,UAAU,IAAI,SAAuB,CAAC,CAAC;AACvD,QAAM,EAAE,aAAa,gBAAgB,IAAI,cAAc;AAAA,IACrD,MAAM,QAAQ,CAAC;AAAA,IACf;AAAA,IACA,iBAAiB,gBAAgB;AAAA,IACjC,mBAAmB,kBAAkB;AAAA,IACrC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,EACnB,CAAC;AAED,QAAM,cAAc,QAAgB,MAAM;AACxC,WAAO,QACJ,IAAI,CAAC,QAAQ;AA1DpB;AA2DQ,WAAI,SAAI,SAAJ,mBAAU;AAAU,eAAO;AAC/B,aAAO,GAAG,IAAI,QAAQ,GAAG;AAAA,IAC3B,CAAC,EACA,KAAK,GAAG;AAAA,EACb,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,YAAY,YAAY;AAE9B,SACE,qBAAC,SAAI,WAAU,gBAAe,OAAO,YACnC;AAAA,wBAAC,SAAI,WAAU,SACZ,0BAAgB,EAAE,IAAI,CAAC,gBACtB;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QAEV,OAAO,EAAE,qBAAqB,YAAY;AAAA,QAEzC,sBAAY,QAAQ,IAAI,CAAC,WAAW;AA5EjD;AA6Ec,gBAAM,WAAW,OAAO,OAAO,WAAW;AAC1C,gBAAM,cAAc,OAAO,OAAO,YAAY;AAC9C,gBAAM,mBACJ,YAAO,OAAO,UAAU,SAAxB,mBAA8B,UAAS;AAEzC,iBACE,oBAAC,SAAI,WAAW,GAAG,cAAc,OAC/B;AAAA,YAAC;AAAA;AAAA,cACC,SAAS,OAAO,OAAO,wBAAwB;AAAA,cAC/C,OAAO,WAAW,EAAE,QAAQ,UAAU,IAAI;AAAA,cAC1C,MAAK;AAAA,cAEL;AAAA,oCAAC,QAAK,SAAQ,QACX;AAAA,kBACC,OAAO,OAAO,UAAU;AAAA,kBACxB,OAAO,WAAW;AAAA,gBACpB,GACF;AAAA,gBACC,WACC;AAAA,kBAAC;AAAA;AAAA,oBACC,WAAU;AAAA,oBACV,OAAO,EAAE,YAAY,iBAAiB;AAAA,oBAEtC;AAAA;AAAA,wBAAC;AAAA;AAAA,0BACC,OACE,gBAAgB,QACZ,mBACA;AAAA;AAAA,sBAER;AAAA,sBACA;AAAA,wBAAC;AAAA;AAAA,0BACC,OACE,gBAAgB,SACZ,mBACA;AAAA;AAAA,sBAER;AAAA;AAAA;AAAA,gBACF,IACE;AAAA;AAAA;AAAA,UACN,KAjC2C,OAAO,EAkCpD;AAAA,QAEJ,CAAC;AAAA;AAAA,MA9CI,YAAY;AAAA,IA+CnB,CACD,GACH;AAAA,IACA,qBAAC,SAAI,WAAU,SAEZ;AAAA,gBAAU,KAAK,WAAW,KACzB,oBAAC,SAAI,WAAU,MACb,8BAAC,QAAK,OAAM,UAAS,SAAQ,UAC1B,yBACC,oBAAC,QAAK,OAAM,QAAO,IAAG,KAAI,IAAG,KAAI,SAAQ,QAAO,+DAEhD,GAEJ,KAPsB,oBAQxB;AAAA,MAID,UAAU,KAAK,IAAI,CAAC,QAAQ;AAC3B,eACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YAEA;AAAA,YACA;AAAA;AAAA,UAFK,OAAO,IAAI,EAAE;AAAA,QAGpB;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,51 @@
1
+ import {
2
+ ThemeProvider
3
+ } from "./chunk-BVBX6IJ3.js";
4
+ import {
5
+ ToastContainer
6
+ } from "./chunk-NJ2U2TVS.js";
7
+ import {
8
+ __objRest,
9
+ __spreadValues
10
+ } from "./chunk-N552FDTV.js";
11
+
12
+ // src/atoms/drawer.tsx
13
+ import * as Dialog from "@radix-ui/react-dialog";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
15
+ function Root2(props) {
16
+ return /* @__PURE__ */ jsx(Dialog.Root, __spreadValues({}, props));
17
+ }
18
+ function Content2(props) {
19
+ const _a = props, { position = "right", className } = _a, rest = __objRest(_a, ["position", "className"]);
20
+ console.log(document.getElementsByTagName("main"));
21
+ console.log(document.querySelector(".radix-themes"));
22
+ return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(ThemeProvider, { children: [
23
+ /* @__PURE__ */ jsx(Dialog.Overlay, { className: "DrawerOverlay" }),
24
+ /* @__PURE__ */ jsx(
25
+ Dialog.Content,
26
+ __spreadValues({
27
+ className: `DrawerContent ${position} ${className || ""}`
28
+ }, rest)
29
+ ),
30
+ /* @__PURE__ */ jsx(ToastContainer, {})
31
+ ] }) });
32
+ }
33
+ function Trigger2(props) {
34
+ return /* @__PURE__ */ jsx(Dialog.Trigger, __spreadValues({ asChild: true }, props));
35
+ }
36
+ var Drawer = {
37
+ Root: Dialog.Root,
38
+ Trigger: Trigger2,
39
+ Content: Content2,
40
+ Close: Dialog.Close,
41
+ Title: Dialog.Title,
42
+ Description: Dialog.Description
43
+ };
44
+
45
+ export {
46
+ Root2 as Root,
47
+ Content2 as Content,
48
+ Trigger2 as Trigger,
49
+ Drawer
50
+ };
51
+ //# sourceMappingURL=chunk-FFXK3WHX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/atoms/drawer.tsx"],"sourcesContent":["import React 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, ...rest } = props;\n console.log(document.getElementsByTagName('main'));\n console.log(document.querySelector('.radix-themes'));\n\n return (\n <Dialog.Portal>\n <ThemeProvider>\n <Dialog.Overlay className=\"DrawerOverlay\" />\n <Dialog.Content\n className={`DrawerContent ${position} ${className || ''}`}\n {...rest}\n />\n <ToastContainer />\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":";;;;;;;;;;;;AACA,YAAY,YAAY;AAKf,cAeH,YAfG;AADF,SAASA,MAAK,OAA4C;AAC/D,SAAO,oBAAQ,aAAP,mBAAgB,MAAO;AACjC;AAOO,SAASC,SAAQ,OAAsC;AAC5D,QAAmD,YAA3C,aAAW,SAAS,UAf9B,IAeqD,IAAT,iBAAS,IAAT,CAAlC,YAAoB;AAC5B,UAAQ,IAAI,SAAS,qBAAqB,MAAM,CAAC;AACjD,UAAQ,IAAI,SAAS,cAAc,eAAe,CAAC;AAEnD,SACE,oBAAQ,eAAP,EACC,+BAAC,iBACC;AAAA,wBAAQ,gBAAP,EAAe,WAAU,iBAAgB;AAAA,IAC1C;AAAA,MAAQ;AAAA,MAAP;AAAA,QACC,WAAW,iBAAiB,QAAQ,IAAI,aAAa,EAAE;AAAA,SACnD;AAAA,IACN;AAAA,IACA,oBAAC,kBAAe;AAAA,KAClB,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,130 @@
1
+ import {
2
+ IconButton
3
+ } from "./chunk-O3DNDMV3.js";
4
+ import {
5
+ Typo
6
+ } from "./chunk-O3XTRD7R.js";
7
+ import {
8
+ Flex
9
+ } from "./chunk-25HMMI7R.js";
10
+ import {
11
+ ChevronLeftIcon,
12
+ ChevronRightIcon,
13
+ DoubleArrowLeftIcon,
14
+ DoubleArrowRightIcon
15
+ } from "./chunk-TSVWEPRP.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-FUSEDVWI.js.map