@sikka/hawa 0.24.3-next → 0.24.5-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/accordion/index.d.mts +1 -2
- package/dist/accordion/index.d.ts +1 -2
- package/dist/accordion/index.mjs +219 -7
- package/dist/alert/index.d.mts +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/appLayout/index.d.mts +126 -0
- package/dist/appLayout/index.d.ts +126 -0
- package/dist/appLayout/index.js +1325 -0
- package/dist/appLayout/index.mjs +1285 -0
- package/dist/appMenubar/index.d.mts +33 -0
- package/dist/appMenubar/index.d.ts +33 -0
- package/dist/appMenubar/index.js +281 -0
- package/dist/appMenubar/index.mjs +224 -0
- package/dist/appTabs/index.d.mts +18 -0
- package/dist/appTabs/index.d.ts +18 -0
- package/dist/appTabs/index.js +92 -0
- package/dist/appTabs/index.mjs +50 -0
- package/dist/appTopbar/index.d.mts +44 -0
- package/dist/appTopbar/index.d.ts +44 -0
- package/dist/appTopbar/index.js +483 -0
- package/dist/appTopbar/index.mjs +441 -0
- package/dist/avatar/index.d.mts +5 -4
- package/dist/avatar/index.d.ts +5 -4
- package/dist/backToTop/index.mjs +353 -3
- package/dist/badge/index.d.mts +2 -2
- package/dist/badge/index.d.ts +2 -2
- package/dist/checkbox/index.d.mts +1 -2
- package/dist/checkbox/index.d.ts +1 -2
- package/dist/chip/index.d.mts +36 -2
- package/dist/chip/index.d.ts +36 -2
- package/dist/chip/index.mjs +83 -3
- package/dist/chunk-62GI5F2P.mjs +442 -0
- package/dist/chunk-7NCNPRCL.mjs +120 -0
- package/dist/{chunk-TNAHW35O.mjs → chunk-C2UYTGUD.mjs} +8 -4
- package/dist/{chunk-26FHSPJI.mjs → chunk-DGWAHQRX.mjs} +1 -101
- package/dist/chunk-LRLLDOQZ.mjs +178 -0
- package/dist/chunk-ND4BWUKH.mjs +34 -0
- package/dist/codeBlock/index.mjs +684 -310
- package/dist/colorPicker/index.d.mts +2 -1
- package/dist/colorPicker/index.d.ts +2 -1
- package/dist/colorPicker/index.mjs +2 -167
- package/dist/combobox/index.d.mts +9 -1
- package/dist/combobox/index.d.ts +9 -1
- package/dist/combobox/index.mjs +61 -393
- package/dist/command/index.mjs +10 -425
- package/dist/commonTypes-3J1E3b61.d.mts +6 -0
- package/dist/commonTypes-3J1E3b61.d.ts +6 -0
- package/dist/commonTypes-GhKAraJw.d.mts +4 -0
- package/dist/commonTypes-GhKAraJw.d.ts +4 -0
- package/dist/commonTypes-LrR8QrYP.d.mts +5 -0
- package/dist/commonTypes-LrR8QrYP.d.ts +5 -0
- package/dist/commonTypes-WPhcN3Vr.d.mts +5 -0
- package/dist/commonTypes-WPhcN3Vr.d.ts +5 -0
- package/dist/commonTypes-ko_NGEoT.d.mts +3 -0
- package/dist/commonTypes-ko_NGEoT.d.ts +3 -0
- package/dist/copyrights/index.d.mts +17 -0
- package/dist/copyrights/index.d.ts +17 -0
- package/dist/copyrights/index.js +45 -0
- package/dist/copyrights/index.mjs +8 -0
- package/dist/count/index.d.mts +11 -0
- package/dist/count/index.d.ts +11 -0
- package/dist/count/index.js +45 -0
- package/dist/count/index.mjs +8 -0
- package/dist/dataTable/index.d.mts +1 -1
- package/dist/dataTable/index.d.ts +1 -1
- package/dist/destroyableCard/index.d.mts +1 -1
- package/dist/destroyableCard/index.d.ts +1 -1
- package/dist/dialog/index.d.mts +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/docsLayout/index.d.mts +37 -0
- package/dist/docsLayout/index.d.ts +37 -0
- package/dist/docsLayout/index.js +926 -0
- package/dist/docsLayout/index.mjs +886 -0
- package/dist/docsSidebar/index.d.mts +11 -0
- package/dist/docsSidebar/index.d.ts +11 -0
- package/dist/docsSidebar/index.js +111 -0
- package/dist/docsSidebar/index.mjs +69 -0
- package/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +44 -35
- package/dist/index.mjs +44 -35
- package/dist/input/index.d.mts +2 -9
- package/dist/input/index.d.ts +2 -9
- package/dist/input/index.mjs +14 -98
- package/dist/interfaceSettings/index.d.mts +1 -1
- package/dist/interfaceSettings/index.d.ts +1 -1
- package/dist/interfaceSettings/index.mjs +24 -110
- package/dist/label/index.d.mts +1 -1
- package/dist/label/index.d.ts +1 -1
- package/dist/label/index.mjs +2 -87
- package/dist/layout/index.d.mts +11 -4
- package/dist/layout/index.d.ts +11 -4
- package/dist/layout/index.js +47 -38
- package/dist/layout/index.mjs +44 -35
- package/dist/navbar/index.d.mts +17 -0
- package/dist/navbar/index.d.ts +17 -0
- package/dist/navbar/index.js +166 -0
- package/dist/navbar/index.mjs +126 -0
- package/dist/pagination/index.d.mts +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/passwordInput/index.mjs +27 -137
- package/dist/phoneInput/index.mjs +19 -129
- package/dist/radio/index.d.mts +1 -4
- package/dist/radio/index.d.ts +1 -4
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/separator/index.d.mts +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/sidebar/index.d.mts +48 -0
- package/dist/sidebar/index.d.ts +48 -0
- package/dist/sidebar/index.js +341 -0
- package/dist/sidebar/index.mjs +298 -0
- package/dist/simpleTable/index.d.mts +4 -3
- package/dist/simpleTable/index.d.ts +4 -3
- package/dist/simpleTable/index.mjs +21 -45
- 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/sortButton/index.mjs +9 -260
- package/dist/splitButton/index.d.mts +4 -3
- package/dist/splitButton/index.d.ts +4 -3
- package/dist/splitButton/index.mjs +10 -259
- package/dist/stats/index.d.mts +19 -0
- package/dist/stats/index.d.ts +19 -0
- package/dist/stats/index.js +191 -0
- package/dist/stats/index.mjs +154 -0
- package/dist/stopPropagationWrapper/index.d.mts +2 -2
- package/dist/stopPropagationWrapper/index.d.ts +2 -2
- package/dist/switch/index.d.mts +2 -1
- package/dist/switch/index.d.ts +2 -1
- package/dist/tabs/index.d.mts +19 -1
- package/dist/tabs/index.d.ts +19 -1
- package/dist/tabs/index.mjs +94 -14
- package/dist/textarea/index.d.mts +8 -1
- package/dist/textarea/index.d.ts +8 -1
- package/dist/textarea/index.mjs +92 -8
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Label-fkQ4ebuH.d.mts +0 -12
- package/dist/Label-fkQ4ebuH.d.ts +0 -12
- package/dist/chunk-72HYR6WB.mjs +0 -88
- package/dist/chunk-JYSC6GKM.mjs +0 -229
- package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
- package/dist/commonTypes-N7XOVCit.d.mts +0 -5
- package/dist/commonTypes-N7XOVCit.d.ts +0 -5
- package/dist/index-DUZFcPRO.d.mts +0 -38
- package/dist/index-DUZFcPRO.d.ts +0 -38
package/dist/backToTop/index.mjs
CHANGED
@@ -1,7 +1,357 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "../chunk-
|
4
|
-
|
2
|
+
cn
|
3
|
+
} from "../chunk-TE3BKEXL.mjs";
|
4
|
+
|
5
|
+
// components/elements/backToTop/BackToTop.tsx
|
6
|
+
import React3, { useState, useEffect, useRef } from "react";
|
7
|
+
|
8
|
+
// components/elements/button/Button.tsx
|
9
|
+
import * as React2 from "react";
|
10
|
+
import { cva } from "class-variance-authority";
|
11
|
+
|
12
|
+
// components/elements/loading/Loading.tsx
|
13
|
+
import React from "react";
|
14
|
+
var Loading = ({
|
15
|
+
design = "spinner",
|
16
|
+
size = "sm",
|
17
|
+
themeMode = "light",
|
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(
|
36
|
+
"div",
|
37
|
+
{
|
38
|
+
className: cn("hawa-flex hawa-flex-row hawa-gap-2", props.className)
|
39
|
+
},
|
40
|
+
/* @__PURE__ */ React.createElement(
|
41
|
+
"div",
|
42
|
+
{
|
43
|
+
className: cn(
|
44
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-100 hawa-repeat-infinite",
|
45
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
46
|
+
animationStyles[design.split("-")[1]],
|
47
|
+
color ? color : "hawa-bg-primary"
|
48
|
+
)
|
49
|
+
}
|
50
|
+
),
|
51
|
+
/* @__PURE__ */ React.createElement(
|
52
|
+
"div",
|
53
|
+
{
|
54
|
+
className: cn(
|
55
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-200 hawa-repeat-infinite",
|
56
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
57
|
+
animationStyles[design.split("-")[1]],
|
58
|
+
color ? color : "hawa-bg-primary"
|
59
|
+
)
|
60
|
+
}
|
61
|
+
),
|
62
|
+
/* @__PURE__ */ React.createElement(
|
63
|
+
"div",
|
64
|
+
{
|
65
|
+
className: cn(
|
66
|
+
"hawa-animate-bounce hawa-rounded-full hawa-delay-300 hawa-repeat-infinite",
|
67
|
+
size === "button" ? "hawa-h-2 hawa-w-2" : sizeStyles[size],
|
68
|
+
animationStyles[design.split("-")[1]],
|
69
|
+
color ? color : "hawa-bg-primary"
|
70
|
+
)
|
71
|
+
}
|
72
|
+
)
|
73
|
+
);
|
74
|
+
case "square":
|
75
|
+
return /* @__PURE__ */ React.createElement(
|
76
|
+
"svg",
|
77
|
+
{
|
78
|
+
className: cn("squircle-container", sizeStyles[size]),
|
79
|
+
viewBox: "0 0 35 35",
|
80
|
+
height: "35",
|
81
|
+
width: "35"
|
82
|
+
},
|
83
|
+
/* @__PURE__ */ React.createElement(
|
84
|
+
"rect",
|
85
|
+
{
|
86
|
+
className: "squircle-track",
|
87
|
+
x: "2.5",
|
88
|
+
y: "2.5",
|
89
|
+
fill: "none",
|
90
|
+
strokeWidth: "5px",
|
91
|
+
width: "32.5",
|
92
|
+
height: "32.5"
|
93
|
+
}
|
94
|
+
),
|
95
|
+
/* @__PURE__ */ React.createElement(
|
96
|
+
"rect",
|
97
|
+
{
|
98
|
+
className: "square-car",
|
99
|
+
x: "2.5",
|
100
|
+
y: "2.5",
|
101
|
+
fill: "none",
|
102
|
+
strokeWidth: "5px",
|
103
|
+
width: "32.5",
|
104
|
+
height: "32.5",
|
105
|
+
pathLength: "100"
|
106
|
+
}
|
107
|
+
)
|
108
|
+
);
|
109
|
+
case "squircle":
|
110
|
+
return /* @__PURE__ */ React.createElement(
|
111
|
+
"svg",
|
112
|
+
{
|
113
|
+
className: cn("squircle-container", sizeStyles[size]),
|
114
|
+
x: "0px",
|
115
|
+
y: "0px",
|
116
|
+
viewBox: "0 0 37 37",
|
117
|
+
height: "37",
|
118
|
+
width: "37",
|
119
|
+
preserveAspectRatio: "xMidYMid meet"
|
120
|
+
},
|
121
|
+
/* @__PURE__ */ React.createElement(
|
122
|
+
"path",
|
123
|
+
{
|
124
|
+
className: "squircle-track",
|
125
|
+
fill: "none",
|
126
|
+
strokeWidth: "5",
|
127
|
+
pathLength: "100",
|
128
|
+
d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
|
129
|
+
}
|
130
|
+
),
|
131
|
+
/* @__PURE__ */ React.createElement(
|
132
|
+
"path",
|
133
|
+
{
|
134
|
+
className: "squircle-car",
|
135
|
+
fill: "none",
|
136
|
+
strokeWidth: "5",
|
137
|
+
pathLength: "100",
|
138
|
+
d: "M0.37 18.5 C0.37 5.772 5.772 0.37 18.5 0.37 S36.63 5.772 36.63 18.5 S31.228 36.63 18.5 36.63 S0.37 31.228 0.37 18.5"
|
139
|
+
}
|
140
|
+
)
|
141
|
+
);
|
142
|
+
case "progress":
|
143
|
+
return /* @__PURE__ */ React.createElement("div", { className: "progress-loading" });
|
144
|
+
case "orbit":
|
145
|
+
return /* @__PURE__ */ React.createElement("div", { className: "orbit-container" });
|
146
|
+
default:
|
147
|
+
return /* @__PURE__ */ React.createElement(
|
148
|
+
"svg",
|
149
|
+
{
|
150
|
+
className: cn("circle-container", sizeStyles[size]),
|
151
|
+
viewBox: "0 0 40 40",
|
152
|
+
height: "40",
|
153
|
+
width: "40"
|
154
|
+
},
|
155
|
+
/* @__PURE__ */ React.createElement(
|
156
|
+
"circle",
|
157
|
+
{
|
158
|
+
className: cn("circle-track", {
|
159
|
+
"hawa-stroke-primary-foreground": themeMode === "dark",
|
160
|
+
"hawa-stroke-primary": themeMode === "light"
|
161
|
+
}),
|
162
|
+
cx: "20",
|
163
|
+
cy: "20",
|
164
|
+
r: "17.5",
|
165
|
+
pathLength: "100",
|
166
|
+
strokeWidth: "5px",
|
167
|
+
fill: "none"
|
168
|
+
}
|
169
|
+
),
|
170
|
+
/* @__PURE__ */ React.createElement(
|
171
|
+
"circle",
|
172
|
+
{
|
173
|
+
className: cn("circle-car", {
|
174
|
+
"hawa-stroke-primary-foreground": themeMode === "dark",
|
175
|
+
"hawa-stroke-primary": themeMode === "light"
|
176
|
+
}),
|
177
|
+
cx: "20",
|
178
|
+
cy: "20",
|
179
|
+
r: "17.5",
|
180
|
+
pathLength: "100",
|
181
|
+
strokeWidth: "5px",
|
182
|
+
fill: "none"
|
183
|
+
}
|
184
|
+
)
|
185
|
+
);
|
186
|
+
}
|
187
|
+
};
|
188
|
+
|
189
|
+
// components/elements/button/Button.tsx
|
190
|
+
var buttonVariants = cva(
|
191
|
+
"hawa-inline-flex hawa-items-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",
|
192
|
+
{
|
193
|
+
variants: {
|
194
|
+
variant: {
|
195
|
+
default: "hawa-bg-primary hawa-text-primary-foreground hover:hawa-bg-primary/90",
|
196
|
+
light: "hawa-bg-primary/20 hawa-text-primary hover:hawa-bg-primary/40",
|
197
|
+
destructive: "hawa-bg-destructive hawa-text-destructive-foreground hover:hawa-bg-destructive/90",
|
198
|
+
outline: "hawa-border hawa-border-input hawa-bg-transparent hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
199
|
+
secondary: "hawa-bg-secondary hawa-text-secondary-foreground hover:hawa-bg-secondary/80",
|
200
|
+
ghost: "hover:hawa-bg-accent hover:hawa-text-accent-foreground",
|
201
|
+
link: "hawa-text-primary hawa-underline-offset-4 hover:hawa-underline",
|
202
|
+
combobox: "hawa-bg-background hawa-border",
|
203
|
+
neoBrutalism: "neo-brutalism"
|
204
|
+
// "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 shadow-color-primary active:shadow-color-primary-active",
|
205
|
+
},
|
206
|
+
size: {
|
207
|
+
default: "hawa-h-10 hawa-px-4 hawa-py-2",
|
208
|
+
heightless: "hawa-px-4 hawa-py-4",
|
209
|
+
xs: "hawa-h-fit hawa-min-h-[25px] hawa-py-1 hawa-text-[10px] hawa-px-2 ",
|
210
|
+
sm: "hawa-h-9 hawa-text-[11px] hawa-rounded-md hawa-px-3",
|
211
|
+
lg: "hawa-h-11 hawa-rounded-md hawa-px-8",
|
212
|
+
xl: "hawa-h-14 hawa-rounded-md hawa-px-10",
|
213
|
+
icon: "hawa-h-10 hawa-w-10",
|
214
|
+
smallIcon: "hawa-h-7 hawa-w-7"
|
215
|
+
}
|
216
|
+
},
|
217
|
+
defaultVariants: {
|
218
|
+
variant: "default",
|
219
|
+
size: "default"
|
220
|
+
}
|
221
|
+
}
|
222
|
+
);
|
223
|
+
var Button = React2.forwardRef(
|
224
|
+
({
|
225
|
+
className,
|
226
|
+
variant,
|
227
|
+
size,
|
228
|
+
asChild = false,
|
229
|
+
centered = true,
|
230
|
+
isLoading,
|
231
|
+
children,
|
232
|
+
...props
|
233
|
+
}, ref) => {
|
234
|
+
const Comp = "button";
|
235
|
+
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
236
|
+
return /* @__PURE__ */ React2.createElement(
|
237
|
+
Comp,
|
238
|
+
{
|
239
|
+
className: cn(
|
240
|
+
buttonVariants({ variant, size, className }),
|
241
|
+
centered && "hawa-justify-center"
|
242
|
+
),
|
243
|
+
ref,
|
244
|
+
...props
|
245
|
+
},
|
246
|
+
isLoading ? /* @__PURE__ */ React2.createElement(
|
247
|
+
Loading,
|
248
|
+
{
|
249
|
+
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
250
|
+
themeMode: variant === "outline" ? "light" : "dark",
|
251
|
+
color: loadingColor,
|
252
|
+
size: size === "sm" || size === "xs" ? "xs" : "button"
|
253
|
+
}
|
254
|
+
) : children
|
255
|
+
);
|
256
|
+
}
|
257
|
+
);
|
258
|
+
Button.displayName = "Button";
|
259
|
+
|
260
|
+
// components/elements/backToTop/BackToTop.tsx
|
261
|
+
var BackToTop = ({ ...props }) => {
|
262
|
+
const [visible, setVisible] = useState(false);
|
263
|
+
const [rect, _setRect] = useState(null);
|
264
|
+
const self = useRef(null);
|
265
|
+
const _rect = useRef(rect);
|
266
|
+
const setRect = (data) => {
|
267
|
+
_rect.current = data;
|
268
|
+
_setRect(data);
|
269
|
+
};
|
270
|
+
const getCoords = () => {
|
271
|
+
let anchor = props.anchor.current;
|
272
|
+
if (anchor) {
|
273
|
+
return [anchor.scrollTop, anchor.scrollLeft];
|
274
|
+
}
|
275
|
+
return [0, 0];
|
276
|
+
};
|
277
|
+
const onScroll = () => {
|
278
|
+
var _a;
|
279
|
+
let [scrollTop, scrollLeft] = getCoords();
|
280
|
+
let rect2 = (_a = props.anchor.current) == null ? void 0 : _a.getBoundingClientRect();
|
281
|
+
if (rect2) {
|
282
|
+
setVisible(scrollTop >= rect2.height + (props.paddingThreshold || 100));
|
283
|
+
}
|
284
|
+
};
|
285
|
+
const backToTop = () => {
|
286
|
+
if (props.anchor.current) {
|
287
|
+
props.anchor.current.scrollTo({ top: 0, behavior: "smooth" });
|
288
|
+
}
|
289
|
+
};
|
290
|
+
useEffect(() => {
|
291
|
+
if (!props.anchor.current)
|
292
|
+
return;
|
293
|
+
props.anchor.current.addEventListener("scroll", onScroll);
|
294
|
+
let interval = setInterval(() => {
|
295
|
+
if (!props.anchor.current)
|
296
|
+
return;
|
297
|
+
let newRect = props.anchor.current.getBoundingClientRect();
|
298
|
+
if (_rect.current == null)
|
299
|
+
return setRect(newRect);
|
300
|
+
if (!(_rect.current.top == newRect.top && _rect.current.left == newRect.left && _rect.current.width == newRect.width && _rect.current.height == newRect.height)) {
|
301
|
+
setRect(newRect);
|
302
|
+
}
|
303
|
+
}, 1);
|
304
|
+
return () => {
|
305
|
+
var _a;
|
306
|
+
(_a = props.anchor.current) == null ? void 0 : _a.removeEventListener("scroll", onScroll);
|
307
|
+
clearInterval(interval);
|
308
|
+
};
|
309
|
+
}, [onScroll, props.anchor]);
|
310
|
+
const getStyles = () => {
|
311
|
+
var _a;
|
312
|
+
if (!props.anchor.current || !self.current)
|
313
|
+
return {};
|
314
|
+
let corner = props.corner || "bottom-right";
|
315
|
+
let [vertical, horizontal] = corner.split("-");
|
316
|
+
let anchorRect = props.anchor.current.getBoundingClientRect();
|
317
|
+
let selfRect = (_a = self.current) == null ? void 0 : _a.getBoundingClientRect();
|
318
|
+
let width = horizontal == "right" ? anchorRect.width - selfRect.width : 0;
|
319
|
+
let height = vertical == "bottom" ? anchorRect.height - selfRect.height : 0;
|
320
|
+
let style = {
|
321
|
+
top: anchorRect.y + height + (vertical == "bottom" ? -1 : 1) * (props.paddingX || 10),
|
322
|
+
left: anchorRect.x + width + (horizontal == "right" ? -1 : 1) * (props.paddingX || 25)
|
323
|
+
};
|
324
|
+
return style;
|
325
|
+
};
|
326
|
+
return /* @__PURE__ */ React3.createElement(
|
327
|
+
Button,
|
328
|
+
{
|
329
|
+
className: cn(
|
330
|
+
"hawa-fixed hawa-cursor-pointer hawa-rounded hawa-transition-all",
|
331
|
+
visible ? "hawa-pointer-events-all hawa-opacity-100" : "hawa-pointer-events-none hawa-opacity-0"
|
332
|
+
),
|
333
|
+
onClick: backToTop,
|
334
|
+
style: {
|
335
|
+
...getStyles(),
|
336
|
+
transitionProperty: "opacity, background-color"
|
337
|
+
},
|
338
|
+
ref: self,
|
339
|
+
size: "icon"
|
340
|
+
},
|
341
|
+
/* @__PURE__ */ React3.createElement(
|
342
|
+
"svg",
|
343
|
+
{
|
344
|
+
className: cn(
|
345
|
+
"hawa-h-6 hawa-w-6 hawa-shrink-0 hawa-rotate-180 hawa-transition-all disabled:hawa-bg-gray-200"
|
346
|
+
),
|
347
|
+
"aria-label": "Arrow Icon",
|
348
|
+
viewBox: "0 0 20 20",
|
349
|
+
fill: "currentColor"
|
350
|
+
},
|
351
|
+
/* @__PURE__ */ React3.createElement("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
|
352
|
+
)
|
353
|
+
);
|
354
|
+
};
|
5
355
|
export {
|
6
356
|
BackToTop
|
7
357
|
};
|
package/dist/badge/index.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React, { FC, RefObject } from 'react';
|
2
2
|
|
3
3
|
type BadgeTypes = {
|
4
4
|
position: "right" | "left";
|
@@ -8,6 +8,6 @@ type BadgeTypes = {
|
|
8
8
|
className?: string;
|
9
9
|
};
|
10
10
|
declare const Badge: FC<BadgeTypes>;
|
11
|
-
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) =>
|
11
|
+
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React.JSX.Element;
|
12
12
|
|
13
13
|
export { Badge, BadgedComponent };
|
package/dist/badge/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React, { FC, RefObject } from 'react';
|
2
2
|
|
3
3
|
type BadgeTypes = {
|
4
4
|
position: "right" | "left";
|
@@ -8,6 +8,6 @@ type BadgeTypes = {
|
|
8
8
|
className?: string;
|
9
9
|
};
|
10
10
|
declare const Badge: FC<BadgeTypes>;
|
11
|
-
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) =>
|
11
|
+
declare const BadgedComponent: ({ children, className, hideBadge, position, size, text }: any) => React.JSX.Element;
|
12
12
|
|
13
13
|
export { Badge, BadgedComponent };
|
package/dist/checkbox/index.d.ts
CHANGED
package/dist/chip/index.d.mts
CHANGED
@@ -1,2 +1,36 @@
|
|
1
|
-
|
2
|
-
import '
|
1
|
+
import React__default from 'react';
|
2
|
+
import { R as RadiusType } from '../commonTypes-PBumfOBg.mjs';
|
3
|
+
|
4
|
+
type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
|
5
|
+
type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
|
6
|
+
/** The text inside the chip */
|
7
|
+
label: string;
|
8
|
+
/** The small icon before the chip label */
|
9
|
+
icon?: JSX.Element;
|
10
|
+
/** The color of the chip, must be a tailwind color */
|
11
|
+
color?: ChipColors;
|
12
|
+
/** The size of the chip */
|
13
|
+
size?: "small" | "normal" | "large";
|
14
|
+
/** Enable/Disable the dot before the label of the chip */
|
15
|
+
dot?: boolean;
|
16
|
+
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
17
|
+
dotType?: "available" | "unavailable";
|
18
|
+
radius?: RadiusType;
|
19
|
+
};
|
20
|
+
declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
|
21
|
+
/** The text inside the chip */
|
22
|
+
label: string;
|
23
|
+
/** The small icon before the chip label */
|
24
|
+
icon?: JSX.Element | undefined;
|
25
|
+
/** The color of the chip, must be a tailwind color */
|
26
|
+
color?: ChipColors | undefined;
|
27
|
+
/** The size of the chip */
|
28
|
+
size?: "small" | "normal" | "large" | undefined;
|
29
|
+
/** Enable/Disable the dot before the label of the chip */
|
30
|
+
dot?: boolean | undefined;
|
31
|
+
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
32
|
+
dotType?: "available" | "unavailable" | undefined;
|
33
|
+
radius?: RadiusType | undefined;
|
34
|
+
} & React__default.RefAttributes<HTMLSpanElement>>;
|
35
|
+
|
36
|
+
export { Chip, type ChipColors, type ChipTypes };
|
package/dist/chip/index.d.ts
CHANGED
@@ -1,2 +1,36 @@
|
|
1
|
-
|
2
|
-
import '
|
1
|
+
import React__default from 'react';
|
2
|
+
import { R as RadiusType } from '../commonTypes-PBumfOBg.js';
|
3
|
+
|
4
|
+
type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
|
5
|
+
type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
|
6
|
+
/** The text inside the chip */
|
7
|
+
label: string;
|
8
|
+
/** The small icon before the chip label */
|
9
|
+
icon?: JSX.Element;
|
10
|
+
/** The color of the chip, must be a tailwind color */
|
11
|
+
color?: ChipColors;
|
12
|
+
/** The size of the chip */
|
13
|
+
size?: "small" | "normal" | "large";
|
14
|
+
/** Enable/Disable the dot before the label of the chip */
|
15
|
+
dot?: boolean;
|
16
|
+
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
17
|
+
dotType?: "available" | "unavailable";
|
18
|
+
radius?: RadiusType;
|
19
|
+
};
|
20
|
+
declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
|
21
|
+
/** The text inside the chip */
|
22
|
+
label: string;
|
23
|
+
/** The small icon before the chip label */
|
24
|
+
icon?: JSX.Element | undefined;
|
25
|
+
/** The color of the chip, must be a tailwind color */
|
26
|
+
color?: ChipColors | undefined;
|
27
|
+
/** The size of the chip */
|
28
|
+
size?: "small" | "normal" | "large" | undefined;
|
29
|
+
/** Enable/Disable the dot before the label of the chip */
|
30
|
+
dot?: boolean | undefined;
|
31
|
+
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
32
|
+
dotType?: "available" | "unavailable" | undefined;
|
33
|
+
radius?: RadiusType | undefined;
|
34
|
+
} & React__default.RefAttributes<HTMLSpanElement>>;
|
35
|
+
|
36
|
+
export { Chip, type ChipColors, type ChipTypes };
|
package/dist/chip/index.mjs
CHANGED
@@ -1,7 +1,87 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "../chunk-
|
4
|
-
|
2
|
+
cn
|
3
|
+
} from "../chunk-TE3BKEXL.mjs";
|
4
|
+
|
5
|
+
// components/elements/chip/Chip.tsx
|
6
|
+
import React from "react";
|
7
|
+
var Chip = React.forwardRef(
|
8
|
+
({
|
9
|
+
label,
|
10
|
+
size = "normal",
|
11
|
+
icon,
|
12
|
+
color,
|
13
|
+
radius = "inherit",
|
14
|
+
dotType,
|
15
|
+
...rest
|
16
|
+
}, ref) => {
|
17
|
+
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
18
|
+
let radiusStyles = {
|
19
|
+
inherit: " hawa-rounded",
|
20
|
+
full: "hawa-rounded-full",
|
21
|
+
none: "hawa-rounded-none"
|
22
|
+
};
|
23
|
+
let sizeStyles = {
|
24
|
+
small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
|
25
|
+
normal: "hawa-h-fit hawa-text-xs",
|
26
|
+
large: "hawa-text-base"
|
27
|
+
};
|
28
|
+
let dotStyles = {
|
29
|
+
small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
|
30
|
+
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
31
|
+
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
32
|
+
};
|
33
|
+
let dotTypeStyles = {
|
34
|
+
available: "hawa-bg-green-500",
|
35
|
+
unavailable: "hawa-bg-red-500"
|
36
|
+
};
|
37
|
+
let colorStyles = {
|
38
|
+
green: "hawa-bg-green-100 hawa-text-green-500 dark:hawa-bg-green-400 dark:hawa-text-green-800",
|
39
|
+
blue: "hawa-bg-blue-100 hawa-text-blue-500 dark:hawa-bg-blue-400 dark:hawa-text-blue-100",
|
40
|
+
red: "hawa-bg-red-100 hawa-text-red-500 dark:hawa-bg-red-400 dark:hawa-text-red-100",
|
41
|
+
yellow: "hawa-bg-yellow-100 hawa-text-yellow-600 dark:hawa-bg-yellow-400 dark:hawa-text-yellow-800",
|
42
|
+
orange: "hawa-bg-orange-100 hawa-text-orange-500 dark:hawa-bg-orange-400 dark:hawa-text-orange-100",
|
43
|
+
purple: "hawa-bg-purple-100 hawa-text-purple-500 dark:hawa-bg-purple-400 dark:hawa-text-purple-100",
|
44
|
+
cyan: "hawa-bg-cyan-100 hawa-text-cyan-800 dark:hawa-bg-cyan-400 dark:hawa-text-cyan-800",
|
45
|
+
hyper: "hawa-text-white hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
|
46
|
+
oceanic: "hawa-text-white hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
|
47
|
+
};
|
48
|
+
if (label) {
|
49
|
+
return /* @__PURE__ */ React.createElement(
|
50
|
+
"span",
|
51
|
+
{
|
52
|
+
...rest,
|
53
|
+
ref,
|
54
|
+
className: cn(
|
55
|
+
defaultStyles,
|
56
|
+
sizeStyles[size],
|
57
|
+
radiusStyles[radius],
|
58
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
59
|
+
)
|
60
|
+
},
|
61
|
+
dotType && /* @__PURE__ */ React.createElement(
|
62
|
+
"span",
|
63
|
+
{
|
64
|
+
className: cn(dotStyles[size], dotTypeStyles[dotType])
|
65
|
+
}
|
66
|
+
),
|
67
|
+
icon && icon,
|
68
|
+
label
|
69
|
+
);
|
70
|
+
} else {
|
71
|
+
return /* @__PURE__ */ React.createElement(
|
72
|
+
"span",
|
73
|
+
{
|
74
|
+
...rest,
|
75
|
+
ref,
|
76
|
+
className: cn(
|
77
|
+
"hawa-h-2 hawa-w-2 hawa-rounded-full",
|
78
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
79
|
+
)
|
80
|
+
}
|
81
|
+
);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
);
|
5
85
|
export {
|
6
86
|
Chip
|
7
87
|
};
|