@colisweb/rescript-toolkit 2.31.0 → 2.33.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
|
@@ -52,6 +52,8 @@ module Array = {
|
|
|
52
52
|
let tail = array => array->Array.get(array->Array.length - 1)
|
|
53
53
|
let tailExn = array => array->Array.getExn(array->Array.length - 1)
|
|
54
54
|
let isLastIndex = (array, index) => array->Array.length - 1 == index
|
|
55
|
+
|
|
56
|
+
let flatten = array => array->Array.reduce([], (acc, value) => acc->Array.concat(value))
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
module Result = {
|
|
@@ -4,23 +4,36 @@ type status = [#success | #error | #warning | #info]
|
|
|
4
4
|
let make = (~title, ~description=?, ~status, ~className=?) =>
|
|
5
5
|
<div
|
|
6
6
|
className={cx([
|
|
7
|
-
"py-2 px-4 flex items-center",
|
|
7
|
+
"py-2 px-4 flex items-center border rounded",
|
|
8
8
|
switch status {
|
|
9
|
-
| #success => "bg-success-50"
|
|
10
|
-
| #error => "bg-danger-50"
|
|
11
|
-
| #warning => "bg-warning-50"
|
|
12
|
-
| #info => "bg-info-50"
|
|
9
|
+
| #success => "bg-success-50 border-success-500"
|
|
10
|
+
| #error => "bg-danger-50 border-danger-500"
|
|
11
|
+
| #warning => "bg-warning-50 border-warning-500"
|
|
12
|
+
| #info => "bg-info-50 border-info-500"
|
|
13
13
|
},
|
|
14
14
|
className->Option.getWithDefault(""),
|
|
15
15
|
])}>
|
|
16
16
|
{switch status {
|
|
17
|
-
| #success => <BsReactIcons.MdCheckCircle size=28 className="text-success-
|
|
17
|
+
| #success => <BsReactIcons.MdCheckCircle size=28 className="text-success-600 flex-shrink-0" />
|
|
18
18
|
| #error => <BsReactIcons.MdWarning size=28 className="text-danger-600 flex-shrink-0" />
|
|
19
|
-
| #warning => <BsReactIcons.MdWarning size=28 className="text-warning-
|
|
20
|
-
| #info => <BsReactIcons.
|
|
19
|
+
| #warning => <BsReactIcons.MdWarning size=28 className="text-warning-600 flex-shrink-0" />
|
|
20
|
+
| #info => <BsReactIcons.FaExclamationCircle size=28 className="text-info-600 flex-shrink-0" />
|
|
21
21
|
}}
|
|
22
22
|
<div className="mx-3">
|
|
23
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
className={cx([
|
|
25
|
+
description->Option.isSome ? "font-bold" : "",
|
|
26
|
+
{
|
|
27
|
+
switch status {
|
|
28
|
+
| #success => "text-success-600"
|
|
29
|
+
| #error => "text-danger-600"
|
|
30
|
+
| #warning => "text-warning-600"
|
|
31
|
+
| #info => "text-info-600"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
])}>
|
|
35
|
+
title
|
|
36
|
+
</div>
|
|
24
37
|
{description->Option.getWithDefault(React.null)}
|
|
25
38
|
</div>
|
|
26
39
|
</div>
|
|
@@ -98,14 +98,7 @@ module Core = {
|
|
|
98
98
|
|
|
99
99
|
<React.Fragment key={"tr" ++ index->Int.toString}>
|
|
100
100
|
<Toolkit__Ui_Spread props={row.getRowProps()}>
|
|
101
|
-
<tr
|
|
102
|
-
className={cx([
|
|
103
|
-
"block even:bg-gray-200",
|
|
104
|
-
{
|
|
105
|
-
open Css
|
|
106
|
-
style(list{height(5.5->rem)})
|
|
107
|
-
},
|
|
108
|
-
])}>
|
|
101
|
+
<tr className={"block even:bg-gray-200 min-h-[5.5rem]"}>
|
|
109
102
|
{row.cells
|
|
110
103
|
->Array.mapWithIndex((index, cell) =>
|
|
111
104
|
<Toolkit__Ui_Spread
|