tgui-core 1.0.13 → 1.0.15

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.
@@ -1,61 +1,59 @@
1
1
  import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
- import { classes as i, canRender as d } from "../common/react.js";
3
- import { computeBoxClassName as b, computeBoxProps as x } from "./Box.js";
4
- import { Icon as h } from "./Icon.js";
5
- import '../assets/Tabs.css';const m = "_tabs_3dx9a_13", v = "_fill_3dx9a_20", p = "_section_3dx9a_24", u = "_vertical_3dx9a_35", w = "_horizontal_3dx9a_40", y = "_tabs__tab_3dx9a_48", N = "_fluid_3dx9a_52", k = "_tab_3dx9a_13", z = "_selected_3dx9a_66", T = "_tab__text_3dx9a_75", j = "_tab__left_3dx9a_80", B = "_tab__right_3dx9a_86", S = "_color__black_3dx9a_113", C = "_color__white_3dx9a_125", I = "_color__red_3dx9a_137", P = "_color__orange_3dx9a_149", R = "_color__yellow_3dx9a_161", q = "_color__olive_3dx9a_173", A = "_color__green_3dx9a_185", D = "_color__teal_3dx9a_197", E = "_color__blue_3dx9a_209", F = "_color__violet_3dx9a_221", G = "_color__purple_3dx9a_233", H = "_color__pink_3dx9a_245", J = "_color__brown_3dx9a_257", K = "_color__grey_3dx9a_269", L = "_color__good_3dx9a_293", M = "_color__average_3dx9a_305", O = "_color__bad_3dx9a_317", Q = "_color__label_3dx9a_329", _ = {
6
- tabs: m,
7
- fill: v,
8
- section: p,
9
- "section--fitted": "_section--fitted_3dx9a_28",
2
+ import { classes as h, canRender as i } from "../common/react.js";
3
+ import { computeBoxClassName as b, computeBoxProps as d } from "./Box.js";
4
+ import { Icon as m } from "./Icon.js";
5
+ import '../assets/Tabs.css';const v = "_tabs_9h380_13", p = "_fill_9h380_20", u = "_vertical_9h380_35", w = "_horizontal_9h380_40", x = "_tabs__tab_9h380_48", y = "_fluid_9h380_52", N = "_tab_9h380_13", k = "_selected_9h380_66", z = "_tab__text_9h380_75", T = "_tab__left_9h380_80", j = "_tab__right_9h380_86", B = "_color__black_9h380_113", S = "_color__white_9h380_125", C = "_color__red_9h380_137", I = "_color__orange_9h380_149", P = "_color__yellow_9h380_161", R = "_color__olive_9h380_173", q = "_color__green_9h380_185", A = "_color__teal_9h380_197", D = "_color__blue_9h380_209", E = "_color__violet_9h380_221", F = "_color__purple_9h380_233", G = "_color__pink_9h380_245", H = "_color__brown_9h380_257", J = "_color__grey_9h380_269", K = "_color__good_9h380_293", L = "_color__average_9h380_305", M = "_color__bad_9h380_317", O = "_color__label_9h380_329", _ = {
6
+ tabs: v,
7
+ fill: p,
10
8
  vertical: u,
11
9
  horizontal: w,
12
- tabs__tab: y,
13
- fluid: N,
14
- tab: k,
15
- selected: z,
16
- tab__text: T,
17
- tab__left: j,
18
- tab__right: B,
19
- color__black: S,
20
- color__white: C,
21
- color__red: I,
22
- color__orange: P,
23
- color__yellow: R,
24
- color__olive: q,
25
- color__green: A,
26
- color__teal: D,
27
- color__blue: E,
28
- color__violet: F,
29
- color__purple: G,
30
- color__pink: H,
31
- color__brown: J,
32
- color__grey: K,
33
- "color__light-grey": "_color__light-grey_3dx9a_281",
34
- color__good: L,
35
- color__average: M,
36
- color__bad: O,
37
- color__label: Q
38
- }, U = (r) => {
39
- const { className: a, vertical: e, fill: s, fluid: c, children: t, ...l } = r;
10
+ tabs__tab: x,
11
+ fluid: y,
12
+ tab: N,
13
+ selected: k,
14
+ tab__text: z,
15
+ tab__left: T,
16
+ tab__right: j,
17
+ color__black: B,
18
+ color__white: S,
19
+ color__red: C,
20
+ color__orange: I,
21
+ color__yellow: P,
22
+ color__olive: R,
23
+ color__green: q,
24
+ color__teal: A,
25
+ color__blue: D,
26
+ color__violet: E,
27
+ color__purple: F,
28
+ color__pink: G,
29
+ color__brown: H,
30
+ color__grey: J,
31
+ "color__light-grey": "_color__light-grey_9h380_281",
32
+ color__good: K,
33
+ color__average: L,
34
+ color__bad: M,
35
+ color__label: O
36
+ }, Q = (r) => {
37
+ const { className: e, vertical: a, fill: s, fluid: c, children: t, ...l } = r;
40
38
  return /* @__PURE__ */ o(
41
39
  "div",
42
40
  {
43
- className: i([
41
+ className: h([
44
42
  _.tabs,
45
- e ? _.vertical : _.horizontal,
43
+ a ? _.vertical : _.horizontal,
46
44
  s && _.fill,
47
45
  c && _.fluid,
48
- a,
46
+ e,
49
47
  b(l)
50
48
  ]),
51
- ...x(l),
49
+ ...d(l),
52
50
  children: t
53
51
  }
54
52
  );
55
- }, V = (r) => {
53
+ }, U = (r) => {
56
54
  const {
57
- className: a,
58
- selected: e,
55
+ className: e,
56
+ selected: a,
59
57
  color: s,
60
58
  icon: c,
61
59
  leftSlot: t,
@@ -66,24 +64,24 @@ import '../assets/Tabs.css';const m = "_tabs_3dx9a_13", v = "_fill_3dx9a_20", p
66
64
  return /* @__PURE__ */ f(
67
65
  "div",
68
66
  {
69
- className: i([
67
+ className: h([
70
68
  _.tab,
71
69
  _.tabs__tab,
72
70
  _["color__" + s],
73
- e && _.selected,
74
- a,
71
+ a && _.selected,
72
+ e,
75
73
  b(n)
76
74
  ]),
77
- ...x(n),
75
+ ...d(n),
78
76
  children: [
79
- d(t) && /* @__PURE__ */ o("div", { className: _.tab__left, children: t }) || !!c && /* @__PURE__ */ o("div", { className: _.tab__left, children: /* @__PURE__ */ o(h, { name: c }) }),
77
+ i(t) && /* @__PURE__ */ o("div", { className: _.tab__left, children: t }) || !!c && /* @__PURE__ */ o("div", { className: _.tab__left, children: /* @__PURE__ */ o(m, { name: c }) }),
80
78
  /* @__PURE__ */ o("div", { className: _.tab__text, children: g }),
81
- d(l) && /* @__PURE__ */ o("div", { className: _.tab__right, children: l })
79
+ i(l) && /* @__PURE__ */ o("div", { className: _.tab__right, children: l })
82
80
  ]
83
81
  }
84
82
  );
85
83
  };
86
- U.Tab = V;
84
+ Q.Tab = U;
87
85
  export {
88
- U as Tabs
86
+ Q as Tabs
89
87
  };
@@ -32,7 +32,7 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
32
32
  onKeyDown: import('react').KeyboardEventHandler<HTMLDivElement>;
33
33
  onKeyUp: import('react').KeyboardEventHandler<HTMLDivElement>;
34
34
  onMouseDown: import('react').MouseEventHandler<HTMLDivElement>;
35
- onMouseMove: import('react').MouseEventHandler<HTMLDivElement>; /** Fires once the enter key is pressed */
35
+ onMouseMove: import('react').MouseEventHandler<HTMLDivElement>;
36
36
  onMouseOver: import('react').MouseEventHandler<HTMLDivElement>;
37
37
  onMouseUp: import('react').MouseEventHandler<HTMLDivElement>;
38
38
  onScroll: import('react').UIEventHandler<HTMLDivElement>;
@@ -1,10 +1,10 @@
1
1
  import { jsxs as I, jsx as f } from "react/jsx-runtime";
2
2
  import { KEY as p } from "../common/keys.js";
3
3
  import { classes as d } from "../common/react.js";
4
- import { forwardRef as Y, useRef as C, useState as H, useImperativeHandle as L, useEffect as b } from "react";
4
+ import { forwardRef as Y, useRef as C, useState as H, useImperativeHandle as L, useEffect as g } from "react";
5
5
  import { Box as P } from "./Box.js";
6
- import { toInputValue as g } from "./Input.js";
7
- import '../assets/TextArea.css';const U = "_textArea_20wp8_13", $ = "_fluid_20wp8_26", q = "_noborder_20wp8_32", z = "_inner_20wp8_36", G = "_scrollable_20wp8_36", J = "_custom_20wp8_71", M = "_nowrap_20wp8_76", O = "_wrapper_20wp8_82", e = {
6
+ import { toInputValue as T } from "./Input.js";
7
+ import '../assets/TextArea.css';const U = "_textArea_1bert_20", $ = "_fluid_1bert_33", q = "_noborder_1bert_39", z = "_inner_1bert_43", G = "_scrollable_1bert_43", J = "_custom_1bert_78", M = "_nowrap_1bert_83", O = "_wrapper_1bert_89", e = {
8
8
  textArea: U,
9
9
  fluid: $,
10
10
  noborder: q,
@@ -14,7 +14,7 @@ import '../assets/TextArea.css';const U = "_textArea_20wp8_13", $ = "_fluid_20wp
14
14
  nowrap: M,
15
15
  wrapper: O
16
16
  }, er = Y(
17
- (T, x) => {
17
+ (x, w) => {
18
18
  const {
19
19
  autoFocus: m,
20
20
  autoSelect: s,
@@ -28,43 +28,43 @@ import '../assets/TextArea.css';const U = "_textArea_20wp8_13", $ = "_fluid_20wp
28
28
  onInput: c,
29
29
  placeholder: N,
30
30
  scrollbar: S,
31
- selfClear: _,
31
+ selfClear: b,
32
32
  value: i,
33
33
  ...E
34
- } = T, { className: K, fluid: k, nowrap: D, ...R } = E, t = C(null), [V, j] = H(0), B = (r) => {
34
+ } = x, { className: K, fluid: k, nowrap: D, ...R } = E, t = C(null), [V, j] = H(0), B = (r) => {
35
35
  if (r.key === p.Enter) {
36
36
  if (r.shiftKey) {
37
37
  r.currentTarget.focus();
38
38
  return;
39
39
  }
40
- n == null || n(r, r.currentTarget.value), _ && (r.currentTarget.value = ""), r.currentTarget.blur();
40
+ n == null || n(r, r.currentTarget.value), b && (r.currentTarget.value = ""), r.currentTarget.blur();
41
41
  return;
42
42
  }
43
43
  if (r.key === p.Escape) {
44
- u == null || u(r), _ ? r.currentTarget.value = "" : (r.currentTarget.value = g(i), r.currentTarget.blur());
44
+ u == null || u(r), b ? r.currentTarget.value = "" : (r.currentTarget.value = T(i), r.currentTarget.blur());
45
45
  return;
46
46
  }
47
47
  if (!y && r.key === p.Tab) {
48
48
  r.preventDefault();
49
- const { value: o, selectionStart: w, selectionEnd: F } = r.currentTarget;
50
- r.currentTarget.value = o.substring(0, w) + " " + o.substring(F), r.currentTarget.selectionEnd = w + 1;
49
+ const { value: o, selectionStart: _, selectionEnd: F } = r.currentTarget;
50
+ r.currentTarget.value = o.substring(0, _) + " " + o.substring(F), r.currentTarget.selectionEnd = _ + 1;
51
51
  }
52
52
  };
53
53
  return L(
54
- x,
54
+ w,
55
55
  () => t.current
56
- ), b(() => {
56
+ ), g(() => {
57
57
  if (!m && !s)
58
58
  return;
59
59
  const r = t.current;
60
60
  r && (m || s) && setTimeout(() => {
61
61
  r.focus(), s && r.select();
62
62
  }, 1);
63
- }, []), b(() => {
63
+ }, []), g(() => {
64
64
  const r = t.current;
65
65
  if (!r)
66
66
  return;
67
- const o = g(i);
67
+ const o = T(i);
68
68
  r.value !== o && (r.value = o);
69
69
  }, [i]), /* @__PURE__ */ I(
70
70
  P,
@@ -1,18 +1,20 @@
1
- var s = Object.defineProperty;
2
- var p = (r, e, t) => e in r ? s(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var o = (r, e, t) => (p(r, typeof e != "symbol" ? e + "" : e, t), t);
1
+ import '../assets/Tooltip.css';var s = Object.defineProperty;
2
+ var p = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var r = (o, e, t) => (p(o, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import { jsx as l } from "react/jsx-runtime";
5
5
  import { Component as c } from "react";
6
6
  import { findDOMNode as m, render as a } from "react-dom";
7
7
  import { c as u } from "../popper-Dm3m9eeZ.js";
8
- const i = {
8
+ const h = "_tooltip_1pib4_13", f = {
9
+ tooltip: h
10
+ }, i = {
9
11
  modifiers: [
10
12
  {
11
13
  name: "eventListeners",
12
14
  enabled: !1
13
15
  }
14
16
  ]
15
- }, h = {
17
+ }, v = {
16
18
  width: 0,
17
19
  height: 0,
18
20
  top: 0,
@@ -30,7 +32,7 @@ const i = {
30
32
  const e = this.getDOMNode();
31
33
  e && (e.addEventListener("mouseenter", () => {
32
34
  let t = n.renderedTooltip;
33
- t === void 0 && (t = document.createElement("div"), t.className = "toolTip", document.body.appendChild(t), n.renderedTooltip = t), n.currentHoveredElement = e, t.style.opacity = "1", this.renderPopperContent();
35
+ t === void 0 && (t = document.createElement("div"), t.className = f.tooltip, document.body.appendChild(t), n.renderedTooltip = t), n.currentHoveredElement = e, t.style.opacity = "1", this.renderPopperContent();
34
36
  }), e.addEventListener("mouseleave", () => {
35
37
  this.fadeOut();
36
38
  }));
@@ -69,10 +71,10 @@ const i = {
69
71
  // Thus, instead of using the Popper component, Tooltip creates ONE popper
70
72
  // and stores every tooltip inside that.
71
73
  // This means you can never have two tooltips at once, for instance.
72
- o(n, "renderedTooltip"), o(n, "singletonPopper"), o(n, "currentHoveredElement"), o(n, "virtualElement", {
74
+ r(n, "renderedTooltip"), r(n, "singletonPopper"), r(n, "currentHoveredElement"), r(n, "virtualElement", {
73
75
  getBoundingClientRect: () => {
74
76
  var e;
75
- return ((e = n.currentHoveredElement) == null ? void 0 : e.getBoundingClientRect()) ?? h;
77
+ return ((e = n.currentHoveredElement) == null ? void 0 : e.getBoundingClientRect()) ?? v;
76
78
  }
77
79
  });
78
80
  let d = n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "TGUI core component library",
5
5
  "keywords": [
6
6
  "TGUI",