@sikka/hawa 0.24.8-next → 0.24.10-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/{Radio-2ZwcMDWt.d.ts → Radio-K1WGpnGA.d.ts} +2 -1
- package/dist/{Radio-5ZANA8Vh.d.mts → Radio-hsrLKNxE.d.mts} +2 -1
- package/dist/blocks/feedback/index.js +18 -21
- package/dist/blocks/feedback/index.mjs +2 -2
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +22 -25
- package/dist/blocks/index.mjs +6 -6
- package/dist/blocks/pricing/index.js +21 -24
- package/dist/blocks/pricing/index.mjs +5 -5
- package/dist/{chunk-O4FANSN5.mjs → chunk-2VDIM3CP.mjs} +17 -20
- package/dist/{chunk-OT7WQYPD.mjs → chunk-4Y2FCYFW.mjs} +17 -20
- package/dist/elements/index.d.mts +2 -2
- package/dist/elements/index.d.ts +2 -2
- package/dist/elements/index.js +19 -22
- package/dist/elements/index.mjs +3 -3
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +24 -27
- package/dist/index.mjs +24 -27
- package/dist/interfaceSettings/index.js +19 -22
- package/dist/interfaceSettings/index.mjs +19 -22
- package/dist/radio/index.d.mts +2 -1
- package/dist/radio/index.d.ts +2 -1
- package/dist/radio/index.js +17 -20
- package/dist/radio/index.mjs +17 -20
- package/package.json +1 -1
package/dist/radio/index.js
CHANGED
@@ -135,8 +135,10 @@ var Radio = ({
|
|
135
135
|
width = "default",
|
136
136
|
size = "default",
|
137
137
|
orientation = "horizontal",
|
138
|
+
name,
|
138
139
|
labelProps,
|
139
140
|
tabsContainerClassName,
|
141
|
+
onChange,
|
140
142
|
...props
|
141
143
|
}) => {
|
142
144
|
var _a, _b, _c;
|
@@ -170,6 +172,14 @@ var Radio = ({
|
|
170
172
|
setParentDirection(dir);
|
171
173
|
}
|
172
174
|
});
|
175
|
+
const handleChange = (opt) => {
|
176
|
+
setSelectedOption(opt.value);
|
177
|
+
if (onChange) {
|
178
|
+
onChange(opt.value);
|
179
|
+
} else {
|
180
|
+
console.log("onChange was not provided");
|
181
|
+
}
|
182
|
+
};
|
173
183
|
switch (design) {
|
174
184
|
case "tabs":
|
175
185
|
return /* @__PURE__ */ import_react2.default.createElement(
|
@@ -188,14 +198,7 @@ var Radio = ({
|
|
188
198
|
"li",
|
189
199
|
{
|
190
200
|
"aria-current": "page",
|
191
|
-
onClick: () =>
|
192
|
-
setSelectedOption(opt.value);
|
193
|
-
if (props.onChangeTab) {
|
194
|
-
props.onChangeTab(opt);
|
195
|
-
} else {
|
196
|
-
console.log("onChangeTab was not provided");
|
197
|
-
}
|
198
|
-
},
|
201
|
+
onClick: () => handleChange(opt),
|
199
202
|
className: cn(
|
200
203
|
"hawa-w-full hawa-cursor-pointer ",
|
201
204
|
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
@@ -234,7 +237,8 @@ var Radio = ({
|
|
234
237
|
id: opt.value.toString(),
|
235
238
|
type: "radio",
|
236
239
|
value: opt.value,
|
237
|
-
name
|
240
|
+
name,
|
241
|
+
onChange: () => handleChange(opt)
|
238
242
|
}
|
239
243
|
),
|
240
244
|
/* @__PURE__ */ import_react2.default.createElement(
|
@@ -251,12 +255,12 @@ var Radio = ({
|
|
251
255
|
)
|
252
256
|
)));
|
253
257
|
case "cards":
|
254
|
-
return /* @__PURE__ */ import_react2.default.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ import_react2.default.createElement("li", { key: o }, /* @__PURE__ */ import_react2.default.createElement(
|
258
|
+
return /* @__PURE__ */ import_react2.default.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ import_react2.default.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ import_react2.default.createElement(
|
255
259
|
"input",
|
256
260
|
{
|
257
261
|
type: "radio",
|
258
262
|
id: opt.value.toString(),
|
259
|
-
name
|
263
|
+
name,
|
260
264
|
value: opt.value.toString(),
|
261
265
|
className: "hawa-peer hawa-hidden",
|
262
266
|
required: true,
|
@@ -290,15 +294,8 @@ var Radio = ({
|
|
290
294
|
id: opt.value.toString(),
|
291
295
|
type: "radio",
|
292
296
|
value: opt.value,
|
293
|
-
name
|
294
|
-
onChange: () =>
|
295
|
-
setSelectedOption(opt.value);
|
296
|
-
if (props.onChangeTab) {
|
297
|
-
props.onChangeTab(opt);
|
298
|
-
} else {
|
299
|
-
console.log("onChangeTab was not provided");
|
300
|
-
}
|
301
|
-
}
|
297
|
+
name,
|
298
|
+
onChange: () => handleChange(opt)
|
302
299
|
}
|
303
300
|
),
|
304
301
|
/* @__PURE__ */ import_react2.default.createElement(
|
package/dist/radio/index.mjs
CHANGED
@@ -96,8 +96,10 @@ var Radio = ({
|
|
96
96
|
width = "default",
|
97
97
|
size = "default",
|
98
98
|
orientation = "horizontal",
|
99
|
+
name,
|
99
100
|
labelProps,
|
100
101
|
tabsContainerClassName,
|
102
|
+
onChange,
|
101
103
|
...props
|
102
104
|
}) => {
|
103
105
|
var _a, _b, _c;
|
@@ -131,6 +133,14 @@ var Radio = ({
|
|
131
133
|
setParentDirection(dir);
|
132
134
|
}
|
133
135
|
});
|
136
|
+
const handleChange = (opt) => {
|
137
|
+
setSelectedOption(opt.value);
|
138
|
+
if (onChange) {
|
139
|
+
onChange(opt.value);
|
140
|
+
} else {
|
141
|
+
console.log("onChange was not provided");
|
142
|
+
}
|
143
|
+
};
|
134
144
|
switch (design) {
|
135
145
|
case "tabs":
|
136
146
|
return /* @__PURE__ */ React3.createElement(
|
@@ -149,14 +159,7 @@ var Radio = ({
|
|
149
159
|
"li",
|
150
160
|
{
|
151
161
|
"aria-current": "page",
|
152
|
-
onClick: () =>
|
153
|
-
setSelectedOption(opt.value);
|
154
|
-
if (props.onChangeTab) {
|
155
|
-
props.onChangeTab(opt);
|
156
|
-
} else {
|
157
|
-
console.log("onChangeTab was not provided");
|
158
|
-
}
|
159
|
-
},
|
162
|
+
onClick: () => handleChange(opt),
|
160
163
|
className: cn(
|
161
164
|
"hawa-w-full hawa-cursor-pointer ",
|
162
165
|
orientation === "horizontal" && parentDirection === "ltr" && "hawa-rounded-none first:hawa-rounded-l last:hawa-rounded-r",
|
@@ -195,7 +198,8 @@ var Radio = ({
|
|
195
198
|
id: opt.value.toString(),
|
196
199
|
type: "radio",
|
197
200
|
value: opt.value,
|
198
|
-
name
|
201
|
+
name,
|
202
|
+
onChange: () => handleChange(opt)
|
199
203
|
}
|
200
204
|
),
|
201
205
|
/* @__PURE__ */ React3.createElement(
|
@@ -212,12 +216,12 @@ var Radio = ({
|
|
212
216
|
)
|
213
217
|
)));
|
214
218
|
case "cards":
|
215
|
-
return /* @__PURE__ */ React3.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React3.createElement("li", { key: o }, /* @__PURE__ */ React3.createElement(
|
219
|
+
return /* @__PURE__ */ React3.createElement("ul", { className: cn(orientationStyle[orientation], "hawa-gap-4") }, (_c = props.options) == null ? void 0 : _c.map((opt, o) => /* @__PURE__ */ React3.createElement("li", { key: o, onClick: () => handleChange(opt) }, /* @__PURE__ */ React3.createElement(
|
216
220
|
"input",
|
217
221
|
{
|
218
222
|
type: "radio",
|
219
223
|
id: opt.value.toString(),
|
220
|
-
name
|
224
|
+
name,
|
221
225
|
value: opt.value.toString(),
|
222
226
|
className: "hawa-peer hawa-hidden",
|
223
227
|
required: true,
|
@@ -251,15 +255,8 @@ var Radio = ({
|
|
251
255
|
id: opt.value.toString(),
|
252
256
|
type: "radio",
|
253
257
|
value: opt.value,
|
254
|
-
name
|
255
|
-
onChange: () =>
|
256
|
-
setSelectedOption(opt.value);
|
257
|
-
if (props.onChangeTab) {
|
258
|
-
props.onChangeTab(opt);
|
259
|
-
} else {
|
260
|
-
console.log("onChangeTab was not provided");
|
261
|
-
}
|
262
|
-
}
|
258
|
+
name,
|
259
|
+
onChange: () => handleChange(opt)
|
263
260
|
}
|
264
261
|
),
|
265
262
|
/* @__PURE__ */ React3.createElement(
|