@colisweb/rescript-toolkit 5.0.5 → 5.1.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,4 +1,8 @@
|
|
|
1
1
|
type size = [#xs | #sm | #md | #lg]
|
|
2
|
+
type variant =
|
|
3
|
+
| Default
|
|
4
|
+
| Filled
|
|
5
|
+
|
|
2
6
|
@react.component
|
|
3
7
|
let make = (
|
|
4
8
|
~value,
|
|
@@ -9,10 +13,15 @@ let make = (
|
|
|
9
13
|
~checked=?,
|
|
10
14
|
~className="",
|
|
11
15
|
~size: size=#sm,
|
|
16
|
+
~variant: variant=Default,
|
|
12
17
|
) =>
|
|
13
18
|
<label
|
|
14
19
|
className={cx([
|
|
15
|
-
"flex items-center cw-radio",
|
|
20
|
+
"flex items-center cw-radio relative",
|
|
21
|
+
switch variant {
|
|
22
|
+
| Default => "cw-radio--default"
|
|
23
|
+
| Filled => "self-start bg-neutral-100 font-medium px-2 py-1 rounded-full cw-radio--filled"
|
|
24
|
+
},
|
|
16
25
|
disabled->Option.getWithDefault(false)
|
|
17
26
|
? "cursor-not-allowed opacity-75 text-gray-600"
|
|
18
27
|
: "cursor-pointer",
|
|
@@ -32,11 +41,23 @@ let make = (
|
|
|
32
41
|
?name
|
|
33
42
|
?checked
|
|
34
43
|
/>
|
|
44
|
+
{switch variant {
|
|
45
|
+
| Default => React.null
|
|
46
|
+
| Filled =>
|
|
47
|
+
<span
|
|
48
|
+
className="cw-radio-filled-bg peer-checked:bg-primary-700 w-full h-full absolute rounded-full left-0 top-0"
|
|
49
|
+
/>
|
|
50
|
+
}}
|
|
35
51
|
<span
|
|
36
52
|
className={cx([
|
|
37
53
|
"bg-white flex-shrink-0 cw-radio-circle",
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
{
|
|
55
|
+
switch variant {
|
|
56
|
+
| Default => "peer-checked:border-primary-700 peer-checked:text-primary-700"
|
|
57
|
+
| Filled => "peer-checked:border-primary-700 peer-checked:text-white"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"checkmark rounded-full border-2 mr-2 border-neutral-700 transform transition-all ease-in-out flex items-center justify-center",
|
|
40
61
|
switch size {
|
|
41
62
|
| #xs => "w-4 h-4"
|
|
42
63
|
| #sm => "w-6 h-6"
|
|
@@ -56,5 +77,15 @@ let make = (
|
|
|
56
77
|
])}
|
|
57
78
|
/>
|
|
58
79
|
</span>
|
|
59
|
-
|
|
80
|
+
<span
|
|
81
|
+
className={cx([
|
|
82
|
+
{
|
|
83
|
+
switch variant {
|
|
84
|
+
| Default => ""
|
|
85
|
+
| Filled => "peer-checked:text-white relative pr-1"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
])}>
|
|
89
|
+
{children->Option.getWithDefault(React.null)}
|
|
90
|
+
</span>
|
|
60
91
|
</label>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
type size = [#xs | #sm | #md | #lg] // default #sm
|
|
2
|
+
type variant =
|
|
3
|
+
// default Default
|
|
4
|
+
| Default
|
|
5
|
+
| Filled
|
|
2
6
|
|
|
3
7
|
@react.component
|
|
4
8
|
let make: (
|
|
@@ -10,4 +14,5 @@ let make: (
|
|
|
10
14
|
~checked: bool=?,
|
|
11
15
|
~className: string=?,
|
|
12
16
|
~size: size=?,
|
|
17
|
+
~variant: variant=?,
|
|
13
18
|
) => React.element
|
|
@@ -6158,3 +6158,7 @@ module FaChevronCircleRight = {
|
|
|
6158
6158
|
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
6159
6159
|
"FaChevronCircleRight"
|
|
6160
6160
|
}
|
|
6161
|
+
module FaBell = {
|
|
6162
|
+
@module("react-icons/fa") @react.component
|
|
6163
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element = "FaBell"
|
|
6164
|
+
}
|