@sikka/hawa 0.34.8-next → 0.35.1-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Radio-BpXOu4Hr.d.mts → Radio-BCD7k628.d.mts} +3 -0
- package/dist/{Radio-CREjhlGz.d.ts → Radio-y9uhxitu.d.ts} +3 -0
- package/dist/alert/index.js +28 -17
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +61 -50
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js +81 -70
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +138 -127
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/backToTop/index.js +28 -17
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +55 -44
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +50 -39
- package/dist/blocks/auth/index.mjs +5 -5
- package/dist/blocks/feedback/index.d.mts +3 -0
- package/dist/blocks/feedback/index.d.ts +3 -0
- package/dist/blocks/feedback/index.js +174 -120
- package/dist/blocks/feedback/index.mjs +29 -93
- package/dist/blocks/index.d.mts +2 -1
- package/dist/blocks/index.d.ts +2 -1
- package/dist/blocks/index.js +253 -201
- package/dist/blocks/index.mjs +3 -3
- package/dist/blocks/misc/index.js +71 -60
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +154 -80
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.d.mts +13 -0
- package/dist/button/index.d.ts +13 -0
- package/dist/button/index.js +28 -17
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +51 -40
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +34 -23
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +57 -46
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/{chunk-GEB3LM5A.mjs → chunk-A376BKNX.mjs} +2 -2
- package/dist/{chunk-OS2UOK5C.mjs → chunk-DABX3SU6.mjs} +64 -51
- package/dist/{chunk-QPZ4ZR2B.mjs → chunk-DFWFQWWT.mjs} +155 -116
- package/dist/{chunk-UBNCETCU.mjs → chunk-GVZWOUGN.mjs} +1 -1
- package/dist/chunk-HHC34DXN.mjs +320 -0
- package/dist/{chunk-QVF3VLB7.mjs → chunk-IDKXEJET.mjs} +157 -144
- package/dist/{chunk-AW5FW5TY.mjs → chunk-L56XQRQI.mjs} +1 -1
- package/dist/{chunk-ORNLFAC6.mjs → chunk-XFRJ62W3.mjs} +1 -1
- package/dist/{chunk-RTGD7N7I.mjs → chunk-XJMDUR5A.mjs} +1 -1
- package/dist/{chunk-J7BT4XJR.mjs → chunk-YOT2GVXO.mjs} +1 -1
- package/dist/codeBlock/index.js +28 -17
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +70 -59
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dataTable/index.d.mts +1 -2
- package/dist/dataTable/index.d.ts +1 -2
- package/dist/dataTable/index.js +144 -105
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +178 -139
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +41 -5
- package/dist/datePicker/index.d.ts +41 -5
- package/dist/datePicker/index.js +48 -17
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +48 -17
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +40 -29
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +135 -124
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +7 -3
- package/dist/elements/index.d.ts +7 -3
- package/dist/elements/index.js +475 -395
- package/dist/elements/index.mjs +32 -4
- package/dist/fileDropzone/index.js +28 -17
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +89 -78
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.d.mts +16 -9
- package/dist/index.d.ts +16 -9
- package/dist/index.js +515 -435
- package/dist/index.mjs +1204 -1124
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +85 -24
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +107 -46
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/layout/index.js +121 -110
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +1 -1
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +1 -1
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/radio/index.d.mts +3 -0
- package/dist/radio/index.d.ts +3 -0
- package/dist/radio/index.js +85 -24
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +100 -39
- package/dist/radio/index.mjs.map +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/sortButton/index.js +28 -17
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +58 -47
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +12 -0
- package/dist/splitButton/index.d.ts +12 -0
- package/dist/splitButton/index.js +70 -59
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +93 -82
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs.map +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-IQEBXGLM.mjs +0 -215
package/dist/dataTable/index.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// elements/dataTable/DataTable.tsx
|
4
|
-
import * as
|
4
|
+
import * as React10 from "react";
|
5
5
|
import {
|
6
6
|
flexRender,
|
7
7
|
getCoreRowModel,
|
@@ -20,16 +20,28 @@ function cn(...inputs) {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
// elements/button/Button.tsx
|
23
|
-
import * as
|
23
|
+
import * as React5 from "react";
|
24
24
|
import { cva } from "class-variance-authority";
|
25
25
|
|
26
|
+
// elements/helperText/HelperText.tsx
|
27
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
|
28
|
+
"p",
|
29
|
+
{
|
30
|
+
className: cn(
|
31
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
32
|
+
helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
33
|
+
)
|
34
|
+
},
|
35
|
+
helperText
|
36
|
+
);
|
37
|
+
|
26
38
|
// elements/label/Label.tsx
|
27
|
-
import * as
|
39
|
+
import * as React3 from "react";
|
28
40
|
|
29
41
|
// elements/tooltip/Tooltip.tsx
|
30
|
-
import
|
42
|
+
import React2 from "react";
|
31
43
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
32
|
-
var TooltipContent =
|
44
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
33
45
|
TooltipPrimitive.Content,
|
34
46
|
{
|
35
47
|
ref,
|
@@ -46,7 +58,7 @@ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, size = "defa
|
|
46
58
|
}
|
47
59
|
));
|
48
60
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
49
|
-
var TooltipArrow =
|
61
|
+
var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
50
62
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
51
63
|
var Tooltip = ({
|
52
64
|
side,
|
@@ -63,13 +75,13 @@ var Tooltip = ({
|
|
63
75
|
delayDuration = 300,
|
64
76
|
...props
|
65
77
|
}) => {
|
66
|
-
return /* @__PURE__ */
|
78
|
+
return /* @__PURE__ */ React2.createElement(
|
67
79
|
TooltipPrimitive.TooltipProvider,
|
68
80
|
{
|
69
81
|
delayDuration,
|
70
82
|
...providerProps
|
71
83
|
},
|
72
|
-
/* @__PURE__ */
|
84
|
+
/* @__PURE__ */ React2.createElement(
|
73
85
|
TooltipPrimitive.Root,
|
74
86
|
{
|
75
87
|
open: !disabled && open,
|
@@ -77,8 +89,8 @@ var Tooltip = ({
|
|
77
89
|
onOpenChange,
|
78
90
|
...props
|
79
91
|
},
|
80
|
-
/* @__PURE__ */
|
81
|
-
/* @__PURE__ */
|
92
|
+
/* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
93
|
+
/* @__PURE__ */ React2.createElement(
|
82
94
|
TooltipContent,
|
83
95
|
{
|
84
96
|
size,
|
@@ -98,7 +110,7 @@ var Tooltip = ({
|
|
98
110
|
};
|
99
111
|
|
100
112
|
// elements/label/Label.tsx
|
101
|
-
var Label =
|
113
|
+
var Label = React3.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React3.createElement(
|
102
114
|
"label",
|
103
115
|
{
|
104
116
|
ref,
|
@@ -109,8 +121,8 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
109
121
|
...props
|
110
122
|
},
|
111
123
|
children,
|
112
|
-
required && /* @__PURE__ */
|
113
|
-
), hint && /* @__PURE__ */
|
124
|
+
required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
125
|
+
), hint && /* @__PURE__ */ React3.createElement(
|
114
126
|
Tooltip,
|
115
127
|
{
|
116
128
|
content: hint,
|
@@ -120,7 +132,7 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
120
132
|
onClick: (event) => event.preventDefault()
|
121
133
|
}
|
122
134
|
},
|
123
|
-
/* @__PURE__ */
|
135
|
+
/* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
|
124
136
|
"svg",
|
125
137
|
{
|
126
138
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -132,15 +144,15 @@ var Label = React2.forwardRef(({ className, hint, hintSide, required, children,
|
|
132
144
|
strokeLinecap: "round",
|
133
145
|
strokeLinejoin: "round"
|
134
146
|
},
|
135
|
-
/* @__PURE__ */
|
136
|
-
/* @__PURE__ */
|
137
|
-
/* @__PURE__ */
|
147
|
+
/* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
148
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
149
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
|
138
150
|
))
|
139
151
|
)));
|
140
152
|
Label.displayName = "Label";
|
141
153
|
|
142
154
|
// elements/loading/Loading.tsx
|
143
|
-
import
|
155
|
+
import React4 from "react";
|
144
156
|
var Loading = ({
|
145
157
|
design = "spinner",
|
146
158
|
size = "normal",
|
@@ -171,7 +183,7 @@ var Loading = ({
|
|
171
183
|
};
|
172
184
|
switch (design.split("-")[0]) {
|
173
185
|
case "dots":
|
174
|
-
return /* @__PURE__ */
|
186
|
+
return /* @__PURE__ */ React4.createElement(
|
175
187
|
"div",
|
176
188
|
{
|
177
189
|
className: cn(
|
@@ -179,7 +191,7 @@ var Loading = ({
|
|
179
191
|
classNames == null ? void 0 : classNames.container
|
180
192
|
)
|
181
193
|
},
|
182
|
-
/* @__PURE__ */
|
194
|
+
/* @__PURE__ */ React4.createElement(
|
183
195
|
"div",
|
184
196
|
{
|
185
197
|
className: cn(
|
@@ -190,7 +202,7 @@ var Loading = ({
|
|
190
202
|
)
|
191
203
|
}
|
192
204
|
),
|
193
|
-
/* @__PURE__ */
|
205
|
+
/* @__PURE__ */ React4.createElement(
|
194
206
|
"div",
|
195
207
|
{
|
196
208
|
className: cn(
|
@@ -201,7 +213,7 @@ var Loading = ({
|
|
201
213
|
)
|
202
214
|
}
|
203
215
|
),
|
204
|
-
/* @__PURE__ */
|
216
|
+
/* @__PURE__ */ React4.createElement(
|
205
217
|
"div",
|
206
218
|
{
|
207
219
|
className: cn(
|
@@ -214,7 +226,7 @@ var Loading = ({
|
|
214
226
|
)
|
215
227
|
);
|
216
228
|
case "square":
|
217
|
-
return /* @__PURE__ */
|
229
|
+
return /* @__PURE__ */ React4.createElement(
|
218
230
|
"svg",
|
219
231
|
{
|
220
232
|
className: cn(
|
@@ -226,7 +238,7 @@ var Loading = ({
|
|
226
238
|
height: "35",
|
227
239
|
width: "35"
|
228
240
|
},
|
229
|
-
/* @__PURE__ */
|
241
|
+
/* @__PURE__ */ React4.createElement(
|
230
242
|
"rect",
|
231
243
|
{
|
232
244
|
className: "squircle-track",
|
@@ -238,7 +250,7 @@ var Loading = ({
|
|
238
250
|
height: "32.5"
|
239
251
|
}
|
240
252
|
),
|
241
|
-
/* @__PURE__ */
|
253
|
+
/* @__PURE__ */ React4.createElement(
|
242
254
|
"rect",
|
243
255
|
{
|
244
256
|
className: "square-car",
|
@@ -253,7 +265,7 @@ var Loading = ({
|
|
253
265
|
)
|
254
266
|
);
|
255
267
|
case "squircle":
|
256
|
-
return /* @__PURE__ */
|
268
|
+
return /* @__PURE__ */ React4.createElement(
|
257
269
|
"svg",
|
258
270
|
{
|
259
271
|
x: "0px",
|
@@ -268,7 +280,7 @@ var Loading = ({
|
|
268
280
|
classNames == null ? void 0 : classNames.container
|
269
281
|
)
|
270
282
|
},
|
271
|
-
/* @__PURE__ */
|
283
|
+
/* @__PURE__ */ React4.createElement(
|
272
284
|
"path",
|
273
285
|
{
|
274
286
|
className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
|
@@ -278,7 +290,7 @@ var Loading = ({
|
|
278
290
|
d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
|
279
291
|
}
|
280
292
|
),
|
281
|
-
/* @__PURE__ */
|
293
|
+
/* @__PURE__ */ React4.createElement(
|
282
294
|
"path",
|
283
295
|
{
|
284
296
|
className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
|
@@ -290,7 +302,7 @@ var Loading = ({
|
|
290
302
|
)
|
291
303
|
);
|
292
304
|
case "progress":
|
293
|
-
return /* @__PURE__ */
|
305
|
+
return /* @__PURE__ */ React4.createElement(
|
294
306
|
"div",
|
295
307
|
{
|
296
308
|
className: cn(
|
@@ -301,9 +313,9 @@ var Loading = ({
|
|
301
313
|
}
|
302
314
|
);
|
303
315
|
case "orbit":
|
304
|
-
return /* @__PURE__ */
|
316
|
+
return /* @__PURE__ */ React4.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
|
305
317
|
default:
|
306
|
-
return /* @__PURE__ */
|
318
|
+
return /* @__PURE__ */ React4.createElement(
|
307
319
|
"svg",
|
308
320
|
{
|
309
321
|
viewBox: "0 0 40 40",
|
@@ -315,7 +327,7 @@ var Loading = ({
|
|
315
327
|
classNames == null ? void 0 : classNames.container
|
316
328
|
)
|
317
329
|
},
|
318
|
-
/* @__PURE__ */
|
330
|
+
/* @__PURE__ */ React4.createElement(
|
319
331
|
"circle",
|
320
332
|
{
|
321
333
|
className: cn(
|
@@ -334,7 +346,7 @@ var Loading = ({
|
|
334
346
|
pathLength: "100"
|
335
347
|
}
|
336
348
|
),
|
337
|
-
/* @__PURE__ */
|
349
|
+
/* @__PURE__ */ React4.createElement(
|
338
350
|
"circle",
|
339
351
|
{
|
340
352
|
className: cn(
|
@@ -385,13 +397,10 @@ var buttonVariants = cva(
|
|
385
397
|
smallIcon: "hawa-h-7 hawa-w-7"
|
386
398
|
}
|
387
399
|
},
|
388
|
-
defaultVariants: {
|
389
|
-
variant: "default",
|
390
|
-
size: "default"
|
391
|
-
}
|
400
|
+
defaultVariants: { variant: "default", size: "default" }
|
392
401
|
}
|
393
402
|
);
|
394
|
-
var Button =
|
403
|
+
var Button = React5.forwardRef(
|
395
404
|
({
|
396
405
|
className,
|
397
406
|
label,
|
@@ -401,11 +410,13 @@ var Button = React4.forwardRef(
|
|
401
410
|
centered = true,
|
402
411
|
isLoading,
|
403
412
|
children,
|
413
|
+
labelProps,
|
414
|
+
showHelperText = false,
|
404
415
|
...props
|
405
416
|
}, ref) => {
|
406
417
|
const Comp = "button";
|
407
418
|
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
408
|
-
return /* @__PURE__ */
|
419
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
|
409
420
|
Comp,
|
410
421
|
{
|
411
422
|
className: cn(
|
@@ -415,7 +426,7 @@ var Button = React4.forwardRef(
|
|
415
426
|
ref,
|
416
427
|
...props
|
417
428
|
},
|
418
|
-
isLoading ? /* @__PURE__ */
|
429
|
+
isLoading ? /* @__PURE__ */ React5.createElement(
|
419
430
|
Loading,
|
420
431
|
{
|
421
432
|
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
@@ -424,20 +435,20 @@ var Button = React4.forwardRef(
|
|
424
435
|
size: size === "sm" || size === "xs" ? "xs" : "button"
|
425
436
|
}
|
426
437
|
) : children
|
427
|
-
));
|
438
|
+
), showHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
|
428
439
|
}
|
429
440
|
);
|
430
441
|
Button.displayName = "Button";
|
431
442
|
|
432
443
|
// elements/dropdownMenu/DropdownMenu.tsx
|
433
|
-
import * as
|
444
|
+
import * as React6 from "react";
|
434
445
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
435
446
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
436
447
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
437
448
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
438
449
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
439
450
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
440
|
-
var DropdownMenuSubTrigger =
|
451
|
+
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
441
452
|
DropdownMenuPrimitive.SubTrigger,
|
442
453
|
{
|
443
454
|
ref,
|
@@ -448,9 +459,9 @@ var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ..
|
|
448
459
|
),
|
449
460
|
...props
|
450
461
|
},
|
451
|
-
/* @__PURE__ */
|
462
|
+
/* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
|
452
463
|
" ",
|
453
|
-
/* @__PURE__ */
|
464
|
+
/* @__PURE__ */ React6.createElement(
|
454
465
|
"svg",
|
455
466
|
{
|
456
467
|
"aria-label": "Chevron Right Icon",
|
@@ -462,7 +473,7 @@ var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ..
|
|
462
473
|
width: "1em",
|
463
474
|
className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
|
464
475
|
},
|
465
|
-
/* @__PURE__ */
|
476
|
+
/* @__PURE__ */ React6.createElement(
|
466
477
|
"path",
|
467
478
|
{
|
468
479
|
fillRule: "evenodd",
|
@@ -472,7 +483,7 @@ var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ..
|
|
472
483
|
)
|
473
484
|
));
|
474
485
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
475
|
-
var DropdownMenuSubContent =
|
486
|
+
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
476
487
|
DropdownMenuPrimitive.SubContent,
|
477
488
|
{
|
478
489
|
ref,
|
@@ -484,7 +495,7 @@ var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) =>
|
|
484
495
|
}
|
485
496
|
));
|
486
497
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
487
|
-
var DropdownMenuContent =
|
498
|
+
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React6.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React6.createElement(
|
488
499
|
DropdownMenuPrimitive.Content,
|
489
500
|
{
|
490
501
|
ref,
|
@@ -497,8 +508,8 @@ var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...pro
|
|
497
508
|
}
|
498
509
|
)));
|
499
510
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
500
|
-
var DropdownMenuItem =
|
501
|
-
return /* @__PURE__ */
|
511
|
+
var DropdownMenuItem = React6.forwardRef(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {
|
512
|
+
return /* @__PURE__ */ React6.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React6.createElement(
|
502
513
|
DropdownMenuPrimitive.Item,
|
503
514
|
{
|
504
515
|
disabled: props.disabled,
|
@@ -511,14 +522,14 @@ var DropdownMenuItem = React5.forwardRef(({ className, inset, badged, slug, Link
|
|
511
522
|
),
|
512
523
|
...props
|
513
524
|
},
|
514
|
-
/* @__PURE__ */
|
525
|
+
/* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 " }, props.children),
|
515
526
|
props.end && props.end,
|
516
|
-
!props.end && props.shortcut && /* @__PURE__ */
|
517
|
-
!props.end && badged && /* @__PURE__ */
|
527
|
+
!props.end && props.shortcut && /* @__PURE__ */ React6.createElement(DropdownMenuShortcut, null, props.shortcut),
|
528
|
+
!props.end && badged && /* @__PURE__ */ React6.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
|
518
529
|
));
|
519
530
|
});
|
520
531
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
521
|
-
var DropdownMenuCheckboxItem =
|
532
|
+
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
522
533
|
DropdownMenuPrimitive.CheckboxItem,
|
523
534
|
{
|
524
535
|
ref,
|
@@ -529,7 +540,7 @@ var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked
|
|
529
540
|
checked,
|
530
541
|
...props
|
531
542
|
},
|
532
|
-
/* @__PURE__ */
|
543
|
+
/* @__PURE__ */ React6.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React6.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React6.createElement(
|
533
544
|
"svg",
|
534
545
|
{
|
535
546
|
"aria-label": "Check Mark",
|
@@ -540,12 +551,12 @@ var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked
|
|
540
551
|
height: "0.60em",
|
541
552
|
width: "0.60em"
|
542
553
|
},
|
543
|
-
/* @__PURE__ */
|
554
|
+
/* @__PURE__ */ React6.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
|
544
555
|
), " ")),
|
545
556
|
children
|
546
557
|
));
|
547
558
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
548
|
-
var DropdownMenuRadioItem =
|
559
|
+
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
549
560
|
DropdownMenuPrimitive.RadioItem,
|
550
561
|
{
|
551
562
|
ref,
|
@@ -555,7 +566,7 @@ var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }
|
|
555
566
|
),
|
556
567
|
...props
|
557
568
|
},
|
558
|
-
/* @__PURE__ */
|
569
|
+
/* @__PURE__ */ React6.createElement("span", { className: "hawa-absolute hawa-left-2 hawa-flex hawa-h-3.5 hawa-w-3.5 hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React6.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React6.createElement(
|
559
570
|
"svg",
|
560
571
|
{
|
561
572
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -570,12 +581,12 @@ var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }
|
|
570
581
|
strokeLinejoin: "round",
|
571
582
|
className: "hawa-h-2 hawa-w-2 hawa-fill-current"
|
572
583
|
},
|
573
|
-
/* @__PURE__ */
|
584
|
+
/* @__PURE__ */ React6.createElement("circle", { cx: "12", cy: "12", r: "10" })
|
574
585
|
))),
|
575
586
|
children
|
576
587
|
));
|
577
588
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
578
|
-
var DropdownMenuLabel =
|
589
|
+
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
579
590
|
DropdownMenuPrimitive.Label,
|
580
591
|
{
|
581
592
|
ref,
|
@@ -588,7 +599,7 @@ var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref)
|
|
588
599
|
}
|
589
600
|
));
|
590
601
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
591
|
-
var DropdownMenuSeparator =
|
602
|
+
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
592
603
|
DropdownMenuPrimitive.Separator,
|
593
604
|
{
|
594
605
|
ref,
|
@@ -601,7 +612,7 @@ var DropdownMenuShortcut = ({
|
|
601
612
|
className,
|
602
613
|
...props
|
603
614
|
}) => {
|
604
|
-
return /* @__PURE__ */
|
615
|
+
return /* @__PURE__ */ React6.createElement(
|
605
616
|
"span",
|
606
617
|
{
|
607
618
|
className: cn(
|
@@ -641,10 +652,10 @@ var DropdownMenu = ({
|
|
641
652
|
default: "hawa-px-2 hawa-py-3 ",
|
642
653
|
sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
|
643
654
|
};
|
644
|
-
let [values, setValues] =
|
655
|
+
let [values, setValues] = React6.useState(
|
645
656
|
items.map((item) => item.currentOption)
|
646
657
|
);
|
647
|
-
return /* @__PURE__ */
|
658
|
+
return /* @__PURE__ */ React6.createElement(
|
648
659
|
DropdownMenuRoot,
|
649
660
|
{
|
650
661
|
onOpenChange,
|
@@ -652,8 +663,8 @@ var DropdownMenu = ({
|
|
652
663
|
modal: false,
|
653
664
|
dir: direction
|
654
665
|
},
|
655
|
-
/* @__PURE__ */
|
656
|
-
/* @__PURE__ */
|
666
|
+
/* @__PURE__ */ React6.createElement(DropdownMenuTrigger, { asChild: true, className: triggerClassname }, trigger),
|
667
|
+
/* @__PURE__ */ React6.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React6.createElement(
|
657
668
|
DropdownMenuContent,
|
658
669
|
{
|
659
670
|
side,
|
@@ -674,12 +685,12 @@ var DropdownMenu = ({
|
|
674
685
|
var _a;
|
675
686
|
const ItemLinkComponent = item.slug ? LinkComponent : "a";
|
676
687
|
if (item.itemType === "separator") {
|
677
|
-
return /* @__PURE__ */
|
688
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuSeparator, { key: index });
|
678
689
|
} else if (item.itemType === "label") {
|
679
|
-
return /* @__PURE__ */
|
690
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuLabel, { key: index }, item.label);
|
680
691
|
} else if (item.itemType === "radio") {
|
681
692
|
let dd = item.currentOption;
|
682
|
-
return /* @__PURE__ */
|
693
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
|
683
694
|
DropdownMenuSubTrigger,
|
684
695
|
{
|
685
696
|
dir: direction,
|
@@ -687,7 +698,7 @@ var DropdownMenu = ({
|
|
687
698
|
},
|
688
699
|
item.icon && item.icon,
|
689
700
|
item.label && item.label
|
690
|
-
), /* @__PURE__ */
|
701
|
+
), /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React6.createElement(
|
691
702
|
DropdownMenuRadioGroup,
|
692
703
|
{
|
693
704
|
value: values[index],
|
@@ -701,12 +712,12 @@ var DropdownMenu = ({
|
|
701
712
|
}
|
702
713
|
}
|
703
714
|
},
|
704
|
-
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */
|
715
|
+
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React6.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
|
705
716
|
)));
|
706
717
|
} else if (item.itemType === "custom") {
|
707
|
-
return /* @__PURE__ */
|
718
|
+
return /* @__PURE__ */ React6.createElement("div", { key: index }, item.content);
|
708
719
|
} else {
|
709
|
-
return item.subitems ? /* @__PURE__ */
|
720
|
+
return item.subitems ? /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
|
710
721
|
DropdownMenuSubTrigger,
|
711
722
|
{
|
712
723
|
dir: direction,
|
@@ -714,9 +725,9 @@ var DropdownMenu = ({
|
|
714
725
|
},
|
715
726
|
item.icon && item.icon,
|
716
727
|
item.label && item.label
|
717
|
-
), /* @__PURE__ */
|
728
|
+
), /* @__PURE__ */ React6.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => {
|
718
729
|
const SubitemLinkComponent = subitem.slug ? LinkComponent : "a";
|
719
|
-
return /* @__PURE__ */
|
730
|
+
return /* @__PURE__ */ React6.createElement(
|
720
731
|
DropdownMenuItem,
|
721
732
|
{
|
722
733
|
key: subIndex,
|
@@ -745,7 +756,7 @@ var DropdownMenu = ({
|
|
745
756
|
subitem.icon && subitem.icon,
|
746
757
|
subitem.label && subitem.label
|
747
758
|
);
|
748
|
-
})))) : /* @__PURE__ */
|
759
|
+
})))) : /* @__PURE__ */ React6.createElement(
|
749
760
|
DropdownMenuItem,
|
750
761
|
{
|
751
762
|
LinkComponent: ItemLinkComponent,
|
@@ -799,10 +810,10 @@ var DropdownMenu = ({
|
|
799
810
|
};
|
800
811
|
|
801
812
|
// elements/input/Input.tsx
|
802
|
-
import
|
813
|
+
import React8, { forwardRef as forwardRef4 } from "react";
|
803
814
|
|
804
815
|
// elements/skeleton/Skeleton.tsx
|
805
|
-
import
|
816
|
+
import React7 from "react";
|
806
817
|
function Skeleton({
|
807
818
|
className,
|
808
819
|
content,
|
@@ -821,7 +832,7 @@ function Skeleton({
|
|
821
832
|
right: "hawa-mask-fade-right",
|
822
833
|
left: "hawa-mask-fade-left "
|
823
834
|
};
|
824
|
-
return /* @__PURE__ */
|
835
|
+
return /* @__PURE__ */ React7.createElement(
|
825
836
|
"div",
|
826
837
|
{
|
827
838
|
className: cn(
|
@@ -881,7 +892,7 @@ var Input = forwardRef4(
|
|
881
892
|
props.onChange(newEvent);
|
882
893
|
}
|
883
894
|
};
|
884
|
-
return /* @__PURE__ */
|
895
|
+
return /* @__PURE__ */ React8.createElement(
|
885
896
|
"div",
|
886
897
|
{
|
887
898
|
className: cn(
|
@@ -892,8 +903,8 @@ var Input = forwardRef4(
|
|
892
903
|
"hawa-w-full hawa-gap-2"
|
893
904
|
)
|
894
905
|
},
|
895
|
-
props.label && /* @__PURE__ */
|
896
|
-
/* @__PURE__ */
|
906
|
+
props.label && /* @__PURE__ */ React8.createElement(Label, { ...labelProps }, props.label),
|
907
|
+
/* @__PURE__ */ React8.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ React8.createElement(
|
897
908
|
"span",
|
898
909
|
{
|
899
910
|
className: cn(
|
@@ -902,7 +913,7 @@ var Input = forwardRef4(
|
|
902
913
|
)
|
903
914
|
},
|
904
915
|
props.outsidePrefix
|
905
|
-
), props.isLoading ? /* @__PURE__ */
|
916
|
+
), props.isLoading ? /* @__PURE__ */ React8.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React8.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React8.createElement(React8.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React8.createElement(
|
906
917
|
"div",
|
907
918
|
{
|
908
919
|
className: cn(
|
@@ -910,7 +921,7 @@ var Input = forwardRef4(
|
|
910
921
|
preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
911
922
|
)
|
912
923
|
}
|
913
|
-
), /* @__PURE__ */
|
924
|
+
), /* @__PURE__ */ React8.createElement("div", { className: "hawa-flex hawa-flex-col hawa-w-full hawa-gap-2" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ React8.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React8.createElement(
|
914
925
|
"div",
|
915
926
|
{
|
916
927
|
className: cn(
|
@@ -919,7 +930,7 @@ var Input = forwardRef4(
|
|
919
930
|
)
|
920
931
|
},
|
921
932
|
props.endIcon
|
922
|
-
), /* @__PURE__ */
|
933
|
+
), /* @__PURE__ */ React8.createElement(
|
923
934
|
"input",
|
924
935
|
{
|
925
936
|
required: true,
|
@@ -945,7 +956,7 @@ var Input = forwardRef4(
|
|
945
956
|
inputProps == null ? void 0 : inputProps.className
|
946
957
|
)
|
947
958
|
}
|
948
|
-
)), !forceHideHelperText && /* @__PURE__ */
|
959
|
+
)), !forceHideHelperText && /* @__PURE__ */ React8.createElement(
|
949
960
|
"p",
|
950
961
|
{
|
951
962
|
className: cn(
|
@@ -954,7 +965,7 @@ var Input = forwardRef4(
|
|
954
965
|
)
|
955
966
|
},
|
956
967
|
props.helperText
|
957
|
-
), !props.disabled && forceHideHelperText && /* @__PURE__ */
|
968
|
+
), !props.disabled && forceHideHelperText && /* @__PURE__ */ React8.createElement(
|
958
969
|
"div",
|
959
970
|
{
|
960
971
|
className: cn(
|
@@ -963,7 +974,7 @@ var Input = forwardRef4(
|
|
963
974
|
)
|
964
975
|
},
|
965
976
|
props.helperText
|
966
|
-
), showCount && /* @__PURE__ */
|
977
|
+
), showCount && /* @__PURE__ */ React8.createElement(
|
967
978
|
"div",
|
968
979
|
{
|
969
980
|
className: cn(
|
@@ -984,8 +995,8 @@ var Input = forwardRef4(
|
|
984
995
|
);
|
985
996
|
|
986
997
|
// elements/table/Table.tsx
|
987
|
-
import * as
|
988
|
-
var Table =
|
998
|
+
import * as React9 from "react";
|
999
|
+
var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React9.createElement(
|
989
1000
|
"table",
|
990
1001
|
{
|
991
1002
|
ref,
|
@@ -993,7 +1004,7 @@ var Table = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
993
1004
|
...props
|
994
1005
|
}
|
995
1006
|
)));
|
996
|
-
var TableHeader =
|
1007
|
+
var TableHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
997
1008
|
"thead",
|
998
1009
|
{
|
999
1010
|
ref,
|
@@ -1001,8 +1012,8 @@ var TableHeader = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
1001
1012
|
...props
|
1002
1013
|
}
|
1003
1014
|
));
|
1004
|
-
var TableHead =
|
1005
|
-
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */
|
1015
|
+
var TableHead = React9.forwardRef(
|
1016
|
+
({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
1006
1017
|
"th",
|
1007
1018
|
{
|
1008
1019
|
ref,
|
@@ -1020,8 +1031,8 @@ var TableHead = React8.forwardRef(
|
|
1020
1031
|
}
|
1021
1032
|
)
|
1022
1033
|
);
|
1023
|
-
var TableBody =
|
1024
|
-
var TableFooter =
|
1034
|
+
var TableBody = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("tbody", { ref, className: cn("hawa-border-none", className), ...props }));
|
1035
|
+
var TableFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
1025
1036
|
"tfoot",
|
1026
1037
|
{
|
1027
1038
|
ref,
|
@@ -1032,7 +1043,7 @@ var TableFooter = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
1032
1043
|
...props
|
1033
1044
|
}
|
1034
1045
|
));
|
1035
|
-
var TableRow =
|
1046
|
+
var TableRow = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
1036
1047
|
"tr",
|
1037
1048
|
{
|
1038
1049
|
ref,
|
@@ -1045,14 +1056,14 @@ var TableRow = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
1045
1056
|
...props
|
1046
1057
|
}
|
1047
1058
|
));
|
1048
|
-
var TableCell =
|
1059
|
+
var TableCell = React9.forwardRef(
|
1049
1060
|
({ className, enablePadding = true, padding = "default", ...props }, ref) => {
|
1050
1061
|
let paddingStyles = {
|
1051
1062
|
condensed: "hawa-p-0 hawa-px-4",
|
1052
1063
|
default: "hawa-p-4",
|
1053
1064
|
noPadding: "hawa-p-0"
|
1054
1065
|
};
|
1055
|
-
return /* @__PURE__ */
|
1066
|
+
return /* @__PURE__ */ React9.createElement(
|
1056
1067
|
"td",
|
1057
1068
|
{
|
1058
1069
|
ref,
|
@@ -1073,7 +1084,7 @@ var TableCell = React8.forwardRef(
|
|
1073
1084
|
);
|
1074
1085
|
}
|
1075
1086
|
);
|
1076
|
-
var TableCaption =
|
1087
|
+
var TableCaption = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
1077
1088
|
"caption",
|
1078
1089
|
{
|
1079
1090
|
ref,
|
@@ -1105,16 +1116,16 @@ var DataTable = ({
|
|
1105
1116
|
...props
|
1106
1117
|
}) => {
|
1107
1118
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
1108
|
-
const [sorting, setSorting] =
|
1119
|
+
const [sorting, setSorting] = React10.useState(
|
1109
1120
|
props.defaultSort ? [{ id: props.defaultSort, desc: false }] : []
|
1110
1121
|
);
|
1111
|
-
const [columnFilters, setColumnFilters] =
|
1122
|
+
const [columnFilters, setColumnFilters] = React10.useState(
|
1112
1123
|
[]
|
1113
1124
|
);
|
1114
|
-
const [globalFilter, setGlobalFilter] =
|
1115
|
-
const [expanded, setExpanded] =
|
1116
|
-
const [columnVisibility, setColumnVisibility] =
|
1117
|
-
const [rowSelection, setRowSelection] =
|
1125
|
+
const [globalFilter, setGlobalFilter] = React10.useState("");
|
1126
|
+
const [expanded, setExpanded] = React10.useState({});
|
1127
|
+
const [columnVisibility, setColumnVisibility] = React10.useState({});
|
1128
|
+
const [rowSelection, setRowSelection] = React10.useState({});
|
1118
1129
|
const table = useReactTable({
|
1119
1130
|
data,
|
1120
1131
|
columns,
|
@@ -1143,7 +1154,7 @@ var DataTable = ({
|
|
1143
1154
|
label: `${item} / ${pageText}`,
|
1144
1155
|
value: item
|
1145
1156
|
}));
|
1146
|
-
|
1157
|
+
React10.useEffect(() => {
|
1147
1158
|
setColumnVisibility((prev) => {
|
1148
1159
|
let newColumnVisibility = {};
|
1149
1160
|
columns.forEach((column) => {
|
@@ -1153,24 +1164,52 @@ var DataTable = ({
|
|
1153
1164
|
return newColumnVisibility;
|
1154
1165
|
});
|
1155
1166
|
}, [columns]);
|
1156
|
-
return /* @__PURE__ */
|
1167
|
+
return /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React10.createElement(
|
1157
1168
|
Input,
|
1158
1169
|
{
|
1170
|
+
inputProps: { title: "" },
|
1159
1171
|
forceHideHelperText: true,
|
1160
1172
|
placeholder: (_c = props.texts) == null ? void 0 : _c.searchPlaceholder,
|
1161
1173
|
value: globalFilter != null ? globalFilter : "",
|
1162
1174
|
onChange: (event) => setGlobalFilter(event.target.value),
|
1163
1175
|
margin: "none",
|
1164
|
-
className: "hawa-w-full md:hawa-max-w-sm"
|
1176
|
+
className: "hawa-w-full md:hawa-max-w-sm",
|
1177
|
+
endIconProps: { className: "!hawa-end-2" },
|
1178
|
+
endIcon: globalFilter ? /* @__PURE__ */ React10.createElement(
|
1179
|
+
Button,
|
1180
|
+
{
|
1181
|
+
onClick: () => setGlobalFilter(""),
|
1182
|
+
variant: "ghost",
|
1183
|
+
size: "smallIcon",
|
1184
|
+
"aria-label": "Clear Search"
|
1185
|
+
},
|
1186
|
+
/* @__PURE__ */ React10.createElement(
|
1187
|
+
"svg",
|
1188
|
+
{
|
1189
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1190
|
+
width: "16",
|
1191
|
+
height: "16",
|
1192
|
+
viewBox: "0 0 24 24",
|
1193
|
+
fill: "none",
|
1194
|
+
stroke: "currentColor",
|
1195
|
+
strokeWidth: "2",
|
1196
|
+
strokeLinecap: "round",
|
1197
|
+
strokeLinejoin: "round",
|
1198
|
+
className: "hawa-icon hawa-text-muted-foreground"
|
1199
|
+
},
|
1200
|
+
/* @__PURE__ */ React10.createElement("path", { d: "M18 6 6 18" }),
|
1201
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m6 6 12 12" })
|
1202
|
+
)
|
1203
|
+
) : null
|
1165
1204
|
}
|
1166
|
-
), enableHideColumns && /* @__PURE__ */
|
1205
|
+
), enableHideColumns && /* @__PURE__ */ React10.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React10.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React10.createElement(
|
1167
1206
|
Button,
|
1168
1207
|
{
|
1169
1208
|
variant: "outline",
|
1170
1209
|
className: "hawa-flex hawa-flex-row hawa-gap-2"
|
1171
1210
|
},
|
1172
1211
|
((_d = props.texts) == null ? void 0 : _d.columns) || "Columns",
|
1173
|
-
/* @__PURE__ */
|
1212
|
+
/* @__PURE__ */ React10.createElement(
|
1174
1213
|
"svg",
|
1175
1214
|
{
|
1176
1215
|
"aria-label": "Chevron Down Icon",
|
@@ -1185,16 +1224,16 @@ var DataTable = ({
|
|
1185
1224
|
strokeLinejoin: "round",
|
1186
1225
|
className: "hawa-icon hawa-rotate-90"
|
1187
1226
|
},
|
1188
|
-
/* @__PURE__ */
|
1227
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m9 18 6-6-6-6" })
|
1189
1228
|
)
|
1190
|
-
)), /* @__PURE__ */
|
1229
|
+
)), /* @__PURE__ */ React10.createElement(
|
1191
1230
|
DropdownMenuContent,
|
1192
1231
|
{
|
1193
1232
|
align: props.direction === "rtl" ? "start" : "end"
|
1194
1233
|
},
|
1195
1234
|
table.getAllColumns().filter((column) => column.getCanHide()).map((column) => {
|
1196
1235
|
var _a2, _b2;
|
1197
|
-
return /* @__PURE__ */
|
1236
|
+
return /* @__PURE__ */ React10.createElement(
|
1198
1237
|
DropdownMenuCheckboxItem,
|
1199
1238
|
{
|
1200
1239
|
key: column.id,
|
@@ -1206,7 +1245,7 @@ var DataTable = ({
|
|
1206
1245
|
) : column.id
|
1207
1246
|
);
|
1208
1247
|
})
|
1209
|
-
))), props.isLoading ? /* @__PURE__ */
|
1248
|
+
))), props.isLoading ? /* @__PURE__ */ React10.createElement(Skeleton, { className: "hawa-h-[130px] hawa-w-full" }) : /* @__PURE__ */ React10.createElement(
|
1210
1249
|
"div",
|
1211
1250
|
{
|
1212
1251
|
className: cn(
|
@@ -1214,10 +1253,10 @@ var DataTable = ({
|
|
1214
1253
|
paginationPosition === "top" ? "hawa-flex-col-reverse" : "hawa-flex-col"
|
1215
1254
|
)
|
1216
1255
|
},
|
1217
|
-
/* @__PURE__ */
|
1256
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-rounded-md" }, /* @__PURE__ */ React10.createElement(Table, null, table.getAllColumns().length > 0 && /* @__PURE__ */ React10.createElement(TableHeader, null, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React10.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => {
|
1218
1257
|
var _a2;
|
1219
1258
|
let isSortable = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.sortable;
|
1220
|
-
return /* @__PURE__ */
|
1259
|
+
return /* @__PURE__ */ React10.createElement(
|
1221
1260
|
TableHead,
|
1222
1261
|
{
|
1223
1262
|
dir: props.direction,
|
@@ -1233,7 +1272,7 @@ var DataTable = ({
|
|
1233
1272
|
header.getContext()
|
1234
1273
|
)
|
1235
1274
|
);
|
1236
|
-
})))), /* @__PURE__ */
|
1275
|
+
})))), /* @__PURE__ */ React10.createElement(TableBody, null, ((_e = table.getRowModel().rows) == null ? void 0 : _e.length) ? table.getRowModel().rows.map((row) => /* @__PURE__ */ React10.createElement(
|
1237
1276
|
TableRow,
|
1238
1277
|
{
|
1239
1278
|
key: row.id,
|
@@ -1241,7 +1280,7 @@ var DataTable = ({
|
|
1241
1280
|
},
|
1242
1281
|
row.getVisibleCells().map((cell) => {
|
1243
1282
|
var _a2;
|
1244
|
-
return /* @__PURE__ */
|
1283
|
+
return /* @__PURE__ */ React10.createElement(
|
1245
1284
|
TableCell,
|
1246
1285
|
{
|
1247
1286
|
style: {
|
@@ -1257,7 +1296,7 @@ var DataTable = ({
|
|
1257
1296
|
)
|
1258
1297
|
);
|
1259
1298
|
})
|
1260
|
-
)) : /* @__PURE__ */
|
1299
|
+
)) : /* @__PURE__ */ React10.createElement(TableRow, null, /* @__PURE__ */ React10.createElement(
|
1261
1300
|
TableCell,
|
1262
1301
|
{
|
1263
1302
|
colSpan: columns.length,
|
@@ -1265,16 +1304,16 @@ var DataTable = ({
|
|
1265
1304
|
},
|
1266
1305
|
(_f = props.texts) == null ? void 0 : _f.noData
|
1267
1306
|
))))),
|
1268
|
-
/* @__PURE__ */
|
1307
|
+
/* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between" }, !props.showCount && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }), props.showCount && /* @__PURE__ */ React10.createElement(
|
1269
1308
|
"div",
|
1270
1309
|
{
|
1271
1310
|
className: "text-muted-foreground text-sm",
|
1272
1311
|
dir: props.direction
|
1273
1312
|
},
|
1274
|
-
/* @__PURE__ */
|
1313
|
+
/* @__PURE__ */ React10.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
|
1275
1314
|
" ",
|
1276
|
-
/* @__PURE__ */
|
1277
|
-
), /* @__PURE__ */
|
1315
|
+
/* @__PURE__ */ React10.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
|
1316
|
+
), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-sm" }, (_h = props.texts) == null ? void 0 : _h.goTo), /* @__PURE__ */ React10.createElement(
|
1278
1317
|
"input",
|
1279
1318
|
{
|
1280
1319
|
max: table.getPageCount(),
|
@@ -1291,7 +1330,7 @@ var DataTable = ({
|
|
1291
1330
|
},
|
1292
1331
|
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm"
|
1293
1332
|
}
|
1294
|
-
)), /* @__PURE__ */
|
1333
|
+
)), /* @__PURE__ */ React10.createElement(
|
1295
1334
|
DropdownMenu,
|
1296
1335
|
{
|
1297
1336
|
size: "sm",
|
@@ -1304,7 +1343,7 @@ var DataTable = ({
|
|
1304
1343
|
{ label: `40 / ${pageText}`, value: 40 },
|
1305
1344
|
{ label: `50 / ${pageText}`, value: 50 }
|
1306
1345
|
],
|
1307
|
-
trigger: /* @__PURE__ */
|
1346
|
+
trigger: /* @__PURE__ */ React10.createElement(
|
1308
1347
|
Button,
|
1309
1348
|
{
|
1310
1349
|
variant: "outline",
|
@@ -1315,7 +1354,7 @@ var DataTable = ({
|
|
1315
1354
|
),
|
1316
1355
|
onItemSelect: (e) => table.setPageSize(Number(e))
|
1317
1356
|
}
|
1318
|
-
), table.getPageCount() > 1 && /* @__PURE__ */
|
1357
|
+
), table.getPageCount() > 1 && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm " }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React10.createElement("div", null, (_j = props.texts) == null ? void 0 : _j.page), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React10.createElement("span", null, (_k = props.texts) == null ? void 0 : _k.of), /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React10.createElement(
|
1319
1358
|
Button,
|
1320
1359
|
{
|
1321
1360
|
"aria-label": "Next Table Page",
|
@@ -1327,7 +1366,7 @@ var DataTable = ({
|
|
1327
1366
|
props.direction === "rtl" && "hawa-rotate-180"
|
1328
1367
|
)
|
1329
1368
|
},
|
1330
|
-
/* @__PURE__ */
|
1369
|
+
/* @__PURE__ */ React10.createElement(
|
1331
1370
|
"svg",
|
1332
1371
|
{
|
1333
1372
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1340,10 +1379,10 @@ var DataTable = ({
|
|
1340
1379
|
strokeLinecap: "round",
|
1341
1380
|
strokeLinejoin: "round"
|
1342
1381
|
},
|
1343
|
-
/* @__PURE__ */
|
1344
|
-
/* @__PURE__ */
|
1382
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1383
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
|
1345
1384
|
)
|
1346
|
-
), /* @__PURE__ */
|
1385
|
+
), /* @__PURE__ */ React10.createElement(
|
1347
1386
|
Button,
|
1348
1387
|
{
|
1349
1388
|
"aria-label": "Previous Table Page",
|
@@ -1355,7 +1394,7 @@ var DataTable = ({
|
|
1355
1394
|
props.direction === "rtl" && "hawa-rotate-180"
|
1356
1395
|
)
|
1357
1396
|
},
|
1358
|
-
/* @__PURE__ */
|
1397
|
+
/* @__PURE__ */ React10.createElement(
|
1359
1398
|
"svg",
|
1360
1399
|
{
|
1361
1400
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1369,9 +1408,9 @@ var DataTable = ({
|
|
1369
1408
|
strokeLinecap: "round",
|
1370
1409
|
strokeLinejoin: "round"
|
1371
1410
|
},
|
1372
|
-
/* @__PURE__ */
|
1411
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
|
1373
1412
|
)
|
1374
|
-
), /* @__PURE__ */
|
1413
|
+
), /* @__PURE__ */ React10.createElement(
|
1375
1414
|
Button,
|
1376
1415
|
{
|
1377
1416
|
"aria-label": "Next Table Page",
|
@@ -1383,7 +1422,7 @@ var DataTable = ({
|
|
1383
1422
|
props.direction === "ltr" && "hawa-rotate-180"
|
1384
1423
|
)
|
1385
1424
|
},
|
1386
|
-
/* @__PURE__ */
|
1425
|
+
/* @__PURE__ */ React10.createElement(
|
1387
1426
|
"svg",
|
1388
1427
|
{
|
1389
1428
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1397,9 +1436,9 @@ var DataTable = ({
|
|
1397
1436
|
strokeLinecap: "round",
|
1398
1437
|
strokeLinejoin: "round"
|
1399
1438
|
},
|
1400
|
-
/* @__PURE__ */
|
1439
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
|
1401
1440
|
)
|
1402
|
-
), /* @__PURE__ */
|
1441
|
+
), /* @__PURE__ */ React10.createElement(
|
1403
1442
|
Button,
|
1404
1443
|
{
|
1405
1444
|
"aria-label": "Next Table Page",
|
@@ -1411,7 +1450,7 @@ var DataTable = ({
|
|
1411
1450
|
props.direction === "ltr" && "hawa-rotate-180"
|
1412
1451
|
)
|
1413
1452
|
},
|
1414
|
-
/* @__PURE__ */
|
1453
|
+
/* @__PURE__ */ React10.createElement(
|
1415
1454
|
"svg",
|
1416
1455
|
{
|
1417
1456
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -1424,8 +1463,8 @@ var DataTable = ({
|
|
1424
1463
|
strokeLinecap: "round",
|
1425
1464
|
strokeLinejoin: "round"
|
1426
1465
|
},
|
1427
|
-
/* @__PURE__ */
|
1428
|
-
/* @__PURE__ */
|
1466
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
|
1467
|
+
/* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
|
1429
1468
|
)
|
1430
1469
|
))))
|
1431
1470
|
));
|