dn-react-router-toolkit 0.9.0 → 0.9.1

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 (93) hide show
  1. package/dist/api/create_api_handler.d.mts +2 -2
  2. package/dist/api/create_api_handler.d.ts +2 -2
  3. package/dist/api/create_api_handler.js +55 -52
  4. package/dist/api/create_api_handler.mjs +61 -59
  5. package/dist/api/create_handler.d.mts +5 -5
  6. package/dist/api/create_handler.d.ts +5 -5
  7. package/dist/api/create_handler.js +41 -44
  8. package/dist/api/create_handler.mjs +41 -44
  9. package/dist/api/index.d.mts +4 -3
  10. package/dist/api/index.d.ts +4 -3
  11. package/dist/api/index.js +118 -102
  12. package/dist/api/index.mjs +130 -109
  13. package/dist/api/item_api_handler.d.mts +4 -3
  14. package/dist/api/item_api_handler.d.ts +4 -3
  15. package/dist/api/item_api_handler.js +22 -6
  16. package/dist/api/item_api_handler.mjs +28 -6
  17. package/dist/auth/cookie_manager.d.mts +1 -1
  18. package/dist/auth/cookie_manager.d.ts +1 -1
  19. package/dist/auth/index.d.mts +2 -2
  20. package/dist/auth/index.d.ts +2 -2
  21. package/dist/auth/index.js +18 -18
  22. package/dist/auth/index.mjs +18 -18
  23. package/dist/auth/with_auth.d.mts +2 -2
  24. package/dist/auth/with_auth.d.ts +2 -2
  25. package/dist/auth/with_auth.js +18 -18
  26. package/dist/auth/with_auth.mjs +18 -18
  27. package/dist/client/editor.d.mts +2 -2
  28. package/dist/client/editor.d.ts +2 -2
  29. package/dist/client/editor.js +9 -3
  30. package/dist/client/editor.mjs +9 -3
  31. package/dist/client/index.d.mts +2 -2
  32. package/dist/client/index.d.ts +2 -2
  33. package/dist/client/index.js +9 -3
  34. package/dist/client/index.mjs +9 -3
  35. package/dist/crud/crud_form.js +22 -4
  36. package/dist/crud/crud_form.mjs +11 -3
  37. package/dist/crud/crud_form_provider.js +16 -3
  38. package/dist/crud/crud_form_provider.mjs +14 -1
  39. package/dist/crud/index.js +22 -4
  40. package/dist/crud/index.mjs +11 -3
  41. package/dist/db/backup/index.d.mts +1 -1
  42. package/dist/db/backup/index.d.ts +1 -1
  43. package/dist/form/create_form_component.js +21 -2
  44. package/dist/form/create_form_component.mjs +10 -1
  45. package/dist/form/form_components.js +21 -2
  46. package/dist/form/form_components.mjs +10 -1
  47. package/dist/form/index.js +21 -2
  48. package/dist/form/index.mjs +10 -1
  49. package/dist/post/editor_toolbar.js +20 -3
  50. package/dist/post/editor_toolbar.mjs +9 -2
  51. package/dist/post/index.js +31 -11
  52. package/dist/post/index.mjs +19 -9
  53. package/dist/post/post_form_page.js +29 -11
  54. package/dist/post/post_form_page.mjs +17 -9
  55. package/dist/post/thumbnail_picker.js +21 -2
  56. package/dist/post/thumbnail_picker.mjs +10 -1
  57. package/dist/table/buttons.js +11 -14
  58. package/dist/table/buttons.mjs +10 -13
  59. package/dist/table/index.js +14 -18
  60. package/dist/table/index.mjs +13 -17
  61. package/dist/table/table.js +10 -4
  62. package/dist/table/table.mjs +5 -1
  63. package/dist/table/table_form.js +12 -18
  64. package/dist/table/table_form.mjs +9 -15
  65. package/dist/utils/cn.d.mts +3 -0
  66. package/dist/utils/cn.d.ts +3 -0
  67. package/dist/utils/cn.js +32 -0
  68. package/dist/utils/cn.mjs +7 -0
  69. package/dist/utils/date.d.mts +5 -0
  70. package/dist/utils/date.d.ts +5 -0
  71. package/dist/utils/date.js +65 -0
  72. package/dist/utils/date.mjs +29 -0
  73. package/dist/utils/index.d.mts +7 -0
  74. package/dist/utils/index.d.ts +7 -0
  75. package/dist/utils/index.js +116 -0
  76. package/dist/utils/index.mjs +73 -0
  77. package/dist/utils/korean.d.mts +6 -0
  78. package/dist/utils/korean.d.ts +6 -0
  79. package/dist/utils/korean.js +41 -0
  80. package/dist/utils/korean.mjs +16 -0
  81. package/dist/utils/singleton.d.mts +3 -0
  82. package/dist/utils/singleton.d.ts +3 -0
  83. package/dist/utils/singleton.js +37 -0
  84. package/dist/utils/singleton.mjs +12 -0
  85. package/dist/utils/sleep.d.mts +3 -0
  86. package/dist/utils/sleep.d.ts +3 -0
  87. package/dist/utils/sleep.js +32 -0
  88. package/dist/utils/sleep.mjs +7 -0
  89. package/dist/utils/slug.d.mts +3 -0
  90. package/dist/utils/slug.d.ts +3 -0
  91. package/dist/utils/slug.js +32 -0
  92. package/dist/utils/slug.mjs +7 -0
  93. package/package.json +6 -2
@@ -1,10 +1,8 @@
1
1
  // src/post/post_form_page.tsx
2
2
  import { useLoaderData } from "react-router";
3
- import { cn as cn4, toSlug } from "dn-react-toolkit/utils";
4
3
  import { useStoreComponent as useStoreComponent2 } from "react-store-input";
5
4
 
6
5
  // src/post/editor_toolbar.tsx
7
- import { cn } from "dn-react-toolkit/utils";
8
6
  import {
9
7
  GoFileMedia,
10
8
  GoLink,
@@ -147,7 +145,20 @@ function StoreTextEditor({
147
145
  }
148
146
 
149
147
  // src/client/editor.tsx
150
- import { generateMetadata } from "dn-react-toolkit/file/client";
148
+ import { generateMetadata } from "gw-file/client";
149
+
150
+ // src/utils/cn.ts
151
+ function cn(...classes) {
152
+ return classes.filter(Boolean).join(" ").trim();
153
+ }
154
+
155
+ // src/utils/date.ts
156
+ import moment from "moment-timezone";
157
+
158
+ // src/utils/slug.ts
159
+ var toSlug = (str) => {
160
+ return str.toLowerCase().replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ]+/g, "-").replace(/^-|-$/g, "");
161
+ };
151
162
 
152
163
  // src/post/editor_toolbar.tsx
153
164
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -248,7 +259,6 @@ import "dn-react-text-editor";
248
259
 
249
260
  // src/post/thumbnail_picker.tsx
250
261
  import { useSelector } from "react-store-input";
251
- import { cn as cn2 } from "dn-react-toolkit/utils";
252
262
  import { useEffect, useState } from "react";
253
263
  import { jsx as jsx5 } from "react/jsx-runtime";
254
264
  function PostThumbnailPicker({
@@ -292,7 +302,7 @@ function PostThumbnailPicker({
292
302
  "button",
293
303
  {
294
304
  type: "button",
295
- className: cn2(
305
+ className: cn(
296
306
  "border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
297
307
  thumbnail === url && "border-transparent ring-2 ring-primary"
298
308
  ),
@@ -321,18 +331,16 @@ import {
321
331
  createContext,
322
332
  useContext
323
333
  } from "react";
324
- import { Korean } from "dn-react-toolkit/utils";
325
334
  import { jsx as jsx6 } from "react/jsx-runtime";
326
335
  var FormContext = createContext({});
327
336
 
328
337
  // src/form/create_form_component.tsx
329
- import { cn as cn3 } from "dn-react-toolkit/utils";
330
338
  import "react";
331
339
  import { jsx as jsx7 } from "react/jsx-runtime";
332
340
  function createComponent(tag, options) {
333
341
  return function FormComponent({ className, ...props }) {
334
342
  const Tag = tag;
335
- return /* @__PURE__ */ jsx7(Tag, { ...props, className: cn3(options.className, className) });
343
+ return /* @__PURE__ */ jsx7(Tag, { ...props, className: cn(options.className, className) });
336
344
  };
337
345
  }
338
346
 
@@ -538,7 +546,7 @@ var createPostFormPage = ({
538
546
  updateDelay: 500,
539
547
  editor: {
540
548
  attributes: {
541
- class: cn4(textEditorClassName, "pb-[50vh]")
549
+ class: cn(textEditorClassName, "pb-[50vh]")
542
550
  }
543
551
  },
544
552
  attachFile
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
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
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/post/thumbnail_picker.tsx
@@ -24,8 +34,17 @@ __export(thumbnail_picker_exports, {
24
34
  });
25
35
  module.exports = __toCommonJS(thumbnail_picker_exports);
26
36
  var import_react_store_input = require("react-store-input");
27
- var import_utils = require("dn-react-toolkit/utils");
28
37
  var import_react = require("react");
38
+
39
+ // src/utils/cn.ts
40
+ function cn(...classes) {
41
+ return classes.filter(Boolean).join(" ").trim();
42
+ }
43
+
44
+ // src/utils/date.ts
45
+ var import_moment_timezone = __toESM(require("moment-timezone"));
46
+
47
+ // src/post/thumbnail_picker.tsx
29
48
  var import_jsx_runtime = require("react/jsx-runtime");
30
49
  function PostThumbnailPicker({
31
50
  store,
@@ -68,7 +87,7 @@ function PostThumbnailPicker({
68
87
  "button",
69
88
  {
70
89
  type: "button",
71
- className: (0, import_utils.cn)(
90
+ className: cn(
72
91
  "border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
73
92
  thumbnail === url && "border-transparent ring-2 ring-primary"
74
93
  ),
@@ -1,7 +1,16 @@
1
1
  // src/post/thumbnail_picker.tsx
2
2
  import { useSelector } from "react-store-input";
3
- import { cn } from "dn-react-toolkit/utils";
4
3
  import { useEffect, useState } from "react";
4
+
5
+ // src/utils/cn.ts
6
+ function cn(...classes) {
7
+ return classes.filter(Boolean).join(" ").trim();
8
+ }
9
+
10
+ // src/utils/date.ts
11
+ import moment from "moment-timezone";
12
+
13
+ // src/post/thumbnail_picker.tsx
5
14
  import { jsx } from "react/jsx-runtime";
6
15
  function PostThumbnailPicker({
7
16
  store,
@@ -23,8 +23,14 @@ __export(buttons_exports, {
23
23
  TablePageButtons: () => TablePageButtons
24
24
  });
25
25
  module.exports = __toCommonJS(buttons_exports);
26
- var import_utils = require("dn-react-toolkit/utils");
27
26
  var import_react_router = require("react-router");
27
+
28
+ // src/utils/cn.ts
29
+ function cn(...classes) {
30
+ return classes.filter(Boolean).join(" ").trim();
31
+ }
32
+
33
+ // src/table/buttons.tsx
28
34
  var import_jsx_runtime = require("react/jsx-runtime");
29
35
  function TablePageButtons({
30
36
  MAX_PAGES_TO_SHOW,
@@ -43,10 +49,7 @@ function TablePageButtons({
43
49
  import_react_router.Link,
44
50
  {
45
51
  to: (() => {
46
- searchParams.set(
47
- "offset",
48
- String((startButton - 1) * limit)
49
- );
52
+ searchParams.set("offset", String((startButton - 1) * limit));
50
53
  return `${pathname}?${searchParams.toString()}`;
51
54
  })(),
52
55
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -54,10 +57,7 @@ function TablePageButtons({
54
57
  }
55
58
  ),
56
59
  Array.from({
57
- length: Math.min(
58
- MAX_PAGES_TO_SHOW,
59
- pages - startButton
60
- )
60
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
61
61
  }).map((_, index) => {
62
62
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
63
  import_react_router.Link,
@@ -69,7 +69,7 @@ function TablePageButtons({
69
69
  );
70
70
  return `${pathname}?${searchParams.toString()}`;
71
71
  })(),
72
- className: (0, import_utils.cn)(
72
+ className: cn(
73
73
  "w-6 block text-center transition-colors",
74
74
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
75
75
  ),
@@ -82,10 +82,7 @@ function TablePageButtons({
82
82
  import_react_router.Link,
83
83
  {
84
84
  to: (() => {
85
- searchParams.set(
86
- "offset",
87
- String((endButton + 1) * limit)
88
- );
85
+ searchParams.set("offset", String((endButton + 1) * limit));
89
86
  return `${pathname}?${searchParams.toString()}`;
90
87
  })(),
91
88
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -1,6 +1,12 @@
1
1
  // src/table/buttons.tsx
2
- import { cn } from "dn-react-toolkit/utils";
3
2
  import { Link, useLocation, useSearchParams } from "react-router";
3
+
4
+ // src/utils/cn.ts
5
+ function cn(...classes) {
6
+ return classes.filter(Boolean).join(" ").trim();
7
+ }
8
+
9
+ // src/table/buttons.tsx
4
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
11
  function TablePageButtons({
6
12
  MAX_PAGES_TO_SHOW,
@@ -19,10 +25,7 @@ function TablePageButtons({
19
25
  Link,
20
26
  {
21
27
  to: (() => {
22
- searchParams.set(
23
- "offset",
24
- String((startButton - 1) * limit)
25
- );
28
+ searchParams.set("offset", String((startButton - 1) * limit));
26
29
  return `${pathname}?${searchParams.toString()}`;
27
30
  })(),
28
31
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -30,10 +33,7 @@ function TablePageButtons({
30
33
  }
31
34
  ),
32
35
  Array.from({
33
- length: Math.min(
34
- MAX_PAGES_TO_SHOW,
35
- pages - startButton
36
- )
36
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
37
37
  }).map((_, index) => {
38
38
  return /* @__PURE__ */ jsx(
39
39
  Link,
@@ -58,10 +58,7 @@ function TablePageButtons({
58
58
  Link,
59
59
  {
60
60
  to: (() => {
61
- searchParams.set(
62
- "offset",
63
- String((endButton + 1) * limit)
64
- );
61
+ searchParams.set("offset", String((endButton + 1) * limit));
65
62
  return `${pathname}?${searchParams.toString()}`;
66
63
  })(),
67
64
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -84,8 +84,14 @@ var BaseTableRepository = class {
84
84
  };
85
85
 
86
86
  // src/table/buttons.tsx
87
- var import_utils = require("dn-react-toolkit/utils");
88
87
  var import_react_router = require("react-router");
88
+
89
+ // src/utils/cn.ts
90
+ function cn(...classes) {
91
+ return classes.filter(Boolean).join(" ").trim();
92
+ }
93
+
94
+ // src/table/buttons.tsx
89
95
  var import_jsx_runtime = require("react/jsx-runtime");
90
96
  function TablePageButtons({
91
97
  MAX_PAGES_TO_SHOW,
@@ -104,10 +110,7 @@ function TablePageButtons({
104
110
  import_react_router.Link,
105
111
  {
106
112
  to: (() => {
107
- searchParams.set(
108
- "offset",
109
- String((startButton - 1) * limit)
110
- );
113
+ searchParams.set("offset", String((startButton - 1) * limit));
111
114
  return `${pathname}?${searchParams.toString()}`;
112
115
  })(),
113
116
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -115,10 +118,7 @@ function TablePageButtons({
115
118
  }
116
119
  ),
117
120
  Array.from({
118
- length: Math.min(
119
- MAX_PAGES_TO_SHOW,
120
- pages - startButton
121
- )
121
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
122
122
  }).map((_, index) => {
123
123
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
124
  import_react_router.Link,
@@ -130,7 +130,7 @@ function TablePageButtons({
130
130
  );
131
131
  return `${pathname}?${searchParams.toString()}`;
132
132
  })(),
133
- className: (0, import_utils.cn)(
133
+ className: cn(
134
134
  "w-6 block text-center transition-colors",
135
135
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
136
136
  ),
@@ -143,10 +143,7 @@ function TablePageButtons({
143
143
  import_react_router.Link,
144
144
  {
145
145
  to: (() => {
146
- searchParams.set(
147
- "offset",
148
- String((endButton + 1) * limit)
149
- );
146
+ searchParams.set("offset", String((endButton + 1) * limit));
150
147
  return `${pathname}?${searchParams.toString()}`;
151
148
  })(),
152
149
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -234,7 +231,6 @@ function tableLoader({
234
231
  }
235
232
 
236
233
  // src/table/table.tsx
237
- var import_utils2 = require("dn-react-toolkit/utils");
238
234
  var import_go = require("react-icons/go");
239
235
  var import_react_router2 = require("react-router");
240
236
  var import_jsx_runtime2 = require("react/jsx-runtime");
@@ -256,7 +252,7 @@ function Table({
256
252
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
257
253
  "table",
258
254
  {
259
- className: (0, import_utils2.cn)(className, "text-[15px] border-separate border-spacing-0"),
255
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
260
256
  children: [
261
257
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: keys.map((key) => {
262
258
  const value = columns[key];
@@ -272,7 +268,7 @@ function Table({
272
268
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
273
269
  "button",
274
270
  {
275
- className: (0, import_utils2.cn)(
271
+ className: cn(
276
272
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
277
273
  "px-4 flex items-center w-full"
278
274
  ),
@@ -299,7 +295,7 @@ function Table({
299
295
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
300
296
  "th",
301
297
  {
302
- className: (0, import_utils2.cn)("py-4 border-y font-normal align-top"),
298
+ className: cn("py-4 border-y font-normal align-top"),
303
299
  children: [
304
300
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Head, {}),
305
301
  filter && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "px-3 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
@@ -57,8 +57,14 @@ var BaseTableRepository = class {
57
57
  };
58
58
 
59
59
  // src/table/buttons.tsx
60
- import { cn } from "dn-react-toolkit/utils";
61
60
  import { Link, useLocation, useSearchParams } from "react-router";
61
+
62
+ // src/utils/cn.ts
63
+ function cn(...classes) {
64
+ return classes.filter(Boolean).join(" ").trim();
65
+ }
66
+
67
+ // src/table/buttons.tsx
62
68
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
63
69
  function TablePageButtons({
64
70
  MAX_PAGES_TO_SHOW,
@@ -77,10 +83,7 @@ function TablePageButtons({
77
83
  Link,
78
84
  {
79
85
  to: (() => {
80
- searchParams.set(
81
- "offset",
82
- String((startButton - 1) * limit)
83
- );
86
+ searchParams.set("offset", String((startButton - 1) * limit));
84
87
  return `${pathname}?${searchParams.toString()}`;
85
88
  })(),
86
89
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -88,10 +91,7 @@ function TablePageButtons({
88
91
  }
89
92
  ),
90
93
  Array.from({
91
- length: Math.min(
92
- MAX_PAGES_TO_SHOW,
93
- pages - startButton
94
- )
94
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
95
95
  }).map((_, index) => {
96
96
  return /* @__PURE__ */ jsx(
97
97
  Link,
@@ -116,10 +116,7 @@ function TablePageButtons({
116
116
  Link,
117
117
  {
118
118
  to: (() => {
119
- searchParams.set(
120
- "offset",
121
- String((endButton + 1) * limit)
122
- );
119
+ searchParams.set("offset", String((endButton + 1) * limit));
123
120
  return `${pathname}?${searchParams.toString()}`;
124
121
  })(),
125
122
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -211,7 +208,6 @@ function tableLoader({
211
208
  }
212
209
 
213
210
  // src/table/table.tsx
214
- import { cn as cn2 } from "dn-react-toolkit/utils";
215
211
  import { GoArrowDown, GoArrowUp } from "react-icons/go";
216
212
  import { Link as Link2, useSearchParams as useSearchParams2 } from "react-router";
217
213
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -233,7 +229,7 @@ function Table({
233
229
  return /* @__PURE__ */ jsxs2(
234
230
  "table",
235
231
  {
236
- className: cn2(className, "text-[15px] border-separate border-spacing-0"),
232
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
237
233
  children: [
238
234
  /* @__PURE__ */ jsx2("thead", { children: /* @__PURE__ */ jsx2("tr", { children: keys.map((key) => {
239
235
  const value = columns[key];
@@ -249,7 +245,7 @@ function Table({
249
245
  return /* @__PURE__ */ jsxs2(
250
246
  "button",
251
247
  {
252
- className: cn2(
248
+ className: cn(
253
249
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
254
250
  "px-4 flex items-center w-full"
255
251
  ),
@@ -276,7 +272,7 @@ function Table({
276
272
  return /* @__PURE__ */ jsxs2(
277
273
  "th",
278
274
  {
279
- className: cn2("py-4 border-y font-normal align-top"),
275
+ className: cn("py-4 border-y font-normal align-top"),
280
276
  children: [
281
277
  /* @__PURE__ */ jsx2(Head, {}),
282
278
  filter && /* @__PURE__ */ jsx2("div", { className: "px-3 mt-4", children: /* @__PURE__ */ jsxs2(
@@ -23,7 +23,13 @@ __export(table_exports, {
23
23
  Table: () => Table
24
24
  });
25
25
  module.exports = __toCommonJS(table_exports);
26
- var import_utils = require("dn-react-toolkit/utils");
26
+
27
+ // src/utils/cn.ts
28
+ function cn(...classes) {
29
+ return classes.filter(Boolean).join(" ").trim();
30
+ }
31
+
32
+ // src/table/table.tsx
27
33
  var import_go = require("react-icons/go");
28
34
  var import_react_router = require("react-router");
29
35
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -45,7 +51,7 @@ function Table({
45
51
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
46
52
  "table",
47
53
  {
48
- className: (0, import_utils.cn)(className, "text-[15px] border-separate border-spacing-0"),
54
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
49
55
  children: [
50
56
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: keys.map((key) => {
51
57
  const value = columns[key];
@@ -61,7 +67,7 @@ function Table({
61
67
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
62
68
  "button",
63
69
  {
64
- className: (0, import_utils.cn)(
70
+ className: cn(
65
71
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
66
72
  "px-4 flex items-center w-full"
67
73
  ),
@@ -88,7 +94,7 @@ function Table({
88
94
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
89
95
  "th",
90
96
  {
91
- className: (0, import_utils.cn)("py-4 border-y font-normal align-top"),
97
+ className: cn("py-4 border-y font-normal align-top"),
92
98
  children: [
93
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Head, {}),
94
100
  filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -1,5 +1,9 @@
1
+ // src/utils/cn.ts
2
+ function cn(...classes) {
3
+ return classes.filter(Boolean).join(" ").trim();
4
+ }
5
+
1
6
  // src/table/table.tsx
2
- import { cn } from "dn-react-toolkit/utils";
3
7
  import { GoArrowDown, GoArrowUp } from "react-icons/go";
4
8
  import { Link, useSearchParams } from "react-router";
5
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -26,8 +26,12 @@ module.exports = __toCommonJS(table_form_exports);
26
26
  var import_react_router4 = require("react-router");
27
27
  var import_go2 = require("react-icons/go");
28
28
 
29
+ // src/utils/cn.ts
30
+ function cn(...classes) {
31
+ return classes.filter(Boolean).join(" ").trim();
32
+ }
33
+
29
34
  // src/table/table.tsx
30
- var import_utils = require("dn-react-toolkit/utils");
31
35
  var import_go = require("react-icons/go");
32
36
  var import_react_router = require("react-router");
33
37
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -49,7 +53,7 @@ function Table({
49
53
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
50
54
  "table",
51
55
  {
52
- className: (0, import_utils.cn)(className, "text-[15px] border-separate border-spacing-0"),
56
+ className: cn(className, "text-[15px] border-separate border-spacing-0"),
53
57
  children: [
54
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: keys.map((key) => {
55
59
  const value = columns[key];
@@ -65,7 +69,7 @@ function Table({
65
69
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
70
  "button",
67
71
  {
68
- className: (0, import_utils.cn)(
72
+ className: cn(
69
73
  orderBy === key ? "text-gray-900 font-medium" : "text-gray-500 font-medium",
70
74
  "px-4 flex items-center w-full"
71
75
  ),
@@ -92,7 +96,7 @@ function Table({
92
96
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
93
97
  "th",
94
98
  {
95
- className: (0, import_utils.cn)("py-4 border-y font-normal align-top"),
99
+ className: cn("py-4 border-y font-normal align-top"),
96
100
  children: [
97
101
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Head, {}),
98
102
  filter && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -169,7 +173,6 @@ function useTable() {
169
173
  }
170
174
 
171
175
  // src/table/buttons.tsx
172
- var import_utils2 = require("dn-react-toolkit/utils");
173
176
  var import_react_router3 = require("react-router");
174
177
  var import_jsx_runtime2 = require("react/jsx-runtime");
175
178
  function TablePageButtons({
@@ -189,10 +192,7 @@ function TablePageButtons({
189
192
  import_react_router3.Link,
190
193
  {
191
194
  to: (() => {
192
- searchParams.set(
193
- "offset",
194
- String((startButton - 1) * limit)
195
- );
195
+ searchParams.set("offset", String((startButton - 1) * limit));
196
196
  return `${pathname}?${searchParams.toString()}`;
197
197
  })(),
198
198
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -200,10 +200,7 @@ function TablePageButtons({
200
200
  }
201
201
  ),
202
202
  Array.from({
203
- length: Math.min(
204
- MAX_PAGES_TO_SHOW,
205
- pages - startButton
206
- )
203
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
207
204
  }).map((_, index) => {
208
205
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
209
206
  import_react_router3.Link,
@@ -215,7 +212,7 @@ function TablePageButtons({
215
212
  );
216
213
  return `${pathname}?${searchParams.toString()}`;
217
214
  })(),
218
- className: (0, import_utils2.cn)(
215
+ className: cn(
219
216
  "w-6 block text-center transition-colors",
220
217
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
221
218
  ),
@@ -228,10 +225,7 @@ function TablePageButtons({
228
225
  import_react_router3.Link,
229
226
  {
230
227
  to: (() => {
231
- searchParams.set(
232
- "offset",
233
- String((endButton + 1) * limit)
234
- );
228
+ searchParams.set("offset", String((endButton + 1) * limit));
235
229
  return `${pathname}?${searchParams.toString()}`;
236
230
  })(),
237
231
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -2,8 +2,12 @@
2
2
  import { useLocation as useLocation2, useNavigate, useSearchParams as useSearchParams3 } from "react-router";
3
3
  import { GoSearch } from "react-icons/go";
4
4
 
5
+ // src/utils/cn.ts
6
+ function cn(...classes) {
7
+ return classes.filter(Boolean).join(" ").trim();
8
+ }
9
+
5
10
  // src/table/table.tsx
6
- import { cn } from "dn-react-toolkit/utils";
7
11
  import { GoArrowDown, GoArrowUp } from "react-icons/go";
8
12
  import { Link, useSearchParams } from "react-router";
9
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -145,7 +149,6 @@ function useTable() {
145
149
  }
146
150
 
147
151
  // src/table/buttons.tsx
148
- import { cn as cn2 } from "dn-react-toolkit/utils";
149
152
  import { Link as Link2, useLocation, useSearchParams as useSearchParams2 } from "react-router";
150
153
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
151
154
  function TablePageButtons({
@@ -165,10 +168,7 @@ function TablePageButtons({
165
168
  Link2,
166
169
  {
167
170
  to: (() => {
168
- searchParams.set(
169
- "offset",
170
- String((startButton - 1) * limit)
171
- );
171
+ searchParams.set("offset", String((startButton - 1) * limit));
172
172
  return `${pathname}?${searchParams.toString()}`;
173
173
  })(),
174
174
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -176,10 +176,7 @@ function TablePageButtons({
176
176
  }
177
177
  ),
178
178
  Array.from({
179
- length: Math.min(
180
- MAX_PAGES_TO_SHOW,
181
- pages - startButton
182
- )
179
+ length: Math.min(MAX_PAGES_TO_SHOW, pages - startButton)
183
180
  }).map((_, index) => {
184
181
  return /* @__PURE__ */ jsx2(
185
182
  Link2,
@@ -191,7 +188,7 @@ function TablePageButtons({
191
188
  );
192
189
  return `${pathname}?${searchParams.toString()}`;
193
190
  })(),
194
- className: cn2(
191
+ className: cn(
195
192
  "w-6 block text-center transition-colors",
196
193
  currentPage === startButton + index + 1 ? "font-bold text-primary" : "hover:text-primary"
197
194
  ),
@@ -204,10 +201,7 @@ function TablePageButtons({
204
201
  Link2,
205
202
  {
206
203
  to: (() => {
207
- searchParams.set(
208
- "offset",
209
- String((endButton + 1) * limit)
210
- );
204
+ searchParams.set("offset", String((endButton + 1) * limit));
211
205
  return `${pathname}?${searchParams.toString()}`;
212
206
  })(),
213
207
  className: "w-10 block text-center transition-colors hover:text-primary",
@@ -0,0 +1,3 @@
1
+ declare function cn(...classes: (string | false | undefined)[]): string;
2
+
3
+ export { cn };
@@ -0,0 +1,3 @@
1
+ declare function cn(...classes: (string | false | undefined)[]): string;
2
+
3
+ export { cn };