tgui-core 1.2.0 → 1.3.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 (116) hide show
  1. package/README.md +3 -3
  2. package/dist/common/color.js +31 -30
  3. package/dist/common/events.js +5 -5
  4. package/dist/common/format.js +27 -27
  5. package/dist/common/hotkeys.d.ts +0 -1
  6. package/dist/common/hotkeys.js +2 -2
  7. package/dist/common/math.d.ts +4 -0
  8. package/dist/common/math.js +29 -25
  9. package/dist/common/random.js +14 -13
  10. package/dist/common/react.js +1 -1
  11. package/dist/common/string.js +9 -9
  12. package/dist/common/type-utils.d.ts +1 -1
  13. package/dist/components/AnimatedNumber.d.ts +6 -6
  14. package/dist/components/AnimatedNumber.js +14 -17
  15. package/dist/components/Autofocus.d.ts +0 -1
  16. package/dist/components/Blink.d.ts +0 -1
  17. package/dist/components/BlockQuote.d.ts +0 -1
  18. package/dist/components/BlockQuote.js +4 -7
  19. package/dist/components/Box.d.ts +0 -1
  20. package/dist/components/Box.js +4 -4
  21. package/dist/components/Button.d.ts +0 -1
  22. package/dist/components/Button.js +173 -211
  23. package/dist/components/ByondUi.js +3 -3
  24. package/dist/components/Chart.d.ts +0 -1
  25. package/dist/components/Chart.js +25 -22
  26. package/dist/components/Collapsible.d.ts +0 -1
  27. package/dist/components/ColorBox.d.ts +0 -1
  28. package/dist/components/ColorBox.js +7 -14
  29. package/dist/components/Dialog.js +31 -40
  30. package/dist/components/Dimmer.d.ts +0 -1
  31. package/dist/components/Dimmer.js +6 -9
  32. package/dist/components/Divider.js +10 -14
  33. package/dist/components/DmIcon.d.ts +0 -1
  34. package/dist/components/DraggableControl.js +57 -49
  35. package/dist/components/Dropdown.d.ts +0 -1
  36. package/dist/components/Dropdown.js +73 -67
  37. package/dist/components/FitText.d.ts +0 -1
  38. package/dist/components/Flex.d.ts +1 -1
  39. package/dist/components/Flex.js +39 -41
  40. package/dist/components/Icon.d.ts +0 -1
  41. package/dist/components/Icon.js +27 -34
  42. package/dist/components/Image.d.ts +0 -1
  43. package/dist/components/Image.js +7 -6
  44. package/dist/components/ImageButton.d.ts +0 -1
  45. package/dist/components/ImageButton.js +87 -170
  46. package/dist/components/InfinitePlane.js +1 -1
  47. package/dist/components/Input.d.ts +0 -1
  48. package/dist/components/Input.js +57 -64
  49. package/dist/components/KeyListener.d.ts +0 -1
  50. package/dist/components/Knob.d.ts +0 -1
  51. package/dist/components/Knob.js +91 -117
  52. package/dist/components/LabeledControls.d.ts +0 -1
  53. package/dist/components/LabeledList.d.ts +0 -1
  54. package/dist/components/LabeledList.js +48 -55
  55. package/dist/components/MenuBar.d.ts +0 -1
  56. package/dist/components/MenuBar.js +93 -102
  57. package/dist/components/Modal.d.ts +0 -1
  58. package/dist/components/Modal.js +11 -18
  59. package/dist/components/NoticeBox.d.ts +0 -1
  60. package/dist/components/NoticeBox.js +16 -43
  61. package/dist/components/NumberInput.d.ts +0 -2
  62. package/dist/components/NumberInput.js +99 -107
  63. package/dist/components/Popper.d.ts +0 -1
  64. package/dist/components/ProgressBar.d.ts +0 -1
  65. package/dist/components/ProgressBar.js +22 -27
  66. package/dist/components/RestrictedInput.js +64 -58
  67. package/dist/components/RoundGauge.d.ts +0 -1
  68. package/dist/components/RoundGauge.js +70 -104
  69. package/dist/components/Section.d.ts +1 -2
  70. package/dist/components/Section.js +50 -51
  71. package/dist/components/Slider.d.ts +0 -1
  72. package/dist/components/Slider.js +72 -80
  73. package/dist/components/Stack.d.ts +0 -1
  74. package/dist/components/Stack.js +37 -47
  75. package/dist/components/StyleableSection.d.ts +0 -1
  76. package/dist/components/StyleableSection.js +11 -11
  77. package/dist/components/Table.d.ts +0 -1
  78. package/dist/components/Table.js +38 -47
  79. package/dist/components/Tabs.d.ts +0 -1
  80. package/dist/components/Tabs.js +43 -75
  81. package/dist/components/TextArea.d.ts +0 -1
  82. package/dist/components/TextArea.js +74 -69
  83. package/dist/components/TimeDisplay.d.ts +7 -6
  84. package/dist/components/TimeDisplay.js +17 -17
  85. package/dist/components/Tooltip.d.ts +1 -2
  86. package/dist/components/Tooltip.js +8 -10
  87. package/dist/components/TrackOutsideClicks.d.ts +0 -1
  88. package/dist/components/VirtualList.d.ts +0 -1
  89. package/package.json +25 -25
  90. package/dist/ProgressBar.module-Jzqlebbx.js +0 -29
  91. package/dist/Section.module-qhQWhlUX.js +0 -18
  92. package/dist/assets/BlockQuote.css +0 -1
  93. package/dist/assets/Button.css +0 -1
  94. package/dist/assets/ColorBox.css +0 -1
  95. package/dist/assets/Dialog.css +0 -1
  96. package/dist/assets/Dimmer.css +0 -1
  97. package/dist/assets/Divider.css +0 -1
  98. package/dist/assets/Flex.css +0 -1
  99. package/dist/assets/Icon.css +0 -6
  100. package/dist/assets/ImageButton.css +0 -5
  101. package/dist/assets/Input.css +0 -1
  102. package/dist/assets/Knob.css +0 -1
  103. package/dist/assets/LabeledList.css +0 -1
  104. package/dist/assets/MenuBar.css +0 -1
  105. package/dist/assets/Modal.css +0 -1
  106. package/dist/assets/NoticeBox.css +0 -1
  107. package/dist/assets/NumberInput.css +0 -1
  108. package/dist/assets/ProgressBar.css +0 -1
  109. package/dist/assets/RoundGauge.css +0 -1
  110. package/dist/assets/Section.css +0 -1
  111. package/dist/assets/Slider.css +0 -1
  112. package/dist/assets/Stack.css +0 -1
  113. package/dist/assets/Table.css +0 -1
  114. package/dist/assets/Tabs.css +0 -1
  115. package/dist/assets/TextArea.css +0 -1
  116. package/dist/assets/Tooltip.css +0 -1
@@ -1,72 +1,70 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { classes as l } from "../common/react.js";
3
- import { computeBoxClassName as m, computeBoxProps as a, unit as d } from "./Box.js";
4
- import '../assets/Flex.css';const p = "_flex_djoni_5", N = "_inline_djoni_10", r = {
5
- flex: p,
6
- inline: N
7
- };
8
- function y(e) {
9
- return l([
10
- r.flex,
11
- e.inline && r.inline,
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { classes as r } from "../common/react.js";
3
+ import { computeBoxClassName as m, computeBoxProps as a, unit as f } from "./Box.js";
4
+ function p(e) {
5
+ return r([
6
+ "Flex",
7
+ e.inline && "Flex--inline",
12
8
  m(e)
13
9
  ]);
14
10
  }
15
- function v(e) {
16
- const { direction: n, wrap: t, align: o, justify: s, ...i } = e;
11
+ function d(e) {
12
+ const { direction: s, wrap: t, align: i, justify: n, ...o } = e;
17
13
  return a({
18
14
  style: {
19
- ...i.style,
20
- flexDirection: n,
15
+ ...o.style,
16
+ flexDirection: s,
21
17
  flexWrap: t === !0 ? "wrap" : t,
22
- alignItems: o,
23
- justifyContent: s
18
+ alignItems: i,
19
+ justifyContent: n
24
20
  },
25
- ...i
21
+ ...o
26
22
  });
27
23
  }
28
- function _(e) {
29
- const { className: n, ...t } = e;
30
- return /* @__PURE__ */ c(
24
+ function F(e) {
25
+ const { className: s, ...t } = e;
26
+ return /* @__PURE__ */ l(
31
27
  "div",
32
28
  {
33
- className: l([n, y(t)]),
34
- ...v(t)
29
+ className: r([s, p(t)]),
30
+ ...d(t)
35
31
  }
36
32
  );
37
33
  }
38
- function g(e) {
39
- const { style: n, grow: t, order: o, shrink: s, basis: i, align: u, ...f } = e, x = i ?? // IE11: Set basis to specified width if it's known, which fixes certain
34
+ const N = (e) => r(["Flex__item", m(e)]);
35
+ function v(e) {
36
+ const { style: s, grow: t, order: i, shrink: n, basis: o, align: c, ...u } = e, x = o ?? // IE11: Set basis to specified width if it's known, which fixes certain
40
37
  // bugs when rendering tables inside the flex.
41
38
  e.width ?? // If grow is used, basis should be set to 0 to be consistent with
42
39
  // flex css shorthand `flex: 1`.
43
40
  (t !== void 0 ? 0 : void 0);
44
41
  return a({
45
42
  style: {
46
- ...n,
43
+ ...s,
47
44
  flexGrow: t !== void 0 && Number(t),
48
- flexShrink: s !== void 0 && Number(s),
49
- flexBasis: d(x),
50
- order: o,
51
- alignSelf: u
45
+ flexShrink: n !== void 0 && Number(n),
46
+ flexBasis: f(x),
47
+ order: i,
48
+ alignSelf: c
52
49
  },
53
- ...f
50
+ ...u
54
51
  });
55
52
  }
56
- function j(e) {
57
- const { className: n, ...t } = e;
58
- return /* @__PURE__ */ c(
53
+ function y(e) {
54
+ const { className: s, ...t } = e;
55
+ return /* @__PURE__ */ l(
59
56
  "div",
60
57
  {
61
- className: l([n, m(e)]),
62
- ...g(t)
58
+ className: r([s, N(e)]),
59
+ ...v(t)
63
60
  }
64
61
  );
65
62
  }
66
- _.Item = j;
63
+ F.Item = y;
67
64
  export {
68
- _ as Flex,
69
- y as computeFlexClassName,
70
- g as computeFlexItemProps,
71
- v as computeFlexProps
65
+ F as Flex,
66
+ p as computeFlexClassName,
67
+ N as computeFlexItemClassName,
68
+ v as computeFlexItemProps,
69
+ d as computeFlexProps
72
70
  };
@@ -1,7 +1,6 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { BooleanLike } from '../common/react';
3
3
  import { BoxProps } from './Box';
4
-
5
4
  type Props = {
6
5
  /** Icon name. See [icon list](https://fontawesome.com/v5/search?o=r&m=free) */
7
6
  name: string;
@@ -1,51 +1,44 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { classes as m } from "../common/react.js";
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { classes as l } from "../common/react.js";
3
3
  import { computeBoxProps as p, computeBoxClassName as u } from "./Box.js";
4
- import '../assets/Icon.css';const x = "_iconStack_bg05l_7", y = "_icon_bg05l_7", S = {
5
- iconStack: x,
6
- icon: y
7
- }, f = /-o$/;
8
- function b(a) {
9
- const { name: t, size: o, spin: c, className: _, rotation: i, ...n } = a, e = n.style || {};
10
- o && (e.fontSize = o * 100 + "%"), i && (e.transform = `rotate(${i}deg)`), n.style = e;
11
- const N = p(n);
12
- let s = "";
13
- if (t.startsWith("tg-"))
14
- s = t;
4
+ const f = /-o$/;
5
+ function d(c) {
6
+ const { name: s, size: o, spin: a, className: N, rotation: r, ...e } = c, n = e.style || {};
7
+ o && (n.fontSize = `${o * 100}%`), r && (n.transform = `rotate(${r}deg)`), e.style = n;
8
+ const x = p(e);
9
+ let t = "";
10
+ if (s.startsWith("tg-"))
11
+ t = s;
15
12
  else {
16
- const k = f.test(t), r = t.replace(f, ""), g = !r.startsWith("fa-");
17
- s = k ? "far " : "fas ", g && (s += "fa-"), s += r, c && (s += " fa-spin");
13
+ const I = f.test(s), i = s.replace(f, ""), S = !i.startsWith("fa-");
14
+ t = I ? "far " : "fas ", S && (t += "fa-"), t += i, a && (t += " fa-spin");
18
15
  }
19
- return /* @__PURE__ */ l(
16
+ return /* @__PURE__ */ m(
20
17
  "i",
21
18
  {
22
- className: m([
23
- S.icon,
24
- s,
25
- _,
26
- u(n)
19
+ className: l([
20
+ "Icon",
21
+ t,
22
+ N,
23
+ u(e)
27
24
  ]),
28
- ...N
25
+ ...x
29
26
  }
30
27
  );
31
28
  }
32
- function d(a) {
33
- const { className: t, children: o, ...c } = a;
34
- return /* @__PURE__ */ l(
29
+ function g(c) {
30
+ const { className: s, children: o, ...a } = c;
31
+ return /* @__PURE__ */ m(
35
32
  "span",
36
33
  {
37
- className: m([
38
- S.iconStack,
39
- t,
40
- u(c)
41
- ]),
42
- ...p(c),
34
+ className: l(["IconStack", s, u(a)]),
35
+ ...p(a),
43
36
  children: o
44
37
  }
45
38
  );
46
39
  }
47
- b.Stack = d;
40
+ d.Stack = g;
48
41
  export {
49
- b as Icon,
50
- d as IconStack
42
+ d as Icon,
43
+ g as IconStack
51
44
  };
@@ -1,5 +1,4 @@
1
1
  import { BoxProps } from './Box';
2
-
3
2
  type Props = Partial<{
4
3
  className: string;
5
4
  /** True is default, this fixes an ie thing */
@@ -1,15 +1,15 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import { useRef as f } from "react";
3
- import { computeBoxProps as a } from "./Box.js";
2
+ import { useRef as a } from "react";
3
+ import { computeBoxProps as f } from "./Box.js";
4
4
  const l = 5;
5
- function b(o) {
5
+ function E(o) {
6
6
  const {
7
7
  fixBlur: s = !0,
8
8
  fixErrors: m = !1,
9
9
  objectFit: n = "fill",
10
10
  src: e,
11
11
  ...c
12
- } = o, t = f(0), r = a(c);
12
+ } = o, t = a(0), r = f(c);
13
13
  return r.style = {
14
14
  ...r.style,
15
15
  "-ms-interpolation-mode": s ? "nearest-neighbor" : "auto",
@@ -26,10 +26,11 @@ function b(o) {
26
26
  }
27
27
  },
28
28
  src: e,
29
- ...r
29
+ ...r,
30
+ alt: "dm icon"
30
31
  }
31
32
  );
32
33
  }
33
34
  export {
34
- b as Image
35
+ E as Image
35
36
  };
@@ -2,7 +2,6 @@ import { Placement } from '@popperjs/core';
2
2
  import { ReactNode } from 'react';
3
3
  import { BooleanLike } from '../common/react';
4
4
  import { BoxProps } from './Box';
5
-
6
5
  type Props = Partial<{
7
6
  /** Asset cache. Example: `asset={['assetname32x32', thing.key]}` */
8
7
  asset: string[];
@@ -1,212 +1,129 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { classes as e } from "../common/react.js";
3
- import { computeBoxProps as D } from "./Box.js";
4
- import { DmIcon as F } from "./DmIcon.js";
5
- import { Icon as E } from "./Icon.js";
1
+ import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
+ import { classes as l } from "../common/react.js";
3
+ import { computeBoxProps as A } from "./Box.js";
4
+ import { DmIcon as D } from "./DmIcon.js";
5
+ import { Icon as F } from "./Icon.js";
6
6
  import { Image as j } from "./Image.js";
7
- import { Stack as I } from "./Stack.js";
7
+ import { Stack as y } from "./Stack.js";
8
8
  import { Tooltip as z } from "./Tooltip.js";
9
- import '../assets/ImageButton.css';const P = "_color__black_7gau9_18", q = "_contentColor__black_7gau9_29", M = "_buttonsContainerColor__black_7gau9_37", R = "_color__white_7gau9_45", T = "_contentColor__white_7gau9_56", G = "_buttonsContainerColor__white_7gau9_64", H = "_color__red_7gau9_72", J = "_contentColor__red_7gau9_83", K = "_buttonsContainerColor__red_7gau9_91", L = "_color__orange_7gau9_99", O = "_contentColor__orange_7gau9_110", Q = "_buttonsContainerColor__orange_7gau9_118", U = "_color__yellow_7gau9_126", V = "_contentColor__yellow_7gau9_137", W = "_buttonsContainerColor__yellow_7gau9_145", X = "_color__olive_7gau9_153", Y = "_contentColor__olive_7gau9_164", Z = "_buttonsContainerColor__olive_7gau9_172", oo = "_color__green_7gau9_180", to = "_contentColor__green_7gau9_191", _o = "_buttonsContainerColor__green_7gau9_199", no = "_color__teal_7gau9_207", eo = "_contentColor__teal_7gau9_218", ro = "_buttonsContainerColor__teal_7gau9_226", lo = "_color__blue_7gau9_234", ao = "_contentColor__blue_7gau9_245", co = "_buttonsContainerColor__blue_7gau9_253", so = "_color__violet_7gau9_261", io = "_contentColor__violet_7gau9_272", uo = "_buttonsContainerColor__violet_7gau9_280", Co = "_color__purple_7gau9_288", go = "_contentColor__purple_7gau9_299", bo = "_buttonsContainerColor__purple_7gau9_307", po = "_color__pink_7gau9_315", mo = "_contentColor__pink_7gau9_326", fo = "_buttonsContainerColor__pink_7gau9_334", ho = "_color__brown_7gau9_342", vo = "_contentColor__brown_7gau9_353", yo = "_buttonsContainerColor__brown_7gau9_361", wo = "_color__grey_7gau9_369", ko = "_contentColor__grey_7gau9_380", xo = "_buttonsContainerColor__grey_7gau9_388", Io = "_color__good_7gau9_423", $o = "_contentColor__good_7gau9_434", Ao = "_buttonsContainerColor__good_7gau9_442", Bo = "_color__average_7gau9_450", No = "_contentColor__average_7gau9_461", So = "_buttonsContainerColor__average_7gau9_469", Do = "_color__bad_7gau9_477", Fo = "_contentColor__bad_7gau9_488", Eo = "_buttonsContainerColor__bad_7gau9_496", jo = "_color__label_7gau9_504", zo = "_contentColor__label_7gau9_515", Po = "_buttonsContainerColor__label_7gau9_523", qo = "_color__default_7gau9_531", Mo = "_disabled_7gau9_542", Ro = "_selected_7gau9_547", To = "_contentColor__default_7gau9_558", Go = "_contentDisabled_7gau9_566", Ho = "_contentSelected_7gau9_571", Jo = "_buttonsContainerColor__default_7gau9_579", Ko = "_ImageButton_7gau9_587", Lo = "_noAction_7gau9_595", Oo = "_container_7gau9_598", Qo = "_image_7gau9_603", Uo = "_buttonsContainer_7gau9_37", Vo = "_buttonsAltContainer_7gau9_621", Wo = "_buttonsEmpty_7gau9_628", Xo = "_content_7gau9_29", Yo = "_fluid_7gau9_649", Zo = "_info_7gau9_661", ot = "_title_7gau9_667", tt = "_divider_7gau9_671", _t = "_contentFluid_7gau9_675", nt = "_hasButtons_7gau9_683", o = {
10
- color__black: P,
11
- contentColor__black: q,
12
- buttonsContainerColor__black: M,
13
- color__white: R,
14
- contentColor__white: T,
15
- buttonsContainerColor__white: G,
16
- color__red: H,
17
- contentColor__red: J,
18
- buttonsContainerColor__red: K,
19
- color__orange: L,
20
- contentColor__orange: O,
21
- buttonsContainerColor__orange: Q,
22
- color__yellow: U,
23
- contentColor__yellow: V,
24
- buttonsContainerColor__yellow: W,
25
- color__olive: X,
26
- contentColor__olive: Y,
27
- buttonsContainerColor__olive: Z,
28
- color__green: oo,
29
- contentColor__green: to,
30
- buttonsContainerColor__green: _o,
31
- color__teal: no,
32
- contentColor__teal: eo,
33
- buttonsContainerColor__teal: ro,
34
- color__blue: lo,
35
- contentColor__blue: ao,
36
- buttonsContainerColor__blue: co,
37
- color__violet: so,
38
- contentColor__violet: io,
39
- buttonsContainerColor__violet: uo,
40
- color__purple: Co,
41
- contentColor__purple: go,
42
- buttonsContainerColor__purple: bo,
43
- color__pink: po,
44
- contentColor__pink: mo,
45
- buttonsContainerColor__pink: fo,
46
- color__brown: ho,
47
- contentColor__brown: vo,
48
- buttonsContainerColor__brown: yo,
49
- color__grey: wo,
50
- contentColor__grey: ko,
51
- buttonsContainerColor__grey: xo,
52
- "color__light-grey": "_color__light-grey_7gau9_396",
53
- "contentColor__light-grey": "_contentColor__light-grey_7gau9_407",
54
- "buttonsContainerColor__light-grey": "_buttonsContainerColor__light-grey_7gau9_415",
55
- color__good: Io,
56
- contentColor__good: $o,
57
- buttonsContainerColor__good: Ao,
58
- color__average: Bo,
59
- contentColor__average: No,
60
- buttonsContainerColor__average: So,
61
- color__bad: Do,
62
- contentColor__bad: Fo,
63
- buttonsContainerColor__bad: Eo,
64
- color__label: jo,
65
- contentColor__label: zo,
66
- buttonsContainerColor__label: Po,
67
- color__default: qo,
68
- disabled: Mo,
69
- selected: Ro,
70
- contentColor__default: To,
71
- contentDisabled: Go,
72
- contentSelected: Ho,
73
- buttonsContainerColor__default: Jo,
74
- ImageButton: Ko,
75
- noAction: Lo,
76
- container: Oo,
77
- image: Qo,
78
- buttonsContainer: Uo,
79
- buttonsAltContainer: Vo,
80
- buttonsEmpty: Wo,
81
- content: Xo,
82
- fluid: Yo,
83
- info: Zo,
84
- title: ot,
85
- divider: tt,
86
- contentFluid: _t,
87
- hasButtons: nt
88
- };
89
- function Ct($) {
9
+ function H(N) {
90
10
  const {
91
- asset: p,
92
- base64: s,
93
- buttons: i,
94
- buttonsAlt: m,
95
- children: r,
96
- className: A,
97
- color: _,
11
+ asset: f,
12
+ base64: r,
13
+ buttons: m,
14
+ buttonsAlt: h,
15
+ children: i,
16
+ className: k,
17
+ color: e,
98
18
  disabled: a,
99
- dmFallback: f,
100
- dmIcon: h,
101
- dmIconState: v,
19
+ dmFallback: I,
20
+ dmIcon: b,
21
+ dmIconState: x,
102
22
  fluid: c,
103
- imageSize: n = 64,
104
- imageSrc: u,
105
- onClick: C,
106
- onRightClick: g,
107
- selected: y,
108
- title: w,
109
- tooltip: k,
110
- tooltipPosition: B,
111
- ...N
112
- } = $;
113
- function x(l, S) {
114
- return /* @__PURE__ */ t(I, { height: `${n}px`, width: `${n}px`, children: /* @__PURE__ */ t(I.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
115
- E,
23
+ imageSize: o = 64,
24
+ imageSrc: d,
25
+ onClick: s,
26
+ onRightClick: u,
27
+ selected: B,
28
+ title: C,
29
+ tooltip: _,
30
+ tooltipPosition: w,
31
+ ...v
32
+ } = N;
33
+ function $(n, S) {
34
+ return /* @__PURE__ */ t(y, { height: `${o}px`, width: `${o}px`, children: /* @__PURE__ */ t(y.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
35
+ F,
116
36
  {
117
37
  spin: S,
118
- name: l,
38
+ name: n,
119
39
  color: "gray",
120
- style: { fontSize: `calc(${n}px * 0.75)` }
40
+ style: { fontSize: `calc(${o}px * 0.75)` }
121
41
  }
122
42
  ) }) });
123
43
  }
124
- let b = /* @__PURE__ */ d(
44
+ let p = /* @__PURE__ */ g(
125
45
  "div",
126
46
  {
127
- className: e([
128
- o.container,
129
- i && o.hasButtons,
130
- !C && !g && o.noAction,
131
- y && o.selected,
132
- a && o.disabled,
133
- _ && typeof _ == "string" ? o["color__" + _] : o.color__default
47
+ className: l([
48
+ "container",
49
+ m && "hasButtons",
50
+ !s && !u && "noAction",
51
+ B && "ImageButton--selected",
52
+ a && "ImageButton--disabled",
53
+ e && typeof e == "string" ? `ImageButton--color__${e}` : "ImageButton--color__default"
134
54
  ]),
135
55
  tabIndex: a ? void 0 : 0,
136
- onClick: (l) => {
137
- !a && C && C(l);
56
+ onClick: (n) => {
57
+ !a && s && s(n);
58
+ },
59
+ onKeyDown: (n) => {
60
+ n.key === "Enter" && !a && s && s(n);
138
61
  },
139
- onContextMenu: (l) => {
140
- l.preventDefault(), !a && g && g(l);
62
+ onContextMenu: (n) => {
63
+ n.preventDefault(), !a && u && u(n);
141
64
  },
142
- style: { width: c ? "auto" : `calc(${n}px + 0.5em + 2px)` },
65
+ style: { width: c ? "auto" : `calc(${o}px + 0.5em + 2px)` },
143
66
  children: [
144
- /* @__PURE__ */ t("div", { className: e([o.image]), children: s || p || u ? /* @__PURE__ */ t(
67
+ /* @__PURE__ */ t("div", { className: "image", children: r || f || d ? /* @__PURE__ */ t(
145
68
  j,
146
69
  {
147
- className: e(!s && !u && p || []),
148
- src: s ? `data:image/png;base64,${s}` : u,
149
- height: `${n}px`,
150
- width: `${n}px`
70
+ className: l(!r && !d && f || []),
71
+ src: r ? `data:image/png;base64,${r}` : d,
72
+ height: `${o}px`,
73
+ width: `${o}px`
151
74
  }
152
- ) : h && v ? /* @__PURE__ */ t(
153
- F,
75
+ ) : b && x ? /* @__PURE__ */ t(
76
+ D,
154
77
  {
155
- icon: h,
156
- icon_state: v,
157
- fallback: f || x("spinner", !0),
158
- height: `${n}px`,
159
- width: `${n}px`
78
+ icon: b,
79
+ icon_state: x,
80
+ fallback: I || $("spinner", !0),
81
+ height: `${o}px`,
82
+ width: `${o}px`
160
83
  }
161
- ) : x("question", !1) }),
162
- c ? /* @__PURE__ */ d("div", { className: e([o.info]), children: [
163
- w && /* @__PURE__ */ t(
164
- "span",
165
- {
166
- className: e([o.title, r && o.divider]),
167
- children: w
168
- }
169
- ),
170
- r && /* @__PURE__ */ t("span", { className: e([o.contentFluid]), children: r })
171
- ] }) : r && /* @__PURE__ */ t(
84
+ ) : $("question", !1) }),
85
+ c ? /* @__PURE__ */ g("div", { className: "info", children: [
86
+ C && /* @__PURE__ */ t("span", { className: l(["title", i && "divider"]), children: C }),
87
+ i && /* @__PURE__ */ t("span", { className: "contentFluid", children: i })
88
+ ] }) : i && /* @__PURE__ */ t(
172
89
  "span",
173
90
  {
174
- className: e([
175
- o.content,
176
- y && o.contentSelected,
177
- a && o.contentDisabled,
178
- _ && typeof _ == "string" ? o["contentColor__" + _] : o.contentColor__default
91
+ className: l([
92
+ "content",
93
+ B && "ImageButton--contentSelected",
94
+ a && "ImageButton--contentDisabled",
95
+ e && typeof e == "string" ? `ImageButton--contentColor__${e}` : "ImageButton--contentColor__default"
179
96
  ]),
180
- children: r
97
+ children: i
181
98
  }
182
99
  )
183
100
  ]
184
101
  }
185
102
  );
186
- return k && (b = /* @__PURE__ */ t(z, { content: k, position: B, children: b })), /* @__PURE__ */ d(
103
+ return _ && (p = /* @__PURE__ */ t(z, { content: _, position: w, children: p })), /* @__PURE__ */ g(
187
104
  "div",
188
105
  {
189
- className: e([
190
- o.ImageButton,
191
- c && o.fluid,
192
- A
106
+ className: l([
107
+ "ImageButton",
108
+ c && "ImageButton--fluid",
109
+ k
193
110
  ]),
194
- ...D(N),
111
+ ...A(v),
195
112
  children: [
196
- b,
197
- i && /* @__PURE__ */ t(
113
+ p,
114
+ m && /* @__PURE__ */ t(
198
115
  "div",
199
116
  {
200
- className: e([
201
- o.buttonsContainer,
202
- m && o.buttonsAltContainer,
203
- !r && o.buttonsEmpty,
204
- c && _ && typeof _ == "string" ? o["buttonsContainerColor__" + _] : c && o.buttonsContainerColor__default
117
+ className: l([
118
+ "buttonsContainer",
119
+ h && "buttonsAltContainer",
120
+ !i && "buttonsEmpty",
121
+ c && e && typeof e == "string" ? `ImageButton--buttonsContainerColor__${e}` : c && "ImageButton--buttonsContainerColor__default"
205
122
  ]),
206
123
  style: {
207
- width: m ? `calc(${n}px + 0.5em)` : "auto"
124
+ width: h ? `calc(${o}px + 0.5em)` : "auto"
208
125
  },
209
- children: i
126
+ children: m
210
127
  }
211
128
  )
212
129
  ]
@@ -214,5 +131,5 @@ function Ct($) {
214
131
  );
215
132
  }
216
133
  export {
217
- Ct as ImageButton
134
+ H as ImageButton
218
135
  };
@@ -24,7 +24,7 @@ class k extends v {
24
24
  }
25
25
  doOffsetMouse(e) {
26
26
  const { zoom: o } = this.state;
27
- e.screenZoomX = e.screenX * Math.pow(o, -1), e.screenZoomY = e.screenY * Math.pow(o, -1);
27
+ e.screenZoomX = e.screenX * o ** -1, e.screenZoomY = e.screenY * o ** -1;
28
28
  }
29
29
  handleMouseDown(e) {
30
30
  this.setState((o) => ({
@@ -1,6 +1,5 @@
1
1
  import { SyntheticEvent } from 'react';
2
2
  import { BoxProps } from './Box';
3
-
4
3
  type ConditionalProps = {
5
4
  /**
6
5
  * Mark this if you want to debounce onInput.