@fabio.caffarello/react-design-system 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/index.cjs +4 -4
  2. package/dist/index.js +696 -246
  3. package/dist/ui/atoms/ErrorMessage/ErrorMessage.d.ts +18 -0
  4. package/dist/ui/atoms/ErrorMessage/ErrorMessage.stories.d.ts +7 -0
  5. package/dist/ui/atoms/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  6. package/dist/ui/atoms/Label/Label.d.ts +20 -0
  7. package/dist/ui/atoms/Label/Label.stories.d.ts +8 -0
  8. package/dist/ui/atoms/Label/Label.test.d.ts +1 -0
  9. package/dist/ui/atoms/NavLink/NavLink.d.ts +20 -0
  10. package/dist/ui/atoms/NavLink/NavLink.stories.d.ts +8 -0
  11. package/dist/ui/atoms/NavLink/NavLink.test.d.ts +1 -0
  12. package/dist/ui/atoms/index.d.ts +3 -0
  13. package/dist/ui/molecules/Breadcrumb/Breadcrumb.d.ts +28 -0
  14. package/dist/ui/molecules/Breadcrumb/Breadcrumb.stories.d.ts +9 -0
  15. package/dist/ui/molecules/Breadcrumb/Breadcrumb.test.d.ts +1 -0
  16. package/dist/ui/molecules/Form/Form.d.ts +24 -0
  17. package/dist/ui/molecules/Form/Form.stories.d.ts +9 -0
  18. package/dist/ui/molecules/Form/Form.test.d.ts +1 -0
  19. package/dist/ui/molecules/Pagination/Pagination.d.ts +28 -0
  20. package/dist/ui/molecules/Pagination/Pagination.stories.d.ts +10 -0
  21. package/dist/ui/molecules/Pagination/Pagination.test.d.ts +1 -0
  22. package/dist/ui/molecules/index.d.ts +4 -0
  23. package/dist/ui/organisms/Modal/Modal.d.ts +25 -0
  24. package/dist/ui/organisms/Modal/Modal.stories.d.ts +9 -0
  25. package/dist/ui/organisms/Modal/Modal.test.d.ts +1 -0
  26. package/dist/ui/organisms/Table/Table.d.ts +35 -0
  27. package/dist/ui/organisms/Table/Table.stories.d.ts +9 -0
  28. package/dist/ui/organisms/Table/Table.test.d.ts +1 -0
  29. package/dist/ui/organisms/index.d.ts +3 -0
  30. package/package.json +1 -1
  31. package/src/ui/atoms/ErrorMessage/ErrorMessage.stories.tsx +81 -0
  32. package/src/ui/atoms/ErrorMessage/ErrorMessage.test.tsx +40 -0
  33. package/src/ui/atoms/ErrorMessage/ErrorMessage.tsx +62 -0
  34. package/src/ui/atoms/Label/Label.stories.tsx +94 -0
  35. package/src/ui/atoms/Label/Label.test.tsx +47 -0
  36. package/src/ui/atoms/Label/Label.tsx +51 -0
  37. package/src/ui/atoms/NavLink/NavLink.stories.tsx +71 -0
  38. package/src/ui/atoms/NavLink/NavLink.test.tsx +44 -0
  39. package/src/ui/atoms/NavLink/NavLink.tsx +63 -0
  40. package/src/ui/atoms/index.ts +6 -0
  41. package/src/ui/molecules/Breadcrumb/Breadcrumb.stories.tsx +75 -0
  42. package/src/ui/molecules/Breadcrumb/Breadcrumb.test.tsx +89 -0
  43. package/src/ui/molecules/Breadcrumb/Breadcrumb.tsx +79 -0
  44. package/src/ui/molecules/Form/Form.stories.tsx +195 -0
  45. package/src/ui/molecules/Form/Form.test.tsx +87 -0
  46. package/src/ui/molecules/Form/Form.tsx +76 -0
  47. package/src/ui/molecules/Pagination/Pagination.stories.tsx +116 -0
  48. package/src/ui/molecules/Pagination/Pagination.test.tsx +112 -0
  49. package/src/ui/molecules/Pagination/Pagination.tsx +168 -0
  50. package/src/ui/molecules/index.ts +7 -0
  51. package/src/ui/organisms/Modal/Modal.stories.tsx +102 -0
  52. package/src/ui/organisms/Modal/Modal.test.tsx +111 -0
  53. package/src/ui/organisms/Modal/Modal.tsx +203 -0
  54. package/src/ui/organisms/Table/Table.stories.tsx +137 -0
  55. package/src/ui/organisms/Table/Table.test.tsx +109 -0
  56. package/src/ui/organisms/Table/Table.tsx +128 -0
  57. package/src/ui/organisms/index.ts +5 -0
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
- import te from "react";
2
- var _ = { exports: {} }, p = {};
1
+ import ae, { useRef as P, useEffect as V } from "react";
2
+ import { createPortal as ne } from "react-dom";
3
+ var S = { exports: {} }, _ = {};
3
4
  /**
4
5
  * @license React
5
6
  * react-jsx-runtime.production.js
@@ -9,29 +10,29 @@ var _ = { exports: {} }, p = {};
9
10
  * This source code is licensed under the MIT license found in the
10
11
  * LICENSE file in the root directory of this source tree.
11
12
  */
12
- var F;
13
- function ae() {
14
- if (F) return p;
15
- F = 1;
16
- var t = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
17
- function a(n, s, i) {
18
- var b = null;
19
- if (i !== void 0 && (b = "" + i), s.key !== void 0 && (b = "" + s.key), "key" in s) {
20
- i = {};
21
- for (var f in s)
22
- f !== "key" && (i[f] = s[f]);
23
- } else i = s;
24
- return s = i.ref, {
25
- $$typeof: t,
13
+ var q;
14
+ function le() {
15
+ if (q) return _;
16
+ q = 1;
17
+ var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
18
+ function a(n, l, o) {
19
+ var c = null;
20
+ if (o !== void 0 && (c = "" + o), l.key !== void 0 && (c = "" + l.key), "key" in l) {
21
+ o = {};
22
+ for (var u in l)
23
+ u !== "key" && (o[u] = l[u]);
24
+ } else o = l;
25
+ return l = o.ref, {
26
+ $$typeof: s,
26
27
  type: n,
27
- key: b,
28
- ref: s !== void 0 ? s : null,
29
- props: i
28
+ key: c,
29
+ ref: l !== void 0 ? l : null,
30
+ props: o
30
31
  };
31
32
  }
32
- return p.Fragment = o, p.jsx = a, p.jsxs = a, p;
33
+ return _.Fragment = t, _.jsx = a, _.jsxs = a, _;
33
34
  }
34
- var x = {};
35
+ var R = {};
35
36
  /**
36
37
  * @license React
37
38
  * react-jsx-runtime.development.js
@@ -41,124 +42,124 @@ var x = {};
41
42
  * This source code is licensed under the MIT license found in the
42
43
  * LICENSE file in the root directory of this source tree.
43
44
  */
44
- var D;
45
- function ne() {
46
- return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
47
- function t(e) {
45
+ var U;
46
+ function oe() {
47
+ return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
48
+ function s(e) {
48
49
  if (e == null) return null;
49
50
  if (typeof e == "function")
50
- return e.$$typeof === K ? null : e.displayName || e.name || null;
51
+ return e.$$typeof === re ? null : e.displayName || e.name || null;
51
52
  if (typeof e == "string") return e;
52
53
  switch (e) {
53
- case E:
54
+ case d:
54
55
  return "Fragment";
55
- case q:
56
+ case f:
56
57
  return "Profiler";
57
- case U:
58
+ case w:
58
59
  return "StrictMode";
59
- case X:
60
+ case Z:
60
61
  return "Suspense";
61
- case H:
62
- return "SuspenseList";
63
62
  case Q:
63
+ return "SuspenseList";
64
+ case ee:
64
65
  return "Activity";
65
66
  }
66
67
  if (typeof e == "object")
67
68
  switch (typeof e.tag == "number" && console.error(
68
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
70
  ), e.$$typeof) {
70
- case B:
71
+ case N:
71
72
  return "Portal";
72
- case V:
73
+ case X:
73
74
  return e.displayName || "Context";
74
- case J:
75
+ case T:
75
76
  return (e._context.displayName || "Context") + ".Consumer";
76
- case G:
77
- var r = e.render;
78
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case Z:
80
- return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
81
- case R:
82
- r = e._payload, e = e._init;
77
+ case H:
78
+ var i = e.render;
79
+ return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
+ case K:
81
+ return i = e.displayName || null, i !== null ? i : s(e.type) || "Memo";
82
+ case O:
83
+ i = e._payload, e = e._init;
83
84
  try {
84
- return t(e(r));
85
+ return s(e(i));
85
86
  } catch {
86
87
  }
87
88
  }
88
89
  return null;
89
90
  }
90
- function o(e) {
91
+ function t(e) {
91
92
  return "" + e;
92
93
  }
93
94
  function a(e) {
94
95
  try {
95
- o(e);
96
- var r = !1;
96
+ t(e);
97
+ var i = !1;
97
98
  } catch {
98
- r = !0;
99
+ i = !0;
99
100
  }
100
- if (r) {
101
- r = console;
102
- var l = r.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
- return l.call(
104
- r,
101
+ if (i) {
102
+ i = console;
103
+ var b = i.error, p = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
104
+ return b.call(
105
+ i,
105
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- c
107
- ), o(e);
107
+ p
108
+ ), t(e);
108
109
  }
109
110
  }
110
111
  function n(e) {
111
- if (e === E) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === R)
112
+ if (e === d) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === O)
113
114
  return "<...>";
114
115
  try {
115
- var r = t(e);
116
- return r ? "<" + r + ">" : "<...>";
116
+ var i = s(e);
117
+ return i ? "<" + i + ">" : "<...>";
117
118
  } catch {
118
119
  return "<...>";
119
120
  }
120
121
  }
121
- function s() {
122
- var e = j.A;
122
+ function l() {
123
+ var e = L.A;
123
124
  return e === null ? null : e.getOwner();
124
125
  }
125
- function i() {
126
+ function o() {
126
127
  return Error("react-stack-top-frame");
127
128
  }
128
- function b(e) {
129
- if (A.call(e, "key")) {
130
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
131
- if (r && r.isReactWarning) return !1;
129
+ function c(e) {
130
+ if (M.call(e, "key")) {
131
+ var i = Object.getOwnPropertyDescriptor(e, "key").get;
132
+ if (i && i.isReactWarning) return !1;
132
133
  }
133
134
  return e.key !== void 0;
134
135
  }
135
- function f(e, r) {
136
- function l() {
137
- P || (P = !0, console.error(
136
+ function u(e, i) {
137
+ function b() {
138
+ z || (z = !0, console.error(
138
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
- r
140
+ i
140
141
  ));
141
142
  }
142
- l.isReactWarning = !0, Object.defineProperty(e, "key", {
143
- get: l,
143
+ b.isReactWarning = !0, Object.defineProperty(e, "key", {
144
+ get: b,
144
145
  configurable: !0
145
146
  });
146
147
  }
147
148
  function m() {
148
- var e = t(this.type);
149
- return C[e] || (C[e] = !0, console.error(
149
+ var e = s(this.type);
150
+ return I[e] || (I[e] = !0, console.error(
150
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
152
  )), e = this.props.ref, e !== void 0 ? e : null;
152
153
  }
153
- function M(e, r, l, c, h, T) {
154
- var d = l.ref;
154
+ function j(e, i, b, p, C, B) {
155
+ var h = b.ref;
155
156
  return e = {
156
- $$typeof: O,
157
+ $$typeof: v,
157
158
  type: e,
158
- key: r,
159
- props: l,
160
- _owner: c
161
- }, (d !== void 0 ? d : null) !== null ? Object.defineProperty(e, "ref", {
159
+ key: i,
160
+ props: b,
161
+ _owner: p
162
+ }, (h !== void 0 ? h : null) !== null ? Object.defineProperty(e, "ref", {
162
163
  enumerable: !1,
163
164
  get: m
164
165
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
@@ -175,111 +176,111 @@ function ne() {
175
176
  configurable: !1,
176
177
  enumerable: !1,
177
178
  writable: !0,
178
- value: h
179
+ value: C
179
180
  }), Object.defineProperty(e, "_debugTask", {
180
181
  configurable: !1,
181
182
  enumerable: !1,
182
183
  writable: !0,
183
- value: T
184
+ value: B
184
185
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
186
  }
186
- function w(e, r, l, c, h, T) {
187
- var d = r.children;
188
- if (d !== void 0)
189
- if (c)
190
- if (ee(d)) {
191
- for (c = 0; c < d.length; c++)
192
- N(d[c]);
193
- Object.freeze && Object.freeze(d);
187
+ function g(e, i, b, p, C, B) {
188
+ var h = i.children;
189
+ if (h !== void 0)
190
+ if (p)
191
+ if (se(h)) {
192
+ for (p = 0; p < h.length; p++)
193
+ k(h[p]);
194
+ Object.freeze && Object.freeze(h);
194
195
  } else
195
196
  console.error(
196
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
198
  );
198
- else N(d);
199
- if (A.call(r, "key")) {
200
- d = t(e);
201
- var g = Object.keys(r).filter(function(re) {
202
- return re !== "key";
199
+ else k(h);
200
+ if (M.call(i, "key")) {
201
+ h = s(e);
202
+ var E = Object.keys(i).filter(function(te) {
203
+ return te !== "key";
203
204
  });
204
- c = 0 < g.length ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}", I[d + c] || (g = 0 < g.length ? "{" + g.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ p = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", W[h + p] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
205
206
  `A props object containing a "key" prop is being spread into JSX:
206
207
  let props = %s;
207
208
  <%s {...props} />
208
209
  React keys must be passed directly to JSX without using spread:
209
210
  let props = %s;
210
211
  <%s key={someKey} {...props} />`,
211
- c,
212
- d,
213
- g,
214
- d
215
- ), I[d + c] = !0);
212
+ p,
213
+ h,
214
+ E,
215
+ h
216
+ ), W[h + p] = !0);
216
217
  }
217
- if (d = null, l !== void 0 && (a(l), d = "" + l), b(r) && (a(r.key), d = "" + r.key), "key" in r) {
218
- l = {};
219
- for (var k in r)
220
- k !== "key" && (l[k] = r[k]);
221
- } else l = r;
222
- return d && f(
223
- l,
218
+ if (h = null, b !== void 0 && (a(b), h = "" + b), c(i) && (a(i.key), h = "" + i.key), "key" in i) {
219
+ b = {};
220
+ for (var Y in i)
221
+ Y !== "key" && (b[Y] = i[Y]);
222
+ } else b = i;
223
+ return h && u(
224
+ b,
224
225
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), M(
226
+ ), j(
226
227
  e,
227
- d,
228
- l,
229
- s(),
230
228
  h,
231
- T
229
+ b,
230
+ l(),
231
+ C,
232
+ B
232
233
  );
233
234
  }
234
- function N(e) {
235
- S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === R && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
235
+ function k(e) {
236
+ x(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? x(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
237
  }
237
- function S(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === O;
238
+ function x(e) {
239
+ return typeof e == "object" && e !== null && e.$$typeof === v;
239
240
  }
240
- var v = te, O = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), Q = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), j = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, ee = Array.isArray, y = console.createTask ? console.createTask : function() {
241
+ var y = ae, v = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), X = Symbol.for("react.context"), H = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), L = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, se = Array.isArray, $ = console.createTask ? console.createTask : function() {
241
242
  return null;
242
243
  };
243
- v = {
244
+ y = {
244
245
  react_stack_bottom_frame: function(e) {
245
246
  return e();
246
247
  }
247
248
  };
248
- var P, C = {}, Y = v.react_stack_bottom_frame.bind(
249
- v,
250
- i
251
- )(), $ = y(n(i)), I = {};
252
- x.Fragment = E, x.jsx = function(e, r, l) {
253
- var c = 1e4 > j.recentlyCreatedOwnerStacks++;
254
- return w(
249
+ var z, I = {}, F = y.react_stack_bottom_frame.bind(
250
+ y,
251
+ o
252
+ )(), D = $(n(o)), W = {};
253
+ R.Fragment = d, R.jsx = function(e, i, b) {
254
+ var p = 1e4 > L.recentlyCreatedOwnerStacks++;
255
+ return g(
255
256
  e,
256
- r,
257
- l,
257
+ i,
258
+ b,
258
259
  !1,
259
- c ? Error("react-stack-top-frame") : Y,
260
- c ? y(n(e)) : $
260
+ p ? Error("react-stack-top-frame") : F,
261
+ p ? $(n(e)) : D
261
262
  );
262
- }, x.jsxs = function(e, r, l) {
263
- var c = 1e4 > j.recentlyCreatedOwnerStacks++;
264
- return w(
263
+ }, R.jsxs = function(e, i, b) {
264
+ var p = 1e4 > L.recentlyCreatedOwnerStacks++;
265
+ return g(
265
266
  e,
266
- r,
267
- l,
267
+ i,
268
+ b,
268
269
  !0,
269
- c ? Error("react-stack-top-frame") : Y,
270
- c ? y(n(e)) : $
270
+ p ? Error("react-stack-top-frame") : F,
271
+ p ? $(n(e)) : D
271
272
  );
272
273
  };
273
- })()), x;
274
+ })()), R;
274
275
  }
275
- var L;
276
- function oe() {
277
- return L || (L = 1, process.env.NODE_ENV === "production" ? _.exports = ae() : _.exports = ne()), _.exports;
276
+ var J;
277
+ function ie() {
278
+ return J || (J = 1, process.env.NODE_ENV === "production" ? S.exports = le() : S.exports = oe()), S.exports;
278
279
  }
279
- var u = oe();
280
- function ce({ variant: t = "info", className: o, ...a }) {
281
- const n = [o || ""];
282
- switch (t) {
280
+ var r = ie();
281
+ function xe({ variant: s = "info", className: t, ...a }) {
282
+ const n = [t || ""];
283
+ switch (s) {
283
284
  case "warning": {
284
285
  n.push("bg-yellow-100 text-yellow-800 border-yellow-500");
285
286
  break;
@@ -294,7 +295,7 @@ function ce({ variant: t = "info", className: o, ...a }) {
294
295
  break;
295
296
  }
296
297
  }
297
- return /* @__PURE__ */ u.jsx(
298
+ return /* @__PURE__ */ r.jsx(
298
299
  "div",
299
300
  {
300
301
  role: "alert",
@@ -303,21 +304,21 @@ function ce({ variant: t = "info", className: o, ...a }) {
303
304
  }
304
305
  );
305
306
  }
306
- function se({
307
- variant: t,
308
- bold: o,
307
+ function ce({
308
+ variant: s,
309
+ bold: t,
309
310
  italic: a,
310
311
  className: n,
311
- as: s,
312
- color: i,
313
- ...b
312
+ as: l,
313
+ color: o,
314
+ ...c
314
315
  }) {
315
- const f = [n];
316
+ const u = [n];
316
317
  let m;
317
- if (s)
318
- m = s;
318
+ if (l)
319
+ m = l;
319
320
  else
320
- switch (t) {
321
+ switch (s) {
321
322
  case "heading":
322
323
  m = "h2";
323
324
  break;
@@ -329,11 +330,11 @@ function se({
329
330
  m = "p";
330
331
  break;
331
332
  }
332
- return o && f.push("font-bold"), a && f.push("italic"), i && f.push(`text-${i}`), /* @__PURE__ */ u.jsx(m, { className: f.join(" "), ...b });
333
+ return t && u.push("font-bold"), a && u.push("italic"), o && u.push(`text-${o}`), /* @__PURE__ */ r.jsx(m, { className: u.join(" "), ...c });
333
334
  }
334
- function le({ className: t, ...o }) {
335
+ function de({ className: s, ...t }) {
335
336
  const a = [
336
- t,
337
+ s,
337
338
  "px-large",
338
339
  "border",
339
340
  "border-1",
@@ -343,22 +344,22 @@ function le({ className: t, ...o }) {
343
344
  "h-form-element",
344
345
  "text-base"
345
346
  ];
346
- return /* @__PURE__ */ u.jsx("input", { className: a.join(" "), ...o });
347
+ return /* @__PURE__ */ r.jsx("input", { className: a.join(" "), ...t });
347
348
  }
348
- function W({
349
- className: t,
350
- variant: o = "regular",
349
+ function A({
350
+ className: s,
351
+ variant: t = "regular",
351
352
  ...a
352
353
  }) {
353
354
  const n = [
354
- t,
355
+ s,
355
356
  "rounded",
356
357
  "h-form-element",
357
358
  "lh-form-element",
358
359
  "px-large",
359
360
  "text-base"
360
361
  ];
361
- switch (o) {
362
+ switch (t) {
362
363
  case "error":
363
364
  n.push("bg-red-light", "text-red-dark", "font-bold");
364
365
  break;
@@ -370,19 +371,19 @@ function W({
370
371
  n.push("bg-blue-light", "text-blue-dark", "font-bold");
371
372
  break;
372
373
  }
373
- return /* @__PURE__ */ u.jsx("button", { className: n.join(" "), ...a });
374
+ return /* @__PURE__ */ r.jsx("button", { className: n.join(" "), ...a });
374
375
  }
375
- function ie({ className: t, ...o }) {
376
- const a = [t, "p-large", "bg-bg", "rounded", "shadow-card"];
377
- return /* @__PURE__ */ u.jsx("div", { className: a.join(" "), ...o });
376
+ function ue({ className: s, ...t }) {
377
+ const a = [s, "p-large", "bg-bg", "rounded", "shadow-card"];
378
+ return /* @__PURE__ */ r.jsx("div", { className: a.join(" "), ...t });
378
379
  }
379
- function de({
380
- variant: t = "neutral",
381
- className: o = "",
380
+ function pe({
381
+ variant: s = "neutral",
382
+ className: t = "",
382
383
  children: a,
383
384
  ...n
384
385
  }) {
385
- const s = [
386
+ const l = [
386
387
  "inline-flex",
387
388
  "items-center",
388
389
  "px-2",
@@ -391,36 +392,36 @@ function de({
391
392
  "text-xs",
392
393
  "font-medium",
393
394
  "border"
394
- ], i = {
395
+ ], o = {
395
396
  success: "bg-green-100 text-green-800 border-green-500",
396
397
  warning: "bg-yellow-100 text-yellow-800 border-yellow-500",
397
398
  error: "bg-red-100 text-red-800 border-red-500",
398
399
  info: "bg-blue-100 text-blue-800 border-blue-500",
399
400
  neutral: "bg-gray-100 text-gray-800 border-gray-500"
400
- }, b = [
401
- ...s,
402
- i[t],
403
- o
401
+ }, c = [
402
+ ...l,
403
+ o[s],
404
+ t
404
405
  ].filter(Boolean).join(" ");
405
- return /* @__PURE__ */ u.jsx(
406
+ return /* @__PURE__ */ r.jsx(
406
407
  "span",
407
408
  {
408
409
  role: "status",
409
410
  "aria-label": typeof a == "string" ? a : void 0,
410
- className: b,
411
+ className: c,
411
412
  ...n,
412
413
  children: a
413
414
  }
414
415
  );
415
416
  }
416
- function fe({
417
- options: t,
418
- placeholder: o,
417
+ function he({
418
+ options: s,
419
+ placeholder: t,
419
420
  error: a = !1,
420
421
  className: n = "",
421
- ...s
422
+ ...l
422
423
  }) {
423
- const i = [
424
+ const o = [
424
425
  "block",
425
426
  "w-full",
426
427
  "rounded",
@@ -431,21 +432,21 @@ function fe({
431
432
  "focus:outline-none",
432
433
  "focus:ring-2",
433
434
  "focus:ring-offset-2"
434
- ], b = a ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", f = [
435
- ...i,
436
- b,
435
+ ], c = a ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", u = [
436
+ ...o,
437
+ c,
437
438
  n
438
439
  ].filter(Boolean).join(" ");
439
- return /* @__PURE__ */ u.jsxs(
440
+ return /* @__PURE__ */ r.jsxs(
440
441
  "select",
441
442
  {
442
- className: f,
443
+ className: u,
443
444
  "aria-invalid": a,
444
- "aria-describedby": a ? `${s.id}-error` : void 0,
445
- ...s,
445
+ "aria-describedby": a ? `${l.id}-error` : void 0,
446
+ ...l,
446
447
  children: [
447
- o && /* @__PURE__ */ u.jsx("option", { value: "", disabled: !0, children: o }),
448
- t.map((m) => /* @__PURE__ */ u.jsx(
448
+ t && /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, children: t }),
449
+ s.map((m) => /* @__PURE__ */ r.jsx(
449
450
  "option",
450
451
  {
451
452
  value: m.value,
@@ -458,13 +459,13 @@ function fe({
458
459
  }
459
460
  );
460
461
  }
461
- function be({
462
- error: t = !1,
463
- resize: o = "vertical",
462
+ function ve({
463
+ error: s = !1,
464
+ resize: t = "vertical",
464
465
  className: a = "",
465
466
  ...n
466
467
  }) {
467
- const s = [
468
+ const l = [
468
469
  "block",
469
470
  "w-full",
470
471
  "rounded",
@@ -475,69 +476,330 @@ function be({
475
476
  "focus:outline-none",
476
477
  "focus:ring-2",
477
478
  "focus:ring-offset-2"
478
- ], i = {
479
+ ], o = {
479
480
  none: "resize-none",
480
481
  both: "resize",
481
482
  horizontal: "resize-x",
482
483
  vertical: "resize-y"
483
- }, b = t ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", f = [
484
- ...s,
485
- i[o],
486
- b,
484
+ }, c = s ? "border-red-500 focus:ring-red-500" : "border-gray-300 focus:ring-indigo-500", u = [
485
+ ...l,
486
+ o[t],
487
+ c,
487
488
  a
488
489
  ].filter(Boolean).join(" ");
489
- return /* @__PURE__ */ u.jsx(
490
+ return /* @__PURE__ */ r.jsx(
490
491
  "textarea",
491
492
  {
492
- className: f,
493
- "aria-invalid": t,
494
- "aria-describedby": t && n.id ? `${n.id}-error` : void 0,
493
+ className: u,
494
+ "aria-invalid": s,
495
+ "aria-describedby": s && n.id ? `${n.id}-error` : void 0,
495
496
  ...n
496
497
  }
497
498
  );
498
499
  }
499
- function z({ label: t, ...o }) {
500
- return o.id || console.error("InputWithLabel component requires an id prop"), /* @__PURE__ */ u.jsxs("div", { className: "mb-medium grid gap-small", children: [
501
- /* @__PURE__ */ u.jsx(se, { as: "label", htmlFor: o.id, className: "cursor-pointer", children: t }),
502
- /* @__PURE__ */ u.jsx(le, { ...o })
500
+ function ge({
501
+ variant: s = "default",
502
+ className: t = "",
503
+ children: a,
504
+ ...n
505
+ }) {
506
+ const l = [
507
+ "block",
508
+ "text-sm",
509
+ "font-medium",
510
+ "text-gray-700"
511
+ ], o = {
512
+ default: "",
513
+ required: "after:content-['*'] after:ml-0.5 after:text-red-500",
514
+ optional: "after:content-['(optional)'] after:ml-1 after:text-gray-400 after:font-normal"
515
+ }, c = [
516
+ ...l,
517
+ o[s],
518
+ t
519
+ ].filter(Boolean).join(" ");
520
+ return /* @__PURE__ */ r.jsx("label", { className: c, ...n, children: a });
521
+ }
522
+ function je({
523
+ message: s,
524
+ id: t,
525
+ className: a = "",
526
+ ...n
527
+ }) {
528
+ const o = [
529
+ ...[
530
+ "mt-1",
531
+ "text-sm",
532
+ "text-red-600",
533
+ "flex",
534
+ "items-center",
535
+ "gap-1"
536
+ ],
537
+ a
538
+ ].filter(Boolean).join(" ");
539
+ return /* @__PURE__ */ r.jsxs(
540
+ "div",
541
+ {
542
+ role: "alert",
543
+ id: t,
544
+ className: o,
545
+ "aria-live": "polite",
546
+ ...n,
547
+ children: [
548
+ /* @__PURE__ */ r.jsx(
549
+ "svg",
550
+ {
551
+ className: "h-4 w-4 flex-shrink-0",
552
+ fill: "currentColor",
553
+ viewBox: "0 0 20 20",
554
+ "aria-hidden": "true",
555
+ children: /* @__PURE__ */ r.jsx(
556
+ "path",
557
+ {
558
+ fillRule: "evenodd",
559
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
560
+ clipRule: "evenodd"
561
+ }
562
+ )
563
+ }
564
+ ),
565
+ /* @__PURE__ */ r.jsx("span", { children: s })
566
+ ]
567
+ }
568
+ );
569
+ }
570
+ function fe({
571
+ variant: s = "default",
572
+ className: t = "",
573
+ children: a,
574
+ ...n
575
+ }) {
576
+ const l = [
577
+ "inline-flex",
578
+ "items-center",
579
+ "px-1",
580
+ "pt-1",
581
+ "border-b-2",
582
+ "text-sm",
583
+ "font-medium",
584
+ "transition-colors"
585
+ ], o = {
586
+ default: "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700",
587
+ active: "border-indigo-500 text-gray-900",
588
+ disabled: "border-transparent text-gray-300 cursor-not-allowed pointer-events-none"
589
+ }, c = [
590
+ ...l,
591
+ o[s],
592
+ t
593
+ ].filter(Boolean).join(" ");
594
+ return s === "disabled" ? /* @__PURE__ */ r.jsx("span", { className: c, "aria-disabled": "true", children: a }) : /* @__PURE__ */ r.jsx("a", { className: c, ...n, children: a });
595
+ }
596
+ function G({ label: s, ...t }) {
597
+ return t.id || console.error("InputWithLabel component requires an id prop"), /* @__PURE__ */ r.jsxs("div", { className: "mb-medium grid gap-small", children: [
598
+ /* @__PURE__ */ r.jsx(ce, { as: "label", htmlFor: t.id, className: "cursor-pointer", children: s }),
599
+ /* @__PURE__ */ r.jsx(de, { ...t })
503
600
  ] });
504
601
  }
505
- function me({
506
- variant: t = "default",
507
- padding: o = "medium",
602
+ function ye({
603
+ variant: s = "default",
604
+ padding: t = "medium",
508
605
  className: a = "",
509
606
  children: n,
510
- ...s
607
+ ...l
511
608
  }) {
512
- const i = [
609
+ const o = [
513
610
  "bg-white",
514
611
  "rounded-lg",
515
612
  "border",
516
613
  "border-gray-200",
517
614
  "shadow-sm"
518
- ], b = {
615
+ ], c = {
519
616
  default: "",
520
617
  hover: "hover:shadow-md transition-shadow cursor-pointer",
521
618
  selected: "border-indigo-500 shadow-md"
522
- }, f = {
619
+ }, u = {
523
620
  none: "",
524
621
  small: "p-2",
525
622
  medium: "p-4",
526
623
  large: "p-6"
527
624
  }, m = [
528
- ...i,
529
- b[t],
530
- f[o],
625
+ ...o,
626
+ c[s],
627
+ u[t],
531
628
  a
532
629
  ].filter(Boolean).join(" ");
533
- return /* @__PURE__ */ u.jsx("div", { className: m, ...s, children: n });
630
+ return /* @__PURE__ */ r.jsx("div", { className: m, ...l, children: n });
534
631
  }
535
- function ge({
536
- onForgotPasswordClick: t,
537
- className: o,
632
+ function Ne({
633
+ children: s,
634
+ onSubmit: t,
635
+ loading: a = !1,
636
+ error: n = null,
637
+ success: l = null,
638
+ className: o = "",
639
+ ...c
640
+ }) {
641
+ const m = [
642
+ ...[
643
+ "space-y-4"
644
+ ],
645
+ o
646
+ ].filter(Boolean).join(" "), j = (g) => {
647
+ g.preventDefault(), t && !a && t(g);
648
+ };
649
+ return /* @__PURE__ */ r.jsxs(
650
+ "form",
651
+ {
652
+ className: m,
653
+ onSubmit: j,
654
+ noValidate: !0,
655
+ ...c,
656
+ children: [
657
+ s,
658
+ n && /* @__PURE__ */ r.jsx(
659
+ "div",
660
+ {
661
+ role: "alert",
662
+ className: "p-3 text-sm text-red-800 bg-red-50 border border-red-200 rounded",
663
+ children: n
664
+ }
665
+ ),
666
+ l && /* @__PURE__ */ r.jsx(
667
+ "div",
668
+ {
669
+ role: "alert",
670
+ className: "p-3 text-sm text-green-800 bg-green-50 border border-green-200 rounded",
671
+ children: l
672
+ }
673
+ )
674
+ ]
675
+ }
676
+ );
677
+ }
678
+ function ke({
679
+ items: s,
680
+ separator: t = "/",
681
+ className: a = "",
682
+ ...n
683
+ }) {
684
+ const o = [
685
+ ...[
686
+ "flex",
687
+ "items-center",
688
+ "space-x-2",
689
+ "text-sm"
690
+ ],
691
+ a
692
+ ].filter(Boolean).join(" ");
693
+ return /* @__PURE__ */ r.jsx("nav", { "aria-label": "Breadcrumb", className: o, ...n, children: /* @__PURE__ */ r.jsx("ol", { className: "flex items-center space-x-2", children: s.map((c, u) => {
694
+ const m = u === s.length - 1;
695
+ return /* @__PURE__ */ r.jsxs("li", { className: "flex items-center", children: [
696
+ u > 0 && /* @__PURE__ */ r.jsx("span", { className: "mx-2 text-gray-400", "aria-hidden": "true", children: t }),
697
+ m ? /* @__PURE__ */ r.jsx("span", { className: "text-gray-900 font-medium", "aria-current": "page", children: c.label }) : c.href ? /* @__PURE__ */ r.jsx(fe, { href: c.href, variant: "default", children: c.label }) : /* @__PURE__ */ r.jsx("span", { className: "text-gray-500", children: c.label })
698
+ ] }, u);
699
+ }) }) });
700
+ }
701
+ function we({
702
+ currentPage: s,
703
+ totalPages: t,
704
+ onPageChange: a,
705
+ totalItems: n,
706
+ itemsPerPage: l,
707
+ showPageInfo: o = !0,
708
+ className: c = "",
709
+ ...u
710
+ }) {
711
+ const m = () => {
712
+ s > 1 && a(s - 1);
713
+ }, j = () => {
714
+ s < t && a(s + 1);
715
+ }, g = (d) => {
716
+ d >= 1 && d <= t && d !== s && a(d);
717
+ }, k = () => {
718
+ const d = [];
719
+ if (t <= 5)
720
+ for (let f = 1; f <= t; f++)
721
+ d.push(f);
722
+ else if (s <= 3) {
723
+ for (let f = 1; f <= 4; f++)
724
+ d.push(f);
725
+ d.push("ellipsis"), d.push(t);
726
+ } else if (s >= t - 2) {
727
+ d.push(1), d.push("ellipsis");
728
+ for (let f = t - 3; f <= t; f++)
729
+ d.push(f);
730
+ } else {
731
+ d.push(1), d.push("ellipsis");
732
+ for (let f = s - 1; f <= s + 1; f++)
733
+ d.push(f);
734
+ d.push("ellipsis"), d.push(t);
735
+ }
736
+ return d;
737
+ }, x = n && l ? (s - 1) * l + 1 : void 0, y = n && l ? Math.min(s * l, n) : void 0, N = [
738
+ ...[
739
+ "flex",
740
+ "items-center",
741
+ "justify-between",
742
+ "px-4",
743
+ "py-3"
744
+ ],
745
+ c
746
+ ].filter(Boolean).join(" ");
747
+ return /* @__PURE__ */ r.jsxs("nav", { className: N, "aria-label": "Pagination", ...u, children: [
748
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
749
+ /* @__PURE__ */ r.jsx(
750
+ A,
751
+ {
752
+ variant: "secondary",
753
+ onClick: m,
754
+ disabled: s === 1,
755
+ className: "px-3 py-1 text-sm",
756
+ children: "Previous"
757
+ }
758
+ ),
759
+ /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-1", children: k().map((d, w) => {
760
+ if (d === "ellipsis")
761
+ return /* @__PURE__ */ r.jsx("span", { className: "px-2 text-gray-500", children: "..." }, `ellipsis-${w}`);
762
+ const f = d, T = f === s;
763
+ return /* @__PURE__ */ r.jsx(
764
+ "button",
765
+ {
766
+ onClick: () => g(f),
767
+ className: `px-3 py-1 text-sm rounded ${T ? "bg-indigo-600 text-white" : "text-gray-700 hover:bg-gray-100"}`,
768
+ "aria-current": T ? "page" : void 0,
769
+ "aria-label": `Go to page ${f}`,
770
+ children: f
771
+ },
772
+ f
773
+ );
774
+ }) }),
775
+ /* @__PURE__ */ r.jsx(
776
+ A,
777
+ {
778
+ variant: "secondary",
779
+ onClick: j,
780
+ disabled: s === t,
781
+ className: "px-3 py-1 text-sm",
782
+ children: "Next"
783
+ }
784
+ )
785
+ ] }),
786
+ o && n && l && /* @__PURE__ */ r.jsxs("div", { className: "text-sm text-gray-700", children: [
787
+ "Showing ",
788
+ x,
789
+ " to ",
790
+ y,
791
+ " of ",
792
+ n,
793
+ " results"
794
+ ] })
795
+ ] });
796
+ }
797
+ function Ee({
798
+ onForgotPasswordClick: s,
799
+ className: t,
538
800
  ...a
539
801
  }) {
540
- return /* @__PURE__ */ u.jsx(ie, { className: o, children: /* @__PURE__ */ u.jsxs(
802
+ return /* @__PURE__ */ r.jsx(ue, { className: t, children: /* @__PURE__ */ r.jsxs(
541
803
  "form",
542
804
  {
543
805
  ...a,
@@ -545,16 +807,16 @@ function ge({
545
807
  n.preventDefault(), a.onSubmit && a.onSubmit(n);
546
808
  },
547
809
  children: [
548
- /* @__PURE__ */ u.jsx(
549
- z,
810
+ /* @__PURE__ */ r.jsx(
811
+ G,
550
812
  {
551
813
  id: "login-email",
552
814
  label: "Your email",
553
815
  placeholder: "myname@email.com"
554
816
  }
555
817
  ),
556
- /* @__PURE__ */ u.jsx(
557
- z,
818
+ /* @__PURE__ */ r.jsx(
819
+ G,
558
820
  {
559
821
  id: "login-password",
560
822
  label: "Your password",
@@ -562,32 +824,220 @@ function ge({
562
824
  type: "password"
563
825
  }
564
826
  ),
565
- /* @__PURE__ */ u.jsxs("div", { className: "flex justify-between", children: [
566
- /* @__PURE__ */ u.jsx(
567
- W,
827
+ /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between", children: [
828
+ /* @__PURE__ */ r.jsx(
829
+ A,
568
830
  {
569
831
  variant: "secondary",
570
832
  type: "button",
571
- onClick: t,
833
+ onClick: s,
572
834
  children: "Forgot password?"
573
835
  }
574
836
  ),
575
- /* @__PURE__ */ u.jsx(W, { variant: "regular", type: "submit", children: "Sign in" })
837
+ /* @__PURE__ */ r.jsx(A, { variant: "regular", type: "submit", children: "Sign in" })
576
838
  ] })
577
839
  ]
578
840
  }
579
841
  ) });
580
842
  }
843
+ function _e({
844
+ isOpen: s,
845
+ onClose: t,
846
+ title: a,
847
+ children: n,
848
+ variant: l = "default",
849
+ showCloseButton: o = !0,
850
+ footer: c,
851
+ className: u = "",
852
+ ...m
853
+ }) {
854
+ const j = P(null), g = P(null);
855
+ if (V(() => {
856
+ if (!s) return;
857
+ g.current = document.activeElement;
858
+ const d = setTimeout(() => {
859
+ j.current?.focus();
860
+ }, 0), w = (f) => {
861
+ f.key === "Escape" && t();
862
+ };
863
+ return document.addEventListener("keydown", w), () => {
864
+ clearTimeout(d), document.removeEventListener("keydown", w), g.current?.focus();
865
+ };
866
+ }, [s, t]), V(() => (s ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
867
+ document.body.style.overflow = "";
868
+ }), [s]), !s) return null;
869
+ const k = [
870
+ "fixed",
871
+ "inset-0",
872
+ "z-50",
873
+ "overflow-y-auto"
874
+ ], x = [
875
+ "fixed",
876
+ "inset-0",
877
+ "bg-black",
878
+ "bg-opacity-50",
879
+ "transition-opacity"
880
+ ], v = [
881
+ "relative",
882
+ "bg-white",
883
+ "rounded-lg",
884
+ "shadow-xl",
885
+ "my-8",
886
+ "mx-auto",
887
+ {
888
+ default: "max-w-md",
889
+ large: "max-w-2xl",
890
+ fullscreen: "max-w-full h-full"
891
+ }[l],
892
+ "p-6",
893
+ u
894
+ ].filter(Boolean).join(" "), N = /* @__PURE__ */ r.jsxs(
895
+ "div",
896
+ {
897
+ className: k.join(" "),
898
+ role: "dialog",
899
+ "aria-modal": "true",
900
+ "aria-labelledby": a ? "modal-title" : void 0,
901
+ onClick: (d) => {
902
+ d.target === d.currentTarget && t();
903
+ },
904
+ children: [
905
+ /* @__PURE__ */ r.jsx("div", { className: x.join(" "), "aria-hidden": "true" }),
906
+ /* @__PURE__ */ r.jsx("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ r.jsxs(
907
+ "div",
908
+ {
909
+ ref: j,
910
+ tabIndex: -1,
911
+ className: v,
912
+ onClick: (d) => d.stopPropagation(),
913
+ ...m,
914
+ children: [
915
+ a && /* @__PURE__ */ r.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
916
+ /* @__PURE__ */ r.jsx("h2", { id: "modal-title", className: "text-xl font-semibold text-gray-900", children: a }),
917
+ o && /* @__PURE__ */ r.jsx(
918
+ "button",
919
+ {
920
+ onClick: t,
921
+ className: "text-gray-400 hover:text-gray-500 focus:outline-none",
922
+ "aria-label": "Close modal",
923
+ children: /* @__PURE__ */ r.jsx(
924
+ "svg",
925
+ {
926
+ className: "h-6 w-6",
927
+ fill: "none",
928
+ viewBox: "0 0 24 24",
929
+ stroke: "currentColor",
930
+ children: /* @__PURE__ */ r.jsx(
931
+ "path",
932
+ {
933
+ strokeLinecap: "round",
934
+ strokeLinejoin: "round",
935
+ strokeWidth: 2,
936
+ d: "M6 18L18 6M6 6l12 12"
937
+ }
938
+ )
939
+ }
940
+ )
941
+ }
942
+ )
943
+ ] }),
944
+ !a && o && /* @__PURE__ */ r.jsx("div", { className: "flex justify-end mb-4", children: /* @__PURE__ */ r.jsx(
945
+ "button",
946
+ {
947
+ onClick: t,
948
+ className: "text-gray-400 hover:text-gray-500 focus:outline-none",
949
+ "aria-label": "Close modal",
950
+ children: /* @__PURE__ */ r.jsx(
951
+ "svg",
952
+ {
953
+ className: "h-6 w-6",
954
+ fill: "none",
955
+ viewBox: "0 0 24 24",
956
+ stroke: "currentColor",
957
+ children: /* @__PURE__ */ r.jsx(
958
+ "path",
959
+ {
960
+ strokeLinecap: "round",
961
+ strokeLinejoin: "round",
962
+ strokeWidth: 2,
963
+ d: "M6 18L18 6M6 6l12 12"
964
+ }
965
+ )
966
+ }
967
+ )
968
+ }
969
+ ) }),
970
+ /* @__PURE__ */ r.jsx("div", { className: "mb-4", children: n }),
971
+ c && /* @__PURE__ */ r.jsx("div", { className: "flex justify-end gap-2 mt-4", children: c })
972
+ ]
973
+ }
974
+ ) })
975
+ ]
976
+ }
977
+ );
978
+ return typeof window < "u" ? ne(N, document.body) : N;
979
+ }
980
+ function Re({
981
+ columns: s,
982
+ data: t,
983
+ loading: a = !1,
984
+ onSort: n,
985
+ sortColumn: l,
986
+ sortDirection: o,
987
+ emptyMessage: c = "No data available",
988
+ className: u = "",
989
+ ...m
990
+ }) {
991
+ const j = (x) => {
992
+ if (!n || !s.find((v) => v.key === x)?.sortable)
993
+ return;
994
+ n(x, l === x && o === "asc" ? "desc" : "asc");
995
+ }, k = [
996
+ ...[
997
+ "min-w-full",
998
+ "divide-y",
999
+ "divide-gray-200"
1000
+ ],
1001
+ u
1002
+ ].filter(Boolean).join(" ");
1003
+ return /* @__PURE__ */ r.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r.jsxs("table", { className: k, ...m, children: [
1004
+ /* @__PURE__ */ r.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ r.jsx("tr", { children: s.map((x) => /* @__PURE__ */ r.jsx(
1005
+ "th",
1006
+ {
1007
+ scope: "col",
1008
+ className: `px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider ${x.sortable && n ? "cursor-pointer hover:bg-gray-100 select-none" : ""}`,
1009
+ onClick: () => x.sortable && j(x.key),
1010
+ children: /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
1011
+ /* @__PURE__ */ r.jsx("span", { children: x.label }),
1012
+ x.sortable && l === x.key && /* @__PURE__ */ r.jsx("span", { className: "text-gray-400", children: o === "asc" ? "↑" : "↓" })
1013
+ ] })
1014
+ },
1015
+ x.key
1016
+ )) }) }),
1017
+ /* @__PURE__ */ r.jsx("tbody", { className: "bg-white divide-y divide-gray-200", children: a ? /* @__PURE__ */ r.jsx("tr", { children: /* @__PURE__ */ r.jsx("td", { colSpan: s.length, className: "px-6 py-4 text-center text-gray-500", children: "Loading..." }) }) : t.length === 0 ? /* @__PURE__ */ r.jsx("tr", { children: /* @__PURE__ */ r.jsx("td", { colSpan: s.length, className: "px-6 py-4 text-center text-gray-500", children: c }) }) : t.map((x, y) => /* @__PURE__ */ r.jsx("tr", { className: "hover:bg-gray-50", children: s.map((v) => {
1018
+ const N = x[v.key];
1019
+ return /* @__PURE__ */ r.jsx("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-900", children: v.render ? v.render(N, x) : N }, v.key);
1020
+ }) }, y)) })
1021
+ ] }) });
1022
+ }
581
1023
  export {
582
- de as Badge,
583
- ie as BoxWrapper,
584
- W as Button,
585
- me as Card,
586
- ce as Info,
587
- le as Input,
588
- z as InputWithLabel,
589
- ge as LoginBox,
590
- fe as Select,
591
- se as Text,
592
- be as Textarea
1024
+ pe as Badge,
1025
+ ue as BoxWrapper,
1026
+ ke as Breadcrumb,
1027
+ A as Button,
1028
+ ye as Card,
1029
+ je as ErrorMessage,
1030
+ Ne as Form,
1031
+ xe as Info,
1032
+ de as Input,
1033
+ G as InputWithLabel,
1034
+ ge as Label,
1035
+ Ee as LoginBox,
1036
+ _e as Modal,
1037
+ fe as NavLink,
1038
+ we as Pagination,
1039
+ he as Select,
1040
+ Re as Table,
1041
+ ce as Text,
1042
+ ve as Textarea
593
1043
  };