elbe-ui 1.0.8 → 2.0.0

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 (141) hide show
  1. package/dist/elbe.css +150 -562
  2. package/dist/elbe.css.map +1 -1
  3. package/dist/index.d.ts +188 -46
  4. package/dist/index.js +8 -6
  5. package/dist/ui/app/app.d.ts +12 -0
  6. package/dist/ui/{components/layout/app_base.js → app/app.js} +24 -31
  7. package/dist/ui/app/app_ctxt.d.ts +35 -0
  8. package/dist/ui/app/app_ctxt.js +10 -0
  9. package/dist/ui/components/badge.d.ts +3 -3
  10. package/dist/ui/components/badge.js +16 -5
  11. package/dist/ui/components/banner.d.ts +3 -3
  12. package/dist/ui/components/banner.js +1 -1
  13. package/dist/ui/components/base/box.d.ts +82 -35
  14. package/dist/ui/components/base/box.js +56 -8
  15. package/dist/ui/components/base/card.d.ts +11 -12
  16. package/dist/ui/components/base/card.js +36 -19
  17. package/dist/ui/components/base/padded.d.ts +2 -4
  18. package/dist/ui/components/base/state_builder.d.ts +9 -0
  19. package/dist/ui/components/base/state_builder.js +33 -0
  20. package/dist/ui/components/button/button.d.ts +8 -6
  21. package/dist/ui/components/button/button.js +27 -16
  22. package/dist/ui/components/button/choose_button.d.ts +5 -3
  23. package/dist/ui/components/button/choose_button.js +9 -6
  24. package/dist/ui/components/button/icon_button.d.ts +6 -5
  25. package/dist/ui/components/button/icon_button.js +33 -23
  26. package/dist/ui/components/button/toggle_button.d.ts +5 -5
  27. package/dist/ui/components/button/toggle_button.js +13 -7
  28. package/dist/ui/components/dialog/dialog.d.ts +13 -0
  29. package/dist/ui/components/dialog/dialog.js +69 -0
  30. package/dist/ui/components/dialog/dialog_ctx.d.ts +34 -0
  31. package/dist/ui/components/dialog/dialog_ctx.js +44 -0
  32. package/dist/ui/components/dialog/dialogs/_alert.d.ts +7 -0
  33. package/dist/ui/components/dialog/dialogs/_alert.js +9 -0
  34. package/dist/ui/components/dialog/dialogs/_confirm.d.ts +9 -0
  35. package/dist/ui/components/dialog/dialogs/_confirm.js +21 -0
  36. package/dist/ui/components/error_view.js +3 -3
  37. package/dist/ui/components/footer.js +7 -7
  38. package/dist/ui/components/input/_labeled_input.d.ts +21 -0
  39. package/dist/ui/components/input/_labeled_input.js +21 -0
  40. package/dist/ui/components/input/checkbox.d.ts +4 -2
  41. package/dist/ui/components/input/checkbox.js +16 -8
  42. package/dist/ui/components/input/range.d.ts +5 -3
  43. package/dist/ui/components/input/range.js +20 -13
  44. package/dist/ui/components/input/select.d.ts +4 -3
  45. package/dist/ui/components/input/select.js +13 -40
  46. package/dist/ui/components/input/switch.d.ts +4 -2
  47. package/dist/ui/components/input/switch.js +30 -40
  48. package/dist/ui/components/input/text/input_field.d.ts +14 -19
  49. package/dist/ui/components/input/text/input_field.js +63 -61
  50. package/dist/ui/components/input/text/single_line.d.ts +11 -9
  51. package/dist/ui/components/input/text/single_line.js +15 -21
  52. package/dist/ui/components/layout/flex.d.ts +7 -3
  53. package/dist/ui/components/layout/flex.js +15 -12
  54. package/dist/ui/components/layout/header.d.ts +2 -2
  55. package/dist/ui/components/layout/header.js +25 -18
  56. package/dist/ui/components/layout/menu.js +74 -49
  57. package/dist/ui/components/layout/scroll.d.ts +1 -0
  58. package/dist/ui/components/layout/scroll.js +3 -1
  59. package/dist/ui/components/layout/toolbar.js +9 -6
  60. package/dist/ui/components/link.d.ts +4 -2
  61. package/dist/ui/components/link.js +24 -11
  62. package/dist/ui/components/progress_bar.d.ts +2 -2
  63. package/dist/ui/components/progress_bar.js +12 -9
  64. package/dist/ui/components/spinner.d.ts +2 -7
  65. package/dist/ui/components/spinner.js +15 -16
  66. package/dist/ui/components/text.d.ts +5 -6
  67. package/dist/ui/components/text.js +34 -21
  68. package/dist/ui/components/tooltip.d.ts +5 -0
  69. package/dist/ui/components/tooltip.js +48 -0
  70. package/dist/ui/theme/subthemes/_theme_geometry.d.ts +9 -0
  71. package/dist/ui/theme/subthemes/_theme_geometry.js +22 -0
  72. package/dist/ui/theme/subthemes/_theme_menu.d.ts +9 -0
  73. package/dist/ui/theme/subthemes/_theme_menu.js +12 -0
  74. package/dist/ui/theme/subthemes/_theme_motion.d.ts +9 -0
  75. package/dist/ui/theme/subthemes/_theme_motion.js +13 -0
  76. package/dist/ui/theme/subthemes/_theme_toast.d.ts +8 -0
  77. package/dist/ui/theme/subthemes/_theme_toast.js +11 -0
  78. package/dist/ui/theme/subthemes/_theme_type.d.ts +49 -0
  79. package/dist/ui/theme/subthemes/_theme_type.js +73 -0
  80. package/dist/ui/theme/subthemes/color/_seed.d.ts +2 -0
  81. package/dist/ui/theme/subthemes/color/_seed.js +105 -0
  82. package/dist/ui/theme/subthemes/color/_theme_color.d.ts +865 -0
  83. package/dist/ui/theme/subthemes/color/_theme_color.js +83 -0
  84. package/dist/ui/theme/subthemes/color/colors/_color_contrast.d.ts +284 -0
  85. package/dist/ui/theme/subthemes/color/colors/_color_contrast.js +17 -0
  86. package/dist/ui/theme/subthemes/color/colors/_color_kind.d.ts +242 -0
  87. package/dist/ui/theme/subthemes/color/colors/_color_kind.js +45 -0
  88. package/dist/ui/theme/subthemes/color/colors/_color_layer.d.ts +226 -0
  89. package/dist/ui/theme/subthemes/color/colors/_color_layer.js +95 -0
  90. package/dist/ui/theme/subthemes/color/colors/_color_manner.d.ts +280 -0
  91. package/dist/ui/theme/subthemes/color/colors/_color_manner.js +17 -0
  92. package/dist/ui/theme/subthemes/color/colors/_color_mode.d.ts +269 -0
  93. package/dist/ui/theme/subthemes/color/colors/_color_mode.js +16 -0
  94. package/dist/ui/theme/subthemes/color/colors/_color_rgba.d.ts +166 -0
  95. package/dist/ui/theme/subthemes/color/colors/_color_rgba.js +86 -0
  96. package/dist/ui/theme/subthemes/color/colors/_color_scheme.d.ts +256 -0
  97. package/dist/ui/theme/subthemes/color/colors/_color_scheme.js +17 -0
  98. package/dist/ui/theme/subthemes/color/colors/_color_state.d.ts +252 -0
  99. package/dist/ui/theme/subthemes/color/colors/_color_state.js +49 -0
  100. package/dist/ui/theme/subthemes/color/colors/_colordef.d.ts +22 -0
  101. package/dist/ui/theme/subthemes/color/colors/_colordef.js +34 -0
  102. package/dist/ui/theme/subthemes/color/colors/colors.d.ts +511 -0
  103. package/dist/ui/theme/subthemes/color/colors/colors.js +24 -0
  104. package/dist/ui/theme/theme.d.ts +984 -30
  105. package/dist/ui/theme/theme.js +14 -82
  106. package/dist/ui/theme/theme_context.d.ts +15 -17
  107. package/dist/ui/theme/theme_context.js +79 -18
  108. package/dist/ui/util/_util.d.ts +1 -0
  109. package/dist/ui/util/_util.js +3 -0
  110. package/dist/ui/util/error_view.js +3 -3
  111. package/dist/ui/util/merge_deep.d.ts +1 -0
  112. package/dist/ui/util/merge_deep.js +18 -0
  113. package/dist/ui/util/root.d.ts +17 -0
  114. package/dist/ui/util/root.js +23 -0
  115. package/dist/ui/util/toast/_toast.d.ts +5 -0
  116. package/dist/ui/util/toast/_toast.js +7 -0
  117. package/dist/ui/util/toast/toast_ctx.d.ts +28 -0
  118. package/dist/ui/util/toast/toast_ctx.js +62 -0
  119. package/dist/ui/util/toast/toast_legacy.d.ts +5 -0
  120. package/dist/ui/util/{toast.js → toast/toast_legacy.js} +4 -4
  121. package/dist/ui/util/util.d.ts +8 -0
  122. package/dist/ui/util/util.js +54 -1
  123. package/package.json +10 -8
  124. package/dist/ui/components/dialog.d.ts +0 -10
  125. package/dist/ui/components/dialog.js +0 -35
  126. package/dist/ui/components/layout/app_base.d.ts +0 -15
  127. package/dist/ui/components/layout/ctx_app_base.d.ts +0 -19
  128. package/dist/ui/components/layout/ctx_app_base.js +0 -12
  129. package/dist/ui/theme/color_theme.d.ts +0 -2
  130. package/dist/ui/theme/color_theme.js +0 -92
  131. package/dist/ui/theme/colors.d.ts +0 -133
  132. package/dist/ui/theme/colors.js +0 -309
  133. package/dist/ui/theme/geometry_theme.d.ts +0 -16
  134. package/dist/ui/theme/geometry_theme.js +0 -28
  135. package/dist/ui/theme/seed.d.ts +0 -53
  136. package/dist/ui/theme/seed.js +0 -4
  137. package/dist/ui/theme/type_theme.d.ts +0 -38
  138. package/dist/ui/theme/type_theme.js +0 -73
  139. package/dist/ui/util/confirm_dialog.d.ts +0 -10
  140. package/dist/ui/util/confirm_dialog.js +0 -46
  141. package/dist/ui/util/toast.d.ts +0 -5
@@ -16,24 +16,27 @@ export function FlexSpace({}) {
16
16
  }
17
17
  export function Column(_a) {
18
18
  var { gap = 1, main = "start", cross = "stretch", children, noScrollbar = false, scroll = false } = _a, p = __rest(_a, ["gap", "main", "cross", "children", "noScrollbar", "scroll"]);
19
- return _Flex(false, { gap, main, cross, scroll, noScrollbar, children }, p, false);
19
+ return _FlexLayout(false, { gap, main, cross, scroll, noScrollbar, children }, p, false);
20
20
  }
21
21
  export function Row(_a) {
22
22
  var { gap = 1, main = "start", cross, wrap = false, children, noScrollbar = false, scroll = false } = _a, p = __rest(_a, ["gap", "main", "cross", "wrap", "children", "noScrollbar", "scroll"]);
23
- return _Flex(true, { gap, main, cross, scroll, noScrollbar, children }, p, wrap);
23
+ return _FlexLayout(true, { gap, main, cross, scroll, noScrollbar, children }, p, wrap);
24
24
  }
25
- function _Flex(row, p, elbe, wraps) {
26
- var _a;
27
- return (_jsx("div", Object.assign({}, applyProps("flex", elbe, [
28
- row ? "row" : "column",
29
- wraps && "wrap",
30
- p.noScrollbar && "no-scrollbar",
31
- ], {
25
+ export function FlexLayout(_a) {
26
+ var { gap = 1, main = "start", cross = "stretch", direction, children, noScrollbar = false, scroll = false, wrap = false } = _a, p = __rest(_a, ["gap", "main", "cross", "direction", "children", "noScrollbar", "scroll", "wrap"]);
27
+ return _FlexLayout(direction !== "column", { gap, main, cross, scroll, noScrollbar, children }, p, wrap);
28
+ }
29
+ function _FlexLayout(row, p, elbe, wraps) {
30
+ var _a, _b, _c;
31
+ return (_jsx("div", Object.assign({}, applyProps("flex", elbe, [p.noScrollbar && "elbe_no-scrollbar"], {
32
+ display: "flex",
33
+ flexDirection: row ? "row" : "column",
34
+ flexWrap: wraps ? "wrap" : "nowrap",
32
35
  justifyContent: p.main,
33
- alignItems: p.cross,
34
- gap: `${p.gap}rem`,
36
+ alignItems: (_a = p.cross) !== null && _a !== void 0 ? _a : (row ? "center" : "stretch"),
37
+ gap: `${(_b = p.gap) !== null && _b !== void 0 ? _b : 1}rem`,
35
38
  overflowX: !row ? undefined : p.scroll ? "auto" : undefined,
36
39
  overflowY: row ? undefined : p.scroll ? "auto" : undefined,
37
- flex: ((_a = p.flex) !== null && _a !== void 0 ? _a : p.scroll) ? 1 : undefined,
40
+ flex: ((_c = elbe.flex) !== null && _c !== void 0 ? _c : p.scroll) ? 1 : undefined,
38
41
  }), { children: p.children })));
39
42
  }
@@ -1,4 +1,4 @@
1
- import { ElbeChild, ElbeColorSchemes } from "../../..";
1
+ import { ColorSelection, ElbeChild } from "../../..";
2
2
  export type HeaderLogos = {
3
3
  logo?: string | ElbeChild;
4
4
  logoDark?: string | ElbeChild;
@@ -10,7 +10,7 @@ export type HeaderProps = HeaderLogos & {
10
10
  title: string | ElbeChild;
11
11
  centerTitle?: boolean;
12
12
  actions?: ElbeChild[];
13
- scheme?: ElbeColorSchemes;
13
+ scheme?: ColorSelection.Schemes;
14
14
  };
15
15
  export declare function Header(p: HeaderProps): import("react/jsx-runtime").JSX.Element;
16
16
  export declare function _Logo(p: {
@@ -1,17 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ChevronLeft, MenuIcon, XIcon } from "lucide-react";
3
3
  import { useMemo, useState } from "react";
4
- import { Card, IconButton, Text, useLayoutMode, useSiteScroll, useTheme, useThemeConfig, } from "../../..";
5
- import { maybeAppBase } from "./ctx_app_base";
4
+ import { Card, IconButton, Text, useLayoutMode, useSiteScroll, } from "../../..";
5
+ import { useApp } from "../../app/app_ctxt";
6
6
  import { _Toolbar } from "./toolbar";
7
7
  export function Header(p) {
8
- var _a, _b, _c, _d, _e, _f, _g, _h;
9
- const appBase = maybeAppBase();
8
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
9
+ const { _appThemeContext, appConfig, menu } = useApp();
10
+ const { theme, useWith } = _appThemeContext.useTheme();
10
11
  const layoutMode = useLayoutMode();
11
12
  const scroll = useSiteScroll();
12
- const tConfig = useThemeConfig();
13
- const theme = useTheme();
14
- return (_jsxs(Card, { padding: 0, scheme: (_a = p.scheme) !== null && _a !== void 0 ? _a : "primary", bordered: true, frosted: !tConfig.highVis, sharp: true, style: {
13
+ const secTheme = useWith((t) => ({
14
+ color: Object.assign(Object.assign({}, t.color), { selection: Object.assign(Object.assign({}, t.color.selection), { scheme: "secondary", manner: "plain" }) }),
15
+ }), [theme]);
16
+ return (_jsxs(Card, { padding: 0, scheme: (_a = p.scheme) !== null && _a !== void 0 ? _a : "primary", manner: "plain", frosted: !theme.color.isContrast,
17
+ //elevated={!!scroll}
18
+ bordered: true, sharp: true, style: {
15
19
  position: "sticky",
16
20
  top: 0,
17
21
  left: 0,
@@ -20,22 +24,25 @@ export function Header(p) {
20
24
  padding: ".5rem",
21
25
  display: "flex",
22
26
  alignItems: "center",
23
- borderTop: "none",
24
- borderLeft: "none",
25
- borderRight: "none",
26
- borderColor: tConfig.highVis || scroll ? undefined : "transparent",
27
+ borderTopStyle: "none",
28
+ borderLeftStyle: "none",
29
+ borderRightStyle: "none",
30
+ borderColor: theme.color.isContrast || scroll
31
+ ? theme.color.currentColor.border.withAlpha(0.25).asCss()
32
+ : "transparent",
33
+ borderWidth: theme.geometry.borderWidth + "rem",
27
34
  gap: "1rem",
28
35
  zIndex: 80,
29
36
  }, children: [p.leading && p.leading !== "back" && p.leading !== "close"
30
37
  ? p.leading
31
- : appBase &&
32
- !layoutMode.isWide && (_jsx(IconButton.plain, { ariaLabel: "open/close menu", onTap: () => appBase.setMenuOpen(!appBase.menuOpen), icon: MenuIcon })), p.leading === "back" && _jsx(BackButton, {}), p.leading === "close" && _jsx(BackButton, { close: true }), !layoutMode.isMobile && (_jsx(_Logo, { logo: (_b = p.logo) !== null && _b !== void 0 ? _b : appBase === null || appBase === void 0 ? void 0 : appBase.icons.logo, logoDark: (_c = p.logoDark) !== null && _c !== void 0 ? _c : appBase === null || appBase === void 0 ? void 0 : appBase.icons.logoDark, lMargin: 0.5 })), (!appBase || layoutMode.isWide) && (_jsx("div", { style: { margin: "-1rem", width: "1.5rem" } })), _jsx(_HeaderTitle, { title: p.title, center: (_d = p.centerTitle) !== null && _d !== void 0 ? _d : false }), _jsx(_Toolbar, { actions: [...((_e = p.actions) !== null && _e !== void 0 ? _e : []), ...((_f = appBase === null || appBase === void 0 ? void 0 : appBase.globalActions) !== null && _f !== void 0 ? _f : [])] }), layoutMode.isWide && (_jsx(_Logo, { logo: (_g = p.endLogo) !== null && _g !== void 0 ? _g : appBase === null || appBase === void 0 ? void 0 : appBase.icons.endLogo, logoDark: (_h = p.endLogoDark) !== null && _h !== void 0 ? _h : appBase === null || appBase === void 0 ? void 0 : appBase.icons.endLogoDark, rMargin: 0.5 }))] }));
38
+ : !layoutMode.isWide && (_jsx(IconButton.plain, { ariaLabel: "open/close menu", onTap: () => menu.setOpen(!menu.isOpen), icon: MenuIcon })), p.leading === "back" && _jsx(BackButton, {}), p.leading === "close" && _jsx(BackButton, { close: true }), !layoutMode.isMobile && (_jsx(_Logo, { logo: (_b = p.logo) !== null && _b !== void 0 ? _b : (_c = appConfig === null || appConfig === void 0 ? void 0 : appConfig.icons) === null || _c === void 0 ? void 0 : _c.logo, logoDark: (_d = p.logoDark) !== null && _d !== void 0 ? _d : (_e = appConfig === null || appConfig === void 0 ? void 0 : appConfig.icons) === null || _e === void 0 ? void 0 : _e.logoDark, lMargin: 0.5 })), (!appConfig || layoutMode.isWide) && (_jsx("div", { style: { margin: "-1rem", width: "1.5rem" } })), _jsx(_HeaderTitle, { title: p.title, center: (_f = p.centerTitle) !== null && _f !== void 0 ? _f : false }), _jsx(_Toolbar, { actions: [...((_g = p.actions) !== null && _g !== void 0 ? _g : []), ...((_h = appConfig === null || appConfig === void 0 ? void 0 : appConfig.globalActions) !== null && _h !== void 0 ? _h : [])] }), layoutMode.isWide && (_jsx(_Logo, { logo: (_j = p.endLogo) !== null && _j !== void 0 ? _j : (_k = appConfig === null || appConfig === void 0 ? void 0 : appConfig.icons) === null || _k === void 0 ? void 0 : _k.endLogo, logoDark: (_l = p.endLogoDark) !== null && _l !== void 0 ? _l : (_m = appConfig === null || appConfig === void 0 ? void 0 : appConfig.icons) === null || _m === void 0 ? void 0 : _m.endLogoDark, rMargin: 0.5 }))] }));
33
39
  }
34
40
  export function _Logo(p) {
35
41
  var _a, _b;
36
- const tConfig = useThemeConfig();
42
+ const { _appThemeContext } = useApp();
43
+ const { theme } = _appThemeContext.useTheme();
37
44
  const [logo, setLogo] = useState(p.logo);
38
- useMemo(() => { var _a; return setLogo(tConfig.dark ? (_a = p.logoDark) !== null && _a !== void 0 ? _a : p.logo : p.logo); }, [tConfig]);
45
+ useMemo(() => { var _a; return setLogo(theme.color.isDark ? (_a = p.logoDark) !== null && _a !== void 0 ? _a : p.logo : p.logo); }, [theme]);
39
46
  return !logo ? null : (_jsx("div", { style: {
40
47
  flex: p.flex ? 1 : undefined,
41
48
  display: "flex",
@@ -49,9 +56,9 @@ export function _Logo(p) {
49
56
  }
50
57
  export function BackButton(p) {
51
58
  var _a, _b;
52
- const appBase = maybeAppBase();
53
- const hidden = ((_b = (_a = appBase === null || appBase === void 0 ? void 0 : appBase.router.history) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) < 2;
54
- return hidden ? null : (_jsx(IconButton.plain, { ariaLabel: p.close ? "close" : "go back", onTap: () => appBase === null || appBase === void 0 ? void 0 : appBase.router.goBack(), icon: p.close ? XIcon : ChevronLeft }, "hello-back"));
59
+ const { router } = useApp();
60
+ const hidden = ((_b = (_a = router.history) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) < 2;
61
+ return hidden ? null : (_jsx(IconButton.plain, { ariaLabel: p.close ? "close" : "go back", onTap: () => router.goBack(), icon: p.close ? XIcon : ChevronLeft }, "hello-back"));
55
62
  }
56
63
  export function _HeaderTitle(p) {
57
64
  const layoutMode = useLayoutMode();
@@ -1,62 +1,87 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MenuIcon } from "lucide-react";
3
- import { _Logo, useLayoutMode, useTheme, useThemeConfig, } from "../../..";
4
- import { Card, elevatedShadow } from "../base/card";
3
+ import { useMemo } from "react";
4
+ import { _Logo, elevatedBackdropStyle, useLayoutMode, } from "../../..";
5
+ import { useApp } from "../../app/app_ctxt";
6
+ import { Card } from "../base/card";
5
7
  import { Button } from "../button/button";
6
- import { useAppBase } from "./ctx_app_base";
7
8
  import { Column } from "./flex";
8
9
  export function Menu(p) {
10
+ const { _appThemeContext, menu } = useApp();
11
+ const { theme } = _appThemeContext.useTheme();
9
12
  const layoutMode = useLayoutMode();
10
- const appBase = useAppBase();
11
- const tConfig = useThemeConfig();
12
- const theme = useTheme();
13
- const topBot = { top: [], bottom: [] };
14
- for (let i of p.items) {
15
- if (i.bottom)
16
- topBot.bottom.push(i);
17
- else
18
- topBot.top.push(i);
19
- }
20
- const wideOrOpen = () => appBase.menuOpen || layoutMode.isWide;
21
- const menuWidth = () => appBase.menuOpen
13
+ const isWideOrOpen = useMemo(() => {
14
+ return (menu === null || menu === void 0 ? void 0 : menu.isOpen) || layoutMode.isWide;
15
+ }, [menu === null || menu === void 0 ? void 0 : menu.isOpen, layoutMode.isWide]);
16
+ const menuWidth = useMemo(() => (menu === null || menu === void 0 ? void 0 : menu.isOpen)
22
17
  ? layoutMode.isMobile
23
- ? "100vw"
24
- : `${17 + theme.geometry.borderWidth}rem`
18
+ ? "100%"
19
+ : `17rem`
25
20
  : layoutMode.isWide
26
- ? `${4 + theme.geometry.borderWidth}rem`
27
- : "0";
21
+ ? `${3 + theme.geometry.borderWidth * 2}rem`
22
+ : "0", [menu === null || menu === void 0 ? void 0 : menu.isOpen, layoutMode.mode, theme.geometry.borderWidth]);
23
+ const topBot = useMemo(() => {
24
+ let topBot = { top: [], bottom: [] };
25
+ for (let i of p.items) {
26
+ if (i.bottom)
27
+ topBot.bottom.push(i);
28
+ else
29
+ topBot.top.push(i);
30
+ }
31
+ return topBot;
32
+ }, [p.items]);
28
33
  return (_jsxs(_Fragment, { children: [layoutMode.isWide && (_jsx("div", { style: {
29
- width: menuWidth(),
30
- minWidth: menuWidth(),
31
- } })), _jsx("div", { onClick: () => appBase.setMenuOpen(false), style: Object.assign({ zIndex: 100, position: "fixed", left: 0, top: 0, width: 0, height: 0, backgroundColor: "rgba(0,0,0,0)", transition: "background-color 200ms ease-in-out" }, (layoutMode.isNarrow && appBase.menuOpen
32
- ? {
33
- backdropFilter: "blur(5px)",
34
- backgroundColor: "rgba(0,0,0,.2)",
35
- width: "100vw",
36
- height: "100vh",
37
- }
38
- : {})) }), _jsx(Card, { onTap: () => {
39
- if (layoutMode.isWide)
40
- return;
41
- appBase.setMenuOpen(false);
42
- }, sharp: layoutMode.isMobile, bordered: true, scheme: "primary", padding: wideOrOpen() ? 0.5 : 0, style: Object.assign({ zIndex: 101, position: "fixed", left: 0, top: 0, height: "100vh", overflow: "hidden", width: menuWidth(), display: "flex",
43
- //display: appBase.menuOpen || layoutMode == "wide" ? "flex" : "none",
44
- flexDirection: "column", justifyContent: "start", alignItems: "stretch", borderTopLeftRadius: 0, borderBottomLeftRadius: 0, borderLeft: "none", borderTop: "none", borderBottom: "none", borderColor: tConfig.highVis ? undefined : "transparent", gap: "1rem", transition: tConfig.reducedMotion
45
- ? "none"
46
- : "width 200ms ease-in-out" }, (layoutMode.isNarrow && appBase.menuOpen
47
- ? {
48
- boxShadow: elevatedShadow,
49
- }
50
- : {})), children: wideOrOpen() && (_jsxs(_Fragment, { children: [_jsx(Button.plain, { contentAlign: "start", ariaLabel: "open/close menu", onTap: () => appBase.setMenuOpen(!appBase.menuOpen), icon: MenuIcon, style: {
51
- marginBottom: ".5rem",
52
- borderRadius: "3rem",
53
- }, children: !layoutMode.isWide && (_jsx(_Logo, { logo: appBase === null || appBase === void 0 ? void 0 : appBase.icons.logo, logoDark: appBase === null || appBase === void 0 ? void 0 : appBase.icons.logoDark, lMargin: 0.5 })) }), _jsx(Column, { flex: 1, scroll: true, noScrollbar: true, children: topBot.top.map((i, index) => (_jsx(_MenuItemView, { item: i }, index))) }), topBot.bottom.map((i, index) => (_jsx(_MenuItemView, { item: i }, index)))] })) })] }));
34
+ width: menuWidth,
35
+ minWidth: menuWidth,
36
+ marginRight: ".5rem",
37
+ } }, "menu_wide_spaceholder")), _jsx("div", { onClick: () => menu.setOpen(false), style: Object.assign({ zIndex: 100, position: "fixed", left: 0, top: 0, width: 0, height: 0 }, elevatedBackdropStyle(layoutMode.isNarrow && (menu === null || menu === void 0 ? void 0 : menu.isOpen), theme, {
38
+ width: "100%",
39
+ height: "100%",
40
+ })) }), _jsx(_Menu, { topBot: topBot, wideOrOpen: isWideOrOpen, menuWidth: menuWidth })] }));
41
+ }
42
+ function _Menu(p) {
43
+ var _a, _b;
44
+ const { _appThemeContext, menu, appConfig } = useApp();
45
+ const { theme } = _appThemeContext.useTheme();
46
+ const layoutMode = useLayoutMode();
47
+ return (_jsx(Card, { onTap: () => {
48
+ if (layoutMode.isWide)
49
+ return;
50
+ menu.setOpen(false);
51
+ }, sharp: theme.menu.sharp || !layoutMode.isWide, bordered: true, scheme: theme.menu.scheme, padding: 0, elevated: theme.menu.elevated || (layoutMode.isNarrow && (menu === null || menu === void 0 ? void 0 : menu.isOpen)), overflow: "hidden", style: {
52
+ zIndex: 101,
53
+ position: "fixed",
54
+ left: 0,
55
+ top: 0,
56
+ height: layoutMode.isWide ? "calc(100vh - 1rem)" : "100vh",
57
+ margin: layoutMode.isWide ? ".5rem" : 0,
58
+ padding: layoutMode.isWide || !menu.isOpen ? 0 : ".5rem",
59
+ borderWidth: !layoutMode.isWide && !menu.isOpen
60
+ ? 0
61
+ : theme.geometry.borderWidth + "rem",
62
+ borderColor: theme.color.isContrast ? undefined : "transparent",
63
+ width: p.menuWidth,
64
+ display: "flex",
65
+ flexDirection: "column",
66
+ justifyContent: "start",
67
+ alignItems: "stretch",
68
+ gap: "1rem",
69
+ transition: theme.motion.reduced ? "none" : "width 200ms ease-in-out",
70
+ }, children: p.wideOrOpen && (_jsxs(_Fragment, { children: [_jsx(Button.plain, { sharp: layoutMode.isWide, contentAlign: "start", ariaLabel: "open/close menu", onTap: () => menu.setOpen(!menu.isOpen), icon: MenuIcon, style: {
71
+ marginBottom: ".5rem",
72
+ }, children: !layoutMode.isWide && (_jsx(_Logo, { logo: (_a = appConfig.icons) === null || _a === void 0 ? void 0 : _a.logo, logoDark: (_b = appConfig.icons) === null || _b === void 0 ? void 0 : _b.logoDark, lMargin: 0.5 })) }), _jsx(Column, { flex: 1, scroll: true, noScrollbar: true, children: p.topBot.top.map((i, index) => (_jsx(_MenuItemView, { item: i }, index))) }), p.topBot.bottom.map((i, index) => (_jsx(_MenuItemView, { item: i }, index)))] })) }));
54
73
  }
55
74
  function _MenuItemView({ item }) {
56
- const appBase = useAppBase();
57
- return (_jsx(Button, { ariaLabel: item.label, contentAlign: "start", manner: (item.path === "/"
58
- ? appBase.router.location === "/"
59
- : appBase.router.location.startsWith(item.path))
75
+ const { menu, router } = useApp();
76
+ return (_jsx(Button
77
+ //sharp
78
+ , {
79
+ //sharp
80
+ ariaLabel: item.label, contentAlign: "start", manner: (item.path === "/"
81
+ ? router.location === "/"
82
+ : router.location.startsWith(item.path))
60
83
  ? "major"
61
- : "plain", label: appBase.menuOpen ? item.label : undefined, icon: item.icon, onTap: item.disabled ? undefined : () => appBase.router.go(item.path, "all") }));
84
+ : "plain", style: {
85
+ transition: "background-color 200ms ease-in-out",
86
+ }, label: menu.isOpen ? item.label : undefined, icon: item.icon, onTap: item.disabled ? undefined : () => router.go(item.path, "all") }));
62
87
  }
@@ -5,6 +5,7 @@ export type ScrollProps = ElbeProps & {
5
5
  height?: number;
6
6
  width?: number;
7
7
  children?: any;
8
+ noScrollbars?: boolean;
8
9
  };
9
10
  type _ScrollProps = ScrollProps & {
10
11
  axis: "vertical" | "horizontal";
@@ -6,7 +6,9 @@ export class Scroll extends Component {
6
6
  super(props);
7
7
  }
8
8
  render() {
9
- return (_jsx("div", Object.assign({}, applyProps("scroll", this.props, null, {
9
+ return (_jsx("div", Object.assign({}, applyProps("scroll", this.props, [this.props.noScrollbars ? "elbe_scrollbars-hidden" : undefined], {
10
+ height: this.props.height ? this.props.height + "rem" : undefined,
11
+ width: this.props.width ? this.props.width + "rem" : undefined,
10
12
  overflowY: this.props.axis === "vertical" ? "scroll" : "hidden",
11
13
  overflowX: this.props.axis === "horizontal" ? "scroll" : "hidden",
12
14
  }), { children: _jsx("div", { className: this.props.innerClass, style: this.props.axis === "horizontal" ? { minWidth: "min-content" } : {}, children: this.props.children }) })));
@@ -1,7 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MoreVertical } from "lucide-react";
3
3
  import { useMemo, useState } from "react";
4
- import { Card, elevatedShadow, IconButton, ToolbarContext, useLayoutMode, useThemeConfig, } from "../../..";
4
+ import { Card, IconButton, ToolbarContext, useLayoutMode, } from "../../..";
5
+ import { useApp } from "../../app/app_ctxt";
6
+ import { elevatedShadow } from "../../util/_util";
5
7
  export function _Toolbar(p) {
6
8
  const [sections, setSections] = useState([
7
9
  [],
@@ -30,8 +32,9 @@ export function _Toolbar(p) {
30
32
  }
31
33
  export function OverflowMenu(p) {
32
34
  var _a;
35
+ const { _appThemeContext } = useApp();
36
+ const { theme } = _appThemeContext.useTheme();
33
37
  const [open, setOpen] = useState(false);
34
- const tConfig = useThemeConfig();
35
38
  return !((_a = p.items) === null || _a === void 0 ? void 0 : _a.length) ? null : (_jsxs("div", { style: {
36
39
  position: "relative",
37
40
  zIndex: 21,
@@ -39,10 +42,10 @@ export function OverflowMenu(p) {
39
42
  position: "fixed",
40
43
  top: 0,
41
44
  right: 0,
42
- width: "100vw",
43
- height: "100vh",
45
+ width: "100%",
46
+ height: "100%",
44
47
  backgroundColor: "transparent",
45
- boxShadow: elevatedShadow,
48
+ boxShadow: elevatedShadow(theme.color.isDark),
46
49
  zIndex: 20,
47
50
  } })), _jsx(IconButton.plain, { ariaLabel: "open/close menu", icon: MoreVertical, onTap: () => setOpen(!open) }), _jsx("div", { style: {
48
51
  zIndex: 21,
@@ -51,7 +54,7 @@ export function OverflowMenu(p) {
51
54
  right: 0,
52
55
  transform: open ? "scale(1)" : "scale(.6)",
53
56
  opacity: open ? 1 : 0,
54
- transition: tConfig.reducedMotion
57
+ transition: theme.motion.reduced
55
58
  ? undefined
56
59
  : "transform 200ms ease-in-out, opacity 200ms ease-in-out",
57
60
  }, children: open && (_jsx(ToolbarContext.Provider, { value: "overflow", children: _jsx(Card, { onTap: () => setOpen(false), scheme: "primary", elevated: true, style: {
@@ -1,10 +1,12 @@
1
+ import { ColorSelection } from "../theme/subthemes/color/colors/colors";
1
2
  export declare function Link(p: {
2
3
  label: string;
3
- href: string;
4
+ href?: string;
4
5
  external?: boolean;
5
- plain?: boolean;
6
+ manner?: ColorSelection.Manners;
6
7
  bold?: boolean;
7
8
  noIcon?: boolean;
8
9
  underline?: boolean;
9
10
  color?: string;
11
+ tooltip?: string;
10
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ExternalLinkIcon } from "lucide-react";
3
+ import { useApp } from "../app/app_ctxt";
4
+ import { WithStateTheme } from "./base/state_builder";
5
+ import { WithTooltip } from "./tooltip";
3
6
  export function Link(p) {
4
- return (_jsxs("a", { className: p.plain ? "plain" : "accent action", href: p.href, target: p.external ? "_blank" : undefined, rel: p.external ? "noopener noreferrer" : undefined, style: {
5
- color: p.color,
6
- display: "inline-flex",
7
- textDecoration: p.underline ? "underline" : "none",
8
- alignItems: "center",
9
- fontWeight: p.bold ? "bold" : "normal",
10
- padding: ".125rem .3rem",
11
- borderRadius: ".5rem",
12
- margin: "-.125rem -.3rem",
13
- transition: "background .2s",
14
- }, children: [p.label, p.external && !p.noIcon && (_jsx(ExternalLinkIcon, { size: 15, style: { marginLeft: ".25rem", marginBottom: ".25rem" } }))] }));
7
+ var _a;
8
+ const { _appThemeContext } = useApp();
9
+ const baseTheme = _appThemeContext.useTheme().useWith(({ color }) => {
10
+ var _a;
11
+ return ({
12
+ color: Object.assign(Object.assign({}, color), { selection: Object.assign(Object.assign({}, color.selection), { manner: (_a = p.manner) !== null && _a !== void 0 ? _a : "flat" }) }),
13
+ });
14
+ }, [p.manner]);
15
+ return (_jsx(WithStateTheme, { theme: baseTheme, disabled: p.href === undefined, children: _jsx(WithTooltip, { tooltip: p.tooltip, children: _jsxs("a", { href: p.href, target: p.external ? "_blank" : undefined, rel: p.external ? "noopener noreferrer" : undefined, className: "elbe_colored", style: {
16
+ display: "inline-flex",
17
+ textDecoration: p.underline ? "underline" : "none",
18
+ alignItems: "center",
19
+ fontWeight: p.bold ? "bold" : "normal",
20
+ padding: ".125rem .3rem",
21
+ borderRadius: ".5rem",
22
+ cursor: "inherit",
23
+ margin: ["major", "minor"].includes((_a = p.manner) !== null && _a !== void 0 ? _a : "flat")
24
+ ? "-.125rem 0rem"
25
+ : "-.125rem -.3rem",
26
+ transition: "background .2s",
27
+ }, children: [p.label, p.external && !p.noIcon && (_jsx(ExternalLinkIcon, { size: 15, style: { marginLeft: ".25rem", marginBottom: ".05rem" } }))] }) }) }));
15
28
  }
@@ -1,6 +1,6 @@
1
1
  import { ElbeProps } from "../..";
2
- export declare function ProgressBar({ value, max, plain, ...elbe }: {
2
+ export declare function ProgressBar({ value, max, manner, ...elbe }: {
3
3
  value: number;
4
4
  max?: number;
5
- plain?: boolean;
5
+ manner: "flat" | "plain";
6
6
  } & ElbeProps): import("react/jsx-runtime").JSX.Element;
@@ -10,21 +10,24 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { applyProps, clamp, useTheme, useThemeConfig } from "../..";
13
+ import { applyProps, clamp } from "../..";
14
+ import { useApp } from "../app/app_ctxt";
14
15
  export function ProgressBar(_a) {
15
- var { value, max = 100, plain } = _a, elbe = __rest(_a, ["value", "max", "plain"]);
16
- const tConfig = useThemeConfig();
17
- const theme = useTheme();
18
- return (_jsx("div", Object.assign({}, applyProps("progress_bar", Object.assign({ role: "progressbar" }, elbe), [plain ? "plain" : "accent minor"], {
16
+ var { value, max = 100, manner = "flat" } = _a, elbe = __rest(_a, ["value", "max", "manner"]);
17
+ const { _appThemeContext } = useApp();
18
+ const theme = _appThemeContext.useTheme().useWith(({ color }) => ({
19
+ color: Object.assign(Object.assign({}, color), { selection: Object.assign(Object.assign({}, color.selection), { manner: manner }) }),
20
+ }), [manner]);
21
+ return (_jsx("div", Object.assign({}, applyProps("progress_bar", Object.assign({ role: "progressbar" }, elbe), [], {
19
22
  width: "100%",
20
23
  height: "0.5rem",
21
- borderRadius: theme.geometry.radius + "rem",
24
+ borderRadius: theme.theme.geometry.radius + "rem",
22
25
  border: "none",
23
26
  }), { children: _jsx("div", { style: {
24
27
  width: `${clamp((value / max) * 100, 0, 100)}%`,
25
28
  height: "100%",
26
- backgroundColor: "var(--c-context-front)",
27
- transition: tConfig.reducedMotion ? "none" : "width 0.25s",
28
- borderRadius: theme.geometry.radius + "rem",
29
+ backgroundColor: theme.theme.color.currentColor.front.asCss(),
30
+ transition: theme.theme.motion.reduced ? "none" : "width 0.25s",
31
+ borderRadius: theme.theme.geometry.radius + "rem",
29
32
  } }) })));
30
33
  }
@@ -1,11 +1,6 @@
1
- import { Component } from "react";
2
1
  export type SpinnerProps = {
3
2
  padding?: number;
4
3
  };
5
- export declare class Spinner extends Component<{
4
+ export declare function Spinner(p: {
6
5
  manner?: "flat" | "plain";
7
- } & SpinnerProps> {
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
- }
6
+ } & SpinnerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Component, useEffect, useMemo, useState } from "react";
3
- import { useThemeConfig } from "../theme/theme_context";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import { useApp } from "../app/app_ctxt";
4
4
  function _toPath(c, yFac, yOffset = 0, clamp = [0, 1], xFac = 1) {
5
5
  return c
6
6
  .filter((p) => p[0] >= clamp[0] && p[0] <= clamp[1])
@@ -10,20 +10,18 @@ function _toPath(c, yFac, yOffset = 0, clamp = [0, 1], xFac = 1) {
10
10
  (p[1] * yFac + yOffset).toFixed(2))
11
11
  .join(" ");
12
12
  }
13
- export class Spinner extends Component {
14
- render() {
15
- return _jsx(_Spinner, Object.assign({ manner: this.props.manner }, this.props));
16
- }
17
- }
18
- Spinner.flat = (p) => new Spinner(Object.assign({ manner: "flat" }, p)).render();
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";
13
+ export function Spinner(p) {
14
+ var _a;
24
15
  const [x, setX] = useState(0);
16
+ const { _appThemeContext } = useApp();
17
+ const theme = _appThemeContext.useTheme().useWith(({ color }) => {
18
+ var _a;
19
+ return ({
20
+ color: Object.assign(Object.assign({}, color), { selection: Object.assign(Object.assign({}, color.selection), { manner: (_a = p.manner) !== null && _a !== void 0 ? _a : "plain" }) }),
21
+ });
22
+ }, [p.manner]);
25
23
  useEffect(() => {
26
- if (tConfig.reducedMotion)
24
+ if (theme.theme.motion.reduced)
27
25
  return () => { };
28
26
  const interval = setInterval(() => {
29
27
  setX((prev) => (prev + 2) % 100);
@@ -39,8 +37,9 @@ function _Spinner(p) {
39
37
  }
40
38
  return path;
41
39
  }, [x]);
42
- return (_jsx("div", { className: `${flat ? "accent flat" : "plain"}`, style: {
43
- padding: `${(_b = p.padding) !== null && _b !== void 0 ? _b : 1}rem`,
40
+ return (_jsx("div", { style: {
41
+ padding: `${(_a = p.padding) !== null && _a !== void 0 ? _a : 1}rem`,
42
+ color: theme.theme.color.currentColor.front.asCss(),
44
43
  }, children: _jsx("svg", { style: { width: "40px", height: "40px" }, viewBox: `-10 -10 120 120`, children: [
45
44
  _toPath(path, 13, 20, [0.4, 0.8], 1),
46
45
  _toPath(path, 10, 50),
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import type { ElbeTypeVariants } from "../theme/type_theme";
3
- import type { ElbeChildren } from "../util/types";
4
- import { type ElbeProps } from "./base/box";
5
- export type TextProps = {
2
+ import { ElbeTypeVariants } from "../theme/subthemes/_theme_type";
3
+ import { ElbeChildrenProps, type ElbeProps } from "./base/box";
4
+ export declare const elbeThemeVariants: ElbeTypeVariants[];
5
+ export type TextProps = ElbeProps & ElbeChildrenProps & {
6
6
  align?: "start" | "center" | "end";
7
7
  bold?: boolean;
8
8
  italic?: boolean;
@@ -10,9 +10,8 @@ export type TextProps = {
10
10
  striked?: boolean;
11
11
  color?: string;
12
12
  size?: number;
13
- children?: ElbeChildren;
14
13
  v?: string;
15
- } & ElbeProps;
14
+ };
16
15
  export declare class Text extends React.Component<TextProps & {
17
16
  variant?: ElbeTypeVariants;
18
17
  }> {
@@ -10,26 +10,24 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import React from "react";
13
+ import React, { useMemo } from "react";
14
+ import { useApp } from "../app/app_ctxt";
14
15
  import { applyProps } from "./base/box";
16
+ export const elbeThemeVariants = [
17
+ "h1",
18
+ "h2",
19
+ "h3",
20
+ "h4",
21
+ "h5",
22
+ "h6",
23
+ "bodyL",
24
+ "bodyM",
25
+ "bodyS",
26
+ "code",
27
+ ];
15
28
  export class Text extends React.Component {
16
29
  render() {
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"]);
18
- return (_jsxs("span", Object.assign({}, applyProps("text", elbe, [
19
- "text",
20
- //align,
21
- color,
22
- variant,
23
- ], {
24
- fontSize: size ? `${size}rem` : "",
25
- color: color || "",
26
- scrollMarginTop: "2rem",
27
- textAlign: align,
28
- fontWeight: bold ? "bold" : "",
29
- fontStyle: italic ? "italic" : "",
30
- textDecoration: underline ? "underline" : "",
31
- textDecorationLine: striked ? "line-through" : "",
32
- }), { children: [v, children] })));
30
+ return _jsx(_Text, Object.assign({}, this.props));
33
31
  }
34
32
  }
35
33
  Text.h1 = (p) => _jsx(Text, Object.assign({}, p, { variant: "h1" }));
@@ -38,11 +36,26 @@ Text.h3 = (p) => _jsx(Text, Object.assign({}, p, { variant: "h3" }));
38
36
  Text.h4 = (p) => _jsx(Text, Object.assign({}, p, { variant: "h4" }));
39
37
  Text.h5 = (p) => _jsx(Text, Object.assign({}, p, { variant: "h5" }));
40
38
  Text.h6 = (p) => _jsx(Text, Object.assign({}, p, { variant: "h6" }));
41
- Text.s = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-s" }));
42
- Text.m = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-m" }));
43
- Text.l = (p) => _jsx(Text, Object.assign({}, p, { variant: "body-l" }));
39
+ Text.s = (p) => _jsx(Text, Object.assign({}, p, { variant: "bodyS" }));
40
+ Text.m = (p) => _jsx(Text, Object.assign({}, p, { variant: "bodyM" }));
41
+ Text.l = (p) => _jsx(Text, Object.assign({}, p, { variant: "bodyL" }));
44
42
  Text.code = (p) => _jsx(Text, Object.assign({}, p, { variant: "code" }));
45
43
  // replace the constructor with defaultProps so React receives the same props object
46
44
  Text.defaultProps = {
47
- variant: "body-m",
45
+ variant: "bodyM",
48
46
  };
47
+ function _Text(p) {
48
+ const { _appThemeContext } = useApp();
49
+ const usedTheme = _appThemeContext.useTheme();
50
+ const tVariant = useMemo(() => {
51
+ var _a;
52
+ const v = usedTheme.theme.type[(_a = p.variant) !== null && _a !== void 0 ? _a : "bodyM"];
53
+ if (!v)
54
+ throw new Error(`Unknown text variant: ${p.variant}`);
55
+ return v;
56
+ }, [usedTheme, p.variant]);
57
+ const { align, bold, italic, underline, striked, color, size, children, variant, v } = p, elbe = __rest(p, ["align", "bold", "italic", "underline", "striked", "color", "size", "children", "variant", "v"]);
58
+ return (_jsxs("span", Object.assign({}, applyProps("text", elbe, [], Object.assign({ color: color !== null && color !== void 0 ? color : "", scrollMarginTop: "2rem", textAlign: align, textDecorationLine: striked ? "line-through" : "",
59
+ // disable auto wrap for code blocks
60
+ whiteSpace: "pre-wrap", fontSize: size ? size + "rem" : undefined }, tVariant.asCss({ bold, italic, underline, size }))), { children: [v, children] })));
61
+ }
@@ -0,0 +1,5 @@
1
+ import { ElbeChildren } from "../util/types";
2
+ export declare function WithTooltip(p: {
3
+ tooltip?: string;
4
+ children?: ElbeChildren;
5
+ }): import("react/jsx-runtime").JSX.Element;