@sikka/hawa 0.39.0-next → 0.40.0-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DropdownMenu-B3cTLPDi.d.mts → DropdownMenu-FVVDS2rX.d.mts} +6 -1
- package/dist/{DropdownMenu-BO1TNMm5.d.ts → DropdownMenu-SFJtRGAw.d.ts} +6 -1
- package/dist/{Radio-lgoClQrv.d.ts → Radio-DlPwVCG4.d.ts} +6 -0
- package/dist/{Radio-uQ7DtzcI.d.mts → Radio-Dyvlywnk.d.mts} +6 -0
- package/dist/alert/index.js +2 -2
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +2 -2
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.d.mts +2 -0
- package/dist/appLayout/index.d.ts +2 -0
- package/dist/appLayout/index.js +14 -3
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +14 -3
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/backToTop/index.js +2 -2
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +2 -2
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +2 -2
- package/dist/blocks/auth/index.mjs +4 -4
- package/dist/blocks/feedback/index.js +162 -119
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +2 -2
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/index.js +442 -450
- package/dist/blocks/index.mjs +3 -3
- package/dist/blocks/misc/index.js +238 -289
- package/dist/blocks/misc/index.mjs +147 -200
- package/dist/blocks/pricing/index.js +162 -119
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.d.mts +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +2 -2
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +2 -2
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +2 -2
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +2 -2
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/{chunk-C2IX3SUD.mjs → chunk-27G5FKOP.mjs} +1 -1
- package/dist/{chunk-IC5WYNKN.mjs → chunk-AJTYKC5R.mjs} +1 -1
- package/dist/{chunk-UMOBOCED.mjs → chunk-CTNKKP2O.mjs} +2 -2
- package/dist/chunk-CTZRVSTI.mjs +346 -0
- package/dist/{chunk-XFSBC5VI.mjs → chunk-DYPGZ2IP.mjs} +1 -1
- package/dist/{chunk-UJ5SXC3M.mjs → chunk-GN7EIDTE.mjs} +1 -1
- package/dist/{chunk-VMVZM3QQ.mjs → chunk-GU2DOJ7Q.mjs} +31 -8
- package/dist/{chunk-RTK6REIK.mjs → chunk-QZIENYTE.mjs} +1 -1
- package/dist/{chunk-EZBHA2IL.mjs → chunk-RT2Q3SH7.mjs} +1 -1
- package/dist/{chunk-W3CF7BSC.mjs → chunk-UBUVHGW4.mjs} +238 -248
- package/dist/{chunk-ZBUBNKF6.mjs → chunk-XCW5YNMS.mjs} +34 -1
- package/dist/codeBlock/index.js +2 -2
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +2 -2
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/command/index.mjs.map +1 -1
- package/dist/commonTypes-189mW5eB.d.mts +8 -0
- package/dist/commonTypes-189mW5eB.d.ts +8 -0
- package/dist/commonTypes-DUY2LJm1.d.mts +3 -0
- package/dist/commonTypes-DUY2LJm1.d.ts +3 -0
- package/dist/commonTypes-D_7LV7Ri.d.mts +5 -0
- package/dist/commonTypes-D_7LV7Ri.d.ts +5 -0
- package/dist/dataTable/index.js +2 -2
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +2 -2
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +1 -1
- package/dist/datePicker/index.d.ts +1 -1
- package/dist/datePicker/index.js +3 -3
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +3 -3
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +2 -2
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +2 -2
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/dropdownMenu/index.d.mts +6 -1
- package/dist/dropdownMenu/index.d.ts +6 -1
- package/dist/dropdownMenu/index.js +29 -6
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +29 -6
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +7 -5
- package/dist/elements/index.d.ts +7 -5
- package/dist/elements/index.js +546 -531
- package/dist/elements/index.mjs +5 -5
- package/dist/fileDropzone/index.d.mts +2 -2
- package/dist/fileDropzone/index.d.ts +2 -2
- package/dist/fileDropzone/index.js +2 -2
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +2 -2
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/fileUploader/index.d.mts +2 -2
- package/dist/fileUploader/index.d.ts +2 -2
- package/dist/glow/index.d.mts +3 -3
- package/dist/glow/index.d.ts +3 -3
- package/dist/hooks/index.d.mts +8 -1
- package/dist/hooks/index.d.ts +8 -1
- package/dist/hooks/index.js +35 -0
- package/dist/hooks/index.mjs +5 -1
- package/dist/index.css +0 -91
- package/dist/index.d.mts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +1020 -959
- package/dist/index.mjs +971 -912
- package/dist/input/index.d.mts +2 -9
- package/dist/input/index.d.ts +2 -9
- package/dist/interfaceSettings/index.js +160 -117
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +160 -117
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/label/index.d.mts +1 -2
- package/dist/label/index.d.ts +1 -2
- package/dist/layout/index.d.mts +3 -1
- package/dist/layout/index.d.ts +3 -1
- package/dist/layout/index.js +14 -3
- package/dist/layout/index.mjs +14 -3
- package/dist/navigationMenu/index.d.mts +2 -1
- package/dist/navigationMenu/index.d.ts +2 -1
- package/dist/pagination/index.d.mts +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/phoneInput/index.d.mts +1 -1
- package/dist/phoneInput/index.d.ts +1 -1
- package/dist/progress/index.d.mts +8 -1
- package/dist/progress/index.d.ts +8 -1
- package/dist/radio/index.d.mts +15 -1
- package/dist/radio/index.d.ts +15 -1
- package/dist/radio/index.js +160 -117
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +160 -117
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/separator/index.d.mts +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/signature/index.d.mts +1 -2
- package/dist/signature/index.d.ts +1 -2
- package/dist/simpleTable/index.d.mts +1 -1
- package/dist/simpleTable/index.d.ts +1 -1
- package/dist/sonner/index.d.mts +1 -1
- package/dist/sonner/index.d.ts +1 -1
- package/dist/sortButton/index.js +2 -2
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +2 -2
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +3 -9
- package/dist/splitButton/index.d.ts +3 -9
- package/dist/splitButton/index.js +2 -2
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +2 -2
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/switch/index.d.mts +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/tabs/index.d.mts +4 -2
- package/dist/tabs/index.d.ts +4 -2
- package/dist/tabs/index.js +123 -174
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +118 -169
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/toaster/index.d.mts +4 -22
- package/dist/toaster/index.d.ts +4 -22
- package/dist/tooltip/index.d.mts +4 -3
- package/dist/tooltip/index.d.ts +4 -3
- package/package.json +1 -1
- package/dist/Label-UbMDLtJF.d.mts +0 -14
- package/dist/Label-UbMDLtJF.d.ts +0 -14
- package/dist/chunk-WDCKXU54.mjs +0 -303
- package/dist/commonTypes-CgDwjGvU.d.mts +0 -5
- package/dist/commonTypes-CgDwjGvU.d.ts +0 -5
- package/dist/commonTypes-DZdITB5m.d.mts +0 -4
- package/dist/commonTypes-DZdITB5m.d.ts +0 -4
- package/dist/floatBox/index.d.mts +0 -15
- package/dist/floatBox/index.d.ts +0 -15
- package/dist/floatBox/index.js +0 -105
- package/dist/floatBox/index.js.map +0 -1
- package/dist/floatBox/index.mjs +0 -69
- package/dist/floatBox/index.mjs.map +0 -1
@@ -0,0 +1,346 @@
|
|
1
|
+
"use client";
|
2
|
+
import {
|
3
|
+
HelperText,
|
4
|
+
Label,
|
5
|
+
cn
|
6
|
+
} from "./chunk-CTNKKP2O.mjs";
|
7
|
+
|
8
|
+
// elements/popover/Popover.tsx
|
9
|
+
import * as React from "react";
|
10
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
11
|
+
var PopoverContent = React.forwardRef(
|
12
|
+
({ className, align = "center", sideOffset = 4, container, ...props }, ref) => /* @__PURE__ */ React.createElement(PopoverPrimitive.Portal, { container }, /* @__PURE__ */ React.createElement(
|
13
|
+
PopoverPrimitive.Content,
|
14
|
+
{
|
15
|
+
ref,
|
16
|
+
align,
|
17
|
+
sideOffset,
|
18
|
+
className: cn(
|
19
|
+
"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",
|
20
|
+
className
|
21
|
+
),
|
22
|
+
...props
|
23
|
+
}
|
24
|
+
))
|
25
|
+
);
|
26
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
27
|
+
var Popover = ({
|
28
|
+
trigger,
|
29
|
+
children,
|
30
|
+
className,
|
31
|
+
align = "center",
|
32
|
+
side,
|
33
|
+
sideOffset = 4,
|
34
|
+
open,
|
35
|
+
width = "default",
|
36
|
+
disableTrigger,
|
37
|
+
contentProps,
|
38
|
+
triggerProps,
|
39
|
+
...props
|
40
|
+
}) => {
|
41
|
+
let widthStyles = {
|
42
|
+
trigger: "var(--radix-popover-trigger-width)",
|
43
|
+
default: "auto"
|
44
|
+
};
|
45
|
+
return /* @__PURE__ */ React.createElement(PopoverPrimitive.Root, { open, ...props }, /* @__PURE__ */ React.createElement(
|
46
|
+
PopoverPrimitive.Trigger,
|
47
|
+
{
|
48
|
+
className: "hawa-w-full",
|
49
|
+
disabled: disableTrigger,
|
50
|
+
...triggerProps
|
51
|
+
},
|
52
|
+
trigger
|
53
|
+
), /* @__PURE__ */ React.createElement(
|
54
|
+
PopoverContent,
|
55
|
+
{
|
56
|
+
side,
|
57
|
+
className,
|
58
|
+
align,
|
59
|
+
sideOffset,
|
60
|
+
style: {
|
61
|
+
width: widthStyles[width],
|
62
|
+
maxWidth: "var(--radix-popover-content-available-width)",
|
63
|
+
maxHeight: "var(--radix-popover-content-available-height)"
|
64
|
+
},
|
65
|
+
...contentProps
|
66
|
+
},
|
67
|
+
children
|
68
|
+
));
|
69
|
+
};
|
70
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
71
|
+
var PopoverRoot = PopoverPrimitive.Root;
|
72
|
+
|
73
|
+
// elements/radio/Radio.tsx
|
74
|
+
import React2, { useState, useRef, useEffect, forwardRef as forwardRef2 } from "react";
|
75
|
+
var Radio = forwardRef2(
|
76
|
+
({
|
77
|
+
design = "default",
|
78
|
+
width = "default",
|
79
|
+
size = "default",
|
80
|
+
orientation = "horizontal",
|
81
|
+
name,
|
82
|
+
labelProps,
|
83
|
+
tabsContainerClassName,
|
84
|
+
forceHideHelperText = false,
|
85
|
+
onChange,
|
86
|
+
containerClassNames,
|
87
|
+
...props
|
88
|
+
}, ref) => {
|
89
|
+
var _a, _b, _c;
|
90
|
+
let activeTabStyle = "hawa-inline-block hawa-w-full hawa-text-primary-foreground hawa-bg-primary hawa-active dark:hawa-bg-primary";
|
91
|
+
let inactiveTabStyle = `hawa-inline-block hawa-w-full hawa-transition-all hawa-bg-primary-foreground dark:hover:hawa-text-white
|
92
|
+
${props.disabled ? "" : "hover:hawa-bg-muted"}`;
|
93
|
+
let orientationStyle = {
|
94
|
+
horizontal: "hawa-flex hawa-flex-row",
|
95
|
+
vertical: "hawa-flex hawa-flex-col"
|
96
|
+
};
|
97
|
+
let tabSizeStyle = {
|
98
|
+
default: "hawa-py-2 hawa-px-4 hawa-text-sm",
|
99
|
+
lg: "hawa-py-2 hawa-px-4",
|
100
|
+
sm: "hawa-p-1.5 hawa-text-xs",
|
101
|
+
xs: "hawa-p-1 hawa-text-[10px]"
|
102
|
+
};
|
103
|
+
let widthStyle = {
|
104
|
+
none: "",
|
105
|
+
default: "hawa-max-w-fit",
|
106
|
+
full: "hawa-w-full"
|
107
|
+
};
|
108
|
+
const [parentDirection, setParentDirection] = React2.useState(
|
109
|
+
null
|
110
|
+
);
|
111
|
+
const [selectedOption, setSelectedOption] = useState(
|
112
|
+
props.defaultValue || props.value
|
113
|
+
);
|
114
|
+
const [openTooltip, setOpenTooltip] = useState(null);
|
115
|
+
const parentRef = useRef(null);
|
116
|
+
useEffect(() => {
|
117
|
+
var _a2;
|
118
|
+
const parentNode = (_a2 = parentRef.current) == null ? void 0 : _a2.parentNode;
|
119
|
+
if (parentNode) {
|
120
|
+
const dir = window.getComputedStyle(parentNode).direction;
|
121
|
+
setParentDirection(dir);
|
122
|
+
}
|
123
|
+
});
|
124
|
+
const handleChange = (opt) => {
|
125
|
+
setSelectedOption(opt.value);
|
126
|
+
if (onChange) {
|
127
|
+
onChange(opt.value);
|
128
|
+
} else {
|
129
|
+
console.log("onChange was not provided");
|
130
|
+
}
|
131
|
+
};
|
132
|
+
const radio_option_tabs_styling = [
|
133
|
+
"hawa-w-full hawa-last hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 ",
|
134
|
+
!props.disabled && "hawa-cursor-pointer",
|
135
|
+
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
136
|
+
orientation === "horizontal" && parentDirection === "rtl" && "hawa-rounded-none first:hawa-rounded-r last:hawa-rounded-l",
|
137
|
+
orientation === "vertical" && "hawa-rounded-none first:hawa-rounded-t last:hawa-rounded-b",
|
138
|
+
tabSizeStyle[size]
|
139
|
+
];
|
140
|
+
switch (design) {
|
141
|
+
case "tabs":
|
142
|
+
return /* @__PURE__ */ React2.createElement(
|
143
|
+
"div",
|
144
|
+
{
|
145
|
+
className: cn(
|
146
|
+
"hawa-gap-2 hawa-flex hawa-flex-col",
|
147
|
+
containerClassNames == null ? void 0 : containerClassNames.tabs
|
148
|
+
)
|
149
|
+
},
|
150
|
+
props.label && /* @__PURE__ */ React2.createElement(Label, { ...labelProps }, props.label),
|
151
|
+
/* @__PURE__ */ React2.createElement(
|
152
|
+
"ul",
|
153
|
+
{
|
154
|
+
ref: parentRef,
|
155
|
+
className: cn(
|
156
|
+
props.options && ((_a = props.options) == null ? void 0 : _a.length) > 2 ? "hawa-flex-wrap xs:hawa-max-w-full xs:hawa-flex-nowrap" : "",
|
157
|
+
"hawa-select-none hawa-whitespace-nowrap hawa-rounded hawa-border hawa-text-center hawa-font-medium hawa-h-[40px]",
|
158
|
+
orientationStyle[orientation],
|
159
|
+
widthStyle[width],
|
160
|
+
tabsContainerClassName
|
161
|
+
)
|
162
|
+
},
|
163
|
+
(_b = props.options) == null ? void 0 : _b.map((opt, o) => {
|
164
|
+
return opt.tooltip ? /* @__PURE__ */ React2.createElement(
|
165
|
+
PopoverRoot,
|
166
|
+
{
|
167
|
+
key: o,
|
168
|
+
open: o === openTooltip,
|
169
|
+
onOpenChange: (bool) => setOpenTooltip(bool ? o : null)
|
170
|
+
},
|
171
|
+
/* @__PURE__ */ React2.createElement(
|
172
|
+
PopoverTrigger,
|
173
|
+
{
|
174
|
+
onMouseEnter: () => setOpenTooltip(o),
|
175
|
+
onMouseLeave: () => setOpenTooltip(null),
|
176
|
+
asChild: true
|
177
|
+
},
|
178
|
+
/* @__PURE__ */ React2.createElement(
|
179
|
+
"li",
|
180
|
+
{
|
181
|
+
"aria-current": "page",
|
182
|
+
onClick: () => {
|
183
|
+
if (props.disabled || opt.disabled)
|
184
|
+
return;
|
185
|
+
handleChange(opt);
|
186
|
+
},
|
187
|
+
className: cn(
|
188
|
+
...radio_option_tabs_styling,
|
189
|
+
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
190
|
+
)
|
191
|
+
},
|
192
|
+
opt.icon && opt.icon,
|
193
|
+
opt.label
|
194
|
+
)
|
195
|
+
),
|
196
|
+
/* @__PURE__ */ React2.createElement(PopoverContent, { ...opt.tooltipContentProps }, opt.tooltip)
|
197
|
+
) : /* @__PURE__ */ React2.createElement(
|
198
|
+
"li",
|
199
|
+
{
|
200
|
+
key: o,
|
201
|
+
"aria-current": "page",
|
202
|
+
onClick: () => {
|
203
|
+
if (props.disabled || opt.disabled)
|
204
|
+
return;
|
205
|
+
handleChange(opt);
|
206
|
+
},
|
207
|
+
className: cn(
|
208
|
+
...radio_option_tabs_styling,
|
209
|
+
selectedOption === opt.value ? activeTabStyle : inactiveTabStyle
|
210
|
+
)
|
211
|
+
},
|
212
|
+
opt.icon && opt.icon,
|
213
|
+
opt.label
|
214
|
+
);
|
215
|
+
})
|
216
|
+
),
|
217
|
+
!forceHideHelperText && /* @__PURE__ */ React2.createElement(HelperText, { helperText: props.helperText })
|
218
|
+
);
|
219
|
+
case "bordered":
|
220
|
+
return /* @__PURE__ */ React2.createElement(
|
221
|
+
"div",
|
222
|
+
{
|
223
|
+
className: cn(
|
224
|
+
orientationStyle[orientation],
|
225
|
+
"hawa-gap-4",
|
226
|
+
containerClassNames == null ? void 0 : containerClassNames.bordered
|
227
|
+
)
|
228
|
+
},
|
229
|
+
props.options && props.options.map((opt, i) => /* @__PURE__ */ React2.createElement("div", { key: i, className: "hawa-w-full hawa-rounded hawa-border" }, /* @__PURE__ */ React2.createElement(
|
230
|
+
"div",
|
231
|
+
{
|
232
|
+
className: cn(
|
233
|
+
"radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all",
|
234
|
+
props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"
|
235
|
+
),
|
236
|
+
key: i + 1
|
237
|
+
},
|
238
|
+
/* @__PURE__ */ React2.createElement(
|
239
|
+
"input",
|
240
|
+
{
|
241
|
+
disabled: opt.disabled,
|
242
|
+
id: opt.value.toString(),
|
243
|
+
type: "radio",
|
244
|
+
value: opt.value,
|
245
|
+
name,
|
246
|
+
onChange: () => handleChange(opt)
|
247
|
+
}
|
248
|
+
),
|
249
|
+
/* @__PURE__ */ React2.createElement(
|
250
|
+
"label",
|
251
|
+
{
|
252
|
+
htmlFor: opt.value.toString(),
|
253
|
+
className: cn(
|
254
|
+
"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",
|
255
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hawa-text-gray-900"
|
256
|
+
)
|
257
|
+
},
|
258
|
+
opt.label
|
259
|
+
)
|
260
|
+
)))
|
261
|
+
);
|
262
|
+
case "cards":
|
263
|
+
return /* @__PURE__ */ React2.createElement(
|
264
|
+
"ul",
|
265
|
+
{
|
266
|
+
className: cn(
|
267
|
+
orientationStyle[orientation],
|
268
|
+
"hawa-gap-4",
|
269
|
+
containerClassNames == null ? void 0 : containerClassNames.cards
|
270
|
+
)
|
271
|
+
},
|
272
|
+
(_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React2.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React2.createElement(
|
273
|
+
"input",
|
274
|
+
{
|
275
|
+
type: "radio",
|
276
|
+
id: opt.value.toString(),
|
277
|
+
name,
|
278
|
+
value: opt.value.toString(),
|
279
|
+
className: "hawa-peer hawa-hidden",
|
280
|
+
required: true,
|
281
|
+
disabled: opt.disabled
|
282
|
+
}
|
283
|
+
), /* @__PURE__ */ React2.createElement(
|
284
|
+
"label",
|
285
|
+
{
|
286
|
+
htmlFor: opt.value.toString(),
|
287
|
+
className: cn(
|
288
|
+
"hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
|
289
|
+
opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
|
290
|
+
)
|
291
|
+
},
|
292
|
+
/* @__PURE__ */ React2.createElement("div", { className: "hawa-block hawa-h-full hawa-w-full" }, /* @__PURE__ */ React2.createElement("div", { className: "hawa-w-full hawa-text-lg hawa-font-semibold" }, opt.label), /* @__PURE__ */ React2.createElement("div", { className: "hawa-w-full" }, opt.sublabel))
|
293
|
+
)))
|
294
|
+
);
|
295
|
+
default:
|
296
|
+
return /* @__PURE__ */ React2.createElement(
|
297
|
+
"div",
|
298
|
+
{
|
299
|
+
className: cn(
|
300
|
+
"hawa-flex hawa-flex-col hawa-gap-2",
|
301
|
+
containerClassNames == null ? void 0 : containerClassNames.default
|
302
|
+
)
|
303
|
+
},
|
304
|
+
props.label && /* @__PURE__ */ React2.createElement(Label, { ...labelProps }, props.label),
|
305
|
+
/* @__PURE__ */ React2.createElement("div", { className: cn(orientationStyle[orientation], "hawa-gap-2") }, props.options && props.options.map((opt, i) => /* @__PURE__ */ React2.createElement(
|
306
|
+
"div",
|
307
|
+
{
|
308
|
+
className: cn(
|
309
|
+
"radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all",
|
310
|
+
props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"
|
311
|
+
),
|
312
|
+
key: i + 1
|
313
|
+
},
|
314
|
+
/* @__PURE__ */ React2.createElement(
|
315
|
+
"input",
|
316
|
+
{
|
317
|
+
disabled: opt.disabled,
|
318
|
+
id: opt.value.toString(),
|
319
|
+
type: "radio",
|
320
|
+
value: opt.value,
|
321
|
+
name,
|
322
|
+
onChange: () => handleChange(opt)
|
323
|
+
}
|
324
|
+
),
|
325
|
+
/* @__PURE__ */ React2.createElement(
|
326
|
+
"label",
|
327
|
+
{
|
328
|
+
htmlFor: opt.value.toString(),
|
329
|
+
className: cn(
|
330
|
+
"hawa-text-sm hawa-font-medium dark:hawa-text-white",
|
331
|
+
opt.disabled ? "hawa-text-gray-400" : "hawa-cursor-pointer hawa-text-gray-900"
|
332
|
+
)
|
333
|
+
},
|
334
|
+
opt.label
|
335
|
+
)
|
336
|
+
))),
|
337
|
+
/* @__PURE__ */ React2.createElement(HelperText, { helperText: props.helperText })
|
338
|
+
);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
);
|
342
|
+
|
343
|
+
export {
|
344
|
+
Popover,
|
345
|
+
Radio
|
346
|
+
};
|
@@ -420,12 +420,12 @@ var Button = React5.forwardRef(
|
|
420
420
|
children,
|
421
421
|
labelProps,
|
422
422
|
showHelperText = false,
|
423
|
-
|
423
|
+
asInput = false,
|
424
424
|
...props
|
425
425
|
}, ref) => {
|
426
426
|
const Comp = "button";
|
427
427
|
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
428
|
-
if (
|
428
|
+
if (asInput) {
|
429
429
|
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
|
430
430
|
Comp,
|
431
431
|
{
|
@@ -1499,14 +1499,37 @@ var DropdownMenu = ({
|
|
1499
1499
|
);
|
1500
1500
|
};
|
1501
1501
|
var DropdownMenuRadio = (props) => {
|
1502
|
-
|
1503
|
-
|
1502
|
+
const ariaLabel = props.label ? `${props.label} radio group` : void 0;
|
1503
|
+
const ariaLabelledby = props.label ? `${props.label}-label` : void 0;
|
1504
|
+
return /* @__PURE__ */ React10.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React10.createElement(DropdownMenuTrigger, { asChild: true }, props.trigger), /* @__PURE__ */ React10.createElement(
|
1505
|
+
DropdownMenuContent,
|
1504
1506
|
{
|
1505
|
-
|
1506
|
-
|
1507
|
+
align: props.align,
|
1508
|
+
side: props.side,
|
1509
|
+
"aria-label": ariaLabel,
|
1510
|
+
"aria-labelledby": ariaLabelledby,
|
1511
|
+
...props.contentProps
|
1507
1512
|
},
|
1508
|
-
props.
|
1509
|
-
|
1513
|
+
props.label && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(DropdownMenuLabel, { id: `${props.label}-label` }, props.label), /* @__PURE__ */ React10.createElement(DropdownMenuSeparator, null)),
|
1514
|
+
/* @__PURE__ */ React10.createElement(
|
1515
|
+
DropdownMenuRadioGroup,
|
1516
|
+
{
|
1517
|
+
value: props.value,
|
1518
|
+
onValueChange: props.onValueChange,
|
1519
|
+
...props.radioGroupProps
|
1520
|
+
},
|
1521
|
+
props.options.map((opt, i) => /* @__PURE__ */ React10.createElement(
|
1522
|
+
DropdownMenuRadioItem,
|
1523
|
+
{
|
1524
|
+
key: i,
|
1525
|
+
...opt.props,
|
1526
|
+
value: opt.value,
|
1527
|
+
"aria-checked": props.value === opt.value
|
1528
|
+
},
|
1529
|
+
opt.label
|
1530
|
+
))
|
1531
|
+
)
|
1532
|
+
));
|
1510
1533
|
};
|
1511
1534
|
|
1512
1535
|
// icons/Emojis.tsx
|