@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 CHANGED
@@ -3350,7 +3350,8 @@ var InputDynamic = ({
3350
3350
  const getPhoneAppearanceClass = () => {
3351
3351
  if (appearance === "underline") return styles.phoneInputUnderline;
3352
3352
  if (appearance === "filled-darker") return styles.phoneInputFilledDarker;
3353
- if (appearance === "filled-lighter") return styles.phoneInputFilledLighter;
3353
+ if (appearance === "filled-lighter")
3354
+ return styles.phoneInputFilledLighter;
3354
3355
  return "";
3355
3356
  };
3356
3357
  const phoneAppearanceClass = getPhoneAppearanceClass();
@@ -3383,9 +3384,21 @@ var InputDynamic = ({
3383
3384
  const fontSizeValuePhoneInput = size == "small" ? reactComponents.tokens.fontSizeBase200 : size === "medium" ? reactComponents.tokens.fontSizeBase300 : reactComponents.tokens.fontSizeBase400;
3384
3385
  const phoneInputSizeStyle = {
3385
3386
  fontSize: fontSizeValuePhoneInput,
3386
- ...size === "small" && { minHeight: "26px", height: "26px", padding: `0 ${reactComponents.tokens.spacingHorizontalS} 0 48px` },
3387
- ...size === "medium" && { minHeight: "34px", height: "34px", padding: `${reactComponents.tokens.spacingVerticalXXS} ${reactComponents.tokens.spacingHorizontalS} ${reactComponents.tokens.spacingVerticalXXS} 48px` },
3388
- ...size === "large" && { minHeight: "40px", height: "40px", padding: `${reactComponents.tokens.spacingVerticalXS} ${reactComponents.tokens.spacingHorizontalS} ${reactComponents.tokens.spacingVerticalXS} 48px` }
3387
+ ...size === "small" && {
3388
+ minHeight: "26px",
3389
+ height: "26px",
3390
+ padding: `0 ${reactComponents.tokens.spacingHorizontalS} 0 48px`
3391
+ },
3392
+ ...size === "medium" && {
3393
+ minHeight: "34px",
3394
+ height: "34px",
3395
+ padding: `${reactComponents.tokens.spacingVerticalXXS} ${reactComponents.tokens.spacingHorizontalS} ${reactComponents.tokens.spacingVerticalXXS} 48px`
3396
+ },
3397
+ ...size === "large" && {
3398
+ minHeight: "40px",
3399
+ height: "40px",
3400
+ padding: `${reactComponents.tokens.spacingVerticalXS} ${reactComponents.tokens.spacingHorizontalS} ${reactComponents.tokens.spacingVerticalXS} 48px`
3401
+ }
3389
3402
  };
3390
3403
  if (type === "emailOrPhone") {
3391
3404
  updateEmailOrPhoneType(field.value);
@@ -3422,7 +3435,11 @@ var InputDynamic = ({
3422
3435
  "div",
3423
3436
  {
3424
3437
  ref: emailOrPhoneInputRef,
3425
- className: reactComponents.mergeClasses(styles.phoneInputWrapper, phoneAppearanceClass, error ? styles.phoneInputError : ""),
3438
+ className: reactComponents.mergeClasses(
3439
+ styles.phoneInputWrapper,
3440
+ phoneAppearanceClass,
3441
+ error ? styles.phoneInputError : ""
3442
+ ),
3426
3443
  children: /* @__PURE__ */ jsxRuntime.jsx(
3427
3444
  PhoneInput,
3428
3445
  {
@@ -3525,7 +3542,11 @@ var InputDynamic = ({
3525
3542
  "div",
3526
3543
  {
3527
3544
  ref: phoneInputRef,
3528
- className: reactComponents.mergeClasses(styles.phoneInputWrapper, phoneAppearanceClass, error ? styles.phoneInputError : ""),
3545
+ className: reactComponents.mergeClasses(
3546
+ styles.phoneInputWrapper,
3547
+ phoneAppearanceClass,
3548
+ error ? styles.phoneInputError : ""
3549
+ ),
3529
3550
  children: /* @__PURE__ */ jsxRuntime.jsx(
3530
3551
  PhoneInput,
3531
3552
  {
@@ -3660,7 +3681,9 @@ var InputDynamic = ({
3660
3681
  autoCapitalize: "off",
3661
3682
  spellCheck: "false"
3662
3683
  },
3663
- value: (options && options.length > 0 ? options : COUNTRIES).find((country) => country.value === field.value) || null,
3684
+ value: (options && options.length > 0 ? options : COUNTRIES).find(
3685
+ (country) => country.value === field.value
3686
+ ) || null,
3664
3687
  onChange: (selectedOption) => {
3665
3688
  field.onChange(selectedOption ? selectedOption.value : "");
3666
3689
  if (onChange) {
@@ -3718,12 +3741,15 @@ var InputDynamic = ({
3718
3741
  return /* @__PURE__ */ jsxRuntime.jsx(
3719
3742
  "div",
3720
3743
  {
3721
- className: reactComponents.mergeClasses(styles.phoneInputWrapper, phoneAppearanceClass, error ? styles.phoneInputError : ""),
3744
+ className: reactComponents.mergeClasses(
3745
+ styles.phoneInputWrapper,
3746
+ phoneAppearanceClass,
3747
+ error ? styles.phoneInputError : ""
3748
+ ),
3722
3749
  children: /* @__PURE__ */ jsxRuntime.jsx(
3723
3750
  PhoneInput,
3724
3751
  {
3725
3752
  ...phoneInputProps,
3726
- onlyCountries,
3727
3753
  country: defaultCountry.toLowerCase(),
3728
3754
  disabled,
3729
3755
  disableSearchIcon: true,
@@ -4085,7 +4111,9 @@ var InputDynamic = ({
4085
4111
  if (!stringValue) return true;
4086
4112
  const detectedType = detectEmailOrPhoneStrict(stringValue);
4087
4113
  if (detectedType === "email") {
4088
- if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
4114
+ if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
4115
+ stringValue
4116
+ )) {
4089
4117
  return mergedLabels.invalidEmailFormatError;
4090
4118
  }
4091
4119
  } else if (detectedType === "phone") {
@@ -4114,7 +4142,9 @@ var InputDynamic = ({
4114
4142
  if (!stringValue) return true;
4115
4143
  const detectedType = detectIdentityType(stringValue);
4116
4144
  if (detectedType === "email") {
4117
- if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(stringValue)) {
4145
+ if (!/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/i.test(
4146
+ stringValue
4147
+ )) {
4118
4148
  return mergedLabels.invalidEmailFormatError;
4119
4149
  }
4120
4150
  } else if (detectedType === "phone") {
@@ -4161,29 +4191,40 @@ var InputDynamic = ({
4161
4191
  }
4162
4192
  ),
4163
4193
  renderInput(field, error?.message),
4164
- helperText && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "4px", marginTop: "4px" }, children: [
4165
- helperIcon && /* @__PURE__ */ jsxRuntime.jsx(
4166
- react.Icon,
4167
- {
4168
- icon: helperIcon,
4169
- style: {
4170
- color: reactComponents.tokens.colorNeutralForeground3,
4171
- flexShrink: 0
4172
- },
4173
- width: 16,
4174
- height: 16
4175
- }
4176
- ),
4177
- /* @__PURE__ */ jsxRuntime.jsx(
4178
- reactComponents.Text,
4179
- {
4180
- size: 200,
4181
- style: { textAlign: "left" },
4182
- className: styles.helperText,
4183
- children: helperText
4184
- }
4185
- )
4186
- ] })
4194
+ helperText && !error && /* @__PURE__ */ jsxRuntime.jsxs(
4195
+ "div",
4196
+ {
4197
+ style: {
4198
+ display: "flex",
4199
+ alignItems: "flex-start",
4200
+ gap: "4px",
4201
+ marginTop: "4px"
4202
+ },
4203
+ children: [
4204
+ helperIcon && /* @__PURE__ */ jsxRuntime.jsx(
4205
+ react.Icon,
4206
+ {
4207
+ icon: helperIcon,
4208
+ style: {
4209
+ color: reactComponents.tokens.colorNeutralForeground3,
4210
+ flexShrink: 0
4211
+ },
4212
+ width: 16,
4213
+ height: 16
4214
+ }
4215
+ ),
4216
+ /* @__PURE__ */ jsxRuntime.jsx(
4217
+ reactComponents.Text,
4218
+ {
4219
+ size: 200,
4220
+ style: { textAlign: "left" },
4221
+ className: styles.helperText,
4222
+ children: helperText
4223
+ }
4224
+ )
4225
+ ]
4226
+ }
4227
+ )
4187
4228
  ]
4188
4229
  }
4189
4230
  )