elbe-ui 0.2.46 → 0.2.51

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 CHANGED
@@ -465,13 +465,12 @@ body,
465
465
  border-width: 20px;
466
466
  border-style: solid;
467
467
  border-width: 0 0 2px 0;
468
- padding: 0 0.75rem;
468
+ padding: 0 0.5rem;
469
469
  background-color: color-mix(in srgb, var(--c-context-back) 50%, transparent);
470
470
  backdrop-filter: blur(10px);
471
471
  -webkit-backdrop-filter: blur(10px);
472
472
  z-index: 20;
473
473
  box-sizing: border-box;
474
- height: 4.5rem;
475
474
  justify-content: space-between;
476
475
  align-items: center;
477
476
  }
package/dist/elbe.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../style/elbe.scss","../style/_base.scss","../style/_flex.scss","../style/_components.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAOQ;AAMR;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAGF;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;;;AAIF;AC3DA;AAoBA;AA6DA;AAUA;AAaA;AA8BA;AC9GA;AAqBA;AAYA;AAkBA;AAqBA;AC2GA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AFzMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;AAMF;EACE;;AAEF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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E;;AAoBJ;EACE;EACA;EACA;;AAGF;EAGE;EACA;EACA;EACA;;AAGF;EAKE;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AACA;EACE;;AAKN;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EAGC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EAGD;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAKD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAaF;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EA5BF;EACA;EACA;EACA;EACA;EACA;EACA;;AA0BA;EAhCA;EACA;EACA;EACA;EACA;EACA;EACA;;AAsEF;EACE;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;;AAIF;EACE;EACA;;AACA;EACE;EACA;;AAMJ;EACE;EACA;;AAGF;EACE;EACA;;;AHhOF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA","file":"elbe.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../style/elbe.scss","../style/_base.scss","../style/_flex.scss","../style/_components.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAOQ;AAMR;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAGF;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;EACA;;;AAIF;AC3DA;AAoBA;AA6DA;AAUA;AAaA;AA8BA;AC9GA;AAqBA;AAYA;AAkBA;AAqBA;AC2GA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA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;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAKF;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;;AClHF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAJA;EACE;;AAoBJ;EACE;EACA;EACA;;AAGF;EAGE;EACA;EACA;EACA;;AAGF;EAKE;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AACA;EACE;;AAKN;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EAGC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EAGD;EACA;EACA;EACA;EAEA;EAEA;EACA;;AAKD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAaF;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EA5BF;EACA;EACA;EACA;EACA;EACA;EACA;;AA0BA;EAhCA;EACA;EACA;EACA;EACA;EACA;EACA;;AAsEF;EACE;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;;AAIF;EACE;EACA;;AACA;EACE;EACA;;AAMJ;EACE;EACA;;AAGF;EACE;EACA;;;AHhOF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA","file":"elbe.css"}
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from "./ui/components/button/choose_button";
13
13
  export * from "./ui/components/button/icon_button";
14
14
  export * from "./ui/components/button/toggle_button";
15
15
  export * from "./ui/components/layout/flex";
16
+ export * from "./ui/components/layout/header";
16
17
  export * from "./ui/components/layout/scaffold";
17
18
  export * from "./ui/components/layout/scroll";
18
19
  export * from "./ui/components/layout/spaced";
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ export * from "./ui/components/button/choose_button";
16
16
  export * from "./ui/components/button/icon_button";
17
17
  export * from "./ui/components/button/toggle_button";
18
18
  export * from "./ui/components/layout/flex";
19
+ export * from "./ui/components/layout/header";
19
20
  export * from "./ui/components/layout/scaffold";
20
21
  export * from "./ui/components/layout/scroll";
21
22
  export * from "./ui/components/layout/spaced";
@@ -0,0 +1,19 @@
1
+ import { JSX } from "preact/jsx-runtime";
2
+ export type HeaderParams = {
3
+ title?: string;
4
+ back?: null | "close" | "back" | JSX.Element;
5
+ actions?: any;
6
+ _absolute?: boolean;
7
+ };
8
+ /**
9
+ * Header is a layout component that provides a header for a page.
10
+ * It is used to create a consistent header for pages.
11
+ * @param back - The back button type. If null, no back button is shown. If "close", a close button is shown. If "back", a back button is shown.
12
+ * @param title - The title of the page.
13
+ * @param actions - The actions to show on the right side of the header.
14
+ * @param children - The children to show in the header. If children are provided, the title is ignored.
15
+ */
16
+ export declare function Header({ back, title, actions, _absolute, children, height, }: HeaderParams & {
17
+ children?: any;
18
+ height?: number;
19
+ }): JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ import { useEffect, useState } from "preact/hooks";
3
+ import { IconButton, Icons, Row, Text } from "../../..";
4
+ /**
5
+ * Header is a layout component that provides a header for a page.
6
+ * It is used to create a consistent header for pages.
7
+ * @param back - The back button type. If null, no back button is shown. If "close", a close button is shown. If "back", a back button is shown.
8
+ * @param title - The title of the page.
9
+ * @param actions - The actions to show on the right side of the header.
10
+ * @param children - The children to show in the header. If children are provided, the title is ignored.
11
+ */
12
+ export function Header({ back, title, actions, _absolute, children, height = 4, }) {
13
+ // if the icon is a type of back, we have to hide it if there is no history
14
+ if (typeof back === "string" &&
15
+ ["back", "close"].includes(back) &&
16
+ history.length == 0) {
17
+ back = null;
18
+ }
19
+ const goBack = () => history.go(-1);
20
+ const [isScrolled, setIsScrolled] = useState(false);
21
+ useEffect(() => {
22
+ const _handle = () => setIsScrolled(window.scrollY > 0);
23
+ window.addEventListener("scroll", _handle);
24
+ return () => {
25
+ window.removeEventListener("scroll", _handle);
26
+ };
27
+ }, []);
28
+ return (_jsxs("div", { children: [_jsx("div", { style: { height: `${height}rem` } }), _jsxs("div", { class: "header", style: {
29
+ height: `${height}rem`,
30
+ borderColor: isScrolled
31
+ ? "color-mix(in srgb, var(--c-context-border) 40%, transparent)"
32
+ : "transparent",
33
+ position: _absolute ? "absolute" : "fixed",
34
+ }, children: [back ? (typeof back !== "string" ? (back) : (_jsx(IconButton.plain, { icon: back === "back" ? Icons.ArrowLeft : Icons.X, onTap: goBack }))) : null, children ? children : _jsx(_PageCenteredTitle, { text: title || "" }), actions ? (_jsx(Row, { gap: 0.5, main: "end", children: actions })) : null] })] }));
35
+ }
36
+ function _PageCenteredTitle({ text }) {
37
+ return _jsx(Text.h5, { v: text, class: "flex-1", align: "center" });
38
+ /* CENTER TO PAGE:
39
+ return (
40
+ <div class="flex-1" style={{ height: "0rem" }}>
41
+ <div
42
+ style={{
43
+ position: "absolute",
44
+ left: "50%",
45
+ transform: "translateX(-50%) translateY(-50%)",
46
+ }}
47
+ >
48
+ <Text.h5 v={text} align="center" />
49
+ </div>
50
+ </div>
51
+ );*/
52
+ }
@@ -1,19 +1,5 @@
1
- import { JSX } from "preact/jsx-runtime";
2
1
  import { type ElbeColorSchemes } from "../../..";
3
- type HeaderParams = {
4
- title?: string;
5
- back?: null | "close" | "back" | JSX.Element;
6
- actions?: any;
7
- _absolute?: boolean;
8
- };
9
- /**
10
- * Header is a layout component that provides a header for a page.
11
- * It is used to create a consistent header for pages.
12
- * @param back - The back button type. If null, no back button is shown. If "close", a close button is shown. If "back", a back button is shown.
13
- * @param title - The title of the page.
14
- * @param actions - The actions to show on the right side of the header.
15
- */
16
- export declare function Header({ back, title, actions, _absolute }: HeaderParams): JSX.Element;
2
+ import { HeaderParams } from "./header";
17
3
  /**
18
4
  * Scaffold is a layout component that provides a header and a content area.
19
5
  * It is used to create a consistent layout for pages.
@@ -26,5 +12,4 @@ export declare function Scaffold({ children, baseLimited, gap, padded, scheme, s
26
12
  scheme?: ElbeColorSchemes;
27
13
  scroll?: boolean;
28
14
  height?: number;
29
- } & HeaderParams): JSX.Element;
30
- export {};
15
+ } & HeaderParams): import("preact").JSX.Element;
@@ -10,40 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
13
- import { useEffect, useState } from "preact/hooks";
14
- import { classString, Icons, Text } from "../../..";
15
- import { IconButton } from "../button/icon_button";
16
- import { Column, Row } from "./flex";
17
- /**
18
- * Header is a layout component that provides a header for a page.
19
- * It is used to create a consistent header for pages.
20
- * @param back - The back button type. If null, no back button is shown. If "close", a close button is shown. If "back", a back button is shown.
21
- * @param title - The title of the page.
22
- * @param actions - The actions to show on the right side of the header.
23
- */
24
- export function Header({ back, title, actions, _absolute }) {
25
- // if the icon is a type of back, we have to hide it if there is no history
26
- if (typeof back === "string" &&
27
- ["back", "close"].includes(back) &&
28
- history.length == 0) {
29
- back = null;
30
- }
31
- const goBack = () => history.go(-1);
32
- const [isScrolled, setIsScrolled] = useState(false);
33
- useEffect(() => {
34
- const _handle = () => setIsScrolled(window.scrollY > 0);
35
- window.addEventListener("scroll", _handle);
36
- return () => {
37
- window.removeEventListener("scroll", _handle);
38
- };
39
- }, []);
40
- return (_jsxs("div", { children: [_jsx("div", { style: "height: 4.5rem" }), _jsxs("div", { class: "header", style: {
41
- borderColor: isScrolled
42
- ? "color-mix(in srgb, var(--c-context-border) 40%, transparent)"
43
- : "transparent",
44
- position: _absolute ? "absolute" : "fixed",
45
- }, children: [_jsx("div", { class: "flex-1", children: back ? (typeof back !== "string" ? (back) : (_jsx(IconButton.plain, { icon: back === "back" ? Icons.ArrowLeft : Icons.X, onTap: goBack }))) : null }), _jsx(Text.h4, { v: title }), _jsx(Row, { class: "flex-1", gap: 0.5, main: "end", children: actions })] })] }));
46
- }
13
+ import { classString } from "../../..";
14
+ import { Column } from "./flex";
15
+ import { Header } from "./header";
47
16
  /**
48
17
  * Scaffold is a layout component that provides a header and a content area.
49
18
  * It is used to create a consistent layout for pages.
@@ -21,7 +21,7 @@ export class Text extends React.Component {
21
21
  const _a = this.props, { align, bold, italic, underline, striked, color, size, children, variant, v } = _a, elbe = __rest(_a, ["align", "bold", "italic", "underline", "striked", "color", "size", "children", "variant", "v"]);
22
22
  return (_jsxs("span", Object.assign({}, applyProps(elbe, [
23
23
  "text",
24
- align,
24
+ //align,
25
25
  bold && "b",
26
26
  italic && "i",
27
27
  underline && "underline",
@@ -32,6 +32,7 @@ export class Text extends React.Component {
32
32
  fontSize: size ? `${size}rem` : "",
33
33
  color: color || "",
34
34
  scrollMarginTop: "2rem",
35
+ textAlign: align,
35
36
  }), { children: [v, children] })));
36
37
  }
37
38
  }
@@ -23,7 +23,7 @@ export declare function ElbeTheme(p: {
23
23
  dark?: boolean;
24
24
  todoOverlay?: boolean;
25
25
  } & ({
26
- seed: ElbeThemeSeed;
27
- } | {
28
26
  theme: ElbeThemeData;
27
+ } | {
28
+ seed?: ElbeThemeSeed;
29
29
  })): import("preact").JSX.Element;
@@ -23,6 +23,7 @@ export class ElbeThemeData {
23
23
  }
24
24
  }
25
25
  export function ElbeTheme(p) {
26
- const theme = "seed" in p ? ElbeThemeData.fromSeed(p.seed) : p.theme;
26
+ var _a;
27
+ const theme = "theme" in p ? p.theme : ElbeThemeData.fromSeed((_a = p.seed) !== null && _a !== void 0 ? _a : {});
27
28
  return (_jsxs("div", { class: `elbe ${p.dark ? "dark" : ""}`, children: [p.todoOverlay && _jsx(ToDo.Overlay, {}), _jsx("style", { children: theme.asCss() }), p.children] }));
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "0.2.46",
3
+ "version": "0.2.51",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {