@colisweb/rescript-toolkit 5.2.0 → 5.3.1

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": "5.2.0",
3
+ "version": "5.3.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -12,9 +12,11 @@ let make = (
12
12
  ~name=?,
13
13
  ~checked=?,
14
14
  ~className="",
15
+ ~contentClassName="",
15
16
  ~size: size=#sm,
16
17
  ~variant: variant=Default,
17
- ) =>
18
+ ~icon: option<module(ReactIcons.Icon)>=?,
19
+ ) => {
18
20
  <label
19
21
  className={cx([
20
22
  "flex items-center cw-radio relative",
@@ -79,13 +81,28 @@ let make = (
79
81
  </span>
80
82
  <span
81
83
  className={cx([
84
+ "flex flex-row items-center gap-2",
82
85
  {
83
86
  switch variant {
84
87
  | Default => ""
85
88
  | Filled => "peer-checked:text-white relative pr-1"
86
89
  }
87
90
  },
91
+ contentClassName,
88
92
  ])}>
93
+ {icon->Option.mapWithDefault(React.null, icon => {
94
+ let module(Icon) = icon
95
+
96
+ <Icon
97
+ size={switch size {
98
+ | #lg => 26
99
+ | #md => 24
100
+ | #sm => 20
101
+ | #xs => 16
102
+ }}
103
+ />
104
+ })}
89
105
  {children->Option.getWithDefault(React.null)}
90
106
  </span>
91
107
  </label>
108
+ }
@@ -13,6 +13,8 @@ let make: (
13
13
  ~name: string=?,
14
14
  ~checked: bool=?,
15
15
  ~className: string=?,
16
+ ~contentClassName: string=?,
16
17
  ~size: size=?,
17
18
  ~variant: variant=?,
19
+ ~icon: module(ReactIcons.Icon)=?,
18
20
  ) => React.element
@@ -8,8 +8,13 @@ type filterOption = {
8
8
  value: string,
9
9
  }
10
10
 
11
+ type sorting =
12
+ | @as("asc") Asc
13
+ | @as("desc") Desc
14
+
11
15
  type sortOption = {
12
16
  id: string,
17
+ value: sorting,
13
18
  desc: bool,
14
19
  }
15
20