elbe-ui 0.2.41 → 0.2.46

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 (46) hide show
  1. package/dist/bit/bit.js +22 -25
  2. package/dist/bit/ctrl_bit.js +47 -28
  3. package/dist/elbe.css +58 -18
  4. package/dist/elbe.css.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +34 -62
  7. package/dist/service/s_api.js +62 -49
  8. package/dist/ui/components/badge.js +13 -34
  9. package/dist/ui/components/base/box.d.ts +37 -40
  10. package/dist/ui/components/base/box.js +21 -23
  11. package/dist/ui/components/base/card.js +19 -10
  12. package/dist/ui/components/base/padded.d.ts +10 -9
  13. package/dist/ui/components/base/padded.js +31 -21
  14. package/dist/ui/components/button/button.js +30 -22
  15. package/dist/ui/components/button/choose_button.js +7 -10
  16. package/dist/ui/components/button/icon_button.js +36 -26
  17. package/dist/ui/components/button/toggle_button.js +19 -10
  18. package/dist/ui/components/dev/todo.d.ts +18 -0
  19. package/dist/ui/components/dev/todo.js +69 -0
  20. package/dist/ui/components/dialog.js +7 -10
  21. package/dist/ui/components/error_view.js +14 -16
  22. package/dist/ui/components/input/checkbox.js +17 -8
  23. package/dist/ui/components/input/input_field.js +28 -23
  24. package/dist/ui/components/input/range.js +26 -9
  25. package/dist/ui/components/input/select.js +16 -7
  26. package/dist/ui/components/input/text_area.js +17 -8
  27. package/dist/ui/components/layout/flex.d.ts +4 -3
  28. package/dist/ui/components/layout/flex.js +27 -19
  29. package/dist/ui/components/layout/scaffold.d.ts +9 -6
  30. package/dist/ui/components/layout/scaffold.js +40 -22
  31. package/dist/ui/components/layout/scroll.js +10 -14
  32. package/dist/ui/components/layout/spaced.js +3 -6
  33. package/dist/ui/components/spinner.js +16 -19
  34. package/dist/ui/components/text.js +42 -37
  35. package/dist/ui/theme/color_theme.js +36 -42
  36. package/dist/ui/theme/colors.js +40 -77
  37. package/dist/ui/theme/geometry_theme.js +8 -16
  38. package/dist/ui/theme/theme.d.ts +1 -0
  39. package/dist/ui/theme/theme.js +13 -34
  40. package/dist/ui/theme/type_theme.js +11 -39
  41. package/dist/ui/util/confirm_dialog.js +1 -4
  42. package/dist/ui/util/error_view.js +4 -7
  43. package/dist/ui/util/toast.js +8 -5
  44. package/dist/ui/util/util.d.ts +1 -0
  45. package/dist/ui/util/util.js +12 -13
  46. package/package.json +4 -2
@@ -1,53 +1,32 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Badge = void 0;
7
- exports.TestBadge = TestBadge;
8
- const jsx_runtime_1 = require("preact/jsx-runtime");
9
- const compat_1 = __importDefault(require("preact/compat"));
10
- function TestBadge(p) {
11
- return new Badge({ ...p, kind: "accent" });
1
+ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ import React from "preact/compat";
3
+ export function TestBadge(p) {
4
+ return new Badge(Object.assign(Object.assign({}, p), { kind: "accent" }));
12
5
  }
13
- class Badge extends compat_1.default.Component {
6
+ export class Badge extends React.Component {
14
7
  constructor(props) {
15
8
  super(props);
16
9
  }
17
10
  static accent(p) {
18
- return (0, jsx_runtime_1.jsx)(Badge, { ...p, kind: "accent" });
11
+ return _jsx(Badge, Object.assign({}, p, { kind: "accent" }));
19
12
  }
20
13
  static error(p) {
21
- return (0, jsx_runtime_1.jsx)(Badge, { ...p, kind: "error" });
14
+ return _jsx(Badge, Object.assign({}, p, { kind: "error" }));
22
15
  }
23
16
  static warning(p) {
24
- return (0, jsx_runtime_1.jsx)(Badge, { ...p, kind: "warning" });
17
+ return _jsx(Badge, Object.assign({}, p, { kind: "warning" }));
25
18
  }
26
19
  static success(p) {
27
- return (0, jsx_runtime_1.jsx)(Badge, { ...p, kind: "success" });
20
+ return _jsx(Badge, Object.assign({}, p, { kind: "success" }));
28
21
  }
29
22
  static info(p) {
30
- return (0, jsx_runtime_1.jsx)(Badge, { ...p, kind: "info" });
23
+ return _jsx(Badge, Object.assign({}, p, { kind: "info" }));
31
24
  }
32
25
  render() {
33
- return ((0, jsx_runtime_1.jsxs)("div", { style: {
26
+ var _a, _b;
27
+ return (_jsxs("div", { style: {
34
28
  position: "relative",
35
29
  display: "inline-block",
36
- }, children: [this.props.child, this.props.children, (0, jsx_runtime_1.jsx)("div", { class: `b ${this.props.kind} major ${this.props.class ?? ""}`, style: {
37
- position: "absolute",
38
- top: "-0.25rem",
39
- right: "-0.25rem",
40
- minWidth: "1.5rem",
41
- minHeight: "1.5rem",
42
- padding: "0rem .4rem",
43
- borderRadius: "3rem",
44
- fontWeight: "bold",
45
- display: "flex",
46
- justifyContent: "center",
47
- alignItems: "center",
48
- visibility: this.props.hidden ? "hidden" : "visible",
49
- ...this.props.style,
50
- }, children: this.props.label ?? this.props.count })] }));
30
+ }, children: [this.props.child, this.props.children, _jsx("div", { class: `b ${this.props.kind} major ${(_a = this.props.class) !== null && _a !== void 0 ? _a : ""}`, style: Object.assign({ position: "absolute", top: "-0.25rem", right: "-0.25rem", minWidth: "1.5rem", minHeight: "1.5rem", padding: "0rem .4rem", borderRadius: "3rem", fontWeight: "bold", display: "flex", justifyContent: "center", alignItems: "center", visibility: this.props.hidden ? "hidden" : "visible" }, this.props.style), children: (_b = this.props.label) !== null && _b !== void 0 ? _b : this.props.count })] }));
51
31
  }
52
32
  }
53
- exports.Badge = Badge;
@@ -6,16 +6,23 @@ export type ElbeProps = {
6
6
  class?: string;
7
7
  style?: React.CSSProperties;
8
8
  tooltip?: string;
9
+ flex?: boolean | number;
10
+ typeLabel?: string;
9
11
  };
10
12
  export declare function applyProps(p: ElbeProps, classes?: string | null | (string | false | null | undefined)[], style?: React.CSSProperties): {
13
+ "data-type": string | undefined;
11
14
  "data-tooltip"?: string | undefined;
12
15
  id: string | undefined;
13
16
  class: string;
14
17
  style: {
15
- [x: string]: string | number | null | undefined;
16
- [x: number]: string | number | null | undefined;
18
+ flex?: string | number | null | undefined;
17
19
  cssText?: string | null;
18
20
  [Symbol.iterator]?: string | number | null | undefined;
21
+ clipPath?: string | number | null | undefined;
22
+ filter?: string | number | null | undefined;
23
+ marker?: string | number | null | undefined;
24
+ mask?: string | number | null | undefined;
25
+ font?: string | number | null | undefined;
19
26
  border?: string | number | null | undefined;
20
27
  accentColor?: string | number | null | undefined;
21
28
  alignContent?: string | number | null | undefined;
@@ -122,7 +129,6 @@ export declare function applyProps(p: ElbeProps, classes?: string | null | (stri
122
129
  caretColor?: string | number | null | undefined;
123
130
  clear?: string | number | null | undefined;
124
131
  clip?: string | number | null | undefined;
125
- clipPath?: string | number | null | undefined;
126
132
  clipRule?: string | number | null | undefined;
127
133
  color?: string | number | null | undefined;
128
134
  colorInterpolation?: string | number | null | undefined;
@@ -164,8 +170,6 @@ export declare function applyProps(p: ElbeProps, classes?: string | null | (stri
164
170
  fill?: string | number | null | undefined;
165
171
  fillOpacity?: string | number | null | undefined;
166
172
  fillRule?: string | number | null | undefined;
167
- filter?: string | number | null | undefined;
168
- flex?: string | number | null | undefined;
169
173
  flexBasis?: string | number | null | undefined;
170
174
  flexDirection?: string | number | null | undefined;
171
175
  flexFlow?: string | number | null | undefined;
@@ -175,7 +179,6 @@ export declare function applyProps(p: ElbeProps, classes?: string | null | (stri
175
179
  float?: string | number | null | undefined;
176
180
  floodColor?: string | number | null | undefined;
177
181
  floodOpacity?: string | number | null | undefined;
178
- font?: string | number | null | undefined;
179
182
  fontFamily?: string | number | null | undefined;
180
183
  fontFeatureSettings?: string | number | null | undefined;
181
184
  fontKerning?: string | number | null | undefined;
@@ -256,11 +259,9 @@ export declare function applyProps(p: ElbeProps, classes?: string | null | (stri
256
259
  marginLeft?: string | number | null | undefined;
257
260
  marginRight?: string | number | null | undefined;
258
261
  marginTop?: string | number | null | undefined;
259
- marker?: string | number | null | undefined;
260
262
  markerEnd?: string | number | null | undefined;
261
263
  markerMid?: string | number | null | undefined;
262
264
  markerStart?: string | number | null | undefined;
263
- mask?: string | number | null | undefined;
264
265
  maskClip?: string | number | null | undefined;
265
266
  maskComposite?: string | number | null | undefined;
266
267
  maskImage?: string | number | null | undefined;
@@ -526,14 +527,19 @@ export declare class Box extends Component<ElbeBoxProps & {
526
527
  scheme: ElbeColorSchemes;
527
528
  }> {
528
529
  static primary: (p: ElbeBoxProps) => import("preact").VNode<import("preact").ClassAttributes<HTMLElement> & {
530
+ "data-type": string | undefined;
529
531
  "data-tooltip"?: string | undefined;
530
532
  id: string | undefined;
531
533
  class: string;
532
534
  style: {
533
- [x: string]: string | number | null | undefined;
534
- [x: number]: string | number | null | undefined;
535
+ flex?: string | number | null | undefined;
535
536
  cssText?: string | null;
536
537
  [Symbol.iterator]?: string | number | null | undefined;
538
+ clipPath?: string | number | null | undefined;
539
+ filter?: string | number | null | undefined;
540
+ marker?: string | number | null | undefined;
541
+ mask?: string | number | null | undefined;
542
+ font?: string | number | null | undefined;
537
543
  border?: string | number | null | undefined;
538
544
  accentColor?: string | number | null | undefined;
539
545
  alignContent?: string | number | null | undefined;
@@ -640,7 +646,6 @@ export declare class Box extends Component<ElbeBoxProps & {
640
646
  caretColor?: string | number | null | undefined;
641
647
  clear?: string | number | null | undefined;
642
648
  clip?: string | number | null | undefined;
643
- clipPath?: string | number | null | undefined;
644
649
  clipRule?: string | number | null | undefined;
645
650
  color?: string | number | null | undefined;
646
651
  colorInterpolation?: string | number | null | undefined;
@@ -682,8 +687,6 @@ export declare class Box extends Component<ElbeBoxProps & {
682
687
  fill?: string | number | null | undefined;
683
688
  fillOpacity?: string | number | null | undefined;
684
689
  fillRule?: string | number | null | undefined;
685
- filter?: string | number | null | undefined;
686
- flex?: string | number | null | undefined;
687
690
  flexBasis?: string | number | null | undefined;
688
691
  flexDirection?: string | number | null | undefined;
689
692
  flexFlow?: string | number | null | undefined;
@@ -693,7 +696,6 @@ export declare class Box extends Component<ElbeBoxProps & {
693
696
  float?: string | number | null | undefined;
694
697
  floodColor?: string | number | null | undefined;
695
698
  floodOpacity?: string | number | null | undefined;
696
- font?: string | number | null | undefined;
697
699
  fontFamily?: string | number | null | undefined;
698
700
  fontFeatureSettings?: string | number | null | undefined;
699
701
  fontKerning?: string | number | null | undefined;
@@ -774,11 +776,9 @@ export declare class Box extends Component<ElbeBoxProps & {
774
776
  marginLeft?: string | number | null | undefined;
775
777
  marginRight?: string | number | null | undefined;
776
778
  marginTop?: string | number | null | undefined;
777
- marker?: string | number | null | undefined;
778
779
  markerEnd?: string | number | null | undefined;
779
780
  markerMid?: string | number | null | undefined;
780
781
  markerStart?: string | number | null | undefined;
781
- mask?: string | number | null | undefined;
782
782
  maskClip?: string | number | null | undefined;
783
783
  maskComposite?: string | number | null | undefined;
784
784
  maskImage?: string | number | null | undefined;
@@ -1035,14 +1035,19 @@ export declare class Box extends Component<ElbeBoxProps & {
1035
1035
  };
1036
1036
  }>;
1037
1037
  static secondary: (p: ElbeBoxProps) => import("preact").VNode<import("preact").ClassAttributes<HTMLElement> & {
1038
+ "data-type": string | undefined;
1038
1039
  "data-tooltip"?: string | undefined;
1039
1040
  id: string | undefined;
1040
1041
  class: string;
1041
1042
  style: {
1042
- [x: string]: string | number | null | undefined;
1043
- [x: number]: string | number | null | undefined;
1043
+ flex?: string | number | null | undefined;
1044
1044
  cssText?: string | null;
1045
1045
  [Symbol.iterator]?: string | number | null | undefined;
1046
+ clipPath?: string | number | null | undefined;
1047
+ filter?: string | number | null | undefined;
1048
+ marker?: string | number | null | undefined;
1049
+ mask?: string | number | null | undefined;
1050
+ font?: string | number | null | undefined;
1046
1051
  border?: string | number | null | undefined;
1047
1052
  accentColor?: string | number | null | undefined;
1048
1053
  alignContent?: string | number | null | undefined;
@@ -1149,7 +1154,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1149
1154
  caretColor?: string | number | null | undefined;
1150
1155
  clear?: string | number | null | undefined;
1151
1156
  clip?: string | number | null | undefined;
1152
- clipPath?: string | number | null | undefined;
1153
1157
  clipRule?: string | number | null | undefined;
1154
1158
  color?: string | number | null | undefined;
1155
1159
  colorInterpolation?: string | number | null | undefined;
@@ -1191,8 +1195,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1191
1195
  fill?: string | number | null | undefined;
1192
1196
  fillOpacity?: string | number | null | undefined;
1193
1197
  fillRule?: string | number | null | undefined;
1194
- filter?: string | number | null | undefined;
1195
- flex?: string | number | null | undefined;
1196
1198
  flexBasis?: string | number | null | undefined;
1197
1199
  flexDirection?: string | number | null | undefined;
1198
1200
  flexFlow?: string | number | null | undefined;
@@ -1202,7 +1204,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1202
1204
  float?: string | number | null | undefined;
1203
1205
  floodColor?: string | number | null | undefined;
1204
1206
  floodOpacity?: string | number | null | undefined;
1205
- font?: string | number | null | undefined;
1206
1207
  fontFamily?: string | number | null | undefined;
1207
1208
  fontFeatureSettings?: string | number | null | undefined;
1208
1209
  fontKerning?: string | number | null | undefined;
@@ -1283,11 +1284,9 @@ export declare class Box extends Component<ElbeBoxProps & {
1283
1284
  marginLeft?: string | number | null | undefined;
1284
1285
  marginRight?: string | number | null | undefined;
1285
1286
  marginTop?: string | number | null | undefined;
1286
- marker?: string | number | null | undefined;
1287
1287
  markerEnd?: string | number | null | undefined;
1288
1288
  markerMid?: string | number | null | undefined;
1289
1289
  markerStart?: string | number | null | undefined;
1290
- mask?: string | number | null | undefined;
1291
1290
  maskClip?: string | number | null | undefined;
1292
1291
  maskComposite?: string | number | null | undefined;
1293
1292
  maskImage?: string | number | null | undefined;
@@ -1544,14 +1543,19 @@ export declare class Box extends Component<ElbeBoxProps & {
1544
1543
  };
1545
1544
  }>;
1546
1545
  static inverse: (p: ElbeBoxProps) => import("preact").VNode<import("preact").ClassAttributes<HTMLElement> & {
1546
+ "data-type": string | undefined;
1547
1547
  "data-tooltip"?: string | undefined;
1548
1548
  id: string | undefined;
1549
1549
  class: string;
1550
1550
  style: {
1551
- [x: string]: string | number | null | undefined;
1552
- [x: number]: string | number | null | undefined;
1551
+ flex?: string | number | null | undefined;
1553
1552
  cssText?: string | null;
1554
1553
  [Symbol.iterator]?: string | number | null | undefined;
1554
+ clipPath?: string | number | null | undefined;
1555
+ filter?: string | number | null | undefined;
1556
+ marker?: string | number | null | undefined;
1557
+ mask?: string | number | null | undefined;
1558
+ font?: string | number | null | undefined;
1555
1559
  border?: string | number | null | undefined;
1556
1560
  accentColor?: string | number | null | undefined;
1557
1561
  alignContent?: string | number | null | undefined;
@@ -1658,7 +1662,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1658
1662
  caretColor?: string | number | null | undefined;
1659
1663
  clear?: string | number | null | undefined;
1660
1664
  clip?: string | number | null | undefined;
1661
- clipPath?: string | number | null | undefined;
1662
1665
  clipRule?: string | number | null | undefined;
1663
1666
  color?: string | number | null | undefined;
1664
1667
  colorInterpolation?: string | number | null | undefined;
@@ -1700,8 +1703,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1700
1703
  fill?: string | number | null | undefined;
1701
1704
  fillOpacity?: string | number | null | undefined;
1702
1705
  fillRule?: string | number | null | undefined;
1703
- filter?: string | number | null | undefined;
1704
- flex?: string | number | null | undefined;
1705
1706
  flexBasis?: string | number | null | undefined;
1706
1707
  flexDirection?: string | number | null | undefined;
1707
1708
  flexFlow?: string | number | null | undefined;
@@ -1711,7 +1712,6 @@ export declare class Box extends Component<ElbeBoxProps & {
1711
1712
  float?: string | number | null | undefined;
1712
1713
  floodColor?: string | number | null | undefined;
1713
1714
  floodOpacity?: string | number | null | undefined;
1714
- font?: string | number | null | undefined;
1715
1715
  fontFamily?: string | number | null | undefined;
1716
1716
  fontFeatureSettings?: string | number | null | undefined;
1717
1717
  fontKerning?: string | number | null | undefined;
@@ -1792,11 +1792,9 @@ export declare class Box extends Component<ElbeBoxProps & {
1792
1792
  marginLeft?: string | number | null | undefined;
1793
1793
  marginRight?: string | number | null | undefined;
1794
1794
  marginTop?: string | number | null | undefined;
1795
- marker?: string | number | null | undefined;
1796
1795
  markerEnd?: string | number | null | undefined;
1797
1796
  markerMid?: string | number | null | undefined;
1798
1797
  markerStart?: string | number | null | undefined;
1799
- mask?: string | number | null | undefined;
1800
1798
  maskClip?: string | number | null | undefined;
1801
1799
  maskComposite?: string | number | null | undefined;
1802
1800
  maskImage?: string | number | null | undefined;
@@ -2053,14 +2051,19 @@ export declare class Box extends Component<ElbeBoxProps & {
2053
2051
  };
2054
2052
  }>;
2055
2053
  render(): import("preact").VNode<import("preact").ClassAttributes<HTMLElement> & {
2054
+ "data-type": string | undefined;
2056
2055
  "data-tooltip"?: string | undefined;
2057
2056
  id: string | undefined;
2058
2057
  class: string;
2059
2058
  style: {
2060
- [x: string]: string | number | null | undefined;
2061
- [x: number]: string | number | null | undefined;
2059
+ flex?: string | number | null | undefined;
2062
2060
  cssText?: string | null;
2063
2061
  [Symbol.iterator]?: string | number | null | undefined;
2062
+ clipPath?: string | number | null | undefined;
2063
+ filter?: string | number | null | undefined;
2064
+ marker?: string | number | null | undefined;
2065
+ mask?: string | number | null | undefined;
2066
+ font?: string | number | null | undefined;
2064
2067
  border?: string | number | null | undefined;
2065
2068
  accentColor?: string | number | null | undefined;
2066
2069
  alignContent?: string | number | null | undefined;
@@ -2167,7 +2170,6 @@ export declare class Box extends Component<ElbeBoxProps & {
2167
2170
  caretColor?: string | number | null | undefined;
2168
2171
  clear?: string | number | null | undefined;
2169
2172
  clip?: string | number | null | undefined;
2170
- clipPath?: string | number | null | undefined;
2171
2173
  clipRule?: string | number | null | undefined;
2172
2174
  color?: string | number | null | undefined;
2173
2175
  colorInterpolation?: string | number | null | undefined;
@@ -2209,8 +2211,6 @@ export declare class Box extends Component<ElbeBoxProps & {
2209
2211
  fill?: string | number | null | undefined;
2210
2212
  fillOpacity?: string | number | null | undefined;
2211
2213
  fillRule?: string | number | null | undefined;
2212
- filter?: string | number | null | undefined;
2213
- flex?: string | number | null | undefined;
2214
2214
  flexBasis?: string | number | null | undefined;
2215
2215
  flexDirection?: string | number | null | undefined;
2216
2216
  flexFlow?: string | number | null | undefined;
@@ -2220,7 +2220,6 @@ export declare class Box extends Component<ElbeBoxProps & {
2220
2220
  float?: string | number | null | undefined;
2221
2221
  floodColor?: string | number | null | undefined;
2222
2222
  floodOpacity?: string | number | null | undefined;
2223
- font?: string | number | null | undefined;
2224
2223
  fontFamily?: string | number | null | undefined;
2225
2224
  fontFeatureSettings?: string | number | null | undefined;
2226
2225
  fontKerning?: string | number | null | undefined;
@@ -2301,11 +2300,9 @@ export declare class Box extends Component<ElbeBoxProps & {
2301
2300
  marginLeft?: string | number | null | undefined;
2302
2301
  marginRight?: string | number | null | undefined;
2303
2302
  marginTop?: string | number | null | undefined;
2304
- marker?: string | number | null | undefined;
2305
2303
  markerEnd?: string | number | null | undefined;
2306
2304
  markerMid?: string | number | null | undefined;
2307
2305
  markerStart?: string | number | null | undefined;
2308
- mask?: string | number | null | undefined;
2309
2306
  maskClip?: string | number | null | undefined;
2310
2307
  maskComposite?: string | number | null | undefined;
2311
2308
  maskImage?: string | number | null | undefined;
@@ -1,30 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Box = void 0;
4
- exports.applyProps = applyProps;
5
- const preact_1 = require("preact");
6
- function applyProps(p, classes, style) {
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 { Component, h } from "preact";
13
+ export function applyProps(p, classes, style) {
14
+ var _a;
7
15
  if (Array.isArray(classes)) {
8
16
  classes = classes.filter((c) => c).join(" ");
9
17
  }
10
- return {
11
- id: p.id,
12
- class: `${classes || ""} ${p.class || ""}`,
13
- style: { ...(style ?? {}), ...(p.style ?? {}) },
14
- ...(p.tooltip ? { ["data-tooltip"]: p.tooltip } : {}),
15
- };
18
+ return Object.assign(Object.assign({ id: p.id, class: `${classes || ""} ${p.class || ""}`, style: Object.assign(Object.assign(Object.assign({}, (style !== null && style !== void 0 ? style : {})), ((_a = p.style) !== null && _a !== void 0 ? _a : {})), (p.flex ? { flex: p.flex === true ? 1 : p.flex } : {})) }, (p.tooltip ? { ["data-tooltip"]: p.tooltip } : {})), { ["data-type"]: p.typeLabel });
16
19
  }
17
- class Box extends preact_1.Component {
18
- static primary = (p) => new Box({ ...p, scheme: "primary" }).render();
19
- static secondary = (p) => new Box({ ...p, scheme: "secondary" }).render();
20
- static inverse = (p) => new Box({ ...p, scheme: "inverse" }).render();
20
+ export class Box extends Component {
21
21
  render() {
22
- const { scheme, mode, padding, margin, children, ...elbe } = this.props;
23
- return (0, preact_1.h)("div", applyProps(elbe, [scheme, mode], {
24
- padding: `${padding}rem`,
25
- margin: `${margin}rem`,
26
- ...elbe.style,
27
- }), children);
22
+ const _a = this.props, { scheme, mode, padding, margin, children } = _a, elbe = __rest(_a, ["scheme", "mode", "padding", "margin", "children"]);
23
+ return h("div", applyProps(elbe, [scheme, mode], Object.assign({ padding: `${padding}rem`, margin: `${margin}rem` }, elbe.style)), children);
28
24
  }
29
25
  }
30
- exports.Box = Box;
26
+ Box.primary = (p) => new Box(Object.assign(Object.assign({}, p), { scheme: "primary" })).render();
27
+ Box.secondary = (p) => new Box(Object.assign(Object.assign({}, p), { scheme: "secondary" })).render();
28
+ Box.inverse = (p) => new Box(Object.assign(Object.assign({}, p), { scheme: "inverse" })).render();
@@ -1,11 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Card = Card;
4
- const jsx_runtime_1 = require("preact/jsx-runtime");
5
- const box_1 = require("./box");
6
- function Card({ mode, scheme = "primary", kind, manner, padding = 1, margin = 0, onTap, onLongTap, children, ...elbe }) {
7
- return ((0, jsx_runtime_1.jsx)("div", { ...(0, box_1.applyProps)(elbe, ["card", mode, scheme, kind, manner], {
8
- padding: `${padding}rem`,
9
- margin: `${margin}rem`,
10
- }), onClick: onTap, onContextMenu: onLongTap, children: children }));
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 "./box";
14
+ export function Card(_a) {
15
+ var { mode, scheme = "primary", kind, manner, padding = 1, margin = 0, onTap, onLongTap, children } = _a, elbe = __rest(_a, ["mode", "scheme", "kind", "manner", "padding", "margin", "onTap", "onLongTap", "children"]);
16
+ return (_jsx("div", Object.assign({}, applyProps(elbe, ["card", mode, scheme, kind, manner], {
17
+ padding: `${padding}rem`,
18
+ margin: `${margin}rem`,
19
+ }), { onClick: onTap, onContextMenu: onLongTap, children: children })));
11
20
  }
@@ -1,18 +1,19 @@
1
1
  import React from "preact/compat";
2
- export type PaddedProps = {
2
+ import { ElbeProps } from "./box";
3
+ export type PaddedProps = ElbeProps & {
3
4
  children: any;
4
5
  };
5
6
  export declare class Padded extends React.Component<PaddedProps & {
6
- top: number;
7
- right: number;
8
- bottom: number;
9
- left: number;
7
+ top?: number;
8
+ right?: number;
9
+ bottom?: number;
10
+ left?: number;
10
11
  }> {
11
12
  constructor(props: PaddedProps & {
12
- top: number;
13
- right: number;
14
- bottom: number;
15
- left: number;
13
+ top?: number;
14
+ right?: number;
15
+ bottom?: number;
16
+ left?: number;
16
17
  });
17
18
  static all: ({ amount, ...p }: PaddedProps & {
18
19
  amount: number;
@@ -1,28 +1,38 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Padded = void 0;
7
- const jsx_runtime_1 = require("preact/jsx-runtime");
8
- const compat_1 = __importDefault(require("preact/compat"));
9
- class Padded extends compat_1.default.Component {
12
+ import { jsx as _jsx } from "preact/jsx-runtime";
13
+ import React from "preact/compat";
14
+ import { applyProps } from "./box";
15
+ export class Padded extends React.Component {
10
16
  constructor(props) {
11
17
  super(props);
12
18
  }
13
- static all = ({ amount = 1, ...p }) => ((0, jsx_runtime_1.jsx)(Padded, { ...p, top: amount, right: amount, bottom: amount, left: amount }));
14
- static symmetric = ({ vertical = 0, horizontal = 0, ...p }) => ((0, jsx_runtime_1.jsx)(Padded, { ...p,
15
- top: vertical,
16
- bottom: vertical,
17
- left: horizontal,
18
- right: horizontal }));
19
19
  render() {
20
- return ((0, jsx_runtime_1.jsx)("div", { style: {
21
- paddingTop: `${this.props.top}rem`,
22
- paddingRight: `${this.props.right}rem`,
23
- paddingBottom: `${this.props.bottom}rem`,
24
- paddingLeft: `${this.props.left}rem`,
25
- }, children: this.props.children }));
20
+ return (_jsx("div", Object.assign({}, applyProps(this.props, [], {
21
+ paddingTop: `${this.props.top || 0}rem`,
22
+ paddingRight: `${this.props.right || 0}rem`,
23
+ paddingBottom: `${this.props.bottom || 0}rem`,
24
+ paddingLeft: `${this.props.left || 0}rem`,
25
+ }), { children: this.props.children })));
26
26
  }
27
27
  }
28
- exports.Padded = Padded;
28
+ Padded.all = (_a) => {
29
+ var { amount = 1 } = _a, p = __rest(_a, ["amount"]);
30
+ return (_jsx(Padded, Object.assign({}, p, { top: amount, right: amount, bottom: amount, left: amount })));
31
+ };
32
+ Padded.symmetric = (_a) => {
33
+ var { vertical = 0, horizontal = 0 } = _a, p = __rest(_a, ["vertical", "horizontal"]);
34
+ return (_jsx(Padded, Object.assign({}, p, { top: vertical,
35
+ bottom: vertical,
36
+ left: horizontal,
37
+ right: horizontal })));
38
+ };
@@ -1,27 +1,35 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Button = void 0;
4
- const jsx_runtime_1 = require("preact/jsx-runtime");
5
- const preact_1 = require("preact");
6
- const error_view_1 = require("../../util/error_view");
7
- const box_1 = require("../base/box");
8
- class Button extends preact_1.Component {
9
- static major = (p) => _btn(p, "major");
10
- static minor = (p) => _btn(p, "minor");
11
- static flat = (p) => _btn(p, "flat");
12
- static plain = (p) => _btn(p, "plain");
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 { Component } from "preact";
14
+ import { _ElbeErr } from "../../util/error_view";
15
+ import { applyProps } from "../base/box";
16
+ export class Button extends Component {
13
17
  render() {
14
18
  return _btn(this.props, this.props.manner);
15
19
  }
16
20
  }
17
- exports.Button = Button;
18
- function _btn({ kind, onTap, icon, label, children, ...elbe }, manner) {
19
- return label || icon || children ? ((0, jsx_runtime_1.jsxs)("button", { ...(0, box_1.applyProps)(elbe, [
20
- "row",
21
- "gap-half",
22
- "main-center",
23
- kind ?? (manner != "plain" && "accent"),
24
- manner,
25
- !onTap && "disabled",
26
- ]), disabled: !onTap, onClick: (e) => onTap && onTap(e), children: [typeof icon === "function" ? icon({}) : icon, label && (0, jsx_runtime_1.jsx)("span", { children: label }), children] })) : ((0, error_view_1._ElbeErr)("Button requires either an icon and or a label, or a child"));
21
+ Button.major = (p) => _btn(p, "major");
22
+ Button.minor = (p) => _btn(p, "minor");
23
+ Button.flat = (p) => _btn(p, "flat");
24
+ Button.plain = (p) => _btn(p, "plain");
25
+ function _btn(_a, manner) {
26
+ var { kind, onTap, icon, label, children } = _a, elbe = __rest(_a, ["kind", "onTap", "icon", "label", "children"]);
27
+ return label || icon || children ? (_jsxs("button", Object.assign({}, applyProps(elbe, [
28
+ "row",
29
+ "gap-half",
30
+ "main-center",
31
+ kind !== null && kind !== void 0 ? kind : (manner != "plain" && "accent"),
32
+ manner,
33
+ !onTap && "disabled",
34
+ ]), { disabled: !onTap, onClick: (e) => onTap && onTap(e), children: [typeof icon === "function" ? icon({}) : icon, label && _jsx("span", { children: label }), children] }))) : (_ElbeErr("Button requires either an icon and or a label, or a child"));
27
35
  }
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChooseButton = ChooseButton;
4
- const jsx_runtime_1 = require("preact/jsx-runtime");
5
- const lucide_react_1 = require("lucide-react");
6
- const spaced_1 = require("../layout/spaced");
7
- const button_1 = require("./button");
8
- function ChooseButton({ items, value, onChange, kind, column = false, }) {
9
- return ((0, jsx_runtime_1.jsx)("div", { class: `${column ? "column" : "row"} gap-none rounded accent minor card padding-none cross-stretch ${!onChange ? "disabled" : ""}`, style: "background: transparent", children: items.map((e) => ((0, jsx_runtime_1.jsxs)(button_1.Button, { manner: e.value === value ? "minor" : "flat", kind: kind, onTap: onChange && (() => onChange(e.value)), class: `sharp ${column ? "main-between gap-double" : ""}`, children: [(0, jsx_runtime_1.jsxs)("div", { class: "row gap-half", children: [typeof e.icon === "function" ? e.icon({}) : e.icon, e.label && (0, jsx_runtime_1.jsx)("span", { children: e.label })] }), column &&
10
- (e.value === value ? (0, jsx_runtime_1.jsx)(lucide_react_1.CheckIcon, {}) : (0, jsx_runtime_1.jsx)(spaced_1.Spaced, { amount: 1.5 }))] }))) }));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ import { CheckIcon } from "lucide-react";
3
+ import { Spaced } from "../layout/spaced";
4
+ import { Button } from "./button";
5
+ export function ChooseButton({ items, value, onChange, kind, column = false, }) {
6
+ return (_jsx("div", { class: `${column ? "column" : "row"} gap-none rounded accent minor card padding-none cross-stretch ${!onChange ? "disabled" : ""}`, style: "background: transparent", children: items.map((e) => (_jsxs(Button, { manner: e.value === value ? "minor" : "flat", kind: kind, onTap: onChange && (() => onChange(e.value)), class: `sharp ${column ? "main-between gap-double" : ""}`, children: [_jsxs("div", { class: "row gap-half", children: [typeof e.icon === "function" ? e.icon({}) : e.icon, e.label && _jsx("span", { children: e.label })] }), column &&
7
+ (e.value === value ? _jsx(CheckIcon, {}) : _jsx(Spaced, { amount: 1.5 }))] }))) }));
11
8
  }