elbe-ui 0.4.26 → 1.0.2

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 (96) hide show
  1. package/README.md +1 -1
  2. package/dist/bit/_bit_provider.d.ts +1 -1
  3. package/dist/bit/_bit_provider.js +11 -6
  4. package/dist/bit/_bit_utils.d.ts +5 -1
  5. package/dist/bit/bit.d.ts +2 -2
  6. package/dist/bit/bit.js +2 -2
  7. package/dist/elbe.css +97 -61
  8. package/dist/elbe.css.map +1 -1
  9. package/dist/index.d.ts +1529 -1527
  10. package/dist/index.js +3 -2
  11. package/dist/ui/components/badge.d.ts +7 -7
  12. package/dist/ui/components/badge.js +3 -3
  13. package/dist/ui/components/banner.d.ts +2 -2
  14. package/dist/ui/components/banner.js +8 -8
  15. package/dist/ui/components/base/box.d.ts +4140 -2520
  16. package/dist/ui/components/base/box.js +4 -4
  17. package/dist/ui/components/base/card.d.ts +1 -1
  18. package/dist/ui/components/base/card.js +1 -1
  19. package/dist/ui/components/base/padded.d.ts +4 -4
  20. package/dist/ui/components/base/padded.js +2 -2
  21. package/dist/ui/components/button/button.d.ts +10 -9
  22. package/dist/ui/components/button/button.js +15 -13
  23. package/dist/ui/components/button/choose_button.d.ts +2 -2
  24. package/dist/ui/components/button/choose_button.js +5 -4
  25. package/dist/ui/components/button/icon_button.d.ts +9 -8
  26. package/dist/ui/components/button/icon_button.js +16 -4
  27. package/dist/ui/components/button/toggle_button.d.ts +2 -2
  28. package/dist/ui/components/button/toggle_button.js +8 -4
  29. package/dist/ui/components/dev/todo.d.ts +4 -4
  30. package/dist/ui/components/dev/todo.js +2 -2
  31. package/dist/ui/components/dialog.d.ts +4 -3
  32. package/dist/ui/components/dialog.js +21 -4
  33. package/dist/ui/components/error_view.d.ts +2 -2
  34. package/dist/ui/components/error_view.js +12 -8
  35. package/dist/ui/components/footer.d.ts +3 -3
  36. package/dist/ui/components/footer.js +3 -3
  37. package/dist/ui/components/input/checkbox.d.ts +1 -1
  38. package/dist/ui/components/input/checkbox.js +5 -5
  39. package/dist/ui/components/input/range.d.ts +1 -1
  40. package/dist/ui/components/input/range.js +1 -1
  41. package/dist/ui/components/input/select.d.ts +1 -1
  42. package/dist/ui/components/input/select.js +2 -2
  43. package/dist/ui/components/input/switch.d.ts +1 -1
  44. package/dist/ui/components/input/switch.js +1 -1
  45. package/dist/ui/components/input/text/input_field.d.ts +9 -9
  46. package/dist/ui/components/input/text/input_field.js +7 -7
  47. package/dist/ui/components/input/text/multi_line.d.ts +1 -1
  48. package/dist/ui/components/input/text/multi_line.js +3 -3
  49. package/dist/ui/components/input/text/single_line.d.ts +1 -1
  50. package/dist/ui/components/input/text/single_line.js +4 -4
  51. package/dist/ui/components/layout/alignment.d.ts +3 -2
  52. package/dist/ui/components/layout/alignment.js +2 -2
  53. package/dist/ui/components/layout/app_base.d.ts +1 -1
  54. package/dist/ui/components/layout/app_base.js +33 -9
  55. package/dist/ui/components/layout/ctx_app_base.d.ts +8 -3
  56. package/dist/ui/components/layout/ctx_app_base.js +1 -2
  57. package/dist/ui/components/layout/flex.d.ts +3 -3
  58. package/dist/ui/components/layout/flex.js +5 -5
  59. package/dist/ui/components/layout/header.d.ts +5 -8
  60. package/dist/ui/components/layout/header.js +11 -13
  61. package/dist/ui/components/layout/menu.d.ts +1 -1
  62. package/dist/ui/components/layout/menu.js +6 -6
  63. package/dist/ui/components/layout/page.d.ts +3 -1
  64. package/dist/ui/components/layout/page.js +14 -12
  65. package/dist/ui/components/layout/scroll.d.ts +4 -4
  66. package/dist/ui/components/layout/scroll.js +3 -3
  67. package/dist/ui/components/layout/spaced.d.ts +1 -1
  68. package/dist/ui/components/layout/spaced.js +1 -1
  69. package/dist/ui/components/layout/toolbar.d.ts +2 -2
  70. package/dist/ui/components/layout/toolbar.js +4 -6
  71. package/dist/ui/components/link.d.ts +1 -1
  72. package/dist/ui/components/link.js +2 -2
  73. package/dist/ui/components/progress_bar.d.ts +1 -1
  74. package/dist/ui/components/progress_bar.js +1 -1
  75. package/dist/ui/components/routing/route.d.ts +8 -8
  76. package/dist/ui/components/routing/route.js +4 -4
  77. package/dist/ui/components/spinner.d.ts +4 -4
  78. package/dist/ui/components/spinner.js +33 -33
  79. package/dist/ui/components/text.d.ts +15 -15
  80. package/dist/ui/components/text.js +6 -6
  81. package/dist/ui/theme/colors.js +0 -1
  82. package/dist/ui/theme/theme.d.ts +1 -1
  83. package/dist/ui/theme/theme.js +3 -3
  84. package/dist/ui/theme/theme_context.d.ts +2 -2
  85. package/dist/ui/theme/theme_context.js +1 -2
  86. package/dist/ui/util/ctx_toolbar.d.ts +1 -2
  87. package/dist/ui/util/ctx_toolbar.js +2 -2
  88. package/dist/ui/util/error_view.d.ts +1 -1
  89. package/dist/ui/util/error_view.js +8 -2
  90. package/dist/ui/util/l10n/_l10n_util.d.ts +1 -1
  91. package/dist/ui/util/l10n/_l10n_util.js +1 -1
  92. package/dist/ui/util/l10n/l10n.d.ts +1 -1
  93. package/dist/ui/util/l10n/l10n.js +2 -2
  94. package/dist/ui/util/types.d.ts +3 -2
  95. package/dist/ui/util/util.js +1 -2
  96. package/package.json +6 -8
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx } from "preact/jsx-runtime";
2
- import { wouter } from "../../..";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Wouter } from "../../..";
3
3
  /**
4
4
  * a route that also renders a menu item in the <AppBase> component.
5
5
  * place it as a child of <AppBase> to have it rendered in the menu.
@@ -12,9 +12,9 @@ export function MenuRoute(p) {
12
12
  return (_jsx(Route, { nest: true, path: p.path, children: p.children }));
13
13
  }
14
14
  /**
15
- * a helper function to create a <wouter.Route> with a path.
15
+ * a helper function to create a <Wouter.Route> with a path.
16
16
  */
17
- export const Route = wouter.Route;
17
+ export const Route = Wouter.Route;
18
18
  export function isMenuRoute(r) {
19
19
  return "path" in r.props && "label" in r.props && "icon" in r.props;
20
20
  }
@@ -1,11 +1,11 @@
1
- import { Component } from "preact";
1
+ import { Component } from "react";
2
2
  export type SpinnerProps = {
3
3
  padding?: number;
4
4
  };
5
5
  export declare class Spinner extends Component<{
6
6
  manner?: "flat" | "plain";
7
7
  } & SpinnerProps> {
8
- static flat: (p: SpinnerProps) => import("preact").JSX.Element;
9
- static plain: (p: SpinnerProps) => import("preact").JSX.Element;
10
- render(): import("preact").JSX.Element;
8
+ static flat: (p: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
9
+ static plain: (p: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
10
+ render(): import("react/jsx-runtime").JSX.Element;
11
11
  }
@@ -1,7 +1,5 @@
1
- import { jsx as _jsx } from "preact/jsx-runtime";
2
- import { useComputed, useSignal } from "@preact/signals";
3
- import { Component } from "preact";
4
- import { useEffect } from "preact/hooks";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Component, useEffect, useMemo, useState } from "react";
5
3
  import { useThemeConfig } from "../theme/theme_context";
6
4
  function _toPath(c, yFac, yOffset = 0, clamp = [0, 1], xFac = 1) {
7
5
  return c
@@ -14,36 +12,38 @@ function _toPath(c, yFac, yOffset = 0, clamp = [0, 1], xFac = 1) {
14
12
  }
15
13
  export class Spinner extends Component {
16
14
  render() {
17
- var _a, _b;
18
- const tConfig = useThemeConfig();
19
- const flat = ((_a = this.props.manner) !== null && _a !== void 0 ? _a : "flat") === "flat";
20
- const xSig = useSignal(0);
21
- useEffect(() => {
22
- if (tConfig.reducedMotion)
23
- return;
24
- const interval = setInterval(() => {
25
- xSig.value = (xSig.value + 2) % 100;
26
- }, 16);
27
- return () => clearInterval(interval);
28
- });
29
- const path = useComputed(() => {
30
- const x = xSig.value;
31
- const path = [];
32
- for (let i = 0; i <= 1; i += 0.01) {
33
- const pos = (i * 1 + x * 0.01) * Math.PI * 2; // angle = 0 -> 2π
34
- const y = Math.sin(pos);
35
- path.push([i, y]);
36
- }
37
- return path;
38
- });
39
- return (_jsx("div", { class: `${flat ? "accent flat" : "plain"}`, style: {
40
- padding: `${(_b = this.props.padding) !== null && _b !== void 0 ? _b : 1}rem`,
41
- }, children: _jsx("svg", { style: "width: 40px; height: 40px", viewBox: `-10 -10 120 120`, children: [
42
- _toPath(path.value, 13, 20, [0.4, 0.8], 1),
43
- _toPath(path.value, 10, 50),
44
- _toPath(path.value, 11, 80, [0.2, 0.6], 1),
45
- ].map((p) => (_jsx("path", { d: p, fill: "none", stroke: "currentcolor", "stroke-width": "10", "stroke-linecap": "round" }))) }) }));
15
+ return _jsx(_Spinner, Object.assign({ manner: this.props.manner }, this.props));
46
16
  }
47
17
  }
48
18
  Spinner.flat = (p) => new Spinner(Object.assign({ manner: "flat" }, p)).render();
49
19
  Spinner.plain = (p) => new Spinner(Object.assign({ manner: "plain" }, p)).render();
20
+ function _Spinner(p) {
21
+ var _a, _b;
22
+ const tConfig = useThemeConfig();
23
+ const flat = ((_a = p.manner) !== null && _a !== void 0 ? _a : "flat") === "flat";
24
+ const [x, setX] = useState(0);
25
+ useEffect(() => {
26
+ if (tConfig.reducedMotion)
27
+ return () => { };
28
+ const interval = setInterval(() => {
29
+ setX((prev) => (prev + 2) % 100);
30
+ }, 16);
31
+ return () => clearInterval(interval);
32
+ });
33
+ const path = useMemo(() => {
34
+ const path = [];
35
+ for (let i = 0; i <= 1; i += 0.01) {
36
+ const pos = (i * 1 + x * 0.01) * Math.PI * 2; // angle = 0 -> 2π
37
+ const y = Math.sin(pos);
38
+ path.push([i, y]);
39
+ }
40
+ return path;
41
+ }, [x]);
42
+ return (_jsx("div", { className: `${flat ? "accent flat" : "plain"}`, style: {
43
+ padding: `${(_b = p.padding) !== null && _b !== void 0 ? _b : 1}rem`,
44
+ }, children: _jsx("svg", { style: { width: "40px", height: "40px" }, viewBox: `-10 -10 120 120`, children: [
45
+ _toPath(path, 13, 20, [0.4, 0.8], 1),
46
+ _toPath(path, 10, 50),
47
+ _toPath(path, 11, 80, [0.2, 0.6], 1),
48
+ ].map((p, i) => (_jsx("path", { d: p, fill: "none", stroke: "currentcolor", strokeWidth: "10", strokeLinecap: "round" }, i))) }) }));
49
+ }
@@ -1,4 +1,4 @@
1
- import React from "preact/compat";
1
+ import React from "react";
2
2
  import type { ElbeTypeVariants } from "../theme/type_theme";
3
3
  import type { ElbeChildren } from "../util/types";
4
4
  import { type ElbeProps } from "./base/box";
@@ -16,18 +16,18 @@ export type TextProps = {
16
16
  export declare class Text extends React.Component<TextProps & {
17
17
  variant?: ElbeTypeVariants;
18
18
  }> {
19
- static h1: (p: TextProps) => React.JSX.Element;
20
- static h2: (p: TextProps) => React.JSX.Element;
21
- static h3: (p: TextProps) => React.JSX.Element;
22
- static h4: (p: TextProps) => React.JSX.Element;
23
- static h5: (p: TextProps) => React.JSX.Element;
24
- static h6: (p: TextProps) => React.JSX.Element;
25
- static s: (p: TextProps) => React.JSX.Element;
26
- static m: (p: TextProps) => React.JSX.Element;
27
- static l: (p: TextProps) => React.JSX.Element;
28
- static code: (p: TextProps) => React.JSX.Element;
29
- constructor({ variant, ...props }: TextProps & {
30
- variant?: ElbeTypeVariants;
31
- });
32
- render(): React.JSX.Element;
19
+ static h1: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
20
+ static h2: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
21
+ static h3: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
22
+ static h4: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
23
+ static h5: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
24
+ static h6: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
25
+ static s: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
26
+ static m: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
27
+ static l: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
28
+ static code: (p: TextProps) => import("react/jsx-runtime").JSX.Element;
29
+ static defaultProps: {
30
+ variant: string;
31
+ };
32
+ render(): import("react/jsx-runtime").JSX.Element;
33
33
  }
@@ -9,14 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
13
- import React from "preact/compat";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React from "react";
14
14
  import { applyProps } from "./base/box";
15
15
  export class Text extends React.Component {
16
- constructor(_a) {
17
- var { variant = "body-m" } = _a, props = __rest(_a, ["variant"]);
18
- super(Object.assign(Object.assign({}, props), { variant }));
19
- }
20
16
  render() {
21
17
  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
18
  return (_jsxs("span", Object.assign({}, applyProps("text", elbe, [
@@ -46,3 +42,7 @@ Text.s = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-s" }));
46
42
  Text.m = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-m" }));
47
43
  Text.l = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-l" }));
48
44
  Text.code = (p) => _jsx(Text, Object.assign({}, p, { variant: "code" }));
45
+ // replace the constructor with defaultProps so React receives the same props object
46
+ Text.defaultProps = {
47
+ variant: "body-m",
48
+ };
@@ -47,7 +47,6 @@ export class RGBAColor {
47
47
  if (!hex)
48
48
  return new RGBAColor(0, 0, 0, 0);
49
49
  const c = hex.replace("#", "").padEnd(6, "0").padEnd(8, "f").toLowerCase();
50
- console.log(c);
51
50
  return new RGBAColor(parseInt(c.substring(0, 2), 16), parseInt(c.substring(2, 4), 16), parseInt(c.substring(4, 6), 16), parseInt(c.substring(6, 8), 16) / 255);
52
51
  }
53
52
  desaturated(f = 1) {
@@ -28,4 +28,4 @@ export declare function ElbeTheme(p: {
28
28
  theme: ElbeThemeData;
29
29
  } | {
30
30
  seed?: ElbeThemeSeed;
31
- })): import("preact").JSX.Element;
31
+ })): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
- import { useEffect } from "preact/hooks";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
3
  import "../../elbe.css";
4
4
  import { ToDo } from "../components/dev/todo";
5
5
  import { ColorTheme } from "./colors";
@@ -31,7 +31,7 @@ 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", { class: `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 }) })] }));
34
+ return (_jsxs("div", { 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
35
  }
36
36
  function _addTooltip() {
37
37
  return useEffect(() => {
@@ -11,8 +11,8 @@ export declare function makeThemeConfig(p: Partial<ElbeThemeConfig>): {
11
11
  reducedMotion: boolean;
12
12
  scale: number;
13
13
  };
14
- export declare const ThemeConfigContext: import("preact").Context<ElbeThemeConfig>;
14
+ export declare const ThemeConfigContext: import("react").Context<ElbeThemeConfig>;
15
15
  export declare function _configCss(t: ElbeThemeData, c: ElbeThemeConfig): string;
16
- export declare const ThemeContext: import("preact").Context<ElbeThemeData>;
16
+ export declare const ThemeContext: import("react").Context<ElbeThemeData>;
17
17
  export declare function useThemeConfig(): ElbeThemeConfig;
18
18
  export declare function useTheme(): ElbeThemeData;
@@ -1,5 +1,4 @@
1
- import { createContext } from "preact";
2
- import { useContext } from "preact/hooks";
1
+ import { createContext, useContext } from "react";
3
2
  import { ElbeThemeData } from "./theme";
4
3
  export function makeThemeConfig(p) {
5
4
  var _a, _b, _c, _d;
@@ -1,6 +1,5 @@
1
- import React from "preact/compat";
2
1
  type _ToolbarState = "toolbar" | "overflow" | null;
3
- export declare const ToolbarContext: React.Context<_ToolbarState>;
2
+ export declare const ToolbarContext: import("react").Context<_ToolbarState>;
4
3
  export declare function useToolbar(): {
5
4
  isInToolbar: boolean;
6
5
  isInOverflow: boolean;
@@ -1,5 +1,5 @@
1
- import React, { useContext } from "preact/compat";
2
- export const ToolbarContext = React.createContext(null);
1
+ import { createContext, useContext } from "react";
2
+ export const ToolbarContext = createContext(null);
3
3
  export function useToolbar() {
4
4
  const ctx = useContext(ToolbarContext);
5
5
  return {
@@ -1 +1 @@
1
- export declare function _ElbeErr(msg: string): import("preact").JSX.Element;
1
+ export declare function _ElbeErr(msg: string): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Icons } from "../..";
3
3
  export function _ElbeErr(msg) {
4
- return (_jsxs("div", { class: "row text-s gap-half", style: "background: #ee0044; color: white; border-radius: 4px; text-align: left; padding: .5rem", children: [_jsx(Icons.CircleX, {}), _jsxs("div", { class: "column gap-none cross-stretch", children: [_jsx("b", { class: "text-s", children: "elbe error" }), _jsx("span", { style: "margin-top: -.125rem", children: msg })] })] }));
4
+ return (_jsxs("div", { className: "row text-s gap-half", style: {
5
+ background: "#ee0044",
6
+ color: "white",
7
+ borderRadius: "4px",
8
+ textAlign: "left",
9
+ padding: ".5rem",
10
+ }, children: [_jsx(Icons.CircleX, {}), _jsxs("div", { className: "column gap-none cross-stretch", children: [_jsx("b", { className: "text-s", children: "elbe error" }), _jsx("span", { style: { marginTop: "-.125rem" }, children: msg })] })] }));
5
11
  }
@@ -24,7 +24,7 @@ export interface _L10nState<T extends _L10nData> extends _L10nSelection {
24
24
  setEasyLang: (easyLang: boolean) => void;
25
25
  inline: (value: Maybe<L10nInlinePlain | string>) => string;
26
26
  }
27
- export declare const _L10nContext: import("preact").Context<_L10nState<any> | null>;
27
+ export declare const _L10nContext: import("react").Context<_L10nState<any> | null>;
28
28
  export declare function _maybeL10n<T extends _L10nData>(): _L10nState<T> | null;
29
29
  export declare function _useL10n<T extends _L10nData>(): _L10nState<T>;
30
30
  export {};
@@ -1,4 +1,4 @@
1
- import { createContext, useContext } from "preact/compat";
1
+ import { createContext, useContext } from "react";
2
2
  export function _bestMatch(selection, locales) {
3
3
  if (locales.length === 0)
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import React from "preact/compat";
1
+ import React from "react";
2
2
  import { ElbeChildren } from "../types";
3
3
  import { _L10nData, _L10nState, _LocaleID, _LocaleIDEasy } from "./_l10n_util";
4
4
  export type L10nInlinePlain = {
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx } from "preact/jsx-runtime";
2
- import { useEffect, useState } from "preact/hooks";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
3
  import { _bestMatch, _L10nContext, _useL10n, } from "./_l10n_util";
4
4
  /**
5
5
  * L10nBase is a function that creates a localization context provider and a hook to use the localization context.
@@ -1,9 +1,10 @@
1
+ import { ReactNode } from "react";
1
2
  export type int = number;
2
3
  export type float = number;
3
4
  /** a unix epoch timestamp in milliseconds */
4
5
  export type UnixMS = int;
5
- export type ElbeChild = React.ReactNode;
6
- export type ElbeChildren = ElbeChild[] | ElbeChild;
6
+ export type ElbeChild = ReactNode;
7
+ export type ElbeChildren = ReactNode;
7
8
  export type s = string;
8
9
  export type n = number;
9
10
  export type b = boolean;
@@ -1,10 +1,9 @@
1
- import { useEffect, useState } from "preact/compat";
1
+ import { useEffect, useState } from "react";
2
2
  import { showToast } from "../..";
3
3
  export function clamp(value, min, max) {
4
4
  return Math.min(Math.max(value, min), max);
5
5
  }
6
6
  export function classString(classes) {
7
- console.log(classes);
8
7
  return classes.filter((c) => c).join(" ");
9
8
  }
10
9
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "0.4.26",
3
+ "version": "1.0.2",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -10,7 +10,8 @@
10
10
  "keywords": [
11
11
  "ui",
12
12
  "ui-framework",
13
- "flutter"
13
+ "flutter",
14
+ "react"
14
15
  ],
15
16
  "files": [
16
17
  "dist"
@@ -21,24 +22,21 @@
21
22
  "build:ts": "tsc",
22
23
  "build:dts": "tsc --declaration",
23
24
  "build:css": "sass -q style/elbe.scss dist/elbe.css",
24
- "build": "rm -rf ./dist && bun run build:ts && bun run build:dts && bun run build:css && (cd example && npm run prep)",
25
+ "build": "rm -rf ./dist && bun run build:ts && bun run build:dts && bun run build:css ",
25
26
  "dev": "bun run build && (cd example && bun run dev)",
26
27
  "pub": "bun run build && npm publish"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@types/bun": "latest",
30
- "sass": "^1.80.6"
31
+ "sass": "^1.93.2"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "typescript": "^5.5.4"
34
35
  },
35
36
  "dependencies": {
36
- "@preact/preset-vite": "^2.9.1",
37
- "@preact/signals": "^1.3.0",
38
37
  "colors-convert": "^1.4.1",
39
38
  "lucide-react": "^0.438.0",
40
- "preact": "^10.24.2",
41
- "vite": "^5.4.10",
39
+ "react": "^19.2.0",
42
40
  "wouter": "^3.7.1"
43
41
  }
44
42
  }