@sikka/hawa 0.35.5-next → 0.36.0-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/{Chip-BtgTAs8x.d.mts → Chip-CGl24Kd9.d.mts} +2 -2
- package/dist/{Chip-DQsP5hFS.d.ts → Chip-Cato49ar.d.ts} +2 -2
- package/dist/accordion/index.d.mts +1 -1
- package/dist/accordion/index.d.ts +1 -1
- package/dist/accordion/index.js +6 -4
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +6 -4
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/appLayout/index.js +180 -172
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +201 -193
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +28 -5
- package/dist/blocks/auth/index.mjs +4 -4
- package/dist/blocks/feedback/index.js +0 -1
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.js +94 -69
- package/dist/blocks/index.mjs +12 -12
- package/dist/blocks/misc/index.js +81 -56
- package/dist/blocks/misc/index.mjs +65 -65
- package/dist/blocks/pricing/index.js +6 -4
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/chip/index.d.mts +2 -2
- package/dist/chip/index.d.ts +2 -2
- package/dist/chip/index.js +6 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +6 -4
- package/dist/chip/index.mjs.map +1 -1
- package/dist/{chunk-HSRW7X3Z.mjs → chunk-6QIOEUE2.mjs} +1 -1
- package/dist/{chunk-JEZLVXSU.mjs → chunk-BXBSZD5X.mjs} +26 -2
- package/dist/{chunk-LVXG3SMD.mjs → chunk-CJ57JBYA.mjs} +6 -4
- package/dist/{chunk-CD6AQVU3.mjs → chunk-HLYAX77R.mjs} +0 -1
- package/dist/{chunk-G7JHUC5N.mjs → chunk-NNPNQK6F.mjs} +211 -4
- package/dist/chunk-SYGWSBJL.mjs +63 -0
- package/dist/{chunk-TERP5K6R.mjs → chunk-T33FXOHA.mjs} +29 -189
- package/dist/colorPicker/index.js +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/dataTable/index.js +41 -5
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +41 -5
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +1 -0
- package/dist/datePicker/index.d.ts +1 -0
- package/dist/datePicker/index.js +3 -2
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +3 -2
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +8 -4
- package/dist/elements/index.d.ts +8 -4
- package/dist/elements/index.js +124 -87
- package/dist/elements/index.mjs +25 -13
- package/dist/hooks/index.d.mts +4 -1
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/index.js +31 -2
- package/dist/hooks/index.mjs +4 -2
- package/dist/index.css +10 -0
- package/dist/index.d.mts +11 -5
- package/dist/index.d.ts +11 -5
- package/dist/index.js +225 -189
- package/dist/index.mjs +771 -736
- package/dist/input/index.d.mts +6 -2
- package/dist/input/index.d.ts +6 -2
- package/dist/input/index.js +26 -2
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +26 -2
- package/dist/input/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +289 -281
- package/dist/layout/index.mjs +24 -56
- package/dist/passwordInput/index.js +26 -2
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +26 -2
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +1 -2
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +1 -2
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +1 -1
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +1 -1
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/select/index.js +0 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +0 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/sidebar/index.js +6 -4
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +6 -4
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/tabs/index.d.mts +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/index.js +26 -24
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +30 -28
- package/dist/tabs/index.mjs.map +1 -1
- package/package.json +7 -8
- package/dist/chunk-545D35G6.mjs +0 -54
package/dist/appLayout/index.mjs
CHANGED
@@ -1,28 +1,37 @@
|
|
1
1
|
"use client";
|
2
2
|
|
3
3
|
// layout/appLayout/AppLayout.tsx
|
4
|
-
import
|
4
|
+
import React12, { useEffect as useEffect2, useState as useState2 } from "react";
|
5
5
|
|
6
|
-
// hooks/
|
7
|
-
import
|
8
|
-
var
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
// hooks/useClickOutside.ts
|
7
|
+
import { useEffect, useRef } from "react";
|
8
|
+
var DEFAULT_EVENTS = ["mousedown", "touchstart"];
|
9
|
+
function useClickOutside(handler, events, nodes) {
|
10
|
+
const ref = useRef();
|
11
|
+
useEffect(() => {
|
12
|
+
const listener = (event) => {
|
13
|
+
const { target } = event != null ? event : {};
|
14
|
+
if (Array.isArray(nodes)) {
|
15
|
+
const shouldIgnore = (target == null ? void 0 : target.hasAttribute("data-ignore-outside-clicks")) || !document.body.contains(target) && target.tagName !== "HTML";
|
16
|
+
const shouldTrigger = nodes.every(
|
17
|
+
(node) => !!node && !event.composedPath().includes(node)
|
18
|
+
);
|
19
|
+
shouldTrigger && !shouldIgnore && handler();
|
20
|
+
} else if (ref.current && !ref.current.contains(target)) {
|
21
|
+
handler();
|
14
22
|
}
|
15
23
|
};
|
16
|
-
|
17
|
-
|
24
|
+
(events || DEFAULT_EVENTS).forEach(
|
25
|
+
(fn) => document.addEventListener(fn, listener)
|
26
|
+
);
|
18
27
|
return () => {
|
19
|
-
|
20
|
-
|
28
|
+
(events || DEFAULT_EVENTS).forEach(
|
29
|
+
(fn) => document.removeEventListener(fn, listener)
|
30
|
+
);
|
21
31
|
};
|
22
|
-
}, [ref,
|
32
|
+
}, [ref, handler, nodes]);
|
23
33
|
return ref;
|
24
|
-
}
|
25
|
-
var useOutsideClick_default = useOutsideClick;
|
34
|
+
}
|
26
35
|
|
27
36
|
// util/index.ts
|
28
37
|
import { clsx } from "clsx";
|
@@ -32,12 +41,12 @@ function cn(...inputs) {
|
|
32
41
|
}
|
33
42
|
|
34
43
|
// elements/button/Button.tsx
|
35
|
-
import * as
|
44
|
+
import * as React5 from "react";
|
36
45
|
import { cva } from "class-variance-authority";
|
37
46
|
|
38
47
|
// elements/helperText/HelperText.tsx
|
39
|
-
import
|
40
|
-
var HelperText = ({ helperText }) => /* @__PURE__ */
|
48
|
+
import React from "react";
|
49
|
+
var HelperText = ({ helperText }) => /* @__PURE__ */ React.createElement(
|
41
50
|
"p",
|
42
51
|
{
|
43
52
|
className: cn(
|
@@ -49,12 +58,12 @@ var HelperText = ({ helperText }) => /* @__PURE__ */ React2.createElement(
|
|
49
58
|
);
|
50
59
|
|
51
60
|
// elements/label/Label.tsx
|
52
|
-
import * as
|
61
|
+
import * as React3 from "react";
|
53
62
|
|
54
63
|
// elements/tooltip/Tooltip.tsx
|
55
|
-
import
|
64
|
+
import React2 from "react";
|
56
65
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
57
|
-
var TooltipContent =
|
66
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, size = "default", ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
58
67
|
TooltipPrimitive.Content,
|
59
68
|
{
|
60
69
|
ref,
|
@@ -71,7 +80,7 @@ var TooltipContent = React3.forwardRef(({ className, sideOffset = 4, size = "def
|
|
71
80
|
}
|
72
81
|
));
|
73
82
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
74
|
-
var TooltipArrow =
|
83
|
+
var TooltipArrow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
75
84
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
76
85
|
var Tooltip = ({
|
77
86
|
side,
|
@@ -88,13 +97,13 @@ var Tooltip = ({
|
|
88
97
|
delayDuration = 300,
|
89
98
|
...props
|
90
99
|
}) => {
|
91
|
-
return /* @__PURE__ */
|
100
|
+
return /* @__PURE__ */ React2.createElement(
|
92
101
|
TooltipPrimitive.TooltipProvider,
|
93
102
|
{
|
94
103
|
delayDuration,
|
95
104
|
...providerProps
|
96
105
|
},
|
97
|
-
/* @__PURE__ */
|
106
|
+
/* @__PURE__ */ React2.createElement(
|
98
107
|
TooltipPrimitive.Root,
|
99
108
|
{
|
100
109
|
open: !disabled && open,
|
@@ -102,8 +111,8 @@ var Tooltip = ({
|
|
102
111
|
onOpenChange,
|
103
112
|
...props
|
104
113
|
},
|
105
|
-
/* @__PURE__ */
|
106
|
-
/* @__PURE__ */
|
114
|
+
/* @__PURE__ */ React2.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
115
|
+
/* @__PURE__ */ React2.createElement(
|
107
116
|
TooltipContent,
|
108
117
|
{
|
109
118
|
size,
|
@@ -123,7 +132,7 @@ var Tooltip = ({
|
|
123
132
|
};
|
124
133
|
|
125
134
|
// elements/label/Label.tsx
|
126
|
-
var Label =
|
135
|
+
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(
|
127
136
|
"label",
|
128
137
|
{
|
129
138
|
ref,
|
@@ -134,8 +143,8 @@ var Label = React4.forwardRef(({ className, hint, hintSide, required, children,
|
|
134
143
|
...props
|
135
144
|
},
|
136
145
|
children,
|
137
|
-
required && /* @__PURE__ */
|
138
|
-
), hint && /* @__PURE__ */
|
146
|
+
required && /* @__PURE__ */ React3.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
147
|
+
), hint && /* @__PURE__ */ React3.createElement(
|
139
148
|
Tooltip,
|
140
149
|
{
|
141
150
|
content: hint,
|
@@ -145,7 +154,7 @@ var Label = React4.forwardRef(({ className, hint, hintSide, required, children,
|
|
145
154
|
onClick: (event) => event.preventDefault()
|
146
155
|
}
|
147
156
|
},
|
148
|
-
/* @__PURE__ */
|
157
|
+
/* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement(
|
149
158
|
"svg",
|
150
159
|
{
|
151
160
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -157,15 +166,15 @@ var Label = React4.forwardRef(({ className, hint, hintSide, required, children,
|
|
157
166
|
strokeLinecap: "round",
|
158
167
|
strokeLinejoin: "round"
|
159
168
|
},
|
160
|
-
/* @__PURE__ */
|
161
|
-
/* @__PURE__ */
|
162
|
-
/* @__PURE__ */
|
169
|
+
/* @__PURE__ */ React3.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
170
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
171
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M12 17h.01" })
|
163
172
|
))
|
164
173
|
)));
|
165
174
|
Label.displayName = "Label";
|
166
175
|
|
167
176
|
// elements/loading/Loading.tsx
|
168
|
-
import
|
177
|
+
import React4 from "react";
|
169
178
|
var Loading = ({
|
170
179
|
design = "spinner",
|
171
180
|
size = "normal",
|
@@ -196,7 +205,7 @@ var Loading = ({
|
|
196
205
|
};
|
197
206
|
switch (design.split("-")[0]) {
|
198
207
|
case "dots":
|
199
|
-
return /* @__PURE__ */
|
208
|
+
return /* @__PURE__ */ React4.createElement(
|
200
209
|
"div",
|
201
210
|
{
|
202
211
|
className: cn(
|
@@ -204,7 +213,7 @@ var Loading = ({
|
|
204
213
|
classNames == null ? void 0 : classNames.container
|
205
214
|
)
|
206
215
|
},
|
207
|
-
/* @__PURE__ */
|
216
|
+
/* @__PURE__ */ React4.createElement(
|
208
217
|
"div",
|
209
218
|
{
|
210
219
|
className: cn(
|
@@ -215,7 +224,7 @@ var Loading = ({
|
|
215
224
|
)
|
216
225
|
}
|
217
226
|
),
|
218
|
-
/* @__PURE__ */
|
227
|
+
/* @__PURE__ */ React4.createElement(
|
219
228
|
"div",
|
220
229
|
{
|
221
230
|
className: cn(
|
@@ -226,7 +235,7 @@ var Loading = ({
|
|
226
235
|
)
|
227
236
|
}
|
228
237
|
),
|
229
|
-
/* @__PURE__ */
|
238
|
+
/* @__PURE__ */ React4.createElement(
|
230
239
|
"div",
|
231
240
|
{
|
232
241
|
className: cn(
|
@@ -239,7 +248,7 @@ var Loading = ({
|
|
239
248
|
)
|
240
249
|
);
|
241
250
|
case "square":
|
242
|
-
return /* @__PURE__ */
|
251
|
+
return /* @__PURE__ */ React4.createElement(
|
243
252
|
"svg",
|
244
253
|
{
|
245
254
|
className: cn(
|
@@ -251,7 +260,7 @@ var Loading = ({
|
|
251
260
|
height: "35",
|
252
261
|
width: "35"
|
253
262
|
},
|
254
|
-
/* @__PURE__ */
|
263
|
+
/* @__PURE__ */ React4.createElement(
|
255
264
|
"rect",
|
256
265
|
{
|
257
266
|
className: "squircle-track",
|
@@ -263,7 +272,7 @@ var Loading = ({
|
|
263
272
|
height: "32.5"
|
264
273
|
}
|
265
274
|
),
|
266
|
-
/* @__PURE__ */
|
275
|
+
/* @__PURE__ */ React4.createElement(
|
267
276
|
"rect",
|
268
277
|
{
|
269
278
|
className: "square-car",
|
@@ -278,7 +287,7 @@ var Loading = ({
|
|
278
287
|
)
|
279
288
|
);
|
280
289
|
case "squircle":
|
281
|
-
return /* @__PURE__ */
|
290
|
+
return /* @__PURE__ */ React4.createElement(
|
282
291
|
"svg",
|
283
292
|
{
|
284
293
|
x: "0px",
|
@@ -293,7 +302,7 @@ var Loading = ({
|
|
293
302
|
classNames == null ? void 0 : classNames.container
|
294
303
|
)
|
295
304
|
},
|
296
|
-
/* @__PURE__ */
|
305
|
+
/* @__PURE__ */ React4.createElement(
|
297
306
|
"path",
|
298
307
|
{
|
299
308
|
className: cn("squircle-track", classNames == null ? void 0 : classNames.track),
|
@@ -303,7 +312,7 @@ var Loading = ({
|
|
303
312
|
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"
|
304
313
|
}
|
305
314
|
),
|
306
|
-
/* @__PURE__ */
|
315
|
+
/* @__PURE__ */ React4.createElement(
|
307
316
|
"path",
|
308
317
|
{
|
309
318
|
className: cn("squircle-car", classNames == null ? void 0 : classNames.car),
|
@@ -315,7 +324,7 @@ var Loading = ({
|
|
315
324
|
)
|
316
325
|
);
|
317
326
|
case "progress":
|
318
|
-
return /* @__PURE__ */
|
327
|
+
return /* @__PURE__ */ React4.createElement(
|
319
328
|
"div",
|
320
329
|
{
|
321
330
|
className: cn(
|
@@ -326,9 +335,9 @@ var Loading = ({
|
|
326
335
|
}
|
327
336
|
);
|
328
337
|
case "orbit":
|
329
|
-
return /* @__PURE__ */
|
338
|
+
return /* @__PURE__ */ React4.createElement("div", { className: cn("orbit-container", classNames == null ? void 0 : classNames.container) });
|
330
339
|
default:
|
331
|
-
return /* @__PURE__ */
|
340
|
+
return /* @__PURE__ */ React4.createElement(
|
332
341
|
"svg",
|
333
342
|
{
|
334
343
|
viewBox: "0 0 40 40",
|
@@ -340,7 +349,7 @@ var Loading = ({
|
|
340
349
|
classNames == null ? void 0 : classNames.container
|
341
350
|
)
|
342
351
|
},
|
343
|
-
/* @__PURE__ */
|
352
|
+
/* @__PURE__ */ React4.createElement(
|
344
353
|
"circle",
|
345
354
|
{
|
346
355
|
className: cn(
|
@@ -359,7 +368,7 @@ var Loading = ({
|
|
359
368
|
pathLength: "100"
|
360
369
|
}
|
361
370
|
),
|
362
|
-
/* @__PURE__ */
|
371
|
+
/* @__PURE__ */ React4.createElement(
|
363
372
|
"circle",
|
364
373
|
{
|
365
374
|
className: cn(
|
@@ -413,7 +422,7 @@ var buttonVariants = cva(
|
|
413
422
|
defaultVariants: { variant: "default", size: "default" }
|
414
423
|
}
|
415
424
|
);
|
416
|
-
var Button =
|
425
|
+
var Button = React5.forwardRef(
|
417
426
|
({
|
418
427
|
className,
|
419
428
|
label,
|
@@ -429,7 +438,7 @@ var Button = React6.forwardRef(
|
|
429
438
|
}, ref) => {
|
430
439
|
const Comp = "button";
|
431
440
|
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
432
|
-
return /* @__PURE__ */
|
441
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
|
433
442
|
Comp,
|
434
443
|
{
|
435
444
|
className: cn(
|
@@ -439,7 +448,7 @@ var Button = React6.forwardRef(
|
|
439
448
|
ref,
|
440
449
|
...props
|
441
450
|
},
|
442
|
-
isLoading ? /* @__PURE__ */
|
451
|
+
isLoading ? /* @__PURE__ */ React5.createElement(
|
443
452
|
Loading,
|
444
453
|
{
|
445
454
|
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
@@ -448,20 +457,20 @@ var Button = React6.forwardRef(
|
|
448
457
|
size: size === "sm" || size === "xs" ? "xs" : "button"
|
449
458
|
}
|
450
459
|
) : children
|
451
|
-
), showHelperText && /* @__PURE__ */
|
460
|
+
), showHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
|
452
461
|
}
|
453
462
|
);
|
454
463
|
Button.displayName = "Button";
|
455
464
|
|
456
465
|
// elements/dropdownMenu/DropdownMenu.tsx
|
457
|
-
import * as
|
466
|
+
import * as React6 from "react";
|
458
467
|
import { Portal } from "@headlessui/react";
|
459
468
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
460
469
|
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
461
470
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
462
471
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
463
472
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
464
|
-
var DropdownMenuSubTrigger =
|
473
|
+
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
465
474
|
DropdownMenuPrimitive.SubTrigger,
|
466
475
|
{
|
467
476
|
ref,
|
@@ -472,9 +481,9 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
472
481
|
),
|
473
482
|
...props
|
474
483
|
},
|
475
|
-
/* @__PURE__ */
|
484
|
+
/* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
|
476
485
|
" ",
|
477
|
-
/* @__PURE__ */
|
486
|
+
/* @__PURE__ */ React6.createElement(
|
478
487
|
"svg",
|
479
488
|
{
|
480
489
|
"aria-label": "Chevron Right Icon",
|
@@ -486,7 +495,7 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
486
495
|
width: "1em",
|
487
496
|
className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
|
488
497
|
},
|
489
|
-
/* @__PURE__ */
|
498
|
+
/* @__PURE__ */ React6.createElement(
|
490
499
|
"path",
|
491
500
|
{
|
492
501
|
fillRule: "evenodd",
|
@@ -496,7 +505,7 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
496
505
|
)
|
497
506
|
));
|
498
507
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
499
|
-
var DropdownMenuSubContent =
|
508
|
+
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
500
509
|
DropdownMenuPrimitive.SubContent,
|
501
510
|
{
|
502
511
|
ref,
|
@@ -508,7 +517,7 @@ var DropdownMenuSubContent = React7.forwardRef(({ className, ...props }, ref) =>
|
|
508
517
|
}
|
509
518
|
));
|
510
519
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
511
|
-
var DropdownMenuContent =
|
520
|
+
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(
|
512
521
|
DropdownMenuPrimitive.Content,
|
513
522
|
{
|
514
523
|
ref,
|
@@ -521,8 +530,8 @@ var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, ...pro
|
|
521
530
|
}
|
522
531
|
)));
|
523
532
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
524
|
-
var DropdownMenuItem =
|
525
|
-
return /* @__PURE__ */
|
533
|
+
var DropdownMenuItem = React6.forwardRef(({ className, inset, badged, slug, LinkComponent, ...props }, ref) => {
|
534
|
+
return /* @__PURE__ */ React6.createElement(LinkComponent, { href: slug }, /* @__PURE__ */ React6.createElement(
|
526
535
|
DropdownMenuPrimitive.Item,
|
527
536
|
{
|
528
537
|
disabled: props.disabled,
|
@@ -535,14 +544,14 @@ var DropdownMenuItem = React7.forwardRef(({ className, inset, badged, slug, Link
|
|
535
544
|
),
|
536
545
|
...props
|
537
546
|
},
|
538
|
-
/* @__PURE__ */
|
547
|
+
/* @__PURE__ */ React6.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 " }, props.children),
|
539
548
|
props.end && props.end,
|
540
|
-
!props.end && props.shortcut && /* @__PURE__ */
|
541
|
-
!props.end && badged && /* @__PURE__ */
|
549
|
+
!props.end && props.shortcut && /* @__PURE__ */ React6.createElement(DropdownMenuShortcut, null, props.shortcut),
|
550
|
+
!props.end && badged && /* @__PURE__ */ React6.createElement("div", { className: "hawa-h-3 hawa-w-3 hawa-rounded-full hawa-bg-red-500" })
|
542
551
|
));
|
543
552
|
});
|
544
553
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
545
|
-
var DropdownMenuCheckboxItem =
|
554
|
+
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
546
555
|
DropdownMenuPrimitive.CheckboxItem,
|
547
556
|
{
|
548
557
|
ref,
|
@@ -553,7 +562,7 @@ var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked
|
|
553
562
|
checked,
|
554
563
|
...props
|
555
564
|
},
|
556
|
-
/* @__PURE__ */
|
565
|
+
/* @__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(
|
557
566
|
"svg",
|
558
567
|
{
|
559
568
|
"aria-label": "Check Mark",
|
@@ -564,12 +573,12 @@ var DropdownMenuCheckboxItem = React7.forwardRef(({ className, children, checked
|
|
564
573
|
height: "0.60em",
|
565
574
|
width: "0.60em"
|
566
575
|
},
|
567
|
-
/* @__PURE__ */
|
576
|
+
/* @__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" })
|
568
577
|
), " ")),
|
569
578
|
children
|
570
579
|
));
|
571
580
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
572
|
-
var DropdownMenuRadioItem =
|
581
|
+
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
573
582
|
DropdownMenuPrimitive.RadioItem,
|
574
583
|
{
|
575
584
|
ref,
|
@@ -579,7 +588,7 @@ var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }
|
|
579
588
|
),
|
580
589
|
...props
|
581
590
|
},
|
582
|
-
/* @__PURE__ */
|
591
|
+
/* @__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(
|
583
592
|
"svg",
|
584
593
|
{
|
585
594
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -594,12 +603,12 @@ var DropdownMenuRadioItem = React7.forwardRef(({ className, children, ...props }
|
|
594
603
|
strokeLinejoin: "round",
|
595
604
|
className: "hawa-h-2 hawa-w-2 hawa-fill-current"
|
596
605
|
},
|
597
|
-
/* @__PURE__ */
|
606
|
+
/* @__PURE__ */ React6.createElement("circle", { cx: "12", cy: "12", r: "10" })
|
598
607
|
))),
|
599
608
|
children
|
600
609
|
));
|
601
610
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
602
|
-
var DropdownMenuLabel =
|
611
|
+
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
603
612
|
DropdownMenuPrimitive.Label,
|
604
613
|
{
|
605
614
|
ref,
|
@@ -612,7 +621,7 @@ var DropdownMenuLabel = React7.forwardRef(({ className, inset, ...props }, ref)
|
|
612
621
|
}
|
613
622
|
));
|
614
623
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
615
|
-
var DropdownMenuSeparator =
|
624
|
+
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
616
625
|
DropdownMenuPrimitive.Separator,
|
617
626
|
{
|
618
627
|
ref,
|
@@ -625,7 +634,7 @@ var DropdownMenuShortcut = ({
|
|
625
634
|
className,
|
626
635
|
...props
|
627
636
|
}) => {
|
628
|
-
return /* @__PURE__ */
|
637
|
+
return /* @__PURE__ */ React6.createElement(
|
629
638
|
"span",
|
630
639
|
{
|
631
640
|
className: cn(
|
@@ -666,10 +675,10 @@ var DropdownMenu = ({
|
|
666
675
|
default: "hawa-px-2 hawa-py-3 ",
|
667
676
|
sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
|
668
677
|
};
|
669
|
-
let [values, setValues] =
|
678
|
+
let [values, setValues] = React6.useState(
|
670
679
|
items.map((item) => item.currentOption)
|
671
680
|
);
|
672
|
-
return /* @__PURE__ */
|
681
|
+
return /* @__PURE__ */ React6.createElement(
|
673
682
|
DropdownMenuRoot,
|
674
683
|
{
|
675
684
|
onOpenChange,
|
@@ -677,7 +686,7 @@ var DropdownMenu = ({
|
|
677
686
|
modal: false,
|
678
687
|
dir: direction
|
679
688
|
},
|
680
|
-
/* @__PURE__ */
|
689
|
+
/* @__PURE__ */ React6.createElement(
|
681
690
|
DropdownMenuTrigger,
|
682
691
|
{
|
683
692
|
asChild: true,
|
@@ -686,7 +695,7 @@ var DropdownMenu = ({
|
|
686
695
|
},
|
687
696
|
trigger
|
688
697
|
),
|
689
|
-
/* @__PURE__ */
|
698
|
+
/* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(
|
690
699
|
DropdownMenuContent,
|
691
700
|
{
|
692
701
|
side,
|
@@ -707,12 +716,12 @@ var DropdownMenu = ({
|
|
707
716
|
var _a;
|
708
717
|
const ItemLinkComponent = item.slug ? LinkComponent : "a";
|
709
718
|
if (item.itemType === "separator") {
|
710
|
-
return /* @__PURE__ */
|
719
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuSeparator, { key: index });
|
711
720
|
} else if (item.itemType === "label") {
|
712
|
-
return /* @__PURE__ */
|
721
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuLabel, { key: index }, item.label);
|
713
722
|
} else if (item.itemType === "radio") {
|
714
723
|
let dd = item.currentOption;
|
715
|
-
return /* @__PURE__ */
|
724
|
+
return /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
|
716
725
|
DropdownMenuSubTrigger,
|
717
726
|
{
|
718
727
|
dir: direction,
|
@@ -720,7 +729,7 @@ var DropdownMenu = ({
|
|
720
729
|
},
|
721
730
|
item.icon && item.icon,
|
722
731
|
item.label && item.label
|
723
|
-
), /* @__PURE__ */
|
732
|
+
), /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React6.createElement(
|
724
733
|
DropdownMenuRadioGroup,
|
725
734
|
{
|
726
735
|
value: values[index],
|
@@ -734,12 +743,12 @@ var DropdownMenu = ({
|
|
734
743
|
}
|
735
744
|
}
|
736
745
|
},
|
737
|
-
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */
|
746
|
+
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React6.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
|
738
747
|
)));
|
739
748
|
} else if (item.itemType === "custom") {
|
740
|
-
return /* @__PURE__ */
|
749
|
+
return /* @__PURE__ */ React6.createElement("div", { key: index }, item.content);
|
741
750
|
} else {
|
742
|
-
return item.subitems ? /* @__PURE__ */
|
751
|
+
return item.subitems ? /* @__PURE__ */ React6.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React6.createElement(
|
743
752
|
DropdownMenuSubTrigger,
|
744
753
|
{
|
745
754
|
dir: direction,
|
@@ -747,9 +756,9 @@ var DropdownMenu = ({
|
|
747
756
|
},
|
748
757
|
item.icon && item.icon,
|
749
758
|
item.label && item.label
|
750
|
-
), /* @__PURE__ */
|
759
|
+
), /* @__PURE__ */ React6.createElement(Portal, null, /* @__PURE__ */ React6.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => {
|
751
760
|
const SubitemLinkComponent = subitem.slug ? LinkComponent : "a";
|
752
|
-
return /* @__PURE__ */
|
761
|
+
return /* @__PURE__ */ React6.createElement(
|
753
762
|
DropdownMenuItem,
|
754
763
|
{
|
755
764
|
key: subIndex,
|
@@ -778,7 +787,7 @@ var DropdownMenu = ({
|
|
778
787
|
subitem.icon && subitem.icon,
|
779
788
|
subitem.label && subitem.label
|
780
789
|
);
|
781
|
-
})))) : /* @__PURE__ */
|
790
|
+
})))) : /* @__PURE__ */ React6.createElement(
|
782
791
|
DropdownMenuItem,
|
783
792
|
{
|
784
793
|
LinkComponent: ItemLinkComponent,
|
@@ -831,20 +840,51 @@ var DropdownMenu = ({
|
|
831
840
|
);
|
832
841
|
};
|
833
842
|
|
843
|
+
// icons/Emojis.tsx
|
844
|
+
import React7 from "react";
|
845
|
+
|
846
|
+
// icons/InputIcons.tsx
|
847
|
+
import React8 from "react";
|
848
|
+
|
849
|
+
// icons/CommonIcons.tsx
|
850
|
+
import React9 from "react";
|
851
|
+
var MenuIcon = () => /* @__PURE__ */ React9.createElement(
|
852
|
+
"svg",
|
853
|
+
{
|
854
|
+
"aria-label": "Menu Button",
|
855
|
+
stroke: "currentColor",
|
856
|
+
fill: "currentColor",
|
857
|
+
strokeWidth: 0,
|
858
|
+
viewBox: "0 0 20 20",
|
859
|
+
"aria-hidden": "true",
|
860
|
+
height: "1.6em",
|
861
|
+
width: "1.6em"
|
862
|
+
},
|
863
|
+
/* @__PURE__ */ React9.createElement(
|
864
|
+
"path",
|
865
|
+
{
|
866
|
+
fillRule: "evenodd",
|
867
|
+
clipRule: "evenodd",
|
868
|
+
d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
869
|
+
}
|
870
|
+
)
|
871
|
+
);
|
872
|
+
|
834
873
|
// layout/sidebar/Sidebar.tsx
|
835
|
-
import * as
|
874
|
+
import * as React11 from "react";
|
836
875
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
837
876
|
|
838
877
|
// elements/chip/Chip.tsx
|
839
|
-
import
|
840
|
-
var Chip =
|
878
|
+
import React10 from "react";
|
879
|
+
var Chip = React10.forwardRef(
|
841
880
|
({
|
842
881
|
label,
|
843
882
|
size = "normal",
|
844
883
|
icon,
|
845
884
|
color,
|
846
885
|
radius = "inherit",
|
847
|
-
|
886
|
+
dot,
|
887
|
+
dotStatus = "none",
|
848
888
|
...rest
|
849
889
|
}, ref) => {
|
850
890
|
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
@@ -863,7 +903,8 @@ var Chip = React8.forwardRef(
|
|
863
903
|
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
864
904
|
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
865
905
|
};
|
866
|
-
let
|
906
|
+
let dotStatusStyles = {
|
907
|
+
none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
|
867
908
|
available: "hawa-bg-green-500",
|
868
909
|
unavailable: "hawa-bg-red-500"
|
869
910
|
};
|
@@ -879,7 +920,7 @@ var Chip = React8.forwardRef(
|
|
879
920
|
oceanic: "hawa-text-white dark:hawa-text-black hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
|
880
921
|
};
|
881
922
|
if (label) {
|
882
|
-
return /* @__PURE__ */
|
923
|
+
return /* @__PURE__ */ React10.createElement(
|
883
924
|
"span",
|
884
925
|
{
|
885
926
|
...rest,
|
@@ -891,17 +932,17 @@ var Chip = React8.forwardRef(
|
|
891
932
|
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
892
933
|
)
|
893
934
|
},
|
894
|
-
|
935
|
+
dot && /* @__PURE__ */ React10.createElement(
|
895
936
|
"span",
|
896
937
|
{
|
897
|
-
className: cn(dotStyles[size],
|
938
|
+
className: cn(dotStyles[size], dotStatusStyles[dotStatus])
|
898
939
|
}
|
899
940
|
),
|
900
941
|
icon && icon,
|
901
942
|
label
|
902
943
|
);
|
903
944
|
} else {
|
904
|
-
return /* @__PURE__ */
|
945
|
+
return /* @__PURE__ */ React10.createElement(
|
905
946
|
"span",
|
906
947
|
{
|
907
948
|
...rest,
|
@@ -919,9 +960,9 @@ var Chip = React8.forwardRef(
|
|
919
960
|
// layout/sidebar/Sidebar.tsx
|
920
961
|
var Accordion = AccordionPrimitive.Root;
|
921
962
|
var triggerStyles = "hawa-flex hawa-flex-1 hawa-items-center hawa-duration-75 hawa-select-none hawa-cursor-pointer hawa-rounded hawa-justify-between hawa-p-2 hawa-px-3 hawa-font-medium hawa-transition-all [&[data-state=open]>svg]:hawa--rotate-90";
|
922
|
-
var AccordionItem =
|
963
|
+
var AccordionItem = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React11.createElement(AccordionPrimitive.Item, { ref, className: cn(className), ...props }));
|
923
964
|
AccordionItem.displayName = "AccordionItem";
|
924
|
-
var AccordionTrigger =
|
965
|
+
var AccordionTrigger = React11.forwardRef(({ className, showArrow, children, ...props }, ref) => /* @__PURE__ */ React11.createElement(AccordionPrimitive.Header, { className: "flex" }, /* @__PURE__ */ React11.createElement(
|
925
966
|
AccordionPrimitive.Trigger,
|
926
967
|
{
|
927
968
|
ref,
|
@@ -929,7 +970,7 @@ var AccordionTrigger = React9.forwardRef(({ className, showArrow, children, ...p
|
|
929
970
|
...props
|
930
971
|
},
|
931
972
|
children,
|
932
|
-
showArrow && /* @__PURE__ */
|
973
|
+
showArrow && /* @__PURE__ */ React11.createElement(
|
933
974
|
"svg",
|
934
975
|
{
|
935
976
|
"aria-label": "Chevron Right Icon",
|
@@ -940,11 +981,11 @@ var AccordionTrigger = React9.forwardRef(({ className, showArrow, children, ...p
|
|
940
981
|
width: "1em",
|
941
982
|
className: "hawa-icon hawa-shrink-0 hawa-rotate-90 hawa-transition-transform hawa-duration-200"
|
942
983
|
},
|
943
|
-
/* @__PURE__ */
|
984
|
+
/* @__PURE__ */ React11.createElement("path", { d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" })
|
944
985
|
)
|
945
986
|
)));
|
946
987
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
947
|
-
var AccordionContent =
|
988
|
+
var AccordionContent = React11.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React11.createElement(
|
948
989
|
AccordionPrimitive.Content,
|
949
990
|
{
|
950
991
|
ref,
|
@@ -954,7 +995,7 @@ var AccordionContent = React9.forwardRef(({ className, children, ...props }, ref
|
|
954
995
|
),
|
955
996
|
...props
|
956
997
|
},
|
957
|
-
/* @__PURE__ */
|
998
|
+
/* @__PURE__ */ React11.createElement("div", null, children)
|
958
999
|
));
|
959
1000
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
960
1001
|
var SidebarGroup = ({
|
@@ -970,7 +1011,7 @@ var SidebarGroup = ({
|
|
970
1011
|
...props
|
971
1012
|
}) => {
|
972
1013
|
const LinkComponent = props.LinkComponent || "a";
|
973
|
-
return /* @__PURE__ */
|
1014
|
+
return /* @__PURE__ */ React11.createElement("div", { className: "hawa-m-2" }, title && /* @__PURE__ */ React11.createElement("h3", { className: "hawa-mb-1 hawa-font-bold" }, title), /* @__PURE__ */ React11.createElement("ul", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React11.createElement(
|
974
1015
|
Accordion,
|
975
1016
|
{
|
976
1017
|
value: openedItem,
|
@@ -981,7 +1022,7 @@ var SidebarGroup = ({
|
|
981
1022
|
collapsible: true,
|
982
1023
|
className: "hawa-flex hawa-flex-col hawa-gap-1"
|
983
1024
|
},
|
984
|
-
items.map((item, idx) => /* @__PURE__ */
|
1025
|
+
items.map((item, idx) => /* @__PURE__ */ React11.createElement(
|
985
1026
|
SidebarItem,
|
986
1027
|
{
|
987
1028
|
isOpen,
|
@@ -1009,14 +1050,14 @@ var SidebarItem = ({
|
|
1009
1050
|
return props.selectedItem === value ? "hawa-bg-primary/90 hawa-text-primary-foreground hawa-cursor-default" : "hover:hawa-bg-primary/10";
|
1010
1051
|
};
|
1011
1052
|
if (item.subitems) {
|
1012
|
-
return /* @__PURE__ */
|
1053
|
+
return /* @__PURE__ */ React11.createElement(
|
1013
1054
|
AccordionItem,
|
1014
1055
|
{
|
1015
1056
|
value: item.value,
|
1016
1057
|
className: "hawa-overflow-x-clip ",
|
1017
1058
|
dir: direction
|
1018
1059
|
},
|
1019
|
-
/* @__PURE__ */
|
1060
|
+
/* @__PURE__ */ React11.createElement(
|
1020
1061
|
AccordionTrigger,
|
1021
1062
|
{
|
1022
1063
|
className: cn(
|
@@ -1028,7 +1069,7 @@ var SidebarItem = ({
|
|
1028
1069
|
),
|
1029
1070
|
showArrow: isOpen
|
1030
1071
|
},
|
1031
|
-
/* @__PURE__ */
|
1072
|
+
/* @__PURE__ */ React11.createElement(
|
1032
1073
|
"div",
|
1033
1074
|
{
|
1034
1075
|
className: cn(
|
@@ -1036,7 +1077,7 @@ var SidebarItem = ({
|
|
1036
1077
|
)
|
1037
1078
|
},
|
1038
1079
|
item.icon && item.icon,
|
1039
|
-
/* @__PURE__ */
|
1080
|
+
/* @__PURE__ */ React11.createElement(
|
1040
1081
|
"span",
|
1041
1082
|
{
|
1042
1083
|
className: cn(
|
@@ -1048,14 +1089,14 @@ var SidebarItem = ({
|
|
1048
1089
|
)
|
1049
1090
|
)
|
1050
1091
|
),
|
1051
|
-
item.subitems && /* @__PURE__ */
|
1092
|
+
item.subitems && /* @__PURE__ */ React11.createElement(AccordionContent, { className: "hawa-mt-1 hawa-h-full hawa-rounded" }, /* @__PURE__ */ React11.createElement(
|
1052
1093
|
"div",
|
1053
1094
|
{
|
1054
1095
|
className: cn(
|
1055
1096
|
"hawa-flex hawa-h-full hawa-flex-col hawa-gap-2 hawa-bg-foreground/5 hawa-p-1"
|
1056
1097
|
)
|
1057
1098
|
},
|
1058
|
-
item.subitems.map((subitem, idx) => /* @__PURE__ */
|
1099
|
+
item.subitems.map((subitem, idx) => /* @__PURE__ */ React11.createElement(
|
1059
1100
|
LinkComponent,
|
1060
1101
|
{
|
1061
1102
|
href: subitem.slug,
|
@@ -1086,7 +1127,7 @@ var SidebarItem = ({
|
|
1086
1127
|
))
|
1087
1128
|
);
|
1088
1129
|
} else {
|
1089
|
-
return /* @__PURE__ */
|
1130
|
+
return /* @__PURE__ */ React11.createElement(
|
1090
1131
|
LinkComponent,
|
1091
1132
|
{
|
1092
1133
|
href: item.slug,
|
@@ -1110,7 +1151,7 @@ var SidebarItem = ({
|
|
1110
1151
|
"hawa-overflow-x-clip "
|
1111
1152
|
)
|
1112
1153
|
},
|
1113
|
-
/* @__PURE__ */
|
1154
|
+
/* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, item.icon && item.icon, /* @__PURE__ */ React11.createElement(
|
1114
1155
|
"span",
|
1115
1156
|
{
|
1116
1157
|
className: cn(
|
@@ -1120,7 +1161,7 @@ var SidebarItem = ({
|
|
1120
1161
|
},
|
1121
1162
|
item.label,
|
1122
1163
|
" ",
|
1123
|
-
item.badge && /* @__PURE__ */
|
1164
|
+
item.badge && /* @__PURE__ */ React11.createElement(Chip, { label: item.badge.label, color: "hyper", size: "small" })
|
1124
1165
|
))
|
1125
1166
|
);
|
1126
1167
|
}
|
@@ -1162,7 +1203,16 @@ var AppLayout = ({
|
|
1162
1203
|
);
|
1163
1204
|
const [openSideMenu, setOpenSideMenu] = useState2(true);
|
1164
1205
|
const [keepDrawerOpen, setKeepDrawerOpen] = useState2(keepOpen);
|
1165
|
-
|
1206
|
+
const handleClickOutside = () => {
|
1207
|
+
if (typeof window !== "undefined") {
|
1208
|
+
if (window.innerWidth < 600) {
|
1209
|
+
setKeepDrawerOpen(false);
|
1210
|
+
setOpenSideMenu(false);
|
1211
|
+
}
|
1212
|
+
}
|
1213
|
+
};
|
1214
|
+
const ref = useClickOutside(handleClickOutside);
|
1215
|
+
useEffect2(() => {
|
1166
1216
|
if (typeof window !== "undefined") {
|
1167
1217
|
const resize = () => {
|
1168
1218
|
setSize(window.innerWidth);
|
@@ -1177,29 +1227,18 @@ var AppLayout = ({
|
|
1177
1227
|
};
|
1178
1228
|
}
|
1179
1229
|
}, []);
|
1180
|
-
|
1230
|
+
useEffect2(() => {
|
1181
1231
|
setKeepDrawerOpen(keepOpen);
|
1182
1232
|
}, [setKeepOpen]);
|
1183
|
-
|
1184
|
-
if (typeof window !== "undefined") {
|
1185
|
-
if (keepDrawerOpen)
|
1186
|
-
return;
|
1187
|
-
if (window.innerWidth < 600) {
|
1188
|
-
setKeepDrawerOpen(false);
|
1189
|
-
setOpenSideMenu(false);
|
1190
|
-
}
|
1191
|
-
}
|
1192
|
-
};
|
1193
|
-
const ref = useOutsideClick_default(handleClickOutside);
|
1194
|
-
const drawerSizeCondition = size > 600 ? drawerSizeStyle[keepDrawerOpen ? "opened" : "closed"][drawerSize] : 0;
|
1195
|
-
useEffect(() => {
|
1233
|
+
useEffect2(() => {
|
1196
1234
|
if (size > 600) {
|
1197
1235
|
setOpenSideMenu(keepDrawerOpen);
|
1198
1236
|
} else {
|
1199
1237
|
setOpenSideMenu(false);
|
1200
1238
|
}
|
1201
|
-
}, [size]);
|
1202
|
-
|
1239
|
+
}, [size, keepDrawerOpen]);
|
1240
|
+
const drawerSizeCondition = size > 600 ? drawerSizeStyle[keepDrawerOpen ? "opened" : "closed"][drawerSize] : 0;
|
1241
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "hawa-fixed hawa-start-0" }, props.topBar && /* @__PURE__ */ React12.createElement(
|
1203
1242
|
"div",
|
1204
1243
|
{
|
1205
1244
|
dir: direction,
|
@@ -1208,7 +1247,7 @@ var AppLayout = ({
|
|
1208
1247
|
bordered && "hawa-border-b-[1px]"
|
1209
1248
|
)
|
1210
1249
|
},
|
1211
|
-
size > 600 ? /* @__PURE__ */
|
1250
|
+
size > 600 ? /* @__PURE__ */ React12.createElement(
|
1212
1251
|
"div",
|
1213
1252
|
{
|
1214
1253
|
className: cn(
|
@@ -1222,24 +1261,24 @@ var AppLayout = ({
|
|
1222
1261
|
props.pageTitle
|
1223
1262
|
) : (
|
1224
1263
|
// Mobile Drawer Menu Button
|
1225
|
-
/* @__PURE__ */
|
1264
|
+
/* @__PURE__ */ React12.createElement(
|
1226
1265
|
"div",
|
1227
1266
|
{
|
1228
1267
|
dir: direction,
|
1229
1268
|
className: "hawa-flex hawa-items-center hawa-justify-center hawa-gap-0.5"
|
1230
1269
|
},
|
1231
|
-
/* @__PURE__ */
|
1270
|
+
/* @__PURE__ */ React12.createElement(
|
1232
1271
|
"div",
|
1233
1272
|
{
|
1234
1273
|
onClick: () => setOpenSideMenu(true),
|
1235
1274
|
className: "hawa-z-40 hawa-mx-1 hawa-cursor-pointer hawa-rounded hawa-p-2 hawa-transition-all hover:hawa-bg-gray-100"
|
1236
1275
|
},
|
1237
|
-
/* @__PURE__ */
|
1276
|
+
/* @__PURE__ */ React12.createElement(MenuIcon, null)
|
1238
1277
|
),
|
1239
|
-
props.pageTitle ? /* @__PURE__ */
|
1278
|
+
props.pageTitle ? /* @__PURE__ */ React12.createElement("div", { className: "hawa-text-sm" }, props.pageTitle) : /* @__PURE__ */ React12.createElement("div", null)
|
1240
1279
|
)
|
1241
1280
|
),
|
1242
|
-
/* @__PURE__ */
|
1281
|
+
/* @__PURE__ */ React12.createElement("div", { className: cn("hawa-flex hawa-gap-2 dark:hawa-text-white") }, size > 600 ? /* @__PURE__ */ React12.createElement("div", { className: "hawa-text-end hawa-text-xs" }, /* @__PURE__ */ React12.createElement("div", { className: "hawa-font-bold" }, props.username), " ", /* @__PURE__ */ React12.createElement("div", null, props.email)) : null, /* @__PURE__ */ React12.createElement(
|
1243
1282
|
DropdownMenu,
|
1244
1283
|
{
|
1245
1284
|
LinkComponent: MenuLinkComponent,
|
@@ -1251,13 +1290,13 @@ var AppLayout = ({
|
|
1251
1290
|
direction,
|
1252
1291
|
items: props.profileMenuItems || [],
|
1253
1292
|
onItemSelect: (e) => console.log("selecting item ", e),
|
1254
|
-
trigger: /* @__PURE__ */
|
1293
|
+
trigger: /* @__PURE__ */ React12.createElement(
|
1255
1294
|
"div",
|
1256
1295
|
{
|
1257
1296
|
onClick: onAvatarClick,
|
1258
1297
|
className: "hawa-relative hawa-h-8 hawa-w-8 hawa-cursor-pointer hawa-overflow-clip hawa-rounded hawa-ring-1 hawa-ring-primary/30 dark:hawa-bg-gray-600"
|
1259
1298
|
},
|
1260
|
-
props.avatarImage ? /* @__PURE__ */
|
1299
|
+
props.avatarImage ? /* @__PURE__ */ React12.createElement("img", { src: props.avatarImage, alt: "User Avatar" }) : /* @__PURE__ */ React12.createElement(
|
1261
1300
|
"svg",
|
1262
1301
|
{
|
1263
1302
|
"aria-label": "Avatar Icon",
|
@@ -1265,7 +1304,7 @@ var AppLayout = ({
|
|
1265
1304
|
fill: "currentColor",
|
1266
1305
|
viewBox: "0 0 20 20"
|
1267
1306
|
},
|
1268
|
-
/* @__PURE__ */
|
1307
|
+
/* @__PURE__ */ React12.createElement(
|
1269
1308
|
"path",
|
1270
1309
|
{
|
1271
1310
|
fillRule: "evenodd",
|
@@ -1277,7 +1316,7 @@ var AppLayout = ({
|
|
1277
1316
|
)
|
1278
1317
|
}
|
1279
1318
|
))
|
1280
|
-
), /* @__PURE__ */
|
1319
|
+
), /* @__PURE__ */ React12.createElement(
|
1281
1320
|
"div",
|
1282
1321
|
{
|
1283
1322
|
className: cn(
|
@@ -1288,9 +1327,7 @@ var AppLayout = ({
|
|
1288
1327
|
style: {
|
1289
1328
|
width: size > 600 ? openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : `${drawerSizeStyle["closed"][drawerSize]}px` : openSideMenu ? `${drawerSizeStyle["opened"][drawerSize]}px` : "0px"
|
1290
1329
|
},
|
1291
|
-
onMouseEnter: () =>
|
1292
|
-
setOpenSideMenu(true);
|
1293
|
-
},
|
1330
|
+
onMouseEnter: () => setOpenSideMenu(true),
|
1294
1331
|
onMouseLeave: () => {
|
1295
1332
|
if (size > 600) {
|
1296
1333
|
if (keepDrawerOpen) {
|
@@ -1305,7 +1342,7 @@ var AppLayout = ({
|
|
1305
1342
|
},
|
1306
1343
|
ref
|
1307
1344
|
},
|
1308
|
-
/* @__PURE__ */
|
1345
|
+
/* @__PURE__ */ React12.createElement(
|
1309
1346
|
"div",
|
1310
1347
|
{
|
1311
1348
|
onClick: props.onLogoClick,
|
@@ -1320,30 +1357,30 @@ var AppLayout = ({
|
|
1320
1357
|
}
|
1321
1358
|
},
|
1322
1359
|
openSideMenu && props.header && props.header,
|
1323
|
-
!props.header && /* @__PURE__ */
|
1360
|
+
!props.header && /* @__PURE__ */ React12.createElement(
|
1324
1361
|
"img",
|
1325
1362
|
{
|
1363
|
+
src: props.logoLink,
|
1326
1364
|
className: cn(
|
1327
1365
|
"hawa-h-9 hawa-opacity-0 hawa-transition-all",
|
1328
1366
|
!openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100",
|
1329
1367
|
classNames == null ? void 0 : classNames.fullLogoImg
|
1330
|
-
)
|
1331
|
-
src: props.logoLink
|
1368
|
+
)
|
1332
1369
|
}
|
1333
1370
|
),
|
1334
|
-
size > 600 ? /* @__PURE__ */
|
1371
|
+
size > 600 ? /* @__PURE__ */ React12.createElement(
|
1335
1372
|
"img",
|
1336
1373
|
{
|
1374
|
+
src: props.logoSymbol,
|
1337
1375
|
className: cn(
|
1338
1376
|
"hawa-fixed hawa-h-9 hawa-transition-all hawa-start-2.5 hawa-top-2.5",
|
1339
1377
|
openSideMenu ? "hawa-invisible hawa-opacity-0" : "hawa-visible hawa-opacity-100",
|
1340
1378
|
classNames == null ? void 0 : classNames.symbolLogoImg
|
1341
|
-
)
|
1342
|
-
src: props.logoSymbol
|
1379
|
+
)
|
1343
1380
|
}
|
1344
1381
|
) : null
|
1345
1382
|
),
|
1346
|
-
/* @__PURE__ */
|
1383
|
+
/* @__PURE__ */ React12.createElement(
|
1347
1384
|
"div",
|
1348
1385
|
{
|
1349
1386
|
className: cn(
|
@@ -1354,30 +1391,22 @@ var AppLayout = ({
|
|
1354
1391
|
width: size > 600 ? `${openSideMenu ? openDrawerWidth : drawerSizeCondition}px` : `${openSideMenu ? openDrawerWidth : 0}px`
|
1355
1392
|
}
|
1356
1393
|
},
|
1357
|
-
/* @__PURE__ */
|
1394
|
+
/* @__PURE__ */ React12.createElement(
|
1358
1395
|
SidebarGroup,
|
1359
1396
|
{
|
1360
1397
|
direction,
|
1361
|
-
onItemClick: (values) => {
|
1362
|
-
if (clickedItem) {
|
1363
|
-
clickedItem(values);
|
1364
|
-
}
|
1365
|
-
},
|
1366
|
-
onSubItemClick: (values) => {
|
1367
|
-
if (clickedItem) {
|
1368
|
-
clickedItem(values);
|
1369
|
-
}
|
1370
|
-
},
|
1371
1398
|
selectedItem: currentPage,
|
1372
1399
|
openedItem: openedSidebarItem,
|
1373
1400
|
setOpenedItem: (e) => setOpenedSidebarItem(e),
|
1374
1401
|
isOpen: keepDrawerOpen || openSideMenu,
|
1375
1402
|
items: props.drawerItems,
|
1376
|
-
LinkComponent: DrawerLinkComponent
|
1403
|
+
LinkComponent: DrawerLinkComponent,
|
1404
|
+
onItemClick: (values) => clickedItem && clickedItem(values),
|
1405
|
+
onSubItemClick: (values) => clickedItem && clickedItem(values)
|
1377
1406
|
}
|
1378
1407
|
)
|
1379
1408
|
),
|
1380
|
-
/* @__PURE__ */
|
1409
|
+
/* @__PURE__ */ React12.createElement(
|
1381
1410
|
"div",
|
1382
1411
|
{
|
1383
1412
|
className: cn(
|
@@ -1388,8 +1417,8 @@ var AppLayout = ({
|
|
1388
1417
|
width: size > 600 ? `${openSideMenu ? openDrawerWidth : 56}px` : `${openSideMenu ? openDrawerWidth : 0}px`
|
1389
1418
|
}
|
1390
1419
|
},
|
1391
|
-
DrawerFooterActions && openSideMenu ? /* @__PURE__ */
|
1392
|
-
size > 600 && openSideMenu ? /* @__PURE__ */
|
1420
|
+
DrawerFooterActions && openSideMenu ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, DrawerFooterActions) : null,
|
1421
|
+
size > 600 && openSideMenu ? /* @__PURE__ */ React12.createElement(
|
1393
1422
|
Tooltip,
|
1394
1423
|
{
|
1395
1424
|
side: "left",
|
@@ -1397,7 +1426,7 @@ var AppLayout = ({
|
|
1397
1426
|
triggerProps: { asChild: true },
|
1398
1427
|
content: keepDrawerOpen ? ((_a = props.texts) == null ? void 0 : _a.collapseSidebar) || "Collapse Sidebar" : ((_b = props.texts) == null ? void 0 : _b.expandSidebar) || "Expand Sidebar"
|
1399
1428
|
},
|
1400
|
-
/* @__PURE__ */
|
1429
|
+
/* @__PURE__ */ React12.createElement(
|
1401
1430
|
Button,
|
1402
1431
|
{
|
1403
1432
|
variant: "outline",
|
@@ -1410,7 +1439,7 @@ var AppLayout = ({
|
|
1410
1439
|
setKeepDrawerOpen(newKeepOpenState);
|
1411
1440
|
}
|
1412
1441
|
},
|
1413
|
-
/* @__PURE__ */
|
1442
|
+
/* @__PURE__ */ React12.createElement(
|
1414
1443
|
"svg",
|
1415
1444
|
{
|
1416
1445
|
className: cn(
|
@@ -1420,7 +1449,7 @@ var AppLayout = ({
|
|
1420
1449
|
fill: "currentColor",
|
1421
1450
|
viewBox: "0 0 20 20"
|
1422
1451
|
},
|
1423
|
-
/* @__PURE__ */
|
1452
|
+
/* @__PURE__ */ React12.createElement(
|
1424
1453
|
"path",
|
1425
1454
|
{
|
1426
1455
|
fillRule: "evenodd",
|
@@ -1432,7 +1461,7 @@ var AppLayout = ({
|
|
1432
1461
|
)
|
1433
1462
|
) : null
|
1434
1463
|
)
|
1435
|
-
), /* @__PURE__ */
|
1464
|
+
), /* @__PURE__ */ React12.createElement(
|
1436
1465
|
"div",
|
1437
1466
|
{
|
1438
1467
|
className: "hawa-fixed -hawa-z-10 hawa-overflow-y-auto hawa-transition-all",
|
@@ -1451,27 +1480,6 @@ var AppLayout = ({
|
|
1451
1480
|
props.children
|
1452
1481
|
));
|
1453
1482
|
};
|
1454
|
-
var MenuIcon = () => /* @__PURE__ */ React10.createElement(
|
1455
|
-
"svg",
|
1456
|
-
{
|
1457
|
-
"aria-label": "Menu Button",
|
1458
|
-
stroke: "currentColor",
|
1459
|
-
fill: "currentColor",
|
1460
|
-
strokeWidth: 0,
|
1461
|
-
viewBox: "0 0 20 20",
|
1462
|
-
"aria-hidden": "true",
|
1463
|
-
height: "1.6em",
|
1464
|
-
width: "1.6em"
|
1465
|
-
},
|
1466
|
-
/* @__PURE__ */ React10.createElement(
|
1467
|
-
"path",
|
1468
|
-
{
|
1469
|
-
fillRule: "evenodd",
|
1470
|
-
clipRule: "evenodd",
|
1471
|
-
d: "M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
1472
|
-
}
|
1473
|
-
)
|
1474
|
-
);
|
1475
1483
|
export {
|
1476
1484
|
AppLayout
|
1477
1485
|
};
|