@asdp/ferryui 0.1.22-dev.9201 → 0.1.22-dev.9214

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.mjs CHANGED
@@ -2757,7 +2757,8 @@ var useStyles8 = makeStyles({
2757
2757
  phoneInputWrapper: {
2758
2758
  width: "100%",
2759
2759
  "& .react-tel-input": {
2760
- width: "100%"
2760
+ width: "100%",
2761
+ fontFamily: tokens.fontFamilyBase
2761
2762
  },
2762
2763
  "& .react-tel-input .form-control": {
2763
2764
  width: "100%",
@@ -2805,6 +2806,128 @@ var useStyles8 = makeStyles({
2805
2806
  },
2806
2807
  "& .react-tel-input .flag-dropdown.open .selected-flag": {
2807
2808
  backgroundColor: "transparent"
2809
+ },
2810
+ // --- Country dropdown list: match react-select styling ---
2811
+ "& .react-tel-input .country-list": {
2812
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
2813
+ borderRadius: tokens.borderRadiusMedium,
2814
+ boxShadow: `0 4px 11px rgba(0, 0, 0, 0.1)`,
2815
+ backgroundColor: tokens.colorNeutralBackground1,
2816
+ margin: "4px 0 0 0",
2817
+ padding: 0,
2818
+ width: "300px",
2819
+ maxHeight: "300px",
2820
+ overflowY: "auto",
2821
+ fontFamily: tokens.fontFamilyBase
2822
+ },
2823
+ // Scrollbar matching react-select
2824
+ "& .react-tel-input .country-list::-webkit-scrollbar": {
2825
+ width: "8px",
2826
+ display: "block"
2827
+ },
2828
+ "& .react-tel-input .country-list::-webkit-scrollbar-track": {
2829
+ backgroundColor: tokens.colorNeutralBackground2,
2830
+ borderRadius: "4px"
2831
+ },
2832
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb": {
2833
+ backgroundColor: tokens.colorNeutralStroke2,
2834
+ borderRadius: "4px"
2835
+ },
2836
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb:hover": {
2837
+ backgroundColor: tokens.colorBrandBackground
2838
+ },
2839
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb:active": {
2840
+ backgroundColor: tokens.colorBrandBackgroundPressed
2841
+ },
2842
+ // Country option items
2843
+ "& .react-tel-input .country-list .country": {
2844
+ padding: "8px 12px",
2845
+ cursor: "pointer",
2846
+ transition: "background-color 0.15s ease",
2847
+ display: "flex",
2848
+ alignItems: "center",
2849
+ fontFamily: tokens.fontFamilyBase,
2850
+ fontSize: tokens.fontSizeBase400,
2851
+ fontWeight: tokens.fontWeightRegular,
2852
+ color: tokens.colorNeutralForeground1,
2853
+ backgroundColor: "transparent"
2854
+ },
2855
+ "& .react-tel-input .country-list .country:hover": {
2856
+ backgroundColor: tokens.colorNeutralBackground1Hover
2857
+ },
2858
+ "& .react-tel-input .country-list .country.highlight": {
2859
+ backgroundColor: tokens.colorBrandBackground,
2860
+ color: tokens.colorNeutralForegroundOnBrand
2861
+ },
2862
+ "& .react-tel-input .country-list .country.highlight .dial-code": {
2863
+ color: tokens.colorNeutralForegroundOnBrand
2864
+ },
2865
+ "& .react-tel-input .country-list .country .country-name": {
2866
+ marginRight: "6px",
2867
+ fontFamily: tokens.fontFamilyBase,
2868
+ fontSize: tokens.fontSizeBase400,
2869
+ fontWeight: tokens.fontWeightRegular,
2870
+ color: "inherit"
2871
+ },
2872
+ "& .react-tel-input .country-list .country .dial-code": {
2873
+ color: tokens.colorNeutralForeground3,
2874
+ fontFamily: tokens.fontFamilyBase,
2875
+ fontSize: tokens.fontSizeBase400,
2876
+ fontWeight: tokens.fontWeightRegular
2877
+ },
2878
+ "& .react-tel-input .country-list .country .flag": {
2879
+ marginRight: "8px",
2880
+ marginTop: "2px"
2881
+ },
2882
+ // Search box - match react-select search input
2883
+ "& .react-tel-input .country-list .search": {
2884
+ position: "sticky",
2885
+ top: 0,
2886
+ backgroundColor: tokens.colorNeutralBackground1,
2887
+ padding: "8px 12px",
2888
+ zIndex: 1
2889
+ },
2890
+ "& .react-tel-input .country-list .search-box": {
2891
+ width: "100%",
2892
+ border: `1px solid ${tokens.colorNeutralStroke1}`,
2893
+ borderRadius: tokens.borderRadiusMedium,
2894
+ fontFamily: tokens.fontFamilyBase,
2895
+ fontSize: tokens.fontSizeBase400,
2896
+ lineHeight: tokens.lineHeightBase400,
2897
+ padding: "6px 10px",
2898
+ outline: "none",
2899
+ color: tokens.colorNeutralForeground1,
2900
+ backgroundColor: tokens.colorNeutralBackground1,
2901
+ boxSizing: "border-box",
2902
+ marginLeft: 0
2903
+ },
2904
+ "& .react-tel-input .country-list .search-box:focus": {
2905
+ borderTopColor: tokens.colorBrandStroke1,
2906
+ borderRightColor: tokens.colorBrandStroke1,
2907
+ borderBottomColor: tokens.colorBrandStroke1,
2908
+ borderLeftColor: tokens.colorBrandStroke1,
2909
+ boxShadow: `0 0 0 1px ${tokens.colorBrandStroke1}`
2910
+ },
2911
+ "& .react-tel-input .country-list .search-box::placeholder": {
2912
+ color: tokens.colorNeutralForeground3,
2913
+ fontFamily: tokens.fontFamilyBase
2914
+ },
2915
+ // Search emoji (magnifying glass) - hide for cleaner look
2916
+ "& .react-tel-input .country-list .search-emoji": {
2917
+ display: "none"
2918
+ },
2919
+ // Divider between preferred countries and rest
2920
+ "& .react-tel-input .country-list .divider": {
2921
+ borderBottom: `1px solid ${tokens.colorNeutralStroke1}`,
2922
+ marginBottom: 0,
2923
+ paddingBottom: 0
2924
+ },
2925
+ // No results message
2926
+ "& .react-tel-input .country-list .no-entries-message": {
2927
+ padding: "8px 12px",
2928
+ color: tokens.colorNeutralForeground3,
2929
+ fontFamily: tokens.fontFamilyBase,
2930
+ fontSize: tokens.fontSizeBase400
2808
2931
  }
2809
2932
  },
2810
2933
  // Appearance: underline
@@ -3001,6 +3124,7 @@ var InputDynamic = ({
3001
3124
  hasError = false,
3002
3125
  autoComplete,
3003
3126
  onInput,
3127
+ onlyCountries,
3004
3128
  contentAfter,
3005
3129
  onChange,
3006
3130
  language = "id",
@@ -3131,13 +3255,26 @@ var InputDynamic = ({
3131
3255
  }),
3132
3256
  placeholder: (provided) => ({
3133
3257
  ...provided,
3134
- color: tokens.colorNeutralForeground3
3258
+ color: tokens.colorNeutralForeground3,
3135
3259
  // fontSize: tokens.fontSizeBase400,
3260
+ whiteSpace: "nowrap",
3261
+ overflow: "hidden",
3262
+ textOverflow: "ellipsis"
3136
3263
  }),
3137
3264
  singleValue: (provided) => ({
3138
3265
  ...provided,
3139
- color: tokens.colorNeutralForeground1
3266
+ color: tokens.colorNeutralForeground1,
3140
3267
  // fontSize: tokens.fontSizeBase400,
3268
+ whiteSpace: "nowrap",
3269
+ overflow: "hidden",
3270
+ textOverflow: "ellipsis"
3271
+ }),
3272
+ valueContainer: (provided) => ({
3273
+ ...provided,
3274
+ flexWrap: "nowrap",
3275
+ whiteSpace: "nowrap",
3276
+ overflow: "hidden",
3277
+ textOverflow: "ellipsis"
3141
3278
  })
3142
3279
  };
3143
3280
  };
@@ -3565,6 +3702,10 @@ var InputDynamic = ({
3565
3702
  return stringVal;
3566
3703
  };
3567
3704
  const cleanedFieldValue = cleanPhoneValue(field.value || "");
3705
+ const phoneInputProps = {};
3706
+ if (onlyCountries) {
3707
+ phoneInputProps.onlyCountries = onlyCountries;
3708
+ }
3568
3709
  return /* @__PURE__ */ jsx(
3569
3710
  "div",
3570
3711
  {
@@ -3572,17 +3713,19 @@ var InputDynamic = ({
3572
3713
  children: /* @__PURE__ */ jsx(
3573
3714
  PhoneInput,
3574
3715
  {
3716
+ ...phoneInputProps,
3717
+ onlyCountries,
3575
3718
  country: defaultCountry.toLowerCase(),
3576
- value: cleanedFieldValue,
3719
+ disabled,
3720
+ disableSearchIcon: true,
3721
+ enableSearch: true,
3722
+ inputStyle: phoneInputSizeStyle,
3577
3723
  onChange: (value, data) => {
3578
3724
  const cleanedValue = cleanPhoneValue(value || "");
3579
3725
  field.onChange(cleanedValue);
3580
3726
  },
3581
3727
  placeholder: placeholder || mergedLabels.phoneDefaultPlaceholder,
3582
- disabled,
3583
- enableSearch: true,
3584
- disableSearchIcon: true,
3585
- inputStyle: phoneInputSizeStyle
3728
+ value: cleanedFieldValue
3586
3729
  }
3587
3730
  )
3588
3731
  }