@asdp/ferryui 0.1.22-dev.9214 → 0.1.22-dev.9233
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/index.js +75 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3341,7 +3341,8 @@ var InputDynamic = ({
|
|
|
3341
3341
|
const getPhoneAppearanceClass = () => {
|
|
3342
3342
|
if (appearance === "underline") return styles.phoneInputUnderline;
|
|
3343
3343
|
if (appearance === "filled-darker") return styles.phoneInputFilledDarker;
|
|
3344
|
-
if (appearance === "filled-lighter")
|
|
3344
|
+
if (appearance === "filled-lighter")
|
|
3345
|
+
return styles.phoneInputFilledLighter;
|
|
3345
3346
|
return "";
|
|
3346
3347
|
};
|
|
3347
3348
|
const phoneAppearanceClass = getPhoneAppearanceClass();
|
|
@@ -3374,9 +3375,21 @@ var InputDynamic = ({
|
|
|
3374
3375
|
const fontSizeValuePhoneInput = size == "small" ? tokens.fontSizeBase200 : size === "medium" ? tokens.fontSizeBase300 : tokens.fontSizeBase400;
|
|
3375
3376
|
const phoneInputSizeStyle = {
|
|
3376
3377
|
fontSize: fontSizeValuePhoneInput,
|
|
3377
|
-
...size === "small" && {
|
|
3378
|
-
|
|
3379
|
-
|
|
3378
|
+
...size === "small" && {
|
|
3379
|
+
minHeight: "26px",
|
|
3380
|
+
height: "26px",
|
|
3381
|
+
padding: `0 ${tokens.spacingHorizontalS} 0 48px`
|
|
3382
|
+
},
|
|
3383
|
+
...size === "medium" && {
|
|
3384
|
+
minHeight: "34px",
|
|
3385
|
+
height: "34px",
|
|
3386
|
+
padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXXS} 48px`
|
|
3387
|
+
},
|
|
3388
|
+
...size === "large" && {
|
|
3389
|
+
minHeight: "40px",
|
|
3390
|
+
height: "40px",
|
|
3391
|
+
padding: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalS} ${tokens.spacingVerticalXS} 48px`
|
|
3392
|
+
}
|
|
3380
3393
|
};
|
|
3381
3394
|
if (type === "emailOrPhone") {
|
|
3382
3395
|
updateEmailOrPhoneType(field.value);
|
|
@@ -3413,7 +3426,11 @@ var InputDynamic = ({
|
|
|
3413
3426
|
"div",
|
|
3414
3427
|
{
|
|
3415
3428
|
ref: emailOrPhoneInputRef,
|
|
3416
|
-
className: mergeClasses(
|
|
3429
|
+
className: mergeClasses(
|
|
3430
|
+
styles.phoneInputWrapper,
|
|
3431
|
+
phoneAppearanceClass,
|
|
3432
|
+
error ? styles.phoneInputError : ""
|
|
3433
|
+
),
|
|
3417
3434
|
children: /* @__PURE__ */ jsx(
|
|
3418
3435
|
PhoneInput,
|
|
3419
3436
|
{
|
|
@@ -3516,7 +3533,11 @@ var InputDynamic = ({
|
|
|
3516
3533
|
"div",
|
|
3517
3534
|
{
|
|
3518
3535
|
ref: phoneInputRef,
|
|
3519
|
-
className: mergeClasses(
|
|
3536
|
+
className: mergeClasses(
|
|
3537
|
+
styles.phoneInputWrapper,
|
|
3538
|
+
phoneAppearanceClass,
|
|
3539
|
+
error ? styles.phoneInputError : ""
|
|
3540
|
+
),
|
|
3520
3541
|
children: /* @__PURE__ */ jsx(
|
|
3521
3542
|
PhoneInput,
|
|
3522
3543
|
{
|
|
@@ -3651,7 +3672,9 @@ var InputDynamic = ({
|
|
|
3651
3672
|
autoCapitalize: "off",
|
|
3652
3673
|
spellCheck: "false"
|
|
3653
3674
|
},
|
|
3654
|
-
value: (options && options.length > 0 ? options : COUNTRIES).find(
|
|
3675
|
+
value: (options && options.length > 0 ? options : COUNTRIES).find(
|
|
3676
|
+
(country) => country.value === field.value
|
|
3677
|
+
) || null,
|
|
3655
3678
|
onChange: (selectedOption) => {
|
|
3656
3679
|
field.onChange(selectedOption ? selectedOption.value : "");
|
|
3657
3680
|
if (onChange) {
|
|
@@ -3709,12 +3732,15 @@ var InputDynamic = ({
|
|
|
3709
3732
|
return /* @__PURE__ */ jsx(
|
|
3710
3733
|
"div",
|
|
3711
3734
|
{
|
|
3712
|
-
className: mergeClasses(
|
|
3735
|
+
className: mergeClasses(
|
|
3736
|
+
styles.phoneInputWrapper,
|
|
3737
|
+
phoneAppearanceClass,
|
|
3738
|
+
error ? styles.phoneInputError : ""
|
|
3739
|
+
),
|
|
3713
3740
|
children: /* @__PURE__ */ jsx(
|
|
3714
3741
|
PhoneInput,
|
|
3715
3742
|
{
|
|
3716
3743
|
...phoneInputProps,
|
|
3717
|
-
onlyCountries,
|
|
3718
3744
|
country: defaultCountry.toLowerCase(),
|
|
3719
3745
|
disabled,
|
|
3720
3746
|
disableSearchIcon: true,
|
|
@@ -4076,7 +4102,9 @@ var InputDynamic = ({
|
|
|
4076
4102
|
if (!stringValue) return true;
|
|
4077
4103
|
const detectedType = detectEmailOrPhoneStrict(stringValue);
|
|
4078
4104
|
if (detectedType === "email") {
|
|
4079
|
-
if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
|
|
4105
|
+
if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
|
|
4106
|
+
stringValue
|
|
4107
|
+
)) {
|
|
4080
4108
|
return mergedLabels.invalidEmailFormatError;
|
|
4081
4109
|
}
|
|
4082
4110
|
} else if (detectedType === "phone") {
|
|
@@ -4105,7 +4133,9 @@ var InputDynamic = ({
|
|
|
4105
4133
|
if (!stringValue) return true;
|
|
4106
4134
|
const detectedType = detectIdentityType(stringValue);
|
|
4107
4135
|
if (detectedType === "email") {
|
|
4108
|
-
if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
|
|
4136
|
+
if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
|
|
4137
|
+
stringValue
|
|
4138
|
+
)) {
|
|
4109
4139
|
return mergedLabels.invalidEmailFormatError;
|
|
4110
4140
|
}
|
|
4111
4141
|
} else if (detectedType === "phone") {
|
|
@@ -4152,29 +4182,40 @@ var InputDynamic = ({
|
|
|
4152
4182
|
}
|
|
4153
4183
|
),
|
|
4154
4184
|
renderInput(field, error?.message),
|
|
4155
|
-
helperText && !error && /* @__PURE__ */ jsxs(
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
{
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4185
|
+
helperText && !error && /* @__PURE__ */ jsxs(
|
|
4186
|
+
"div",
|
|
4187
|
+
{
|
|
4188
|
+
style: {
|
|
4189
|
+
display: "flex",
|
|
4190
|
+
alignItems: "flex-start",
|
|
4191
|
+
gap: "4px",
|
|
4192
|
+
marginTop: "4px"
|
|
4193
|
+
},
|
|
4194
|
+
children: [
|
|
4195
|
+
helperIcon && /* @__PURE__ */ jsx(
|
|
4196
|
+
Icon,
|
|
4197
|
+
{
|
|
4198
|
+
icon: helperIcon,
|
|
4199
|
+
style: {
|
|
4200
|
+
color: tokens.colorNeutralForeground3,
|
|
4201
|
+
flexShrink: 0
|
|
4202
|
+
},
|
|
4203
|
+
width: 16,
|
|
4204
|
+
height: 16
|
|
4205
|
+
}
|
|
4206
|
+
),
|
|
4207
|
+
/* @__PURE__ */ jsx(
|
|
4208
|
+
Text,
|
|
4209
|
+
{
|
|
4210
|
+
size: 200,
|
|
4211
|
+
style: { textAlign: "left" },
|
|
4212
|
+
className: styles.helperText,
|
|
4213
|
+
children: helperText
|
|
4214
|
+
}
|
|
4215
|
+
)
|
|
4216
|
+
]
|
|
4217
|
+
}
|
|
4218
|
+
)
|
|
4178
4219
|
]
|
|
4179
4220
|
}
|
|
4180
4221
|
)
|