@colisweb/rescript-toolkit 4.2.1 → 4.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -70,6 +70,7 @@ module Make = (Config: Config) => {
70
70
  isErrored: bool,
71
71
  isDirty: bool,
72
72
  isValid: bool,
73
+ setFormState: formState => unit,
73
74
  }
74
75
 
75
76
  type onSubmitAPI = {
@@ -399,6 +400,7 @@ module Make = (Config: Config) => {
399
400
  isErrored: state.formState == Errored,
400
401
  isDirty: state.formState == Dirty,
401
402
  isValid: state.formState == Valid,
403
+ setFormState: formState => send(SetFormState(formState)),
402
404
  }
403
405
 
404
406
  interface
@@ -19,6 +19,7 @@ let make = (
19
19
  ~defaultActiveIndex=0,
20
20
  ~className="",
21
21
  ~size: size=#md,
22
+ ~buttonClassName="",
22
23
  ) => {
23
24
  let isMd = size === #md
24
25
  let (activeIndex, setActiveIndex) = React.useState(() => defaultActiveIndex)
@@ -52,7 +53,7 @@ let make = (
52
53
  fn(event)
53
54
  })
54
55
  }}
55
- className={cx([activeIndex === i ? "selected" : ""])}>
56
+ className={cx([activeIndex === i ? "selected" : "", buttonClassName])}>
56
57
  {button.label}
57
58
  {button.count->Option.mapWithDefault(React.null, count => {
58
59
  <span
@@ -19,4 +19,5 @@ let make: (
19
19
  ~defaultActiveIndex: int=?,
20
20
  ~className: string=?,
21
21
  ~size: size=?,
22
+ ~buttonClassName: string=?,
22
23
  ) => React.element