basefn 1.10.0 → 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 +3 -3
- package/rescript.json +1 -1
- 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.res +49 -20
- package/src/components/Basefn__Resizable.res.mjs +66 -36
- 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 +14 -14
- package/src/components/Basefn__Spotlight.res.mjs +69 -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
|
@@ -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
|
}
|
|
@@ -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__Tooltip.css'
|
|
7
9
|
;
|
|
@@ -23,30 +25,30 @@ function Basefn__Tooltip(props) {
|
|
|
23
25
|
let __position = props.position;
|
|
24
26
|
let content = props.content;
|
|
25
27
|
let position = __position !== undefined ? __position : "Top";
|
|
26
|
-
let isVisible = Xote.
|
|
27
|
-
let handleMouseEnter = param => Xote.
|
|
28
|
-
let handleMouseLeave = param => Xote.
|
|
28
|
+
let isVisible = Signal$Xote.make(false, undefined, undefined);
|
|
29
|
+
let handleMouseEnter = param => Signal$Xote.set(isVisible, true);
|
|
30
|
+
let handleMouseLeave = param => Signal$Xote.set(isVisible, false);
|
|
29
31
|
let getTooltipClass = () => {
|
|
30
32
|
let posClass = "basefn-tooltip--" + positionToString(position);
|
|
31
33
|
return "basefn-tooltip " + posClass;
|
|
32
34
|
};
|
|
33
|
-
let tooltipContent = Xote.
|
|
34
|
-
if (Xote.
|
|
35
|
-
return [
|
|
35
|
+
let tooltipContent = Computed$Xote.make(() => {
|
|
36
|
+
if (Signal$Xote.get(isVisible)) {
|
|
37
|
+
return [XoteJSX$Xote.Elements.jsx("div", {
|
|
36
38
|
class: getTooltipClass(),
|
|
37
|
-
children: Xote.
|
|
39
|
+
children: Node$Xote.text(content)
|
|
38
40
|
})];
|
|
39
41
|
} else {
|
|
40
42
|
return [];
|
|
41
43
|
}
|
|
42
44
|
}, undefined);
|
|
43
|
-
return
|
|
45
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
44
46
|
class: "basefn-tooltip-wrapper",
|
|
45
47
|
onMouseEnter: handleMouseEnter,
|
|
46
48
|
onMouseLeave: handleMouseLeave,
|
|
47
|
-
children:
|
|
49
|
+
children: XoteJSX$Xote.array([
|
|
48
50
|
props.children,
|
|
49
|
-
Xote.
|
|
51
|
+
Node$Xote.signalFragment(tooltipContent)
|
|
50
52
|
])
|
|
51
53
|
});
|
|
52
54
|
}
|
|
@@ -20,11 +20,11 @@ let sizeToString = (size: size) => {
|
|
|
20
20
|
|
|
21
21
|
@jsx.component
|
|
22
22
|
let make = (
|
|
23
|
-
~logo: option<
|
|
23
|
+
~logo: option<Node.node>=?,
|
|
24
24
|
~navItems: option<array<navItem>>=?,
|
|
25
|
-
~leftContent: option<
|
|
26
|
-
~centerContent: option<
|
|
27
|
-
~rightContent: option<
|
|
25
|
+
~leftContent: option<Node.node>=?,
|
|
26
|
+
~centerContent: option<Node.node>=?,
|
|
27
|
+
~rightContent: option<Node.node>=?,
|
|
28
28
|
~onMenuClick: option<unit => unit>=?,
|
|
29
29
|
~size: size=Md,
|
|
30
30
|
) => {
|
|
@@ -35,7 +35,7 @@ let make = (
|
|
|
35
35
|
{switch onMenuClick {
|
|
36
36
|
| Some(handler) =>
|
|
37
37
|
<button class="basefn-topbar__menu-button" onClick={_ => handler()}>
|
|
38
|
-
{
|
|
38
|
+
{Node.text("\u2630")}
|
|
39
39
|
</button>
|
|
40
40
|
| None => <> </>
|
|
41
41
|
}}
|
|
@@ -58,10 +58,10 @@ let make = (
|
|
|
58
58
|
"basefn-topbar__nav-item" ++ (item.active ? " basefn-topbar__nav-item--active" : "")
|
|
59
59
|
|
|
60
60
|
<button key={Int.toString(index)} class={className} onClick={_ => item.onClick()}>
|
|
61
|
-
{
|
|
61
|
+
{Node.text(item.label)}
|
|
62
62
|
</button>
|
|
63
63
|
})
|
|
64
|
-
->
|
|
64
|
+
->Node.fragment}
|
|
65
65
|
</nav>
|
|
66
66
|
| None => <> </>
|
|
67
67
|
}}
|
|
@@ -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__Topbar.css'
|
|
7
7
|
;
|
|
@@ -27,46 +27,46 @@ function Basefn__Topbar(props) {
|
|
|
27
27
|
let logo = props.logo;
|
|
28
28
|
let size = __size !== undefined ? __size : "Md";
|
|
29
29
|
let $$class = "basefn-topbar basefn-topbar--" + sizeToString(size);
|
|
30
|
-
return
|
|
30
|
+
return XoteJSX$Xote.Elements.jsxs("header", {
|
|
31
31
|
class: $$class,
|
|
32
|
-
children:
|
|
33
|
-
|
|
32
|
+
children: XoteJSX$Xote.array([
|
|
33
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
34
34
|
class: "basefn-topbar__left",
|
|
35
|
-
children:
|
|
36
|
-
onMenuClick !== undefined ?
|
|
35
|
+
children: XoteJSX$Xote.array([
|
|
36
|
+
onMenuClick !== undefined ? XoteJSX$Xote.Elements.jsx("button", {
|
|
37
37
|
class: "basefn-topbar__menu-button",
|
|
38
38
|
onClick: param => onMenuClick(),
|
|
39
|
-
children: Xote.
|
|
40
|
-
}) :
|
|
41
|
-
logo !== undefined ?
|
|
39
|
+
children: Node$Xote.text("\u2630")
|
|
40
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
41
|
+
logo !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
42
42
|
class: "basefn-topbar__logo",
|
|
43
43
|
children: logo
|
|
44
|
-
}) :
|
|
45
|
-
leftContent !== undefined ? leftContent :
|
|
44
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
45
|
+
leftContent !== undefined ? leftContent : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
46
46
|
])
|
|
47
47
|
}),
|
|
48
|
-
|
|
48
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
49
49
|
class: "basefn-topbar__center",
|
|
50
|
-
children:
|
|
51
|
-
navItems !== undefined ?
|
|
50
|
+
children: XoteJSX$Xote.array([
|
|
51
|
+
navItems !== undefined ? XoteJSX$Xote.Elements.jsx("nav", {
|
|
52
52
|
class: "basefn-topbar__nav",
|
|
53
|
-
children: Xote.
|
|
53
|
+
children: Node$Xote.fragment(navItems.map((item, index) => {
|
|
54
54
|
let className = "basefn-topbar__nav-item" + (
|
|
55
55
|
item.active ? " basefn-topbar__nav-item--active" : ""
|
|
56
56
|
);
|
|
57
|
-
return
|
|
57
|
+
return XoteJSX$Xote.Elements.jsxKeyed("button", {
|
|
58
58
|
class: className,
|
|
59
59
|
onClick: param => item.onClick(),
|
|
60
|
-
children: Xote.
|
|
60
|
+
children: Node$Xote.text(item.label)
|
|
61
61
|
}, index.toString(), undefined);
|
|
62
62
|
}))
|
|
63
|
-
}) :
|
|
64
|
-
centerContent !== undefined ? centerContent :
|
|
63
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
64
|
+
centerContent !== undefined ? centerContent : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
65
65
|
])
|
|
66
66
|
}),
|
|
67
|
-
|
|
67
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
68
68
|
class: "basefn-topbar__right",
|
|
69
|
-
children: rightContent !== undefined ? rightContent :
|
|
69
|
+
children: rightContent !== undefined ? rightContent : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
70
70
|
})
|
|
71
71
|
])
|
|
72
72
|
});
|
|
@@ -75,8 +75,8 @@ let make = (
|
|
|
75
75
|
|
|
76
76
|
let renderText = text =>
|
|
77
77
|
switch text {
|
|
78
|
-
| ReactiveProp.Reactive(text) =>
|
|
79
|
-
| ReactiveProp.Static(text) =>
|
|
78
|
+
| ReactiveProp.Reactive(text) => Node.SignalText(text)
|
|
79
|
+
| ReactiveProp.Static(text) => Node.text(text)
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
switch variant {
|
|
@@ -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__Typography.css'
|
|
7
7
|
;
|
|
@@ -95,48 +95,48 @@ function Basefn__Typography(props) {
|
|
|
95
95
|
_0: text._0
|
|
96
96
|
};
|
|
97
97
|
} else {
|
|
98
|
-
return Xote.
|
|
98
|
+
return Node$Xote.text(text._0);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
switch (variant) {
|
|
102
102
|
case "H1" :
|
|
103
|
-
return
|
|
103
|
+
return XoteJSX$Xote.Elements.jsx("h1", {
|
|
104
104
|
class: $$class$1,
|
|
105
105
|
style: style,
|
|
106
106
|
children: renderText(text)
|
|
107
107
|
});
|
|
108
108
|
case "H2" :
|
|
109
|
-
return
|
|
109
|
+
return XoteJSX$Xote.Elements.jsx("h2", {
|
|
110
110
|
class: $$class$1,
|
|
111
111
|
style: style,
|
|
112
112
|
children: renderText(text)
|
|
113
113
|
});
|
|
114
114
|
case "H3" :
|
|
115
|
-
return
|
|
115
|
+
return XoteJSX$Xote.Elements.jsx("h3", {
|
|
116
116
|
class: $$class$1,
|
|
117
117
|
style: style,
|
|
118
118
|
children: renderText(text)
|
|
119
119
|
});
|
|
120
120
|
case "H4" :
|
|
121
|
-
return
|
|
121
|
+
return XoteJSX$Xote.Elements.jsx("h4", {
|
|
122
122
|
class: $$class$1,
|
|
123
123
|
style: style,
|
|
124
124
|
children: renderText(text)
|
|
125
125
|
});
|
|
126
126
|
case "H5" :
|
|
127
|
-
return
|
|
127
|
+
return XoteJSX$Xote.Elements.jsx("h5", {
|
|
128
128
|
class: $$class$1,
|
|
129
129
|
style: style,
|
|
130
130
|
children: renderText(text)
|
|
131
131
|
});
|
|
132
132
|
case "H6" :
|
|
133
|
-
return
|
|
133
|
+
return XoteJSX$Xote.Elements.jsx("h6", {
|
|
134
134
|
class: $$class$1,
|
|
135
135
|
style: style,
|
|
136
136
|
children: renderText(text)
|
|
137
137
|
});
|
|
138
138
|
case "Small" :
|
|
139
|
-
return
|
|
139
|
+
return XoteJSX$Xote.Elements.jsx("small", {
|
|
140
140
|
class: $$class$1,
|
|
141
141
|
style: style,
|
|
142
142
|
children: renderText(text)
|
|
@@ -144,19 +144,19 @@ function Basefn__Typography(props) {
|
|
|
144
144
|
case "P" :
|
|
145
145
|
case "Lead" :
|
|
146
146
|
case "Muted" :
|
|
147
|
-
return
|
|
147
|
+
return XoteJSX$Xote.Elements.jsx("p", {
|
|
148
148
|
class: $$class$1,
|
|
149
149
|
style: style,
|
|
150
150
|
children: renderText(text)
|
|
151
151
|
});
|
|
152
152
|
case "Code" :
|
|
153
|
-
return
|
|
153
|
+
return XoteJSX$Xote.Elements.jsx("code", {
|
|
154
154
|
class: $$class$1,
|
|
155
155
|
style: style,
|
|
156
156
|
children: renderText(text)
|
|
157
157
|
});
|
|
158
158
|
case "Unstyled" :
|
|
159
|
-
return
|
|
159
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
160
160
|
class: $$class$1,
|
|
161
161
|
style: style,
|
|
162
162
|
children: renderText(text)
|