@colisweb/rescript-toolkit 1.25.3 → 1.26.3
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 +1 -1
- package/src/ui/Toolkit__Ui.res +1 -0
- package/src/ui/Toolkit__Ui_Checkbox.res +1 -1
- package/src/ui/Toolkit__Ui_Dropdown.res +3 -1
- package/src/ui/Toolkit__Ui_Dropdown.resi +1 -0
- package/src/ui/Toolkit__Ui_MultiSelect.res +13 -6
- package/src/ui/Toolkit__Ui_NativeDatePicker.res +23 -0
- package/src/ui/Toolkit__Ui_NativeDatePicker.resi +9 -0
- package/src/ui/Toolkit__Ui_Select.res +2 -2
- package/src/vendors/BsDateFns.res +3 -0
- package/src/vendors/BsReactIcons.res +6 -0
- package/src/vendors/BsSentry.res +8 -3
package/package.json
CHANGED
package/src/ui/Toolkit__Ui.res
CHANGED
|
@@ -51,7 +51,7 @@ let make = (
|
|
|
51
51
|
/>
|
|
52
52
|
<span
|
|
53
53
|
className={cx([
|
|
54
|
-
"checkmark rounded border text-white mr-3 border-neutral-300 transform transition-all ease-in-out flex items-center justify-center",
|
|
54
|
+
"checkmark rounded border text-white mr-3 border-neutral-300 transform transition-all ease-in-out flex items-center justify-center flex-shrink-0",
|
|
55
55
|
switch size {
|
|
56
56
|
| #xs => "w-4 h-4"
|
|
57
57
|
| #sm => "w-6 h-6"
|
|
@@ -11,6 +11,7 @@ let make = (
|
|
|
11
11
|
~children,
|
|
12
12
|
~dropdownClassName="",
|
|
13
13
|
~buttonClassName="",
|
|
14
|
+
~containerClassName="",
|
|
14
15
|
~defaultIsOpen=false,
|
|
15
16
|
~buttonColor: Toolkit__Ui_Button.color=#white,
|
|
16
17
|
~buttonSize: Toolkit__Ui_Button.size=#md,
|
|
@@ -53,10 +54,11 @@ let make = (
|
|
|
53
54
|
None
|
|
54
55
|
}, (isOpen, ref))
|
|
55
56
|
|
|
56
|
-
<div className="relative">
|
|
57
|
+
<div className={cx(["relative", containerClassName])}>
|
|
57
58
|
<Toolkit__Ui_Button
|
|
58
59
|
variant=buttonVariant
|
|
59
60
|
size=buttonSize
|
|
61
|
+
type_="button"
|
|
60
62
|
color=buttonColor
|
|
61
63
|
onClick={event => {
|
|
62
64
|
switch ref.current->Js.Nullable.toOption {
|
|
@@ -41,13 +41,20 @@ let make = (
|
|
|
41
41
|
position=#bottom
|
|
42
42
|
label={switch selectedOptions {
|
|
43
43
|
| [] =>
|
|
44
|
-
<
|
|
45
|
-
placeholder
|
|
46
|
-
|
|
44
|
+
<p className="flex flex-row gap-2 w-full items-center">
|
|
45
|
+
<span className="ml-1"> {placeholder} </span>
|
|
46
|
+
<span className="absolute inset-y-0 right-0 flex items-center px-2">
|
|
47
|
+
<BsReactIcons.FaAngleDown />
|
|
48
|
+
</span>
|
|
49
|
+
</p>
|
|
47
50
|
| options =>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
<div
|
|
52
|
+
className="table table-fixed w-full"
|
|
53
|
+
title={options->Array.map(({label}) => label)->Js.Array2.joinWith(", ")}>
|
|
54
|
+
<span className="table-cell truncate text-left">
|
|
55
|
+
{options->Array.map(({label}) => label)->Js.Array2.joinWith(", ")->React.string}
|
|
56
|
+
</span>
|
|
57
|
+
</div>
|
|
51
58
|
}}>
|
|
52
59
|
<div className="py-2 pl-2 pr-1">
|
|
53
60
|
{allowFilter
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@react.component
|
|
2
|
+
let make = (~onChange, ~value=?, ~id=?, ~disabled=false, ~isInvalid=false, ~className="") =>
|
|
3
|
+
<div className="relative">
|
|
4
|
+
<input
|
|
5
|
+
?id
|
|
6
|
+
value=?{value->Option.map(d => d->BsDateFns.formatWithPattern("yyyy-MM-dd"))}
|
|
7
|
+
disabled
|
|
8
|
+
ariaDisabled={disabled}
|
|
9
|
+
onChange={event => {
|
|
10
|
+
let value = ReactEvent.Form.target(event)["value"]
|
|
11
|
+
onChange(Some(Js.Date.fromString(value))->Option.keep(BsDateFns.isValid))
|
|
12
|
+
}}
|
|
13
|
+
className={cx([
|
|
14
|
+
"h-[38px] border rounded transition-all duration-150 ease-in-out py-2 pl-4 pr-8 appearance-none w-full bg-white text-gray-800 leading-tight focus:outline-none focus:shadow-none focus:border-info-500 disabled:bg-gray-200 disabled:text-gray-700 focus:z30 relative border-gray-300",
|
|
15
|
+
switch isInvalid {
|
|
16
|
+
| true => "border-danger-500 shadow-danger-500"
|
|
17
|
+
| _ => "border-gray-300"
|
|
18
|
+
},
|
|
19
|
+
className,
|
|
20
|
+
])}
|
|
21
|
+
type_="date"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
@@ -32,7 +32,7 @@ let make = (
|
|
|
32
32
|
onChange(value)
|
|
33
33
|
}}>
|
|
34
34
|
{placeholder->Option.mapWithDefault(React.null, placeholder =>
|
|
35
|
-
<option> {placeholder->React.string} </option>
|
|
35
|
+
<option value=""> {placeholder->React.string} </option>
|
|
36
36
|
)}
|
|
37
37
|
{options
|
|
38
38
|
->Array.mapWithIndex((i, (label, value, enabled)) =>
|
|
@@ -44,6 +44,6 @@ let make = (
|
|
|
44
44
|
</select>
|
|
45
45
|
<div
|
|
46
46
|
className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-800">
|
|
47
|
-
<BsReactIcons.
|
|
47
|
+
<BsReactIcons.FaAngleDown />
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
@@ -5887,3 +5887,9 @@ module GoPrimitiveDot = {
|
|
|
5887
5887
|
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
5888
5888
|
"GoPrimitiveDot"
|
|
5889
5889
|
}
|
|
5890
|
+
|
|
5891
|
+
module FaFilter = {
|
|
5892
|
+
@module("react-icons/fa") @react.component
|
|
5893
|
+
external make: (~size: int=?, ~color: string=?, ~className: string=?) => React.element =
|
|
5894
|
+
"FaFilter"
|
|
5895
|
+
}
|
package/src/vendors/BsSentry.res
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
module Sentry = {
|
|
2
2
|
// init
|
|
3
3
|
type initOptions
|
|
4
|
+
type integration
|
|
5
|
+
|
|
6
|
+
@module("@sentry/tracing") @as("Integrations") @new
|
|
7
|
+
external browserTracing: unit => integration = "BrowserTracing"
|
|
4
8
|
|
|
5
9
|
@obj
|
|
6
10
|
external initOptions: (
|
|
@@ -8,6 +12,7 @@ module Sentry = {
|
|
|
8
12
|
~environment: string,
|
|
9
13
|
~beforeSend: ('a, 'b) => 'c=?,
|
|
10
14
|
~ignoreErrors: array<string>=?,
|
|
15
|
+
~integrations: array<integration>=?,
|
|
11
16
|
unit,
|
|
12
17
|
) => initOptions = ""
|
|
13
18
|
|
|
@@ -37,9 +42,9 @@ module Sentry = {
|
|
|
37
42
|
module Scope = {
|
|
38
43
|
type t
|
|
39
44
|
|
|
40
|
-
@
|
|
41
|
-
@
|
|
42
|
-
@
|
|
45
|
+
@send external setExtra: (t, string, 'a) => unit = "setExtra"
|
|
46
|
+
@send external setTag: (t, string, 'a) => unit = "setTag"
|
|
47
|
+
@send external setUser: (t, 'a) => unit = "setUser"
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
// withScope
|