@sikka/hawa 0.26.28 → 0.26.29
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/tooltip/index.js +1 -0
- package/dist/tooltip/index.js.map +1 -0
- package/dist/tooltip/index.mjs +1 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/Chip-H5BnuDdx.d.ts +0 -36
- package/dist/Chip-hr2gRBJ-.d.mts +0 -36
- package/dist/DropdownMenu-EUL-D3I3.d.mts +0 -95
- package/dist/DropdownMenu-SPisqCzV.d.ts +0 -95
- package/dist/Radio-K1WGpnGA.d.ts +0 -75
- package/dist/Radio-hsrLKNxE.d.mts +0 -75
- package/dist/Toast-VBd4UvlM.d.mts +0 -26
- package/dist/Toast-pOd4uGZz.d.ts +0 -26
- package/dist/accordion/index.d.mts +0 -51
- package/dist/accordion/index.d.ts +0 -51
- package/dist/accordion/index.js +0 -271
- package/dist/accordion/index.mjs +0 -227
- package/dist/alert/index.d.mts +0 -29
- package/dist/alert/index.d.ts +0 -29
- package/dist/alert/index.js +0 -442
- package/dist/alert/index.mjs +0 -402
- package/dist/appLayout/index.d.mts +0 -126
- package/dist/appLayout/index.d.ts +0 -126
- package/dist/appLayout/index.js +0 -1326
- package/dist/appLayout/index.mjs +0 -1286
- package/dist/appMenubar/index.d.mts +0 -33
- package/dist/appMenubar/index.d.ts +0 -33
- package/dist/appMenubar/index.js +0 -281
- package/dist/appMenubar/index.mjs +0 -224
- package/dist/appStores/index.d.mts +0 -8
- package/dist/appStores/index.d.ts +0 -8
- package/dist/appStores/index.js +0 -75
- package/dist/appStores/index.mjs +0 -38
- package/dist/appTabs/index.d.mts +0 -18
- package/dist/appTabs/index.d.ts +0 -18
- package/dist/appTabs/index.js +0 -92
- package/dist/appTabs/index.mjs +0 -50
- package/dist/appTopbar/index.d.mts +0 -44
- package/dist/appTopbar/index.d.ts +0 -44
- package/dist/appTopbar/index.js +0 -483
- package/dist/appTopbar/index.mjs +0 -441
- package/dist/avatar/index.d.mts +0 -16
- package/dist/avatar/index.d.ts +0 -16
- package/dist/avatar/index.js +0 -162
- package/dist/avatar/index.mjs +0 -122
- package/dist/backToTop/index.d.mts +0 -15
- package/dist/backToTop/index.d.ts +0 -15
- package/dist/backToTop/index.js +0 -398
- package/dist/backToTop/index.mjs +0 -358
- package/dist/badge/index.d.mts +0 -13
- package/dist/badge/index.d.ts +0 -13
- package/dist/badge/index.js +0 -127
- package/dist/badge/index.mjs +0 -84
- package/dist/blocks/auth/index.d.mts +0 -202
- package/dist/blocks/auth/index.d.ts +0 -202
- package/dist/blocks/auth/index.js +0 -4197
- package/dist/blocks/auth/index.mjs +0 -3389
- package/dist/blocks/feedback/index.d.mts +0 -74
- package/dist/blocks/feedback/index.d.ts +0 -74
- package/dist/blocks/feedback/index.js +0 -1544
- package/dist/blocks/feedback/index.mjs +0 -558
- package/dist/blocks/index.d.mts +0 -480
- package/dist/blocks/index.d.ts +0 -480
- package/dist/blocks/index.js +0 -6700
- package/dist/blocks/index.mjs +0 -2550
- package/dist/blocks/misc/index.d.mts +0 -90
- package/dist/blocks/misc/index.d.ts +0 -90
- package/dist/blocks/misc/index.js +0 -1186
- package/dist/blocks/misc/index.mjs +0 -387
- package/dist/blocks/pricing/index.d.mts +0 -93
- package/dist/blocks/pricing/index.d.ts +0 -93
- package/dist/blocks/pricing/index.js +0 -1528
- package/dist/blocks/pricing/index.mjs +0 -677
- package/dist/breadcrumb/index.d.mts +0 -14
- package/dist/breadcrumb/index.d.ts +0 -14
- package/dist/breadcrumb/index.js +0 -63
- package/dist/breadcrumb/index.mjs +0 -26
- package/dist/button/index.d.mts +0 -16
- package/dist/button/index.d.ts +0 -16
- package/dist/button/index.js +0 -301
- package/dist/button/index.mjs +0 -260
- package/dist/card/index.d.mts +0 -17
- package/dist/card/index.d.ts +0 -17
- package/dist/card/index.js +0 -139
- package/dist/card/index.mjs +0 -92
- package/dist/carousel/index.d.mts +0 -15
- package/dist/carousel/index.d.ts +0 -15
- package/dist/carousel/index.js +0 -193
- package/dist/carousel/index.mjs +0 -151
- package/dist/checkbox/index.d.mts +0 -20
- package/dist/checkbox/index.d.ts +0 -20
- package/dist/checkbox/index.js +0 -184
- package/dist/checkbox/index.mjs +0 -142
- package/dist/chip/index.d.mts +0 -36
- package/dist/chip/index.d.ts +0 -36
- package/dist/chip/index.js +0 -129
- package/dist/chip/index.mjs +0 -87
- package/dist/chunk-2R7F2GL7.mjs +0 -82
- package/dist/chunk-4EGKGSGY.mjs +0 -129
- package/dist/chunk-5YXZXYLH.mjs +0 -67
- package/dist/chunk-65TG6EVD.mjs +0 -264
- package/dist/chunk-D22AALLE.mjs +0 -22
- package/dist/chunk-D36MPDGE.mjs +0 -476
- package/dist/chunk-F3DQJHTG.mjs +0 -3113
- package/dist/chunk-FQ6WVEHW.mjs +0 -151
- package/dist/chunk-GVJYACGA.mjs +0 -189
- package/dist/chunk-JNUGOUYJ.mjs +0 -154
- package/dist/chunk-KMCIHW76.mjs +0 -150
- package/dist/chunk-MQUAGP7K.mjs +0 -1098
- package/dist/chunk-NMS5LCSQ.mjs +0 -195
- package/dist/chunk-OY66MBXP.mjs +0 -163
- package/dist/chunk-R4HAAT6R.mjs +0 -131
- package/dist/chunk-SJ2Z6ZOG.mjs +0 -442
- package/dist/chunk-TGZRVRLP.mjs +0 -107
- package/dist/chunk-TWNGV3RE.mjs +0 -10
- package/dist/chunk-WUHNPHD5.mjs +0 -0
- package/dist/chunk-ZFXKCRJC.mjs +0 -11
- package/dist/chunk-ZS3FB3PO.mjs +0 -12
- package/dist/codeBlock/index.d.mts +0 -24
- package/dist/codeBlock/index.d.ts +0 -24
- package/dist/codeBlock/index.js +0 -517
- package/dist/codeBlock/index.mjs +0 -432
- package/dist/collapsible/index.d.mts +0 -8
- package/dist/collapsible/index.d.ts +0 -8
- package/dist/collapsible/index.js +0 -49
- package/dist/collapsible/index.mjs +0 -12
- package/dist/colorPicker/index.d.mts +0 -34
- package/dist/colorPicker/index.d.ts +0 -34
- package/dist/colorPicker/index.js +0 -276
- package/dist/colorPicker/index.mjs +0 -170
- package/dist/combobox/index.d.mts +0 -41
- package/dist/combobox/index.d.ts +0 -41
- package/dist/combobox/index.js +0 -749
- package/dist/combobox/index.mjs +0 -295
- package/dist/command/index.d.mts +0 -48
- package/dist/command/index.d.ts +0 -48
- package/dist/command/index.js +0 -485
- package/dist/command/index.mjs +0 -22
- package/dist/commonTypes-2IGtJ5cq.d.mts +0 -3
- package/dist/commonTypes-2IGtJ5cq.d.ts +0 -3
- package/dist/commonTypes-2k6FnHw5.d.mts +0 -4
- package/dist/commonTypes-2k6FnHw5.d.ts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
- package/dist/commonTypes-CKtkuNFH.d.mts +0 -11
- package/dist/commonTypes-CKtkuNFH.d.ts +0 -11
- package/dist/commonTypes-GhKAraJw.d.mts +0 -4
- package/dist/commonTypes-GhKAraJw.d.ts +0 -4
- package/dist/commonTypes-MxCJyrHv.d.mts +0 -8
- package/dist/commonTypes-MxCJyrHv.d.ts +0 -8
- package/dist/commonTypes-PBumfOBg.d.mts +0 -3
- package/dist/commonTypes-PBumfOBg.d.ts +0 -3
- package/dist/commonTypes-WPhcN3Vr.d.mts +0 -5
- package/dist/commonTypes-WPhcN3Vr.d.ts +0 -5
- package/dist/commonTypes-_11epZYh.d.mts +0 -4
- package/dist/commonTypes-_11epZYh.d.ts +0 -4
- package/dist/commonTypes-ko_NGEoT.d.mts +0 -3
- package/dist/commonTypes-ko_NGEoT.d.ts +0 -3
- package/dist/copyrights/index.d.mts +0 -17
- package/dist/copyrights/index.d.ts +0 -17
- package/dist/copyrights/index.js +0 -45
- package/dist/copyrights/index.mjs +0 -8
- package/dist/count/index.d.mts +0 -11
- package/dist/count/index.d.ts +0 -11
- package/dist/count/index.js +0 -45
- package/dist/count/index.mjs +0 -8
- package/dist/dataTable/index.d.mts +0 -41
- package/dist/dataTable/index.d.ts +0 -41
- package/dist/dataTable/index.js +0 -1313
- package/dist/dataTable/index.mjs +0 -1281
- package/dist/destroyableCard/index.d.mts +0 -12
- package/dist/destroyableCard/index.d.ts +0 -12
- package/dist/destroyableCard/index.js +0 -203
- package/dist/destroyableCard/index.mjs +0 -163
- package/dist/dialog/index.d.mts +0 -57
- package/dist/dialog/index.d.ts +0 -57
- package/dist/dialog/index.js +0 -368
- package/dist/dialog/index.mjs +0 -314
- package/dist/docsLayout/index.d.mts +0 -37
- package/dist/docsLayout/index.d.ts +0 -37
- package/dist/docsLayout/index.js +0 -927
- package/dist/docsLayout/index.mjs +0 -887
- package/dist/docsSidebar/index.d.mts +0 -11
- package/dist/docsSidebar/index.d.ts +0 -11
- package/dist/docsSidebar/index.js +0 -111
- package/dist/docsSidebar/index.mjs +0 -69
- package/dist/dropdownMenu/index.d.mts +0 -96
- package/dist/dropdownMenu/index.d.ts +0 -96
- package/dist/dropdownMenu/index.js +0 -420
- package/dist/dropdownMenu/index.mjs +0 -362
- package/dist/elements/index.d.mts +0 -788
- package/dist/elements/index.d.ts +0 -788
- package/dist/elements/index.js +0 -7835
- package/dist/elements/index.mjs +0 -3418
- package/dist/fileDropzone/index.d.mts +0 -37
- package/dist/fileDropzone/index.d.ts +0 -37
- package/dist/fileDropzone/index.js +0 -665
- package/dist/fileDropzone/index.mjs +0 -625
- package/dist/fileUploader/index.d.mts +0 -5
- package/dist/fileUploader/index.d.ts +0 -5
- package/dist/fileUploader/index.js +0 -62
- package/dist/fileUploader/index.mjs +0 -25
- package/dist/glow/index.d.mts +0 -16
- package/dist/glow/index.d.ts +0 -16
- package/dist/glow/index.js +0 -155
- package/dist/glow/index.mjs +0 -117
- package/dist/hooks/index.d.mts +0 -108
- package/dist/hooks/index.d.ts +0 -108
- package/dist/hooks/index.js +0 -459
- package/dist/hooks/index.mjs +0 -255
- package/dist/index.d.mts +0 -1932
- package/dist/index.d.ts +0 -1932
- package/dist/index.js +0 -12126
- package/dist/index.mjs +0 -11911
- package/dist/input/index.d.mts +0 -43
- package/dist/input/index.d.ts +0 -43
- package/dist/input/index.js +0 -293
- package/dist/input/index.mjs +0 -158
- package/dist/interfaceSettings/index.d.mts +0 -18
- package/dist/interfaceSettings/index.d.ts +0 -18
- package/dist/interfaceSettings/index.js +0 -420
- package/dist/interfaceSettings/index.mjs +0 -283
- package/dist/label/index.d.mts +0 -13
- package/dist/label/index.d.ts +0 -13
- package/dist/label/index.js +0 -142
- package/dist/label/index.mjs +0 -102
- package/dist/layout/index.d.mts +0 -256
- package/dist/layout/index.d.ts +0 -256
- package/dist/layout/index.js +0 -2627
- package/dist/layout/index.mjs +0 -1393
- package/dist/loading/index.d.mts +0 -15
- package/dist/loading/index.d.ts +0 -15
- package/dist/loading/index.js +0 -225
- package/dist/loading/index.mjs +0 -183
- package/dist/logos/index.d.mts +0 -27
- package/dist/logos/index.d.ts +0 -27
- package/dist/logos/index.js +0 -244
- package/dist/logos/index.mjs +0 -207
- package/dist/navbar/index.d.mts +0 -17
- package/dist/navbar/index.d.ts +0 -17
- package/dist/navbar/index.js +0 -166
- package/dist/navbar/index.mjs +0 -126
- package/dist/navigationMenu/index.d.mts +0 -39
- package/dist/navigationMenu/index.d.ts +0 -39
- package/dist/navigationMenu/index.js +0 -221
- package/dist/navigationMenu/index.mjs +0 -169
- package/dist/pagination/index.d.mts +0 -11
- package/dist/pagination/index.d.ts +0 -11
- package/dist/pagination/index.js +0 -160
- package/dist/pagination/index.mjs +0 -118
- package/dist/passwordInput/index.d.mts +0 -13
- package/dist/passwordInput/index.d.ts +0 -13
- package/dist/passwordInput/index.js +0 -577
- package/dist/passwordInput/index.mjs +0 -534
- package/dist/phoneInput/index.d.mts +0 -23
- package/dist/phoneInput/index.d.ts +0 -23
- package/dist/phoneInput/index.js +0 -2085
- package/dist/phoneInput/index.mjs +0 -2045
- package/dist/pinInput/index.d.mts +0 -20
- package/dist/pinInput/index.d.ts +0 -20
- package/dist/pinInput/index.js +0 -131
- package/dist/pinInput/index.mjs +0 -89
- package/dist/popover/index.d.mts +0 -23
- package/dist/popover/index.d.ts +0 -23
- package/dist/popover/index.js +0 -112
- package/dist/popover/index.mjs +0 -68
- package/dist/progress/index.d.mts +0 -6
- package/dist/progress/index.d.ts +0 -6
- package/dist/progress/index.js +0 -71
- package/dist/progress/index.mjs +0 -29
- package/dist/progressCircle/index.d.mts +0 -16
- package/dist/progressCircle/index.d.ts +0 -16
- package/dist/progressCircle/index.js +0 -159
- package/dist/progressCircle/index.mjs +0 -117
- package/dist/radio/index.d.mts +0 -39
- package/dist/radio/index.d.ts +0 -39
- package/dist/radio/index.js +0 -331
- package/dist/radio/index.mjs +0 -291
- package/dist/scrollArea/index.d.mts +0 -10
- package/dist/scrollArea/index.d.ts +0 -10
- package/dist/scrollArea/index.js +0 -90
- package/dist/scrollArea/index.mjs +0 -47
- package/dist/scrollIndicator/index.d.mts +0 -9
- package/dist/scrollIndicator/index.d.ts +0 -9
- package/dist/scrollIndicator/index.js +0 -80
- package/dist/scrollIndicator/index.mjs +0 -43
- package/dist/select/index.d.mts +0 -50
- package/dist/select/index.d.ts +0 -50
- package/dist/select/index.js +0 -325
- package/dist/select/index.mjs +0 -285
- package/dist/separator/index.d.mts +0 -10
- package/dist/separator/index.d.ts +0 -10
- package/dist/separator/index.js +0 -66
- package/dist/separator/index.mjs +0 -24
- package/dist/sheet/index.d.mts +0 -30
- package/dist/sheet/index.d.ts +0 -30
- package/dist/sheet/index.js +0 -201
- package/dist/sheet/index.mjs +0 -150
- package/dist/sidebar/index.d.mts +0 -48
- package/dist/sidebar/index.d.ts +0 -48
- package/dist/sidebar/index.js +0 -341
- package/dist/sidebar/index.mjs +0 -298
- package/dist/signature/index.d.mts +0 -27
- package/dist/signature/index.d.ts +0 -27
- package/dist/signature/index.js +0 -261
- package/dist/signature/index.mjs +0 -219
- package/dist/simpleTable/index.d.mts +0 -30
- package/dist/simpleTable/index.d.ts +0 -30
- package/dist/simpleTable/index.js +0 -253
- package/dist/simpleTable/index.mjs +0 -217
- package/dist/skeleton/index.d.mts +0 -10
- package/dist/skeleton/index.d.ts +0 -10
- package/dist/skeleton/index.js +0 -75
- package/dist/skeleton/index.mjs +0 -33
- package/dist/slider/index.d.mts +0 -6
- package/dist/slider/index.d.ts +0 -6
- package/dist/slider/index.js +0 -66
- package/dist/slider/index.mjs +0 -24
- package/dist/sortButton/index.d.mts +0 -10
- package/dist/sortButton/index.d.ts +0 -10
- package/dist/sortButton/index.js +0 -336
- package/dist/sortButton/index.mjs +0 -42
- package/dist/splitButton/index.d.mts +0 -52
- package/dist/splitButton/index.d.ts +0 -52
- package/dist/splitButton/index.js +0 -692
- package/dist/splitButton/index.mjs +0 -400
- package/dist/stats/index.d.mts +0 -19
- package/dist/stats/index.d.ts +0 -19
- package/dist/stats/index.js +0 -191
- package/dist/stats/index.mjs +0 -154
- package/dist/stopPropagationWrapper/index.d.mts +0 -5
- package/dist/stopPropagationWrapper/index.d.ts +0 -5
- package/dist/stopPropagationWrapper/index.js +0 -48
- package/dist/stopPropagationWrapper/index.mjs +0 -11
- package/dist/switch/index.d.mts +0 -12
- package/dist/switch/index.d.ts +0 -12
- package/dist/switch/index.js +0 -125
- package/dist/switch/index.mjs +0 -83
- package/dist/table/index.d.mts +0 -21
- package/dist/table/index.d.ts +0 -21
- package/dist/table/index.js +0 -172
- package/dist/table/index.mjs +0 -123
- package/dist/tabs/index.d.mts +0 -33
- package/dist/tabs/index.d.ts +0 -33
- package/dist/tabs/index.js +0 -200
- package/dist/tabs/index.mjs +0 -157
- package/dist/textTypes-559CaoOV.d.mts +0 -88
- package/dist/textTypes-559CaoOV.d.ts +0 -88
- package/dist/textarea/index.d.mts +0 -27
- package/dist/textarea/index.d.ts +0 -27
- package/dist/textarea/index.js +0 -229
- package/dist/textarea/index.mjs +0 -189
- package/dist/toast/index.d.mts +0 -26
- package/dist/toast/index.d.ts +0 -26
- package/dist/toast/index.js +0 -197
- package/dist/toast/index.mjs +0 -19
- package/dist/toaster/index.d.mts +0 -9
- package/dist/toaster/index.d.ts +0 -9
- package/dist/toaster/index.js +0 -353
- package/dist/toaster/index.mjs +0 -184
- package/dist/types/index.d.mts +0 -115
- package/dist/types/index.d.ts +0 -115
- package/dist/types/index.js +0 -18
- package/dist/types/index.mjs +0 -0
package/dist/chunk-NMS5LCSQ.mjs
DELETED
@@ -1,195 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Label,
|
3
|
-
cn
|
4
|
-
} from "./chunk-D36MPDGE.mjs";
|
5
|
-
|
6
|
-
// elements/radio/Radio.tsx
|
7
|
-
import React, { useState, useRef, useEffect } from "react";
|
8
|
-
var Radio = ({
|
9
|
-
design = "default",
|
10
|
-
width = "default",
|
11
|
-
size = "default",
|
12
|
-
orientation = "horizontal",
|
13
|
-
name,
|
14
|
-
labelProps,
|
15
|
-
tabsContainerClassName,
|
16
|
-
onChange,
|
17
|
-
...props
|
18
|
-
}) => {
|
19
|
-
var _a, _b, _c;
|
20
|
-
const [selectedOption, setSelectedOption] = useState(props.defaultValue);
|
21
|
-
let activeTabStyle = "hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary";
|
22
|
-
let inactiveTabStyle = "hawa-inline-block hawa-w-full hawa-transition-all hover:hawa-bg-muted hawa-bg-primary-foreground dark:hover:hawa-text-white";
|
23
|
-
let orientationStyle = {
|
24
|
-
horizontal: "hawa-flex hawa-flex-row",
|
25
|
-
vertical: "hawa-flex hawa-flex-col"
|
26
|
-
};
|
27
|
-
let tabSizeStyle = {
|
28
|
-
default: "hawa-py-2 hawa-px-4 hawa-text-sm",
|
29
|
-
lg: "hawa-py-2 hawa-px-4",
|
30
|
-
sm: "hawa-p-1.5 hawa-text-xs",
|
31
|
-
xs: "hawa-p-1 hawa-text-[10px]"
|
32
|
-
};
|
33
|
-
let widthStyle = {
|
34
|
-
none: "",
|
35
|
-
default: "hawa-max-w-fit",
|
36
|
-
full: "hawa-w-full"
|
37
|
-
};
|
38
|
-
const [parentDirection, setParentDirection] = React.useState(
|
39
|
-
null
|
40
|
-
);
|
41
|
-
const parentRef = useRef(null);
|
42
|
-
useEffect(() => {
|
43
|
-
var _a2;
|
44
|
-
const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
|
45
|
-
if (parentNode) {
|
46
|
-
const dir = window.getComputedStyle(parentNode).direction;
|
47
|
-
setParentDirection(dir);
|
48
|
-
}
|
49
|
-
});
|
50
|
-
const handleChange = (opt) => {
|
51
|
-
setSelectedOption(opt.value);
|
52
|
-
if (onChange) {
|
53
|
-
onChange(opt.value);
|
54
|
-
} else {
|
55
|
-
console.log("onChange was not provided");
|
56
|
-
}
|
57
|
-
};
|
58
|
-
switch (design) {
|
59
|
-
case "tabs":
|
60
|
-
return /* @__PURE__ */ React.createElement(
|
61
|
-
"ul",
|
62
|
-
{
|
63
|
-
ref: parentRef,
|
64
|
-
className: cn(
|
65
|
-
props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
|
66
|
-
"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium",
|
67
|
-
orientationStyle[orientation],
|
68
|
-
widthStyle[width],
|
69
|
-
tabsContainerClassName
|
70
|
-
)
|
71
|
-
},
|
72
|
-
(_b = props.options) == null ? void 0 : _b.map((opt, o) => /* @__PURE__ */ React.createElement(
|
73
|
-
"li",
|
74
|
-
{
|
75
|
-
"aria-current": "page",
|
76
|
-
onClick: () => handleChange(opt),
|
77
|
-
className: cn(
|
78
|
-
"hawa-w-full hawa-cursor-pointer ",
|
79
|
-
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
80
|
-
orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
|
81
|
-
orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
|
82
|
-
tabSizeStyle[size],
|
83
|
-
"hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
|
84
|
-
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
85
|
-
),
|
86
|
-
key: o
|
87
|
-
},
|
88
|
-
opt.icon && opt.icon,
|
89
|
-
opt.label
|
90
|
-
))
|
91
|
-
);
|
92
|
-
case "bordered":
|
93
|
-
return /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement("div", { key: i, className: "hawa-w-full hawa-rounded hawa-border" }, /* @__PURE__ */ React.createElement(
|
94
|
-
"div",
|
95
|
-
{
|
96
|
-
className: cn(
|
97
|
-
"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
|
98
|
-
props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"
|
99
|
-
),
|
100
|
-
key: i + 1
|
101
|
-
},
|
102
|
-
/* @__PURE__ */ React.createElement(
|
103
|
-
"input",
|
104
|
-
{
|
105
|
-
disabled: opt.disabled,
|
106
|
-
id: opt.value.toString(),
|
107
|
-
type: "radio",
|
108
|
-
value: opt.value,
|
109
|
-
name,
|
110
|
-
onChange: () => handleChange(opt)
|
111
|
-
}
|
112
|
-
),
|
113
|
-
/* @__PURE__ */ React.createElement(
|
114
|
-
"label",
|
115
|
-
{
|
116
|
-
htmlFor: opt.value.toString(),
|
117
|
-
className: cn(
|
118
|
-
"hawa-ml-2 hawa-w-full hawa-select-none hawa-p-4 hawa-pl-3 hawa-text-sm hawa-font-medium hawa-text-black dark:hawa-text-white",
|
119
|
-
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
120
|
-
)
|
121
|
-
},
|
122
|
-
opt.label
|
123
|
-
)
|
124
|
-
))));
|
125
|
-
case "cards":
|
126
|
-
return /* @__PURE__ */ React.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React.createElement(
|
127
|
-
"input",
|
128
|
-
{
|
129
|
-
type: "radio",
|
130
|
-
id: opt.value.toString(),
|
131
|
-
name,
|
132
|
-
value: opt.value.toString(),
|
133
|
-
className: "hawa-peer hawa-hidden",
|
134
|
-
required: true,
|
135
|
-
disabled: opt.disabled
|
136
|
-
}
|
137
|
-
), /* @__PURE__ */ React.createElement(
|
138
|
-
"label",
|
139
|
-
{
|
140
|
-
htmlFor: opt.value.toString(),
|
141
|
-
className: cn(
|
142
|
-
"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-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-gray-800 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
143
|
-
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"
|
144
|
-
)
|
145
|
-
},
|
146
|
-
/* @__PURE__ */ React.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
147
|
-
))));
|
148
|
-
default:
|
149
|
-
return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React.createElement(
|
150
|
-
"div",
|
151
|
-
{
|
152
|
-
className: cn(
|
153
|
-
"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
154
|
-
props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
|
155
|
-
),
|
156
|
-
key: i + 1
|
157
|
-
},
|
158
|
-
/* @__PURE__ */ React.createElement(
|
159
|
-
"input",
|
160
|
-
{
|
161
|
-
disabled: opt.disabled,
|
162
|
-
id: opt.value.toString(),
|
163
|
-
type: "radio",
|
164
|
-
value: opt.value,
|
165
|
-
name,
|
166
|
-
onChange: () => handleChange(opt)
|
167
|
-
}
|
168
|
-
),
|
169
|
-
/* @__PURE__ */ React.createElement(
|
170
|
-
"label",
|
171
|
-
{
|
172
|
-
htmlFor: opt.value.toString(),
|
173
|
-
className: cn(
|
174
|
-
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
175
|
-
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
176
|
-
)
|
177
|
-
},
|
178
|
-
opt.label
|
179
|
-
)
|
180
|
-
))), /* @__PURE__ */ React.createElement(
|
181
|
-
"p",
|
182
|
-
{
|
183
|
-
className: cn(
|
184
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
185
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
186
|
-
)
|
187
|
-
},
|
188
|
-
props.helperText
|
189
|
-
));
|
190
|
-
}
|
191
|
-
};
|
192
|
-
|
193
|
-
export {
|
194
|
-
Radio
|
195
|
-
};
|
package/dist/chunk-OY66MBXP.mjs
DELETED
@@ -1,163 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Label,
|
3
|
-
Skeleton,
|
4
|
-
cn
|
5
|
-
} from "./chunk-D36MPDGE.mjs";
|
6
|
-
|
7
|
-
// elements/select/Select.tsx
|
8
|
-
import React from "react";
|
9
|
-
import ReactSelect from "react-select";
|
10
|
-
import CreatableSelect from "react-select/creatable";
|
11
|
-
import clsx from "clsx";
|
12
|
-
var Select = ({
|
13
|
-
labelProps,
|
14
|
-
labelKey = "label",
|
15
|
-
...props
|
16
|
-
}) => {
|
17
|
-
const NoOption = () => {
|
18
|
-
var _a, _b;
|
19
|
-
return /* @__PURE__ */ React.createElement("div", null, (_b = (_a = props.texts) == null ? void 0 : _a.noOptions) != null ? _b : "No Items Found");
|
20
|
-
};
|
21
|
-
const Control = ({ children, innerProps, innerRef }) => {
|
22
|
-
return /* @__PURE__ */ React.createElement(
|
23
|
-
"div",
|
24
|
-
{
|
25
|
-
ref: innerRef,
|
26
|
-
className: clsx(
|
27
|
-
"hawa-flex hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-p-2 hawa-text-sm hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500"
|
28
|
-
),
|
29
|
-
...innerProps
|
30
|
-
},
|
31
|
-
children
|
32
|
-
);
|
33
|
-
};
|
34
|
-
const Option = ({ children, innerProps, innerRef }) => {
|
35
|
-
return /* @__PURE__ */ React.createElement(
|
36
|
-
"div",
|
37
|
-
{
|
38
|
-
ref: innerRef,
|
39
|
-
className: cn(
|
40
|
-
"hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hawa-transition-all hover:hawa-bg-primary hover:hawa-text-primary-foreground"
|
41
|
-
),
|
42
|
-
...innerProps
|
43
|
-
},
|
44
|
-
children
|
45
|
-
);
|
46
|
-
};
|
47
|
-
const Menu = ({
|
48
|
-
cx,
|
49
|
-
children,
|
50
|
-
getStyles,
|
51
|
-
innerProps,
|
52
|
-
innerRef,
|
53
|
-
...menuProps
|
54
|
-
}) => {
|
55
|
-
const menuOpen = menuProps.selectProps.menuIsOpen;
|
56
|
-
return /* @__PURE__ */ React.createElement(
|
57
|
-
"div",
|
58
|
-
{
|
59
|
-
className: cn(
|
60
|
-
"dark:dark-shadow hawa-absolute hawa-z-10 -hawa-mx-1 hawa-mt-1 hawa-flex hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-shadow-md",
|
61
|
-
props.phoneCode ? "hawa-p-1.5" : "hawa-w-full hawa-p-1.5",
|
62
|
-
menuOpen && "hawa-animate-in hawa-fade-in-0 hawa-zoom-in-95 "
|
63
|
-
),
|
64
|
-
ref: innerRef,
|
65
|
-
...innerProps
|
66
|
-
},
|
67
|
-
children
|
68
|
-
);
|
69
|
-
};
|
70
|
-
return /* @__PURE__ */ React.createElement(
|
71
|
-
"div",
|
72
|
-
{
|
73
|
-
className: cn(
|
74
|
-
"hawa-flex hawa-flex-col hawa-gap-2",
|
75
|
-
props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
|
76
|
-
)
|
77
|
-
},
|
78
|
-
props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
|
79
|
-
props.isLoading ? /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
|
80
|
-
// TODO: enable keyboard to go to the next item in the list
|
81
|
-
/* @__PURE__ */ React.createElement(
|
82
|
-
ReactSelect,
|
83
|
-
{
|
84
|
-
noOptionsMessage: NoOption,
|
85
|
-
classNames: {
|
86
|
-
control: () => cn(
|
87
|
-
props.phoneCode && "hawa-rounded-r-none",
|
88
|
-
props.controlClassNames
|
89
|
-
),
|
90
|
-
container: () => cn(
|
91
|
-
"hawa-rounded",
|
92
|
-
props.phoneCode && "hawa-w-fit hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
93
|
-
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
94
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
95
|
-
),
|
96
|
-
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
97
|
-
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
98
|
-
singleValue: () => "hawa-text-foreground",
|
99
|
-
indicatorsContainer: () => cn(
|
100
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
101
|
-
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
102
|
-
)
|
103
|
-
},
|
104
|
-
unstyled: true,
|
105
|
-
autoFocus: true,
|
106
|
-
components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : { Option, Menu },
|
107
|
-
onChange: (newValue, action) => props.onChange(newValue, action),
|
108
|
-
options: props.options,
|
109
|
-
getOptionLabel: props.getOptionLabel,
|
110
|
-
defaultValue: props.defaultValue,
|
111
|
-
placeholder: props.placeholder,
|
112
|
-
isDisabled: props.disabled,
|
113
|
-
isClearable: props.isClearable,
|
114
|
-
isMulti: props.isMulti,
|
115
|
-
isSearchable: props.isSearchable
|
116
|
-
}
|
117
|
-
)
|
118
|
-
) : /* @__PURE__ */ React.createElement(
|
119
|
-
CreatableSelect,
|
120
|
-
{
|
121
|
-
formatCreateLabel: (inputValue) => {
|
122
|
-
var _a, _b;
|
123
|
-
return `${(_b = (_a = props.texts) == null ? void 0 : _a.createLabel) != null ? _b : "Create"} "${inputValue}"`;
|
124
|
-
},
|
125
|
-
classNames: {
|
126
|
-
container: () => cn(
|
127
|
-
"hawa-rounded",
|
128
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
129
|
-
),
|
130
|
-
placeholder: () => "hawa-px-2 hawa-text-muted-foreground",
|
131
|
-
input: () => "hawa-text-primary hawa-px-2",
|
132
|
-
valueContainer: () => "hawa-text-white dark:hawa-text-muted-foreground",
|
133
|
-
singleValue: () => "hawa-text-black dark:hawa-text-white hawa-px-2",
|
134
|
-
indicatorsContainer: () => " hawa-px-2 hawa-cursor-pointer hawa-text-muted-foreground"
|
135
|
-
},
|
136
|
-
unstyled: true,
|
137
|
-
options: props.options,
|
138
|
-
isClearable: props.isClearable,
|
139
|
-
isMulti: props.isMulti,
|
140
|
-
isSearchable: props.isSearchable,
|
141
|
-
placeholder: props.placeholder,
|
142
|
-
onCreateOption: props.handleCreateOption,
|
143
|
-
onChange: (newValue, action) => props.onChange(newValue, action),
|
144
|
-
components: { Control, Option, Menu },
|
145
|
-
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
146
|
-
}
|
147
|
-
),
|
148
|
-
!props.hideHelperText && /* @__PURE__ */ React.createElement(
|
149
|
-
"p",
|
150
|
-
{
|
151
|
-
className: cn(
|
152
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
153
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
154
|
-
)
|
155
|
-
},
|
156
|
-
props.helperText
|
157
|
-
)
|
158
|
-
);
|
159
|
-
};
|
160
|
-
|
161
|
-
export {
|
162
|
-
Select
|
163
|
-
};
|
package/dist/chunk-R4HAAT6R.mjs
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Label,
|
3
|
-
Skeleton,
|
4
|
-
cn
|
5
|
-
} from "./chunk-D36MPDGE.mjs";
|
6
|
-
|
7
|
-
// elements/input/Input.tsx
|
8
|
-
import React, { forwardRef } from "react";
|
9
|
-
var Input = forwardRef(
|
10
|
-
({
|
11
|
-
margin = "none",
|
12
|
-
width = "full",
|
13
|
-
preview = false,
|
14
|
-
forceHideHelperText = false,
|
15
|
-
labelProps,
|
16
|
-
placeholder,
|
17
|
-
showCount,
|
18
|
-
inputProps,
|
19
|
-
countPosition = "bottom",
|
20
|
-
...props
|
21
|
-
}, ref) => {
|
22
|
-
var _a;
|
23
|
-
let marginStyles = {
|
24
|
-
none: "hawa-mb-0",
|
25
|
-
normal: "hawa-mb-3",
|
26
|
-
large: "hawa-mb-5"
|
27
|
-
};
|
28
|
-
let widthStyles = {
|
29
|
-
small: "hawa-w-full hawa-max-w-2xs",
|
30
|
-
normal: "hawa-w-1/2",
|
31
|
-
full: "hawa-w-full",
|
32
|
-
auto: ""
|
33
|
-
};
|
34
|
-
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
35
|
-
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
36
|
-
return /* @__PURE__ */ React.createElement(
|
37
|
-
"div",
|
38
|
-
{
|
39
|
-
className: cn(
|
40
|
-
defaultStyle,
|
41
|
-
marginStyles[margin],
|
42
|
-
widthStyles[width],
|
43
|
-
props.containerClassName,
|
44
|
-
"hawa-w-full hawa-gap-2"
|
45
|
-
)
|
46
|
-
},
|
47
|
-
props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
|
48
|
-
props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React.createElement(React.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React.createElement(
|
49
|
-
"div",
|
50
|
-
{
|
51
|
-
className: cn(
|
52
|
-
"hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
|
53
|
-
preview ? "hawa-opacity-100" : "hawa-opacity-0"
|
54
|
-
)
|
55
|
-
}
|
56
|
-
), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "hawa-relative" }, props.startIcon && /* @__PURE__ */ React.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React.createElement(
|
57
|
-
"div",
|
58
|
-
{
|
59
|
-
className: cn(
|
60
|
-
"hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2",
|
61
|
-
(_a = props.endIconProps) == null ? void 0 : _a.className
|
62
|
-
)
|
63
|
-
},
|
64
|
-
props.endIcon
|
65
|
-
), /* @__PURE__ */ React.createElement(
|
66
|
-
"input",
|
67
|
-
{
|
68
|
-
required: true,
|
69
|
-
dir: props.dir,
|
70
|
-
type: props.type,
|
71
|
-
value: props.value,
|
72
|
-
onChange: props.onChange,
|
73
|
-
autoComplete: props.autoComplete,
|
74
|
-
defaultValue: props.defaultValue,
|
75
|
-
placeholder,
|
76
|
-
disabled: props.disabled || preview,
|
77
|
-
style: { height: 40 },
|
78
|
-
...inputProps,
|
79
|
-
className: cn(
|
80
|
-
defaultInputStyle,
|
81
|
-
" 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",
|
82
|
-
{
|
83
|
-
"hawa-pe-9": props.endIcon,
|
84
|
-
"hawa-ps-9": props.startIcon,
|
85
|
-
"hawa-pe-[60px]": countPosition === "center"
|
86
|
-
},
|
87
|
-
preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
|
88
|
-
inputProps == null ? void 0 : inputProps.className
|
89
|
-
)
|
90
|
-
}
|
91
|
-
)), !forceHideHelperText && /* @__PURE__ */ React.createElement(
|
92
|
-
"p",
|
93
|
-
{
|
94
|
-
className: cn(
|
95
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
96
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
97
|
-
)
|
98
|
-
},
|
99
|
-
props.helperText
|
100
|
-
), !props.disabled && forceHideHelperText && /* @__PURE__ */ React.createElement(
|
101
|
-
"div",
|
102
|
-
{
|
103
|
-
className: cn(
|
104
|
-
"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",
|
105
|
-
props.helperText ? "hawa-border hawa-p-1" : "hawa-border-none hawa-p-0"
|
106
|
-
)
|
107
|
-
},
|
108
|
-
props.helperText
|
109
|
-
), showCount && /* @__PURE__ */ React.createElement(
|
110
|
-
"div",
|
111
|
-
{
|
112
|
-
className: cn(
|
113
|
-
"hawa-absolute hawa-translate-y-1/2 hawa-text-start hawa-text-xs hawa-transition-all",
|
114
|
-
{
|
115
|
-
"hawa-end-0 hawa-top-[62px]": countPosition === "bottom",
|
116
|
-
"hawa-bottom-[62px] hawa-end-0": countPosition === "top",
|
117
|
-
"hawa-end-2": countPosition === "center"
|
118
|
-
}
|
119
|
-
)
|
120
|
-
},
|
121
|
-
props.value ? String(props.value).length : 0,
|
122
|
-
"/",
|
123
|
-
props.maxLength
|
124
|
-
)))
|
125
|
-
);
|
126
|
-
}
|
127
|
-
);
|
128
|
-
|
129
|
-
export {
|
130
|
-
Input
|
131
|
-
};
|