@sikka/hawa 0.38.14-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 +77 -2
- package/dist/blocks/auth/index.mjs +79 -4
- package/dist/blocks/feedback/index.js +162 -119
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +5 -2
- package/dist/blocks/index.d.ts +5 -2
- package/dist/blocks/index.js +525 -450
- package/dist/blocks/index.mjs +12 -4
- package/dist/blocks/misc/index.d.mts +3 -0
- package/dist/blocks/misc/index.d.ts +3 -0
- package/dist/blocks/misc/index.js +246 -289
- package/dist/blocks/misc/index.mjs +155 -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-SL4ONYNR.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-VE7EQ6VH.mjs → chunk-GU2DOJ7Q.mjs} +106 -8
- package/dist/{chunk-RTK6REIK.mjs → chunk-QZIENYTE.mjs} +1 -1
- package/dist/{chunk-EZBHA2IL.mjs → chunk-RT2Q3SH7.mjs} +1 -1
- package/dist/{chunk-AONESDSB.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.d.mts +1 -0
- package/dist/dataTable/index.d.ts +1 -0
- package/dist/dataTable/index.js +3 -3
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +3 -3
- 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 +77 -2
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +77 -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 +13 -5
- package/dist/elements/index.d.ts +13 -5
- package/dist/elements/index.js +622 -532
- package/dist/elements/index.mjs +6 -6
- 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 +35 -4
- package/dist/index.d.ts +35 -4
- package/dist/index.js +1104 -960
- package/dist/index.mjs +1055 -913
- 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 +89 -3
- package/dist/layout/index.mjs +14 -3
- package/dist/logos/index.d.mts +5 -0
- package/dist/logos/index.d.ts +5 -0
- package/dist/logos/index.js +75 -0
- package/dist/logos/index.js.map +1 -1
- package/dist/logos/index.mjs +75 -0
- package/dist/logos/index.mjs.map +1 -1
- 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
|
{
|
@@ -695,6 +695,13 @@ var Logos = {
|
|
695
695
|
d: "M21.543 7.104c.015.211.015.423.015.636 0 6.507-4.954 14.01-14.01 14.01v-.003A13.94 13.94 0 0 1 0 19.539a9.88 9.88 0 0 0 7.287-2.041 4.93 4.93 0 0 1-4.6-3.42 4.916 4.916 0 0 0 2.223-.084A4.926 4.926 0 0 1 .96 9.167v-.062a4.887 4.887 0 0 0 2.235.616A4.928 4.928 0 0 1 1.67 3.148a13.98 13.98 0 0 0 10.15 5.144 4.929 4.929 0 0 1 8.39-4.49 9.868 9.868 0 0 0 3.128-1.196 4.941 4.941 0 0 1-2.165 2.724A9.828 9.828 0 0 0 24 4.555a10.019 10.019 0 0 1-2.457 2.549z"
|
696
696
|
}
|
697
697
|
)),
|
698
|
+
x: (props) => /* @__PURE__ */ React6.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React6.createElement("title", null, "X"), /* @__PURE__ */ React6.createElement(
|
699
|
+
"path",
|
700
|
+
{
|
701
|
+
fill: "currentColor",
|
702
|
+
d: "M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"
|
703
|
+
}
|
704
|
+
)),
|
698
705
|
instagram: (props) => /* @__PURE__ */ React6.createElement(
|
699
706
|
"svg",
|
700
707
|
{
|
@@ -783,6 +790,23 @@ var Logos = {
|
|
783
790
|
d: "M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z"
|
784
791
|
}
|
785
792
|
)),
|
793
|
+
googleplay: (props) => /* @__PURE__ */ React6.createElement(
|
794
|
+
"svg",
|
795
|
+
{
|
796
|
+
role: "img",
|
797
|
+
viewBox: "0 0 24 24",
|
798
|
+
xmlns: "http://www.w3.org/2000/svg",
|
799
|
+
...props
|
800
|
+
},
|
801
|
+
/* @__PURE__ */ React6.createElement("title", null, "Google Play"),
|
802
|
+
/* @__PURE__ */ React6.createElement(
|
803
|
+
"path",
|
804
|
+
{
|
805
|
+
fill: "currentColor",
|
806
|
+
d: "M22.018 13.298l-3.919 2.218-3.515-3.493 3.543-3.521 3.891 2.202a1.49 1.49 0 0 1 0 2.594zM1.337.924a1.486 1.486 0 0 0-.112.568v21.017c0 .217.045.419.124.6l11.155-11.087L1.337.924zm12.207 10.065l3.258-3.238L3.45.195a1.466 1.466 0 0 0-.946-.179l11.04 10.973zm0 2.067l-11 10.933c.298.036.612-.016.906-.183l13.324-7.54-3.23-3.21z"
|
807
|
+
}
|
808
|
+
)
|
809
|
+
),
|
786
810
|
apple: (props) => /* @__PURE__ */ React6.createElement("svg", { role: "img", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React6.createElement(
|
787
811
|
"path",
|
788
812
|
{
|
@@ -790,6 +814,23 @@ var Logos = {
|
|
790
814
|
fill: "currentColor"
|
791
815
|
}
|
792
816
|
)),
|
817
|
+
applestore: (props) => /* @__PURE__ */ React6.createElement(
|
818
|
+
"svg",
|
819
|
+
{
|
820
|
+
role: "img",
|
821
|
+
viewBox: "0 0 24 24",
|
822
|
+
xmlns: "http://www.w3.org/2000/svg",
|
823
|
+
...props
|
824
|
+
},
|
825
|
+
/* @__PURE__ */ React6.createElement("title", null, "App Store"),
|
826
|
+
/* @__PURE__ */ React6.createElement(
|
827
|
+
"path",
|
828
|
+
{
|
829
|
+
fill: "currentColor",
|
830
|
+
d: "M8.8086 14.9194l6.1107-11.0368c.0837-.1513.1682-.302.2437-.4584.0685-.142.1267-.2854.1646-.4403.0803-.3259.0588-.6656-.066-.9767-.1238-.3095-.3417-.5678-.6201-.7355a1.4175 1.4175 0 0 0-.921-.1924c-.3207.043-.6135.1935-.8443.4288-.1094.1118-.1996.2361-.2832.369-.092.1463-.175.2979-.259.4492l-.3864.6979-.3865-.6979c-.0837-.1515-.1667-.303-.2587-.4492-.0837-.1329-.1739-.2572-.2835-.369-.2305-.2353-.5233-.3857-.844-.429a1.4181 1.4181 0 0 0-.921.1926c-.2784.1677-.4964.426-.6203.7355-.1246.311-.1461.6508-.066.9767.038.155.0962.2984.1648.4403.0753.1564.1598.307.2437.4584l1.248 2.2543-4.8625 8.7825H2.0295c-.1676 0-.3351-.0007-.5026.0092-.1522.009-.3004.0284-.448.0714-.3108.0906-.5822.2798-.7783.548-.195.2665-.3006.5929-.3006.9279 0 .3352.1057.6612.3006.9277.196.2683.4675.4575.7782.548.1477.043.296.0623.4481.0715.1675.01.335.009.5026.009h13.0974c.0171-.0357.059-.1294.1-.2697.415-1.4151-.6156-2.843-2.0347-2.843zM3.113 18.5418l-.7922 1.5008c-.0818.1553-.1644.31-.2384.4705-.067.1458-.124.293-.1611.452-.0785.3346-.0576.6834.0645 1.0029.1212.3175.3346.583.607.7549.2727.172.5891.2416.9013.1975.3139-.044.6005-.1986.8263-.4402.1072-.1148.1954-.2424.2772-.3787.0902-.1503.1714-.3059.2535-.4612L6 19.4636c-.0896-.149-.9473-1.4704-2.887-.9218m20.5861-3.0056a1.4707 1.4707 0 0 0-.779-.5407c-.1476-.0425-.2961-.0616-.4483-.0705-.1678-.0099-.3352-.0091-.503-.0091H18.648l-4.3891-7.817c-.6655.7005-.9632 1.485-1.0773 2.1976-.1655 1.0333.0367 2.0934.546 3.0004l5.2741 9.3933c.084.1494.167.299.2591.4435.0837.131.1739.2537.2836.364.231.2323.5238.3809.8449.4232.3192.0424.643-.0244.9217-.1899.2784-.1653.4968-.4204.621-.7257.1246-.3072.146-.6425.0658-.9641-.0381-.1529-.0962-.2945-.165-.4346-.0753-.1543-.1598-.303-.2438-.4524l-1.216-2.1662h1.596c.1677 0 .3351.0009.5029-.009.1522-.009.3007-.028.4483-.0705a1.4707 1.4707 0 0 0 .779-.5407A1.5386 1.5386 0 0 0 24 16.452a1.539 1.539 0 0 0-.3009-.9158Z"
|
831
|
+
}
|
832
|
+
)
|
833
|
+
),
|
793
834
|
paypal: (props) => /* @__PURE__ */ React6.createElement("svg", { role: "img", viewBox: "0 0 24 24", ...props }, /* @__PURE__ */ React6.createElement(
|
794
835
|
"path",
|
795
836
|
{
|
@@ -822,6 +863,40 @@ var Logos = {
|
|
822
863
|
...props
|
823
864
|
},
|
824
865
|
/* @__PURE__ */ React6.createElement("path", { d: "M.057 24l1.687-6.163c-1.041-1.804-1.588-3.849-1.587-5.946.003-6.556 5.338-11.891 11.893-11.891 3.181.001 6.167 1.24 8.413 3.488 2.245 2.248 3.481 5.236 3.48 8.414-.003 6.557-5.338 11.892-11.893 11.892-1.99-.001-3.951-.5-5.688-1.448l-6.305 1.654zm6.597-3.807c1.676.995 3.276 1.591 5.392 1.592 5.448 0 9.886-4.434 9.889-9.885.002-5.462-4.415-9.89-9.881-9.892-5.452 0-9.887 4.434-9.889 9.884-.001 2.225.651 3.891 1.746 5.634l-.999 3.648 3.742-.981zm11.387-5.464c-.074-.124-.272-.198-.57-.347-.297-.149-1.758-.868-2.031-.967-.272-.099-.47-.149-.669.149-.198.297-.768.967-.941 1.165-.173.198-.347.223-.644.074-.297-.149-1.255-.462-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.521.151-.172.2-.296.3-.495.099-.198.05-.372-.025-.521-.075-.148-.669-1.611-.916-2.206-.242-.579-.487-.501-.669-.51l-.57-.01c-.198 0-.52.074-.792.372s-1.04 1.016-1.04 2.479 1.065 2.876 1.213 3.074c.149.198 2.095 3.2 5.076 4.487.709.306 1.263.489 1.694.626.712.226 1.36.194 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.695.248-1.29.173-1.414z" })
|
866
|
+
),
|
867
|
+
visa: (props) => /* @__PURE__ */ React6.createElement(
|
868
|
+
"svg",
|
869
|
+
{
|
870
|
+
role: "img",
|
871
|
+
viewBox: "0 0 24 24",
|
872
|
+
xmlns: "http://www.w3.org/2000/svg",
|
873
|
+
...props
|
874
|
+
},
|
875
|
+
/* @__PURE__ */ React6.createElement("title", null, "Visa"),
|
876
|
+
/* @__PURE__ */ React6.createElement(
|
877
|
+
"path",
|
878
|
+
{
|
879
|
+
fill: "currentColor",
|
880
|
+
d: "M9.112 8.262L5.97 15.758H3.92L2.374 9.775c-.094-.368-.175-.503-.461-.658C1.447 8.864.677 8.627 0 8.479l.046-.217h3.3a.904.904 0 01.894.764l.817 4.338 2.018-5.102zm8.033 5.049c.008-1.979-2.736-2.088-2.717-2.972.006-.269.262-.555.822-.628a3.66 3.66 0 011.913.336l.34-1.59a5.207 5.207 0 00-1.814-.333c-1.917 0-3.266 1.02-3.278 2.479-.012 1.079.963 1.68 1.698 2.04.756.367 1.01.603 1.006.931-.005.504-.602.725-1.16.734-.975.015-1.54-.263-1.992-.473l-.351 1.642c.453.208 1.289.39 2.156.398 2.037 0 3.37-1.006 3.377-2.564m5.061 2.447H24l-1.565-7.496h-1.656a.883.883 0 00-.826.55l-2.909 6.946h2.036l.405-1.12h2.488zm-2.163-2.656l1.02-2.815.588 2.815zm-8.16-4.84l-1.603 7.496H8.34l1.605-7.496z"
|
881
|
+
}
|
882
|
+
)
|
883
|
+
),
|
884
|
+
mastercard: (props) => /* @__PURE__ */ React6.createElement(
|
885
|
+
"svg",
|
886
|
+
{
|
887
|
+
role: "img",
|
888
|
+
viewBox: "0 0 24 24",
|
889
|
+
xmlns: "http://www.w3.org/2000/svg",
|
890
|
+
...props
|
891
|
+
},
|
892
|
+
/* @__PURE__ */ React6.createElement("title", null, "MasterCard"),
|
893
|
+
/* @__PURE__ */ React6.createElement(
|
894
|
+
"path",
|
895
|
+
{
|
896
|
+
fill: "currentColor",
|
897
|
+
d: "M11.343 18.031c.058.049.12.098.181.146-1.177.783-2.59 1.238-4.107 1.238C3.32 19.416 0 16.096 0 12c0-4.095 3.32-7.416 7.416-7.416 1.518 0 2.931.456 4.105 1.238-.06.051-.12.098-.165.15C9.6 7.489 8.595 9.688 8.595 12c0 2.311 1.001 4.51 2.748 6.031zm5.241-13.447c-1.52 0-2.931.456-4.105 1.238.06.051.12.098.165.15C14.4 7.489 15.405 9.688 15.405 12c0 2.31-1.001 4.507-2.748 6.031-.058.049-.12.098-.181.146 1.177.783 2.588 1.238 4.107 1.238C20.68 19.416 24 16.096 24 12c0-4.094-3.32-7.416-7.416-7.416zM12 6.174c-.096.075-.189.15-.28.231C10.156 7.764 9.169 9.765 9.169 12c0 2.236.987 4.236 2.551 5.595.09.08.185.158.28.232.096-.074.189-.152.28-.232 1.563-1.359 2.551-3.359 2.551-5.595 0-2.235-.987-4.236-2.551-5.595-.09-.08-.184-.156-.28-.231z"
|
898
|
+
}
|
899
|
+
)
|
825
900
|
)
|
826
901
|
};
|
827
902
|
|
@@ -1424,14 +1499,37 @@ var DropdownMenu = ({
|
|
1424
1499
|
);
|
1425
1500
|
};
|
1426
1501
|
var DropdownMenuRadio = (props) => {
|
1427
|
-
|
1428
|
-
|
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,
|
1429
1506
|
{
|
1430
|
-
|
1431
|
-
|
1507
|
+
align: props.align,
|
1508
|
+
side: props.side,
|
1509
|
+
"aria-label": ariaLabel,
|
1510
|
+
"aria-labelledby": ariaLabelledby,
|
1511
|
+
...props.contentProps
|
1432
1512
|
},
|
1433
|
-
props.
|
1434
|
-
|
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
|
+
));
|
1435
1533
|
};
|
1436
1534
|
|
1437
1535
|
// icons/Emojis.tsx
|