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
|
@@ -1,8 +1,9 @@
|
|
|
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 Signal$Xote from "xote/src/Signal.res.mjs";
|
|
5
4
|
import * as Core__Option from "@rescript/core/src/Core__Option.res.mjs";
|
|
5
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
6
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
6
7
|
|
|
7
8
|
import './Basefn__AppLayout.css'
|
|
8
9
|
;
|
|
@@ -20,7 +21,7 @@ function Basefn__AppLayout(props) {
|
|
|
20
21
|
let noPadding = __noPadding !== undefined ? __noPadding : false;
|
|
21
22
|
let sidebarCollapsed = __sidebarCollapsed !== undefined ? __sidebarCollapsed : false;
|
|
22
23
|
let topbarPosition = __topbarPosition !== undefined ? __topbarPosition : "Inline";
|
|
23
|
-
let sidebarOpen = Xote.
|
|
24
|
+
let sidebarOpen = Signal$Xote.make(false, undefined, undefined);
|
|
24
25
|
let getLayoutClass = () => {
|
|
25
26
|
let hasSidebar = Core__Option.isSome(sidebar) ? " basefn-app-layout--has-sidebar" : "";
|
|
26
27
|
let sidebarSizeClass;
|
|
@@ -56,8 +57,8 @@ function Basefn__AppLayout(props) {
|
|
|
56
57
|
topbarSizeClass = "";
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
Xote.
|
|
60
|
-
if (Xote.
|
|
60
|
+
Computed$Xote.make(() => {
|
|
61
|
+
if (Signal$Xote.get(sidebarOpen)) {
|
|
61
62
|
return " basefn-app-layout--sidebar-open";
|
|
62
63
|
} else {
|
|
63
64
|
return "";
|
|
@@ -72,47 +73,47 @@ function Basefn__AppLayout(props) {
|
|
|
72
73
|
return "basefn-app-layout__content-inner" + widthClass + paddingClass;
|
|
73
74
|
};
|
|
74
75
|
let tmp;
|
|
75
|
-
tmp = topbarPosition === "Inline" || topbar === undefined ?
|
|
76
|
+
tmp = topbarPosition === "Inline" || topbar === undefined ? XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}) : XoteJSX$Xote.Elements.jsx("div", {
|
|
76
77
|
class: "basefn-app-layout__topbar basefn-app-layout__topbar--above",
|
|
77
78
|
children: topbar
|
|
78
79
|
});
|
|
79
80
|
let tmp$1;
|
|
80
|
-
tmp$1 = topbarPosition === "Inline" && topbar !== undefined ?
|
|
81
|
+
tmp$1 = topbarPosition === "Inline" && topbar !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
81
82
|
class: "basefn-app-layout__topbar",
|
|
82
83
|
children: topbar
|
|
83
|
-
}) :
|
|
84
|
-
return
|
|
85
|
-
class: Xote.
|
|
86
|
-
if (Xote.
|
|
84
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {});
|
|
85
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
86
|
+
class: Computed$Xote.make(() => getLayoutClass() + Signal$Xote.get(Computed$Xote.make(() => {
|
|
87
|
+
if (Signal$Xote.get(sidebarOpen)) {
|
|
87
88
|
return " basefn-app-layout--sidebar-open";
|
|
88
89
|
} else {
|
|
89
90
|
return "";
|
|
90
91
|
}
|
|
91
92
|
}, undefined)), undefined),
|
|
92
|
-
children:
|
|
93
|
+
children: XoteJSX$Xote.array([
|
|
93
94
|
tmp,
|
|
94
|
-
|
|
95
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
95
96
|
class: "basefn-app-layout__body",
|
|
96
|
-
children:
|
|
97
|
-
sidebar !== undefined ?
|
|
98
|
-
children:
|
|
99
|
-
|
|
97
|
+
children: XoteJSX$Xote.array([
|
|
98
|
+
sidebar !== undefined ? XoteJSX$Xote.jsxs(XoteJSX$Xote.jsxFragment, {
|
|
99
|
+
children: XoteJSX$Xote.array([
|
|
100
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
100
101
|
class: "basefn-app-layout__sidebar",
|
|
101
102
|
children: sidebar
|
|
102
103
|
}),
|
|
103
|
-
|
|
104
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
104
105
|
class: "basefn-app-layout__sidebar-backdrop",
|
|
105
|
-
onClick: param => Xote.
|
|
106
|
+
onClick: param => Signal$Xote.set(sidebarOpen, false)
|
|
106
107
|
})
|
|
107
108
|
])
|
|
108
|
-
}) :
|
|
109
|
-
|
|
109
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
110
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
110
111
|
class: "basefn-app-layout__main-wrapper",
|
|
111
|
-
children:
|
|
112
|
+
children: XoteJSX$Xote.array([
|
|
112
113
|
tmp$1,
|
|
113
|
-
|
|
114
|
+
XoteJSX$Xote.Elements.jsx("main", {
|
|
114
115
|
class: "basefn-app-layout__content",
|
|
115
|
-
children:
|
|
116
|
+
children: XoteJSX$Xote.Elements.jsx("div", {
|
|
116
117
|
class: getContentClass(),
|
|
117
118
|
children: props.children
|
|
118
119
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
4
|
|
|
5
5
|
import './Basefn__AspectRatio.css'
|
|
6
6
|
;
|
|
@@ -18,7 +18,7 @@ function Basefn__AspectRatio(props) {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
let getStyle = () => "aspect-ratio: " + ratio.toString() + ";";
|
|
21
|
-
return
|
|
21
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
22
22
|
class: getClassName(),
|
|
23
23
|
style: getStyle(),
|
|
24
24
|
children: props.children
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
4
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
5
5
|
|
|
6
6
|
import './Basefn__Avatar.css'
|
|
@@ -22,9 +22,9 @@ function Basefn__Avatar(props) {
|
|
|
22
22
|
let size = __size !== undefined ? __size : "Md";
|
|
23
23
|
let sizeClass = "basefn-avatar--" + sizeToString(size);
|
|
24
24
|
let $$class = "basefn-avatar " + sizeClass;
|
|
25
|
-
return
|
|
25
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
26
26
|
class: $$class,
|
|
27
|
-
children:
|
|
27
|
+
children: XoteJSX$Xote.Elements.jsx("img", {
|
|
28
28
|
src: Primitive_option.some(props.src),
|
|
29
29
|
alt: Primitive_option.some(props.name)
|
|
30
30
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
4
|
|
|
5
5
|
import './Basefn__Badge.css'
|
|
6
6
|
;
|
|
@@ -46,7 +46,7 @@ function Basefn__Badge(props) {
|
|
|
46
46
|
let dotClass = dot ? " basefn-badge--dot" : "";
|
|
47
47
|
return "basefn-badge " + variantClass + " " + sizeClass + dotClass;
|
|
48
48
|
};
|
|
49
|
-
return
|
|
49
|
+
return XoteJSX$Xote.Elements.jsx("span", {
|
|
50
50
|
class: getClassName(),
|
|
51
51
|
children: {
|
|
52
52
|
TAG: "SignalText",
|
|
@@ -20,7 +20,7 @@ let make = (~items: array<breadcrumbItem>, ~separator: string="/") => {
|
|
|
20
20
|
{switch (item.href, item.onClick) {
|
|
21
21
|
| (Some(href), _) =>
|
|
22
22
|
<a href={href} class={"basefn-breadcrumb__link " ++ className}>
|
|
23
|
-
{
|
|
23
|
+
{Node.text(item.label)}
|
|
24
24
|
</a>
|
|
25
25
|
| (None, Some(onClick)) =>
|
|
26
26
|
<button
|
|
@@ -28,18 +28,18 @@ let make = (~items: array<breadcrumbItem>, ~separator: string="/") => {
|
|
|
28
28
|
onClick={_ => onClick()}
|
|
29
29
|
style="background: none; border: none; padding: 0; font: inherit;"
|
|
30
30
|
>
|
|
31
|
-
{
|
|
31
|
+
{Node.text(item.label)}
|
|
32
32
|
</button>
|
|
33
33
|
| (None, None) =>
|
|
34
34
|
<span class={"basefn-breadcrumb__link " ++ className}>
|
|
35
|
-
{
|
|
35
|
+
{Node.text(item.label)}
|
|
36
36
|
</span>
|
|
37
37
|
}}
|
|
38
38
|
{!isLast
|
|
39
|
-
? <span class="basefn-breadcrumb__separator"> {
|
|
39
|
+
? <span class="basefn-breadcrumb__separator"> {Node.text(separator)} </span>
|
|
40
40
|
: <> </>}
|
|
41
41
|
</div>
|
|
42
42
|
})
|
|
43
|
-
->
|
|
43
|
+
->Node.fragment}
|
|
44
44
|
</nav>
|
|
45
45
|
}
|
|
@@ -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__Breadcrumb.css'
|
|
7
7
|
;
|
|
@@ -10,34 +10,34 @@ function Basefn__Breadcrumb(props) {
|
|
|
10
10
|
let __separator = props.separator;
|
|
11
11
|
let items = props.items;
|
|
12
12
|
let separator = __separator !== undefined ? __separator : "/";
|
|
13
|
-
return
|
|
13
|
+
return XoteJSX$Xote.Elements.jsx("nav", {
|
|
14
14
|
class: "basefn-breadcrumb",
|
|
15
|
-
children: Xote.
|
|
15
|
+
children: Node$Xote.fragment(items.map((item, index) => {
|
|
16
16
|
let isLast = index === (items.length - 1 | 0);
|
|
17
17
|
let className = isLast ? "basefn-breadcrumb__link--active" : "";
|
|
18
18
|
let match = item.href;
|
|
19
19
|
let match$1 = item.onClick;
|
|
20
|
-
return
|
|
20
|
+
return XoteJSX$Xote.Elements.jsxsKeyed("div", {
|
|
21
21
|
class: "basefn-breadcrumb__item",
|
|
22
|
-
children:
|
|
23
|
-
match !== undefined ?
|
|
22
|
+
children: XoteJSX$Xote.array([
|
|
23
|
+
match !== undefined ? XoteJSX$Xote.Elements.jsx("a", {
|
|
24
24
|
class: "basefn-breadcrumb__link " + className,
|
|
25
25
|
href: match,
|
|
26
|
-
children: Xote.
|
|
26
|
+
children: Node$Xote.text(item.label)
|
|
27
27
|
}) : (
|
|
28
|
-
match$1 !== undefined ?
|
|
28
|
+
match$1 !== undefined ? XoteJSX$Xote.Elements.jsx("button", {
|
|
29
29
|
class: "basefn-breadcrumb__link " + className,
|
|
30
30
|
style: "background: none; border: none; padding: 0; font: inherit;",
|
|
31
31
|
onClick: param => match$1(),
|
|
32
|
-
children: Xote.
|
|
33
|
-
}) :
|
|
32
|
+
children: Node$Xote.text(item.label)
|
|
33
|
+
}) : XoteJSX$Xote.Elements.jsx("span", {
|
|
34
34
|
class: "basefn-breadcrumb__link " + className,
|
|
35
|
-
children: Xote.
|
|
35
|
+
children: Node$Xote.text(item.label)
|
|
36
36
|
})
|
|
37
37
|
),
|
|
38
|
-
isLast ?
|
|
38
|
+
isLast ? XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}) : XoteJSX$Xote.Elements.jsx("span", {
|
|
39
39
|
class: "basefn-breadcrumb__separator",
|
|
40
|
-
children: Xote.
|
|
40
|
+
children: Node$Xote.text(separator)
|
|
41
41
|
})
|
|
42
42
|
])
|
|
43
43
|
}, index.toString(), undefined);
|
|
@@ -1,8 +1,9 @@
|
|
|
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 XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
5
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
6
|
+
import * as ReactiveProp$Xote from "xote/src/ReactiveProp.res.mjs";
|
|
6
7
|
|
|
7
8
|
import './Basefn__Button.css'
|
|
8
9
|
;
|
|
@@ -25,19 +26,19 @@ function Basefn__Button(props) {
|
|
|
25
26
|
let __disabled = props.disabled;
|
|
26
27
|
let __class = props.class;
|
|
27
28
|
let __children = props.children;
|
|
28
|
-
let children = __children !== undefined ? __children :
|
|
29
|
-
let $$class = __class !== undefined ? __class : Xote
|
|
30
|
-
let disabled = __disabled !== undefined ? __disabled : Xote
|
|
29
|
+
let children = __children !== undefined ? __children : XoteJSX$Xote.$$null();
|
|
30
|
+
let $$class = __class !== undefined ? __class : ReactiveProp$Xote.$$static("");
|
|
31
|
+
let disabled = __disabled !== undefined ? __disabled : ReactiveProp$Xote.$$static(false);
|
|
31
32
|
if (__label === undefined) {
|
|
32
|
-
Xote
|
|
33
|
+
ReactiveProp$Xote.$$static("");
|
|
33
34
|
}
|
|
34
35
|
let onClick = __onClick !== undefined ? __onClick : Basefn__Dom.preventDefault;
|
|
35
36
|
let variant = __variant !== undefined ? __variant : "Primary";
|
|
36
|
-
let $$class$1 = Xote.
|
|
37
|
+
let $$class$1 = Computed$Xote.make(() => {
|
|
37
38
|
let variantClass = "basefn-button--" + variantToString(variant);
|
|
38
|
-
return "basefn-button " + variantClass + " " + Xote.
|
|
39
|
+
return "basefn-button " + variantClass + " " + ReactiveProp$Xote.get($$class);
|
|
39
40
|
}, undefined);
|
|
40
|
-
return
|
|
41
|
+
return XoteJSX$Xote.Elements.jsx("button", {
|
|
41
42
|
class: $$class$1,
|
|
42
43
|
disabled: disabled,
|
|
43
44
|
onClick: onClick,
|
|
@@ -15,7 +15,7 @@ let orientationToString = (orientation: orientation) => {
|
|
|
15
15
|
let make = (
|
|
16
16
|
~orientation: orientation=Horizontal,
|
|
17
17
|
~className: option<string>=?,
|
|
18
|
-
~children:
|
|
18
|
+
~children: Node.node,
|
|
19
19
|
) => {
|
|
20
20
|
let getClassName = () => {
|
|
21
21
|
let baseClass = "basefn-button-group"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
4
|
|
|
5
5
|
import './Basefn__ButtonGroup.css'
|
|
6
6
|
;
|
|
@@ -22,7 +22,7 @@ function Basefn__ButtonGroup(props) {
|
|
|
22
22
|
let customClass = className !== undefined ? " " + className : "";
|
|
23
23
|
return "basefn-button-group" + orientationClass + customClass;
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
26
26
|
class: getClassName(),
|
|
27
27
|
role: "group",
|
|
28
28
|
children: props.children
|
|
@@ -14,7 +14,7 @@ let variantToString = (variant: variant) => {
|
|
|
14
14
|
|
|
15
15
|
@jsx.component
|
|
16
16
|
let make = (
|
|
17
|
-
~children:
|
|
17
|
+
~children: XoteJSX.element,
|
|
18
18
|
~variant: variant=Default,
|
|
19
19
|
~header: option<string>=?,
|
|
20
20
|
~footer: option<string>=?,
|
|
@@ -33,12 +33,12 @@ let make = (
|
|
|
33
33
|
|
|
34
34
|
<div class={getClassName()} style>
|
|
35
35
|
{switch header {
|
|
36
|
-
| Some(text) => <div class="basefn-card__header"> {
|
|
36
|
+
| Some(text) => <div class="basefn-card__header"> {Node.text(text)} </div>
|
|
37
37
|
| None => <empty />
|
|
38
38
|
}}
|
|
39
39
|
<div class="basefn-card__body"> {children} </div>
|
|
40
40
|
{switch footer {
|
|
41
|
-
| Some(text) => <div class="basefn-card__footer"> {
|
|
41
|
+
| Some(text) => <div class="basefn-card__footer"> {Node.text(text)} </div>
|
|
42
42
|
| None => <empty />
|
|
43
43
|
}}
|
|
44
44
|
</div>
|
|
@@ -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__Card.css'
|
|
7
7
|
;
|
|
@@ -31,22 +31,22 @@ function Basefn__Card(props) {
|
|
|
31
31
|
let customClass = className !== "" ? " " + className : "";
|
|
32
32
|
return "basefn-card " + variantClass + customClass;
|
|
33
33
|
};
|
|
34
|
-
return
|
|
34
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
35
35
|
class: getClassName(),
|
|
36
36
|
style: style,
|
|
37
|
-
children:
|
|
38
|
-
header !== undefined ?
|
|
37
|
+
children: XoteJSX$Xote.array([
|
|
38
|
+
header !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
39
39
|
class: "basefn-card__header",
|
|
40
|
-
children: Xote.
|
|
41
|
-
}) :
|
|
42
|
-
|
|
40
|
+
children: Node$Xote.text(header)
|
|
41
|
+
}) : XoteJSX$Xote.Elements.jsx("empty", {}),
|
|
42
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
43
43
|
class: "basefn-card__body",
|
|
44
44
|
children: props.children
|
|
45
45
|
}),
|
|
46
|
-
footer !== undefined ?
|
|
46
|
+
footer !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
47
47
|
class: "basefn-card__footer",
|
|
48
|
-
children: Xote.
|
|
49
|
-
}) :
|
|
48
|
+
children: Node$Xote.text(footer)
|
|
49
|
+
}) : XoteJSX$Xote.Elements.jsx("empty", {})
|
|
50
50
|
])
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -20,6 +20,6 @@ let make = (
|
|
|
20
20
|
|
|
21
21
|
<label class={getWrapperClassName()}>
|
|
22
22
|
<input type_="checkbox" class="basefn-checkbox-input" checked={checked} disabled ?onChange />
|
|
23
|
-
<span class="basefn-checkbox-label"> {
|
|
23
|
+
<span class="basefn-checkbox-label"> {Node.text(label)} </span>
|
|
24
24
|
</label>
|
|
25
25
|
}
|
|
@@ -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__Checkbox.css'
|
|
7
7
|
;
|
|
@@ -10,19 +10,19 @@ function Basefn__Checkbox(props) {
|
|
|
10
10
|
let __disabled = props.disabled;
|
|
11
11
|
let disabled = __disabled !== undefined ? __disabled : false;
|
|
12
12
|
let base = "basefn-checkbox-wrapper";
|
|
13
|
-
return
|
|
13
|
+
return XoteJSX$Xote.Elements.jsxs("label", {
|
|
14
14
|
class: disabled ? base + " basefn-checkbox-wrapper--disabled" : base,
|
|
15
|
-
children:
|
|
16
|
-
|
|
15
|
+
children: XoteJSX$Xote.array([
|
|
16
|
+
XoteJSX$Xote.Elements.jsx("input", {
|
|
17
17
|
class: "basefn-checkbox-input",
|
|
18
18
|
type: "checkbox",
|
|
19
19
|
disabled: disabled,
|
|
20
20
|
checked: props.checked,
|
|
21
21
|
onChange: props.onChange
|
|
22
22
|
}),
|
|
23
|
-
|
|
23
|
+
XoteJSX$Xote.Elements.jsx("span", {
|
|
24
24
|
class: "basefn-checkbox-label",
|
|
25
|
-
children: Xote.
|
|
25
|
+
children: Node$Xote.text(props.label)
|
|
26
26
|
})
|
|
27
27
|
])
|
|
28
28
|
});
|
|
@@ -15,7 +15,7 @@ type menuContent =
|
|
|
15
15
|
|
|
16
16
|
@jsx.component
|
|
17
17
|
let make = (
|
|
18
|
-
~trigger:
|
|
18
|
+
~trigger: Node.node,
|
|
19
19
|
~items: array<menuContent>,
|
|
20
20
|
~className: option<string>=?,
|
|
21
21
|
) => {
|
|
@@ -77,13 +77,13 @@ let make = (
|
|
|
77
77
|
onClick={_ => handleItemClick(onClick, disabled)}
|
|
78
78
|
disabled={disabled}
|
|
79
79
|
>
|
|
80
|
-
{
|
|
80
|
+
{Node.text(label)}
|
|
81
81
|
</button>
|
|
82
82
|
}
|
|
83
83
|
| Separator => <div key={Int.toString(index)} class="basefn-context-menu__separator" />
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
|
-
->
|
|
86
|
+
->Node.fragment}
|
|
87
87
|
</div>,
|
|
88
88
|
]
|
|
89
89
|
} else {
|
|
@@ -93,6 +93,6 @@ let make = (
|
|
|
93
93
|
|
|
94
94
|
<div class={getWrapperClass()} onContextMenu={handleContextMenu}>
|
|
95
95
|
{trigger}
|
|
96
|
-
{
|
|
96
|
+
{Node.signalFragment(menuContent)}
|
|
97
97
|
</div>
|
|
98
98
|
}
|
|
@@ -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__ContextMenu.css'
|
|
8
10
|
;
|
|
@@ -10,8 +12,8 @@ import './Basefn__ContextMenu.css'
|
|
|
10
12
|
function Basefn__ContextMenu(props) {
|
|
11
13
|
let className = props.className;
|
|
12
14
|
let items = props.items;
|
|
13
|
-
let isOpen = Xote.
|
|
14
|
-
let position = Xote.
|
|
15
|
+
let isOpen = Signal$Xote.make(false, undefined, undefined);
|
|
16
|
+
let position = Signal$Xote.make([
|
|
15
17
|
0,
|
|
16
18
|
0
|
|
17
19
|
], undefined, undefined);
|
|
@@ -19,33 +21,33 @@ function Basefn__ContextMenu(props) {
|
|
|
19
21
|
evt.preventDefault();
|
|
20
22
|
let x = evt.clientX;
|
|
21
23
|
let y = evt.clientY;
|
|
22
|
-
Xote.
|
|
24
|
+
Signal$Xote.set(position, [
|
|
23
25
|
x,
|
|
24
26
|
y
|
|
25
27
|
]);
|
|
26
|
-
Xote.
|
|
28
|
+
Signal$Xote.set(isOpen, true);
|
|
27
29
|
};
|
|
28
30
|
let getWrapperClass = () => {
|
|
29
31
|
let customClass = className !== undefined ? " " + className : "";
|
|
30
32
|
return "basefn-context-menu" + customClass;
|
|
31
33
|
};
|
|
32
|
-
let menuContent = Xote.
|
|
33
|
-
if (!Xote.
|
|
34
|
+
let menuContent = Computed$Xote.make(() => {
|
|
35
|
+
if (!Signal$Xote.get(isOpen)) {
|
|
34
36
|
return [];
|
|
35
37
|
}
|
|
36
|
-
let match = Xote.
|
|
38
|
+
let match = Signal$Xote.get(position);
|
|
37
39
|
let styleStr = "left: " + match[0].toString() + "px; top: " + match[1].toString() + "px;";
|
|
38
40
|
return [
|
|
39
|
-
|
|
41
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
40
42
|
class: "basefn-context-menu__backdrop",
|
|
41
|
-
onClick: param => Xote.
|
|
43
|
+
onClick: param => Signal$Xote.set(isOpen, false)
|
|
42
44
|
}),
|
|
43
|
-
|
|
45
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
44
46
|
class: "basefn-context-menu__menu",
|
|
45
47
|
style: styleStr,
|
|
46
|
-
children: Xote.
|
|
48
|
+
children: Node$Xote.fragment(items.map((item, index) => {
|
|
47
49
|
if (typeof item !== "object") {
|
|
48
|
-
return
|
|
50
|
+
return XoteJSX$Xote.Elements.jsxKeyed("div", {
|
|
49
51
|
class: "basefn-context-menu__separator"
|
|
50
52
|
}, index.toString(), undefined);
|
|
51
53
|
}
|
|
@@ -58,7 +60,7 @@ function Basefn__ContextMenu(props) {
|
|
|
58
60
|
) + (
|
|
59
61
|
danger ? " basefn-context-menu__item--danger" : ""
|
|
60
62
|
);
|
|
61
|
-
return
|
|
63
|
+
return XoteJSX$Xote.Elements.jsxKeyed("button", {
|
|
62
64
|
class: itemClass,
|
|
63
65
|
disabled: disabled,
|
|
64
66
|
onClick: param => {
|
|
@@ -66,21 +68,21 @@ function Basefn__ContextMenu(props) {
|
|
|
66
68
|
return;
|
|
67
69
|
} else {
|
|
68
70
|
onClick();
|
|
69
|
-
return Xote.
|
|
71
|
+
return Signal$Xote.set(isOpen, false);
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
|
-
children: Xote.
|
|
74
|
+
children: Node$Xote.text(match.label)
|
|
73
75
|
}, index.toString(), undefined);
|
|
74
76
|
}))
|
|
75
77
|
})
|
|
76
78
|
];
|
|
77
79
|
}, undefined);
|
|
78
|
-
return
|
|
80
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
79
81
|
class: getWrapperClass(),
|
|
80
82
|
onContextMenu: handleContextMenu,
|
|
81
|
-
children:
|
|
83
|
+
children: XoteJSX$Xote.array([
|
|
82
84
|
props.trigger,
|
|
83
|
-
Xote.
|
|
85
|
+
Node$Xote.signalFragment(menuContent)
|
|
84
86
|
])
|
|
85
87
|
});
|
|
86
88
|
}
|
|
@@ -32,8 +32,8 @@ let make = (
|
|
|
32
32
|
~title: option<string>=?,
|
|
33
33
|
~showCloseButton: bool=true,
|
|
34
34
|
~closeOnBackdrop: bool=true,
|
|
35
|
-
~children:
|
|
36
|
-
~footer: option<
|
|
35
|
+
~children: Node.node,
|
|
36
|
+
~footer: option<Node.node>=?,
|
|
37
37
|
) => {
|
|
38
38
|
let handleBackdropClick = evt => {
|
|
39
39
|
if closeOnBackdrop {
|
|
@@ -60,10 +60,10 @@ let make = (
|
|
|
60
60
|
{switch title {
|
|
61
61
|
| Some(titleText) =>
|
|
62
62
|
<div class="basefn-drawer__header">
|
|
63
|
-
<h2 class="basefn-drawer__title"> {
|
|
63
|
+
<h2 class="basefn-drawer__title"> {Node.text(titleText)} </h2>
|
|
64
64
|
{showCloseButton
|
|
65
65
|
? <button class="basefn-drawer__close" onClick={_ => onClose()}>
|
|
66
|
-
{
|
|
66
|
+
{Node.text("\u00d7")}
|
|
67
67
|
</button>
|
|
68
68
|
: <> </>}
|
|
69
69
|
</div>
|
|
@@ -82,5 +82,5 @@ let make = (
|
|
|
82
82
|
}
|
|
83
83
|
})
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Node.signalFragment(content)
|
|
86
86
|
}
|