@sikka/hawa 0.23.9-next → 0.23.11-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/DropdownMenu-jh4puuXw.d.ts +95 -0
- package/dist/DropdownMenu-vm2kRAhL.d.mts +95 -0
- package/dist/Radio-2ZwcMDWt.d.ts +74 -0
- package/dist/Radio-5ZANA8Vh.d.mts +74 -0
- package/dist/SimpleTable-EE4ejgUR.d.mts +97 -0
- package/dist/SimpleTable-vY1ziD-2.d.ts +97 -0
- package/dist/Toast-jAb16JQg.d.mts +23 -0
- package/dist/Toast-xcELwcIX.d.ts +23 -0
- package/dist/accordion/index.d.mts +1 -1
- package/dist/accordion/index.d.ts +1 -1
- package/dist/alert/index.d.mts +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/avatar/index.d.mts +1 -1
- package/dist/avatar/index.d.ts +1 -1
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/backToTop/index.mjs +4 -2
- package/dist/blocks/index.d.mts +480 -0
- package/dist/blocks/index.d.ts +480 -0
- package/dist/blocks/index.js +8119 -0
- package/dist/blocks/index.mjs +2535 -0
- package/dist/blocks/pricing/index.js +40 -40
- package/dist/blocks/pricing/index.mjs +38 -38
- package/dist/carousel/index.d.mts +13 -0
- package/dist/carousel/index.d.ts +13 -0
- package/dist/carousel/index.js +186 -0
- package/dist/carousel/index.mjs +144 -0
- package/dist/checkbox/index.d.mts +2 -1
- package/dist/checkbox/index.d.ts +2 -1
- package/dist/chip/index.d.mts +37 -2
- package/dist/chip/index.d.ts +37 -2
- package/dist/chip/index.mjs +83 -3
- package/dist/chunk-343SRWR4.mjs +146 -0
- package/dist/{chunk-3N6JJKMN.mjs → chunk-DGWAHQRX.mjs} +3 -7
- package/dist/chunk-FNVYY7ND.mjs +22 -0
- package/dist/chunk-HSOVWPQN.mjs +138 -0
- package/dist/chunk-LRLLDOQZ.mjs +178 -0
- package/dist/chunk-ND4BWUKH.mjs +34 -0
- package/dist/chunk-RYORXSDA.mjs +7519 -0
- package/dist/codeBlock/index.d.mts +23 -0
- package/dist/codeBlock/index.d.ts +23 -0
- package/dist/codeBlock/index.js +2772 -0
- package/dist/codeBlock/index.mjs +2656 -0
- package/dist/collapsible/index.d.mts +8 -0
- package/dist/collapsible/index.d.ts +8 -0
- package/dist/collapsible/index.js +49 -0
- package/dist/collapsible/index.mjs +10 -0
- package/dist/colorPicker/index.d.mts +30 -0
- package/dist/colorPicker/index.d.ts +30 -0
- package/dist/colorPicker/index.js +208 -0
- package/dist/colorPicker/index.mjs +6 -0
- package/dist/combobox/index.mjs +19 -43
- package/dist/commonTypes-2IGtJ5cq.d.mts +3 -0
- package/dist/commonTypes-2IGtJ5cq.d.ts +3 -0
- package/dist/commonTypes-2k6FnHw5.d.mts +4 -0
- package/dist/commonTypes-2k6FnHw5.d.ts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.mts +4 -0
- package/dist/commonTypes-3k5cNB1s.d.ts +4 -0
- package/dist/{commonTypes-N7XOVCit.d.ts → commonTypes-Abm7GBJu.d.mts} +2 -1
- package/dist/{commonTypes-N7XOVCit.d.mts → commonTypes-Abm7GBJu.d.ts} +2 -1
- package/dist/commonTypes-CKtkuNFH.d.mts +11 -0
- package/dist/commonTypes-CKtkuNFH.d.ts +11 -0
- package/dist/commonTypes-Dqxlu-9C.d.mts +4 -0
- package/dist/commonTypes-Dqxlu-9C.d.ts +4 -0
- package/dist/commonTypes-ko_NGEoT.d.mts +3 -0
- package/dist/commonTypes-ko_NGEoT.d.ts +3 -0
- package/dist/dataTable/index.d.mts +1 -2
- package/dist/dataTable/index.d.ts +1 -2
- package/dist/dataTable/index.mjs +4 -2
- package/dist/destroyableCard/index.d.mts +12 -0
- package/dist/destroyableCard/index.d.ts +12 -0
- package/dist/destroyableCard/index.js +205 -0
- package/dist/destroyableCard/index.mjs +163 -0
- package/dist/dropdownMenu/index.d.mts +1 -1
- package/dist/dropdownMenu/index.d.ts +1 -1
- package/dist/dropdownMenu/index.mjs +342 -19
- package/dist/elements/index.d.mts +715 -0
- package/dist/elements/index.d.ts +715 -0
- package/dist/elements/index.js +7719 -0
- package/dist/elements/index.mjs +285 -0
- package/dist/fileUploader/index.d.mts +5 -0
- package/dist/fileUploader/index.d.ts +5 -0
- package/dist/fileUploader/index.js +62 -0
- package/dist/fileUploader/index.mjs +25 -0
- package/dist/hooks/index.d.mts +107 -0
- package/dist/hooks/index.d.ts +107 -0
- package/dist/hooks/index.js +451 -0
- package/dist/hooks/index.mjs +254 -0
- package/dist/index.d.mts +1905 -0
- package/dist/index.d.ts +1905 -0
- package/dist/index.js +11987 -0
- package/dist/index.mjs +11760 -0
- package/dist/input/index.d.mts +1 -9
- package/dist/input/index.d.ts +1 -9
- package/dist/input/index.mjs +15 -97
- package/dist/interfaceSettings/index.d.mts +18 -0
- package/dist/interfaceSettings/index.d.ts +18 -0
- package/dist/interfaceSettings/index.js +419 -0
- package/dist/interfaceSettings/index.mjs +379 -0
- package/dist/label/index.d.mts +2 -1
- package/dist/label/index.d.ts +2 -1
- package/dist/label/index.mjs +3 -87
- package/dist/layout/index.d.mts +249 -0
- package/dist/layout/index.d.ts +249 -0
- package/dist/layout/index.js +4373 -0
- package/dist/layout/index.mjs +1381 -0
- package/dist/navigationMenu/index.d.mts +1 -2
- package/dist/navigationMenu/index.d.ts +1 -2
- package/dist/pagination/index.d.mts +12 -0
- package/dist/pagination/index.d.ts +12 -0
- package/dist/pagination/index.js +160 -0
- package/dist/pagination/index.mjs +118 -0
- package/dist/passwordInput/index.d.mts +13 -0
- package/dist/passwordInput/index.d.ts +13 -0
- package/dist/passwordInput/index.js +566 -0
- package/dist/passwordInput/index.mjs +523 -0
- package/dist/popover/index.d.mts +1 -1
- package/dist/popover/index.d.ts +1 -1
- package/dist/progressCircle/index.d.mts +16 -0
- package/dist/progressCircle/index.d.ts +16 -0
- package/dist/progressCircle/index.js +159 -0
- package/dist/progressCircle/index.mjs +117 -0
- package/dist/radio/index.d.mts +1 -4
- package/dist/radio/index.d.ts +1 -4
- package/dist/scrollIndicator/index.d.mts +9 -0
- package/dist/scrollIndicator/index.d.ts +9 -0
- package/dist/scrollIndicator/index.js +80 -0
- package/dist/scrollIndicator/index.mjs +43 -0
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/separator/index.d.mts +10 -0
- package/dist/separator/index.d.ts +10 -0
- package/dist/separator/index.js +66 -0
- package/dist/separator/index.mjs +24 -0
- package/dist/simpleTable/index.d.mts +30 -0
- package/dist/simpleTable/index.d.ts +30 -0
- package/dist/simpleTable/index.js +253 -0
- package/dist/simpleTable/index.mjs +217 -0
- package/dist/skeleton/index.d.mts +3 -3
- package/dist/skeleton/index.d.ts +3 -3
- package/dist/skeleton/index.mjs +3 -29
- package/dist/slider/index.d.mts +6 -0
- package/dist/slider/index.d.ts +6 -0
- package/dist/slider/index.js +66 -0
- package/dist/slider/index.mjs +24 -0
- package/dist/splitButton/index.d.mts +29 -2
- package/dist/splitButton/index.d.ts +29 -2
- package/dist/splitButton/index.mjs +355 -30
- package/dist/stopPropagationWrapper/index.d.mts +2 -2
- package/dist/stopPropagationWrapper/index.d.ts +2 -2
- package/dist/switch/index.d.mts +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/tabs/index.d.mts +21 -1
- package/dist/tabs/index.d.ts +21 -1
- package/dist/tabs/index.mjs +94 -14
- package/dist/toast/index.d.mts +23 -0
- package/dist/toast/index.d.ts +23 -0
- package/dist/toast/index.js +185 -0
- package/dist/toast/index.mjs +19 -0
- package/dist/toaster/index.d.mts +9 -0
- package/dist/toaster/index.d.ts +9 -0
- package/dist/toaster/index.js +302 -0
- package/dist/toaster/index.mjs +145 -0
- package/dist/tooltip/index.d.mts +3 -4
- package/dist/tooltip/index.d.ts +3 -4
- package/dist/types/index.d.mts +115 -0
- package/dist/types/index.d.ts +115 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +1 -1
- package/dist/chunk-72HYR6WB.mjs +0 -88
- package/dist/chunk-C4CBXIG5.mjs +0 -363
- package/dist/commonTypes-eIwARo5g.d.mts +0 -4
- package/dist/commonTypes-eIwARo5g.d.ts +0 -4
- package/dist/index-DUZFcPRO.d.mts +0 -38
- package/dist/index-DUZFcPRO.d.ts +0 -38
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../chunk-TE3BKEXL.mjs";
|
|
4
|
+
|
|
5
|
+
// components/elements/passwordInput/PasswordInput.tsx
|
|
6
|
+
import React9, { useEffect, useState } from "react";
|
|
7
|
+
|
|
8
|
+
// components/icons/Emojis.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
|
|
11
|
+
// components/icons/InputIcons.tsx
|
|
12
|
+
import React2 from "react";
|
|
13
|
+
var EyeIcon = (props) => /* @__PURE__ */ React2.createElement("div", { className: cn("hawa-h-5 hawa-w-5", props.className) }, /* @__PURE__ */ React2.createElement(
|
|
14
|
+
"svg",
|
|
15
|
+
{
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
fill: "none",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: "2",
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
},
|
|
24
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
25
|
+
/* @__PURE__ */ React2.createElement("circle", { cx: "12", cy: "12", r: "3" })
|
|
26
|
+
));
|
|
27
|
+
var HiddenEyeIcon = (props) => /* @__PURE__ */ React2.createElement("div", { className: cn("hawa-h-5 hawa-w-5", props.className) }, /* @__PURE__ */ React2.createElement(
|
|
28
|
+
"svg",
|
|
29
|
+
{
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "2",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round"
|
|
37
|
+
},
|
|
38
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
39
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
40
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
41
|
+
/* @__PURE__ */ React2.createElement("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
|
|
42
|
+
));
|
|
43
|
+
|
|
44
|
+
// components/icons/CommonIcons.tsx
|
|
45
|
+
import React3 from "react";
|
|
46
|
+
var CheckMark = ({ size = "default", className }) => {
|
|
47
|
+
let sizeStyles = {
|
|
48
|
+
default: "hawa-h-5 hawa-w-5",
|
|
49
|
+
sm: "hawa-h-3 hawa-w-3"
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ React3.createElement(
|
|
52
|
+
"svg",
|
|
53
|
+
{
|
|
54
|
+
className: cn(sizeStyles[size], className),
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
fill: "currentColor",
|
|
57
|
+
viewBox: "0 0 20 20"
|
|
58
|
+
},
|
|
59
|
+
/* @__PURE__ */ React3.createElement(
|
|
60
|
+
"path",
|
|
61
|
+
{
|
|
62
|
+
fillRule: "evenodd",
|
|
63
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
64
|
+
clipRule: "evenodd"
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
var UncheckMark = ({ size = "default", className }) => {
|
|
70
|
+
let sizeStyles = {
|
|
71
|
+
default: "hawa-h-5 hawa-w-5",
|
|
72
|
+
sm: "hawa-h-3 hawa-w-3"
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ React3.createElement(
|
|
75
|
+
"svg",
|
|
76
|
+
{
|
|
77
|
+
className: cn(sizeStyles[size], className),
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
fill: "currentColor",
|
|
80
|
+
viewBox: "0 0 20 20"
|
|
81
|
+
},
|
|
82
|
+
/* @__PURE__ */ React3.createElement(
|
|
83
|
+
"path",
|
|
84
|
+
{
|
|
85
|
+
fillRule: "evenodd",
|
|
86
|
+
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",
|
|
87
|
+
clipRule: "evenodd"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// components/elements/input/Input.tsx
|
|
94
|
+
import React7, { forwardRef as forwardRef2 } from "react";
|
|
95
|
+
|
|
96
|
+
// components/elements/label/Label.tsx
|
|
97
|
+
import * as React5 from "react";
|
|
98
|
+
|
|
99
|
+
// components/elements/tooltip/Tooltip.tsx
|
|
100
|
+
import React4 from "react";
|
|
101
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
102
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React4.createElement(
|
|
103
|
+
TooltipPrimitive.Content,
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
sideOffset,
|
|
107
|
+
className: cn(
|
|
108
|
+
"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",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
));
|
|
114
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
115
|
+
var TooltipArrow = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(TooltipPrimitive.Arrow, { ref, className: cn(className), ...props }));
|
|
116
|
+
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName;
|
|
117
|
+
var Tooltip = ({
|
|
118
|
+
side,
|
|
119
|
+
open,
|
|
120
|
+
content,
|
|
121
|
+
children,
|
|
122
|
+
defaultOpen,
|
|
123
|
+
onOpenChange,
|
|
124
|
+
triggerProps,
|
|
125
|
+
contentProps,
|
|
126
|
+
providerProps,
|
|
127
|
+
delayDuration = 300,
|
|
128
|
+
...props
|
|
129
|
+
}) => {
|
|
130
|
+
return /* @__PURE__ */ React4.createElement(
|
|
131
|
+
TooltipPrimitive.TooltipProvider,
|
|
132
|
+
{
|
|
133
|
+
delayDuration,
|
|
134
|
+
...providerProps
|
|
135
|
+
},
|
|
136
|
+
/* @__PURE__ */ React4.createElement(
|
|
137
|
+
TooltipPrimitive.Root,
|
|
138
|
+
{
|
|
139
|
+
open,
|
|
140
|
+
defaultOpen,
|
|
141
|
+
onOpenChange,
|
|
142
|
+
...props
|
|
143
|
+
},
|
|
144
|
+
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { ...triggerProps }, children),
|
|
145
|
+
/* @__PURE__ */ React4.createElement(TooltipContent, { side, align: "center", ...contentProps }, content)
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// components/elements/label/Label.tsx
|
|
151
|
+
var Label = React5.forwardRef(({ className, hint, hintSide, required, children, ...props }, ref) => /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-1 hawa-transition-all" }, /* @__PURE__ */ React5.createElement(
|
|
152
|
+
"label",
|
|
153
|
+
{
|
|
154
|
+
ref,
|
|
155
|
+
className: cn(
|
|
156
|
+
"hawa-text-sm hawa-font-medium hawa-leading-none peer-disabled:hawa-cursor-not-allowed peer-disabled:hawa-opacity-70",
|
|
157
|
+
className
|
|
158
|
+
),
|
|
159
|
+
...props
|
|
160
|
+
},
|
|
161
|
+
children,
|
|
162
|
+
required && /* @__PURE__ */ React5.createElement("span", { className: "hawa-mx-0.5 hawa-text-red-500" }, "*")
|
|
163
|
+
), hint && /* @__PURE__ */ React5.createElement(Tooltip, { content: hint, side: hintSide }, /* @__PURE__ */ React5.createElement(
|
|
164
|
+
"svg",
|
|
165
|
+
{
|
|
166
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
167
|
+
className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
|
|
168
|
+
viewBox: "0 0 24 24",
|
|
169
|
+
fill: "none",
|
|
170
|
+
stroke: "currentColor",
|
|
171
|
+
strokeWidth: "2",
|
|
172
|
+
strokeLinecap: "round",
|
|
173
|
+
strokeLinejoin: "round"
|
|
174
|
+
},
|
|
175
|
+
/* @__PURE__ */ React5.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
176
|
+
/* @__PURE__ */ React5.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
|
|
177
|
+
/* @__PURE__ */ React5.createElement("path", { d: "M12 17h.01" })
|
|
178
|
+
))));
|
|
179
|
+
Label.displayName = "Label";
|
|
180
|
+
|
|
181
|
+
// components/elements/skeleton/Skeleton.tsx
|
|
182
|
+
import React6 from "react";
|
|
183
|
+
function Skeleton({
|
|
184
|
+
className,
|
|
185
|
+
content,
|
|
186
|
+
animation = "pulse",
|
|
187
|
+
...props
|
|
188
|
+
}) {
|
|
189
|
+
const animationStyles = {
|
|
190
|
+
none: "hawa-rounded hawa-bg-muted",
|
|
191
|
+
pulse: "hawa-animate-pulse hawa-rounded hawa-bg-muted",
|
|
192
|
+
shimmer: "hawa-space-y-5 hawa-rounded hawa-bg-muted hawa-p-4 hawa-relative before:hawa-absolute before:hawa-inset-0 before:hawa--translate-x-full before:hawa-animate-[shimmer_2s_infinite] before:hawa-bg-gradient-to-r before:hawa-from-transparent before:hawa-via-gray-300/40 dark:before:hawa-via-white/10 before:hawa-to-transparent hawa-isolate hawa-overflow-hidden before:hawa-border-t before:hawa-border-rose-100/10"
|
|
193
|
+
};
|
|
194
|
+
return /* @__PURE__ */ React6.createElement(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
className: cn(
|
|
198
|
+
animationStyles[animation],
|
|
199
|
+
content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
|
|
200
|
+
className
|
|
201
|
+
),
|
|
202
|
+
...props
|
|
203
|
+
},
|
|
204
|
+
content && content
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// components/elements/input/Input.tsx
|
|
209
|
+
var Input = forwardRef2(
|
|
210
|
+
({
|
|
211
|
+
margin = "none",
|
|
212
|
+
width = "full",
|
|
213
|
+
preview = false,
|
|
214
|
+
forceHideHelperText = false,
|
|
215
|
+
labelProps,
|
|
216
|
+
placeholder,
|
|
217
|
+
showCount,
|
|
218
|
+
inputProps,
|
|
219
|
+
countPosition = "bottom",
|
|
220
|
+
...props
|
|
221
|
+
}, ref) => {
|
|
222
|
+
var _a;
|
|
223
|
+
let marginStyles = {
|
|
224
|
+
none: "hawa-mb-0",
|
|
225
|
+
normal: "hawa-mb-3",
|
|
226
|
+
large: "hawa-mb-5"
|
|
227
|
+
};
|
|
228
|
+
let widthStyles = {
|
|
229
|
+
small: "hawa-w-full hawa-max-w-2xs",
|
|
230
|
+
normal: "hawa-w-1/2",
|
|
231
|
+
full: "hawa-w-full",
|
|
232
|
+
auto: ""
|
|
233
|
+
};
|
|
234
|
+
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
|
235
|
+
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
|
236
|
+
return /* @__PURE__ */ React7.createElement(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
className: cn(
|
|
240
|
+
defaultStyle,
|
|
241
|
+
marginStyles[margin],
|
|
242
|
+
widthStyles[width],
|
|
243
|
+
props.containerClassName,
|
|
244
|
+
"hawa-w-full hawa-gap-2"
|
|
245
|
+
)
|
|
246
|
+
},
|
|
247
|
+
props.label && /* @__PURE__ */ React7.createElement(Label, { ...labelProps }, props.label),
|
|
248
|
+
props.isLoading ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React7.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React7.createElement(React7.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React7.createElement(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
className: cn(
|
|
252
|
+
"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
|
|
253
|
+
preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
), /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ React7.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React7.createElement(
|
|
257
|
+
"div",
|
|
258
|
+
{
|
|
259
|
+
className: cn(
|
|
260
|
+
"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2",
|
|
261
|
+
(_a = props.endIconProps) == null ? void 0 : _a.className
|
|
262
|
+
)
|
|
263
|
+
},
|
|
264
|
+
props.endIcon
|
|
265
|
+
), /* @__PURE__ */ React7.createElement(
|
|
266
|
+
"input",
|
|
267
|
+
{
|
|
268
|
+
required: true,
|
|
269
|
+
dir: props.dir,
|
|
270
|
+
type: props.type,
|
|
271
|
+
value: props.value,
|
|
272
|
+
onChange: props.onChange,
|
|
273
|
+
autoComplete: props.autoComplete,
|
|
274
|
+
defaultValue: props.defaultValue,
|
|
275
|
+
placeholder,
|
|
276
|
+
disabled: props.disabled || preview,
|
|
277
|
+
style: { height: 40 },
|
|
278
|
+
...inputProps,
|
|
279
|
+
className: cn(
|
|
280
|
+
defaultInputStyle,
|
|
281
|
+
" focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
|
|
282
|
+
{
|
|
283
|
+
"hawa-pe-9": props.endIcon,
|
|
284
|
+
"hawa-ps-9": props.startIcon,
|
|
285
|
+
"hawa-pe-[60px]": countPosition === "center"
|
|
286
|
+
},
|
|
287
|
+
preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
|
|
288
|
+
inputProps == null ? void 0 : inputProps.className
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
)), !forceHideHelperText && /* @__PURE__ */ React7.createElement(
|
|
292
|
+
"p",
|
|
293
|
+
{
|
|
294
|
+
className: cn(
|
|
295
|
+
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
|
296
|
+
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
|
297
|
+
)
|
|
298
|
+
},
|
|
299
|
+
props.helperText
|
|
300
|
+
), !props.disabled && forceHideHelperText && /* @__PURE__ */ React7.createElement(
|
|
301
|
+
"div",
|
|
302
|
+
{
|
|
303
|
+
className: cn(
|
|
304
|
+
"hawa-absolute hawa-end-0 hawa-top-[47px] hawa-z-20 hawa-translate-y-1/2 hawa-rounded hawa-bg-background hawa-text-start hawa-text-xs hawa-text-helper-color hawa-drop-shadow-md hawa-transition-all",
|
|
305
|
+
props.helperText ? "hawa-border hawa-p-1" : "hawa-border-none hawa-p-0"
|
|
306
|
+
)
|
|
307
|
+
},
|
|
308
|
+
props.helperText
|
|
309
|
+
), showCount && /* @__PURE__ */ React7.createElement(
|
|
310
|
+
"div",
|
|
311
|
+
{
|
|
312
|
+
className: cn(
|
|
313
|
+
"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all",
|
|
314
|
+
{
|
|
315
|
+
"hawa-end-0 hawa-top-[62px]": countPosition === "bottom",
|
|
316
|
+
"hawa-bottom-[62px] hawa-end-0": countPosition === "top",
|
|
317
|
+
"hawa-end-2": countPosition === "center"
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
},
|
|
321
|
+
props.value ? String(props.value).length : 0,
|
|
322
|
+
"/",
|
|
323
|
+
props.maxLength
|
|
324
|
+
)))
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
// components/elements/popover/Popover.tsx
|
|
330
|
+
import * as React8 from "react";
|
|
331
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
332
|
+
var PopoverContent = React8.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ React8.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React8.createElement(
|
|
333
|
+
PopoverPrimitive.Content,
|
|
334
|
+
{
|
|
335
|
+
ref,
|
|
336
|
+
align,
|
|
337
|
+
sideOffset,
|
|
338
|
+
className: cn(
|
|
339
|
+
"dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none 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",
|
|
340
|
+
className
|
|
341
|
+
),
|
|
342
|
+
...props
|
|
343
|
+
}
|
|
344
|
+
)));
|
|
345
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
346
|
+
var Popover = ({
|
|
347
|
+
trigger,
|
|
348
|
+
children,
|
|
349
|
+
className,
|
|
350
|
+
align = "center",
|
|
351
|
+
side,
|
|
352
|
+
sideOffset = 4,
|
|
353
|
+
open,
|
|
354
|
+
width = "default",
|
|
355
|
+
disableTrigger,
|
|
356
|
+
contentProps,
|
|
357
|
+
triggerProps,
|
|
358
|
+
...props
|
|
359
|
+
}) => {
|
|
360
|
+
let widthStyles = {
|
|
361
|
+
trigger: "var(--radix-popover-trigger-width)",
|
|
362
|
+
default: "auto"
|
|
363
|
+
};
|
|
364
|
+
return /* @__PURE__ */ React8.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React8.createElement(
|
|
365
|
+
PopoverPrimitive.Trigger,
|
|
366
|
+
{
|
|
367
|
+
className: "hawa-w-full",
|
|
368
|
+
disabled: disableTrigger,
|
|
369
|
+
...triggerProps
|
|
370
|
+
},
|
|
371
|
+
trigger
|
|
372
|
+
), /* @__PURE__ */ React8.createElement(
|
|
373
|
+
PopoverContent,
|
|
374
|
+
{
|
|
375
|
+
side,
|
|
376
|
+
className,
|
|
377
|
+
align,
|
|
378
|
+
sideOffset,
|
|
379
|
+
style: {
|
|
380
|
+
width: widthStyles[width]
|
|
381
|
+
},
|
|
382
|
+
...contentProps
|
|
383
|
+
},
|
|
384
|
+
children
|
|
385
|
+
));
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
// components/elements/passwordInput/PasswordInput.tsx
|
|
389
|
+
var PasswordStrengthIndicator = ({ strength }) => {
|
|
390
|
+
const strengthLevels = [
|
|
391
|
+
"none",
|
|
392
|
+
"very-weak",
|
|
393
|
+
"weak",
|
|
394
|
+
"medium",
|
|
395
|
+
"strong",
|
|
396
|
+
"very-strong"
|
|
397
|
+
];
|
|
398
|
+
const strengthColors = {
|
|
399
|
+
none: "hawa-bg-red-700",
|
|
400
|
+
"very-weak": "hawa-bg-red-600",
|
|
401
|
+
weak: "hawa-bg-red-500",
|
|
402
|
+
medium: "hawa-bg-yellow-500",
|
|
403
|
+
strong: "hawa-bg-green-400",
|
|
404
|
+
"very-strong": "hawa-bg-green-600"
|
|
405
|
+
};
|
|
406
|
+
const currentStrengthLevel = strengthLevels[strength];
|
|
407
|
+
const width = {
|
|
408
|
+
none: "0%",
|
|
409
|
+
"very-weak": "20%",
|
|
410
|
+
weak: "40%",
|
|
411
|
+
medium: "60%",
|
|
412
|
+
strong: "80%",
|
|
413
|
+
"very-strong": "100%"
|
|
414
|
+
}[currentStrengthLevel];
|
|
415
|
+
return /* @__PURE__ */ React9.createElement("div", { className: "hawa-mt-0.5 hawa-h-2 hawa-w-full hawa-rounded hawa-bg-gray-200" }, /* @__PURE__ */ React9.createElement(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
className: `${strengthColors[currentStrengthLevel]} hawa-h-full hawa-rounded hawa-transition-all hawa-duration-300`,
|
|
419
|
+
style: { width }
|
|
420
|
+
}
|
|
421
|
+
));
|
|
422
|
+
};
|
|
423
|
+
var PasswordInput = ({
|
|
424
|
+
hidePopover,
|
|
425
|
+
...props
|
|
426
|
+
}) => {
|
|
427
|
+
const [inputValue, setInputValue] = useState("");
|
|
428
|
+
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
429
|
+
const [currentStr, setCurrentStr] = useState(0);
|
|
430
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
431
|
+
const [lengthCriteriaMet, setLengthCriteriaMet] = useState(false);
|
|
432
|
+
const [numberCriteriaMet, setNumberCriteriaMet] = useState(false);
|
|
433
|
+
const [specialCharCriteriaMet, setSpecialCharCriteriaMet] = useState(false);
|
|
434
|
+
const [lowercaseCriteriaMet, setLowercaseCriteriaMet] = useState(false);
|
|
435
|
+
const [uppercaseCriteriaMet, setUppercaseCriteriaMet] = useState(false);
|
|
436
|
+
useEffect(() => {
|
|
437
|
+
const calculateStrength = () => {
|
|
438
|
+
let strengthScore = 0;
|
|
439
|
+
if (lengthCriteriaMet)
|
|
440
|
+
strengthScore += 1;
|
|
441
|
+
if (numberCriteriaMet)
|
|
442
|
+
strengthScore += 1;
|
|
443
|
+
if (specialCharCriteriaMet)
|
|
444
|
+
strengthScore += 1;
|
|
445
|
+
if (lowercaseCriteriaMet)
|
|
446
|
+
strengthScore += 1;
|
|
447
|
+
if (uppercaseCriteriaMet)
|
|
448
|
+
strengthScore += 1;
|
|
449
|
+
return strengthScore;
|
|
450
|
+
};
|
|
451
|
+
const currentStrengthScore = calculateStrength();
|
|
452
|
+
setCurrentStr(currentStrengthScore);
|
|
453
|
+
}, [inputValue]);
|
|
454
|
+
const handleInputChange = (event) => {
|
|
455
|
+
const newPassword = event.target.value;
|
|
456
|
+
if (props.onChange) {
|
|
457
|
+
props.onChange(event);
|
|
458
|
+
}
|
|
459
|
+
setInputValue(newPassword);
|
|
460
|
+
setLengthCriteriaMet(newPassword.length >= 8);
|
|
461
|
+
setNumberCriteriaMet(/\d/.test(newPassword));
|
|
462
|
+
setSpecialCharCriteriaMet(/[!@#$%^&*(),.?":{}|<>]/.test(newPassword));
|
|
463
|
+
setLowercaseCriteriaMet(/[a-z]/.test(newPassword));
|
|
464
|
+
setUppercaseCriteriaMet(/[A-Z]/.test(newPassword));
|
|
465
|
+
};
|
|
466
|
+
const handleInputFocus = () => {
|
|
467
|
+
if (!hidePopover) {
|
|
468
|
+
setIsInputFocused(true);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
const handleInputBlur = () => {
|
|
472
|
+
setIsInputFocused(false);
|
|
473
|
+
};
|
|
474
|
+
const getCriteriaClass = (isMet) => isMet ? "hawa-flex hawa-flex-row hawa-gap-2 hawa-text-sm hawa-items-center hawa-text-green-500" : "hawa-flex hawa-flex-row hawa-gap-2 hawa-text-sm hawa-items-center hawa-text-red-600";
|
|
475
|
+
return /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement(
|
|
476
|
+
Popover,
|
|
477
|
+
{
|
|
478
|
+
width: "trigger",
|
|
479
|
+
sideOffset: 20,
|
|
480
|
+
open: isInputFocused,
|
|
481
|
+
onOpenChange: setIsInputFocused,
|
|
482
|
+
triggerProps: { asChild: true },
|
|
483
|
+
contentProps: { onOpenAutoFocus: (e) => e.preventDefault() },
|
|
484
|
+
trigger: /* @__PURE__ */ React9.createElement(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
onClick: (e) => {
|
|
488
|
+
e.preventDefault();
|
|
489
|
+
if (!hidePopover) {
|
|
490
|
+
setIsInputFocused(true);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
/* @__PURE__ */ React9.createElement(
|
|
495
|
+
Input,
|
|
496
|
+
{
|
|
497
|
+
width: "full",
|
|
498
|
+
className: "hawa-w-full",
|
|
499
|
+
label: "test",
|
|
500
|
+
onChange: handleInputChange,
|
|
501
|
+
onFocus: handleInputFocus,
|
|
502
|
+
onBlur: handleInputBlur,
|
|
503
|
+
type: passwordVisible ? "text" : "password",
|
|
504
|
+
endIcon: /* @__PURE__ */ React9.createElement(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: "hawa-cursor-pointer",
|
|
508
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
|
509
|
+
},
|
|
510
|
+
passwordVisible ? /* @__PURE__ */ React9.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React9.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
|
511
|
+
" "
|
|
512
|
+
)
|
|
513
|
+
}
|
|
514
|
+
)
|
|
515
|
+
)
|
|
516
|
+
},
|
|
517
|
+
/* @__PURE__ */ React9.createElement("div", { className: "hawa-rounded hawa-p-2" }, /* @__PURE__ */ React9.createElement("ul", { className: "hawa-rounded hawa-p-2" }, /* @__PURE__ */ React9.createElement("li", { className: getCriteriaClass(lengthCriteriaMet) }, lengthCriteriaMet ? /* @__PURE__ */ React9.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { size: "sm" }), "At least 8 characters long"), /* @__PURE__ */ React9.createElement("li", { className: getCriteriaClass(numberCriteriaMet) }, numberCriteriaMet ? /* @__PURE__ */ React9.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { size: "sm" }), "At least 1 number"), /* @__PURE__ */ React9.createElement("li", { className: getCriteriaClass(specialCharCriteriaMet) }, specialCharCriteriaMet ? /* @__PURE__ */ React9.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { size: "sm" }), "At least 1 special character"), /* @__PURE__ */ React9.createElement("li", { className: getCriteriaClass(lowercaseCriteriaMet) }, lowercaseCriteriaMet ? /* @__PURE__ */ React9.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { size: "sm" }), "At least 1 lowercase letter"), /* @__PURE__ */ React9.createElement("li", { className: getCriteriaClass(uppercaseCriteriaMet) }, uppercaseCriteriaMet ? /* @__PURE__ */ React9.createElement(CheckMark, { size: "sm" }) : /* @__PURE__ */ React9.createElement(UncheckMark, { size: "sm" }), "At least 1 uppercase letter")))
|
|
518
|
+
), /* @__PURE__ */ React9.createElement(PasswordStrengthIndicator, { strength: currentStr }));
|
|
519
|
+
};
|
|
520
|
+
export {
|
|
521
|
+
PasswordInput,
|
|
522
|
+
PasswordStrengthIndicator
|
|
523
|
+
};
|
package/dist/popover/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
-
import { P as PositionType } from '../commonTypes-
|
|
3
|
+
import { P as PositionType } from '../commonTypes-2IGtJ5cq.mjs';
|
|
4
4
|
|
|
5
5
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
interface PopoverProps {
|
package/dist/popover/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
-
import { P as PositionType } from '../commonTypes-
|
|
3
|
+
import { P as PositionType } from '../commonTypes-2IGtJ5cq.js';
|
|
4
4
|
|
|
5
5
|
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
interface PopoverProps {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
interface ProgressCircleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
value?: number;
|
|
6
|
+
size?: Size;
|
|
7
|
+
color?: any;
|
|
8
|
+
showAnimation?: boolean;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
radius?: number;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const ProgressCircle: React.ForwardRefExoticComponent<ProgressCircleProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
|
|
16
|
+
export { ProgressCircle };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
interface ProgressCircleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
value?: number;
|
|
6
|
+
size?: Size;
|
|
7
|
+
color?: any;
|
|
8
|
+
showAnimation?: boolean;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
radius?: number;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const ProgressCircle: React.ForwardRefExoticComponent<ProgressCircleProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
|
|
16
|
+
export { ProgressCircle };
|