elbe-ui 0.2.46 → 0.2.52
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/dist/elbe.css +60 -18
- package/dist/elbe.css.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/ui/components/banner.d.ts +12 -0
- package/dist/ui/components/banner.js +17 -0
- package/dist/ui/components/base/box.d.ts +15 -1
- package/dist/ui/components/base/box.js +4 -4
- package/dist/ui/components/base/card.d.ts +4 -1
- package/dist/ui/components/base/card.js +11 -2
- package/dist/ui/components/base/padded.js +1 -1
- package/dist/ui/components/button/button.d.ts +3 -2
- package/dist/ui/components/button/button.js +4 -2
- package/dist/ui/components/button/choose_button.d.ts +1 -0
- package/dist/ui/components/button/choose_button.js +5 -2
- package/dist/ui/components/button/icon_button.d.ts +3 -2
- package/dist/ui/components/button/icon_button.js +2 -1
- package/dist/ui/components/button/toggle_button.d.ts +2 -2
- package/dist/ui/components/button/toggle_button.js +1 -1
- package/dist/ui/components/dev/todo.js +3 -3
- package/dist/ui/components/dialog.js +1 -1
- package/dist/ui/components/input/checkbox.d.ts +2 -2
- package/dist/ui/components/input/checkbox.js +3 -1
- package/dist/ui/components/input/input_field.d.ts +2 -2
- package/dist/ui/components/input/input_field.js +1 -1
- package/dist/ui/components/input/range.d.ts +2 -2
- package/dist/ui/components/input/range.js +2 -2
- package/dist/ui/components/input/select.d.ts +2 -2
- package/dist/ui/components/input/select.js +1 -1
- package/dist/ui/components/input/switch.d.ts +6 -0
- package/dist/ui/components/input/switch.js +49 -0
- package/dist/ui/components/input/text_area.d.ts +2 -2
- package/dist/ui/components/input/text_area.js +1 -1
- package/dist/ui/components/layout/alignment.d.ts +9 -0
- package/dist/ui/components/layout/alignment.js +13 -0
- package/dist/ui/components/layout/flex.js +1 -1
- package/dist/ui/components/layout/header.d.ts +19 -0
- package/dist/ui/components/layout/header.js +52 -0
- package/dist/ui/components/layout/scaffold.d.ts +2 -17
- package/dist/ui/components/layout/scaffold.js +3 -34
- package/dist/ui/components/layout/scroll.js +1 -1
- package/dist/ui/components/progress_bar.d.ts +6 -0
- package/dist/ui/components/progress_bar.js +28 -0
- package/dist/ui/components/text.js +3 -2
- package/dist/ui/theme/color_theme.d.ts +2 -2
- package/dist/ui/theme/color_theme.js +51 -27
- package/dist/ui/theme/colors.d.ts +5 -33
- package/dist/ui/theme/colors.js +13 -11
- package/dist/ui/theme/seed.d.ts +43 -0
- package/dist/ui/theme/seed.js +1 -0
- package/dist/ui/theme/theme.d.ts +9 -5
- package/dist/ui/theme/theme.js +12 -4
- package/dist/ui/util/confirm_dialog.js +6 -3
- package/package.json +1 -1
package/dist/ui/theme/theme.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../elbe.css";
|
|
2
|
+
import { ColorTheme } from "./colors";
|
|
2
3
|
import { GeometryTheme, type GeometryThemeSeed } from "./geometry_theme";
|
|
4
|
+
import { PartialColorThemeSeed } from "./seed";
|
|
3
5
|
import { TypeTheme, type TypeThemeSeed } from "./type_theme";
|
|
4
6
|
export * from "./color_theme";
|
|
5
7
|
export * from "./colors";
|
|
6
8
|
export * from "./geometry_theme";
|
|
7
9
|
export * from "./type_theme";
|
|
8
10
|
export interface ElbeThemeSeed {
|
|
9
|
-
color?: Partial<
|
|
11
|
+
color?: Partial<PartialColorThemeSeed>;
|
|
10
12
|
type?: Partial<TypeThemeSeed>;
|
|
11
13
|
geometry?: Partial<GeometryThemeSeed>;
|
|
12
14
|
}
|
|
@@ -16,14 +18,16 @@ export declare class ElbeThemeData {
|
|
|
16
18
|
readonly geometry: GeometryTheme;
|
|
17
19
|
constructor(color: ColorTheme, type: TypeTheme, geometry: GeometryTheme);
|
|
18
20
|
asCss(): string;
|
|
19
|
-
|
|
21
|
+
_pageBackground(dark?: boolean): string;
|
|
22
|
+
static fromSeed(seed: ElbeThemeSeed, highVis: boolean): ElbeThemeData;
|
|
20
23
|
}
|
|
21
24
|
export declare function ElbeTheme(p: {
|
|
22
25
|
children: any;
|
|
23
26
|
dark?: boolean;
|
|
24
27
|
todoOverlay?: boolean;
|
|
28
|
+
highVis?: boolean;
|
|
25
29
|
} & ({
|
|
26
|
-
seed: ElbeThemeSeed;
|
|
27
|
-
} | {
|
|
28
30
|
theme: ElbeThemeData;
|
|
31
|
+
} | {
|
|
32
|
+
seed?: ElbeThemeSeed;
|
|
29
33
|
})): import("preact").JSX.Element;
|
package/dist/ui/theme/theme.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import "../../elbe.css";
|
|
2
3
|
import { ToDo } from "../components/dev/todo";
|
|
3
4
|
import { ColorTheme } from "./colors";
|
|
4
5
|
import { GeometryTheme } from "./geometry_theme";
|
|
@@ -18,11 +19,18 @@ export class ElbeThemeData {
|
|
|
18
19
|
.map((s) => s.asCss())
|
|
19
20
|
.join("\n");
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
_pageBackground(dark) {
|
|
23
|
+
const c = this.color.color;
|
|
24
|
+
return `html,:root {${(!!dark ? c.dark : c.light).asCss()};`;
|
|
25
|
+
}
|
|
26
|
+
static fromSeed(seed, highVis) {
|
|
27
|
+
return new ElbeThemeData(ColorTheme.generate(seed.color, highVis), TypeTheme.generate(seed.type), GeometryTheme.generate(seed.geometry));
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
export function ElbeTheme(p) {
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const theme = "theme" in p
|
|
33
|
+
? p.theme
|
|
34
|
+
: ElbeThemeData.fromSeed((_a = p.seed) !== null && _a !== void 0 ? _a : {}, (_b = p.highVis) !== null && _b !== void 0 ? _b : false);
|
|
35
|
+
return (_jsxs("div", { class: `elbe ${p.dark ? "dark" : ""} ${p.highVis ? "high_vis" : ""}`, children: [p.todoOverlay && _jsx(ToDo.Overlay, {}), _jsx("style", { children: theme.asCss() }), _jsx("style", { children: theme._pageBackground(p.dark) }), p.children] }));
|
|
28
36
|
}
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function showConfirmDialog({ title, message, okay = false, }) {
|
|
7
7
|
return new Promise((resolve, reject) => {
|
|
8
|
+
var _a;
|
|
8
9
|
const dialog = document.createElement("div");
|
|
9
10
|
dialog.classList.add("dialog");
|
|
10
11
|
dialog.innerHTML = `<dialog open>
|
|
11
12
|
<div
|
|
12
|
-
class="
|
|
13
|
+
class="card primary"
|
|
13
14
|
style="max-width: 30rem; min-width: 10rem"
|
|
14
15
|
>
|
|
15
16
|
<div class="row cross-center">
|
|
@@ -34,9 +35,11 @@ export function showConfirmDialog({ title, message, okay = false, }) {
|
|
|
34
35
|
</div>
|
|
35
36
|
</dialog>
|
|
36
37
|
`;
|
|
37
|
-
document.
|
|
38
|
+
(_a = document.getElementsByClassName("elbe")[0]) === null || _a === void 0 ? void 0 : _a.appendChild(dialog);
|
|
39
|
+
//document.body.appendChild(dialog);
|
|
38
40
|
window["conf_resolve"] = (v) => {
|
|
39
|
-
|
|
41
|
+
var _a;
|
|
42
|
+
(_a = document.getElementsByClassName("elbe")[0]) === null || _a === void 0 ? void 0 : _a.removeChild(dialog);
|
|
40
43
|
resolve(v);
|
|
41
44
|
};
|
|
42
45
|
});
|