tgui-core 1.3.2 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +24 -2
  2. package/dist/common/ui.d.ts +113 -0
  3. package/dist/common/ui.js +137 -0
  4. package/dist/components/AnimatedNumber.d.ts +1 -0
  5. package/dist/components/BlockQuote.d.ts +5 -0
  6. package/dist/components/Box.d.ts +74 -63
  7. package/dist/components/Box.js +13 -127
  8. package/dist/components/Button.d.ts +22 -5
  9. package/dist/components/Button.js +2 -1
  10. package/dist/components/ByondUi.d.ts +50 -0
  11. package/dist/components/ByondUi.js +32 -44
  12. package/dist/components/ColorBox.js +1 -1
  13. package/dist/components/Dropdown.js +1 -1
  14. package/dist/components/Flex.js +1 -1
  15. package/dist/components/Icon.d.ts +1 -1
  16. package/dist/components/Icon.js +2 -2
  17. package/dist/components/Image.js +22 -21
  18. package/dist/components/ImageButton.js +1 -1
  19. package/dist/components/InfinitePlane.js +1 -1
  20. package/dist/components/Input.d.ts +6 -3
  21. package/dist/components/Input.js +60 -55
  22. package/dist/components/KeyListener.d.ts +2 -8
  23. package/dist/components/KeyListener.js +11 -19
  24. package/dist/components/Knob.js +1 -1
  25. package/dist/components/LabeledList.js +16 -15
  26. package/dist/components/Modal.js +1 -1
  27. package/dist/components/ProgressBar.js +1 -1
  28. package/dist/components/RoundGauge.d.ts +2 -1
  29. package/dist/components/RoundGauge.js +19 -18
  30. package/dist/components/Section.d.ts +43 -27
  31. package/dist/components/Section.js +64 -66
  32. package/dist/components/Slider.js +1 -1
  33. package/dist/components/Stack.js +1 -1
  34. package/dist/components/Table.js +1 -1
  35. package/dist/components/Tabs.js +1 -1
  36. package/dist/components/TextArea.d.ts +2 -1
  37. package/package.json +20 -12
@@ -0,0 +1,50 @@
1
+ import { BoxProps } from './Box';
2
+ type SampleByondParams = Partial<{
3
+ /** Can be auto-generated. */
4
+ id: string;
5
+ /** Defaults to the current window */
6
+ parent: string;
7
+ /** The type of control. Read-only. */
8
+ type: string;
9
+ /** Text shown in label/button/input. For input controls this setting is only available at runtime. */
10
+ text: string;
11
+ }>;
12
+ type Props = Partial<{
13
+ /** An object with parameters, which are directly passed to
14
+ * the `winset` proc call.
15
+ *
16
+ * You can find a full reference of these parameters
17
+ * in [BYOND controls and parameters guide](https://secure.byond.com/docs/ref/skinparams.html). */
18
+ params: SampleByondParams & Record<string, any>;
19
+ }> & BoxProps;
20
+ /**
21
+ * ## ByondUi
22
+ * Displays a BYOND UI element on top of the browser, and leverages browser's
23
+ * layout engine to position it just like any other HTML element. It is
24
+ * especially useful if you want to display a secondary game map in your
25
+ * interface.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <ByondUi
30
+ * params={{
31
+ * id: 'test_button', // optional, can be auto-generated
32
+ * parent: 'some_container', // optional, defaults to the current window
33
+ * type: 'button',
34
+ * text: 'Hello, world!',
35
+ * }} />
36
+ * ```
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * <ByondUi
41
+ * params={{
42
+ * id: 'test_map',
43
+ * type: 'map',
44
+ * }} />
45
+ * ```
46
+ *
47
+ * It supports a full set of `Box` properties for layout purposes.
48
+ */
49
+ export declare function ByondUi(props: Props): import("react/jsx-runtime").JSX.Element;
50
+ export {};
@@ -1,19 +1,18 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { Component as a, createRef as c } from "react";
3
- import { shallowDiffers as r } from "../common/react.js";
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useRef as f, useEffect as p } from "react";
4
3
  import { debounce as m } from "../common/timer.js";
5
- import { computeBoxProps as l } from "./Box.js";
4
+ import { computeBoxProps as w } from "../common/ui.js";
6
5
  const o = [];
7
- function h(t) {
8
- const n = o.length;
6
+ function a(t) {
7
+ const e = o.length;
9
8
  o.push(null);
10
- const e = t || `byondui_${n}`;
9
+ const n = t || `byondui_${e}`;
11
10
  return {
12
11
  render: (i) => {
13
- o[n] = e, Byond.winset(e, i);
12
+ o[e] = n, Byond.winset(n, i);
14
13
  },
15
14
  unmount: () => {
16
- o[n] = null, Byond.winset(e, {
15
+ o[e] = null, Byond.winset(n, {
17
16
  parent: ""
18
17
  });
19
18
  }
@@ -21,53 +20,42 @@ function h(t) {
21
20
  }
22
21
  window.addEventListener("beforeunload", () => {
23
22
  for (let t = 0; t < o.length; t++) {
24
- const n = o[t];
25
- typeof n == "string" && (o[t] = null, Byond.winset(n, {
23
+ const e = o[t];
24
+ typeof e == "string" && (o[t] = null, Byond.winset(e, {
26
25
  parent: ""
27
26
  }));
28
27
  }
29
28
  });
30
- function u(t) {
31
- const n = window.devicePixelRatio ?? 1, e = t.getBoundingClientRect();
29
+ function x(t) {
30
+ const e = window.devicePixelRatio ?? 1, n = t.getBoundingClientRect();
32
31
  return {
33
- pos: [e.left * n, e.top * n],
32
+ pos: [n.left * e, n.top * e],
34
33
  size: [
35
- (e.right - e.left) * n,
36
- (e.bottom - e.top) * n
34
+ (n.right - n.left) * e,
35
+ (n.bottom - n.top) * e
37
36
  ]
38
37
  };
39
38
  }
40
- class U extends a {
41
- constructor(n) {
42
- var e;
43
- super(n), this.containerRef = c(), this.byondUiElement = h((e = n.params) == null ? void 0 : e.id), this.handleResize = m(() => {
44
- this.forceUpdate();
45
- }, 100);
46
- }
47
- shouldComponentUpdate(n) {
48
- const { params: e = {}, ...i } = this.props, { params: d = {}, ...p } = n;
49
- return r(e, d) || r(i, p);
50
- }
51
- componentDidMount() {
52
- window.addEventListener("resize", this.handleResize), this.componentDidUpdate(), this.handleResize();
53
- }
54
- componentDidUpdate() {
55
- const { params: n = {} } = this.props, e = u(this.containerRef.current);
56
- this.byondUiElement.render({
39
+ function h(t) {
40
+ const { params: e, ...n } = t, i = f(null), d = f(a(e == null ? void 0 : e.id));
41
+ function s() {
42
+ const c = i.current;
43
+ if (!c) return;
44
+ const r = x(c);
45
+ d.current.render({
57
46
  parent: Byond.windowId,
58
- ...n,
59
- pos: `${e.pos[0]},${e.pos[1]}`,
60
- size: `${e.size[0]}x${e.size[1]}`
47
+ ...e,
48
+ pos: `${r.pos[0]},${r.pos[1]}`,
49
+ size: `${r.size[0]}x${r.size[1]}`
61
50
  });
62
51
  }
63
- componentWillUnmount() {
64
- window.removeEventListener("resize", this.handleResize), this.byondUiElement.unmount();
65
- }
66
- render() {
67
- const { params: n, ...e } = this.props;
68
- return /* @__PURE__ */ s("div", { ref: this.containerRef, ...l(e), children: /* @__PURE__ */ s("div", { style: { minHeight: "22px" } }) });
69
- }
52
+ const u = m(() => {
53
+ s();
54
+ }, 100);
55
+ return p(() => (window.addEventListener("resize", u), s(), () => {
56
+ window.removeEventListener("resize", u), d.current.unmount();
57
+ }), []), /* @__PURE__ */ l("div", { ref: i, ...w(n), children: /* @__PURE__ */ l("div", { style: { minHeight: "22px" } }) });
70
58
  }
71
59
  export {
72
- U as ByondUi
60
+ h as ByondUi
73
61
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { classes as c } from "../common/react.js";
3
- import { computeBoxClassName as s, computeBoxProps as m } from "./Box.js";
3
+ import { computeBoxClassName as s, computeBoxProps as m } from "../common/ui.js";
4
4
  function d(r) {
5
5
  const { content: l, children: a, className: e, ...o } = r;
6
6
  return o.color = l ? null : "default", o.backgroundColor = r.color || "default", /* @__PURE__ */ t(
@@ -1,7 +1,7 @@
1
1
  import { jsx as l, jsxs as p, Fragment as W } from "react/jsx-runtime";
2
2
  import { useState as F, useRef as L, useEffect as S } from "react";
3
3
  import { classes as N } from "../common/react.js";
4
- import { unit as $ } from "./Box.js";
4
+ import { unit as $ } from "../common/ui.js";
5
5
  import { Button as D } from "./Button.js";
6
6
  import { Icon as b } from "./Icon.js";
7
7
  import { Popper as q } from "./Popper.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { classes as r } from "../common/react.js";
3
- import { computeBoxClassName as m, computeBoxProps as a, unit as f } from "./Box.js";
3
+ import { computeBoxClassName as m, computeBoxProps as a, unit as f } from "../common/ui.js";
4
4
  function p(e) {
5
5
  return r([
6
6
  "Flex",
@@ -15,7 +15,7 @@ type Props = {
15
15
  spin: BooleanLike;
16
16
  /** Custom CSS. */
17
17
  style: CSSProperties;
18
- }> & BoxProps;
18
+ }> & Omit<BoxProps, 'children'>;
19
19
  export declare function Icon(props: Props): import("react/jsx-runtime").JSX.Element;
20
20
  export declare namespace Icon {
21
21
  var Stack: typeof IconStack;
@@ -1,9 +1,9 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { classes as l } from "../common/react.js";
3
- import { computeBoxProps as p, computeBoxClassName as u } from "./Box.js";
3
+ import { computeBoxProps as p, computeBoxClassName as u } from "../common/ui.js";
4
4
  const f = /-o$/;
5
5
  function d(c) {
6
- const { name: s, size: o, spin: a, className: N, rotation: r, ...e } = c, n = e.style || {};
6
+ const { name: s = "", size: o, spin: a, className: N, rotation: r, ...e } = c, n = e.style || {};
7
7
  o && (n.fontSize = `${o * 100}%`), r && (n.transform = `rotate(${r}deg)`), e.style = n;
8
8
  const x = p(e);
9
9
  let t = "";
@@ -1,32 +1,33 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useRef as a } from "react";
3
- import { computeBoxProps as f } from "./Box.js";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useRef as p } from "react";
3
+ import { computeBoxProps as f } from "../common/ui.js";
4
4
  const l = 5;
5
- function E(o) {
5
+ function E(m) {
6
6
  const {
7
- fixBlur: s = !0,
8
- fixErrors: m = !1,
9
- objectFit: n = "fill",
10
- src: e,
11
- ...c
12
- } = o, t = a(0), r = f(c);
13
- return r.style = {
14
- ...r.style,
15
- "-ms-interpolation-mode": s ? "nearest-neighbor" : "auto",
16
- objectFit: n
17
- }, /* @__PURE__ */ p(
7
+ fixBlur: r = !0,
8
+ fixErrors: n = !1,
9
+ objectFit: s = "fill",
10
+ src: o,
11
+ ...i
12
+ } = m, t = p(0), e = f(i);
13
+ return e.style = {
14
+ ...e.style,
15
+ "-ms-interpolation-mode": r ? "nearest-neighbor" : "auto",
16
+ imageRendering: r ? "pixelated" : "auto",
17
+ objectFit: s
18
+ }, /* @__PURE__ */ a(
18
19
  "img",
19
20
  {
20
- onError: (i) => {
21
- if (m && t.current < l) {
22
- const u = i.currentTarget;
21
+ onError: (c) => {
22
+ if (n && t.current < l) {
23
+ const u = c.currentTarget;
23
24
  setTimeout(() => {
24
- u.src = `${e}?attempt=${t.current}`, t.current++;
25
+ u.src = `${o}?attempt=${t.current}`, t.current++;
25
26
  }, 1e3);
26
27
  }
27
28
  },
28
- src: e,
29
- ...r,
29
+ src: o,
30
+ ...e,
30
31
  alt: "dm icon"
31
32
  }
32
33
  );
@@ -1,6 +1,6 @@
1
1
  import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
2
  import { classes as l } from "../common/react.js";
3
- import { computeBoxProps as A } from "./Box.js";
3
+ import { computeBoxProps as A } from "../common/ui.js";
4
4
  import { DmIcon as D } from "./DmIcon.js";
5
5
  import { Icon as F } from "./Icon.js";
6
6
  import { Image as j } from "./Image.js";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
2
  import { Component as v } from "react";
3
- import { computeBoxProps as Z } from "./Box.js";
3
+ import { computeBoxProps as Z } from "../common/ui.js";
4
4
  import { Button as c } from "./Button.js";
5
5
  import { ProgressBar as g } from "./ProgressBar.js";
6
6
  import { Stack as d } from "./Stack.js";
@@ -38,18 +38,21 @@ type OptionalProps = Partial<{
38
38
  /** Fires when user is 'done typing': Clicked out, blur, enter key */
39
39
  onChange: (event: SyntheticEvent<HTMLInputElement>, value: string) => void;
40
40
  /** Fires once the enter key is pressed */
41
- onEnter?: (event: SyntheticEvent<HTMLInputElement>, value: string) => void;
41
+ onEnter: (event: SyntheticEvent<HTMLInputElement>, value: string) => void;
42
42
  /** Fires once the escape key is pressed */
43
43
  onEscape: (event: SyntheticEvent<HTMLInputElement>) => void;
44
44
  /** The placeholder text when everything is cleared */
45
45
  placeholder: string;
46
46
  /** Clears the input value on enter */
47
47
  selfClear: boolean;
48
+ /** Auto-updates the input value on props change, ie, data from Byond */
49
+ updateOnPropsChange: boolean;
48
50
  /** The state variable of the input. */
49
51
  value: string | number;
50
52
  }>;
51
- type Props = OptionalProps & ConditionalProps & BoxProps;
52
- export declare function toInputValue(value: string | number | undefined): string;
53
+ type Props = OptionalProps & ConditionalProps & Omit<BoxProps, 'children'>;
54
+ type InputValue = string | number | undefined;
55
+ export declare function toInputValue(value: InputValue): string;
53
56
  /**
54
57
  * ### Input
55
58
  * A basic text input which allow users to enter text into a UI.
@@ -1,81 +1,86 @@
1
- import { jsxs as E, jsx as p } from "react/jsx-runtime";
2
- import { useRef as K, useEffect as m } from "react";
3
- import { KEY as V, isEscape as j } from "../common/keys.js";
4
- import { classes as k } from "../common/react.js";
5
- import { debounce as B } from "../common/timer.js";
1
+ import { jsxs as j, jsx as p } from "react/jsx-runtime";
2
+ import { useRef as k, useEffect as m } from "react";
3
+ import { KEY as w, isEscape as B } from "../common/keys.js";
4
+ import { classes as F } from "../common/react.js";
5
+ import { debounce as O } from "../common/timer.js";
6
6
  import { Box as R } from "./Box.js";
7
- function l(u) {
8
- return typeof u != "number" && typeof u != "string" ? "" : String(u);
7
+ function d(r) {
8
+ return typeof r != "number" && typeof r != "string" ? "" : String(r);
9
9
  }
10
- const S = B((u) => u(), 250);
11
- function A(u) {
10
+ const V = O((r) => r(), 250);
11
+ function C(r) {
12
12
  const {
13
- autoFocus: d,
14
- autoSelect: s,
15
- className: g,
16
- disabled: I,
17
- expensive: T,
18
- fluid: b,
13
+ autoFocus: g,
14
+ autoSelect: l,
15
+ className: I,
16
+ disabled: T,
17
+ expensive: b,
18
+ fluid: h,
19
19
  maxLength: x,
20
20
  monospace: y,
21
- onChange: t,
22
- onEnter: n,
23
- onEscape: o,
21
+ onChange: n,
22
+ onEnter: c,
23
+ onEscape: s,
24
24
  onInput: i,
25
- placeholder: h,
26
- selfClear: w,
27
- value: a,
28
- ...N
29
- } = u, c = K(null);
30
- function _(e) {
31
- var f;
25
+ placeholder: N,
26
+ selfClear: _,
27
+ updateOnPropsChange: D,
28
+ value: o,
29
+ ...E
30
+ } = r, a = k(null);
31
+ function K(t) {
32
+ var u;
32
33
  if (!i) return;
33
- const r = (f = e.currentTarget) == null ? void 0 : f.value;
34
- T ? S(() => i(e, r)) : i(e, r);
34
+ const e = (u = t.currentTarget) == null ? void 0 : u.value;
35
+ b ? V(() => i(t, e)) : i(t, e);
35
36
  }
36
- function D(e) {
37
- if (e.key === V.Enter) {
38
- n == null || n(e, e.currentTarget.value), w ? e.currentTarget.value = "" : (e.currentTarget.blur(), t == null || t(e, e.currentTarget.value));
37
+ function S(t) {
38
+ if (t.key === w.Enter) {
39
+ c == null || c(t, t.currentTarget.value), _ ? t.currentTarget.value = "" : (t.currentTarget.blur(), n == null || n(t, t.currentTarget.value));
39
40
  return;
40
41
  }
41
- j(e.key) && (o == null || o(e), e.currentTarget.value = l(a), e.currentTarget.blur());
42
+ B(t.key) && (s == null || s(t), t.currentTarget.value = d(o), t.currentTarget.blur());
42
43
  }
43
- return m(() => {
44
- const e = c.current;
44
+ function f(t) {
45
+ const e = a.current;
45
46
  if (!e) return;
46
- const r = l(a);
47
- e.value !== r && (e.value = r), !(!d && !s) && setTimeout(() => {
48
- e.focus(), s && e.select();
49
- }, 1);
47
+ const u = d(t);
48
+ e.value !== u && (e.value = u);
49
+ }
50
+ return m(() => {
51
+ const t = a.current;
52
+ if (t) {
53
+ f(o);
54
+ const e = g || l, u = document.activeElement === t;
55
+ e && !u && setTimeout(() => {
56
+ t.focus(), l && t.select();
57
+ }, 1);
58
+ }
50
59
  }, []), m(() => {
51
- const e = c.current;
52
- if (!e || document.activeElement === e)
53
- return;
54
- const r = l(a);
55
- e.value !== r && (e.value = r);
56
- }), /* @__PURE__ */ E(
60
+ D && f(o);
61
+ }, [o]), /* @__PURE__ */ j(
57
62
  R,
58
63
  {
59
- className: k([
64
+ className: F([
60
65
  "Input",
61
- b && "Input--fluid",
66
+ h && "Input--fluid",
62
67
  y && "Input--monospace",
63
- g
68
+ I
64
69
  ]),
65
- ...N,
70
+ ...E,
66
71
  children: [
67
72
  /* @__PURE__ */ p("div", { className: "Input__baseline", children: "." }),
68
73
  /* @__PURE__ */ p(
69
74
  "input",
70
75
  {
71
76
  className: "Input__input",
72
- disabled: I,
77
+ disabled: T,
73
78
  maxLength: x,
74
- onBlur: (e) => t == null ? void 0 : t(e, e.target.value),
75
- onChange: _,
76
- onKeyDown: D,
77
- placeholder: h,
78
- ref: c
79
+ onBlur: (t) => n == null ? void 0 : n(t, t.target.value),
80
+ onChange: K,
81
+ onKeyDown: S,
82
+ placeholder: N,
83
+ ref: a
79
84
  }
80
85
  )
81
86
  ]
@@ -83,6 +88,6 @@ function A(u) {
83
88
  );
84
89
  }
85
90
  export {
86
- A as Input,
87
- l as toInputValue
91
+ C as Input,
92
+ d as toInputValue
88
93
  };
@@ -1,14 +1,8 @@
1
- import { Component } from 'react';
2
1
  import { KeyEvent } from '../common/events';
3
- type KeyListenerProps = Partial<{
2
+ type Props = Partial<{
4
3
  onKey: (key: KeyEvent) => void;
5
4
  onKeyDown: (key: KeyEvent) => void;
6
5
  onKeyUp: (key: KeyEvent) => void;
7
6
  }>;
8
- export declare class KeyListener extends Component<KeyListenerProps> {
9
- dispose: () => void;
10
- constructor(props: any);
11
- componentWillUnmount(): void;
12
- render(): null;
13
- }
7
+ export declare function KeyListener(props: Props): null;
14
8
  export {};
@@ -1,23 +1,15 @@
1
- var t = Object.defineProperty;
2
- var e = (s, o, p) => o in s ? t(s, o, { enumerable: !0, configurable: !0, writable: !0, value: p }) : s[o] = p;
3
- var i = (s, o, p) => e(s, typeof o != "symbol" ? o + "" : o, p);
4
- import { Component as r } from "react";
5
- import { listenForKeyEvents as h } from "../common/hotkeys.js";
6
- class d extends r {
7
- constructor(p) {
8
- super(p);
9
- i(this, "dispose");
10
- this.dispose = h((n) => {
11
- this.props.onKey && this.props.onKey(n), n.isDown() && this.props.onKeyDown && this.props.onKeyDown(n), n.isUp() && this.props.onKeyUp && this.props.onKeyUp(n);
1
+ import { useEffect as i } from "react";
2
+ import { listenForKeyEvents as t } from "../common/hotkeys.js";
3
+ function r(n) {
4
+ return i(() => {
5
+ const o = t((e) => {
6
+ n.onKey && n.onKey(e), e.isDown() && n.onKeyDown && n.onKeyDown(e), e.isUp() && n.onKeyUp && n.onKeyUp(e);
12
7
  });
13
- }
14
- componentWillUnmount() {
15
- this.dispose();
16
- }
17
- render() {
18
- return null;
19
- }
8
+ return () => {
9
+ o();
10
+ };
11
+ }, []), null;
20
12
  }
21
13
  export {
22
- d as KeyListener
14
+ r as KeyListener
23
15
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
2
  import { keyOfMatchingRange as $, scale as t } from "../common/math.js";
3
3
  import { classes as j } from "../common/react.js";
4
- import { computeBoxClassName as E, computeBoxProps as T } from "./Box.js";
4
+ import { computeBoxClassName as E, computeBoxProps as T } from "../common/ui.js";
5
5
  import { DraggableControl as I } from "./DraggableControl.js";
6
6
  function H(c) {
7
7
  const {
@@ -1,6 +1,7 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
2
  import { classes as c } from "../common/react.js";
3
- import { Box as s, unit as g } from "./Box.js";
3
+ import { unit as g } from "../common/ui.js";
4
+ import { Box as r } from "./Box.js";
4
5
  import { Divider as x } from "./Divider.js";
5
6
  import { Tooltip as N } from "./Tooltip.js";
6
7
  function b(l) {
@@ -11,19 +12,19 @@ function v(l) {
11
12
  const {
12
13
  className: t,
13
14
  label: a,
14
- labelColor: L = "label",
15
- labelWrap: m,
15
+ labelColor: m = "label",
16
+ labelWrap: L,
16
17
  color: p,
17
18
  textAlign: _,
18
19
  buttons: o,
19
- content: h,
20
- children: f,
21
- verticalAlign: r = "baseline",
20
+ content: f,
21
+ children: h,
22
+ verticalAlign: s = "baseline",
22
23
  tooltip: n
23
24
  } = l;
24
25
  let i;
25
26
  a && (i = a, typeof a == "string" && (i += ":")), n !== void 0 && (i = /* @__PURE__ */ e(N, { content: n, children: /* @__PURE__ */ e(
26
- s,
27
+ r,
27
28
  {
28
29
  as: "span",
29
30
  style: {
@@ -33,33 +34,33 @@ function v(l) {
33
34
  }
34
35
  ) }));
35
36
  const u = /* @__PURE__ */ e(
36
- s,
37
+ r,
37
38
  {
38
39
  as: "td",
39
- color: L,
40
+ color: m,
40
41
  className: c([
41
42
  "LabeledList__cell",
42
43
  // Kinda flipped because we want nowrap as default. Cleaner CSS this way though.
43
- !m && "LabeledList__label--nowrap"
44
+ !L && "LabeledList__label--nowrap"
44
45
  ]),
45
- verticalAlign: r,
46
+ verticalAlign: s,
46
47
  children: i
47
48
  }
48
49
  );
49
50
  return /* @__PURE__ */ d("tr", { className: c(["LabeledList__row", t]), children: [
50
51
  u,
51
52
  /* @__PURE__ */ d(
52
- s,
53
+ r,
53
54
  {
54
55
  as: "td",
55
56
  color: p,
56
57
  textAlign: _,
57
58
  className: "LabeledList__cell",
58
59
  colSpan: o ? void 0 : 2,
59
- verticalAlign: r,
60
+ verticalAlign: s,
60
61
  children: [
61
- h,
62
- f
62
+ f,
63
+ h
63
64
  ]
64
65
  }
65
66
  ),
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { classes as t } from "../common/react.js";
3
- import { computeBoxClassName as a, computeBoxProps as c } from "./Box.js";
3
+ import { computeBoxClassName as a, computeBoxProps as c } from "../common/ui.js";
4
4
  import { Dimmer as i } from "./Dimmer.js";
5
5
  function f(m) {
6
6
  const { className: s, children: e, ...o } = m;
@@ -2,7 +2,7 @@ import { jsxs as B, jsx as i } from "react/jsx-runtime";
2
2
  import { CSS_COLORS as C } from "../common/constants.js";
3
3
  import { keyOfMatchingRange as P, toFixed as h, scale as x, clamp01 as _ } from "../common/math.js";
4
4
  import { classes as v } from "../common/react.js";
5
- import { computeBoxProps as y, computeBoxClassName as N } from "./Box.js";
5
+ import { computeBoxProps as y, computeBoxClassName as N } from "../common/ui.js";
6
6
  function j(n) {
7
7
  const {
8
8
  className: m,
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from 'react';
1
2
  import { BoxProps } from './Box';
2
3
  type Props = {
3
4
  /** The current value of the metric. */
@@ -20,7 +21,7 @@ type Props = {
20
21
  /** When provided scales the gauge. */
21
22
  size: number;
22
23
  /** Custom css */
23
- style: React.CSSProperties;
24
+ style: CSSProperties;
24
25
  }> & BoxProps;
25
26
  /**
26
27
  * ## RoundGauge