@colisweb/rescript-toolkit 5.42.8 → 5.42.9

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/locale/fr.json CHANGED
@@ -199,11 +199,6 @@
199
199
  "defaultMessage": "Lundi",
200
200
  "message": "Lundi"
201
201
  },
202
- {
203
- "id": "_a7d9c2dc",
204
- "defaultMessage": "Format: +33612345678",
205
- "message": "Format: +33612345678"
206
- },
207
202
  {
208
203
  "id": "_a7e73ea4",
209
204
  "defaultMessage": "Déconnexion",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "5.42.8",
3
+ "version": "5.42.9",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -816,50 +816,31 @@ module Make = (StateLenses: Config) => {
816
816
  ~label,
817
817
  ~isOptional=false,
818
818
  ~id,
819
- ~name=?,
820
- ~placeholder=?,
821
- ~autoFocus=?,
822
- ~disabled=?,
823
- ~containerClassName="",
824
- ~isInline=false,
825
- ~inputClassName="",
826
- ~labelClassName="",
827
- ~inputContainerClassName="",
828
- ~autoComplete=?,
829
- ~allowWhiteSpace=false,
830
819
  ) =>
831
820
  <Field
832
821
  field
833
- render={({value, handleChange, validate, error, state}) => {
834
- let isInvalid = error->Option.isSome
835
-
836
- let onBlur = _ =>
837
- switch state {
838
- | Pristine => ()
839
- | _ => validate()
840
- }
822
+ render={({value, handleChange, validate, error}) => {
841
823
  <>
842
- <Toolkit__Ui_Label htmlFor=id> {label} </Toolkit__Ui_Label>
843
- <div>
844
- <Toolkit__Ui.TextInput
845
- ?autoComplete
846
- className={cx([inputClassName])}
847
- id
848
- value
849
- ?name
850
- type_={"phone"}
851
- ?disabled
852
- ?placeholder
853
- allowWhiteSpace
854
- ?autoFocus
855
- isInvalid
856
- onChangeText={handleChange}
857
- onBlur
858
- />
859
- <small className="text-neutral-600 pl-1 text-xs m">
860
- <FormattedMessage defaultMessage={"Format: +33612345678"} />
861
- </small>
862
- </div>
824
+ <Toolkit__Ui_Label
825
+ htmlFor=id
826
+ optionalMessage={isOptional
827
+ ? <FormattedMessage defaultMessage="(Optionnel)" />
828
+ : React.null}>
829
+ {label}
830
+ </Toolkit__Ui_Label>
831
+ <ReactPhoneNumberInput
832
+ international
833
+ className={cx([
834
+ "bg-white border rounded",
835
+ error->Option.isSome ? "border-danger-500" : "",
836
+ ])}
837
+ id
838
+ value
839
+ countryCallingCodeEditable={false}
840
+ defaultCountry
841
+ onChange={handleChange}
842
+ onBlur={_ => validate()}
843
+ />
863
844
  {error->Option.mapWithDefault(React.null, error => {
864
845
  <ErrorMessage error />
865
846
  })}