@sikka/hawa 0.2.38 → 0.2.40-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/README.md +65 -65
- package/dist/index.css +1919 -0
- package/dist/index.d.mts +208 -3
- package/dist/index.d.ts +208 -3
- package/dist/index.js +1523 -0
- package/dist/index.mjs +1418 -0
- package/package.json +70 -153
- package/dist/index.cjs.js +0 -8
- package/dist/index.esm.js +0 -8
- package/dist/tailwind.css +0 -3966
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1418 @@
|
|
|
1
|
+
// components/elements/Button.tsx
|
|
2
|
+
import * as React2 from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
// components/util.ts
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// components/elements/Loading.tsx
|
|
13
|
+
import React from "react";
|
|
14
|
+
import clsx2 from "clsx";
|
|
15
|
+
var Loading = ({
|
|
16
|
+
design = "spinner",
|
|
17
|
+
size = "sm",
|
|
18
|
+
color,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
let sizeStyles = {
|
|
22
|
+
button: "hawa-h-4 hawa-w-4",
|
|
23
|
+
xs: "hawa-h-1 hawa-w-1",
|
|
24
|
+
sm: "hawa-h-6 hawa-w-6",
|
|
25
|
+
normal: "hawa-h-8 hawa-w-8",
|
|
26
|
+
lg: "hawa-h-14 hawa-w-14",
|
|
27
|
+
xl: "hawa-h-24 hawa-w-24"
|
|
28
|
+
};
|
|
29
|
+
let animationStyles = {
|
|
30
|
+
pulse: "hawa-animate-in hawa-fade-in hawa-duration-1000",
|
|
31
|
+
bounce: "hawa-animate-bounce"
|
|
32
|
+
};
|
|
33
|
+
switch (design.split("-")[0]) {
|
|
34
|
+
case "dots":
|
|
35
|
+
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React.createElement(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: clsx2(
|
|
39
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
|
|
40
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
|
41
|
+
animationStyles[design.split("-")[1]],
|
|
42
|
+
color ? color : "hawa-bg-primary"
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
), /* @__PURE__ */ React.createElement(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: clsx2(
|
|
49
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
|
|
50
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
|
51
|
+
animationStyles[design.split("-")[1]],
|
|
52
|
+
color ? color : "hawa-bg-primary"
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
), /* @__PURE__ */ React.createElement(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: clsx2(
|
|
59
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
|
|
60
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
|
61
|
+
animationStyles[design.split("-")[1]],
|
|
62
|
+
color ? color : "hawa-bg-primary"
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
default:
|
|
67
|
+
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-x-3" }, /* @__PURE__ */ React.createElement("div", { "aria-label": "Loading...", role: "status" }, /* @__PURE__ */ React.createElement(
|
|
68
|
+
"svg",
|
|
69
|
+
{
|
|
70
|
+
className: clsx2(sizeStyles[size], "hawa-animate-spin"),
|
|
71
|
+
viewBox: "3 3 18 18"
|
|
72
|
+
},
|
|
73
|
+
/* @__PURE__ */ React.createElement(
|
|
74
|
+
"path",
|
|
75
|
+
{
|
|
76
|
+
className: "hawa-fill-primary/20",
|
|
77
|
+
d: "M12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5ZM3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12Z"
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ React.createElement(
|
|
81
|
+
"path",
|
|
82
|
+
{
|
|
83
|
+
className: color ? color : "hawa-fill-primary",
|
|
84
|
+
d: "M16.9497 7.05015C14.2161 4.31648 9.78392 4.31648 7.05025 7.05015C6.65973 7.44067 6.02656 7.44067 5.63604 7.05015C5.24551 6.65962 5.24551 6.02646 5.63604 5.63593C9.15076 2.12121 14.8492 2.12121 18.364 5.63593C18.7545 6.02646 18.7545 6.65962 18.364 7.05015C17.9734 7.44067 17.3403 7.44067 16.9497 7.05015Z"
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
)));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// components/elements/Button.tsx
|
|
92
|
+
var buttonVariants = cva(
|
|
93
|
+
"hawa-inline-flex hawa-items-center hawa-justify-center hawa-select-none hawa-rounded-md hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-colors focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
|
|
94
|
+
{
|
|
95
|
+
variants: {
|
|
96
|
+
variant: {
|
|
97
|
+
default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
|
|
98
|
+
light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
|
|
99
|
+
destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
|
|
100
|
+
outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
|
101
|
+
secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
|
|
102
|
+
ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
|
103
|
+
link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
|
|
104
|
+
neoBrutalism: "hawa-cursor-pointer hawa-transition-all hawa-uppercase hawa-font-mono dark:hawa-bg-black hawa-font-bold hawa-py-2 hawa-px-4 hawa-rounded hawa-border-2 hawa-border-primary hawa-shadow-color-primary hawa-transition-[hawa-transform_50ms, hawa-box-shadow_50ms] active:hawa-translate-x-0.5 active:hawa-translate-y-0.5 active:hawa-shadow-color-primary-active"
|
|
105
|
+
},
|
|
106
|
+
size: {
|
|
107
|
+
default: "hawa-h-10 hawa-px-4 hawa-py-2",
|
|
108
|
+
heightless: "hawa-px-4 hawa-py-4",
|
|
109
|
+
xs: "hawa-h-fit hawa-py-1 hawa-text-[10px] hawa-px-2 ",
|
|
110
|
+
sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
|
|
111
|
+
lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
|
|
112
|
+
xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
|
|
113
|
+
icon: "hawa-h-10 hawa-w-10",
|
|
114
|
+
smallIcon: "hawa-h-7 hawa-w-7"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
defaultVariants: {
|
|
118
|
+
variant: "default",
|
|
119
|
+
size: "default"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
var Button = React2.forwardRef(
|
|
124
|
+
({
|
|
125
|
+
className,
|
|
126
|
+
variant,
|
|
127
|
+
size,
|
|
128
|
+
asChild = false,
|
|
129
|
+
isLoading,
|
|
130
|
+
children,
|
|
131
|
+
...props
|
|
132
|
+
}, ref) => {
|
|
133
|
+
const Comp = "button";
|
|
134
|
+
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
|
135
|
+
return /* @__PURE__ */ React2.createElement(
|
|
136
|
+
Comp,
|
|
137
|
+
{
|
|
138
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
139
|
+
ref,
|
|
140
|
+
...props
|
|
141
|
+
},
|
|
142
|
+
isLoading ? /* @__PURE__ */ React2.createElement(
|
|
143
|
+
Loading,
|
|
144
|
+
{
|
|
145
|
+
design: "dots-pulse",
|
|
146
|
+
color: loadingColor,
|
|
147
|
+
size: size === "sm" ? "xs" : "button"
|
|
148
|
+
}
|
|
149
|
+
) : children
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
Button.displayName = "Button";
|
|
154
|
+
|
|
155
|
+
// components/elements/Dialog.tsx
|
|
156
|
+
import * as React3 from "react";
|
|
157
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
158
|
+
var Dialog = DialogPrimitive.Root;
|
|
159
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
160
|
+
var DialogPortal = ({
|
|
161
|
+
// className,
|
|
162
|
+
...props
|
|
163
|
+
}) => /* @__PURE__ */ React3.createElement(
|
|
164
|
+
DialogPrimitive.Portal,
|
|
165
|
+
{
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
DialogPortal.displayName = DialogPrimitive.Portal.displayName;
|
|
170
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
|
171
|
+
DialogPrimitive.Overlay,
|
|
172
|
+
{
|
|
173
|
+
ref,
|
|
174
|
+
className: cn(
|
|
175
|
+
"hawa-fixed hawa-inset-0 hawa-z-50 hawa-bg-background/80 hawa-backdrop-blur-sm data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0",
|
|
176
|
+
className
|
|
177
|
+
),
|
|
178
|
+
...props
|
|
179
|
+
}
|
|
180
|
+
));
|
|
181
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
182
|
+
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React3.createElement(DialogPortal, null, /* @__PURE__ */ React3.createElement(DialogOverlay, null), /* @__PURE__ */ React3.createElement(
|
|
183
|
+
DialogPrimitive.Content,
|
|
184
|
+
{
|
|
185
|
+
onPointerDownOutside: (e) => {
|
|
186
|
+
if (props.persist) {
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
ref,
|
|
191
|
+
className: cn(
|
|
192
|
+
"hawa-fixed hawa-left-[50%] hawa-top-[50%] hawa-z-50 hawa-grid hawa-w-full hawa-max-w-lg hawa-translate-x-[-50%] hawa-translate-y-[-50%] hawa-gap-4 hawa-border hawa-bg-background hawa-p-6 hawa-shadow-lg hawa-duration-200 data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[state=closed]:hawa-slide-out-to-left-1/2 data-[state=closed]:hawa-slide-out-to-top-[48%] data-[state=open]:hawa-slide-in-from-left-1/2 data-[state=open]:hawa-slide-in-from-top-[48%] sm:hawa-rounded md:hawa-w-full",
|
|
193
|
+
className
|
|
194
|
+
),
|
|
195
|
+
...props
|
|
196
|
+
},
|
|
197
|
+
children,
|
|
198
|
+
/* @__PURE__ */ React3.createElement(
|
|
199
|
+
DialogPrimitive.Close,
|
|
200
|
+
{
|
|
201
|
+
className: cn(
|
|
202
|
+
"hawa-absolute hawa-top-4 hawa-rounded hawa-opacity-70 hawa-ring-offset-background hawa-transition-opacity hover:hawa-opacity-100 focus:hawa-outline-none focus:hawa-ring-2 focus:hawa-ring-ring focus:hawa-ring-offset-2 disabled:hawa-pointer-events-none data-[state=open]:hawa-bg-accent data-[state=open]:hawa-text-muted-foreground",
|
|
203
|
+
props.dir === "rtl" ? " hawa-left-4" : " hawa-right-4"
|
|
204
|
+
)
|
|
205
|
+
},
|
|
206
|
+
/* @__PURE__ */ React3.createElement(
|
|
207
|
+
"svg",
|
|
208
|
+
{
|
|
209
|
+
"aria-label": "Close Icon",
|
|
210
|
+
"aria-hidden": "true",
|
|
211
|
+
className: "hawa-h-5 hawa-w-5",
|
|
212
|
+
fill: "currentColor",
|
|
213
|
+
viewBox: "0 0 20 20"
|
|
214
|
+
},
|
|
215
|
+
/* @__PURE__ */ React3.createElement(
|
|
216
|
+
"path",
|
|
217
|
+
{
|
|
218
|
+
fillRule: "evenodd",
|
|
219
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
220
|
+
clipRule: "evenodd"
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ React3.createElement("span", { className: "hawa-sr-only" }, "Close")
|
|
225
|
+
)
|
|
226
|
+
)));
|
|
227
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
228
|
+
var DialogHeader = ({
|
|
229
|
+
className,
|
|
230
|
+
...props
|
|
231
|
+
}) => /* @__PURE__ */ React3.createElement(
|
|
232
|
+
"div",
|
|
233
|
+
{
|
|
234
|
+
className: cn(
|
|
235
|
+
"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-text-center sm:hawa-text-left",
|
|
236
|
+
className
|
|
237
|
+
),
|
|
238
|
+
...props
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
DialogHeader.displayName = "DialogHeader";
|
|
242
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
|
243
|
+
DialogPrimitive.Title,
|
|
244
|
+
{
|
|
245
|
+
ref,
|
|
246
|
+
className: cn(
|
|
247
|
+
"hawa-text-start hawa-text-lg hawa-font-semibold hawa-leading-none hawa-tracking-tight",
|
|
248
|
+
className
|
|
249
|
+
),
|
|
250
|
+
...props
|
|
251
|
+
}
|
|
252
|
+
));
|
|
253
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
254
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
|
255
|
+
DialogPrimitive.Description,
|
|
256
|
+
{
|
|
257
|
+
ref,
|
|
258
|
+
className: cn(
|
|
259
|
+
"hawa-text-start hawa-text-sm hawa-text-muted-foreground",
|
|
260
|
+
className
|
|
261
|
+
),
|
|
262
|
+
...props
|
|
263
|
+
}
|
|
264
|
+
));
|
|
265
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
266
|
+
var DialogFooter = ({
|
|
267
|
+
className,
|
|
268
|
+
...props
|
|
269
|
+
}) => /* @__PURE__ */ React3.createElement(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
className: cn(
|
|
273
|
+
"hawa-flex hawa-flex-col-reverse sm:hawa-flex-row sm:hawa-justify-end sm:hawa-gap-2",
|
|
274
|
+
className
|
|
275
|
+
),
|
|
276
|
+
...props
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
DialogFooter.displayName = "DialogFooter";
|
|
280
|
+
|
|
281
|
+
// components/elements/Card.tsx
|
|
282
|
+
import * as React4 from "react";
|
|
283
|
+
var Card = React4.forwardRef(
|
|
284
|
+
({ className, clickable = false, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
ref,
|
|
288
|
+
className: cn(
|
|
289
|
+
"hawa-rounded-lg hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm",
|
|
290
|
+
clickable && "hawa-cursor-pointer hawa-transition-all hover:hawa-drop-shadow-md dark:hover:hawa-shadow-dark",
|
|
291
|
+
className
|
|
292
|
+
),
|
|
293
|
+
...props
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
);
|
|
297
|
+
Card.displayName = "Card";
|
|
298
|
+
var CardHeader = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
299
|
+
"div",
|
|
300
|
+
{
|
|
301
|
+
ref,
|
|
302
|
+
className: cn(
|
|
303
|
+
"hawa-flex hawa-flex-col hawa-space-y-1.5 hawa-p-6",
|
|
304
|
+
className
|
|
305
|
+
),
|
|
306
|
+
...props
|
|
307
|
+
}
|
|
308
|
+
));
|
|
309
|
+
CardHeader.displayName = "CardHeader";
|
|
310
|
+
var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
311
|
+
"h3",
|
|
312
|
+
{
|
|
313
|
+
ref,
|
|
314
|
+
className: cn(
|
|
315
|
+
"hawa-text-2xl hawa-font-semibold hawa-leading-none hawa-tracking-tight",
|
|
316
|
+
className
|
|
317
|
+
),
|
|
318
|
+
...props
|
|
319
|
+
}
|
|
320
|
+
));
|
|
321
|
+
CardTitle.displayName = "CardTitle";
|
|
322
|
+
var CardDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
323
|
+
"p",
|
|
324
|
+
{
|
|
325
|
+
ref,
|
|
326
|
+
className: cn("hawa-text-sm hawa-text-muted-foreground", className),
|
|
327
|
+
...props
|
|
328
|
+
}
|
|
329
|
+
));
|
|
330
|
+
CardDescription.displayName = "CardDescription";
|
|
331
|
+
var CardContent = React4.forwardRef(
|
|
332
|
+
({ headless, className, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
333
|
+
"div",
|
|
334
|
+
{
|
|
335
|
+
ref,
|
|
336
|
+
className: cn(
|
|
337
|
+
"hawa-p-6",
|
|
338
|
+
headless ? "hawa-pt-6" : "hawa-pt-0",
|
|
339
|
+
className
|
|
340
|
+
),
|
|
341
|
+
...props
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
);
|
|
345
|
+
CardContent.displayName = "CardContent";
|
|
346
|
+
var CardFooter = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
347
|
+
"div",
|
|
348
|
+
{
|
|
349
|
+
ref,
|
|
350
|
+
className: cn("hawa-flex hawa-items-center hawa-p-6 hawa-pt-0", className),
|
|
351
|
+
...props
|
|
352
|
+
}
|
|
353
|
+
));
|
|
354
|
+
CardFooter.displayName = "CardFooter";
|
|
355
|
+
|
|
356
|
+
// components/elements/Breadcrumb.tsx
|
|
357
|
+
import React5 from "react";
|
|
358
|
+
var Breadcrumb = ({ breadcrumbLinks, separator = ">" }) => {
|
|
359
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm" }, breadcrumbLinks.map((singleBreadcrumbLink, index) => /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React5.createElement(
|
|
360
|
+
"a",
|
|
361
|
+
{
|
|
362
|
+
href: singleBreadcrumbLink.href,
|
|
363
|
+
className: index + 1 === breadcrumbLinks.length ? "hawa-pointer-events-none" : "hawa-underline-offset-4 hawa-transition-all hover:hawa-text-primary hover:hawa-underline hover:hawa-decoration-2"
|
|
364
|
+
},
|
|
365
|
+
singleBreadcrumbLink.label
|
|
366
|
+
), index != breadcrumbLinks.length - 1 ? typeof separator == "string" ? /* @__PURE__ */ React5.createElement("div", null, separator) : /* @__PURE__ */ React5.createElement("div", null, separator) : null)));
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
// components/elements/Tooltip.tsx
|
|
370
|
+
import React6 from "react";
|
|
371
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
372
|
+
var TooltipContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React6.createElement(
|
|
373
|
+
TooltipPrimitive.Content,
|
|
374
|
+
{
|
|
375
|
+
ref,
|
|
376
|
+
sideOffset,
|
|
377
|
+
className: cn(
|
|
378
|
+
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-text-popover-foreground hawa-shadow-md hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=closed]:hawa-zoom-out-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
|
379
|
+
className
|
|
380
|
+
),
|
|
381
|
+
...props
|
|
382
|
+
}
|
|
383
|
+
));
|
|
384
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
385
|
+
var TooltipArrow = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React6.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
|
386
|
+
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
|
387
|
+
var Tooltip = ({
|
|
388
|
+
side,
|
|
389
|
+
open,
|
|
390
|
+
content,
|
|
391
|
+
children,
|
|
392
|
+
defaultOpen,
|
|
393
|
+
onOpenChange,
|
|
394
|
+
delayDuration = 300,
|
|
395
|
+
...props
|
|
396
|
+
}) => {
|
|
397
|
+
return /* @__PURE__ */ React6.createElement(TooltipPrimitive.TooltipProvider, { delayDuration }, /* @__PURE__ */ React6.createElement(
|
|
398
|
+
TooltipPrimitive.Root,
|
|
399
|
+
{
|
|
400
|
+
open,
|
|
401
|
+
defaultOpen,
|
|
402
|
+
onOpenChange
|
|
403
|
+
},
|
|
404
|
+
/* @__PURE__ */ React6.createElement(TooltipPrimitive.Trigger, { asChild: true }, children),
|
|
405
|
+
/* @__PURE__ */ React6.createElement(TooltipContent, { side, align: "center", ...props }, content)
|
|
406
|
+
));
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// components/elements/CodeBlock.tsx
|
|
410
|
+
import React7, { useState as useState2 } from "react";
|
|
411
|
+
|
|
412
|
+
// components/hooks/useClipboard.ts
|
|
413
|
+
import { useState } from "react";
|
|
414
|
+
function useClipboard({ timeout = 2e3 } = {}) {
|
|
415
|
+
const [error, setError] = useState(null);
|
|
416
|
+
const [copied, setCopied] = useState(false);
|
|
417
|
+
const [copyTimeout, setCopyTimeout] = useState(null);
|
|
418
|
+
const handleCopyResult = (value) => {
|
|
419
|
+
clearTimeout(copyTimeout);
|
|
420
|
+
setCopyTimeout(setTimeout(() => setCopied(false), timeout));
|
|
421
|
+
setCopied(value);
|
|
422
|
+
};
|
|
423
|
+
const copy = (valueToCopy) => {
|
|
424
|
+
if ("clipboard" in navigator) {
|
|
425
|
+
navigator.clipboard.writeText(valueToCopy).then(() => handleCopyResult(true)).catch((err) => setError(err));
|
|
426
|
+
} else {
|
|
427
|
+
setError(new Error("useClipboard: navigator.clipboard is not supported"));
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
const reset = () => {
|
|
431
|
+
setCopied(false);
|
|
432
|
+
setError(null);
|
|
433
|
+
clearTimeout(copyTimeout);
|
|
434
|
+
};
|
|
435
|
+
return { copy, reset, error, copied };
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// components/elements/CodeBlock.tsx
|
|
439
|
+
var CodeBlock = ({
|
|
440
|
+
tabs,
|
|
441
|
+
code,
|
|
442
|
+
fileName,
|
|
443
|
+
width = "full"
|
|
444
|
+
}) => {
|
|
445
|
+
const clipboard = useClipboard();
|
|
446
|
+
const [selectedTab, setSelectedTab] = useState2(0);
|
|
447
|
+
let widthStyles = {
|
|
448
|
+
full: "hawa-w-full",
|
|
449
|
+
md: "hawa-w-full hawa-max-w-md",
|
|
450
|
+
sm: "hawa-w-full hawa-max-w-sm",
|
|
451
|
+
xs: "hawa-w-full hawa-max-w-xs"
|
|
452
|
+
};
|
|
453
|
+
return /* @__PURE__ */ React7.createElement(
|
|
454
|
+
"div",
|
|
455
|
+
{
|
|
456
|
+
className: cn(
|
|
457
|
+
widthStyles[width],
|
|
458
|
+
"hawa-w-full hawa-flex-col hawa-items-center hawa-rounded hawa-bg-background hawa-text-left hawa-text-white sm:hawa-text-base"
|
|
459
|
+
)
|
|
460
|
+
},
|
|
461
|
+
tabs && /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-bg-gray-200 dark:hawa-bg-muted hawa-p-2 hawa-pb-0 hawa-text-foreground hawa-font-mono " }, tabs.map((tab, i) => /* @__PURE__ */ React7.createElement(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
className: cn(
|
|
465
|
+
selectedTab === i ? " hawa-border-b-2 hawa-border-primary" : "hawa-bg-transparent"
|
|
466
|
+
)
|
|
467
|
+
},
|
|
468
|
+
/* @__PURE__ */ React7.createElement(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
onClick: () => setSelectedTab(i),
|
|
472
|
+
className: cn(
|
|
473
|
+
"hawa-mb-1 hawa-transition-all hawa-w-full hawa-max-w-[52px] hawa-cursor-pointer hawa-rounded-inner hawa-p-2 hawa-py-1 hawa-text-center hawa-text-[1rem] hover:hawa-bg-muted-foreground/20"
|
|
474
|
+
)
|
|
475
|
+
},
|
|
476
|
+
tab.title
|
|
477
|
+
)
|
|
478
|
+
))),
|
|
479
|
+
fileName && /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2 hawa-rounded-t hawa-bg-gray-200 dark:hawa-bg-muted hawa-p-2 hawa-pb-0 hawa-text-foreground hawa-font-mono" }, /* @__PURE__ */ React7.createElement(
|
|
480
|
+
"div",
|
|
481
|
+
{
|
|
482
|
+
className: cn(
|
|
483
|
+
"hawa-mb-1 hawa-w-full hawa-max-w-[52px] hawa-rounded-inner hawa-p-2 hawa-py-1 hawa-text-center hawa-text-[1rem]"
|
|
484
|
+
)
|
|
485
|
+
},
|
|
486
|
+
fileName
|
|
487
|
+
)),
|
|
488
|
+
/* @__PURE__ */ React7.createElement("pre", null, /* @__PURE__ */ React7.createElement(
|
|
489
|
+
"code",
|
|
490
|
+
{
|
|
491
|
+
className: cn(
|
|
492
|
+
"hawa-relative hawa-flex hawa-w-full hawa-flex-row hawa-items-start hawa-justify-between hawa-p-0 hawa-text-left hawa-text-sm sm:hawa-text-base hawa-bg-gray-300 ",
|
|
493
|
+
tabs || fileName ? "hawa-rounded-b hawa-rounded-t-none" : "hawa-rounded"
|
|
494
|
+
)
|
|
495
|
+
},
|
|
496
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-min-h-[37.75px] hawa-w-full hawa-flex-row hawa-justify-start hawa-overflow-auto hawa-p-4 hawa-text-foreground hawa-bg-background/70 hawa-font-mono " }, tabs ? tabs[selectedTab].code : code),
|
|
497
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-absolute hawa-right-0 hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-p-2" }, /* @__PURE__ */ React7.createElement(
|
|
498
|
+
Tooltip,
|
|
499
|
+
{
|
|
500
|
+
open: clipboard.copied,
|
|
501
|
+
side: "left",
|
|
502
|
+
content: /* @__PURE__ */ React7.createElement("div", null, "Copied!")
|
|
503
|
+
},
|
|
504
|
+
/* @__PURE__ */ React7.createElement(
|
|
505
|
+
Button,
|
|
506
|
+
{
|
|
507
|
+
size: "icon",
|
|
508
|
+
onClick: () => clipboard.copy(tabs ? tabs[selectedTab].code : code),
|
|
509
|
+
variant: "outline",
|
|
510
|
+
className: "hawa-opacity-50 sm:hawa-opacity-100 hawa-text-foreground"
|
|
511
|
+
},
|
|
512
|
+
/* @__PURE__ */ React7.createElement(
|
|
513
|
+
"svg",
|
|
514
|
+
{
|
|
515
|
+
"aria-label": "Copy Icon",
|
|
516
|
+
stroke: "currentColor",
|
|
517
|
+
fill: "none",
|
|
518
|
+
strokeWidth: "2",
|
|
519
|
+
viewBox: "0 0 24 24",
|
|
520
|
+
strokeLinecap: "round",
|
|
521
|
+
strokeLinejoin: "round",
|
|
522
|
+
height: "1em",
|
|
523
|
+
width: "1em"
|
|
524
|
+
},
|
|
525
|
+
/* @__PURE__ */ React7.createElement("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
526
|
+
/* @__PURE__ */ React7.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
527
|
+
)
|
|
528
|
+
)
|
|
529
|
+
))
|
|
530
|
+
))
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
// components/elements/Checkbox.tsx
|
|
535
|
+
import * as React8 from "react";
|
|
536
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
537
|
+
var Checkbox = ({
|
|
538
|
+
id,
|
|
539
|
+
label,
|
|
540
|
+
sublabel,
|
|
541
|
+
helperText,
|
|
542
|
+
...checkboxProps
|
|
543
|
+
}) => {
|
|
544
|
+
return /* @__PURE__ */ React8.createElement("div", { className: "hawa-items-top hawa-flex hawa-gap-2 " }, /* @__PURE__ */ React8.createElement(CheckboxElement, { id, ...checkboxProps }), (label || helperText) && /* @__PURE__ */ React8.createElement("div", { className: "hawa-grid hawa-gap-1.5 hawa-leading-none" }, label && /* @__PURE__ */ React8.createElement(
|
|
545
|
+
"label",
|
|
546
|
+
{
|
|
547
|
+
role: "checkbox",
|
|
548
|
+
htmlFor: id,
|
|
549
|
+
className: cn(
|
|
550
|
+
"hawa-cursor-pointer hawa-select-none hawa-text-sm hawa-font-medium hawa-leading-none hawa-pt-0.5",
|
|
551
|
+
checkboxProps.disabled && "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70 "
|
|
552
|
+
)
|
|
553
|
+
},
|
|
554
|
+
label
|
|
555
|
+
), sublabel && /* @__PURE__ */ React8.createElement(
|
|
556
|
+
"label",
|
|
557
|
+
{
|
|
558
|
+
role: "checkbox",
|
|
559
|
+
htmlFor: id,
|
|
560
|
+
className: cn(
|
|
561
|
+
"hawa-cursor-pointer hawa-select-none hawa-text-sm hawa-text-muted-foreground",
|
|
562
|
+
checkboxProps.disabled && "hawa-cursor-not-allowed hawa-text-muted-foreground hawa-opacity-70"
|
|
563
|
+
)
|
|
564
|
+
},
|
|
565
|
+
sublabel
|
|
566
|
+
), helperText && !checkboxProps.disabled && /* @__PURE__ */ React8.createElement(
|
|
567
|
+
"label",
|
|
568
|
+
{
|
|
569
|
+
role: "checkbox",
|
|
570
|
+
htmlFor: id,
|
|
571
|
+
className: cn(
|
|
572
|
+
"hawa-select-none hawa-text-xs hawa-text-red-500",
|
|
573
|
+
checkboxProps.disabled && "hawa-cursor-not-allowed hawa-opacity-70"
|
|
574
|
+
)
|
|
575
|
+
},
|
|
576
|
+
helperText
|
|
577
|
+
)));
|
|
578
|
+
};
|
|
579
|
+
var CheckboxElement = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React8.createElement(
|
|
580
|
+
CheckboxPrimitive.Root,
|
|
581
|
+
{
|
|
582
|
+
ref,
|
|
583
|
+
className: cn(
|
|
584
|
+
"hawa-peer hawa-h-4 hawa-w-4 hawa-shrink-0 hawa-rounded-sm hawa-border hawa-border-primary hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-cursor-not-allowed disabled:hawa-opacity-50 data-[state=checked]:hawa-bg-primary data-[state=checked]:hawa-text-primary-foreground",
|
|
585
|
+
className
|
|
586
|
+
),
|
|
587
|
+
...props
|
|
588
|
+
},
|
|
589
|
+
/* @__PURE__ */ React8.createElement(
|
|
590
|
+
CheckboxPrimitive.Indicator,
|
|
591
|
+
{
|
|
592
|
+
className: cn(
|
|
593
|
+
"hawa-flex hawa-items-center hawa-justify-center hawa-text-current"
|
|
594
|
+
)
|
|
595
|
+
},
|
|
596
|
+
/* @__PURE__ */ React8.createElement(
|
|
597
|
+
"svg",
|
|
598
|
+
{
|
|
599
|
+
"aria-label": "Check Mark",
|
|
600
|
+
stroke: "currentColor",
|
|
601
|
+
fill: "currentColor",
|
|
602
|
+
strokeWidth: "0",
|
|
603
|
+
viewBox: "0 0 512 512",
|
|
604
|
+
height: "0.60em",
|
|
605
|
+
width: "0.60em"
|
|
606
|
+
},
|
|
607
|
+
/* @__PURE__ */ React8.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" })
|
|
608
|
+
),
|
|
609
|
+
" "
|
|
610
|
+
)
|
|
611
|
+
));
|
|
612
|
+
CheckboxElement.displayName = CheckboxPrimitive.Root.displayName;
|
|
613
|
+
|
|
614
|
+
// components/elements/Toast.tsx
|
|
615
|
+
import * as React9 from "react";
|
|
616
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
617
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
618
|
+
var toastVariants = cva2(
|
|
619
|
+
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
620
|
+
{
|
|
621
|
+
variants: {
|
|
622
|
+
variant: {
|
|
623
|
+
default: "border bg-background text-foreground",
|
|
624
|
+
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
|
|
625
|
+
},
|
|
626
|
+
severity: {
|
|
627
|
+
info: "info group text-info-foreground bg-info",
|
|
628
|
+
warning: "warning group text-warning-foreground bg-warning",
|
|
629
|
+
error: "error group border-error bg-error text-error-foreground",
|
|
630
|
+
success: "success group text-success-foreground bg-success",
|
|
631
|
+
none: ""
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
defaultVariants: {
|
|
635
|
+
variant: "default"
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
var ToastProvider = ToastPrimitives.Provider;
|
|
640
|
+
var ToastViewport = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
|
641
|
+
ToastPrimitives.Viewport,
|
|
642
|
+
{
|
|
643
|
+
ref,
|
|
644
|
+
className: cn(
|
|
645
|
+
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
|
|
646
|
+
className
|
|
647
|
+
),
|
|
648
|
+
...props
|
|
649
|
+
}
|
|
650
|
+
));
|
|
651
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
652
|
+
var Toast = React9.forwardRef(({ className, variant, severity = "none", direction, ...props }, ref) => {
|
|
653
|
+
return /* @__PURE__ */ React9.createElement(
|
|
654
|
+
ToastPrimitives.Root,
|
|
655
|
+
{
|
|
656
|
+
ref,
|
|
657
|
+
className: cn(
|
|
658
|
+
toastVariants({ variant, severity }),
|
|
659
|
+
className,
|
|
660
|
+
direction === "rtl" ? "p-6 pl-0 pr-10 data-[state=closed]:slide-out-to-left-full" : "p-6 pr-8 data-[state=closed]:slide-out-to-right-full"
|
|
661
|
+
),
|
|
662
|
+
dir: direction,
|
|
663
|
+
...props
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
});
|
|
667
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
668
|
+
var ToastAction = React9.forwardRef(({ className, ...props }, ref) => {
|
|
669
|
+
return /* @__PURE__ */ React9.createElement(
|
|
670
|
+
ToastPrimitives.Action,
|
|
671
|
+
{
|
|
672
|
+
ref,
|
|
673
|
+
className: cn(
|
|
674
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
675
|
+
"group-[.info]:border-muted/40 group-[.info]:hover:border-info/30 group-[.info]:hover:bg-info group-[.info]:hover:text-info-foreground group-[.info]:focus:ring-info",
|
|
676
|
+
"group-[.error]:border-muted/40 group-[.error]:hover:border-error/30 group-[.error]:hover:bg-error group-[.error]:hover:text-error-foreground group-[.error]:focus:ring-error",
|
|
677
|
+
"group-[.success]:border-muted/40 group-[.success]:hover:border-success/30 group-[.success]:hover:bg-success group-[.success]:hover:text-success-foreground group-[.success]:focus:ring-success",
|
|
678
|
+
"group-[.warning]:border-muted/40 group-[.warning]:hover:border-warning/30 group-[.warning]:hover:bg-warning group-[.warning]:hover:text-warning-foreground group-[.warning]:focus:ring-warning",
|
|
679
|
+
className
|
|
680
|
+
),
|
|
681
|
+
...props
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
});
|
|
685
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
686
|
+
var ToastClose = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
|
687
|
+
ToastPrimitives.Close,
|
|
688
|
+
{
|
|
689
|
+
ref,
|
|
690
|
+
className: cn(
|
|
691
|
+
"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
692
|
+
className
|
|
693
|
+
),
|
|
694
|
+
"toast-close": "",
|
|
695
|
+
...props
|
|
696
|
+
},
|
|
697
|
+
/* @__PURE__ */ React9.createElement(
|
|
698
|
+
"svg",
|
|
699
|
+
{
|
|
700
|
+
"aria-label": "Close Icon",
|
|
701
|
+
"aria-hidden": "true",
|
|
702
|
+
className: "h-4 w-4",
|
|
703
|
+
fill: "currentColor",
|
|
704
|
+
viewBox: "0 0 20 20"
|
|
705
|
+
},
|
|
706
|
+
/* @__PURE__ */ React9.createElement(
|
|
707
|
+
"path",
|
|
708
|
+
{
|
|
709
|
+
fillRule: "evenodd",
|
|
710
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
711
|
+
clipRule: "evenodd"
|
|
712
|
+
}
|
|
713
|
+
)
|
|
714
|
+
)
|
|
715
|
+
));
|
|
716
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
717
|
+
var ToastTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
|
718
|
+
ToastPrimitives.Title,
|
|
719
|
+
{
|
|
720
|
+
ref,
|
|
721
|
+
className: cn("text-sm font-semibold", className),
|
|
722
|
+
...props
|
|
723
|
+
}
|
|
724
|
+
));
|
|
725
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
726
|
+
var ToastDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement(
|
|
727
|
+
ToastPrimitives.Description,
|
|
728
|
+
{
|
|
729
|
+
ref,
|
|
730
|
+
className: cn("text-sm opacity-90", className),
|
|
731
|
+
...props
|
|
732
|
+
}
|
|
733
|
+
));
|
|
734
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
735
|
+
|
|
736
|
+
// components/elements/Toaster.tsx
|
|
737
|
+
import React11 from "react";
|
|
738
|
+
|
|
739
|
+
// components/hooks/useToast.ts
|
|
740
|
+
import * as React10 from "react";
|
|
741
|
+
var TOAST_LIMIT = 5;
|
|
742
|
+
var TOAST_REMOVE_DELAY = 1e5;
|
|
743
|
+
var count = 0;
|
|
744
|
+
function genId() {
|
|
745
|
+
count = (count + 1) % Number.MAX_VALUE;
|
|
746
|
+
return count.toString();
|
|
747
|
+
}
|
|
748
|
+
var toastTimeouts = /* @__PURE__ */ new Map();
|
|
749
|
+
var addToRemoveQueue = (toastId) => {
|
|
750
|
+
if (toastTimeouts.has(toastId)) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const timeout = setTimeout(() => {
|
|
754
|
+
toastTimeouts.delete(toastId);
|
|
755
|
+
dispatch({
|
|
756
|
+
type: "REMOVE_TOAST",
|
|
757
|
+
toastId
|
|
758
|
+
});
|
|
759
|
+
}, TOAST_REMOVE_DELAY);
|
|
760
|
+
toastTimeouts.set(toastId, timeout);
|
|
761
|
+
};
|
|
762
|
+
var reducer = (state, action) => {
|
|
763
|
+
switch (action.type) {
|
|
764
|
+
case "ADD_TOAST":
|
|
765
|
+
return {
|
|
766
|
+
...state,
|
|
767
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
|
|
768
|
+
};
|
|
769
|
+
case "UPDATE_TOAST":
|
|
770
|
+
return {
|
|
771
|
+
...state,
|
|
772
|
+
toasts: state.toasts.map(
|
|
773
|
+
(t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
|
|
774
|
+
)
|
|
775
|
+
};
|
|
776
|
+
case "DISMISS_TOAST": {
|
|
777
|
+
const { toastId } = action;
|
|
778
|
+
if (toastId) {
|
|
779
|
+
addToRemoveQueue(toastId);
|
|
780
|
+
} else {
|
|
781
|
+
state.toasts.forEach((toast2) => {
|
|
782
|
+
addToRemoveQueue(toast2.id);
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
return {
|
|
786
|
+
...state,
|
|
787
|
+
toasts: state.toasts.map(
|
|
788
|
+
(t) => t.id === toastId || toastId === void 0 ? { ...t, open: false } : t
|
|
789
|
+
)
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
case "REMOVE_TOAST":
|
|
793
|
+
if (action.toastId === void 0) {
|
|
794
|
+
return { ...state, toasts: [] };
|
|
795
|
+
}
|
|
796
|
+
return {
|
|
797
|
+
...state,
|
|
798
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId)
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
var listeners = [];
|
|
803
|
+
var memoryState = { toasts: [] };
|
|
804
|
+
function dispatch(action) {
|
|
805
|
+
memoryState = reducer(memoryState, action);
|
|
806
|
+
listeners.forEach((listener) => {
|
|
807
|
+
listener(memoryState);
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
function toast({ ...props }) {
|
|
811
|
+
const id = genId();
|
|
812
|
+
const update = (props2) => dispatch({
|
|
813
|
+
type: "UPDATE_TOAST",
|
|
814
|
+
toast: { ...props2, id }
|
|
815
|
+
});
|
|
816
|
+
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
817
|
+
dispatch({
|
|
818
|
+
type: "ADD_TOAST",
|
|
819
|
+
toast: {
|
|
820
|
+
...props,
|
|
821
|
+
id,
|
|
822
|
+
open: true,
|
|
823
|
+
onOpenChange: (open) => {
|
|
824
|
+
if (!open)
|
|
825
|
+
dismiss();
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
return {
|
|
830
|
+
id,
|
|
831
|
+
dismiss,
|
|
832
|
+
update
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
function useToast() {
|
|
836
|
+
const [state, setState] = React10.useState(memoryState);
|
|
837
|
+
React10.useEffect(() => {
|
|
838
|
+
listeners.push(setState);
|
|
839
|
+
return () => {
|
|
840
|
+
const index = listeners.indexOf(setState);
|
|
841
|
+
if (index > -1) {
|
|
842
|
+
listeners.splice(index, 1);
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
}, [state]);
|
|
846
|
+
return {
|
|
847
|
+
...state,
|
|
848
|
+
toast,
|
|
849
|
+
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// components/elements/Toaster.tsx
|
|
854
|
+
function Toaster(props) {
|
|
855
|
+
const { toasts } = useToast();
|
|
856
|
+
let isRTL = props.direction === "rtl";
|
|
857
|
+
return /* @__PURE__ */ React11.createElement(ToastProvider, { swipeDirection: isRTL ? "left" : "right" }, toasts.map(function({ id, title, description, action, ...toastProps }) {
|
|
858
|
+
return /* @__PURE__ */ React11.createElement(Toast, { direction: props.direction, key: id, ...toastProps }, /* @__PURE__ */ React11.createElement("div", { className: "grid gap-1 text-start" }, title && /* @__PURE__ */ React11.createElement(ToastTitle, null, title), description && /* @__PURE__ */ React11.createElement(ToastDescription, null, description)), action, /* @__PURE__ */ React11.createElement(ToastClose, null));
|
|
859
|
+
}), /* @__PURE__ */ React11.createElement(ToastViewport, { className: cn("gap-2", isRTL && "fixed left-0") }));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
// components/elements/Switch.tsx
|
|
863
|
+
import * as React12 from "react";
|
|
864
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
865
|
+
var rootSize = {
|
|
866
|
+
default: "hawa-h-[25px] hawa-w-[42px]",
|
|
867
|
+
sm: "hawa-h-[20px] hawa-w-[37px]",
|
|
868
|
+
lg: "hawa-h-[30px] hawa-w-[47px]"
|
|
869
|
+
};
|
|
870
|
+
var thumbSize = {
|
|
871
|
+
default: "hawa-h-[21px] hawa-w-[21px]",
|
|
872
|
+
sm: "hawa-h-[16px] hawa-w-[16px]",
|
|
873
|
+
lg: "hawa-h-[26px] hawa-w-[26px]"
|
|
874
|
+
};
|
|
875
|
+
var Switch = React12.forwardRef(({ className, size = "default", label, ...props }, ref) => {
|
|
876
|
+
const [parentDirection, setParentDirection] = React12.useState(
|
|
877
|
+
null
|
|
878
|
+
);
|
|
879
|
+
const parentRef = React12.useRef(null);
|
|
880
|
+
React12.useEffect(() => {
|
|
881
|
+
const parentNode = parentRef.current?.parentNode;
|
|
882
|
+
if (parentNode) {
|
|
883
|
+
const dir = window.getComputedStyle(parentNode).direction;
|
|
884
|
+
setParentDirection(dir);
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center", ref: parentRef }, /* @__PURE__ */ React12.createElement(
|
|
888
|
+
SwitchPrimitives.Root,
|
|
889
|
+
{
|
|
890
|
+
className: cn(
|
|
891
|
+
"hawa-relative hawa-cursor-pointer hawa-rounded-full hawa-bg-primary/20 hawa-outline-none data-[state=checked]:hawa-bg-primary",
|
|
892
|
+
className,
|
|
893
|
+
rootSize[size]
|
|
894
|
+
),
|
|
895
|
+
...props,
|
|
896
|
+
ref
|
|
897
|
+
},
|
|
898
|
+
/* @__PURE__ */ React12.createElement(
|
|
899
|
+
SwitchPrimitives.Thumb,
|
|
900
|
+
{
|
|
901
|
+
className: cn(
|
|
902
|
+
thumbSize[size],
|
|
903
|
+
"hawa-block hawa-rounded-full hawa-bg-white hawa-transition-transform hawa-duration-100 hawa-will-change-transform data-[state=checked]:hawa-bg-primary-foreground dark:hawa-bg-background",
|
|
904
|
+
parentDirection === "rtl" ? "hawa--translate-x-0.5 data-[state=checked]:hawa--translate-x-[19px]" : "hawa-translate-x-0.5 data-[state=checked]:hawa-translate-x-[19px]"
|
|
905
|
+
)
|
|
906
|
+
}
|
|
907
|
+
)
|
|
908
|
+
), label && /* @__PURE__ */ React12.createElement("span", { className: "hawa-mx-2 hawa-text-sm hawa-font-medium hawa-text-gray-900 dark:hawa-text-gray-300" }, label));
|
|
909
|
+
});
|
|
910
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
911
|
+
|
|
912
|
+
// components/elements/Radio.tsx
|
|
913
|
+
import React13, { useState as useState5, useRef as useRef2, useEffect as useEffect3 } from "react";
|
|
914
|
+
var Radio = ({
|
|
915
|
+
design = "default",
|
|
916
|
+
width = "default",
|
|
917
|
+
orientation = "horizontal",
|
|
918
|
+
...props
|
|
919
|
+
}) => {
|
|
920
|
+
const [selectedOption, setSelectedOption] = useState5(props.defaultValue);
|
|
921
|
+
let activeTabStyle = "hawa-inline-block hawa-py-2 hawa-px-4 hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary ";
|
|
922
|
+
let inactiveTabStyle = "hawa-inline-block hawa-py-2 hawa-px-4 hawa-w-full hawa-transition-all hover:hawa-bg-primary/10 dark:hawa-bg-background hawa-bg-primary/5 hover:hawa-text-gray-900 dark:hover:hawa-bg-primary/10 dark:hover:hawa-text-white dark:hawa-bg-primary/5";
|
|
923
|
+
let orientationStyle = {
|
|
924
|
+
horizontal: "hawa-flex hawa-flex-row",
|
|
925
|
+
vertical: "hawa-flex hawa-flex-col"
|
|
926
|
+
};
|
|
927
|
+
let widthStyle = {
|
|
928
|
+
default: "hawa-max-w-fit",
|
|
929
|
+
full: "hawa-w-full"
|
|
930
|
+
};
|
|
931
|
+
const [parentDirection, setParentDirection] = React13.useState(
|
|
932
|
+
null
|
|
933
|
+
);
|
|
934
|
+
const parentRef = useRef2(null);
|
|
935
|
+
useEffect3(() => {
|
|
936
|
+
const parentNode = parentRef.current?.parentNode;
|
|
937
|
+
if (parentNode) {
|
|
938
|
+
const dir = window.getComputedStyle(parentNode).direction;
|
|
939
|
+
setParentDirection(dir);
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
switch (design) {
|
|
943
|
+
case "tabs":
|
|
944
|
+
return /* @__PURE__ */ React13.createElement(
|
|
945
|
+
"ul",
|
|
946
|
+
{
|
|
947
|
+
ref: parentRef,
|
|
948
|
+
className: cn(
|
|
949
|
+
props.options && props.options?.length > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
|
|
950
|
+
"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-text-sm hawa-font-medium",
|
|
951
|
+
widthStyle[width],
|
|
952
|
+
orientationStyle[orientation]
|
|
953
|
+
)
|
|
954
|
+
},
|
|
955
|
+
props.options?.map((opt, o) => /* @__PURE__ */ React13.createElement(
|
|
956
|
+
"li",
|
|
957
|
+
{
|
|
958
|
+
"aria-current": "page",
|
|
959
|
+
onClick: () => {
|
|
960
|
+
setSelectedOption(opt.value);
|
|
961
|
+
props.onChangeTab(opt.value);
|
|
962
|
+
},
|
|
963
|
+
className: cn(
|
|
964
|
+
"hawa-w-full hawa-cursor-pointer ",
|
|
965
|
+
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
|
966
|
+
orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
|
|
967
|
+
orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
|
|
968
|
+
"hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
|
|
969
|
+
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
|
970
|
+
),
|
|
971
|
+
key: o
|
|
972
|
+
},
|
|
973
|
+
opt.icon && opt.icon,
|
|
974
|
+
opt.label
|
|
975
|
+
))
|
|
976
|
+
);
|
|
977
|
+
case "bordered":
|
|
978
|
+
return /* @__PURE__ */ React13.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React13.createElement("div", { className: "hawa-rounded hawa-border hawa-border-gray-200 " }, /* @__PURE__ */ React13.createElement(
|
|
979
|
+
"div",
|
|
980
|
+
{
|
|
981
|
+
className: "radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
|
|
982
|
+
key: i + 1
|
|
983
|
+
},
|
|
984
|
+
/* @__PURE__ */ React13.createElement(
|
|
985
|
+
"input",
|
|
986
|
+
{
|
|
987
|
+
disabled: opt.disabled,
|
|
988
|
+
id: opt.value.toString(),
|
|
989
|
+
type: "radio",
|
|
990
|
+
value: opt.value,
|
|
991
|
+
name: "bordered-radio"
|
|
992
|
+
}
|
|
993
|
+
),
|
|
994
|
+
/* @__PURE__ */ React13.createElement(
|
|
995
|
+
"label",
|
|
996
|
+
{
|
|
997
|
+
htmlFor: opt.value.toString(),
|
|
998
|
+
className: cn(
|
|
999
|
+
"hawa-ml-2 hawa-w-full hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
|
1000
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
|
1001
|
+
)
|
|
1002
|
+
},
|
|
1003
|
+
opt.label
|
|
1004
|
+
)
|
|
1005
|
+
))));
|
|
1006
|
+
case "cards":
|
|
1007
|
+
return /* @__PURE__ */ React13.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options?.map((opt, o) => /* @__PURE__ */ React13.createElement("li", null, /* @__PURE__ */ React13.createElement(
|
|
1008
|
+
"input",
|
|
1009
|
+
{
|
|
1010
|
+
type: "radio",
|
|
1011
|
+
id: opt.value.toString(),
|
|
1012
|
+
name: "cards-radio",
|
|
1013
|
+
value: opt.value.toString(),
|
|
1014
|
+
className: "hawa-peer hawa-hidden",
|
|
1015
|
+
required: true,
|
|
1016
|
+
disabled: opt.disabled
|
|
1017
|
+
}
|
|
1018
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1019
|
+
"label",
|
|
1020
|
+
{
|
|
1021
|
+
htmlFor: opt.value.toString(),
|
|
1022
|
+
className: cn(
|
|
1023
|
+
"hawa-inline-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-white hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-blue-600 peer-checked:hawa-text-blue-600 dark:hawa-border-gray-700 dark:hawa-bg-gray-800 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
|
1024
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-gray-100 hover:hawa-text-gray-600 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-gray-300"
|
|
1025
|
+
)
|
|
1026
|
+
},
|
|
1027
|
+
/* @__PURE__ */ React13.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React13.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
|
1028
|
+
))));
|
|
1029
|
+
default:
|
|
1030
|
+
return /* @__PURE__ */ React13.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React13.createElement(
|
|
1031
|
+
"div",
|
|
1032
|
+
{
|
|
1033
|
+
className: "radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
|
1034
|
+
key: i + 1
|
|
1035
|
+
},
|
|
1036
|
+
/* @__PURE__ */ React13.createElement(
|
|
1037
|
+
"input",
|
|
1038
|
+
{
|
|
1039
|
+
disabled: opt.disabled,
|
|
1040
|
+
id: opt.value.toString(),
|
|
1041
|
+
type: "radio",
|
|
1042
|
+
value: opt.value,
|
|
1043
|
+
name: "default-radio"
|
|
1044
|
+
}
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ React13.createElement(
|
|
1047
|
+
"label",
|
|
1048
|
+
{
|
|
1049
|
+
htmlFor: opt.value.toString(),
|
|
1050
|
+
className: cn(
|
|
1051
|
+
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
|
1052
|
+
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
|
1053
|
+
)
|
|
1054
|
+
},
|
|
1055
|
+
opt.label
|
|
1056
|
+
)
|
|
1057
|
+
)));
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
// components/elements/DropdownMenu.tsx
|
|
1062
|
+
import * as React14 from "react";
|
|
1063
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1064
|
+
var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
|
1065
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1066
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1067
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1068
|
+
var DropdownMenuSubTrigger = React14.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1069
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1070
|
+
{
|
|
1071
|
+
ref,
|
|
1072
|
+
className: cn(
|
|
1073
|
+
"hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-px-2 hawa-py-3 hawa-text-sm hawa-outline-none focus:hawa-bg-accent data-[state=open]:hawa-bg-accent",
|
|
1074
|
+
inset && "hawa-pl-8",
|
|
1075
|
+
className
|
|
1076
|
+
),
|
|
1077
|
+
...props
|
|
1078
|
+
},
|
|
1079
|
+
/* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, children),
|
|
1080
|
+
" ",
|
|
1081
|
+
/* @__PURE__ */ React14.createElement(
|
|
1082
|
+
"svg",
|
|
1083
|
+
{
|
|
1084
|
+
"aria-label": "Chevron Right Icon",
|
|
1085
|
+
stroke: "currentColor",
|
|
1086
|
+
fill: "currentColor",
|
|
1087
|
+
strokeWidth: "0",
|
|
1088
|
+
viewBox: "0 0 16 16",
|
|
1089
|
+
height: "1em",
|
|
1090
|
+
width: "1em",
|
|
1091
|
+
className: cn(props.dir === "rtl" ? "hawa-rotate-180" : "")
|
|
1092
|
+
},
|
|
1093
|
+
/* @__PURE__ */ React14.createElement(
|
|
1094
|
+
"path",
|
|
1095
|
+
{
|
|
1096
|
+
fillRule: "evenodd",
|
|
1097
|
+
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"
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
)
|
|
1101
|
+
));
|
|
1102
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1103
|
+
var DropdownMenuSubContent = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1104
|
+
DropdownMenuPrimitive.SubContent,
|
|
1105
|
+
{
|
|
1106
|
+
ref,
|
|
1107
|
+
className: cn(
|
|
1108
|
+
"hawa-z-50 hawa-min-w-[8rem] hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
|
1109
|
+
className
|
|
1110
|
+
),
|
|
1111
|
+
...props
|
|
1112
|
+
}
|
|
1113
|
+
));
|
|
1114
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1115
|
+
var DropdownMenuContent = React14.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React14.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React14.createElement(
|
|
1116
|
+
DropdownMenuPrimitive.Content,
|
|
1117
|
+
{
|
|
1118
|
+
ref,
|
|
1119
|
+
sideOffset,
|
|
1120
|
+
className: cn(
|
|
1121
|
+
"hawa-z-50 hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-p-1 hawa-text-popover-foreground hawa-shadow-md data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
|
|
1122
|
+
className
|
|
1123
|
+
),
|
|
1124
|
+
...props
|
|
1125
|
+
}
|
|
1126
|
+
)));
|
|
1127
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1128
|
+
var DropdownMenuItem = React14.forwardRef(({ className, inset, ...props }, ref) => {
|
|
1129
|
+
console.log("sdsdsds", props.children);
|
|
1130
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1131
|
+
DropdownMenuPrimitive.Item,
|
|
1132
|
+
{
|
|
1133
|
+
disabled: props.disabled,
|
|
1134
|
+
ref,
|
|
1135
|
+
className: cn(
|
|
1136
|
+
"hawa-relative hawa-flex hawa-cursor-pointer hawa-select-none hawa-items-center hawa-justify-between hawa-rounded-sm hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
|
|
1137
|
+
inset && "hawa-pl-8",
|
|
1138
|
+
props.end && Array.isArray(props.children) && props.children[1] && "hawa-gap-6",
|
|
1139
|
+
className
|
|
1140
|
+
),
|
|
1141
|
+
...props
|
|
1142
|
+
},
|
|
1143
|
+
/* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 " }, props.children),
|
|
1144
|
+
props.end && props.end
|
|
1145
|
+
);
|
|
1146
|
+
});
|
|
1147
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1148
|
+
var DropdownMenuCheckboxItem = React14.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1149
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
1150
|
+
{
|
|
1151
|
+
ref,
|
|
1152
|
+
className: cn(
|
|
1153
|
+
"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
|
|
1154
|
+
className
|
|
1155
|
+
),
|
|
1156
|
+
checked,
|
|
1157
|
+
...props
|
|
1158
|
+
},
|
|
1159
|
+
/* @__PURE__ */ React14.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__ */ React14.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React14.createElement(
|
|
1160
|
+
"svg",
|
|
1161
|
+
{
|
|
1162
|
+
"aria-label": "Check Mark",
|
|
1163
|
+
stroke: "currentColor",
|
|
1164
|
+
fill: "currentColor",
|
|
1165
|
+
strokeWidth: "0",
|
|
1166
|
+
viewBox: "0 0 512 512",
|
|
1167
|
+
height: "0.60em",
|
|
1168
|
+
width: "0.60em"
|
|
1169
|
+
},
|
|
1170
|
+
/* @__PURE__ */ React14.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" })
|
|
1171
|
+
), " ")),
|
|
1172
|
+
children
|
|
1173
|
+
));
|
|
1174
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1175
|
+
var DropdownMenuRadioItem = React14.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1176
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1177
|
+
{
|
|
1178
|
+
ref,
|
|
1179
|
+
className: cn(
|
|
1180
|
+
"hawa-relative hawa-flex hawa-cursor-default hawa-select-none hawa-items-center hawa-rounded-sm hawa-py-1.5 hawa-pl-8 hawa-pr-2 hawa-text-sm hawa-outline-none hawa-transition-colors focus:hawa-bg-accent focus:hawa-text-accent-foreground data-[disabled]:hawa-pointer-events-none data-[disabled]:hawa-opacity-50",
|
|
1181
|
+
className
|
|
1182
|
+
),
|
|
1183
|
+
...props
|
|
1184
|
+
},
|
|
1185
|
+
/* @__PURE__ */ React14.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__ */ React14.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React14.createElement(
|
|
1186
|
+
"svg",
|
|
1187
|
+
{
|
|
1188
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1189
|
+
width: "24",
|
|
1190
|
+
"aria-label": "Circle",
|
|
1191
|
+
height: "24",
|
|
1192
|
+
viewBox: "0 0 24 24",
|
|
1193
|
+
fill: "none",
|
|
1194
|
+
stroke: "currentColor",
|
|
1195
|
+
strokeWidth: "2",
|
|
1196
|
+
strokeLinecap: "round",
|
|
1197
|
+
strokeLinejoin: "round",
|
|
1198
|
+
className: "hawa-h-2 hawa-w-2 hawa-fill-current"
|
|
1199
|
+
},
|
|
1200
|
+
/* @__PURE__ */ React14.createElement("circle", { cx: "12", cy: "12", r: "10" })
|
|
1201
|
+
))),
|
|
1202
|
+
children
|
|
1203
|
+
));
|
|
1204
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1205
|
+
var DropdownMenuLabel = React14.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1206
|
+
DropdownMenuPrimitive.Label,
|
|
1207
|
+
{
|
|
1208
|
+
ref,
|
|
1209
|
+
className: cn(
|
|
1210
|
+
"hawa-px-2 hawa-py-1.5 hawa-text-sm hawa-font-semibold",
|
|
1211
|
+
inset && "hawa-pl-8",
|
|
1212
|
+
className
|
|
1213
|
+
),
|
|
1214
|
+
...props
|
|
1215
|
+
}
|
|
1216
|
+
));
|
|
1217
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1218
|
+
var DropdownMenuSeparator = React14.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
1219
|
+
DropdownMenuPrimitive.Separator,
|
|
1220
|
+
{
|
|
1221
|
+
ref,
|
|
1222
|
+
className: cn("hawa--mx-1 hawa-my-1 hawa-h-px hawa-bg-muted", className),
|
|
1223
|
+
...props
|
|
1224
|
+
}
|
|
1225
|
+
));
|
|
1226
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1227
|
+
var DropdownMenuShortcut = ({
|
|
1228
|
+
className,
|
|
1229
|
+
...props
|
|
1230
|
+
}) => {
|
|
1231
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1232
|
+
"span",
|
|
1233
|
+
{
|
|
1234
|
+
className: cn(
|
|
1235
|
+
"hawa-ml-auto hawa-text-xs hawa-tracking-widest hawa-opacity-60",
|
|
1236
|
+
className
|
|
1237
|
+
),
|
|
1238
|
+
...props
|
|
1239
|
+
}
|
|
1240
|
+
);
|
|
1241
|
+
};
|
|
1242
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1243
|
+
var DropdownMenu = ({
|
|
1244
|
+
trigger,
|
|
1245
|
+
items,
|
|
1246
|
+
direction,
|
|
1247
|
+
sideOffset,
|
|
1248
|
+
side,
|
|
1249
|
+
className,
|
|
1250
|
+
triggerClassname,
|
|
1251
|
+
align,
|
|
1252
|
+
alignOffset,
|
|
1253
|
+
onItemSelect,
|
|
1254
|
+
size = "default",
|
|
1255
|
+
width = "default"
|
|
1256
|
+
}) => {
|
|
1257
|
+
const widthStyles = {
|
|
1258
|
+
default: "hawa-min-w-[8rem]",
|
|
1259
|
+
sm: "hawa-w-fit",
|
|
1260
|
+
lg: "hawa-w-[200px]",
|
|
1261
|
+
parent: "ddm-w-parent"
|
|
1262
|
+
};
|
|
1263
|
+
const sizeStyles = {
|
|
1264
|
+
default: "hawa-px-2 hawa-py-3 ",
|
|
1265
|
+
sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5"
|
|
1266
|
+
};
|
|
1267
|
+
return /* @__PURE__ */ React14.createElement(DropdownMenuRoot, { dir: direction }, /* @__PURE__ */ React14.createElement(DropdownMenuTrigger, { asChild: true, className: triggerClassname }, trigger), /* @__PURE__ */ React14.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React14.createElement(
|
|
1268
|
+
DropdownMenuContent,
|
|
1269
|
+
{
|
|
1270
|
+
side,
|
|
1271
|
+
sideOffset,
|
|
1272
|
+
className: cn(
|
|
1273
|
+
className,
|
|
1274
|
+
widthStyles[width],
|
|
1275
|
+
"hawa-flex hawa-flex-col hawa-gap-2"
|
|
1276
|
+
),
|
|
1277
|
+
align,
|
|
1278
|
+
alignOffset
|
|
1279
|
+
},
|
|
1280
|
+
items && items.map((item, index) => {
|
|
1281
|
+
if (item.type === "separator") {
|
|
1282
|
+
return /* @__PURE__ */ React14.createElement(DropdownMenuSeparator, { key: index });
|
|
1283
|
+
} else if (item.type === "label") {
|
|
1284
|
+
return /* @__PURE__ */ React14.createElement(DropdownMenuLabel, { key: index }, item.label);
|
|
1285
|
+
} else {
|
|
1286
|
+
return item.subitems ? /* @__PURE__ */ React14.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React14.createElement(
|
|
1287
|
+
DropdownMenuSubTrigger,
|
|
1288
|
+
{
|
|
1289
|
+
className: cn(sizeStyles[size]),
|
|
1290
|
+
dir: direction
|
|
1291
|
+
},
|
|
1292
|
+
item.icon && item.icon,
|
|
1293
|
+
item.label && item.label
|
|
1294
|
+
), /* @__PURE__ */ React14.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React14.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React14.createElement(
|
|
1295
|
+
DropdownMenuItem,
|
|
1296
|
+
{
|
|
1297
|
+
key: subIndex,
|
|
1298
|
+
className: cn(
|
|
1299
|
+
sizeStyles[size],
|
|
1300
|
+
!item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
|
|
1301
|
+
),
|
|
1302
|
+
disabled: subitem.disabled,
|
|
1303
|
+
onSelect: () => {
|
|
1304
|
+
subitem.action && subitem.action();
|
|
1305
|
+
if (onItemSelect) {
|
|
1306
|
+
onItemSelect(subitem.value);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
subitem.icon && subitem.icon,
|
|
1311
|
+
subitem.label && subitem.label
|
|
1312
|
+
))))) : /* @__PURE__ */ React14.createElement(
|
|
1313
|
+
DropdownMenuItem,
|
|
1314
|
+
{
|
|
1315
|
+
key: index,
|
|
1316
|
+
disabled: item.disabled,
|
|
1317
|
+
onSelect: (e) => {
|
|
1318
|
+
if (item.presist) {
|
|
1319
|
+
e.preventDefault();
|
|
1320
|
+
}
|
|
1321
|
+
if (item.action) {
|
|
1322
|
+
item.action();
|
|
1323
|
+
if (onItemSelect) {
|
|
1324
|
+
onItemSelect(item.value);
|
|
1325
|
+
}
|
|
1326
|
+
} else {
|
|
1327
|
+
if (onItemSelect) {
|
|
1328
|
+
onItemSelect(item.value);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
end: item.end,
|
|
1333
|
+
className: cn(
|
|
1334
|
+
sizeStyles[size],
|
|
1335
|
+
!item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent " : "focus:hawa-bg-accent ",
|
|
1336
|
+
item.presist && "focus:hawa-bg-transparent"
|
|
1337
|
+
)
|
|
1338
|
+
},
|
|
1339
|
+
item.icon && item.icon,
|
|
1340
|
+
item.label && item.label
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
})
|
|
1344
|
+
)));
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
// components/elements/ActionCard.tsx
|
|
1348
|
+
import React15, { useState as useState6 } from "react";
|
|
1349
|
+
var ActionCard = (props) => {
|
|
1350
|
+
const [hovered, setHovered] = useState6(false);
|
|
1351
|
+
return /* @__PURE__ */ React15.createElement("div", { className: "hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-gap-1" }, /* @__PURE__ */ React15.createElement(
|
|
1352
|
+
"div",
|
|
1353
|
+
{
|
|
1354
|
+
className: "hawa-group hawa-relative hawa-h-full hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-bg-cover hawa-bg-center hawa-transition-all hawa-duration-500 hover:hawa-drop-shadow-2xl",
|
|
1355
|
+
style: {
|
|
1356
|
+
backgroundImage: `url(${props.blank ? "" : props.cardImage})`
|
|
1357
|
+
},
|
|
1358
|
+
onMouseEnter: () => setHovered(true),
|
|
1359
|
+
onMouseLeave: () => setHovered(false)
|
|
1360
|
+
},
|
|
1361
|
+
props.blank ? /* @__PURE__ */ React15.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center " }, /* @__PURE__ */ React15.createElement(
|
|
1362
|
+
"svg",
|
|
1363
|
+
{
|
|
1364
|
+
className: "hawa-h-10 hawa-w-10 hawa-text-foreground",
|
|
1365
|
+
stroke: "currentColor",
|
|
1366
|
+
fill: "currentColor",
|
|
1367
|
+
"stroke-width": "0",
|
|
1368
|
+
viewBox: "0 0 24 24",
|
|
1369
|
+
height: "1em",
|
|
1370
|
+
width: "1em",
|
|
1371
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1372
|
+
},
|
|
1373
|
+
/* @__PURE__ */ React15.createElement("path", { d: "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" })
|
|
1374
|
+
)) : /* @__PURE__ */ React15.createElement("div", { className: "hawa-absolute hawa-inset-0 hawa-rounded hawa-bg-black hawa-opacity-50" }),
|
|
1375
|
+
/* @__PURE__ */ React15.createElement("div", { className: "hawa-absolute hawa-bottom-2 hawa-right-2 hawa-z-10 hawa-opacity-0 hawa-transition-all hawa-duration-200 group-hover:hawa-opacity-100" }, props.inCardActions),
|
|
1376
|
+
!props.blank && /* @__PURE__ */ React15.createElement("div", { className: "hawa-relative hawa-p-4" }, /* @__PURE__ */ React15.createElement("h1", { className: "hawa-text-white" }, props.title), /* @__PURE__ */ React15.createElement("p", { className: "hawa-text-white" }, props.subtitle))
|
|
1377
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1378
|
+
"div",
|
|
1379
|
+
{
|
|
1380
|
+
className: `hawa-flex hawa-flex-row hawa-justify-between hawa-text-sm hawa-transition-all hawa-duration-200 ${hovered ? "hawa-opacity-100" : "hawa-opacity-0"}`
|
|
1381
|
+
},
|
|
1382
|
+
props.bottomElement
|
|
1383
|
+
));
|
|
1384
|
+
};
|
|
1385
|
+
export {
|
|
1386
|
+
ActionCard,
|
|
1387
|
+
Breadcrumb,
|
|
1388
|
+
Button,
|
|
1389
|
+
Card,
|
|
1390
|
+
CardContent,
|
|
1391
|
+
CardDescription,
|
|
1392
|
+
CardFooter,
|
|
1393
|
+
CardHeader,
|
|
1394
|
+
CardTitle,
|
|
1395
|
+
Checkbox,
|
|
1396
|
+
CodeBlock,
|
|
1397
|
+
Dialog,
|
|
1398
|
+
DialogContent,
|
|
1399
|
+
DialogDescription,
|
|
1400
|
+
DialogFooter,
|
|
1401
|
+
DialogHeader,
|
|
1402
|
+
DialogTitle,
|
|
1403
|
+
DialogTrigger,
|
|
1404
|
+
DropdownMenu,
|
|
1405
|
+
Loading,
|
|
1406
|
+
Radio,
|
|
1407
|
+
Switch,
|
|
1408
|
+
Toast,
|
|
1409
|
+
ToastAction,
|
|
1410
|
+
ToastClose,
|
|
1411
|
+
ToastDescription,
|
|
1412
|
+
ToastProvider,
|
|
1413
|
+
ToastTitle,
|
|
1414
|
+
ToastViewport,
|
|
1415
|
+
Toaster,
|
|
1416
|
+
Tooltip,
|
|
1417
|
+
buttonVariants
|
|
1418
|
+
};
|