tgui-core 1.8.3 → 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 (83) hide show
  1. package/dist/common/constants.d.ts +4 -0
  2. package/dist/common/constants.js +17 -0
  3. package/dist/common/hotkeys.js +48 -48
  4. package/dist/common/ui.d.ts +6 -0
  5. package/dist/common/ui.js +63 -59
  6. package/dist/components/AnimatedNumber.d.ts +1 -1
  7. package/dist/components/Button.d.ts +3 -3
  8. package/dist/components/Button.js +21 -22
  9. package/dist/components/Chart.d.ts +3 -15
  10. package/dist/components/Chart.js +68 -86
  11. package/dist/components/ColorBox.js +3 -3
  12. package/dist/components/Dialog.d.ts +16 -0
  13. package/dist/components/Dialog.js +5 -5
  14. package/dist/components/DmIcon.d.ts +1 -1
  15. package/dist/components/DraggableControl.d.ts +56 -0
  16. package/dist/components/DraggableControl.js +126 -176
  17. package/dist/components/Dropdown.d.ts +5 -5
  18. package/dist/components/Dropdown.js +135 -132
  19. package/dist/components/FitText.d.ts +1 -1
  20. package/dist/components/Flex.js +24 -26
  21. package/dist/components/Floating.d.ts +75 -0
  22. package/dist/components/Floating.js +2235 -0
  23. package/dist/components/ImageButton.d.ts +2 -3
  24. package/dist/components/ImageButton.js +88 -98
  25. package/dist/components/InfinitePlane.d.ts +35 -32
  26. package/dist/components/InfinitePlane.js +123 -133
  27. package/dist/components/Knob.d.ts +22 -6
  28. package/dist/components/Knob.js +45 -46
  29. package/dist/components/MenuBar.js +81 -97
  30. package/dist/components/Modal.js +12 -12
  31. package/dist/components/NumberInput.d.ts +1 -1
  32. package/dist/components/Popper.d.ts +5 -1
  33. package/dist/components/Popper.js +1026 -121
  34. package/dist/components/ProgressBar.js +3 -3
  35. package/dist/components/RoundGauge.js +30 -30
  36. package/dist/components/Section.js +7 -7
  37. package/dist/components/Slider.d.ts +22 -6
  38. package/dist/components/Slider.js +55 -56
  39. package/dist/components/Stack.js +3 -3
  40. package/dist/components/Table.js +7 -7
  41. package/dist/components/Tabs.js +7 -7
  42. package/dist/components/TextArea.d.ts +17 -0
  43. package/dist/components/TextArea.js +35 -33
  44. package/dist/components/Tooltip.d.ts +3 -34
  45. package/dist/components/Tooltip.js +14 -77
  46. package/dist/components/TrackOutsideClicks.d.ts +1 -1
  47. package/dist/components/index.d.ts +1 -0
  48. package/dist/components/index.js +64 -62
  49. package/package.json +26 -27
  50. package/styles/base.scss +13 -11
  51. package/styles/colors.scss +63 -67
  52. package/styles/components/BlockQuote.scss +5 -8
  53. package/styles/components/Button.scss +123 -99
  54. package/styles/components/Dialog.scss +23 -30
  55. package/styles/components/Dimmer.scss +3 -8
  56. package/styles/components/Divider.scss +6 -7
  57. package/styles/components/Dropdown.scss +97 -52
  58. package/styles/components/Flex.scss +0 -1
  59. package/styles/components/Floating.scss +60 -0
  60. package/styles/components/ImageButton.scss +136 -192
  61. package/styles/components/Input.scss +24 -26
  62. package/styles/components/Knob.scss +37 -41
  63. package/styles/components/LabeledList.scss +8 -6
  64. package/styles/components/MenuBar.scss +17 -21
  65. package/styles/components/Modal.scss +8 -7
  66. package/styles/components/NoticeBox.scss +22 -26
  67. package/styles/components/NumberInput.scss +30 -28
  68. package/styles/components/ProgressBar.scss +27 -19
  69. package/styles/components/RoundGauge.scss +46 -26
  70. package/styles/components/Section.scss +17 -32
  71. package/styles/components/Slider.scss +18 -15
  72. package/styles/components/Stack.scss +8 -48
  73. package/styles/components/Table.scss +2 -2
  74. package/styles/components/Tabs.scss +92 -66
  75. package/styles/components/TextArea.scss +32 -36
  76. package/styles/components/Tooltip.scss +10 -13
  77. package/styles/functions.scss +1 -62
  78. package/styles/main.scss +6 -1
  79. package/styles/reset.scss +7 -11
  80. package/styles/vars-colors.scss +108 -0
  81. package/styles/vars-components.scss +162 -0
  82. package/styles/vars-values.scss +110 -0
  83. package/dist/popper-CiqSDJTE.js +0 -906
@@ -99,4 +99,8 @@ export declare function getGasLabel(gasId: string, fallbackValue?: string): stri
99
99
  export declare function getGasColor(gasId: string): string;
100
100
  export declare const getGasFromId: (gasId: string) => Gas | undefined;
101
101
  export declare const getGasFromPath: (gasPath: string) => Gas | undefined;
102
+ export declare const COMPONENT_COLORS: {
103
+ readonly states: readonly ["", "good", "average", "bad", "black", "white"];
104
+ readonly spectrum: readonly ["red", "orange", "yellow", "olive", "green", "teal", "blue", "violet", "purple", "pink", "brown", "grey"];
105
+ };
102
106
  export {};
@@ -296,9 +296,26 @@ const g = (a) => {
296
296
  if (e[o].path === a)
297
297
  return e[o];
298
298
  }
299
+ }, f = {
300
+ states: ["", "good", "average", "bad", "black", "white"],
301
+ spectrum: [
302
+ "red",
303
+ "orange",
304
+ "yellow",
305
+ "olive",
306
+ "green",
307
+ "teal",
308
+ "blue",
309
+ "violet",
310
+ "purple",
311
+ "pink",
312
+ "brown",
313
+ "grey"
314
+ ]
299
315
  };
300
316
  export {
301
317
  c as COLORS,
318
+ f as COMPONENT_COLORS,
302
319
  u as CSS_COLORS,
303
320
  d as RADIO_CHANNELS,
304
321
  m as UI_CLOSE,
@@ -1,19 +1,19 @@
1
- import { globalEvents as l } from "./events.js";
2
- import { KEY_ESCAPE as K, KEY_ENTER as E, KEY_SPACE as p, KEY_TAB as h, KEY_CTRL as d, KEY_SHIFT as g, KEY_UP as S, KEY_DOWN as Y, KEY_LEFT as _, KEY_RIGHT as B, KEY_F5 as w } from "./keycodes.js";
3
- const m = {}, c = [
4
- K,
5
- E,
6
- p,
1
+ import { globalEvents as a } from "./events.js";
2
+ import { KEY_ESCAPE as m, KEY_ENTER as h, KEY_SPACE as p, KEY_TAB as E, KEY_CTRL as d, KEY_SHIFT as g, KEY_UP as B, KEY_DOWN as T, KEY_LEFT as b, KEY_RIGHT as S, KEY_F5 as Y } from "./keycodes.js";
3
+ const K = {}, c = [
4
+ m,
7
5
  h,
6
+ p,
7
+ E,
8
8
  d,
9
9
  g,
10
- S,
11
- Y,
12
- _,
13
10
  B,
14
- w
15
- ], o = {}, u = [];
16
- function F(n) {
11
+ T,
12
+ b,
13
+ S,
14
+ Y
15
+ ], i = {}, u = [];
16
+ function _(n) {
17
17
  if (n === 16) return "Shift";
18
18
  if (n === 17) return "Ctrl";
19
19
  if (n === 18) return "Alt";
@@ -37,7 +37,7 @@ function F(n) {
37
37
  if (n === 189) return "-";
38
38
  if (n === 190) return ".";
39
39
  }
40
- function N(n) {
40
+ function y(n) {
41
41
  const t = String(n);
42
42
  if (t === "Ctrl+F5" || t === "Ctrl+R") {
43
43
  location.reload();
@@ -45,58 +45,58 @@ function N(n) {
45
45
  }
46
46
  if (t === "Ctrl+F" || n.event.defaultPrevented || n.isModifierKey() || c.includes(n.code))
47
47
  return;
48
- const i = F(n.code);
49
- if (!i)
48
+ const o = _(n.code);
49
+ if (!o)
50
50
  return;
51
- const f = m[i];
52
- if (f)
53
- return Byond.command(f);
54
- if (n.isDown() && !o[i]) {
55
- o[i] = !0;
56
- const r = `KeyDown "${i}"`;
51
+ const s = K[o];
52
+ if (s)
53
+ return Byond.command(s);
54
+ if (n.isDown() && !i[o]) {
55
+ i[o] = !0;
56
+ const r = `${globalThis.ByondKeyDown} "${o}"`;
57
57
  return Byond.command(r);
58
58
  }
59
- if (n.isUp() && o[i]) {
60
- o[i] = !1;
61
- const r = `KeyUp "${i}"`;
59
+ if (n.isUp() && i[o]) {
60
+ i[o] = !1;
61
+ const r = `${globalThis.ByondKeyUp} "${o}"`;
62
62
  return Byond.command(r);
63
63
  }
64
64
  }
65
- function P(n) {
65
+ function N(n) {
66
66
  c.push(n);
67
67
  }
68
- function R(n) {
68
+ function U(n) {
69
69
  const t = c.indexOf(n);
70
70
  t >= 0 && c.splice(t, 1);
71
71
  }
72
- function T() {
73
- for (const n in o)
74
- o[n] && (o[n] = !1, Byond.command(`KeyUp "${n}"`));
72
+ function w() {
73
+ for (const n in i)
74
+ i[n] && (i[n] = !1, Byond.command(`${globalThis.ByondKeyUp} "${n}"`));
75
75
  }
76
- function v() {
77
- Byond.winget("default.*").then((n) => {
76
+ function D() {
77
+ globalThis.ByondKeyUp || (globalThis.ByondKeyUp = "KeyUp", globalThis.ByondKeyDown = "KeyDown"), Byond.winget("default.*").then((n) => {
78
78
  const t = {};
79
79
  for (const r in n) {
80
- const s = r.split("."), e = s[1], a = s[2];
81
- e && a && (t[e] || (t[e] = {}), t[e][a] = n[r]);
80
+ const f = r.split("."), e = f[1], l = f[2];
81
+ e && l && (t[e] || (t[e] = {}), t[e][l] = n[r]);
82
82
  }
83
- const i = /\\"/g;
84
- function f(r) {
85
- return r.substring(1, r.length - 1).replace(i, '"');
83
+ const o = /\\"/g;
84
+ function s(r) {
85
+ return r.substring(1, r.length - 1).replace(o, '"');
86
86
  }
87
87
  for (const r in t) {
88
- const s = t[r], e = f(s.name);
89
- m[e] = f(s.command);
88
+ const f = t[r], e = s(f.name);
89
+ K[e] = s(f.command);
90
90
  }
91
- }), l.on("window-blur", () => {
92
- T();
93
- }), l.on("key", (n) => {
91
+ }), a.on("window-blur", () => {
92
+ w();
93
+ }), a.on("key", (n) => {
94
94
  for (const t of u)
95
95
  t(n);
96
- N(n);
96
+ y(n);
97
97
  });
98
98
  }
99
- function x(n) {
99
+ function H(n) {
100
100
  u.push(n);
101
101
  let t = !1;
102
102
  return () => {
@@ -104,9 +104,9 @@ function x(n) {
104
104
  };
105
105
  }
106
106
  export {
107
- P as acquireHotKey,
108
- x as listenForKeyEvents,
109
- T as releaseHeldKeys,
110
- R as releaseHotKey,
111
- v as setupHotKeys
107
+ N as acquireHotKey,
108
+ H as listenForKeyEvents,
109
+ w as releaseHeldKeys,
110
+ U as releaseHotKey,
111
+ D as setupHotKeys
112
112
  };
@@ -46,6 +46,12 @@ export type StringStyleMap = {
46
46
  right: string | BooleanLike;
47
47
  /** Top margin. */
48
48
  top: string | BooleanLike;
49
+ /** Gap on all sides. */
50
+ g: string | BooleanLike;
51
+ /** Row gap. */
52
+ gr: string | BooleanLike;
53
+ /** Column gap. */
54
+ gc: string | BooleanLike;
49
55
  /** Overflow property. */
50
56
  overflow: string | BooleanLike;
51
57
  /** Overflow-X property. */
package/dist/common/ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { CSS_COLORS as u } from "./constants.js";
1
+ import { CSS_COLORS as b } from "./constants.js";
2
2
  import { classes as y } from "./react.js";
3
3
  const f = (o) => {
4
4
  if (typeof o == "string")
5
5
  return o.endsWith("px") ? `${Number.parseFloat(o) / 12}rem` : o;
6
6
  if (typeof o == "number")
7
7
  return `${o}rem`;
8
- }, p = (o) => {
8
+ }, e = (o) => {
9
9
  if (typeof o == "string")
10
10
  return f(o);
11
11
  if (typeof o == "number")
@@ -15,76 +15,80 @@ function w(o) {
15
15
  return !h(o);
16
16
  }
17
17
  function h(o) {
18
- return typeof o == "string" && u.includes(o);
18
+ return typeof o == "string" && b.includes(o);
19
19
  }
20
- const c = (o) => (t, i) => {
21
- (typeof i == "number" || typeof i == "string") && (t[o] = i);
22
- }, n = (o, t) => (i, e) => {
23
- (typeof e == "number" || typeof e == "string") && (i[o] = t(e));
24
- }, l = (o, t) => (i, e) => {
25
- e && (i[o] = t);
26
- }, s = (o, t, i) => (e, r) => {
27
- if (typeof r == "number" || typeof r == "string")
28
- for (let m = 0; m < i.length; m++)
29
- e[o + i[m]] = t(r);
30
- }, a = (o) => (t, i) => {
31
- w(i) && (t[o] = i);
20
+ const c = (o) => (t, n) => {
21
+ (typeof n == "number" || typeof n == "string") && (t[o] = n);
22
+ }, i = (o, t) => (n, r) => {
23
+ (typeof r == "number" || typeof r == "string") && (n[o] = t(r));
24
+ }, l = (o, t) => (n, r) => {
25
+ r && (n[o] = t);
26
+ }, g = (o, t, n) => (r, p) => {
27
+ if (typeof p == "number" || typeof p == "string")
28
+ for (let m = 0; m < n.length; m++)
29
+ r[o + n[m]] = t(p);
30
+ }, a = (o) => (t, n) => {
31
+ w(n) && (t[o] = n);
32
32
  }, d = {
33
33
  align: c("textAlign"),
34
- bottom: n("bottom", f),
34
+ bottom: i("bottom", f),
35
35
  fontFamily: c("fontFamily"),
36
- fontSize: n("fontSize", f),
36
+ fontSize: i("fontSize", f),
37
37
  fontWeight: c("fontWeight"),
38
- height: n("height", f),
39
- left: n("left", f),
40
- maxHeight: n("maxHeight", f),
41
- maxWidth: n("maxWidth", f),
42
- minHeight: n("minHeight", f),
43
- minWidth: n("minWidth", f),
38
+ height: i("height", f),
39
+ left: i("left", f),
40
+ maxHeight: i("maxHeight", f),
41
+ maxWidth: i("maxWidth", f),
42
+ minHeight: i("minHeight", f),
43
+ minWidth: i("minWidth", f),
44
44
  opacity: c("opacity"),
45
45
  overflow: c("overflow"),
46
46
  overflowX: c("overflowX"),
47
47
  overflowY: c("overflowY"),
48
48
  position: c("position"),
49
- right: n("right", f),
49
+ right: i("right", f),
50
50
  textAlign: c("textAlign"),
51
- top: n("top", f),
51
+ top: i("top", f),
52
52
  verticalAlign: c("verticalAlign"),
53
- width: n("width", f),
53
+ width: i("width", f),
54
54
  lineHeight: (o, t) => {
55
55
  typeof t == "number" ? o.lineHeight = t : typeof t == "string" && (o.lineHeight = f(t));
56
56
  },
57
57
  // Margin
58
- m: s("margin", p, [
58
+ m: g("margin", e, [
59
59
  "Top",
60
60
  "Bottom",
61
61
  "Left",
62
62
  "Right"
63
63
  ]),
64
- mb: n("marginBottom", p),
65
- ml: n("marginLeft", p),
66
- mr: n("marginRight", p),
67
- mt: n("marginTop", p),
68
- mx: s("margin", p, ["Left", "Right"]),
69
- my: s("margin", p, ["Top", "Bottom"]),
64
+ mb: i("marginBottom", e),
65
+ ml: i("marginLeft", e),
66
+ mr: i("marginRight", e),
67
+ mt: i("marginTop", e),
68
+ mx: g("margin", e, ["Left", "Right"]),
69
+ my: g("margin", e, ["Top", "Bottom"]),
70
+ // Gap
71
+ g: i("gap", e),
72
+ gr: i("rowGap", e),
73
+ gc: i("columnGap", e),
70
74
  // Padding
71
- p: s("padding", p, [
75
+ p: g("padding", e, [
72
76
  "Top",
73
77
  "Bottom",
74
78
  "Left",
75
79
  "Right"
76
80
  ]),
77
- pb: n("paddingBottom", p),
78
- pl: n("paddingLeft", p),
79
- pr: n("paddingRight", p),
80
- pt: n("paddingTop", p),
81
- px: s("padding", p, ["Left", "Right"]),
82
- py: s("padding", p, ["Top", "Bottom"]),
81
+ pb: i("paddingBottom", e),
82
+ pl: i("paddingLeft", e),
83
+ pr: i("paddingRight", e),
84
+ pt: i("paddingTop", e),
85
+ px: g("padding", e, ["Left", "Right"]),
86
+ py: g("padding", e, ["Top", "Bottom"]),
83
87
  // Color props
84
88
  color: a("color"),
85
89
  textColor: a("color"),
86
90
  backgroundColor: a("backgroundColor")
87
- }, b = {
91
+ }, u = {
88
92
  bold: l("fontWeight", "bold"),
89
93
  fillPositionedParent: (o, t) => {
90
94
  t && (o.position = "absolute", o.top = 0, o.bottom = 0, o.left = 0, o.right = 0);
@@ -95,43 +99,43 @@ const c = (o) => (t, i) => {
95
99
  preserveWhitespace: l("whiteSpace", "pre-wrap")
96
100
  };
97
101
  function T(o) {
98
- const t = {}, i = {};
99
- for (const e in o) {
100
- if (e === "style")
102
+ const t = {}, n = {};
103
+ for (const r in o) {
104
+ if (r === "style")
101
105
  continue;
102
- const r = o[e], m = d[e] || b[e];
103
- m ? m(i, r) : t[e] = r;
106
+ const p = o[r], m = d[r] || u[r];
107
+ m ? m(n, p) : t[r] = p;
104
108
  }
105
- return t.style = { ...i, ...o.style }, t;
109
+ return t.style = { ...n, ...o.style }, t;
106
110
  }
107
111
  function S(o) {
108
- const t = o.textColor || o.color, { backgroundColor: i } = o;
112
+ const t = o.textColor || o.color, { backgroundColor: n } = o;
109
113
  return y([
110
114
  h(t) && `color-${t}`,
111
- h(i) && `color-bg-${i}`
115
+ h(n) && `color-bg-${n}`
112
116
  ]);
113
117
  }
114
118
  function P(o) {
115
119
  const t = {};
116
120
  if (!o) return t;
117
- const i = o.split(" ");
118
- for (const e of i) {
119
- const [r, m] = e.split("-");
120
- if (r)
121
- if (r in d) {
121
+ const n = o.split(" ");
122
+ for (const r of n) {
123
+ const [p, m] = r.split("-");
124
+ if (p)
125
+ if (p in d) {
122
126
  if (m === "") continue;
123
- const g = Number(m);
124
- !Number.isNaN(g) && Number.isFinite(g) ? t[r] = g : t[r] = m;
125
- } else r in b ? t[r] = !0 : console.warn(`Unknown prop ${r}`);
127
+ const s = Number(m);
128
+ !Number.isNaN(s) && Number.isFinite(s) ? t[p] = s : t[p] = m;
129
+ } else p in u ? t[p] = !0 : console.warn(`Unknown prop ${p}`);
126
130
  }
127
131
  return t;
128
132
  }
129
133
  export {
130
- b as booleanStyleMap,
134
+ u as booleanStyleMap,
131
135
  S as computeBoxClassName,
132
136
  T as computeBoxProps,
133
137
  P as computeTwClass,
134
- p as halfUnit,
138
+ e as halfUnit,
135
139
  d as stringStyleMap,
136
140
  f as unit
137
141
  };
@@ -26,7 +26,7 @@ export declare class AnimatedNumber extends Component<Props> {
26
26
  /**
27
27
  * The inner `<span/>` being updated sixty times per second.
28
28
  */
29
- ref: import('react').RefObject<HTMLSpanElement>;
29
+ ref: import('react').RefObject<HTMLSpanElement | null>;
30
30
  /**
31
31
  * The interval being used to update the inner span.
32
32
  */
@@ -1,4 +1,4 @@
1
- import { Placement } from '@popperjs/core';
1
+ import { Placement } from '@floating-ui/react';
2
2
  import { ReactNode } from 'react';
3
3
  import { BooleanLike } from '../common/react';
4
4
  import { BoxProps } from './Box';
@@ -27,7 +27,7 @@ type Props = Partial<{
27
27
  circular: boolean;
28
28
  /** Reduces the padding of the button */
29
29
  compact: boolean;
30
- /** Disables and greys out the button */
30
+ /** Disables button and makes it semi-transparent */
31
31
  disabled: BooleanLike;
32
32
  /** Fill all available horizontal space */
33
33
  fluid: boolean;
@@ -51,7 +51,7 @@ type Props = Partial<{
51
51
  selected: BooleanLike;
52
52
  /** A fancy, boxy tooltip, which appears when hovering over the button */
53
53
  tooltip: ReactNode;
54
- /** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
54
+ /** Position of the tooltip. Does not guarantee the position is respected. */
55
55
  tooltipPosition: Placement;
56
56
  /** Align content vertically using flex. Use lineHeight if the height is static. */
57
57
  verticalAlignContent: string;
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as _, Fragment as K } from "react/jsx-runtime";
2
2
  import { useState as A, createRef as V, useEffect as $, useRef as z } from "react";
3
- import { KEY as D, isEscape as E } from "../common/keys.js";
4
- import { classes as F } from "../common/react.js";
5
- import { computeBoxClassName as j, computeBoxProps as q } from "../common/ui.js";
3
+ import { KEY as F, isEscape as E } from "../common/keys.js";
4
+ import { classes as P } from "../common/react.js";
5
+ import { computeBoxProps as j, computeBoxClassName as q } from "../common/ui.js";
6
6
  import { Box as O } from "./Box.js";
7
7
  import { Icon as S } from "./Icon.js";
8
8
  import { Tooltip as v } from "./Tooltip.js";
@@ -23,31 +23,32 @@ function R(e) {
23
23
  iconPosition: y,
24
24
  iconRotation: k,
25
25
  iconSize: m,
26
- iconSpin: P,
26
+ iconSpin: w,
27
27
  onClick: f,
28
28
  selected: g,
29
29
  tooltip: I,
30
- tooltipPosition: w,
30
+ tooltipPosition: D,
31
31
  verticalAlignContent: x,
32
32
  ...N
33
33
  } = e, n = C || a;
34
34
  let b = /* @__PURE__ */ r(
35
35
  "div",
36
36
  {
37
- className: F([
37
+ className: P([
38
38
  "Button",
39
39
  l && "Button--fluid",
40
40
  t && "Button--disabled",
41
41
  g && "Button--selected",
42
42
  h && "Button--circular",
43
43
  B && "Button--compact",
44
- y && `Button--iconPosition--${y}`,
44
+ !n && "Button--empty",
45
+ y && `Button--icon-${y}`,
45
46
  x && "Button--flex",
46
47
  x && l && "Button--flex--fluid",
47
48
  x && `Button--verticalAlignContent--${x}`,
48
49
  c && typeof c == "string" ? `Button--color--${c}` : "Button--color--default",
49
50
  d,
50
- j(N)
51
+ q(N)
51
52
  ]),
52
53
  tabIndex: t ? void 0 : 0,
53
54
  onClick: (p) => {
@@ -55,18 +56,18 @@ function R(e) {
55
56
  },
56
57
  onKeyDown: (p) => {
57
58
  if (u) {
58
- if (p.key === D.Space || p.key === D.Enter) {
59
+ if (p.key === F.Space || p.key === F.Enter) {
59
60
  p.preventDefault(), !t && f && f(p);
60
61
  return;
61
62
  }
62
63
  E(p.key) && p.preventDefault();
63
64
  }
64
65
  },
65
- ...q(N),
66
+ ...j(N),
66
67
  children: /* @__PURE__ */ _(
67
68
  "div",
68
69
  {
69
- className: F([
70
+ className: P([
70
71
  "Button__content",
71
72
  o && "Button__content--ellipsis"
72
73
  ]),
@@ -74,24 +75,22 @@ function R(e) {
74
75
  i && y !== "right" && /* @__PURE__ */ r(
75
76
  S,
76
77
  {
77
- mr: n && 0.5,
78
78
  name: i,
79
79
  color: s,
80
80
  rotation: k,
81
81
  size: m,
82
- spin: P
82
+ spin: w
83
83
  }
84
84
  ),
85
85
  o ? /* @__PURE__ */ r("span", { className: "Button--ellipsis", children: n }) : n,
86
86
  i && y === "right" && /* @__PURE__ */ r(
87
87
  S,
88
88
  {
89
- ml: n && 0.5,
90
89
  name: i,
91
90
  color: s,
92
91
  rotation: k,
93
92
  size: m,
94
- spin: P
93
+ spin: w
95
94
  }
96
95
  )
97
96
  ]
@@ -99,7 +98,7 @@ function R(e) {
99
98
  )
100
99
  }
101
100
  );
102
- return I && (b = /* @__PURE__ */ r(v, { content: I, position: w, children: b })), b;
101
+ return I && (b = /* @__PURE__ */ r(v, { content: I, position: D, children: b })), b;
103
102
  }
104
103
  function T(e) {
105
104
  const { checked: u, ...a } = e;
@@ -165,8 +164,8 @@ function Y(e) {
165
164
  placeholder: y,
166
165
  tooltip: k,
167
166
  tooltipPosition: m,
168
- ...P
169
- } = e, [f, g] = A(!1), I = V(), w = h || u;
167
+ ...w
168
+ } = e, [f, g] = A(!1), I = V(), D = h || u;
170
169
  function x(n) {
171
170
  const b = I.current;
172
171
  if (!b) return;
@@ -185,17 +184,17 @@ function Y(e) {
185
184
  let N = /* @__PURE__ */ _(
186
185
  O,
187
186
  {
188
- className: F([
187
+ className: P([
189
188
  "Button",
190
189
  C && "Button--fluid",
191
190
  B && "Button--disabled",
192
191
  `Button--color--${a}`
193
192
  ]),
194
- ...P,
193
+ ...w,
195
194
  onClick: () => g(!0),
196
195
  children: [
197
196
  t && /* @__PURE__ */ r(S, { name: t, rotation: o, spin: l }),
198
- /* @__PURE__ */ r("div", { children: w }),
197
+ /* @__PURE__ */ r("div", { children: D }),
199
198
  /* @__PURE__ */ r(
200
199
  "input",
201
200
  {
@@ -210,7 +209,7 @@ function Y(e) {
210
209
  f && (g(!1), x(n));
211
210
  },
212
211
  onKeyDown: (n) => {
213
- if (n.key === D.Enter) {
212
+ if (n.key === F.Enter) {
214
213
  g(!1), x(n);
215
214
  return;
216
215
  }
@@ -1,4 +1,3 @@
1
- import { Component, RefObject } from 'react';
2
1
  import { BoxProps } from './Box';
3
2
  type Props = {
4
3
  data: number[][];
@@ -9,19 +8,8 @@ type Props = {
9
8
  strokeColor: string;
10
9
  strokeWidth: number;
11
10
  }> & BoxProps;
12
- type State = {
13
- viewBox: [number, number];
14
- };
15
- declare class LineChart extends Component<Props> {
16
- ref: RefObject<HTMLDivElement>;
17
- state: State;
18
- constructor(props: Props);
19
- componentDidMount(): void;
20
- componentWillUnmount(): void;
21
- handleResize: () => void;
22
- render(): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Chart(props: Props): import("react/jsx-runtime").JSX.Element;
12
+ export declare namespace Chart {
13
+ var Line: typeof Chart;
23
14
  }
24
- export declare const Chart: {
25
- Line: typeof LineChart;
26
- };
27
15
  export {};