@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.d.mts CHANGED
@@ -810,6 +810,7 @@ interface InputDynamicProps<T extends FieldValues = FieldValues> {
810
810
  rows?: number;
811
811
  min?: number | string;
812
812
  max?: number | string;
813
+ onlyCountries?: string[];
813
814
  step?: number | string;
814
815
  isMultiSelect?: boolean;
815
816
  selectScrollbarColor?: string;
package/dist/index.d.ts CHANGED
@@ -810,6 +810,7 @@ interface InputDynamicProps<T extends FieldValues = FieldValues> {
810
810
  rows?: number;
811
811
  min?: number | string;
812
812
  max?: number | string;
813
+ onlyCountries?: string[];
813
814
  step?: number | string;
814
815
  isMultiSelect?: boolean;
815
816
  selectScrollbarColor?: string;
package/dist/index.js CHANGED
@@ -2766,7 +2766,8 @@ var useStyles8 = reactComponents.makeStyles({
2766
2766
  phoneInputWrapper: {
2767
2767
  width: "100%",
2768
2768
  "& .react-tel-input": {
2769
- width: "100%"
2769
+ width: "100%",
2770
+ fontFamily: reactComponents.tokens.fontFamilyBase
2770
2771
  },
2771
2772
  "& .react-tel-input .form-control": {
2772
2773
  width: "100%",
@@ -2814,6 +2815,128 @@ var useStyles8 = reactComponents.makeStyles({
2814
2815
  },
2815
2816
  "& .react-tel-input .flag-dropdown.open .selected-flag": {
2816
2817
  backgroundColor: "transparent"
2818
+ },
2819
+ // --- Country dropdown list: match react-select styling ---
2820
+ "& .react-tel-input .country-list": {
2821
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
2822
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
2823
+ boxShadow: `0 4px 11px rgba(0, 0, 0, 0.1)`,
2824
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
2825
+ margin: "4px 0 0 0",
2826
+ padding: 0,
2827
+ width: "300px",
2828
+ maxHeight: "300px",
2829
+ overflowY: "auto",
2830
+ fontFamily: reactComponents.tokens.fontFamilyBase
2831
+ },
2832
+ // Scrollbar matching react-select
2833
+ "& .react-tel-input .country-list::-webkit-scrollbar": {
2834
+ width: "8px",
2835
+ display: "block"
2836
+ },
2837
+ "& .react-tel-input .country-list::-webkit-scrollbar-track": {
2838
+ backgroundColor: reactComponents.tokens.colorNeutralBackground2,
2839
+ borderRadius: "4px"
2840
+ },
2841
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb": {
2842
+ backgroundColor: reactComponents.tokens.colorNeutralStroke2,
2843
+ borderRadius: "4px"
2844
+ },
2845
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb:hover": {
2846
+ backgroundColor: reactComponents.tokens.colorBrandBackground
2847
+ },
2848
+ "& .react-tel-input .country-list::-webkit-scrollbar-thumb:active": {
2849
+ backgroundColor: reactComponents.tokens.colorBrandBackgroundPressed
2850
+ },
2851
+ // Country option items
2852
+ "& .react-tel-input .country-list .country": {
2853
+ padding: "8px 12px",
2854
+ cursor: "pointer",
2855
+ transition: "background-color 0.15s ease",
2856
+ display: "flex",
2857
+ alignItems: "center",
2858
+ fontFamily: reactComponents.tokens.fontFamilyBase,
2859
+ fontSize: reactComponents.tokens.fontSizeBase400,
2860
+ fontWeight: reactComponents.tokens.fontWeightRegular,
2861
+ color: reactComponents.tokens.colorNeutralForeground1,
2862
+ backgroundColor: "transparent"
2863
+ },
2864
+ "& .react-tel-input .country-list .country:hover": {
2865
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1Hover
2866
+ },
2867
+ "& .react-tel-input .country-list .country.highlight": {
2868
+ backgroundColor: reactComponents.tokens.colorBrandBackground,
2869
+ color: reactComponents.tokens.colorNeutralForegroundOnBrand
2870
+ },
2871
+ "& .react-tel-input .country-list .country.highlight .dial-code": {
2872
+ color: reactComponents.tokens.colorNeutralForegroundOnBrand
2873
+ },
2874
+ "& .react-tel-input .country-list .country .country-name": {
2875
+ marginRight: "6px",
2876
+ fontFamily: reactComponents.tokens.fontFamilyBase,
2877
+ fontSize: reactComponents.tokens.fontSizeBase400,
2878
+ fontWeight: reactComponents.tokens.fontWeightRegular,
2879
+ color: "inherit"
2880
+ },
2881
+ "& .react-tel-input .country-list .country .dial-code": {
2882
+ color: reactComponents.tokens.colorNeutralForeground3,
2883
+ fontFamily: reactComponents.tokens.fontFamilyBase,
2884
+ fontSize: reactComponents.tokens.fontSizeBase400,
2885
+ fontWeight: reactComponents.tokens.fontWeightRegular
2886
+ },
2887
+ "& .react-tel-input .country-list .country .flag": {
2888
+ marginRight: "8px",
2889
+ marginTop: "2px"
2890
+ },
2891
+ // Search box - match react-select search input
2892
+ "& .react-tel-input .country-list .search": {
2893
+ position: "sticky",
2894
+ top: 0,
2895
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
2896
+ padding: "8px 12px",
2897
+ zIndex: 1
2898
+ },
2899
+ "& .react-tel-input .country-list .search-box": {
2900
+ width: "100%",
2901
+ border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
2902
+ borderRadius: reactComponents.tokens.borderRadiusMedium,
2903
+ fontFamily: reactComponents.tokens.fontFamilyBase,
2904
+ fontSize: reactComponents.tokens.fontSizeBase400,
2905
+ lineHeight: reactComponents.tokens.lineHeightBase400,
2906
+ padding: "6px 10px",
2907
+ outline: "none",
2908
+ color: reactComponents.tokens.colorNeutralForeground1,
2909
+ backgroundColor: reactComponents.tokens.colorNeutralBackground1,
2910
+ boxSizing: "border-box",
2911
+ marginLeft: 0
2912
+ },
2913
+ "& .react-tel-input .country-list .search-box:focus": {
2914
+ borderTopColor: reactComponents.tokens.colorBrandStroke1,
2915
+ borderRightColor: reactComponents.tokens.colorBrandStroke1,
2916
+ borderBottomColor: reactComponents.tokens.colorBrandStroke1,
2917
+ borderLeftColor: reactComponents.tokens.colorBrandStroke1,
2918
+ boxShadow: `0 0 0 1px ${reactComponents.tokens.colorBrandStroke1}`
2919
+ },
2920
+ "& .react-tel-input .country-list .search-box::placeholder": {
2921
+ color: reactComponents.tokens.colorNeutralForeground3,
2922
+ fontFamily: reactComponents.tokens.fontFamilyBase
2923
+ },
2924
+ // Search emoji (magnifying glass) - hide for cleaner look
2925
+ "& .react-tel-input .country-list .search-emoji": {
2926
+ display: "none"
2927
+ },
2928
+ // Divider between preferred countries and rest
2929
+ "& .react-tel-input .country-list .divider": {
2930
+ borderBottom: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`,
2931
+ marginBottom: 0,
2932
+ paddingBottom: 0
2933
+ },
2934
+ // No results message
2935
+ "& .react-tel-input .country-list .no-entries-message": {
2936
+ padding: "8px 12px",
2937
+ color: reactComponents.tokens.colorNeutralForeground3,
2938
+ fontFamily: reactComponents.tokens.fontFamilyBase,
2939
+ fontSize: reactComponents.tokens.fontSizeBase400
2817
2940
  }
2818
2941
  },
2819
2942
  // Appearance: underline
@@ -3010,6 +3133,7 @@ var InputDynamic = ({
3010
3133
  hasError = false,
3011
3134
  autoComplete,
3012
3135
  onInput,
3136
+ onlyCountries,
3013
3137
  contentAfter,
3014
3138
  onChange,
3015
3139
  language = "id",
@@ -3140,13 +3264,26 @@ var InputDynamic = ({
3140
3264
  }),
3141
3265
  placeholder: (provided) => ({
3142
3266
  ...provided,
3143
- color: reactComponents.tokens.colorNeutralForeground3
3267
+ color: reactComponents.tokens.colorNeutralForeground3,
3144
3268
  // fontSize: tokens.fontSizeBase400,
3269
+ whiteSpace: "nowrap",
3270
+ overflow: "hidden",
3271
+ textOverflow: "ellipsis"
3145
3272
  }),
3146
3273
  singleValue: (provided) => ({
3147
3274
  ...provided,
3148
- color: reactComponents.tokens.colorNeutralForeground1
3275
+ color: reactComponents.tokens.colorNeutralForeground1,
3149
3276
  // fontSize: tokens.fontSizeBase400,
3277
+ whiteSpace: "nowrap",
3278
+ overflow: "hidden",
3279
+ textOverflow: "ellipsis"
3280
+ }),
3281
+ valueContainer: (provided) => ({
3282
+ ...provided,
3283
+ flexWrap: "nowrap",
3284
+ whiteSpace: "nowrap",
3285
+ overflow: "hidden",
3286
+ textOverflow: "ellipsis"
3150
3287
  })
3151
3288
  };
3152
3289
  };
@@ -3574,6 +3711,10 @@ var InputDynamic = ({
3574
3711
  return stringVal;
3575
3712
  };
3576
3713
  const cleanedFieldValue = cleanPhoneValue(field.value || "");
3714
+ const phoneInputProps = {};
3715
+ if (onlyCountries) {
3716
+ phoneInputProps.onlyCountries = onlyCountries;
3717
+ }
3577
3718
  return /* @__PURE__ */ jsxRuntime.jsx(
3578
3719
  "div",
3579
3720
  {
@@ -3581,17 +3722,19 @@ var InputDynamic = ({
3581
3722
  children: /* @__PURE__ */ jsxRuntime.jsx(
3582
3723
  PhoneInput,
3583
3724
  {
3725
+ ...phoneInputProps,
3726
+ onlyCountries,
3584
3727
  country: defaultCountry.toLowerCase(),
3585
- value: cleanedFieldValue,
3728
+ disabled,
3729
+ disableSearchIcon: true,
3730
+ enableSearch: true,
3731
+ inputStyle: phoneInputSizeStyle,
3586
3732
  onChange: (value, data) => {
3587
3733
  const cleanedValue = cleanPhoneValue(value || "");
3588
3734
  field.onChange(cleanedValue);
3589
3735
  },
3590
3736
  placeholder: placeholder || mergedLabels.phoneDefaultPlaceholder,
3591
- disabled,
3592
- enableSearch: true,
3593
- disableSearchIcon: true,
3594
- inputStyle: phoneInputSizeStyle
3737
+ value: cleanedFieldValue
3595
3738
  }
3596
3739
  )
3597
3740
  }