@sikka/hawa 0.31.5-next → 0.31.7-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-bhKmANMf.d.ts → Radio-3B8RZYJA.d.ts} +1 -1
- package/dist/{Radio-9MkZay6D.d.mts → Radio-L369ID7b.d.mts} +1 -1
- package/dist/blocks/auth/index.js +54 -21
- package/dist/blocks/auth/index.mjs +17 -18
- package/dist/blocks/feedback/index.js +39 -5
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +54 -21
- package/dist/blocks/index.mjs +1 -1
- package/dist/blocks/misc/index.js +39 -5
- package/dist/blocks/misc/index.mjs +1 -1
- package/dist/{chunk-6HRJIMXY.mjs → chunk-JXN2PVGT.mjs} +55 -22
- package/dist/{chunk-34LNWMOZ.mjs → chunk-WAVKQ44V.mjs} +39 -5
- package/dist/elements/index.d.mts +3 -2
- package/dist/elements/index.d.ts +3 -2
- package/dist/elements/index.js +54 -21
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +6 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +54 -21
- package/dist/index.mjs +55 -22
- package/dist/phoneInput/index.d.mts +2 -1
- package/dist/phoneInput/index.d.ts +2 -1
- package/dist/phoneInput/index.js +54 -21
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +55 -22
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +39 -5
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +39 -5
- package/dist/select/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -3119,22 +3119,56 @@ var Select = ({
|
|
3119
3119
|
props.controlClassNames
|
3120
3120
|
),
|
3121
3121
|
container: () => cn(
|
3122
|
-
"hawa-rounded",
|
3123
|
-
props.phoneCode && "hawa-
|
3122
|
+
"hawa-rounded ",
|
3123
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
3124
3124
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
3125
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
3125
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
3126
|
+
props.isMulti && "hawa-ps-0 "
|
3126
3127
|
),
|
3127
3128
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
3128
3129
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
3129
3130
|
singleValue: () => "hawa-text-foreground",
|
3130
3131
|
indicatorsContainer: () => cn(
|
3131
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
3132
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
3132
3133
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
3133
3134
|
)
|
3134
3135
|
},
|
3135
3136
|
unstyled: true,
|
3136
3137
|
autoFocus: true,
|
3137
|
-
components: props.hideIndicator ? {
|
3138
|
+
components: props.hideIndicator ? {
|
3139
|
+
Option,
|
3140
|
+
Menu,
|
3141
|
+
IndicatorsContainer: () => null
|
3142
|
+
} : {
|
3143
|
+
Option,
|
3144
|
+
Menu,
|
3145
|
+
// Control: (e) => (
|
3146
|
+
// <div
|
3147
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
3148
|
+
// {...e}
|
3149
|
+
// />
|
3150
|
+
// ),
|
3151
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react8.default.createElement(
|
3152
|
+
"div",
|
3153
|
+
{
|
3154
|
+
className: cn(
|
3155
|
+
e.className,
|
3156
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
3157
|
+
),
|
3158
|
+
...e
|
3159
|
+
}
|
3160
|
+
),
|
3161
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react8.default.createElement(
|
3162
|
+
"div",
|
3163
|
+
{
|
3164
|
+
className: cn(
|
3165
|
+
// e.className,
|
3166
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
3167
|
+
),
|
3168
|
+
...e
|
3169
|
+
}
|
3170
|
+
)
|
3171
|
+
},
|
3138
3172
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
3139
3173
|
options: props.options,
|
3140
3174
|
getOptionLabel: props.getOptionLabel,
|
@@ -3190,16 +3224,14 @@ var Select = ({
|
|
3190
3224
|
};
|
3191
3225
|
|
3192
3226
|
// elements/phoneInput/PhoneInput.tsx
|
3193
|
-
var PhoneInput = ({
|
3227
|
+
var PhoneInput = ({
|
3228
|
+
labelProps,
|
3229
|
+
inputProps,
|
3230
|
+
...props
|
3231
|
+
}) => {
|
3194
3232
|
const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
|
3195
3233
|
const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
|
3196
3234
|
const inputRef = (0, import_react9.useRef)(null);
|
3197
|
-
(0, import_react9.useEffect)(() => {
|
3198
|
-
var _a;
|
3199
|
-
if (inputRef.current) {
|
3200
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
3201
|
-
}
|
3202
|
-
}, []);
|
3203
3235
|
const handleInputChange = (e) => {
|
3204
3236
|
const validChars = /^[0-9-()]+$/;
|
3205
3237
|
const input = e.target.value;
|
@@ -3215,31 +3247,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
3215
3247
|
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react9.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react9.default.createElement(
|
3216
3248
|
Select,
|
3217
3249
|
{
|
3250
|
+
phoneCode: true,
|
3218
3251
|
width: "fit",
|
3219
3252
|
hideHelperText: true,
|
3220
|
-
phoneCode: true,
|
3221
3253
|
hideIndicator: true,
|
3222
|
-
placeholder: "Code",
|
3223
|
-
options: countries_default,
|
3224
3254
|
isMulti: false,
|
3225
3255
|
isSearchable: true,
|
3226
3256
|
isClearable: false,
|
3227
|
-
|
3257
|
+
placeholder: "Code",
|
3258
|
+
options: countries_default,
|
3259
|
+
onChange: setCountryCode,
|
3228
3260
|
value: countryCode == null ? void 0 : countryCode.label,
|
3229
|
-
|
3261
|
+
defaultValue: props.preferredCountry
|
3230
3262
|
}
|
3231
3263
|
), /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react9.default.createElement(
|
3232
3264
|
"input",
|
3233
3265
|
{
|
3266
|
+
type: "tel",
|
3234
3267
|
ref: inputRef,
|
3235
3268
|
id: "phone-number",
|
3269
|
+
value: phoneNumber,
|
3270
|
+
onChange: handleInputChange,
|
3271
|
+
placeholder: props.placeholder,
|
3236
3272
|
className: cn(
|
3237
3273
|
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
3238
3274
|
),
|
3239
|
-
|
3240
|
-
value: phoneNumber,
|
3241
|
-
type: "tel",
|
3242
|
-
placeholder: props.placeholder
|
3275
|
+
...inputProps
|
3243
3276
|
}
|
3244
3277
|
))), /* @__PURE__ */ import_react9.default.createElement(
|
3245
3278
|
"p",
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
} from "../../chunk-47APBDKK.mjs";
|
8
8
|
import {
|
9
9
|
Select
|
10
|
-
} from "../../chunk-
|
10
|
+
} from "../../chunk-WAVKQ44V.mjs";
|
11
11
|
import {
|
12
12
|
EyeIcon,
|
13
13
|
HiddenEyeIcon
|
@@ -629,7 +629,7 @@ var Alert = ({
|
|
629
629
|
};
|
630
630
|
|
631
631
|
// elements/phoneInput/PhoneInput.tsx
|
632
|
-
import React4, { useState as useState2, useRef as useRef2
|
632
|
+
import React4, { useState as useState2, useRef as useRef2 } from "react";
|
633
633
|
|
634
634
|
// countries.ts
|
635
635
|
var countries = [
|
@@ -2325,16 +2325,14 @@ var countries = [
|
|
2325
2325
|
var countries_default = countries;
|
2326
2326
|
|
2327
2327
|
// elements/phoneInput/PhoneInput.tsx
|
2328
|
-
var PhoneInput = ({
|
2328
|
+
var PhoneInput = ({
|
2329
|
+
labelProps,
|
2330
|
+
inputProps,
|
2331
|
+
...props
|
2332
|
+
}) => {
|
2329
2333
|
const [phoneNumber, setPhoneNumber] = useState2("");
|
2330
2334
|
const [countryCode, setCountryCode] = useState2(props.preferredCountry);
|
2331
2335
|
const inputRef = useRef2(null);
|
2332
|
-
useEffect2(() => {
|
2333
|
-
var _a;
|
2334
|
-
if (inputRef.current) {
|
2335
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
2336
|
-
}
|
2337
|
-
}, []);
|
2338
2336
|
const handleInputChange = (e) => {
|
2339
2337
|
const validChars = /^[0-9-()]+$/;
|
2340
2338
|
const input = e.target.value;
|
@@ -2350,31 +2348,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
2350
2348
|
return /* @__PURE__ */ React4.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React4.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React4.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React4.createElement(
|
2351
2349
|
Select,
|
2352
2350
|
{
|
2351
|
+
phoneCode: true,
|
2353
2352
|
width: "fit",
|
2354
2353
|
hideHelperText: true,
|
2355
|
-
phoneCode: true,
|
2356
2354
|
hideIndicator: true,
|
2357
|
-
placeholder: "Code",
|
2358
|
-
options: countries_default,
|
2359
2355
|
isMulti: false,
|
2360
2356
|
isSearchable: true,
|
2361
2357
|
isClearable: false,
|
2362
|
-
|
2358
|
+
placeholder: "Code",
|
2359
|
+
options: countries_default,
|
2360
|
+
onChange: setCountryCode,
|
2363
2361
|
value: countryCode == null ? void 0 : countryCode.label,
|
2364
|
-
|
2362
|
+
defaultValue: props.preferredCountry
|
2365
2363
|
}
|
2366
2364
|
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
|
2367
2365
|
"input",
|
2368
2366
|
{
|
2367
|
+
type: "tel",
|
2369
2368
|
ref: inputRef,
|
2370
2369
|
id: "phone-number",
|
2370
|
+
value: phoneNumber,
|
2371
|
+
onChange: handleInputChange,
|
2372
|
+
placeholder: props.placeholder,
|
2371
2373
|
className: cn(
|
2372
2374
|
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
2373
2375
|
),
|
2374
|
-
|
2375
|
-
value: phoneNumber,
|
2376
|
-
type: "tel",
|
2377
|
-
placeholder: props.placeholder
|
2376
|
+
...inputProps
|
2378
2377
|
}
|
2379
2378
|
))), /* @__PURE__ */ React4.createElement(
|
2380
2379
|
"p",
|
@@ -1493,22 +1493,56 @@ var Select = ({
|
|
1493
1493
|
props.controlClassNames
|
1494
1494
|
),
|
1495
1495
|
container: () => cn(
|
1496
|
-
"hawa-rounded",
|
1497
|
-
props.phoneCode && "hawa-
|
1496
|
+
"hawa-rounded ",
|
1497
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
1498
1498
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
1499
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
1499
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
1500
|
+
props.isMulti && "hawa-ps-0 "
|
1500
1501
|
),
|
1501
1502
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
1502
1503
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
1503
1504
|
singleValue: () => "hawa-text-foreground",
|
1504
1505
|
indicatorsContainer: () => cn(
|
1505
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
1506
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
1506
1507
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
1507
1508
|
)
|
1508
1509
|
},
|
1509
1510
|
unstyled: true,
|
1510
1511
|
autoFocus: true,
|
1511
|
-
components: props.hideIndicator ? {
|
1512
|
+
components: props.hideIndicator ? {
|
1513
|
+
Option,
|
1514
|
+
Menu,
|
1515
|
+
IndicatorsContainer: () => null
|
1516
|
+
} : {
|
1517
|
+
Option,
|
1518
|
+
Menu,
|
1519
|
+
// Control: (e) => (
|
1520
|
+
// <div
|
1521
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
1522
|
+
// {...e}
|
1523
|
+
// />
|
1524
|
+
// ),
|
1525
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react11.default.createElement(
|
1526
|
+
"div",
|
1527
|
+
{
|
1528
|
+
className: cn(
|
1529
|
+
e.className,
|
1530
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
1531
|
+
),
|
1532
|
+
...e
|
1533
|
+
}
|
1534
|
+
),
|
1535
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react11.default.createElement(
|
1536
|
+
"div",
|
1537
|
+
{
|
1538
|
+
className: cn(
|
1539
|
+
// e.className,
|
1540
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
1541
|
+
),
|
1542
|
+
...e
|
1543
|
+
}
|
1544
|
+
)
|
1545
|
+
},
|
1512
1546
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
1513
1547
|
options: props.options,
|
1514
1548
|
getOptionLabel: props.getOptionLabel,
|
package/dist/blocks/index.d.mts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React__default, { FC, InputHTMLAttributes } from 'react';
|
2
2
|
import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.mjs';
|
3
3
|
import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-CKtkuNFH.mjs';
|
4
|
-
import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-
|
4
|
+
import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-L369ID7b.mjs';
|
5
5
|
import { M as MenuItemType } from '../DropdownMenu-o_-MnT5h.mjs';
|
6
6
|
import '@radix-ui/react-dropdown-menu';
|
7
7
|
|
package/dist/blocks/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React__default, { FC, InputHTMLAttributes } from 'react';
|
2
2
|
import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.js';
|
3
3
|
import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-CKtkuNFH.js';
|
4
|
-
import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-
|
4
|
+
import { S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-3B8RZYJA.js';
|
5
5
|
import { M as MenuItemType } from '../DropdownMenu-p-Ha-y2R.js';
|
6
6
|
import '@radix-ui/react-dropdown-menu';
|
7
7
|
|
package/dist/blocks/index.js
CHANGED
@@ -3140,22 +3140,56 @@ var Select = ({
|
|
3140
3140
|
props.controlClassNames
|
3141
3141
|
),
|
3142
3142
|
container: () => cn(
|
3143
|
-
"hawa-rounded",
|
3144
|
-
props.phoneCode && "hawa-
|
3143
|
+
"hawa-rounded ",
|
3144
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
3145
3145
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
3146
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
3146
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
3147
|
+
props.isMulti && "hawa-ps-0 "
|
3147
3148
|
),
|
3148
3149
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
3149
3150
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
3150
3151
|
singleValue: () => "hawa-text-foreground",
|
3151
3152
|
indicatorsContainer: () => cn(
|
3152
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
3153
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
3153
3154
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
3154
3155
|
)
|
3155
3156
|
},
|
3156
3157
|
unstyled: true,
|
3157
3158
|
autoFocus: true,
|
3158
|
-
components: props.hideIndicator ? {
|
3159
|
+
components: props.hideIndicator ? {
|
3160
|
+
Option,
|
3161
|
+
Menu,
|
3162
|
+
IndicatorsContainer: () => null
|
3163
|
+
} : {
|
3164
|
+
Option,
|
3165
|
+
Menu,
|
3166
|
+
// Control: (e) => (
|
3167
|
+
// <div
|
3168
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
3169
|
+
// {...e}
|
3170
|
+
// />
|
3171
|
+
// ),
|
3172
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react8.default.createElement(
|
3173
|
+
"div",
|
3174
|
+
{
|
3175
|
+
className: cn(
|
3176
|
+
e.className,
|
3177
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
3178
|
+
),
|
3179
|
+
...e
|
3180
|
+
}
|
3181
|
+
),
|
3182
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react8.default.createElement(
|
3183
|
+
"div",
|
3184
|
+
{
|
3185
|
+
className: cn(
|
3186
|
+
// e.className,
|
3187
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
3188
|
+
),
|
3189
|
+
...e
|
3190
|
+
}
|
3191
|
+
)
|
3192
|
+
},
|
3159
3193
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
3160
3194
|
options: props.options,
|
3161
3195
|
getOptionLabel: props.getOptionLabel,
|
@@ -3211,16 +3245,14 @@ var Select = ({
|
|
3211
3245
|
};
|
3212
3246
|
|
3213
3247
|
// elements/phoneInput/PhoneInput.tsx
|
3214
|
-
var PhoneInput = ({
|
3248
|
+
var PhoneInput = ({
|
3249
|
+
labelProps,
|
3250
|
+
inputProps,
|
3251
|
+
...props
|
3252
|
+
}) => {
|
3215
3253
|
const [phoneNumber, setPhoneNumber] = (0, import_react9.useState)("");
|
3216
3254
|
const [countryCode, setCountryCode] = (0, import_react9.useState)(props.preferredCountry);
|
3217
3255
|
const inputRef = (0, import_react9.useRef)(null);
|
3218
|
-
(0, import_react9.useEffect)(() => {
|
3219
|
-
var _a;
|
3220
|
-
if (inputRef.current) {
|
3221
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
3222
|
-
}
|
3223
|
-
}, []);
|
3224
3256
|
const handleInputChange = (e) => {
|
3225
3257
|
const validChars = /^[0-9-()]+$/;
|
3226
3258
|
const input = e.target.value;
|
@@ -3236,31 +3268,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
3236
3268
|
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ import_react9.default.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ import_react9.default.createElement(
|
3237
3269
|
Select,
|
3238
3270
|
{
|
3271
|
+
phoneCode: true,
|
3239
3272
|
width: "fit",
|
3240
3273
|
hideHelperText: true,
|
3241
|
-
phoneCode: true,
|
3242
3274
|
hideIndicator: true,
|
3243
|
-
placeholder: "Code",
|
3244
|
-
options: countries_default,
|
3245
3275
|
isMulti: false,
|
3246
3276
|
isSearchable: true,
|
3247
3277
|
isClearable: false,
|
3248
|
-
|
3278
|
+
placeholder: "Code",
|
3279
|
+
options: countries_default,
|
3280
|
+
onChange: setCountryCode,
|
3249
3281
|
value: countryCode == null ? void 0 : countryCode.label,
|
3250
|
-
|
3282
|
+
defaultValue: props.preferredCountry
|
3251
3283
|
}
|
3252
3284
|
), /* @__PURE__ */ import_react9.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react9.default.createElement(
|
3253
3285
|
"input",
|
3254
3286
|
{
|
3287
|
+
type: "tel",
|
3255
3288
|
ref: inputRef,
|
3256
3289
|
id: "phone-number",
|
3290
|
+
value: phoneNumber,
|
3291
|
+
onChange: handleInputChange,
|
3292
|
+
placeholder: props.placeholder,
|
3257
3293
|
className: cn(
|
3258
3294
|
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
3259
3295
|
),
|
3260
|
-
|
3261
|
-
value: phoneNumber,
|
3262
|
-
type: "tel",
|
3263
|
-
placeholder: props.placeholder
|
3296
|
+
...inputProps
|
3264
3297
|
}
|
3265
3298
|
))), /* @__PURE__ */ import_react9.default.createElement(
|
3266
3299
|
"p",
|
package/dist/blocks/index.mjs
CHANGED
@@ -1377,22 +1377,56 @@ var Select = ({
|
|
1377
1377
|
props.controlClassNames
|
1378
1378
|
),
|
1379
1379
|
container: () => cn(
|
1380
|
-
"hawa-rounded",
|
1381
|
-
props.phoneCode && "hawa-
|
1380
|
+
"hawa-rounded ",
|
1381
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
1382
1382
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
1383
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
1383
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
1384
|
+
props.isMulti && "hawa-ps-0 "
|
1384
1385
|
),
|
1385
1386
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
1386
1387
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
1387
1388
|
singleValue: () => "hawa-text-foreground",
|
1388
1389
|
indicatorsContainer: () => cn(
|
1389
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
1390
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
1390
1391
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
1391
1392
|
)
|
1392
1393
|
},
|
1393
1394
|
unstyled: true,
|
1394
1395
|
autoFocus: true,
|
1395
|
-
components: props.hideIndicator ? {
|
1396
|
+
components: props.hideIndicator ? {
|
1397
|
+
Option,
|
1398
|
+
Menu,
|
1399
|
+
IndicatorsContainer: () => null
|
1400
|
+
} : {
|
1401
|
+
Option,
|
1402
|
+
Menu,
|
1403
|
+
// Control: (e) => (
|
1404
|
+
// <div
|
1405
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
1406
|
+
// {...e}
|
1407
|
+
// />
|
1408
|
+
// ),
|
1409
|
+
ValueContainer: (e) => /* @__PURE__ */ import_react28.default.createElement(
|
1410
|
+
"div",
|
1411
|
+
{
|
1412
|
+
className: cn(
|
1413
|
+
e.className,
|
1414
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
1415
|
+
),
|
1416
|
+
...e
|
1417
|
+
}
|
1418
|
+
),
|
1419
|
+
MultiValueContainer: (e) => /* @__PURE__ */ import_react28.default.createElement(
|
1420
|
+
"div",
|
1421
|
+
{
|
1422
|
+
className: cn(
|
1423
|
+
// e.className,
|
1424
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
1425
|
+
),
|
1426
|
+
...e
|
1427
|
+
}
|
1428
|
+
)
|
1429
|
+
},
|
1396
1430
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
1397
1431
|
options: props.options,
|
1398
1432
|
getOptionLabel: props.getOptionLabel,
|
@@ -429,22 +429,56 @@ var Select = ({
|
|
429
429
|
props.controlClassNames
|
430
430
|
),
|
431
431
|
container: () => cn(
|
432
|
-
"hawa-rounded",
|
433
|
-
props.phoneCode && "hawa-
|
432
|
+
"hawa-rounded ",
|
433
|
+
props.phoneCode && "hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[40px] ",
|
434
434
|
"hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm",
|
435
|
-
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer"
|
435
|
+
props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer",
|
436
|
+
props.isMulti && "hawa-ps-0 "
|
436
437
|
),
|
437
438
|
placeholder: () => "hawa-text-muted-foreground hawa-cursor-pointer hawa-px-1",
|
438
439
|
valueContainer: () => "hawa-text-foreground hawa-px-1 ",
|
439
440
|
singleValue: () => "hawa-text-foreground",
|
440
441
|
indicatorsContainer: () => cn(
|
441
|
-
"hawa-cursor-pointer hawa-text-muted-foreground",
|
442
|
+
"hawa-cursor-pointer hawa-text-muted-foreground hawa-absolute hawa-end-0 hawa-top-[50%] hawa-bottom-[50%] ",
|
442
443
|
props.hideIndicator ? "hawa-invisible" : "hawa-px-1"
|
443
444
|
)
|
444
445
|
},
|
445
446
|
unstyled: true,
|
446
447
|
autoFocus: true,
|
447
|
-
components: props.hideIndicator ? {
|
448
|
+
components: props.hideIndicator ? {
|
449
|
+
Option,
|
450
|
+
Menu,
|
451
|
+
IndicatorsContainer: () => null
|
452
|
+
} : {
|
453
|
+
Option,
|
454
|
+
Menu,
|
455
|
+
// Control: (e) => (
|
456
|
+
// <div
|
457
|
+
// className={cn(e.className, "hawa-flex hawa-flex-row")}
|
458
|
+
// {...e}
|
459
|
+
// />
|
460
|
+
// ),
|
461
|
+
ValueContainer: (e) => /* @__PURE__ */ React4.createElement(
|
462
|
+
"div",
|
463
|
+
{
|
464
|
+
className: cn(
|
465
|
+
e.className,
|
466
|
+
"hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
|
467
|
+
),
|
468
|
+
...e
|
469
|
+
}
|
470
|
+
),
|
471
|
+
MultiValueContainer: (e) => /* @__PURE__ */ React4.createElement(
|
472
|
+
"div",
|
473
|
+
{
|
474
|
+
className: cn(
|
475
|
+
// e.className,
|
476
|
+
"hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row"
|
477
|
+
),
|
478
|
+
...e
|
479
|
+
}
|
480
|
+
)
|
481
|
+
},
|
448
482
|
onChange: (newValue, action) => props.onChange(newValue, action),
|
449
483
|
options: props.options,
|
450
484
|
getOptionLabel: props.getOptionLabel,
|
@@ -500,7 +534,7 @@ var Select = ({
|
|
500
534
|
};
|
501
535
|
|
502
536
|
// elements/phoneInput/PhoneInput.tsx
|
503
|
-
import React5, { useState as useState2, useRef as useRef2
|
537
|
+
import React5, { useState as useState2, useRef as useRef2 } from "react";
|
504
538
|
|
505
539
|
// countries.ts
|
506
540
|
var countries = [
|
@@ -2196,16 +2230,14 @@ var countries = [
|
|
2196
2230
|
var countries_default = countries;
|
2197
2231
|
|
2198
2232
|
// elements/phoneInput/PhoneInput.tsx
|
2199
|
-
var PhoneInput = ({
|
2233
|
+
var PhoneInput = ({
|
2234
|
+
labelProps,
|
2235
|
+
inputProps,
|
2236
|
+
...props
|
2237
|
+
}) => {
|
2200
2238
|
const [phoneNumber, setPhoneNumber] = useState2("");
|
2201
2239
|
const [countryCode, setCountryCode] = useState2(props.preferredCountry);
|
2202
2240
|
const inputRef = useRef2(null);
|
2203
|
-
useEffect2(() => {
|
2204
|
-
var _a;
|
2205
|
-
if (inputRef.current) {
|
2206
|
-
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
2207
|
-
}
|
2208
|
-
}, []);
|
2209
2241
|
const handleInputChange = (e) => {
|
2210
2242
|
const validChars = /^[0-9-()]+$/;
|
2211
2243
|
const input = e.target.value;
|
@@ -2221,31 +2253,32 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
2221
2253
|
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, props.label), /* @__PURE__ */ React5.createElement("div", { dir: "ltr", className: "hawa-flex hawa-w-full hawa-flex-row" }, /* @__PURE__ */ React5.createElement(
|
2222
2254
|
Select,
|
2223
2255
|
{
|
2256
|
+
phoneCode: true,
|
2224
2257
|
width: "fit",
|
2225
2258
|
hideHelperText: true,
|
2226
|
-
phoneCode: true,
|
2227
2259
|
hideIndicator: true,
|
2228
|
-
placeholder: "Code",
|
2229
|
-
options: countries_default,
|
2230
2260
|
isMulti: false,
|
2231
2261
|
isSearchable: true,
|
2232
2262
|
isClearable: false,
|
2233
|
-
|
2263
|
+
placeholder: "Code",
|
2264
|
+
options: countries_default,
|
2265
|
+
onChange: setCountryCode,
|
2234
2266
|
value: countryCode == null ? void 0 : countryCode.label,
|
2235
|
-
|
2267
|
+
defaultValue: props.preferredCountry
|
2236
2268
|
}
|
2237
2269
|
), /* @__PURE__ */ React5.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React5.createElement(
|
2238
2270
|
"input",
|
2239
2271
|
{
|
2272
|
+
type: "tel",
|
2240
2273
|
ref: inputRef,
|
2241
2274
|
id: "phone-number",
|
2275
|
+
value: phoneNumber,
|
2276
|
+
onChange: handleInputChange,
|
2277
|
+
placeholder: props.placeholder,
|
2242
2278
|
className: cn(
|
2243
2279
|
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
2244
2280
|
),
|
2245
|
-
|
2246
|
-
value: phoneNumber,
|
2247
|
-
type: "tel",
|
2248
|
-
placeholder: props.placeholder
|
2281
|
+
...inputProps
|
2249
2282
|
}
|
2250
2283
|
))), /* @__PURE__ */ React5.createElement(
|
2251
2284
|
"p",
|