elbe-ui 1.0.2 → 1.0.3
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.
|
@@ -11,11 +11,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { Component, createElement } from "react";
|
|
13
13
|
export function applyProps(typeLabel, p, classes, style) {
|
|
14
|
-
var _a, _b, _c;
|
|
14
|
+
var _a, _b, _c, _d;
|
|
15
15
|
if (Array.isArray(classes)) {
|
|
16
16
|
classes = classes.filter((c) => c).join(" ");
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const args = Object.assign(Object.assign({ id: p.id, onKeyDown: p.onKeyDown, onKeyUp: p.onKeyUp, onClick: p.onClick, onContextMenu: p.onContextMenu, onDoubleClick: p.onDoubleClick, onMouseDown: p.onMouseDown, onMouseUp: p.onMouseUp, onMouseEnter: p.onMouseEnter, onMouseLeave: p.onMouseLeave, onFocus: p.onFocus, onBlur: p.onBlur, tabIndex: p.tabIndex, autoFocus: p.autoFocus, role: (_a = p.role) !== null && _a !== void 0 ? _a : undefined, className: `${classes || ""} ${p.className || ""}`, style: Object.assign(Object.assign(Object.assign({}, (style !== null && style !== void 0 ? style : {})), ((_b = p.style) !== null && _b !== void 0 ? _b : {})), (p.flex ? { flex: p.flex === true ? 1 : p.flex } : {})) }, (p.tooltip ? { ["data-tooltip"]: p.tooltip } : {})), { ["aria-label"]: (_c = p.ariaLabel) !== null && _c !== void 0 ? _c : undefined,
|
|
19
|
+
//@ts-ignore
|
|
20
|
+
["data-type"]: (_d = p.typeLabel) !== null && _d !== void 0 ? _d : (!!typeLabel ? `elbe_${typeLabel}` : undefined) });
|
|
21
|
+
return args;
|
|
19
22
|
}
|
|
20
23
|
export class Box extends Component {
|
|
21
24
|
render() {
|
|
@@ -24,5 +24,9 @@ export function ElbeDialog({ title, open, onClose, children, _style, barrierDism
|
|
|
24
24
|
e.stopPropagation();
|
|
25
25
|
e.preventDefault();
|
|
26
26
|
onClose();
|
|
27
|
-
} })] }), _jsx(Spaced, { amount: 0.5 }), _jsx("div", { className: "padded", style: {
|
|
27
|
+
} })] }), _jsx(Spaced, { amount: 0.5 }), _jsx("div", { className: "padded", style: {
|
|
28
|
+
paddingTop: 0,
|
|
29
|
+
maxHeight: "80vh",
|
|
30
|
+
overflow: "auto",
|
|
31
|
+
}, children: children })] }) }));
|
|
28
32
|
}
|
package/dist/ui/theme/theme.js
CHANGED
|
@@ -31,7 +31,9 @@ export function ElbeTheme(p) {
|
|
|
31
31
|
const theme = "theme" in p ? p.theme : ElbeThemeData.fromSeed((_a = p.seed) !== null && _a !== void 0 ? _a : {});
|
|
32
32
|
const config = makeThemeConfig(p);
|
|
33
33
|
_addTooltip();
|
|
34
|
-
return (_jsxs("div", {
|
|
34
|
+
return (_jsxs("div", { ["type-label"]: "elbe-theme", style: {
|
|
35
|
+
width: "100%",
|
|
36
|
+
}, className: `elbe ${config.dark ? "dark" : ""} ${config.highVis ? "highvis" : ""} ${config.reducedMotion ? "reduced_motion" : ""}`, children: [p.todoOverlay && _jsx(ToDo.Overlay, {}), _jsx("style", { children: theme.asCss() }), _jsx("style", { children: _configCss(theme, config) }), _jsx(ThemeConfigContext.Provider, { value: config, children: _jsx(ThemeContext.Provider, { value: theme, children: p.children }) })] }));
|
|
35
37
|
}
|
|
36
38
|
function _addTooltip() {
|
|
37
39
|
return useEffect(() => {
|