elbe-ui 0.3.1 → 0.4.1

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.
Files changed (80) hide show
  1. package/README.md +12 -0
  2. package/dist/elbe.css +57 -56
  3. package/dist/elbe.css.map +1 -1
  4. package/dist/index.d.ts +6 -3
  5. package/dist/index.js +6 -3
  6. package/dist/ui/components/badge.d.ts +1 -1
  7. package/dist/ui/components/banner.d.ts +3 -2
  8. package/dist/ui/components/banner.js +13 -7
  9. package/dist/ui/components/base/box.d.ts +28 -27
  10. package/dist/ui/components/base/card.d.ts +6 -4
  11. package/dist/ui/components/base/card.js +6 -2
  12. package/dist/ui/components/base/roles.d.ts +1 -0
  13. package/dist/ui/components/base/roles.js +1 -0
  14. package/dist/ui/components/button/button.d.ts +1 -0
  15. package/dist/ui/components/button/button.js +12 -4
  16. package/dist/ui/components/button/choose_button.js +3 -2
  17. package/dist/ui/components/button/icon_button.d.ts +3 -0
  18. package/dist/ui/components/button/icon_button.js +9 -2
  19. package/dist/ui/components/button/toggle_button.js +7 -1
  20. package/dist/ui/components/dialog.d.ts +1 -1
  21. package/dist/ui/components/footer.js +1 -1
  22. package/dist/ui/components/input/checkbox.d.ts +2 -5
  23. package/dist/ui/components/input/checkbox.js +10 -19
  24. package/dist/ui/components/input/range.js +4 -1
  25. package/dist/ui/components/input/select.js +1 -1
  26. package/dist/ui/components/input/switch.d.ts +6 -2
  27. package/dist/ui/components/input/switch.js +25 -22
  28. package/dist/ui/components/input/text/input_field.d.ts +28 -0
  29. package/dist/ui/components/input/text/input_field.js +70 -0
  30. package/dist/ui/components/input/text/multi_line.d.ts +10 -0
  31. package/dist/ui/components/input/text/multi_line.js +19 -0
  32. package/dist/ui/components/input/text/single_line.d.ts +18 -0
  33. package/dist/ui/components/input/text/single_line.js +28 -0
  34. package/dist/ui/components/layout/app_base.d.ts +14 -0
  35. package/dist/ui/components/layout/app_base.js +30 -0
  36. package/dist/ui/components/layout/ctx_app_base.d.ts +16 -0
  37. package/dist/ui/components/layout/ctx_app_base.js +13 -0
  38. package/dist/ui/components/layout/flex.d.ts +4 -2
  39. package/dist/ui/components/layout/flex.js +13 -5
  40. package/dist/ui/components/layout/header.d.ts +18 -18
  41. package/dist/ui/components/layout/header.js +54 -48
  42. package/dist/ui/components/layout/menu.d.ts +12 -0
  43. package/dist/ui/components/layout/menu.js +59 -0
  44. package/dist/ui/components/layout/spaced.d.ts +4 -2
  45. package/dist/ui/components/layout/spaced.js +6 -2
  46. package/dist/ui/components/layout/toolbar.d.ts +7 -0
  47. package/dist/ui/components/layout/toolbar.js +71 -0
  48. package/dist/ui/components/progress_bar.js +7 -5
  49. package/dist/ui/components/spinner.js +4 -0
  50. package/dist/ui/components/text.d.ts +1 -1
  51. package/dist/ui/components/text.js +4 -4
  52. package/dist/ui/theme/color_theme.d.ts +1 -1
  53. package/dist/ui/theme/color_theme.js +63 -52
  54. package/dist/ui/theme/colors.d.ts +33 -13
  55. package/dist/ui/theme/colors.js +42 -15
  56. package/dist/ui/theme/geometry_theme.js +2 -4
  57. package/dist/ui/theme/seed.d.ts +18 -8
  58. package/dist/ui/theme/seed.js +4 -1
  59. package/dist/ui/theme/theme.d.ts +3 -5
  60. package/dist/ui/theme/theme.js +9 -12
  61. package/dist/ui/theme/theme_context.d.ts +18 -0
  62. package/dist/ui/theme/theme_context.js +26 -0
  63. package/dist/ui/theme/type_theme.js +5 -2
  64. package/dist/ui/util/ctx_toolbar.d.ts +8 -0
  65. package/dist/ui/util/ctx_toolbar.js +9 -0
  66. package/dist/ui/util/l10n/l10n.d.ts +35 -0
  67. package/dist/ui/util/l10n/l10n.js +68 -0
  68. package/dist/ui/util/single_key.d.ts +11 -0
  69. package/dist/ui/util/single_key.js +1 -0
  70. package/dist/ui/util/types.d.ts +9 -0
  71. package/dist/ui/util/types.js +1 -0
  72. package/dist/ui/util/util.d.ts +5 -3
  73. package/dist/ui/util/util.js +36 -1
  74. package/package.json +1 -1
  75. package/dist/ui/components/input/input_field.d.ts +0 -22
  76. package/dist/ui/components/input/input_field.js +0 -36
  77. package/dist/ui/components/input/text_area.d.ts +0 -10
  78. package/dist/ui/components/input/text_area.js +0 -22
  79. package/dist/ui/components/layout/scaffold.d.ts +0 -15
  80. package/dist/ui/components/layout/scaffold.js +0 -31
@@ -1,22 +0,0 @@
1
- import React from "preact/compat";
2
- import { ActionElbeProps } from "../base/box";
3
- import { _TextArea } from "./text_area";
4
- export type InputFieldProps = {
5
- label?: string;
6
- hint: string;
7
- readonly?: boolean;
8
- value: string | number;
9
- onInput?: (value: string) => void;
10
- } & ActionElbeProps;
11
- export declare class Field extends React.Component<InputFieldProps & {
12
- type?: "text" | "number" | "password" | "date" | "time" | "email";
13
- }> {
14
- static text: (p: InputFieldProps) => React.JSX.Element;
15
- static number: (p: InputFieldProps) => React.JSX.Element;
16
- static password: (p: InputFieldProps) => React.JSX.Element;
17
- static date: (p: InputFieldProps) => React.JSX.Element;
18
- static time: (p: InputFieldProps) => React.JSX.Element;
19
- static email: (p: InputFieldProps) => React.JSX.Element;
20
- static multiLine: typeof _TextArea;
21
- render(): React.JSX.Element;
22
- }
@@ -1,36 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx } from "preact/jsx-runtime";
13
- import React from "preact/compat";
14
- import { applyProps } from "../base/box";
15
- import { _TextArea } from "./text_area";
16
- export class Field extends React.Component {
17
- render() {
18
- var _a;
19
- const _b = this.props, { label, hint, readonly, type, value, onInput } = _b, elbe = __rest(_b, ["label", "hint", "readonly", "type", "value", "onInput"]);
20
- return (_jsx("div", { style: {
21
- width: "12rem !important",
22
- display: "flex",
23
- flexDirection: "column",
24
- alignItems: "stretch",
25
- }, "data-tooltip": (_a = this.props) === null || _a === void 0 ? void 0 : _a.tooltip, children: _jsx("input", Object.assign({ type: this.props.type }, applyProps("text_field", this.props, null, {
26
- width: "100%",
27
- }), { size: 5, label: this.props.label, placeholder: this.props.hint, value: this.props.value, onInput: (e) => this.props.onInput && this.props.onInput(e.currentTarget.value), readonly: this.props.readonly })) }));
28
- }
29
- }
30
- Field.text = (p) => _jsx(Field, Object.assign({}, p, { type: "text" }));
31
- Field.number = (p) => _jsx(Field, Object.assign({}, p, { type: "number" }));
32
- Field.password = (p) => _jsx(Field, Object.assign({}, p, { type: "password" }));
33
- Field.date = (p) => _jsx(Field, Object.assign({}, p, { type: "date" }));
34
- Field.time = (p) => _jsx(Field, Object.assign({}, p, { type: "time" }));
35
- Field.email = (p) => _jsx(Field, Object.assign({}, p, { type: "email" }));
36
- Field.multiLine = _TextArea;
@@ -1,10 +0,0 @@
1
- import { ActionElbeProps } from "../base/box";
2
- export declare function _TextArea({ label, hint, readonly, rows, maxLength, value, onInput, ...elbe }: {
3
- label?: string;
4
- hint: string;
5
- rows?: number;
6
- maxLength?: number;
7
- readonly?: boolean;
8
- value: string | number;
9
- onInput?: (value: string) => void;
10
- } & ActionElbeProps): import("preact").JSX.Element;
@@ -1,22 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx } from "preact/jsx-runtime";
13
- import { applyProps } from "../base/box";
14
- export function _TextArea(_a) {
15
- var { label, hint, readonly, rows = 4, maxLength, value, onInput } = _a, elbe = __rest(_a, ["label", "hint", "readonly", "rows", "maxLength", "value", "onInput"]);
16
- return (_jsx("div", { style: {
17
- width: "12rem !important",
18
- display: "flex",
19
- flexDirection: "column",
20
- alignItems: "stretch",
21
- }, "data-tooltip": elbe.tooltip, children: _jsx("textarea", Object.assign({}, applyProps("text_area", elbe, null, { width: "100%" }), { label: label, size: 5, cols: 5, placeholder: hint, rows: rows, maxLength: maxLength, value: value, onInput: (e) => onInput && onInput(e.currentTarget.value), readonly: readonly })) }));
22
- }
@@ -1,15 +0,0 @@
1
- import { type ElbeColorSchemes } from "../../..";
2
- import { HeaderParams } from "./header";
3
- /**
4
- * Scaffold is a layout component that provides a header and a content area.
5
- * It is used to create a consistent layout for pages.
6
- */
7
- export declare function Scaffold({ children, baseLimited, gap, padded, scheme, scroll, height, ...header }: {
8
- baseLimited?: boolean;
9
- children: any;
10
- gap?: number;
11
- padded?: boolean;
12
- scheme?: ElbeColorSchemes;
13
- scroll?: boolean;
14
- height?: number;
15
- } & HeaderParams): import("preact").JSX.Element;
@@ -1,31 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
13
- import { classString } from "../../..";
14
- import { Column } from "./flex";
15
- import { Header } from "./header";
16
- /**
17
- * Scaffold is a layout component that provides a header and a content area.
18
- * It is used to create a consistent layout for pages.
19
- */
20
- export function Scaffold(_a) {
21
- var { children, baseLimited = false, gap = 1, padded = true, scheme, scroll = false, height } = _a, header = __rest(_a, ["children", "baseLimited", "gap", "padded", "scheme", "scroll", "height"]);
22
- return (_jsxs(Column, { cross: "stretch", gap: 0, typeLabel: "Scaffold", class: `${scheme !== null && scheme !== void 0 ? scheme : "primary"}`, style: {
23
- overflowY: height ? "scroll" : null,
24
- height: height ? `${height}rem` : scroll ? null : "100vh",
25
- //height: header.limitToParent ? "100px" : null,
26
- }, children: [_jsx(Header, Object.assign({}, header, { _absolute: height ? true : false })), _jsx("div", { class: classString([
27
- !scroll && "flex-1",
28
- padded && "padded",
29
- baseLimited && "base-limited",
30
- ]), children: _jsx(Column, { cross: "stretch", style: { height: scroll ? null : "100%" }, gap: gap !== null && gap !== void 0 ? gap : 1, children: children }) })] }));
31
- }