basefn 1.0.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/README.md +104 -0
- package/package.json +82 -0
- package/rescript.json +32 -0
- package/src/Basefn.css +14 -0
- package/src/Basefn.res +105 -0
- package/src/Basefn.res.mjs +114 -0
- package/src/Basefn__Dom.res +9 -0
- package/src/Basefn__Dom.res.mjs +24 -0
- package/src/Basefn__Utils.res +15 -0
- package/src/Basefn__Utils.res.mjs +32 -0
- package/src/Demo.res +1417 -0
- package/src/Demo.res.mjs +2328 -0
- package/src/Eita.res.mjs +105 -0
- package/src/Eita__Accordion.res.mjs +77 -0
- package/src/Eita__Alert.res.mjs +81 -0
- package/src/Eita__AppLayout.res.mjs +100 -0
- package/src/Eita__Avatar.res.mjs +40 -0
- package/src/Eita__Badge.res.mjs +65 -0
- package/src/Eita__Breadcrumb.res.mjs +53 -0
- package/src/Eita__Button.res.mjs +47 -0
- package/src/Eita__Card.res.mjs +60 -0
- package/src/Eita__Checkbox.res.mjs +36 -0
- package/src/Eita__Dom.res.mjs +16 -0
- package/src/Eita__Drawer.res.mjs +112 -0
- package/src/Eita__Dropdown.res.mjs +96 -0
- package/src/Eita__Grid.res.mjs +24 -0
- package/src/Eita__Input.res.mjs +54 -0
- package/src/Eita__Kbd.res.mjs +42 -0
- package/src/Eita__Label.res.mjs +24 -0
- package/src/Eita__Modal.res.mjs +93 -0
- package/src/Eita__Progress.res.mjs +101 -0
- package/src/Eita__Radio.res.mjs +38 -0
- package/src/Eita__Select.res.mjs +40 -0
- package/src/Eita__Separator.res.mjs +70 -0
- package/src/Eita__Sidebar.res.mjs +103 -0
- package/src/Eita__Slider.res.mjs +89 -0
- package/src/Eita__Spinner.res.mjs +69 -0
- package/src/Eita__Stepper.res.mjs +114 -0
- package/src/Eita__Switch.res.mjs +84 -0
- package/src/Eita__Tabs.res.mjs +57 -0
- package/src/Eita__Textarea.res.mjs +39 -0
- package/src/Eita__Timeline.res.mjs +86 -0
- package/src/Eita__Toast.res.mjs +112 -0
- package/src/Eita__Tooltip.res.mjs +60 -0
- package/src/Eita__Topbar.res.mjs +96 -0
- package/src/Eita__Typography.res.mjs +183 -0
- package/src/Eita__Utils.res.mjs +32 -0
- package/src/Example.res +111 -0
- package/src/Example.res.mjs +176 -0
- package/src/components/Basefn__Accordion.css +70 -0
- package/src/components/Basefn__Accordion.res +79 -0
- package/src/components/Basefn__Accordion.res.mjs +77 -0
- package/src/components/Basefn__Alert.css +79 -0
- package/src/components/Basefn__Alert.res +68 -0
- package/src/components/Basefn__Alert.res.mjs +78 -0
- package/src/components/Basefn__AppLayout.css +100 -0
- package/src/components/Basefn__AppLayout.res +74 -0
- package/src/components/Basefn__AppLayout.res.mjs +100 -0
- package/src/components/Basefn__Avatar.css +25 -0
- package/src/components/Basefn__Avatar.res +23 -0
- package/src/components/Basefn__Avatar.res.mjs +40 -0
- package/src/components/Basefn__Badge.css +71 -0
- package/src/components/Basefn__Badge.res +43 -0
- package/src/components/Basefn__Badge.res.mjs +65 -0
- package/src/components/Basefn__Breadcrumb.css +36 -0
- package/src/components/Basefn__Breadcrumb.res +45 -0
- package/src/components/Basefn__Breadcrumb.res.mjs +53 -0
- package/src/components/Basefn__Button.css +83 -0
- package/src/components/Basefn__Button.res +32 -0
- package/src/components/Basefn__Button.res.mjs +54 -0
- package/src/components/Basefn__Card.css +50 -0
- package/src/components/Basefn__Card.res +45 -0
- package/src/components/Basefn__Card.res.mjs +60 -0
- package/src/components/Basefn__Checkbox.css +72 -0
- package/src/components/Basefn__Checkbox.res +25 -0
- package/src/components/Basefn__Checkbox.res.mjs +36 -0
- package/src/components/Basefn__Drawer.css +168 -0
- package/src/components/Basefn__Drawer.res +86 -0
- package/src/components/Basefn__Drawer.res.mjs +112 -0
- package/src/components/Basefn__Dropdown.css +76 -0
- package/src/components/Basefn__Dropdown.res +85 -0
- package/src/components/Basefn__Dropdown.res.mjs +96 -0
- package/src/components/Basefn__Grid.css +11 -0
- package/src/components/Basefn__Grid.res +296 -0
- package/src/components/Basefn__Grid.res.mjs +263 -0
- package/src/components/Basefn__Icon.css +12 -0
- package/src/components/Basefn__Icon.res +196 -0
- package/src/components/Basefn__Icon.res.mjs +183 -0
- package/src/components/Basefn__Input.css +44 -0
- package/src/components/Basefn__Input.res +48 -0
- package/src/components/Basefn__Input.res.mjs +63 -0
- package/src/components/Basefn__Kbd.css +65 -0
- package/src/components/Basefn__Kbd.res +27 -0
- package/src/components/Basefn__Kbd.res.mjs +42 -0
- package/src/components/Basefn__Label.css +22 -0
- package/src/components/Basefn__Label.res +18 -0
- package/src/components/Basefn__Label.res.mjs +24 -0
- package/src/components/Basefn__Modal.css +100 -0
- package/src/components/Basefn__Modal.res +74 -0
- package/src/components/Basefn__Modal.res.mjs +93 -0
- package/src/components/Basefn__Progress.css +69 -0
- package/src/components/Basefn__Progress.res +88 -0
- package/src/components/Basefn__Progress.res.mjs +101 -0
- package/src/components/Basefn__Radio.css +72 -0
- package/src/components/Basefn__Radio.res +35 -0
- package/src/components/Basefn__Radio.res.mjs +38 -0
- package/src/components/Basefn__Select.css +44 -0
- package/src/components/Basefn__Select.res +33 -0
- package/src/components/Basefn__Select.res.mjs +40 -0
- package/src/components/Basefn__Separator.css +85 -0
- package/src/components/Basefn__Separator.res +45 -0
- package/src/components/Basefn__Separator.res.mjs +70 -0
- package/src/components/Basefn__Sidebar.css +141 -0
- package/src/components/Basefn__Sidebar.res +95 -0
- package/src/components/Basefn__Sidebar.res.mjs +107 -0
- package/src/components/Basefn__Slider.css +97 -0
- package/src/components/Basefn__Slider.res +68 -0
- package/src/components/Basefn__Slider.res.mjs +89 -0
- package/src/components/Basefn__Spinner.css +63 -0
- package/src/components/Basefn__Spinner.res +44 -0
- package/src/components/Basefn__Spinner.res.mjs +69 -0
- package/src/components/Basefn__Stepper.css +141 -0
- package/src/components/Basefn__Stepper.res +86 -0
- package/src/components/Basefn__Stepper.res.mjs +114 -0
- package/src/components/Basefn__Switch.css +80 -0
- package/src/components/Basefn__Switch.res +62 -0
- package/src/components/Basefn__Switch.res.mjs +84 -0
- package/src/components/Basefn__Tabs.css +54 -0
- package/src/components/Basefn__Tabs.res +73 -0
- package/src/components/Basefn__Tabs.res.mjs +57 -0
- package/src/components/Basefn__Textarea.css +41 -0
- package/src/components/Basefn__Textarea.res +28 -0
- package/src/components/Basefn__Textarea.res.mjs +41 -0
- package/src/components/Basefn__ThemeToggle.css +5 -0
- package/src/components/Basefn__ThemeToggle.res +29 -0
- package/src/components/Basefn__ThemeToggle.res.mjs +49 -0
- package/src/components/Basefn__Timeline.css +144 -0
- package/src/components/Basefn__Timeline.res +70 -0
- package/src/components/Basefn__Timeline.res.mjs +86 -0
- package/src/components/Basefn__Toast.css +100 -0
- package/src/components/Basefn__Toast.res +92 -0
- package/src/components/Basefn__Toast.res.mjs +112 -0
- package/src/components/Basefn__Tooltip.css +84 -0
- package/src/components/Basefn__Tooltip.res +42 -0
- package/src/components/Basefn__Tooltip.res.mjs +60 -0
- package/src/components/Basefn__Topbar.css +130 -0
- package/src/components/Basefn__Topbar.res +92 -0
- package/src/components/Basefn__Topbar.res.mjs +91 -0
- package/src/components/Basefn__Typography.css +120 -0
- package/src/components/Basefn__Typography.res +96 -0
- package/src/components/Basefn__Typography.res.mjs +175 -0
- package/src/styles/Basefn__Theme.res +63 -0
- package/src/styles/Basefn__Theme.res.mjs +65 -0
- package/src/styles/variables.css +199 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Drawer.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function positionToString(position) {
|
|
10
|
+
switch (position) {
|
|
11
|
+
case "Left" :
|
|
12
|
+
return "left";
|
|
13
|
+
case "Right" :
|
|
14
|
+
return "right";
|
|
15
|
+
case "Top" :
|
|
16
|
+
return "top";
|
|
17
|
+
case "Bottom" :
|
|
18
|
+
return "bottom";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function sizeToString(size) {
|
|
23
|
+
switch (size) {
|
|
24
|
+
case "Sm" :
|
|
25
|
+
return "sm";
|
|
26
|
+
case "Md" :
|
|
27
|
+
return "md";
|
|
28
|
+
case "Lg" :
|
|
29
|
+
return "lg";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function Eita__Drawer(props) {
|
|
34
|
+
let footer = props.footer;
|
|
35
|
+
let children = props.children;
|
|
36
|
+
let __closeOnBackdrop = props.closeOnBackdrop;
|
|
37
|
+
let __showCloseButton = props.showCloseButton;
|
|
38
|
+
let title = props.title;
|
|
39
|
+
let __size = props.size;
|
|
40
|
+
let __position = props.position;
|
|
41
|
+
let onClose = props.onClose;
|
|
42
|
+
let isOpen = props.isOpen;
|
|
43
|
+
let position = __position !== undefined ? __position : "Right";
|
|
44
|
+
let size = __size !== undefined ? __size : "Md";
|
|
45
|
+
let showCloseButton = __showCloseButton !== undefined ? __showCloseButton : true;
|
|
46
|
+
let closeOnBackdrop = __closeOnBackdrop !== undefined ? __closeOnBackdrop : true;
|
|
47
|
+
let handleBackdropClick = evt => {
|
|
48
|
+
if (!closeOnBackdrop) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
let target = evt.target;
|
|
52
|
+
let currentTarget = evt.currentTarget;
|
|
53
|
+
if (target === currentTarget) {
|
|
54
|
+
return onClose();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
let getDrawerClass = () => {
|
|
58
|
+
let positionClass = "basefn-drawer--" + positionToString(position);
|
|
59
|
+
let sizeClass = "basefn-drawer--" + sizeToString(size);
|
|
60
|
+
return "basefn-drawer " + positionClass + " " + sizeClass;
|
|
61
|
+
};
|
|
62
|
+
return Xote.Component.signalFragment(Xote.Computed.make(() => {
|
|
63
|
+
if (Xote.Signal.get(isOpen)) {
|
|
64
|
+
return [Xote__JSX.jsxs(Xote__JSX.jsxFragment, {
|
|
65
|
+
children: Xote__JSX.array([
|
|
66
|
+
Xote__JSX.Elements.jsx("div", {
|
|
67
|
+
class: "basefn-drawer-backdrop",
|
|
68
|
+
onClick: handleBackdropClick
|
|
69
|
+
}),
|
|
70
|
+
Xote__JSX.Elements.jsxs("div", {
|
|
71
|
+
class: getDrawerClass(),
|
|
72
|
+
children: Xote__JSX.array([
|
|
73
|
+
title !== undefined ? Xote__JSX.Elements.jsxs("div", {
|
|
74
|
+
class: "basefn-drawer__header",
|
|
75
|
+
children: Xote__JSX.array([
|
|
76
|
+
Xote__JSX.Elements.jsx("h2", {
|
|
77
|
+
class: "basefn-drawer__title",
|
|
78
|
+
children: Xote.Component.text(title)
|
|
79
|
+
}),
|
|
80
|
+
showCloseButton ? Xote__JSX.Elements.jsx("button", {
|
|
81
|
+
class: "basefn-drawer__close",
|
|
82
|
+
onClick: param => onClose(),
|
|
83
|
+
children: Xote.Component.text("\u00d7")
|
|
84
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {})
|
|
85
|
+
])
|
|
86
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {}),
|
|
87
|
+
Xote__JSX.Elements.jsx("div", {
|
|
88
|
+
class: "basefn-drawer__body",
|
|
89
|
+
children: children
|
|
90
|
+
}),
|
|
91
|
+
footer !== undefined ? Xote__JSX.Elements.jsx("div", {
|
|
92
|
+
class: "basefn-drawer__footer",
|
|
93
|
+
children: footer
|
|
94
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {})
|
|
95
|
+
])
|
|
96
|
+
})
|
|
97
|
+
])
|
|
98
|
+
})];
|
|
99
|
+
} else {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
}, undefined));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let make = Eita__Drawer;
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
positionToString,
|
|
109
|
+
sizeToString,
|
|
110
|
+
make,
|
|
111
|
+
}
|
|
112
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Dropdown.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function Eita__Dropdown(props) {
|
|
10
|
+
let __align = props.align;
|
|
11
|
+
let items = props.items;
|
|
12
|
+
let align = __align !== undefined ? __align : "left";
|
|
13
|
+
let isOpen = Xote.Signal.make(false, undefined, undefined);
|
|
14
|
+
let handleToggle = param => Xote.Signal.update(isOpen, prev => !prev);
|
|
15
|
+
let getMenuClass = () => {
|
|
16
|
+
let alignClass = align === "right" ? " basefn-dropdown__menu--right" : "";
|
|
17
|
+
return "basefn-dropdown__menu" + alignClass;
|
|
18
|
+
};
|
|
19
|
+
let menuContent = Xote.Computed.make(() => {
|
|
20
|
+
if (Xote.Signal.get(isOpen)) {
|
|
21
|
+
return [Xote__JSX.Elements.jsx("div", {
|
|
22
|
+
class: getMenuClass(),
|
|
23
|
+
children: Xote.Component.fragment(items.map((item, index) => {
|
|
24
|
+
if (typeof item !== "object") {
|
|
25
|
+
return Xote__JSX.Elements.jsxKeyed("div", {
|
|
26
|
+
class: "basefn-dropdown__separator"
|
|
27
|
+
}, index.toString(), undefined);
|
|
28
|
+
}
|
|
29
|
+
let match = item._0;
|
|
30
|
+
let disabled = match.disabled;
|
|
31
|
+
if (disabled !== undefined) {
|
|
32
|
+
let danger = match.danger;
|
|
33
|
+
if (danger !== undefined) {
|
|
34
|
+
let onClick = match.onClick;
|
|
35
|
+
let className = "basefn-dropdown__item" + (
|
|
36
|
+
disabled ? " basefn-dropdown__item--disabled" : ""
|
|
37
|
+
) + (
|
|
38
|
+
danger ? " basefn-dropdown__item--danger" : ""
|
|
39
|
+
);
|
|
40
|
+
return Xote__JSX.Elements.jsxKeyed("button", {
|
|
41
|
+
class: className,
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
onClick: param => {
|
|
44
|
+
if (disabled) {
|
|
45
|
+
return;
|
|
46
|
+
} else {
|
|
47
|
+
onClick();
|
|
48
|
+
return Xote.Signal.set(isOpen, false);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
children: Xote.Component.text(match.label)
|
|
52
|
+
}, index.toString(), undefined);
|
|
53
|
+
}
|
|
54
|
+
throw {
|
|
55
|
+
RE_EXN_ID: "Match_failure",
|
|
56
|
+
_1: [
|
|
57
|
+
"Eita__Dropdown.res",
|
|
58
|
+
53,
|
|
59
|
+
12
|
|
60
|
+
],
|
|
61
|
+
Error: new Error()
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
throw {
|
|
65
|
+
RE_EXN_ID: "Match_failure",
|
|
66
|
+
_1: [
|
|
67
|
+
"Eita__Dropdown.res",
|
|
68
|
+
53,
|
|
69
|
+
12
|
|
70
|
+
],
|
|
71
|
+
Error: new Error()
|
|
72
|
+
};
|
|
73
|
+
}))
|
|
74
|
+
})];
|
|
75
|
+
} else {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
}, undefined);
|
|
79
|
+
return Xote__JSX.Elements.jsxs("div", {
|
|
80
|
+
class: "basefn-dropdown",
|
|
81
|
+
children: Xote__JSX.array([
|
|
82
|
+
Xote__JSX.Elements.jsx("div", {
|
|
83
|
+
onClick: handleToggle,
|
|
84
|
+
children: props.trigger
|
|
85
|
+
}),
|
|
86
|
+
Xote.Component.signalFragment(menuContent)
|
|
87
|
+
])
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let make = Eita__Dropdown;
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
make,
|
|
95
|
+
}
|
|
96
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
4
|
+
|
|
5
|
+
import "./Eita__Grid.css"
|
|
6
|
+
;
|
|
7
|
+
|
|
8
|
+
function Eita__Grid(props) {
|
|
9
|
+
let __gap = props.gap;
|
|
10
|
+
let gap = __gap !== undefined ? __gap : "0.5rem";
|
|
11
|
+
let style = "gap: " + gap + ";";
|
|
12
|
+
return Xote__JSX.Elements.jsx("div", {
|
|
13
|
+
class: "basefn-grid",
|
|
14
|
+
style: style,
|
|
15
|
+
children: props.children
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let make = Eita__Grid;
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
make,
|
|
23
|
+
}
|
|
24
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
4
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
5
|
+
|
|
6
|
+
import './Eita__Input.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function inputTypeToString(type_) {
|
|
10
|
+
switch (type_) {
|
|
11
|
+
case "Text" :
|
|
12
|
+
return "text";
|
|
13
|
+
case "Email" :
|
|
14
|
+
return "email";
|
|
15
|
+
case "Password" :
|
|
16
|
+
return "password";
|
|
17
|
+
case "Number" :
|
|
18
|
+
return "number";
|
|
19
|
+
case "Tel" :
|
|
20
|
+
return "tel";
|
|
21
|
+
case "Url" :
|
|
22
|
+
return "url";
|
|
23
|
+
case "Search" :
|
|
24
|
+
return "search";
|
|
25
|
+
case "Date" :
|
|
26
|
+
return "date";
|
|
27
|
+
case "Time" :
|
|
28
|
+
return "time";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Eita__Input(props) {
|
|
33
|
+
let __placeholder = props.placeholder;
|
|
34
|
+
let __type_ = props.type_;
|
|
35
|
+
let type_ = __type_ !== undefined ? __type_ : "Text";
|
|
36
|
+
let placeholder = __placeholder !== undefined ? __placeholder : "";
|
|
37
|
+
return Xote__JSX.Elements.jsx("input", {
|
|
38
|
+
class: "basefn-input",
|
|
39
|
+
type: inputTypeToString(type_),
|
|
40
|
+
name: Primitive_option.some(props.name),
|
|
41
|
+
value: props.value,
|
|
42
|
+
placeholder: placeholder,
|
|
43
|
+
disabled: false,
|
|
44
|
+
onInput: props.onInput
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let make = Eita__Input;
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
inputTypeToString,
|
|
52
|
+
make,
|
|
53
|
+
}
|
|
54
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Kbd.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function sizeToString(size) {
|
|
10
|
+
switch (size) {
|
|
11
|
+
case "Sm" :
|
|
12
|
+
return "sm";
|
|
13
|
+
case "Md" :
|
|
14
|
+
return "md";
|
|
15
|
+
case "Lg" :
|
|
16
|
+
return "lg";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function Eita__Kbd(props) {
|
|
21
|
+
let __size = props.size;
|
|
22
|
+
let size = __size !== undefined ? __size : "Md";
|
|
23
|
+
let getClassName = () => {
|
|
24
|
+
let sizeClass = "basefn-kbd--" + sizeToString(size);
|
|
25
|
+
return "basefn-kbd " + sizeClass;
|
|
26
|
+
};
|
|
27
|
+
return Xote__JSX.Elements.jsx("kbd", {
|
|
28
|
+
class: getClassName(),
|
|
29
|
+
children: Xote.Component.list(props.keys, key => Xote__JSX.Elements.jsx("span", {
|
|
30
|
+
class: "basefn-kbd__key",
|
|
31
|
+
children: Xote.Component.text(key)
|
|
32
|
+
}))
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let make = Eita__Kbd;
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
sizeToString,
|
|
40
|
+
make,
|
|
41
|
+
}
|
|
42
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Label.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function Eita__Label(props) {
|
|
10
|
+
let __required = props.required;
|
|
11
|
+
let required = __required !== undefined ? __required : false;
|
|
12
|
+
let base = "basefn-label";
|
|
13
|
+
return Xote__JSX.Elements.jsx("label", {
|
|
14
|
+
class: required ? base + " basefn-label--required" : base,
|
|
15
|
+
children: Xote.Component.text(props.text)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let make = Eita__Label;
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
make,
|
|
23
|
+
}
|
|
24
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Modal.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function sizeToString(size) {
|
|
10
|
+
switch (size) {
|
|
11
|
+
case "Sm" :
|
|
12
|
+
return "sm";
|
|
13
|
+
case "Md" :
|
|
14
|
+
return "md";
|
|
15
|
+
case "Lg" :
|
|
16
|
+
return "lg";
|
|
17
|
+
case "Xl" :
|
|
18
|
+
return "xl";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function Eita__Modal(props) {
|
|
23
|
+
let footer = props.footer;
|
|
24
|
+
let children = props.children;
|
|
25
|
+
let __showCloseButton = props.showCloseButton;
|
|
26
|
+
let __closeOnBackdrop = props.closeOnBackdrop;
|
|
27
|
+
let __size = props.size;
|
|
28
|
+
let title = props.title;
|
|
29
|
+
let onClose = props.onClose;
|
|
30
|
+
let isOpen = props.isOpen;
|
|
31
|
+
let size = __size !== undefined ? __size : "Md";
|
|
32
|
+
let closeOnBackdrop = __closeOnBackdrop !== undefined ? __closeOnBackdrop : true;
|
|
33
|
+
let showCloseButton = __showCloseButton !== undefined ? __showCloseButton : true;
|
|
34
|
+
let handleBackdropClick = evt => {
|
|
35
|
+
if (!closeOnBackdrop) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let target = evt.target;
|
|
39
|
+
let currentTarget = evt.currentTarget;
|
|
40
|
+
if (target === currentTarget) {
|
|
41
|
+
return onClose();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
let getModalClass = () => {
|
|
45
|
+
let sizeClass = "basefn-modal--" + sizeToString(size);
|
|
46
|
+
return "basefn-modal " + sizeClass;
|
|
47
|
+
};
|
|
48
|
+
return Xote.Component.signalFragment(Xote.Computed.make(() => {
|
|
49
|
+
if (Xote.Signal.get(isOpen)) {
|
|
50
|
+
return [Xote__JSX.Elements.jsx("div", {
|
|
51
|
+
class: "basefn-modal-backdrop",
|
|
52
|
+
onClick: handleBackdropClick,
|
|
53
|
+
children: Xote__JSX.Elements.jsxs("div", {
|
|
54
|
+
class: getModalClass(),
|
|
55
|
+
children: Xote__JSX.array([
|
|
56
|
+
title !== undefined ? Xote__JSX.Elements.jsxs("div", {
|
|
57
|
+
class: "basefn-modal__header",
|
|
58
|
+
children: Xote__JSX.array([
|
|
59
|
+
Xote__JSX.Elements.jsx("h2", {
|
|
60
|
+
class: "basefn-modal__title",
|
|
61
|
+
children: Xote.Component.text(title)
|
|
62
|
+
}),
|
|
63
|
+
showCloseButton ? Xote__JSX.Elements.jsx("button", {
|
|
64
|
+
class: "basefn-modal__close",
|
|
65
|
+
onClick: param => onClose(),
|
|
66
|
+
children: Xote.Component.text("\u00d7")
|
|
67
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {})
|
|
68
|
+
])
|
|
69
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {}),
|
|
70
|
+
Xote__JSX.Elements.jsx("div", {
|
|
71
|
+
class: "basefn-modal__body",
|
|
72
|
+
children: children
|
|
73
|
+
}),
|
|
74
|
+
footer !== undefined ? Xote__JSX.Elements.jsx("div", {
|
|
75
|
+
class: "basefn-modal__footer",
|
|
76
|
+
children: footer
|
|
77
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {})
|
|
78
|
+
])
|
|
79
|
+
})
|
|
80
|
+
})];
|
|
81
|
+
} else {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}, undefined));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let make = Eita__Modal;
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
sizeToString,
|
|
91
|
+
make,
|
|
92
|
+
}
|
|
93
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
import * as Core__Option from "@rescript/core/src/Core__Option.res.mjs";
|
|
6
|
+
|
|
7
|
+
import './Eita__Progress.css'
|
|
8
|
+
;
|
|
9
|
+
|
|
10
|
+
function sizeToString(size) {
|
|
11
|
+
switch (size) {
|
|
12
|
+
case "Sm" :
|
|
13
|
+
return "sm";
|
|
14
|
+
case "Md" :
|
|
15
|
+
return "md";
|
|
16
|
+
case "Lg" :
|
|
17
|
+
return "lg";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function variantToString(variant) {
|
|
22
|
+
switch (variant) {
|
|
23
|
+
case "Default" :
|
|
24
|
+
return "default";
|
|
25
|
+
case "Primary" :
|
|
26
|
+
return "primary";
|
|
27
|
+
case "Success" :
|
|
28
|
+
return "success";
|
|
29
|
+
case "Warning" :
|
|
30
|
+
return "warning";
|
|
31
|
+
case "Error" :
|
|
32
|
+
return "error";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Eita__Progress(props) {
|
|
37
|
+
let __indeterminate = props.indeterminate;
|
|
38
|
+
let label = props.label;
|
|
39
|
+
let __showLabel = props.showLabel;
|
|
40
|
+
let __variant = props.variant;
|
|
41
|
+
let __size = props.size;
|
|
42
|
+
let __max = props.max;
|
|
43
|
+
let value = props.value;
|
|
44
|
+
let max = __max !== undefined ? __max : 100.0;
|
|
45
|
+
let size = __size !== undefined ? __size : "Md";
|
|
46
|
+
let variant = __variant !== undefined ? __variant : "Primary";
|
|
47
|
+
let showLabel = __showLabel !== undefined ? __showLabel : false;
|
|
48
|
+
let indeterminate = __indeterminate !== undefined ? __indeterminate : false;
|
|
49
|
+
let getProgressClass = () => {
|
|
50
|
+
let sizeClass = "basefn-progress--" + sizeToString(size);
|
|
51
|
+
return "basefn-progress " + sizeClass;
|
|
52
|
+
};
|
|
53
|
+
let getBarClass = () => {
|
|
54
|
+
let variantClass = "basefn-progress__bar--" + variantToString(variant);
|
|
55
|
+
let animatedClass = indeterminate ? " basefn-progress__bar--animated" : "";
|
|
56
|
+
return "basefn-progress__bar " + variantClass + animatedClass;
|
|
57
|
+
};
|
|
58
|
+
let getPercentage = () => {
|
|
59
|
+
let currentValue = Xote.Signal.get(value);
|
|
60
|
+
let percent = currentValue / max * 100.0;
|
|
61
|
+
let clamped = percent > 100.0 ? 100.0 : (
|
|
62
|
+
percent < 0.0 ? 0.0 : percent
|
|
63
|
+
);
|
|
64
|
+
return clamped.toString();
|
|
65
|
+
};
|
|
66
|
+
return Xote__JSX.jsxs(Xote__JSX.jsxFragment, {
|
|
67
|
+
children: Xote__JSX.array([
|
|
68
|
+
Xote__JSX.Elements.jsx("div", {
|
|
69
|
+
class: getProgressClass(),
|
|
70
|
+
children: Xote__JSX.Elements.jsx("div", {
|
|
71
|
+
class: getBarClass(),
|
|
72
|
+
style: Xote.Computed.make(() => {
|
|
73
|
+
if (indeterminate) {
|
|
74
|
+
return "width: 30%";
|
|
75
|
+
} else {
|
|
76
|
+
return "width: " + getPercentage() + "%";
|
|
77
|
+
}
|
|
78
|
+
}, undefined)
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
showLabel || Core__Option.isSome(label) ? Xote__JSX.Elements.jsxs("div", {
|
|
82
|
+
class: "basefn-progress__label",
|
|
83
|
+
children: Xote__JSX.array([
|
|
84
|
+
Xote__JSX.Elements.jsx("span", {
|
|
85
|
+
children: Xote.Component.text(label !== undefined ? label : "Progress")
|
|
86
|
+
}),
|
|
87
|
+
indeterminate ? Xote__JSX.jsx(Xote__JSX.jsxFragment, {}) : Xote.Component.textSignal(() => getPercentage() + "%")
|
|
88
|
+
])
|
|
89
|
+
}) : Xote__JSX.jsx(Xote__JSX.jsxFragment, {})
|
|
90
|
+
])
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
let make = Eita__Progress;
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
sizeToString,
|
|
98
|
+
variantToString,
|
|
99
|
+
make,
|
|
100
|
+
}
|
|
101
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Radio.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function Eita__Radio(props) {
|
|
10
|
+
let __disabled = props.disabled;
|
|
11
|
+
let disabled = __disabled !== undefined ? __disabled : false;
|
|
12
|
+
let base = "basefn-radio-wrapper";
|
|
13
|
+
return Xote__JSX.Elements.jsxs("label", {
|
|
14
|
+
class: disabled ? base + " basefn-radio-wrapper--disabled" : base,
|
|
15
|
+
children: Xote__JSX.array([
|
|
16
|
+
Xote__JSX.Elements.jsx("input", {
|
|
17
|
+
class: "basefn-radio-input",
|
|
18
|
+
type: "radio",
|
|
19
|
+
name: props.name,
|
|
20
|
+
value: props.value,
|
|
21
|
+
disabled: disabled,
|
|
22
|
+
checked: props.checked,
|
|
23
|
+
onChange: props.onChange
|
|
24
|
+
}),
|
|
25
|
+
Xote__JSX.Elements.jsx("span", {
|
|
26
|
+
class: "basefn-radio-label",
|
|
27
|
+
children: Xote.Component.text(props.label)
|
|
28
|
+
})
|
|
29
|
+
])
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let make = Eita__Radio;
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
make,
|
|
37
|
+
}
|
|
38
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Select.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function Eita__Select(props) {
|
|
10
|
+
let __disabled = props.disabled;
|
|
11
|
+
let onChange = props.onChange;
|
|
12
|
+
let value = props.value;
|
|
13
|
+
let disabled = __disabled !== undefined ? __disabled : false;
|
|
14
|
+
let onChange$1 = e => {
|
|
15
|
+
let t = e.target;
|
|
16
|
+
let v = t.value;
|
|
17
|
+
Xote.Signal.set(value, v);
|
|
18
|
+
if (onChange !== undefined) {
|
|
19
|
+
return onChange(v);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return Xote__JSX.Elements.jsx("select", {
|
|
23
|
+
class: "basefn-select",
|
|
24
|
+
name: "test",
|
|
25
|
+
value: value,
|
|
26
|
+
disabled: disabled,
|
|
27
|
+
onChange: onChange$1,
|
|
28
|
+
children: Xote.Component.list(props.options, opt => Xote__JSX.Elements.jsx("option", {
|
|
29
|
+
value: opt.value,
|
|
30
|
+
children: Xote.Component.text(opt.label)
|
|
31
|
+
}))
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let make = Eita__Select;
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
make,
|
|
39
|
+
}
|
|
40
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Xote__JSX from "xote/src/Xote__JSX.res.mjs";
|
|
5
|
+
|
|
6
|
+
import './Eita__Separator.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function orientationToString(orientation) {
|
|
10
|
+
if (orientation === "Horizontal") {
|
|
11
|
+
return "horizontal";
|
|
12
|
+
} else {
|
|
13
|
+
return "vertical";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function variantToString(variant) {
|
|
18
|
+
switch (variant) {
|
|
19
|
+
case "Solid" :
|
|
20
|
+
return "solid";
|
|
21
|
+
case "Dashed" :
|
|
22
|
+
return "dashed";
|
|
23
|
+
case "Dotted" :
|
|
24
|
+
return "dotted";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function Eita__Separator(props) {
|
|
29
|
+
let label = props.label;
|
|
30
|
+
let __variant = props.variant;
|
|
31
|
+
let __orientation = props.orientation;
|
|
32
|
+
let orientation = __orientation !== undefined ? __orientation : "Horizontal";
|
|
33
|
+
let variant = __variant !== undefined ? __variant : "Solid";
|
|
34
|
+
let getClassName = () => {
|
|
35
|
+
let orientationClass = "basefn-separator--" + orientationToString(orientation);
|
|
36
|
+
let variantClass = "basefn-separator--" + variantToString(variant);
|
|
37
|
+
return "basefn-separator " + orientationClass + " " + variantClass;
|
|
38
|
+
};
|
|
39
|
+
if (label !== undefined) {
|
|
40
|
+
return Xote__JSX.Elements.jsxs("div", {
|
|
41
|
+
class: getClassName() + " basefn-separator--with-label",
|
|
42
|
+
children: Xote__JSX.array([
|
|
43
|
+
Xote__JSX.Elements.jsx("div", {
|
|
44
|
+
class: "basefn-separator__line"
|
|
45
|
+
}),
|
|
46
|
+
Xote__JSX.Elements.jsx("span", {
|
|
47
|
+
class: "basefn-separator__label",
|
|
48
|
+
children: Xote.Component.text(label)
|
|
49
|
+
}),
|
|
50
|
+
Xote__JSX.Elements.jsx("div", {
|
|
51
|
+
class: "basefn-separator__line"
|
|
52
|
+
})
|
|
53
|
+
])
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
return Xote__JSX.Elements.jsx("div", {
|
|
57
|
+
class: getClassName(),
|
|
58
|
+
role: "separator"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let make = Eita__Separator;
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
orientationToString,
|
|
67
|
+
variantToString,
|
|
68
|
+
make,
|
|
69
|
+
}
|
|
70
|
+
/* Not a pure module */
|