dn-react-router-toolkit 0.2.7 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/api/create_handler.d.mts +13 -0
  2. package/dist/api/create_handler.d.ts +13 -0
  3. package/dist/api/create_handler.js +298 -0
  4. package/dist/api/create_handler.mjs +304 -0
  5. package/dist/api/index.d.mts +4 -0
  6. package/dist/api/index.d.ts +4 -0
  7. package/dist/api/index.js +298 -0
  8. package/dist/api/index.mjs +304 -0
  9. package/dist/auth/client/index.d.mts +3 -0
  10. package/dist/auth/client/index.d.ts +3 -0
  11. package/dist/{date.js → auth/client/index.js} +25 -32
  12. package/dist/auth/client/index.mjs +21 -0
  13. package/dist/auth/client/redirect_page.d.mts +1 -0
  14. package/dist/auth/client/redirect_page.d.ts +1 -0
  15. package/dist/auth/cookie_store.d.mts +13 -0
  16. package/dist/auth/cookie_store.d.ts +13 -0
  17. package/dist/{text_editor/plugins/keymap.js → auth/cookie_store.js} +24 -16
  18. package/dist/auth/cookie_store.mjs +23 -0
  19. package/dist/auth/index.d.mts +5 -0
  20. package/dist/auth/index.d.ts +5 -0
  21. package/dist/auth/index.js +139 -0
  22. package/dist/auth/index.mjs +111 -0
  23. package/dist/auth/server/index.d.mts +1 -0
  24. package/dist/auth/server/index.d.ts +1 -0
  25. package/dist/{slug.js → auth/server/index.js} +6 -14
  26. package/dist/auth/server/index.mjs +2 -0
  27. package/dist/auth/with_auth.d.mts +2 -6
  28. package/dist/auth/with_auth.d.ts +2 -6
  29. package/dist/auth/with_auth.js +3 -0
  30. package/dist/auth/with_auth.mjs +3 -0
  31. package/dist/{components → client}/client_env.d.mts +1 -1
  32. package/dist/{components → client}/client_env.d.ts +1 -1
  33. package/dist/{components → client}/client_env.js +6 -2
  34. package/dist/{components → client}/client_env.mjs +2 -2
  35. package/dist/client/index.d.mts +3 -0
  36. package/dist/client/index.d.ts +3 -0
  37. package/dist/{auth/client/google_login_button.js → client/index.js} +30 -33
  38. package/dist/client/index.mjs +31 -0
  39. package/dist/client/use_user_agent.d.mts +8 -0
  40. package/dist/client/use_user_agent.d.ts +8 -0
  41. package/dist/{file/client/format_size.js → client/use_user_agent.js} +14 -14
  42. package/dist/client/use_user_agent.mjs +13 -0
  43. package/dist/file/client/index.d.mts +1 -0
  44. package/dist/file/client/index.d.ts +1 -0
  45. package/dist/file/{cdn.js → client/index.js} +6 -16
  46. package/dist/file/client/index.mjs +2 -0
  47. package/dist/file/index.d.mts +1 -0
  48. package/dist/file/index.d.ts +1 -0
  49. package/dist/{cn.js → file/index.js} +6 -14
  50. package/dist/file/index.mjs +2 -0
  51. package/dist/file/server/index.d.mts +1 -0
  52. package/dist/file/server/index.d.ts +1 -0
  53. package/dist/file/server/index.js +24 -0
  54. package/dist/file/server/index.mjs +2 -0
  55. package/dist/http/index.d.mts +1 -1
  56. package/dist/http/index.d.ts +1 -1
  57. package/dist/http/index.js +3 -90
  58. package/dist/http/index.mjs +2 -68
  59. package/dist/index.d.mts +8 -6
  60. package/dist/index.d.ts +8 -6
  61. package/dist/index.js +3 -79
  62. package/dist/index.mjs +2 -58
  63. package/dist/modal/index.d.mts +1 -0
  64. package/dist/modal/index.d.ts +1 -0
  65. package/dist/{sleep.js → modal/index.js} +6 -14
  66. package/dist/modal/index.mjs +2 -0
  67. package/dist/seo/index.d.mts +4 -0
  68. package/dist/seo/index.d.ts +4 -0
  69. package/dist/seo/index.js +304 -0
  70. package/dist/seo/index.mjs +267 -0
  71. package/dist/text_editor/index.d.mts +1 -0
  72. package/dist/text_editor/index.d.ts +1 -0
  73. package/dist/text_editor/index.js +24 -0
  74. package/dist/text_editor/index.mjs +2 -0
  75. package/package.json +58 -32
  76. package/dist/auth/apple_auth.d.mts +0 -38
  77. package/dist/auth/apple_auth.d.ts +0 -38
  78. package/dist/auth/apple_auth.js +0 -88
  79. package/dist/auth/apple_auth.mjs +0 -63
  80. package/dist/auth/auth_repository.d.mts +0 -41
  81. package/dist/auth/auth_repository.d.ts +0 -41
  82. package/dist/auth/auth_repository.js +0 -18
  83. package/dist/auth/auth_repository.mjs +0 -0
  84. package/dist/auth/auth_service.d.mts +0 -63
  85. package/dist/auth/auth_service.d.ts +0 -63
  86. package/dist/auth/auth_service.js +0 -210
  87. package/dist/auth/auth_service.mjs +0 -171
  88. package/dist/auth/client/google_login_button.d.mts +0 -7
  89. package/dist/auth/client/google_login_button.d.ts +0 -7
  90. package/dist/auth/client/google_login_button.mjs +0 -37
  91. package/dist/auth/client/provider.d.mts +0 -24
  92. package/dist/auth/client/provider.d.ts +0 -24
  93. package/dist/auth/client/provider.js +0 -154
  94. package/dist/auth/client/provider.mjs +0 -118
  95. package/dist/auth/google_auth.d.mts +0 -33
  96. package/dist/auth/google_auth.d.ts +0 -33
  97. package/dist/auth/google_auth.js +0 -135
  98. package/dist/auth/google_auth.mjs +0 -108
  99. package/dist/auth/handlers/find_auth.d.mts +0 -13
  100. package/dist/auth/handlers/find_auth.d.ts +0 -13
  101. package/dist/auth/handlers/find_auth.js +0 -82
  102. package/dist/auth/handlers/find_auth.mjs +0 -55
  103. package/dist/auth/handlers/login.d.mts +0 -13
  104. package/dist/auth/handlers/login.d.ts +0 -13
  105. package/dist/auth/handlers/login.js +0 -107
  106. package/dist/auth/handlers/login.mjs +0 -80
  107. package/dist/auth/handlers/login_with_thirdparty.d.mts +0 -15
  108. package/dist/auth/handlers/login_with_thirdparty.d.ts +0 -15
  109. package/dist/auth/handlers/login_with_thirdparty.js +0 -98
  110. package/dist/auth/handlers/login_with_thirdparty.mjs +0 -71
  111. package/dist/auth/handlers/logout.d.mts +0 -13
  112. package/dist/auth/handlers/logout.d.ts +0 -13
  113. package/dist/auth/handlers/logout.js +0 -102
  114. package/dist/auth/handlers/logout.mjs +0 -75
  115. package/dist/auth/handlers/refresh.d.mts +0 -13
  116. package/dist/auth/handlers/refresh.d.ts +0 -13
  117. package/dist/auth/handlers/refresh.js +0 -92
  118. package/dist/auth/handlers/refresh.mjs +0 -65
  119. package/dist/auth/handlers/request_password_reset.d.mts +0 -10
  120. package/dist/auth/handlers/request_password_reset.d.ts +0 -10
  121. package/dist/auth/handlers/request_password_reset.js +0 -87
  122. package/dist/auth/handlers/request_password_reset.mjs +0 -60
  123. package/dist/auth/handlers/reset_password.d.mts +0 -10
  124. package/dist/auth/handlers/reset_password.d.ts +0 -10
  125. package/dist/auth/handlers/reset_password.js +0 -88
  126. package/dist/auth/handlers/reset_password.mjs +0 -61
  127. package/dist/auth/handlers/signup.d.mts +0 -15
  128. package/dist/auth/handlers/signup.d.ts +0 -15
  129. package/dist/auth/handlers/signup.js +0 -147
  130. package/dist/auth/handlers/signup.mjs +0 -112
  131. package/dist/auth/handlers/signup_with_thirdparty.d.mts +0 -17
  132. package/dist/auth/handlers/signup_with_thirdparty.d.ts +0 -17
  133. package/dist/auth/handlers/signup_with_thirdparty.js +0 -123
  134. package/dist/auth/handlers/signup_with_thirdparty.mjs +0 -98
  135. package/dist/auth/handlers/thirdparty_auth_callback.d.mts +0 -16
  136. package/dist/auth/handlers/thirdparty_auth_callback.d.ts +0 -16
  137. package/dist/auth/handlers/thirdparty_auth_callback.js +0 -129
  138. package/dist/auth/handlers/thirdparty_auth_callback.mjs +0 -102
  139. package/dist/auth/jwt_manager.d.mts +0 -38
  140. package/dist/auth/jwt_manager.d.ts +0 -38
  141. package/dist/auth/jwt_manager.js +0 -90
  142. package/dist/auth/jwt_manager.mjs +0 -65
  143. package/dist/auth/kakao_auth.d.mts +0 -27
  144. package/dist/auth/kakao_auth.d.ts +0 -27
  145. package/dist/auth/kakao_auth.js +0 -56
  146. package/dist/auth/kakao_auth.mjs +0 -31
  147. package/dist/auth/password_recovery.d.mts +0 -34
  148. package/dist/auth/password_recovery.d.ts +0 -34
  149. package/dist/auth/password_recovery.js +0 -169
  150. package/dist/auth/password_recovery.mjs +0 -134
  151. package/dist/auth/thirdparty_auth.d.mts +0 -41
  152. package/dist/auth/thirdparty_auth.d.ts +0 -41
  153. package/dist/auth/thirdparty_auth.js +0 -113
  154. package/dist/auth/thirdparty_auth.mjs +0 -86
  155. package/dist/cn.d.mts +0 -3
  156. package/dist/cn.d.ts +0 -3
  157. package/dist/cn.mjs +0 -7
  158. package/dist/components/index.d.mts +0 -5
  159. package/dist/components/index.d.ts +0 -5
  160. package/dist/components/index.js +0 -261
  161. package/dist/components/index.mjs +0 -219
  162. package/dist/components/modal/fullscreen_container.d.mts +0 -7
  163. package/dist/components/modal/fullscreen_container.d.ts +0 -7
  164. package/dist/components/modal/fullscreen_container.js +0 -102
  165. package/dist/components/modal/fullscreen_container.mjs +0 -68
  166. package/dist/components/modal/hooks.d.mts +0 -18
  167. package/dist/components/modal/hooks.d.ts +0 -18
  168. package/dist/components/modal/hooks.js +0 -236
  169. package/dist/components/modal/hooks.mjs +0 -204
  170. package/dist/components/modal/index.d.mts +0 -4
  171. package/dist/components/modal/index.d.ts +0 -4
  172. package/dist/components/modal/index.js +0 -238
  173. package/dist/components/modal/index.mjs +0 -203
  174. package/dist/components/modal/modal.d.mts +0 -13
  175. package/dist/components/modal/modal.d.ts +0 -13
  176. package/dist/components/modal/modal.js +0 -155
  177. package/dist/components/modal/modal.mjs +0 -130
  178. package/dist/components/styles.d.mts +0 -9
  179. package/dist/components/styles.d.ts +0 -9
  180. package/dist/components/styles.js +0 -48
  181. package/dist/components/styles.mjs +0 -17
  182. package/dist/date.d.mts +0 -5
  183. package/dist/date.d.ts +0 -5
  184. package/dist/date.mjs +0 -29
  185. package/dist/file/cdn.d.mts +0 -6
  186. package/dist/file/cdn.d.ts +0 -6
  187. package/dist/file/cdn.mjs +0 -9
  188. package/dist/file/client/drop_file_input.d.mts +0 -36
  189. package/dist/file/client/drop_file_input.d.ts +0 -36
  190. package/dist/file/client/drop_file_input.js +0 -323
  191. package/dist/file/client/drop_file_input.mjs +0 -294
  192. package/dist/file/client/file_upload_button.d.mts +0 -10
  193. package/dist/file/client/file_upload_button.d.ts +0 -10
  194. package/dist/file/client/file_upload_button.js +0 -89
  195. package/dist/file/client/file_upload_button.mjs +0 -58
  196. package/dist/file/client/file_uploader.d.mts +0 -13
  197. package/dist/file/client/file_uploader.d.ts +0 -13
  198. package/dist/file/client/file_uploader.js +0 -163
  199. package/dist/file/client/file_uploader.mjs +0 -136
  200. package/dist/file/client/format_size.d.mts +0 -3
  201. package/dist/file/client/format_size.d.ts +0 -3
  202. package/dist/file/client/format_size.mjs +0 -13
  203. package/dist/file/client/metadata.d.mts +0 -7
  204. package/dist/file/client/metadata.d.ts +0 -7
  205. package/dist/file/client/metadata.js +0 -85
  206. package/dist/file/client/metadata.mjs +0 -60
  207. package/dist/file/file_repository.d.mts +0 -16
  208. package/dist/file/file_repository.d.ts +0 -16
  209. package/dist/file/file_repository.js +0 -18
  210. package/dist/file/file_repository.mjs +0 -0
  211. package/dist/file/file_service.d.mts +0 -32
  212. package/dist/file/file_service.d.ts +0 -32
  213. package/dist/file/file_service.js +0 -66
  214. package/dist/file/file_service.mjs +0 -41
  215. package/dist/file/handlers/delete_file.d.mts +0 -17
  216. package/dist/file/handlers/delete_file.d.ts +0 -17
  217. package/dist/file/handlers/delete_file.js +0 -99
  218. package/dist/file/handlers/delete_file.mjs +0 -72
  219. package/dist/file/handlers/upload_file.d.mts +0 -16
  220. package/dist/file/handlers/upload_file.d.ts +0 -16
  221. package/dist/file/handlers/upload_file.js +0 -106
  222. package/dist/file/handlers/upload_file.mjs +0 -79
  223. package/dist/file/object_storage.d.mts +0 -20
  224. package/dist/file/object_storage.d.ts +0 -20
  225. package/dist/file/object_storage.js +0 -90
  226. package/dist/file/object_storage.mjs +0 -70
  227. package/dist/file/responsive_image.d.mts +0 -20
  228. package/dist/file/responsive_image.d.ts +0 -20
  229. package/dist/file/responsive_image.js +0 -132
  230. package/dist/file/responsive_image.mjs +0 -96
  231. package/dist/http/response.d.mts +0 -19
  232. package/dist/http/response.d.ts +0 -19
  233. package/dist/http/response.js +0 -109
  234. package/dist/http/response.mjs +0 -68
  235. package/dist/route/api.d.mts +0 -21
  236. package/dist/route/api.d.ts +0 -21
  237. package/dist/route/api.js +0 -584
  238. package/dist/route/api.mjs +0 -547
  239. package/dist/singleton.d.mts +0 -3
  240. package/dist/singleton.d.ts +0 -3
  241. package/dist/singleton.js +0 -37
  242. package/dist/singleton.mjs +0 -12
  243. package/dist/sleep.d.mts +0 -3
  244. package/dist/sleep.d.ts +0 -3
  245. package/dist/sleep.mjs +0 -7
  246. package/dist/slug.d.mts +0 -3
  247. package/dist/slug.d.ts +0 -3
  248. package/dist/slug.mjs +0 -7
  249. package/dist/text_editor/attach_media.d.mts +0 -16
  250. package/dist/text_editor/attach_media.d.ts +0 -16
  251. package/dist/text_editor/attach_media.js +0 -237
  252. package/dist/text_editor/attach_media.mjs +0 -210
  253. package/dist/text_editor/plugins/drag_and_drop.d.mts +0 -13
  254. package/dist/text_editor/plugins/drag_and_drop.d.ts +0 -13
  255. package/dist/text_editor/plugins/drag_and_drop.js +0 -59
  256. package/dist/text_editor/plugins/drag_and_drop.mjs +0 -34
  257. package/dist/text_editor/plugins/keymap.d.mts +0 -5
  258. package/dist/text_editor/plugins/keymap.d.ts +0 -5
  259. package/dist/text_editor/plugins/keymap.mjs +0 -15
  260. package/dist/text_editor/plugins/placehoder.d.mts +0 -5
  261. package/dist/text_editor/plugins/placehoder.d.ts +0 -5
  262. package/dist/text_editor/plugins/placehoder.js +0 -112
  263. package/dist/text_editor/plugins/placehoder.mjs +0 -87
  264. package/dist/text_editor/plugins/trailing_paragraph.d.mts +0 -5
  265. package/dist/text_editor/plugins/trailing_paragraph.d.ts +0 -5
  266. package/dist/text_editor/plugins/trailing_paragraph.js +0 -46
  267. package/dist/text_editor/plugins/trailing_paragraph.mjs +0 -21
  268. package/dist/text_editor/plugins/upload_placeholder.d.mts +0 -7
  269. package/dist/text_editor/plugins/upload_placeholder.d.ts +0 -7
  270. package/dist/text_editor/plugins/upload_placeholder.js +0 -94
  271. package/dist/text_editor/plugins/upload_placeholder.mjs +0 -68
  272. package/dist/text_editor/schema.d.mts +0 -9
  273. package/dist/text_editor/schema.d.ts +0 -9
  274. package/dist/text_editor/schema.js +0 -354
  275. package/dist/text_editor/schema.mjs +0 -319
  276. package/dist/text_editor/text_editor.d.mts +0 -45
  277. package/dist/text_editor/text_editor.d.ts +0 -45
  278. package/dist/text_editor/text_editor.js +0 -834
  279. package/dist/text_editor/text_editor.mjs +0 -806
@@ -1,203 +0,0 @@
1
- // src/cn.ts
2
- function cn(...classes) {
3
- return classes.filter(Boolean).join(" ").trim();
4
- }
5
-
6
- // src/components/modal/fullscreen_container.tsx
7
- import React from "react";
8
- import {
9
- useEffect,
10
- useRef
11
- } from "react";
12
- function useFullscreen(ref) {
13
- useEffect(() => {
14
- const container = ref.current;
15
- if (!container) {
16
- return;
17
- }
18
- const scroll = () => {
19
- if (scrollY > 0) {
20
- window.scrollTo({
21
- top: 0,
22
- behavior: "instant"
23
- });
24
- }
25
- };
26
- const resize = () => {
27
- if (!visualViewport) {
28
- return;
29
- }
30
- container.classList.remove("bottom-0");
31
- container.style.height = `${visualViewport?.height}px`;
32
- if (visualViewport.height < window.innerHeight) {
33
- window.addEventListener("scroll", scroll);
34
- } else {
35
- window.removeEventListener("scroll", scroll);
36
- }
37
- };
38
- resize();
39
- visualViewport?.addEventListener("resize", resize);
40
- scroll();
41
- return () => {
42
- window.removeEventListener("scroll", scroll);
43
- visualViewport?.removeEventListener("resize", resize);
44
- };
45
- }, [ref]);
46
- return "fixed inset-0";
47
- }
48
-
49
- // src/components/modal/hooks.tsx
50
- import { createContext, useCallback, useEffect as useEffect3, useRef as useRef3, useState } from "react";
51
- import { createPortal } from "react-dom";
52
-
53
- // src/components/modal/modal.tsx
54
- import React2, {
55
- useEffect as useEffect2,
56
- useRef as useRef2
57
- } from "react";
58
- function Modal({
59
- open,
60
- className,
61
- background = "bg-gray-500/25",
62
- onBackgroundClick,
63
- children,
64
- ...props
65
- }) {
66
- const containerRef = useRef2(null);
67
- const fullscreen = useFullscreen(containerRef);
68
- const [mounted, setMounted] = React2.useState(false);
69
- useEffect2(() => {
70
- if (open) {
71
- setMounted(true);
72
- } else {
73
- setTimeout(() => {
74
- setMounted(false);
75
- }, 200);
76
- }
77
- return () => {
78
- };
79
- }, [open]);
80
- const onBackgroundMouseDown = (event) => {
81
- event.preventDefault();
82
- onBackgroundClick?.();
83
- };
84
- const onModalMouseDown = (event) => {
85
- event.stopPropagation();
86
- };
87
- const onBackgroundTouchStart = (event) => {
88
- event.preventDefault();
89
- onBackgroundClick?.();
90
- };
91
- const onModalTouchStart = (event) => {
92
- event.stopPropagation();
93
- };
94
- return /* @__PURE__ */ React2.createElement(
95
- "div",
96
- {
97
- ref: containerRef,
98
- className: cn(
99
- fullscreen,
100
- "z-[999] flex flex-col justify-center transition-bg duration-200 md:px-6 overflow-hidden print:px-0 print:block print:overflow-auto",
101
- open && mounted ? cn(background, "ease-out") : "bg-transparent ease-in pointer-events-none"
102
- ),
103
- onMouseDown: onBackgroundMouseDown,
104
- onTouchStart: onBackgroundTouchStart
105
- },
106
- /* @__PURE__ */ React2.createElement(
107
- "div",
108
- {
109
- className: cn(
110
- "relative flex-1 flex flex-col justify-end md:justify-center items-center transition-[opacity transform] duration-200 print:block",
111
- open && mounted ? "translate-y-[0px] opacity-100 ease-out" : "translate-y-[100%] md:translate-y-[50px] opacity-0 ease-in"
112
- )
113
- },
114
- (open || mounted) && /* @__PURE__ */ React2.createElement(
115
- "div",
116
- {
117
- ...props,
118
- className: cn(
119
- className,
120
- "w-full max-h-[92vh] print:w-[unset] print:max-h-[unset] rounded-tl-lg rounded-tr-lg md:rounded-lg overflow-auto print:rounded-none"
121
- ),
122
- onMouseDown: onModalMouseDown,
123
- onTouchStart: onModalTouchStart
124
- },
125
- children
126
- )
127
- )
128
- );
129
- }
130
-
131
- // src/components/modal/hooks.tsx
132
- import React3 from "react";
133
- function useModalRoot() {
134
- const [container, setContainer] = useState(null);
135
- useEffect3(() => {
136
- const container2 = document.getElementById("modal-root");
137
- if (container2) {
138
- setContainer(container2);
139
- }
140
- return () => {
141
- setContainer(null);
142
- };
143
- }, []);
144
- return container;
145
- }
146
- function useModalPortal() {
147
- const container = useModalRoot();
148
- if (!container) {
149
- return (children) => null;
150
- }
151
- return (children) => {
152
- return createPortal(children, container);
153
- };
154
- }
155
- var ModalContext = createContext({});
156
- function useModal() {
157
- const ch2 = useRef3(
158
- null
159
- );
160
- const open = () => {
161
- ch2.current?.(true);
162
- };
163
- const close = () => {
164
- ch2.current?.(false);
165
- };
166
- const Component = useCallback(
167
- function Component2(props) {
168
- const [isOpen, setIsOpen] = useState(false);
169
- const createPortal2 = useModalPortal();
170
- useEffect3(() => {
171
- ch2.current = (v) => {
172
- setIsOpen(v);
173
- };
174
- return () => {
175
- ch2.current = null;
176
- };
177
- }, []);
178
- useEffect3(() => {
179
- if (isOpen) {
180
- } else {
181
- }
182
- return () => {
183
- };
184
- }, [isOpen]);
185
- return /* @__PURE__ */ React3.createElement(ModalContext.Provider, { value: { open, close, isOpen } }, createPortal2(
186
- /* @__PURE__ */ React3.createElement(Modal, { ...props, open: isOpen, onBackgroundClick: close })
187
- ));
188
- },
189
- []
190
- );
191
- return {
192
- open,
193
- close,
194
- Modal: Component
195
- };
196
- }
197
- export {
198
- ModalContext,
199
- useFullscreen,
200
- useModal,
201
- useModalPortal,
202
- useModalRoot
203
- };
@@ -1,13 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
-
3
- type ModalProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
4
- open: boolean;
5
- children?: ReactNode;
6
- onBackgroundClick?: () => void;
7
- embeded?: boolean;
8
- always?: boolean;
9
- background?: string;
10
- };
11
- declare function Modal({ open, className, background, onBackgroundClick, children, ...props }: ModalProps): React.JSX.Element;
12
-
13
- export { type ModalProps, Modal as default };
@@ -1,13 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
-
3
- type ModalProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
4
- open: boolean;
5
- children?: ReactNode;
6
- onBackgroundClick?: () => void;
7
- embeded?: boolean;
8
- always?: boolean;
9
- background?: string;
10
- };
11
- declare function Modal({ open, className, background, onBackgroundClick, children, ...props }: ModalProps): React.JSX.Element;
12
-
13
- export { type ModalProps, Modal as default };
@@ -1,155 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/components/modal/modal.tsx
31
- var modal_exports = {};
32
- __export(modal_exports, {
33
- default: () => Modal
34
- });
35
- module.exports = __toCommonJS(modal_exports);
36
- var import_react3 = __toESM(require("react"));
37
-
38
- // src/cn.ts
39
- function cn(...classes) {
40
- return classes.filter(Boolean).join(" ").trim();
41
- }
42
-
43
- // src/components/modal/fullscreen_container.tsx
44
- var import_react = __toESM(require("react"));
45
- var import_react2 = require("react");
46
- function useFullscreen(ref) {
47
- (0, import_react2.useEffect)(() => {
48
- const container = ref.current;
49
- if (!container) {
50
- return;
51
- }
52
- const scroll = () => {
53
- if (scrollY > 0) {
54
- window.scrollTo({
55
- top: 0,
56
- behavior: "instant"
57
- });
58
- }
59
- };
60
- const resize = () => {
61
- if (!visualViewport) {
62
- return;
63
- }
64
- container.classList.remove("bottom-0");
65
- container.style.height = `${visualViewport?.height}px`;
66
- if (visualViewport.height < window.innerHeight) {
67
- window.addEventListener("scroll", scroll);
68
- } else {
69
- window.removeEventListener("scroll", scroll);
70
- }
71
- };
72
- resize();
73
- visualViewport?.addEventListener("resize", resize);
74
- scroll();
75
- return () => {
76
- window.removeEventListener("scroll", scroll);
77
- visualViewport?.removeEventListener("resize", resize);
78
- };
79
- }, [ref]);
80
- return "fixed inset-0";
81
- }
82
-
83
- // src/components/modal/modal.tsx
84
- function Modal({
85
- open,
86
- className,
87
- background = "bg-gray-500/25",
88
- onBackgroundClick,
89
- children,
90
- ...props
91
- }) {
92
- const containerRef = (0, import_react3.useRef)(null);
93
- const fullscreen = useFullscreen(containerRef);
94
- const [mounted, setMounted] = import_react3.default.useState(false);
95
- (0, import_react3.useEffect)(() => {
96
- if (open) {
97
- setMounted(true);
98
- } else {
99
- setTimeout(() => {
100
- setMounted(false);
101
- }, 200);
102
- }
103
- return () => {
104
- };
105
- }, [open]);
106
- const onBackgroundMouseDown = (event) => {
107
- event.preventDefault();
108
- onBackgroundClick?.();
109
- };
110
- const onModalMouseDown = (event) => {
111
- event.stopPropagation();
112
- };
113
- const onBackgroundTouchStart = (event) => {
114
- event.preventDefault();
115
- onBackgroundClick?.();
116
- };
117
- const onModalTouchStart = (event) => {
118
- event.stopPropagation();
119
- };
120
- return /* @__PURE__ */ import_react3.default.createElement(
121
- "div",
122
- {
123
- ref: containerRef,
124
- className: cn(
125
- fullscreen,
126
- "z-[999] flex flex-col justify-center transition-bg duration-200 md:px-6 overflow-hidden print:px-0 print:block print:overflow-auto",
127
- open && mounted ? cn(background, "ease-out") : "bg-transparent ease-in pointer-events-none"
128
- ),
129
- onMouseDown: onBackgroundMouseDown,
130
- onTouchStart: onBackgroundTouchStart
131
- },
132
- /* @__PURE__ */ import_react3.default.createElement(
133
- "div",
134
- {
135
- className: cn(
136
- "relative flex-1 flex flex-col justify-end md:justify-center items-center transition-[opacity transform] duration-200 print:block",
137
- open && mounted ? "translate-y-[0px] opacity-100 ease-out" : "translate-y-[100%] md:translate-y-[50px] opacity-0 ease-in"
138
- )
139
- },
140
- (open || mounted) && /* @__PURE__ */ import_react3.default.createElement(
141
- "div",
142
- {
143
- ...props,
144
- className: cn(
145
- className,
146
- "w-full max-h-[92vh] print:w-[unset] print:max-h-[unset] rounded-tl-lg rounded-tr-lg md:rounded-lg overflow-auto print:rounded-none"
147
- ),
148
- onMouseDown: onModalMouseDown,
149
- onTouchStart: onModalTouchStart
150
- },
151
- children
152
- )
153
- )
154
- );
155
- }
@@ -1,130 +0,0 @@
1
- // src/components/modal/modal.tsx
2
- import React2, {
3
- useEffect as useEffect2,
4
- useRef as useRef2
5
- } from "react";
6
-
7
- // src/cn.ts
8
- function cn(...classes) {
9
- return classes.filter(Boolean).join(" ").trim();
10
- }
11
-
12
- // src/components/modal/fullscreen_container.tsx
13
- import React from "react";
14
- import {
15
- useEffect,
16
- useRef
17
- } from "react";
18
- function useFullscreen(ref) {
19
- useEffect(() => {
20
- const container = ref.current;
21
- if (!container) {
22
- return;
23
- }
24
- const scroll = () => {
25
- if (scrollY > 0) {
26
- window.scrollTo({
27
- top: 0,
28
- behavior: "instant"
29
- });
30
- }
31
- };
32
- const resize = () => {
33
- if (!visualViewport) {
34
- return;
35
- }
36
- container.classList.remove("bottom-0");
37
- container.style.height = `${visualViewport?.height}px`;
38
- if (visualViewport.height < window.innerHeight) {
39
- window.addEventListener("scroll", scroll);
40
- } else {
41
- window.removeEventListener("scroll", scroll);
42
- }
43
- };
44
- resize();
45
- visualViewport?.addEventListener("resize", resize);
46
- scroll();
47
- return () => {
48
- window.removeEventListener("scroll", scroll);
49
- visualViewport?.removeEventListener("resize", resize);
50
- };
51
- }, [ref]);
52
- return "fixed inset-0";
53
- }
54
-
55
- // src/components/modal/modal.tsx
56
- function Modal({
57
- open,
58
- className,
59
- background = "bg-gray-500/25",
60
- onBackgroundClick,
61
- children,
62
- ...props
63
- }) {
64
- const containerRef = useRef2(null);
65
- const fullscreen = useFullscreen(containerRef);
66
- const [mounted, setMounted] = React2.useState(false);
67
- useEffect2(() => {
68
- if (open) {
69
- setMounted(true);
70
- } else {
71
- setTimeout(() => {
72
- setMounted(false);
73
- }, 200);
74
- }
75
- return () => {
76
- };
77
- }, [open]);
78
- const onBackgroundMouseDown = (event) => {
79
- event.preventDefault();
80
- onBackgroundClick?.();
81
- };
82
- const onModalMouseDown = (event) => {
83
- event.stopPropagation();
84
- };
85
- const onBackgroundTouchStart = (event) => {
86
- event.preventDefault();
87
- onBackgroundClick?.();
88
- };
89
- const onModalTouchStart = (event) => {
90
- event.stopPropagation();
91
- };
92
- return /* @__PURE__ */ React2.createElement(
93
- "div",
94
- {
95
- ref: containerRef,
96
- className: cn(
97
- fullscreen,
98
- "z-[999] flex flex-col justify-center transition-bg duration-200 md:px-6 overflow-hidden print:px-0 print:block print:overflow-auto",
99
- open && mounted ? cn(background, "ease-out") : "bg-transparent ease-in pointer-events-none"
100
- ),
101
- onMouseDown: onBackgroundMouseDown,
102
- onTouchStart: onBackgroundTouchStart
103
- },
104
- /* @__PURE__ */ React2.createElement(
105
- "div",
106
- {
107
- className: cn(
108
- "relative flex-1 flex flex-col justify-end md:justify-center items-center transition-[opacity transform] duration-200 print:block",
109
- open && mounted ? "translate-y-[0px] opacity-100 ease-out" : "translate-y-[100%] md:translate-y-[50px] opacity-0 ease-in"
110
- )
111
- },
112
- (open || mounted) && /* @__PURE__ */ React2.createElement(
113
- "div",
114
- {
115
- ...props,
116
- className: cn(
117
- className,
118
- "w-full max-h-[92vh] print:w-[unset] print:max-h-[unset] rounded-tl-lg rounded-tr-lg md:rounded-lg overflow-auto print:rounded-none"
119
- ),
120
- onMouseDown: onModalMouseDown,
121
- onTouchStart: onModalTouchStart
122
- },
123
- children
124
- )
125
- )
126
- );
127
- }
128
- export {
129
- Modal as default
130
- };
@@ -1,9 +0,0 @@
1
- declare const inputBackgroundStyle = "text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400";
2
- declare const formInputStyle = "w-full px-3 text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400 h-[40px]";
3
- declare const baseButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden";
4
- declare const primaryButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden px-4 h-[40px] bg-gradient-to-br from-primary-400 to-primary-500 text-white transition-colors";
5
- declare const disabledButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-neutral-200 text-neutral-400";
6
- declare const outlineButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-white border border-neutral-300 hover:bg-neutral-50";
7
- declare const dangerousButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-white border hover:bg-red-50 text-red-600";
8
-
9
- export { baseButtonStyle, dangerousButtonStyle, disabledButtonStyle, formInputStyle, inputBackgroundStyle, outlineButtonStyle, primaryButtonStyle };
@@ -1,9 +0,0 @@
1
- declare const inputBackgroundStyle = "text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400";
2
- declare const formInputStyle = "w-full px-3 text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400 h-[40px]";
3
- declare const baseButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden";
4
- declare const primaryButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden px-4 h-[40px] bg-gradient-to-br from-primary-400 to-primary-500 text-white transition-colors";
5
- declare const disabledButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-neutral-200 text-neutral-400";
6
- declare const outlineButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-white border border-neutral-300 hover:bg-neutral-50";
7
- declare const dangerousButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden h-[40px] px-4 bg-white border hover:bg-red-50 text-red-600";
8
-
9
- export { baseButtonStyle, dangerousButtonStyle, disabledButtonStyle, formInputStyle, inputBackgroundStyle, outlineButtonStyle, primaryButtonStyle };
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/components/styles.ts
21
- var styles_exports = {};
22
- __export(styles_exports, {
23
- baseButtonStyle: () => baseButtonStyle,
24
- dangerousButtonStyle: () => dangerousButtonStyle,
25
- disabledButtonStyle: () => disabledButtonStyle,
26
- formInputStyle: () => formInputStyle,
27
- inputBackgroundStyle: () => inputBackgroundStyle,
28
- outlineButtonStyle: () => outlineButtonStyle,
29
- primaryButtonStyle: () => primaryButtonStyle
30
- });
31
- module.exports = __toCommonJS(styles_exports);
32
- var inputBackgroundStyle = "text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400";
33
- var formInputStyle = `w-full px-3 ${inputBackgroundStyle} h-[40px]`;
34
- var baseButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden";
35
- var primaryButtonStyle = `${baseButtonStyle} px-4 h-[40px] bg-gradient-to-br from-primary-400 to-primary-500 text-white transition-colors`;
36
- var disabledButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-neutral-200 text-neutral-400`;
37
- var outlineButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-white border border-neutral-300 hover:bg-neutral-50`;
38
- var dangerousButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-white border hover:bg-red-50 text-red-600`;
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- baseButtonStyle,
42
- dangerousButtonStyle,
43
- disabledButtonStyle,
44
- formInputStyle,
45
- inputBackgroundStyle,
46
- outlineButtonStyle,
47
- primaryButtonStyle
48
- });
@@ -1,17 +0,0 @@
1
- // src/components/styles.ts
2
- var inputBackgroundStyle = "text-[16px] border border-neutral-200 outline-none appearance-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-neutral-400";
3
- var formInputStyle = `w-full px-3 ${inputBackgroundStyle} h-[40px]`;
4
- var baseButtonStyle = "transition-colors text-sm font-semibold cursor-pointer flex items-center justify-center rounded-lg whitespace-nowrap text-ellipsis overflow-hidden";
5
- var primaryButtonStyle = `${baseButtonStyle} px-4 h-[40px] bg-gradient-to-br from-primary-400 to-primary-500 text-white transition-colors`;
6
- var disabledButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-neutral-200 text-neutral-400`;
7
- var outlineButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-white border border-neutral-300 hover:bg-neutral-50`;
8
- var dangerousButtonStyle = `${baseButtonStyle} h-[40px] px-4 bg-white border hover:bg-red-50 text-red-600`;
9
- export {
10
- baseButtonStyle,
11
- dangerousButtonStyle,
12
- disabledButtonStyle,
13
- formInputStyle,
14
- inputBackgroundStyle,
15
- outlineButtonStyle,
16
- primaryButtonStyle
17
- };
package/dist/date.d.mts DELETED
@@ -1,5 +0,0 @@
1
- export { default as moment } from 'moment-timezone';
2
-
3
- declare const formatHumanDateTime: (value: string | Date) => string;
4
-
5
- export { formatHumanDateTime };
package/dist/date.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { default as moment } from 'moment-timezone';
2
-
3
- declare const formatHumanDateTime: (value: string | Date) => string;
4
-
5
- export { formatHumanDateTime };
package/dist/date.mjs DELETED
@@ -1,29 +0,0 @@
1
- // src/date.ts
2
- import moment from "moment-timezone";
3
- var formatHumanDateTime = (value) => {
4
- const date = moment(value).tz("Asia/Seoul");
5
- const now = moment().tz("Asia/Seoul");
6
- if (date.isAfter(now.clone().subtract(1, "minute"))) {
7
- return "\uBC29\uAE08 \uC804";
8
- }
9
- if (date.isAfter(now.clone().subtract(1, "hour"))) {
10
- const diff = now.diff(date, "minute");
11
- return `${diff}\uBD84 \uC804`;
12
- }
13
- if (date.isAfter(now.clone().subtract(6, "hours"))) {
14
- const diff = now.diff(date, "hour");
15
- return `${diff}\uC2DC\uAC04 \uC804`;
16
- }
17
- if (date.isAfter(now.clone().subtract(1, "week"))) {
18
- const diff = now.diff(date, "day");
19
- return `${diff}\uC77C \uC804`;
20
- }
21
- if (date.isSame(now, "year")) {
22
- return date.format("M\uC6D4 D\uC77C");
23
- }
24
- return date.format("YYYY\uB144 M\uC6D4 D\uC77C");
25
- };
26
- export {
27
- formatHumanDateTime,
28
- moment
29
- };
@@ -1,6 +0,0 @@
1
- type CDN = <T extends string | undefined>(key: T, options?: {
2
- width?: number;
3
- }) => T extends undefined ? T : string;
4
- declare const createCDN: (origin: string) => CDN;
5
-
6
- export { type CDN, createCDN };
@@ -1,6 +0,0 @@
1
- type CDN = <T extends string | undefined>(key: T, options?: {
2
- width?: number;
3
- }) => T extends undefined ? T : string;
4
- declare const createCDN: (origin: string) => CDN;
5
-
6
- export { type CDN, createCDN };
package/dist/file/cdn.mjs DELETED
@@ -1,9 +0,0 @@
1
- // src/file/cdn.ts
2
- var createCDN = (origin) => {
3
- return (key, { width } = {}) => {
4
- return key ? `${origin}/${key}${width ? `?w=${width}` : ""}` : void 0;
5
- };
6
- };
7
- export {
8
- createCDN
9
- };