basefn 1.9.1 → 1.11.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 +4 -4
- package/rescript.json +1 -1
- package/src/Basefn.res +5 -0
- package/src/Basefn.res.mjs +4 -0
- package/src/Basefn__Responsive.res.mjs +5 -5
- package/src/Basefn__Utils.res.mjs +2 -2
- package/src/Demo.res +59 -59
- package/src/Demo.res.mjs +630 -628
- package/src/Example.res +3 -3
- package/src/Example.res.mjs +48 -47
- package/src/components/Basefn__Accordion.res +5 -5
- package/src/components/Basefn__Accordion.res.mjs +25 -26
- package/src/components/Basefn__Alert.res +4 -4
- package/src/components/Basefn__Alert.res.mjs +20 -18
- package/src/components/Basefn__AlertDialog.res +5 -5
- package/src/components/Basefn__AlertDialog.res.mjs +23 -21
- package/src/components/Basefn__AppLayout.res +3 -3
- package/src/components/Basefn__AppLayout.res.mjs +25 -24
- package/src/components/Basefn__AspectRatio.res +1 -1
- package/src/components/Basefn__AspectRatio.res.mjs +2 -2
- package/src/components/Basefn__Avatar.res.mjs +3 -3
- package/src/components/Basefn__Badge.res +1 -1
- package/src/components/Basefn__Badge.res.mjs +2 -2
- package/src/components/Basefn__Breadcrumb.res +5 -5
- package/src/components/Basefn__Breadcrumb.res.mjs +14 -14
- package/src/components/Basefn__Button.res +1 -1
- package/src/components/Basefn__Button.res.mjs +10 -9
- package/src/components/Basefn__ButtonGroup.res +1 -1
- package/src/components/Basefn__ButtonGroup.res.mjs +2 -2
- package/src/components/Basefn__Card.res +3 -3
- package/src/components/Basefn__Card.res.mjs +11 -11
- package/src/components/Basefn__Checkbox.res +1 -1
- package/src/components/Basefn__Checkbox.res.mjs +7 -7
- package/src/components/Basefn__ContextMenu.res +4 -4
- package/src/components/Basefn__ContextMenu.res.mjs +22 -20
- package/src/components/Basefn__Drawer.res +5 -5
- package/src/components/Basefn__Drawer.res.mjs +22 -20
- package/src/components/Basefn__Dropdown.res +4 -4
- package/src/components/Basefn__Dropdown.res.mjs +20 -18
- package/src/components/Basefn__Grid.res.mjs +15 -14
- package/src/components/Basefn__HoverCard.res +3 -3
- package/src/components/Basefn__HoverCard.res.mjs +14 -12
- package/src/components/Basefn__Icon.res.mjs +8 -7
- package/src/components/Basefn__Input.res.mjs +4 -4
- package/src/components/Basefn__Kbd.res +2 -2
- package/src/components/Basefn__Kbd.res.mjs +5 -5
- package/src/components/Basefn__Label.res +1 -1
- package/src/components/Basefn__Label.res.mjs +4 -4
- package/src/components/Basefn__Modal.res +5 -5
- package/src/components/Basefn__Modal.res.mjs +20 -18
- package/src/components/Basefn__Popover.res +3 -3
- package/src/components/Basefn__Popover.res.mjs +15 -13
- package/src/components/Basefn__Progress.res +2 -2
- package/src/components/Basefn__Progress.res.mjs +16 -14
- package/src/components/Basefn__Radio.res +1 -1
- package/src/components/Basefn__Radio.res.mjs +7 -7
- package/src/components/Basefn__Resizable.css +156 -0
- package/src/components/Basefn__Resizable.res +318 -0
- package/src/components/Basefn__Resizable.res.mjs +343 -0
- package/src/components/Basefn__ScrollArea.res +1 -1
- package/src/components/Basefn__ScrollArea.res.mjs +2 -2
- package/src/components/Basefn__Select.res +2 -2
- package/src/components/Basefn__Select.res.mjs +7 -6
- package/src/components/Basefn__Separator.res +1 -1
- package/src/components/Basefn__Separator.res.mjs +9 -9
- package/src/components/Basefn__Sidebar.res +7 -7
- package/src/components/Basefn__Sidebar.res.mjs +28 -24
- package/src/components/Basefn__Skeleton.res.mjs +2 -2
- package/src/components/Basefn__Slider.res +4 -4
- package/src/components/Basefn__Slider.res.mjs +21 -20
- package/src/components/Basefn__Spinner.res +1 -1
- package/src/components/Basefn__Spinner.res.mjs +8 -8
- package/src/components/Basefn__Spotlight.res +22 -14
- package/src/components/Basefn__Spotlight.res.mjs +79 -65
- package/src/components/Basefn__Stepper.res +6 -6
- package/src/components/Basefn__Stepper.res.mjs +20 -24
- package/src/components/Basefn__Switch.res +1 -1
- package/src/components/Basefn__Switch.res.mjs +16 -14
- package/src/components/Basefn__Tabs.res +4 -4
- package/src/components/Basefn__Tabs.res.mjs +19 -17
- package/src/components/Basefn__Textarea.res.mjs +4 -4
- package/src/components/Basefn__ThemeToggle.res +1 -1
- package/src/components/Basefn__ThemeToggle.res.mjs +13 -10
- package/src/components/Basefn__Timeline.res +6 -6
- package/src/components/Basefn__Timeline.res.mjs +21 -21
- package/src/components/Basefn__Toast.res +4 -4
- package/src/components/Basefn__Toast.res.mjs +23 -20
- package/src/components/Basefn__Toggle.res +1 -1
- package/src/components/Basefn__Toggle.res.mjs +8 -7
- package/src/components/Basefn__ToggleGroup.res +2 -2
- package/src/components/Basefn__ToggleGroup.res.mjs +12 -10
- package/src/components/Basefn__Tooltip.res +3 -3
- package/src/components/Basefn__Tooltip.res.mjs +14 -12
- package/src/components/Basefn__Topbar.res +7 -7
- package/src/components/Basefn__Topbar.res.mjs +22 -22
- package/src/components/Basefn__Typography.res +2 -2
- package/src/components/Basefn__Typography.res.mjs +13 -13
- package/src/styles/Basefn__Theme.res.mjs +5 -5
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
4
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
5
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
6
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
7
|
|
|
6
8
|
import './Basefn__Switch.css'
|
|
7
9
|
;
|
|
@@ -27,7 +29,7 @@ function Basefn__Switch(props) {
|
|
|
27
29
|
let size = __size !== undefined ? __size : "Md";
|
|
28
30
|
let handleClick = param => {
|
|
29
31
|
if (!disabled) {
|
|
30
|
-
Xote.
|
|
32
|
+
Signal$Xote.update(checked, prev => !prev);
|
|
31
33
|
if (onChange !== undefined) {
|
|
32
34
|
return onChange();
|
|
33
35
|
} else {
|
|
@@ -41,8 +43,8 @@ function Basefn__Switch(props) {
|
|
|
41
43
|
};
|
|
42
44
|
let getSwitchClass = () => {
|
|
43
45
|
let sizeClass = size !== "Md" ? " basefn-switch--" + sizeToString(size) : "";
|
|
44
|
-
Xote.
|
|
45
|
-
if (Xote.
|
|
46
|
+
Computed$Xote.make(() => {
|
|
47
|
+
if (Signal$Xote.get(checked)) {
|
|
46
48
|
return " basefn-switch--checked";
|
|
47
49
|
} else {
|
|
48
50
|
return "";
|
|
@@ -51,26 +53,26 @@ function Basefn__Switch(props) {
|
|
|
51
53
|
let disabledClass = disabled ? " basefn-switch--disabled" : "";
|
|
52
54
|
return "basefn-switch" + sizeClass + disabledClass;
|
|
53
55
|
};
|
|
54
|
-
return
|
|
56
|
+
return XoteJSX$Xote.Elements.jsxs("label", {
|
|
55
57
|
class: getWrapperClass(),
|
|
56
|
-
children:
|
|
57
|
-
|
|
58
|
-
class: Xote.
|
|
59
|
-
if (Xote.
|
|
58
|
+
children: XoteJSX$Xote.array([
|
|
59
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
60
|
+
class: Computed$Xote.make(() => getSwitchClass() + Signal$Xote.get(Computed$Xote.make(() => {
|
|
61
|
+
if (Signal$Xote.get(checked)) {
|
|
60
62
|
return " basefn-switch--checked";
|
|
61
63
|
} else {
|
|
62
64
|
return "";
|
|
63
65
|
}
|
|
64
66
|
}, undefined)), undefined),
|
|
65
67
|
onClick: handleClick,
|
|
66
|
-
children:
|
|
68
|
+
children: XoteJSX$Xote.Elements.jsx("div", {
|
|
67
69
|
class: "basefn-switch__slider"
|
|
68
70
|
})
|
|
69
71
|
}),
|
|
70
|
-
label !== undefined ?
|
|
72
|
+
label !== undefined ? XoteJSX$Xote.Elements.jsx("span", {
|
|
71
73
|
class: "basefn-switch-label",
|
|
72
|
-
children: Xote.
|
|
73
|
-
}) :
|
|
74
|
+
children: Node$Xote.text(label)
|
|
75
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
74
76
|
])
|
|
75
77
|
});
|
|
76
78
|
}
|
|
@@ -5,7 +5,7 @@ open Xote
|
|
|
5
5
|
type tab = {
|
|
6
6
|
value: string,
|
|
7
7
|
label: string,
|
|
8
|
-
content:
|
|
8
|
+
content: Node.node,
|
|
9
9
|
disabled?: bool,
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -51,10 +51,10 @@ let make = (~tabs: array<tab>, ~defaultValue: option<string>=?) => {
|
|
|
51
51
|
onClick={_ => handleTabClick(tab.value, tab.disabled)}
|
|
52
52
|
disabled={tab.disabled->Option.getOr(false)}
|
|
53
53
|
>
|
|
54
|
-
{
|
|
54
|
+
{Node.text(tab.label)}
|
|
55
55
|
</button>
|
|
56
56
|
})
|
|
57
|
-
->
|
|
57
|
+
->Node.fragment}
|
|
58
58
|
</div>
|
|
59
59
|
<div class="basefn-tabs__content">
|
|
60
60
|
{
|
|
@@ -69,5 +69,5 @@ let make = (~tabs: array<tab>, ~defaultValue: option<string>=?) => {
|
|
|
69
69
|
]
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Node.signalFragment(computed)
|
|
73
73
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
4
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
5
5
|
import * as Core__Option from "@rescript/core/src/Core__Option.res.mjs";
|
|
6
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
7
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
6
8
|
|
|
7
9
|
import './Basefn__Tabs.css'
|
|
8
10
|
;
|
|
@@ -10,21 +12,21 @@ import './Basefn__Tabs.css'
|
|
|
10
12
|
function Basefn__Tabs(props) {
|
|
11
13
|
let defaultValue = props.defaultValue;
|
|
12
14
|
let tabs = props.tabs;
|
|
13
|
-
let activeTabSignal = Xote.
|
|
14
|
-
return Xote.
|
|
15
|
-
let activeValue = Xote.
|
|
16
|
-
return [
|
|
15
|
+
let activeTabSignal = Signal$Xote.make(defaultValue !== undefined ? defaultValue : Core__Option.getOr(Core__Option.map(tabs[0], tab => tab.value), ""), undefined, undefined);
|
|
16
|
+
return Node$Xote.signalFragment(Computed$Xote.make(() => {
|
|
17
|
+
let activeValue = Signal$Xote.get(activeTabSignal);
|
|
18
|
+
return [XoteJSX$Xote.Elements.jsxs("div", {
|
|
17
19
|
class: "basefn-tabs",
|
|
18
|
-
children:
|
|
19
|
-
|
|
20
|
+
children: XoteJSX$Xote.array([
|
|
21
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
20
22
|
class: "basefn-tabs__list",
|
|
21
|
-
children: Xote.
|
|
22
|
-
let isActive = Xote.
|
|
23
|
-
let className = Xote.
|
|
24
|
-
let activeClass = Xote.
|
|
23
|
+
children: Node$Xote.fragment(tabs.map(tab => {
|
|
24
|
+
let isActive = Computed$Xote.make(() => Signal$Xote.get(activeTabSignal) === tab.value, undefined);
|
|
25
|
+
let className = Computed$Xote.make(() => {
|
|
26
|
+
let activeClass = Signal$Xote.get(isActive) ? " basefn-tabs__trigger--active" : "";
|
|
25
27
|
return "basefn-tabs__trigger" + activeClass;
|
|
26
28
|
}, undefined);
|
|
27
|
-
return
|
|
29
|
+
return XoteJSX$Xote.Elements.jsxKeyed("button", {
|
|
28
30
|
class: className,
|
|
29
31
|
disabled: Core__Option.getOr(tab.disabled, false),
|
|
30
32
|
onClick: param => {
|
|
@@ -33,16 +35,16 @@ function Basefn__Tabs(props) {
|
|
|
33
35
|
if (disabled !== undefined && disabled) {
|
|
34
36
|
return;
|
|
35
37
|
} else {
|
|
36
|
-
return Xote.
|
|
38
|
+
return Signal$Xote.set(activeTabSignal, value);
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
|
-
children: Xote.
|
|
41
|
+
children: Node$Xote.text(tab.label)
|
|
40
42
|
}, tab.value, undefined);
|
|
41
43
|
}))
|
|
42
44
|
}),
|
|
43
|
-
|
|
45
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
44
46
|
class: "basefn-tabs__content",
|
|
45
|
-
children: Core__Option.getOr(Core__Option.map(tabs.find(tab => tab.value === activeValue), tab => tab.content),
|
|
47
|
+
children: Core__Option.getOr(Core__Option.map(tabs.find(tab => tab.value === activeValue), tab => tab.content), XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}))
|
|
46
48
|
})
|
|
47
49
|
])
|
|
48
50
|
})];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
-
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
3
|
import * as Basefn__Dom from "../Basefn__Dom.res.mjs";
|
|
4
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
5
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
6
6
|
|
|
7
7
|
import './Basefn__Textarea.css'
|
|
8
8
|
;
|
|
@@ -18,13 +18,13 @@ function Basefn__Textarea(props) {
|
|
|
18
18
|
let t = Basefn__Dom.target(e);
|
|
19
19
|
let v = t.value;
|
|
20
20
|
if (value.TAG === "Reactive") {
|
|
21
|
-
Xote.
|
|
21
|
+
Signal$Xote.set(value._0, v);
|
|
22
22
|
}
|
|
23
23
|
if (onInput !== undefined) {
|
|
24
24
|
return onInput(v);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
return
|
|
27
|
+
return XoteJSX$Xote.Elements.jsx("textarea", {
|
|
28
28
|
class: "basefn-textarea",
|
|
29
29
|
value: value,
|
|
30
30
|
placeholder: placeholder,
|
|
@@ -23,7 +23,7 @@ let make = (~size: [#Sm | #Md | #Lg]=#Md) => {
|
|
|
23
23
|
<Basefn__Button
|
|
24
24
|
variant=Ghost onClick={handleClick} class={"basefn-theme-toggle"->ReactiveProp.static}
|
|
25
25
|
>
|
|
26
|
-
{
|
|
26
|
+
{Node.signalFragment(icon)}
|
|
27
27
|
</Basefn__Button>
|
|
28
28
|
</Basefn__Tooltip>
|
|
29
29
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
5
4
|
import * as Basefn__Dom from "../Basefn__Dom.res.mjs";
|
|
5
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
6
6
|
import * as Basefn__Icon from "./Basefn__Icon.res.mjs";
|
|
7
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
7
8
|
import * as Basefn__Theme from "../styles/Basefn__Theme.res.mjs";
|
|
9
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
8
10
|
import * as Basefn__Button from "./Basefn__Button.res.mjs";
|
|
9
11
|
import * as Basefn__Tooltip from "./Basefn__Tooltip.res.mjs";
|
|
12
|
+
import * as ReactiveProp$Xote from "xote/src/ReactiveProp.res.mjs";
|
|
10
13
|
|
|
11
14
|
import './Basefn__ThemeToggle.css'
|
|
12
15
|
;
|
|
@@ -17,24 +20,24 @@ function Basefn__ThemeToggle(props) {
|
|
|
17
20
|
Basefn__Dom.stopPropagation(e);
|
|
18
21
|
Basefn__Theme.toggleTheme();
|
|
19
22
|
};
|
|
20
|
-
let icon = Xote.
|
|
21
|
-
let match = Xote.
|
|
23
|
+
let icon = Computed$Xote.make(() => {
|
|
24
|
+
let match = Signal$Xote.get(Basefn__Theme.currentTheme);
|
|
22
25
|
if (match === "Light") {
|
|
23
|
-
return [
|
|
26
|
+
return [XoteJSX$Xote.jsx(Basefn__Icon.make, {
|
|
24
27
|
name: "Sun"
|
|
25
28
|
})];
|
|
26
29
|
} else {
|
|
27
|
-
return [
|
|
30
|
+
return [XoteJSX$Xote.jsx(Basefn__Icon.make, {
|
|
28
31
|
name: "Moon"
|
|
29
32
|
})];
|
|
30
33
|
}
|
|
31
34
|
}, undefined);
|
|
32
|
-
return
|
|
35
|
+
return XoteJSX$Xote.jsx(Basefn__Tooltip.make, {
|
|
33
36
|
content: "Toggle theme",
|
|
34
37
|
position: "Bottom",
|
|
35
|
-
children:
|
|
36
|
-
children: Xote.
|
|
37
|
-
class: Xote
|
|
38
|
+
children: XoteJSX$Xote.jsx(Basefn__Button.make, {
|
|
39
|
+
children: Node$Xote.signalFragment(icon),
|
|
40
|
+
class: ReactiveProp$Xote.$$static("basefn-theme-toggle"),
|
|
38
41
|
onClick: handleClick,
|
|
39
42
|
variant: "Ghost"
|
|
40
43
|
})
|
|
@@ -46,25 +46,25 @@ let make = (~items: array<timelineItem>, ~orientation: orientation=Vertical) =>
|
|
|
46
46
|
<div class="basefn-timeline__marker-wrapper">
|
|
47
47
|
<div class={getMarkerClass(item.variant)}>
|
|
48
48
|
{switch item.icon {
|
|
49
|
-
| Some(iconText) =>
|
|
50
|
-
| None =>
|
|
49
|
+
| Some(iconText) => Node.text(iconText)
|
|
50
|
+
| None => Node.text(Int.toString(index + 1))
|
|
51
51
|
}}
|
|
52
52
|
</div>
|
|
53
53
|
<div class="basefn-timeline__connector" />
|
|
54
54
|
</div>
|
|
55
55
|
<div class="basefn-timeline__content">
|
|
56
|
-
<div class="basefn-timeline__title"> {
|
|
56
|
+
<div class="basefn-timeline__title"> {Node.text(item.title)} </div>
|
|
57
57
|
{switch item.timestamp {
|
|
58
|
-
| Some(time) => <div class="basefn-timeline__timestamp"> {
|
|
58
|
+
| Some(time) => <div class="basefn-timeline__timestamp"> {Node.text(time)} </div>
|
|
59
59
|
| None => <> </>
|
|
60
60
|
}}
|
|
61
61
|
{switch item.description {
|
|
62
|
-
| Some(desc) => <div class="basefn-timeline__description"> {
|
|
62
|
+
| Some(desc) => <div class="basefn-timeline__description"> {Node.text(desc)} </div>
|
|
63
63
|
| None => <> </>
|
|
64
64
|
}}
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
})
|
|
68
|
-
->
|
|
68
|
+
->Node.fragment}
|
|
69
69
|
</div>
|
|
70
70
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
4
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
5
5
|
|
|
6
6
|
import './Basefn__Timeline.css'
|
|
7
7
|
;
|
|
@@ -33,42 +33,42 @@ function Basefn__Timeline(props) {
|
|
|
33
33
|
let variantClass = "basefn-timeline__marker--" + variantToString(variant);
|
|
34
34
|
return "basefn-timeline__marker " + variantClass;
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
37
37
|
class: getTimelineClass(),
|
|
38
|
-
children: Xote.
|
|
38
|
+
children: Node$Xote.fragment(props.items.map((item, index) => {
|
|
39
39
|
let iconText = item.icon;
|
|
40
40
|
let time = item.timestamp;
|
|
41
41
|
let desc = item.description;
|
|
42
|
-
return
|
|
42
|
+
return XoteJSX$Xote.Elements.jsxsKeyed("div", {
|
|
43
43
|
class: "basefn-timeline__item",
|
|
44
|
-
children:
|
|
45
|
-
|
|
44
|
+
children: XoteJSX$Xote.array([
|
|
45
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
46
46
|
class: "basefn-timeline__marker-wrapper",
|
|
47
|
-
children:
|
|
48
|
-
|
|
47
|
+
children: XoteJSX$Xote.array([
|
|
48
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
49
49
|
class: getMarkerClass(item.variant),
|
|
50
|
-
children: iconText !== undefined ? Xote.
|
|
50
|
+
children: iconText !== undefined ? Node$Xote.text(iconText) : Node$Xote.text((index + 1 | 0).toString())
|
|
51
51
|
}),
|
|
52
|
-
|
|
52
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
53
53
|
class: "basefn-timeline__connector"
|
|
54
54
|
})
|
|
55
55
|
])
|
|
56
56
|
}),
|
|
57
|
-
|
|
57
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
58
58
|
class: "basefn-timeline__content",
|
|
59
|
-
children:
|
|
60
|
-
|
|
59
|
+
children: XoteJSX$Xote.array([
|
|
60
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
61
61
|
class: "basefn-timeline__title",
|
|
62
|
-
children: Xote.
|
|
62
|
+
children: Node$Xote.text(item.title)
|
|
63
63
|
}),
|
|
64
|
-
time !== undefined ?
|
|
64
|
+
time !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
65
65
|
class: "basefn-timeline__timestamp",
|
|
66
|
-
children: Xote.
|
|
67
|
-
}) :
|
|
68
|
-
desc !== undefined ?
|
|
66
|
+
children: Node$Xote.text(time)
|
|
67
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
68
|
+
desc !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
69
69
|
class: "basefn-timeline__description",
|
|
70
|
-
children: Xote.
|
|
71
|
-
}) :
|
|
70
|
+
children: Node$Xote.text(desc)
|
|
71
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
72
72
|
])
|
|
73
73
|
})
|
|
74
74
|
])
|
|
@@ -66,10 +66,10 @@ let make = (
|
|
|
66
66
|
<div class="basefn-toast__content">
|
|
67
67
|
{switch title {
|
|
68
68
|
| Some(titleText) =>
|
|
69
|
-
<div class="basefn-toast__title"> {
|
|
69
|
+
<div class="basefn-toast__title"> {Node.text(titleText)} </div>
|
|
70
70
|
| None => <> </>
|
|
71
71
|
}}
|
|
72
|
-
<div class="basefn-toast__message"> {
|
|
72
|
+
<div class="basefn-toast__message"> {Node.text(message)} </div>
|
|
73
73
|
</div>
|
|
74
74
|
<button
|
|
75
75
|
class="basefn-toast__close"
|
|
@@ -78,7 +78,7 @@ let make = (
|
|
|
78
78
|
onClose()
|
|
79
79
|
}}
|
|
80
80
|
>
|
|
81
|
-
{
|
|
81
|
+
{Node.text("\u00d7")}
|
|
82
82
|
</button>
|
|
83
83
|
</div>
|
|
84
84
|
</div>,
|
|
@@ -88,5 +88,5 @@ let make = (
|
|
|
88
88
|
}
|
|
89
89
|
})
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Node.signalFragment(content)
|
|
92
92
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
4
|
+
import * as Effect$Xote from "xote/src/Effect.res.mjs";
|
|
5
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
6
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
7
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
8
|
|
|
6
9
|
import './Basefn__Toast.css'
|
|
7
10
|
;
|
|
@@ -45,12 +48,12 @@ function Basefn__Toast(props) {
|
|
|
45
48
|
let position = __position !== undefined ? __position : "TopRight";
|
|
46
49
|
let autoDismiss = __autoDismiss !== undefined ? __autoDismiss : true;
|
|
47
50
|
let duration = __duration !== undefined ? __duration : 3000;
|
|
48
|
-
Xote.
|
|
49
|
-
if (!(Xote.
|
|
51
|
+
Effect$Xote.run(() => {
|
|
52
|
+
if (!(Signal$Xote.get(isVisible) && autoDismiss)) {
|
|
50
53
|
return;
|
|
51
54
|
}
|
|
52
55
|
let timeoutId = setTimeout(() => {
|
|
53
|
-
Xote.
|
|
56
|
+
Signal$Xote.set(isVisible, false);
|
|
54
57
|
onClose();
|
|
55
58
|
}, duration);
|
|
56
59
|
return () => {
|
|
@@ -65,33 +68,33 @@ function Basefn__Toast(props) {
|
|
|
65
68
|
let posClass = "basefn-toast-container--" + positionToString(position);
|
|
66
69
|
return "basefn-toast-container " + posClass;
|
|
67
70
|
};
|
|
68
|
-
return Xote.
|
|
69
|
-
if (Xote.
|
|
70
|
-
return [
|
|
71
|
+
return Node$Xote.signalFragment(Computed$Xote.make(() => {
|
|
72
|
+
if (Signal$Xote.get(isVisible)) {
|
|
73
|
+
return [XoteJSX$Xote.Elements.jsx("div", {
|
|
71
74
|
class: getContainerClass(),
|
|
72
|
-
children:
|
|
75
|
+
children: XoteJSX$Xote.Elements.jsxs("div", {
|
|
73
76
|
class: getToastClass(),
|
|
74
|
-
children:
|
|
75
|
-
|
|
77
|
+
children: XoteJSX$Xote.array([
|
|
78
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
76
79
|
class: "basefn-toast__content",
|
|
77
|
-
children:
|
|
78
|
-
title !== undefined ?
|
|
80
|
+
children: XoteJSX$Xote.array([
|
|
81
|
+
title !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
79
82
|
class: "basefn-toast__title",
|
|
80
|
-
children: Xote.
|
|
81
|
-
}) :
|
|
82
|
-
|
|
83
|
+
children: Node$Xote.text(title)
|
|
84
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
85
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
83
86
|
class: "basefn-toast__message",
|
|
84
|
-
children: Xote.
|
|
87
|
+
children: Node$Xote.text(message)
|
|
85
88
|
})
|
|
86
89
|
])
|
|
87
90
|
}),
|
|
88
|
-
|
|
91
|
+
XoteJSX$Xote.Elements.jsx("button", {
|
|
89
92
|
class: "basefn-toast__close",
|
|
90
93
|
onClick: param => {
|
|
91
|
-
Xote.
|
|
94
|
+
Signal$Xote.set(isVisible, false);
|
|
92
95
|
onClose();
|
|
93
96
|
},
|
|
94
|
-
children: Xote.
|
|
97
|
+
children: Node$Xote.text("\u00d7")
|
|
95
98
|
})
|
|
96
99
|
])
|
|
97
100
|
})
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
4
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
5
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
6
|
|
|
6
7
|
import './Basefn__Toggle.css'
|
|
7
8
|
;
|
|
@@ -39,21 +40,21 @@ function Basefn__Toggle(props) {
|
|
|
39
40
|
if (disabled) {
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
let newValue = !Xote.
|
|
43
|
-
Xote.
|
|
43
|
+
let newValue = !Signal$Xote.get(pressed);
|
|
44
|
+
Signal$Xote.set(pressed, newValue);
|
|
44
45
|
if (onPressedChange !== undefined) {
|
|
45
46
|
return onPressedChange(newValue);
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
|
-
let computedClassName = Xote.
|
|
49
|
+
let computedClassName = Computed$Xote.make(() => {
|
|
49
50
|
let variantClass = " basefn-toggle--" + variantToString(variant);
|
|
50
51
|
let sizeClass = " basefn-toggle--" + sizeToString(size);
|
|
51
|
-
let pressedClass = Xote.
|
|
52
|
+
let pressedClass = Signal$Xote.get(pressed) ? " basefn-toggle--pressed" : "";
|
|
52
53
|
let disabledClass = disabled ? " basefn-toggle--disabled" : "";
|
|
53
54
|
let customClass = className !== undefined ? " " + className : "";
|
|
54
55
|
return "basefn-toggle" + variantClass + sizeClass + pressedClass + disabledClass + customClass;
|
|
55
56
|
}, undefined);
|
|
56
|
-
return
|
|
57
|
+
return XoteJSX$Xote.Elements.jsx("button", {
|
|
57
58
|
class: computedClassName,
|
|
58
59
|
disabled: disabled,
|
|
59
60
|
onClick: handleClick,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
4
|
-
import * as
|
|
3
|
+
import * as Node$Xote from "xote/src/Node.res.mjs";
|
|
4
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
5
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
6
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
7
|
|
|
6
8
|
import './Basefn__ToggleGroup.css'
|
|
7
9
|
;
|
|
@@ -39,21 +41,21 @@ function Basefn__ToggleGroup(props) {
|
|
|
39
41
|
let customClass = className !== undefined ? " " + className : "";
|
|
40
42
|
return "basefn-toggle-group" + customClass;
|
|
41
43
|
};
|
|
42
|
-
let getItemClassName = (itemValue, itemDisabled) => Xote.
|
|
44
|
+
let getItemClassName = (itemValue, itemDisabled) => Computed$Xote.make(() => {
|
|
43
45
|
let variantClass = " basefn-toggle-group__item--" + variantToString(variant);
|
|
44
46
|
let sizeClass = " basefn-toggle-group__item--" + sizeToString(size);
|
|
45
|
-
let currentValues = Xote.
|
|
47
|
+
let currentValues = Signal$Xote.get(value);
|
|
46
48
|
let pressedClass = currentValues.includes(itemValue) ? " basefn-toggle-group__item--pressed" : "";
|
|
47
49
|
let disabledClass = itemDisabled ? " basefn-toggle-group__item--disabled" : "";
|
|
48
50
|
return "basefn-toggle-group__item" + variantClass + sizeClass + pressedClass + disabledClass;
|
|
49
51
|
}, undefined);
|
|
50
|
-
return
|
|
52
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
51
53
|
class: getGroupClassName(),
|
|
52
54
|
role: "group",
|
|
53
|
-
children: Xote.
|
|
55
|
+
children: Node$Xote.fragment(props.items.map(item => {
|
|
54
56
|
let d = item.disabled;
|
|
55
57
|
let isDisabled = d !== undefined ? d : false;
|
|
56
|
-
return
|
|
58
|
+
return XoteJSX$Xote.Elements.jsxKeyed("button", {
|
|
57
59
|
class: getItemClassName(item.value, isDisabled),
|
|
58
60
|
disabled: isDisabled,
|
|
59
61
|
onClick: param => {
|
|
@@ -61,19 +63,19 @@ function Basefn__ToggleGroup(props) {
|
|
|
61
63
|
if (isDisabled) {
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
64
|
-
let currentValues = Xote.
|
|
66
|
+
let currentValues = Signal$Xote.get(value);
|
|
65
67
|
let newValues;
|
|
66
68
|
newValues = type_ === "Single" ? (
|
|
67
69
|
currentValues.includes(itemValue) ? [] : [itemValue]
|
|
68
70
|
) : (
|
|
69
71
|
currentValues.includes(itemValue) ? currentValues.filter(v => v !== itemValue) : currentValues.concat([itemValue])
|
|
70
72
|
);
|
|
71
|
-
Xote.
|
|
73
|
+
Signal$Xote.set(value, newValues);
|
|
72
74
|
if (onValueChange !== undefined) {
|
|
73
75
|
return onValueChange(newValues);
|
|
74
76
|
}
|
|
75
77
|
},
|
|
76
|
-
children: Xote.
|
|
78
|
+
children: Node$Xote.text(item.label)
|
|
77
79
|
}, item.value, undefined);
|
|
78
80
|
}))
|
|
79
81
|
});
|
|
@@ -14,7 +14,7 @@ let positionToString = (position: position) => {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
@jsx.component
|
|
17
|
-
let make = (~content: string, ~position: position=Top, ~children:
|
|
17
|
+
let make = (~content: string, ~position: position=Top, ~children: Node.node) => {
|
|
18
18
|
let isVisible = Signal.make(false)
|
|
19
19
|
|
|
20
20
|
let handleMouseEnter = _ => Signal.set(isVisible, true)
|
|
@@ -27,7 +27,7 @@ let make = (~content: string, ~position: position=Top, ~children: Component.node
|
|
|
27
27
|
|
|
28
28
|
let tooltipContent = Computed.make(() => {
|
|
29
29
|
if Signal.get(isVisible) {
|
|
30
|
-
[<div class={getTooltipClass()}> {
|
|
30
|
+
[<div class={getTooltipClass()}> {Node.text(content)} </div>]
|
|
31
31
|
} else {
|
|
32
32
|
[]
|
|
33
33
|
}
|
|
@@ -37,6 +37,6 @@ let make = (~content: string, ~position: position=Top, ~children: Component.node
|
|
|
37
37
|
class="basefn-tooltip-wrapper" onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}
|
|
38
38
|
>
|
|
39
39
|
{children}
|
|
40
|
-
{
|
|
40
|
+
{Node.signalFragment(tooltipContent)}
|
|
41
41
|
</div>
|
|
42
42
|
}
|