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__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)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as Xote from "xote/src/
|
|
3
|
+
import * as Signal$Xote from "xote/src/Signal.res.mjs";
|
|
4
4
|
|
|
5
|
-
let currentTheme = Xote.
|
|
5
|
+
let currentTheme = Signal$Xote.make("Light", undefined, undefined);
|
|
6
6
|
|
|
7
7
|
function themeToString(theme) {
|
|
8
8
|
if (theme === "Light") {
|
|
@@ -52,17 +52,17 @@ function loadThemePreference() {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function toggleTheme() {
|
|
55
|
-
let match = Xote.
|
|
55
|
+
let match = Signal$Xote.get(currentTheme);
|
|
56
56
|
let newTheme;
|
|
57
57
|
newTheme = match === "Light" ? "Dark" : "Light";
|
|
58
|
-
Xote.
|
|
58
|
+
Signal$Xote.set(currentTheme, newTheme);
|
|
59
59
|
applyTheme(newTheme);
|
|
60
60
|
saveThemePreference(newTheme);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function init() {
|
|
64
64
|
let stored = loadThemePreference();
|
|
65
|
-
Xote.
|
|
65
|
+
Signal$Xote.set(currentTheme, stored);
|
|
66
66
|
applyTheme(stored);
|
|
67
67
|
}
|
|
68
68
|
|