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,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__Drawer.css'
|
|
7
9
|
;
|
|
@@ -59,39 +61,39 @@ function Basefn__Drawer(props) {
|
|
|
59
61
|
let sizeClass = "basefn-drawer--" + sizeToString(size);
|
|
60
62
|
return "basefn-drawer " + positionClass + " " + sizeClass;
|
|
61
63
|
};
|
|
62
|
-
return Xote.
|
|
63
|
-
if (Xote.
|
|
64
|
-
return [
|
|
65
|
-
children:
|
|
66
|
-
|
|
64
|
+
return Node$Xote.signalFragment(Computed$Xote.make(() => {
|
|
65
|
+
if (Signal$Xote.get(isOpen)) {
|
|
66
|
+
return [XoteJSX$Xote.jsxs(XoteJSX$Xote.jsxFragment, {
|
|
67
|
+
children: XoteJSX$Xote.array([
|
|
68
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
67
69
|
class: "basefn-drawer-backdrop",
|
|
68
70
|
onClick: handleBackdropClick
|
|
69
71
|
}),
|
|
70
|
-
|
|
72
|
+
XoteJSX$Xote.Elements.jsxs("div", {
|
|
71
73
|
class: getDrawerClass(),
|
|
72
|
-
children:
|
|
73
|
-
title !== undefined ?
|
|
74
|
+
children: XoteJSX$Xote.array([
|
|
75
|
+
title !== undefined ? XoteJSX$Xote.Elements.jsxs("div", {
|
|
74
76
|
class: "basefn-drawer__header",
|
|
75
|
-
children:
|
|
76
|
-
|
|
77
|
+
children: XoteJSX$Xote.array([
|
|
78
|
+
XoteJSX$Xote.Elements.jsx("h2", {
|
|
77
79
|
class: "basefn-drawer__title",
|
|
78
|
-
children: Xote.
|
|
80
|
+
children: Node$Xote.text(title)
|
|
79
81
|
}),
|
|
80
|
-
showCloseButton ?
|
|
82
|
+
showCloseButton ? XoteJSX$Xote.Elements.jsx("button", {
|
|
81
83
|
class: "basefn-drawer__close",
|
|
82
84
|
onClick: param => onClose(),
|
|
83
|
-
children: Xote.
|
|
84
|
-
}) :
|
|
85
|
+
children: Node$Xote.text("\u00d7")
|
|
86
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
85
87
|
])
|
|
86
|
-
}) :
|
|
87
|
-
|
|
88
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
89
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
88
90
|
class: "basefn-drawer__body",
|
|
89
91
|
children: children
|
|
90
92
|
}),
|
|
91
|
-
footer !== undefined ?
|
|
93
|
+
footer !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
92
94
|
class: "basefn-drawer__footer",
|
|
93
95
|
children: footer
|
|
94
|
-
}) :
|
|
96
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
95
97
|
])
|
|
96
98
|
})
|
|
97
99
|
])
|
|
@@ -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
|
~align: [#left | #right]=#left,
|
|
21
21
|
) => {
|
|
@@ -71,13 +71,13 @@ let make = (
|
|
|
71
71
|
onClick={_ => handleItemClick(onClick, disabled)}
|
|
72
72
|
disabled={disabled}
|
|
73
73
|
>
|
|
74
|
-
{
|
|
74
|
+
{Node.text(label)}
|
|
75
75
|
</button>
|
|
76
76
|
}
|
|
77
77
|
| Separator => <div key={Int.toString(index)} class="basefn-dropdown__separator" />
|
|
78
78
|
}
|
|
79
79
|
})
|
|
80
|
-
->
|
|
80
|
+
->Node.fragment}
|
|
81
81
|
</div>,
|
|
82
82
|
]
|
|
83
83
|
} else {
|
|
@@ -87,6 +87,6 @@ let make = (
|
|
|
87
87
|
|
|
88
88
|
<div class="basefn-dropdown">
|
|
89
89
|
<div onClick={handleToggle}> {trigger} </div>
|
|
90
|
-
{
|
|
90
|
+
{Node.signalFragment(menuContent)}
|
|
91
91
|
</div>
|
|
92
92
|
}
|
|
@@ -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__Dropdown.css'
|
|
8
10
|
;
|
|
@@ -11,25 +13,25 @@ function Basefn__Dropdown(props) {
|
|
|
11
13
|
let __align = props.align;
|
|
12
14
|
let items = props.items;
|
|
13
15
|
let align = __align !== undefined ? __align : "left";
|
|
14
|
-
let isOpen = Xote.
|
|
15
|
-
let handleToggle = param => Xote.
|
|
16
|
+
let isOpen = Signal$Xote.make(false, undefined, undefined);
|
|
17
|
+
let handleToggle = param => Signal$Xote.update(isOpen, prev => !prev);
|
|
16
18
|
let getMenuClass = () => {
|
|
17
19
|
let alignClass = align === "right" ? " basefn-dropdown__menu--right" : "";
|
|
18
20
|
return "basefn-dropdown__menu" + alignClass;
|
|
19
21
|
};
|
|
20
|
-
let handleBackdropClick = param => Xote.
|
|
21
|
-
let menuContent = Xote.
|
|
22
|
-
if (Xote.
|
|
22
|
+
let handleBackdropClick = param => Signal$Xote.set(isOpen, false);
|
|
23
|
+
let menuContent = Computed$Xote.make(() => {
|
|
24
|
+
if (Signal$Xote.get(isOpen)) {
|
|
23
25
|
return [
|
|
24
|
-
|
|
26
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
25
27
|
class: "basefn-dropdown__backdrop",
|
|
26
28
|
onClick: handleBackdropClick
|
|
27
29
|
}),
|
|
28
|
-
|
|
30
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
29
31
|
class: getMenuClass(),
|
|
30
|
-
children: Xote.
|
|
32
|
+
children: Node$Xote.fragment(items.map((item, index) => {
|
|
31
33
|
if (typeof item !== "object") {
|
|
32
|
-
return
|
|
34
|
+
return XoteJSX$Xote.Elements.jsxKeyed("div", {
|
|
33
35
|
class: "basefn-dropdown__separator"
|
|
34
36
|
}, index.toString(), undefined);
|
|
35
37
|
}
|
|
@@ -42,7 +44,7 @@ function Basefn__Dropdown(props) {
|
|
|
42
44
|
) + (
|
|
43
45
|
danger ? " basefn-dropdown__item--danger" : ""
|
|
44
46
|
);
|
|
45
|
-
return
|
|
47
|
+
return XoteJSX$Xote.Elements.jsxKeyed("button", {
|
|
46
48
|
class: className,
|
|
47
49
|
disabled: disabled,
|
|
48
50
|
onClick: param => {
|
|
@@ -50,10 +52,10 @@ function Basefn__Dropdown(props) {
|
|
|
50
52
|
return;
|
|
51
53
|
} else {
|
|
52
54
|
onClick();
|
|
53
|
-
return Xote.
|
|
55
|
+
return Signal$Xote.set(isOpen, false);
|
|
54
56
|
}
|
|
55
57
|
},
|
|
56
|
-
children: Xote.
|
|
58
|
+
children: Node$Xote.text(match.label)
|
|
57
59
|
}, index.toString(), undefined);
|
|
58
60
|
}))
|
|
59
61
|
})
|
|
@@ -62,14 +64,14 @@ function Basefn__Dropdown(props) {
|
|
|
62
64
|
return [];
|
|
63
65
|
}
|
|
64
66
|
}, undefined);
|
|
65
|
-
return
|
|
67
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
66
68
|
class: "basefn-dropdown",
|
|
67
|
-
children:
|
|
68
|
-
|
|
69
|
+
children: XoteJSX$Xote.array([
|
|
70
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
69
71
|
onClick: handleToggle,
|
|
70
72
|
children: props.trigger
|
|
71
73
|
}),
|
|
72
|
-
Xote.
|
|
74
|
+
Node$Xote.signalFragment(menuContent)
|
|
73
75
|
])
|
|
74
76
|
});
|
|
75
77
|
}
|
|
@@ -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 XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
|
+
import * as ReactiveProp$Xote from "xote/src/ReactiveProp.res.mjs";
|
|
5
6
|
|
|
6
7
|
import "./Basefn__Grid.css"
|
|
7
8
|
;
|
|
@@ -131,10 +132,10 @@ function Basefn__Grid(props) {
|
|
|
131
132
|
TAG: "Count",
|
|
132
133
|
_0: 1
|
|
133
134
|
});
|
|
134
|
-
let $$class = __class !== undefined ? __class : Xote
|
|
135
|
-
let style = __style !== undefined ? __style : Xote
|
|
136
|
-
let className = Xote.
|
|
137
|
-
let gridStyle = Xote.
|
|
135
|
+
let $$class = __class !== undefined ? __class : ReactiveProp$Xote.$$static("");
|
|
136
|
+
let style = __style !== undefined ? __style : ReactiveProp$Xote.$$static("");
|
|
137
|
+
let className = Computed$Xote.make(() => "basefn-grid " + ReactiveProp$Xote.get($$class), undefined);
|
|
138
|
+
let gridStyle = Computed$Xote.make(() => {
|
|
138
139
|
let styles = [];
|
|
139
140
|
styles.push("grid-template-columns: " + columnsToString(columns));
|
|
140
141
|
if (rows !== undefined) {
|
|
@@ -171,13 +172,13 @@ function Basefn__Grid(props) {
|
|
|
171
172
|
if (alignContent !== undefined) {
|
|
172
173
|
styles.push("align-content: " + alignContentToString(alignContent));
|
|
173
174
|
}
|
|
174
|
-
let customStyle = Xote.
|
|
175
|
+
let customStyle = ReactiveProp$Xote.get(style);
|
|
175
176
|
if (customStyle !== "") {
|
|
176
177
|
styles.push(customStyle);
|
|
177
178
|
}
|
|
178
179
|
return styles.join("; ");
|
|
179
180
|
}, undefined);
|
|
180
|
-
return
|
|
181
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
181
182
|
class: className,
|
|
182
183
|
style: gridStyle,
|
|
183
184
|
children: props.children
|
|
@@ -211,10 +212,10 @@ function Basefn__Grid$Item(props) {
|
|
|
211
212
|
let justifySelf = props.justifySelf;
|
|
212
213
|
let row = props.row;
|
|
213
214
|
let column = props.column;
|
|
214
|
-
let $$class = __class !== undefined ? __class : Xote
|
|
215
|
-
let style = __style !== undefined ? __style : Xote
|
|
216
|
-
let className = Xote.
|
|
217
|
-
let itemStyle = Xote.
|
|
215
|
+
let $$class = __class !== undefined ? __class : ReactiveProp$Xote.$$static("");
|
|
216
|
+
let style = __style !== undefined ? __style : ReactiveProp$Xote.$$static("");
|
|
217
|
+
let className = Computed$Xote.make(() => "basefn-grid-item " + ReactiveProp$Xote.get($$class), undefined);
|
|
218
|
+
let itemStyle = Computed$Xote.make(() => {
|
|
218
219
|
let styles = [];
|
|
219
220
|
if (column !== undefined) {
|
|
220
221
|
styles.push("grid-column: " + columnSpanToString(column));
|
|
@@ -228,13 +229,13 @@ function Basefn__Grid$Item(props) {
|
|
|
228
229
|
if (alignSelf !== undefined) {
|
|
229
230
|
styles.push("align-self: " + alignItemsToString(alignSelf));
|
|
230
231
|
}
|
|
231
|
-
let customStyle = Xote.
|
|
232
|
+
let customStyle = ReactiveProp$Xote.get(style);
|
|
232
233
|
if (customStyle !== "") {
|
|
233
234
|
styles.push(customStyle);
|
|
234
235
|
}
|
|
235
236
|
return styles.join("; ");
|
|
236
237
|
}, undefined);
|
|
237
|
-
return
|
|
238
|
+
return XoteJSX$Xote.Elements.jsx("div", {
|
|
238
239
|
class: className,
|
|
239
240
|
style: itemStyle,
|
|
240
241
|
children: props.children
|
|
@@ -25,8 +25,8 @@ let alignToString = (align: align) => {
|
|
|
25
25
|
|
|
26
26
|
@jsx.component
|
|
27
27
|
let make = (
|
|
28
|
-
~trigger:
|
|
29
|
-
~content:
|
|
28
|
+
~trigger: Node.node,
|
|
29
|
+
~content: Node.node,
|
|
30
30
|
~position: position=Bottom,
|
|
31
31
|
~align: align=Center,
|
|
32
32
|
~openDelay: int=200,
|
|
@@ -94,6 +94,6 @@ let make = (
|
|
|
94
94
|
<div class="basefn-hover-card__trigger">
|
|
95
95
|
{trigger}
|
|
96
96
|
</div>
|
|
97
|
-
{
|
|
97
|
+
{Node.signalFragment(hoverCardContent)}
|
|
98
98
|
</div>
|
|
99
99
|
}
|
|
@@ -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
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
6
8
|
|
|
7
9
|
import './Basefn__HoverCard.css'
|
|
@@ -42,7 +44,7 @@ function Basefn__HoverCard(props) {
|
|
|
42
44
|
let align = __align !== undefined ? __align : "Center";
|
|
43
45
|
let openDelay = __openDelay !== undefined ? __openDelay : 200;
|
|
44
46
|
let closeDelay = __closeDelay !== undefined ? __closeDelay : 100;
|
|
45
|
-
let isOpen = Xote.
|
|
47
|
+
let isOpen = Signal$Xote.make(false, undefined, undefined);
|
|
46
48
|
let timeoutId = {
|
|
47
49
|
contents: undefined
|
|
48
50
|
};
|
|
@@ -56,12 +58,12 @@ function Basefn__HoverCard(props) {
|
|
|
56
58
|
};
|
|
57
59
|
let handleMouseEnter = param => {
|
|
58
60
|
clearExistingTimeout();
|
|
59
|
-
let id = setTimeout(() => Xote.
|
|
61
|
+
let id = setTimeout(() => Signal$Xote.set(isOpen, true), openDelay);
|
|
60
62
|
timeoutId.contents = Primitive_option.some(id);
|
|
61
63
|
};
|
|
62
64
|
let handleMouseLeave = param => {
|
|
63
65
|
clearExistingTimeout();
|
|
64
|
-
let id = setTimeout(() => Xote.
|
|
66
|
+
let id = setTimeout(() => Signal$Xote.set(isOpen, false), closeDelay);
|
|
65
67
|
timeoutId.contents = Primitive_option.some(id);
|
|
66
68
|
};
|
|
67
69
|
let getHoverCardClassName = () => {
|
|
@@ -73,9 +75,9 @@ function Basefn__HoverCard(props) {
|
|
|
73
75
|
let alignClass = " basefn-hover-card__content--align-" + alignToString(align);
|
|
74
76
|
return "basefn-hover-card__content" + positionClass + alignClass;
|
|
75
77
|
};
|
|
76
|
-
let hoverCardContent = Xote.
|
|
77
|
-
if (Xote.
|
|
78
|
-
return [
|
|
78
|
+
let hoverCardContent = Computed$Xote.make(() => {
|
|
79
|
+
if (Signal$Xote.get(isOpen)) {
|
|
80
|
+
return [XoteJSX$Xote.Elements.jsx("div", {
|
|
79
81
|
class: getContentClassName(),
|
|
80
82
|
onMouseEnter: handleMouseEnter,
|
|
81
83
|
onMouseLeave: handleMouseLeave,
|
|
@@ -85,16 +87,16 @@ function Basefn__HoverCard(props) {
|
|
|
85
87
|
return [];
|
|
86
88
|
}
|
|
87
89
|
}, undefined);
|
|
88
|
-
return
|
|
90
|
+
return XoteJSX$Xote.Elements.jsxs("div", {
|
|
89
91
|
class: getHoverCardClassName(),
|
|
90
92
|
onMouseEnter: handleMouseEnter,
|
|
91
93
|
onMouseLeave: handleMouseLeave,
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
+
children: XoteJSX$Xote.array([
|
|
95
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
94
96
|
class: "basefn-hover-card__trigger",
|
|
95
97
|
children: props.trigger
|
|
96
98
|
}),
|
|
97
|
-
Xote.
|
|
99
|
+
Node$Xote.signalFragment(hoverCardContent)
|
|
98
100
|
])
|
|
99
101
|
});
|
|
100
102
|
}
|
|
@@ -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 XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
4
|
+
import * as Computed$Xote from "xote/src/Computed.res.mjs";
|
|
5
|
+
import * as ReactiveProp$Xote from "xote/src/ReactiveProp.res.mjs";
|
|
5
6
|
import XJs from "lucide/dist/esm/icons/x.js";
|
|
6
7
|
import SunJs from "lucide/dist/esm/icons/sun.js";
|
|
7
8
|
import CopyJs from "lucide/dist/esm/icons/copy.js";
|
|
@@ -152,18 +153,18 @@ function Basefn__Icon(props) {
|
|
|
152
153
|
let __class = props.class;
|
|
153
154
|
let __size = props.size;
|
|
154
155
|
let size = __size !== undefined ? __size : "Md";
|
|
155
|
-
let $$class = __class !== undefined ? __class : Xote
|
|
156
|
-
let color = __color !== undefined ? __color : Xote
|
|
156
|
+
let $$class = __class !== undefined ? __class : ReactiveProp$Xote.$$static("");
|
|
157
|
+
let color = __color !== undefined ? __color : ReactiveProp$Xote.$$static("currentColor");
|
|
157
158
|
let iconData = getIconData(props.name);
|
|
158
159
|
let sizeStr = sizeToPixels(size);
|
|
159
160
|
let svgInner = iconToSvgInner(iconData);
|
|
160
|
-
let className = Xote.
|
|
161
|
-
let style = Xote.
|
|
161
|
+
let className = Computed$Xote.make(() => "basefn-icon " + ReactiveProp$Xote.get($$class), undefined);
|
|
162
|
+
let style = Computed$Xote.make(() => "color: " + ReactiveProp$Xote.get(color) + "; width: " + sizeStr + "px; height: " + sizeStr + "px; display: inline-flex;", undefined);
|
|
162
163
|
let svgHtml = `<svg width="` + sizeStr + `" height="` + sizeStr + `" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%;">` + svgInner + `</svg>`;
|
|
163
164
|
iconIdCounter.contents = iconIdCounter.contents + 1 | 0;
|
|
164
165
|
let iconId = "basefn-icon-" + iconIdCounter.contents.toString();
|
|
165
166
|
injectIconHTML(iconId, svgHtml);
|
|
166
|
-
return
|
|
167
|
+
return XoteJSX$Xote.Elements.jsx("span", {
|
|
167
168
|
id: iconId,
|
|
168
169
|
class: className,
|
|
169
170
|
style: style
|
|
@@ -1,8 +1,8 @@
|
|
|
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 XoteJSX$Xote from "xote/src/XoteJSX.res.mjs";
|
|
5
4
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
5
|
+
import * as ReactiveProp$Xote from "xote/src/ReactiveProp.res.mjs";
|
|
6
6
|
|
|
7
7
|
import './Basefn__Input.css'
|
|
8
8
|
;
|
|
@@ -37,12 +37,12 @@ function Basefn__Input(props) {
|
|
|
37
37
|
let __type_ = props.type_;
|
|
38
38
|
let type_ = __type_ !== undefined ? __type_ : "Text";
|
|
39
39
|
let placeholder = __placeholder !== undefined ? __placeholder : "";
|
|
40
|
-
let disabled = __disabled !== undefined ? __disabled : Xote
|
|
40
|
+
let disabled = __disabled !== undefined ? __disabled : ReactiveProp$Xote.$$static(false);
|
|
41
41
|
let radius = __radius !== undefined ? __radius : "Md";
|
|
42
42
|
let radiusClass;
|
|
43
43
|
radiusClass = radius === "Full" ? "basefn-input--radius-full" : "";
|
|
44
44
|
let $$class = "basefn-input " + radiusClass;
|
|
45
|
-
return
|
|
45
|
+
return XoteJSX$Xote.Elements.jsx("input", {
|
|
46
46
|
class: $$class,
|
|
47
47
|
style: props.style,
|
|
48
48
|
type: inputTypeToString(type_),
|
|
@@ -20,8 +20,8 @@ let make = (~keys: Signal.t<array<string>>, ~size: size=Md) => {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
<kbd class={getClassName()}>
|
|
23
|
-
{
|
|
24
|
-
<span class="basefn-kbd__key"> {
|
|
23
|
+
{Node.list(keys, key => {
|
|
24
|
+
<span class="basefn-kbd__key"> {Node.text(key)} </span>
|
|
25
25
|
})}
|
|
26
26
|
</kbd>
|
|
27
27
|
}
|
|
@@ -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__Kbd.css'
|
|
7
7
|
;
|
|
@@ -24,11 +24,11 @@ function Basefn__Kbd(props) {
|
|
|
24
24
|
let sizeClass = "basefn-kbd--" + sizeToString(size);
|
|
25
25
|
return "basefn-kbd " + sizeClass;
|
|
26
26
|
};
|
|
27
|
-
return
|
|
27
|
+
return XoteJSX$Xote.Elements.jsx("kbd", {
|
|
28
28
|
class: getClassName(),
|
|
29
|
-
children: Xote.
|
|
29
|
+
children: Node$Xote.list(props.keys, key => XoteJSX$Xote.Elements.jsx("span", {
|
|
30
30
|
class: "basefn-kbd__key",
|
|
31
|
-
children: Xote.
|
|
31
|
+
children: Node$Xote.text(key)
|
|
32
32
|
}))
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -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__Label.css'
|
|
7
7
|
;
|
|
@@ -10,9 +10,9 @@ function Basefn__Label(props) {
|
|
|
10
10
|
let __required = props.required;
|
|
11
11
|
let required = __required !== undefined ? __required : false;
|
|
12
12
|
let base = "basefn-label";
|
|
13
|
-
return
|
|
13
|
+
return XoteJSX$Xote.Elements.jsx("label", {
|
|
14
14
|
class: required ? base + " basefn-label--required" : base,
|
|
15
|
-
children: Xote.
|
|
15
|
+
children: Node$Xote.text(props.text)
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -21,8 +21,8 @@ let make = (
|
|
|
21
21
|
~size: size=Md,
|
|
22
22
|
~closeOnBackdrop: bool=true,
|
|
23
23
|
~showCloseButton: bool=true,
|
|
24
|
-
~children:
|
|
25
|
-
~footer: option<
|
|
24
|
+
~children: Node.node,
|
|
25
|
+
~footer: option<Node.node>=?,
|
|
26
26
|
) => {
|
|
27
27
|
let handleBackdropClick = evt => {
|
|
28
28
|
if closeOnBackdrop {
|
|
@@ -48,10 +48,10 @@ let make = (
|
|
|
48
48
|
{switch title {
|
|
49
49
|
| Some(titleText) =>
|
|
50
50
|
<div class="basefn-modal__header">
|
|
51
|
-
<h2 class="basefn-modal__title"> {
|
|
51
|
+
<h2 class="basefn-modal__title"> {Node.text(titleText)} </h2>
|
|
52
52
|
{showCloseButton
|
|
53
53
|
? <button class="basefn-modal__close" onClick={_ => onClose()}>
|
|
54
|
-
{
|
|
54
|
+
{Node.text("\u00d7")}
|
|
55
55
|
</button>
|
|
56
56
|
: <> </>}
|
|
57
57
|
</div>
|
|
@@ -70,5 +70,5 @@ let make = (
|
|
|
70
70
|
}
|
|
71
71
|
})
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Node.signalFragment(content)
|
|
74
74
|
}
|
|
@@ -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__Modal.css'
|
|
7
9
|
;
|
|
@@ -45,36 +47,36 @@ function Basefn__Modal(props) {
|
|
|
45
47
|
let sizeClass = "basefn-modal--" + sizeToString(size);
|
|
46
48
|
return "basefn-modal " + sizeClass;
|
|
47
49
|
};
|
|
48
|
-
return Xote.
|
|
49
|
-
if (Xote.
|
|
50
|
-
return [
|
|
50
|
+
return Node$Xote.signalFragment(Computed$Xote.make(() => {
|
|
51
|
+
if (Signal$Xote.get(isOpen)) {
|
|
52
|
+
return [XoteJSX$Xote.Elements.jsx("div", {
|
|
51
53
|
class: "basefn-modal-backdrop",
|
|
52
54
|
onClick: handleBackdropClick,
|
|
53
|
-
children:
|
|
55
|
+
children: XoteJSX$Xote.Elements.jsxs("div", {
|
|
54
56
|
class: getModalClass(),
|
|
55
|
-
children:
|
|
56
|
-
title !== undefined ?
|
|
57
|
+
children: XoteJSX$Xote.array([
|
|
58
|
+
title !== undefined ? XoteJSX$Xote.Elements.jsxs("div", {
|
|
57
59
|
class: "basefn-modal__header",
|
|
58
|
-
children:
|
|
59
|
-
|
|
60
|
+
children: XoteJSX$Xote.array([
|
|
61
|
+
XoteJSX$Xote.Elements.jsx("h2", {
|
|
60
62
|
class: "basefn-modal__title",
|
|
61
|
-
children: Xote.
|
|
63
|
+
children: Node$Xote.text(title)
|
|
62
64
|
}),
|
|
63
|
-
showCloseButton ?
|
|
65
|
+
showCloseButton ? XoteJSX$Xote.Elements.jsx("button", {
|
|
64
66
|
class: "basefn-modal__close",
|
|
65
67
|
onClick: param => onClose(),
|
|
66
|
-
children: Xote.
|
|
67
|
-
}) :
|
|
68
|
+
children: Node$Xote.text("\u00d7")
|
|
69
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
68
70
|
])
|
|
69
|
-
}) :
|
|
70
|
-
|
|
71
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {}),
|
|
72
|
+
XoteJSX$Xote.Elements.jsx("div", {
|
|
71
73
|
class: "basefn-modal__body",
|
|
72
74
|
children: children
|
|
73
75
|
}),
|
|
74
|
-
footer !== undefined ?
|
|
76
|
+
footer !== undefined ? XoteJSX$Xote.Elements.jsx("div", {
|
|
75
77
|
class: "basefn-modal__footer",
|
|
76
78
|
children: footer
|
|
77
|
-
}) :
|
|
79
|
+
}) : XoteJSX$Xote.jsx(XoteJSX$Xote.jsxFragment, {})
|
|
78
80
|
])
|
|
79
81
|
})
|
|
80
82
|
})];
|
|
@@ -25,8 +25,8 @@ let alignToString = (align: align) => {
|
|
|
25
25
|
|
|
26
26
|
@jsx.component
|
|
27
27
|
let make = (
|
|
28
|
-
~trigger:
|
|
29
|
-
~content:
|
|
28
|
+
~trigger: Node.node,
|
|
29
|
+
~content: Node.node,
|
|
30
30
|
~isOpen: Signal.t<bool>,
|
|
31
31
|
~onOpenChange: option<bool => unit>=?,
|
|
32
32
|
~position: position=Bottom,
|
|
@@ -90,6 +90,6 @@ let make = (
|
|
|
90
90
|
<div class="basefn-popover__trigger" onClick={handleTriggerClick}>
|
|
91
91
|
{trigger}
|
|
92
92
|
</div>
|
|
93
|
-
{
|
|
93
|
+
{Node.signalFragment(popoverContent)}
|
|
94
94
|
</div>
|
|
95
95
|
}
|