tgui-core 1.5.4 → 1.5.5

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.
@@ -23,3 +23,55 @@ export declare class Color {
23
23
  */
24
24
  static lookup(value: number, colors: Color[]): Color;
25
25
  }
26
+ export interface RgbColor {
27
+ r: number;
28
+ g: number;
29
+ b: number;
30
+ }
31
+ export interface RgbaColor extends RgbColor {
32
+ a: number;
33
+ }
34
+ export interface HslColor {
35
+ h: number;
36
+ s: number;
37
+ l: number;
38
+ }
39
+ export interface HslaColor extends HslColor {
40
+ a: number;
41
+ }
42
+ export interface HsvColor {
43
+ h: number;
44
+ s: number;
45
+ v: number;
46
+ }
47
+ export interface HsvaColor extends HsvColor {
48
+ a: number;
49
+ }
50
+ export type ObjectColor = RgbColor | HslColor | HsvColor | RgbaColor | HslaColor | HsvaColor;
51
+ export type AnyColor = string | ObjectColor;
52
+ export declare const hexToHsva: (hex: string) => HsvaColor;
53
+ export declare const hexToRgba: (hex: string) => RgbaColor;
54
+ export declare const parseHue: (value: string, unit?: string) => number;
55
+ export declare const hslaStringToHsva: (hslString: string) => HsvaColor;
56
+ export declare const hslStringToHsva: (hslString: string) => HsvaColor;
57
+ export declare const hslaToHsva: ({ h, s, l, a }: HslaColor) => HsvaColor;
58
+ export declare const hsvaToHex: (hsva: HsvaColor) => string;
59
+ export declare const hsvaToHsla: ({ h, s, v, a }: HsvaColor) => HslaColor;
60
+ export declare const hsvaToHslString: (hsva: HsvaColor) => string;
61
+ export declare const hsvaToHsvString: (hsva: HsvaColor) => string;
62
+ export declare const hsvaToHsvaString: (hsva: HsvaColor) => string;
63
+ export declare const hsvaToHslaString: (hsva: HsvaColor) => string;
64
+ export declare const hsvaToRgba: ({ h, s, v, a }: HsvaColor) => RgbaColor;
65
+ export declare const hsvaToRgbString: (hsva: HsvaColor) => string;
66
+ export declare const hsvaToRgbaString: (hsva: HsvaColor) => string;
67
+ export declare const hsvaStringToHsva: (hsvString: string) => HsvaColor;
68
+ export declare const hsvStringToHsva: (hsvString: string) => HsvaColor;
69
+ export declare const rgbaStringToHsva: (rgbaString: string) => HsvaColor;
70
+ export declare const rgbStringToHsva: (rgbaString: string) => HsvaColor;
71
+ export declare const rgbaToHex: ({ r, g, b, a }: RgbaColor) => string;
72
+ export declare const rgbaToHsva: ({ r, g, b, a }: RgbaColor) => HsvaColor;
73
+ export declare const roundHsva: (hsva: HsvaColor) => HsvaColor;
74
+ export declare const rgbaToRgb: ({ r, g, b }: RgbaColor) => RgbColor;
75
+ export declare const hslaToHsl: ({ h, s, l }: HslaColor) => HslColor;
76
+ export declare const hsvaToHsv: (hsva: HsvaColor) => HsvColor;
77
+ export declare const validHex: (value: string, alpha?: boolean) => boolean;
@@ -1,13 +1,13 @@
1
- var g = Object.defineProperty;
2
- var u = (e, t, r) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var i = (e, t, r) => u(e, typeof t != "symbol" ? t + "" : t, r);
4
- class n {
5
- constructor(t = 0, r = 0, s = 0, a = 1) {
6
- i(this, "r");
7
- i(this, "g");
8
- i(this, "b");
9
- i(this, "a");
10
- this.r = t, this.g = r, this.b = s, this.a = a;
1
+ var v = Object.defineProperty;
2
+ var H = (r, t, s) => t in r ? v(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s;
3
+ var c = (r, t, s) => H(r, typeof t != "symbol" ? t + "" : t, s);
4
+ class u {
5
+ constructor(t = 0, s = 0, n = 0, e = 1) {
6
+ c(this, "r");
7
+ c(this, "g");
8
+ c(this, "b");
9
+ c(this, "a");
10
+ this.r = t, this.g = s, this.b = n, this.a = e;
11
11
  }
12
12
  toString() {
13
13
  let t = this.a;
@@ -15,11 +15,11 @@ class n {
15
15
  }
16
16
  /** Darkens a color by a given percent. Returns a color, which can have toString called to get it's rgba() css value. */
17
17
  darken(t) {
18
- const r = t / 100;
19
- return new n(
20
- this.r - this.r * r,
21
- this.g - this.g * r,
22
- this.b - this.b * r,
18
+ const s = t / 100;
19
+ return new u(
20
+ this.r - this.r * s,
21
+ this.g - this.g * s,
22
+ this.b - this.b * s,
23
23
  this.a
24
24
  );
25
25
  }
@@ -31,7 +31,7 @@ class n {
31
31
  * Creates a color from the CSS hex color notation.
32
32
  */
33
33
  static fromHex(t) {
34
- return new n(
34
+ return new u(
35
35
  Number.parseInt(t.slice(1, 3), 16),
36
36
  Number.parseInt(t.slice(3, 5), 16),
37
37
  Number.parseInt(t.slice(5, 7), 16)
@@ -40,31 +40,169 @@ class n {
40
40
  /**
41
41
  * Linear interpolation of two colors.
42
42
  */
43
- static lerp(t, r, s) {
44
- return new n(
45
- (r.r - t.r) * s + t.r,
46
- (r.g - t.g) * s + t.g,
47
- (r.b - t.b) * s + t.b,
48
- (r.a - t.a) * s + t.a
43
+ static lerp(t, s, n) {
44
+ return new u(
45
+ (s.r - t.r) * n + t.r,
46
+ (s.g - t.g) * n + t.g,
47
+ (s.b - t.b) * n + t.b,
48
+ (s.a - t.a) * n + t.a
49
49
  );
50
50
  }
51
51
  /**
52
52
  * Loops up the color in the provided list of colors
53
53
  * with linear interpolation.
54
54
  */
55
- static lookup(t, r) {
56
- const s = r.length;
57
- if (s < 2)
55
+ static lookup(t, s) {
56
+ const n = s.length;
57
+ if (n < 2)
58
58
  throw new Error("Needs at least two colors!");
59
- const a = t * (s - 1);
59
+ const e = t * (n - 1);
60
60
  if (t < 1e-4)
61
- return r[0];
61
+ return s[0];
62
62
  if (t >= 1 - 1e-4)
63
- return r[s - 1];
64
- const b = a % 1, h = a | 0;
65
- return n.lerp(r[h], r[h + 1], b);
63
+ return s[n - 1];
64
+ const o = e % 1, h = e | 0;
65
+ return u.lerp(s[h], s[h + 1], o);
66
66
  }
67
67
  }
68
+ const a = (r, t = 0, s = 10 ** t) => Math.round(s * r) / s, T = {
69
+ grad: 360 / 400,
70
+ turn: 360,
71
+ rad: 360 / (Math.PI * 2)
72
+ }, E = (r) => N(p(r)), p = (r) => {
73
+ let t = r;
74
+ return t[0] === "#" && (t = t.substring(1)), t.length < 6 ? {
75
+ r: Number.parseInt(t[0] + t[0], 16),
76
+ g: Number.parseInt(t[1] + t[1], 16),
77
+ b: Number.parseInt(t[2] + t[2], 16),
78
+ a: t.length === 4 ? a(Number.parseInt(t[3] + t[3], 16) / 255, 2) : 1
79
+ } : {
80
+ r: Number.parseInt(t.substring(0, 2), 16),
81
+ g: Number.parseInt(t.substring(2, 4), 16),
82
+ b: Number.parseInt(t.substring(4, 6), 16),
83
+ a: t.length === 8 ? a(Number.parseInt(t.substring(6, 8), 16) / 255, 2) : 1
84
+ };
85
+ }, $ = (r, t = "deg") => Number(r) * (T[t] || 1), S = (r) => {
86
+ const s = /hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(r);
87
+ return s ? x({
88
+ h: $(s[1], s[2]),
89
+ s: Number(s[3]),
90
+ l: Number(s[4]),
91
+ a: s[5] === void 0 ? 1 : Number(s[5]) / (s[6] ? 100 : 1)
92
+ }) : { h: 0, s: 0, v: 0, a: 1 };
93
+ }, P = S, x = ({ h: r, s: t, l: s, a: n }) => (t *= (s < 50 ? s : 100 - s) / 100, {
94
+ h: r,
95
+ s: t > 0 ? 2 * t / (s + t) * 100 : 0,
96
+ v: s + t,
97
+ a: n
98
+ }), k = (r) => w(m(r)), l = ({ h: r, s: t, v: s, a: n }) => {
99
+ const e = (200 - t) * s / 100;
100
+ return {
101
+ h: a(r),
102
+ s: a(
103
+ e > 0 && e < 200 ? t * s / 100 / (e <= 100 ? e : 200 - e) * 100 : 0
104
+ ),
105
+ l: a(e / 2),
106
+ a: a(n, 2)
107
+ };
108
+ }, L = (r) => {
109
+ const { h: t, s, l: n } = l(r);
110
+ return `hsl(${t}, ${s}%, ${n}%)`;
111
+ }, O = (r) => {
112
+ const { h: t, s, v: n } = g(r);
113
+ return `hsv(${t}, ${s}%, ${n}%)`;
114
+ }, F = (r) => {
115
+ const { h: t, s, v: n, a: e } = g(r);
116
+ return `hsva(${t}, ${s}%, ${n}%, ${e})`;
117
+ }, y = (r) => {
118
+ const { h: t, s, l: n, a: e } = l(r);
119
+ return `hsla(${t}, ${s}%, ${n}%, ${e})`;
120
+ }, m = ({ h: r, s: t, v: s, a: n }) => {
121
+ r = r / 360 * 6, t = t / 100, s = s / 100;
122
+ const e = Math.floor(r), o = s * (1 - t), h = s * (1 - (r - e) * t), b = s * (1 - (1 - r + e) * t), d = e % 6;
123
+ return {
124
+ r: [s, h, o, o, b, s][d] * 255,
125
+ g: [b, s, s, h, o, o][d] * 255,
126
+ b: [o, o, b, s, s, h][d] * 255,
127
+ a: a(n, 2)
128
+ };
129
+ }, A = (r) => {
130
+ const { r: t, g: s, b: n } = m(r);
131
+ return `rgb(${a(t)}, ${a(s)}, ${a(n)})`;
132
+ }, U = (r) => {
133
+ const { r: t, g: s, b: n, a: e } = m(r);
134
+ return `rgba(${a(t)}, ${a(s)}, ${a(n)}, ${a(e, 2)})`;
135
+ }, I = (r) => {
136
+ const s = /hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(r);
137
+ return s ? g({
138
+ h: $(s[1], s[2]),
139
+ s: Number(s[3]),
140
+ v: Number(s[4]),
141
+ a: s[5] === void 0 ? 1 : Number(s[5]) / (s[6] ? 100 : 1)
142
+ }) : { h: 0, s: 0, v: 0, a: 1 };
143
+ }, V = I, f = (r) => {
144
+ const s = /rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(r);
145
+ return s ? N({
146
+ r: Number(s[1]) / (s[2] ? 100 / 255 : 1),
147
+ g: Number(s[3]) / (s[4] ? 100 / 255 : 1),
148
+ b: Number(s[5]) / (s[6] ? 100 / 255 : 1),
149
+ a: s[7] === void 0 ? 1 : Number(s[7]) / (s[8] ? 100 : 1)
150
+ }) : { h: 0, s: 0, v: 0, a: 1 };
151
+ }, j = f, i = (r) => {
152
+ const t = r.toString(16);
153
+ return t.length < 2 ? `0${t}` : t;
154
+ }, w = ({ r, g: t, b: s, a: n }) => {
155
+ const e = n < 1 ? i(a(n * 255)) : "";
156
+ return `#${i(a(r))}${i(a(t))}${i(a(s))}${e}`;
157
+ }, N = ({ r, g: t, b: s, a: n }) => {
158
+ const e = Math.max(r, t, s), o = e - Math.min(r, t, s), h = o ? e === r ? (t - s) / o : e === t ? 2 + (s - r) / o : 4 + (r - t) / o : 0;
159
+ return {
160
+ h: 60 * (h < 0 ? h + 6 : h),
161
+ s: e ? o / e * 100 : 0,
162
+ v: e / 255 * 100,
163
+ a: n
164
+ };
165
+ }, g = (r) => ({
166
+ h: a(r.h),
167
+ s: a(r.s),
168
+ v: a(r.v),
169
+ a: a(r.a, 2)
170
+ }), q = ({ r, g: t, b: s }) => ({ r, g: t, b: s }), z = ({ h: r, s: t, l: s }) => ({ h: r, s: t, l: s }), B = (r) => {
171
+ const { h: t, s, v: n } = g(r);
172
+ return { h: t, s, v: n };
173
+ }, M = /^#?([0-9A-F]{3,8})$/i, D = (r, t) => {
174
+ const s = M.exec(r), n = s ? s[1].length : 0;
175
+ return n === 3 || // '#rgb' format
176
+ n === 6 || // '#rrggbb' format
177
+ !!t && n === 4 || // '#rgba' format
178
+ !!t && n === 8;
179
+ };
68
180
  export {
69
- n as Color
181
+ u as Color,
182
+ E as hexToHsva,
183
+ p as hexToRgba,
184
+ P as hslStringToHsva,
185
+ S as hslaStringToHsva,
186
+ z as hslaToHsl,
187
+ x as hslaToHsva,
188
+ V as hsvStringToHsva,
189
+ I as hsvaStringToHsva,
190
+ k as hsvaToHex,
191
+ L as hsvaToHslString,
192
+ l as hsvaToHsla,
193
+ y as hsvaToHslaString,
194
+ B as hsvaToHsv,
195
+ O as hsvaToHsvString,
196
+ F as hsvaToHsvaString,
197
+ A as hsvaToRgbString,
198
+ m as hsvaToRgba,
199
+ U as hsvaToRgbaString,
200
+ $ as parseHue,
201
+ j as rgbStringToHsva,
202
+ f as rgbaStringToHsva,
203
+ w as rgbaToHex,
204
+ N as rgbaToHsva,
205
+ q as rgbaToRgb,
206
+ g as roundHsva,
207
+ D as validHex
70
208
  };
@@ -1,5 +1,5 @@
1
- import { jsx as l, jsxs as p, Fragment as W } from "react/jsx-runtime";
2
- import { useState as F, useRef as L, useEffect as S } from "react";
1
+ import { jsx as l, jsxs as p, Fragment as F } from "react/jsx-runtime";
2
+ import { useState as L, useRef as S, useEffect as V } from "react";
3
3
  import { classes as N } from "../common/react.js";
4
4
  import { unit as $ } from "../common/ui.js";
5
5
  import { Button as D } from "./Button.js";
@@ -9,17 +9,17 @@ const z = -1;
9
9
  function h(u) {
10
10
  return typeof u == "string" ? u : u.value;
11
11
  }
12
- function X(u) {
12
+ function Y(u) {
13
13
  const {
14
14
  autoScroll: v = !0,
15
15
  buttons: I,
16
16
  className: O,
17
- clipSelectedText: k = !0,
17
+ clipSelectedText: T = !0,
18
18
  color: B = "default",
19
19
  disabled: d,
20
20
  displayText: E,
21
21
  icon: x,
22
- iconRotation: T,
22
+ iconRotation: k,
23
23
  iconSpin: j,
24
24
  menuWidth: C = "15rem",
25
25
  noChevron: R,
@@ -30,13 +30,12 @@ function X(u) {
30
30
  placeholder: K = "Select...",
31
31
  selected: m,
32
32
  width: P = "15rem"
33
- } = u, [r, f] = F(!1), V = y ? !r : r, w = L(null), i = c.findIndex((e) => h(e) === m) || 0;
33
+ } = u, [r, f] = L(!1), W = y ? !r : r, w = S(null), i = c.findIndex((e) => h(e) === m) || 0;
34
34
  function g(e) {
35
- var t;
36
35
  let s = e;
37
36
  e < i ? s = e < 2 ? 0 : e - 2 : s = e > c.length - 3 ? c.length - 1 : e - 2;
38
- const n = (t = w.current) == null ? void 0 : t.children[s];
39
- n == null || n.scrollIntoView({ block: "nearest" });
37
+ const n = w.current, t = n == null ? void 0 : n.children[s];
38
+ n && t && (n.scrollTop = t.offsetTop);
40
39
  }
41
40
  function _(e) {
42
41
  if (c.length < 1 || d)
@@ -45,7 +44,7 @@ function X(u) {
45
44
  let t;
46
45
  i < 0 ? t = e === "next" ? n : s : e === "next" ? t = i === n ? s : i + 1 : t = i === s ? n : i - 1, r && v && g(t), o == null || o(h(c[t]));
47
46
  }
48
- return S(() => {
47
+ return V(() => {
49
48
  var e;
50
49
  r && (v && i !== z && g(i), (e = w.current) == null || e.focus());
51
50
  }, [r]), /* @__PURE__ */ l(
@@ -104,22 +103,22 @@ function X(u) {
104
103
  e.key === "Enter" && !d && (f(!r), a == null || a(e));
105
104
  },
106
105
  children: [
107
- x && /* @__PURE__ */ l(b, { mr: 1, name: x, rotation: T, spin: j }),
106
+ x && /* @__PURE__ */ l(b, { mr: 1, name: x, rotation: k, spin: j }),
108
107
  /* @__PURE__ */ l(
109
108
  "span",
110
109
  {
111
110
  className: "Dropdown__selected-text",
112
111
  style: {
113
- overflow: k ? "hidden" : "visible"
112
+ overflow: T ? "hidden" : "visible"
114
113
  },
115
114
  children: E || m && h(m) || K
116
115
  }
117
116
  ),
118
- !R && /* @__PURE__ */ l("span", { className: "Dropdown__arrow-button", children: /* @__PURE__ */ l(b, { name: V ? "chevron-up" : "chevron-down" }) })
117
+ !R && /* @__PURE__ */ l("span", { className: "Dropdown__arrow-button", children: /* @__PURE__ */ l(b, { name: W ? "chevron-up" : "chevron-down" }) })
119
118
  ]
120
119
  }
121
120
  ),
122
- I && /* @__PURE__ */ p(W, { children: [
121
+ I && /* @__PURE__ */ p(F, { children: [
123
122
  /* @__PURE__ */ l(
124
123
  D,
125
124
  {
@@ -154,5 +153,5 @@ function X(u) {
154
153
  );
155
154
  }
156
155
  export {
157
- X as Dropdown
156
+ Y as Dropdown
158
157
  };
@@ -0,0 +1,23 @@
1
+ import { default as React, Component, KeyboardEvent, MouseEvent, RefObject } from 'react';
2
+ export interface Interaction {
3
+ left: number;
4
+ top: number;
5
+ }
6
+ export interface InteractiveProps {
7
+ onMove: (interaction: Interaction) => void;
8
+ onKey: (offset: Interaction) => void;
9
+ children: React.ReactNode;
10
+ style?: React.CSSProperties;
11
+ }
12
+ export declare class Interactive extends Component<InteractiveProps> {
13
+ containerRef: RefObject<HTMLDivElement>;
14
+ constructor(props: InteractiveProps);
15
+ handleMoveStart: (event: MouseEvent) => void;
16
+ handleMove: (event: MouseEvent) => void;
17
+ handleMoveEnd: () => void;
18
+ handleKeyDown: (event: KeyboardEvent) => void;
19
+ toggleDocumentEvents: (state: boolean) => void;
20
+ componentDidMount(): void;
21
+ componentWillUnmount(): void;
22
+ render(): import("react/jsx-runtime").JSX.Element;
23
+ }
@@ -0,0 +1,75 @@
1
+ var h = Object.defineProperty;
2
+ var u = (t, n, e) => n in t ? h(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var s = (t, n, e) => u(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { jsx as p } from "react/jsx-runtime";
5
+ import { Component as f, createRef as g } from "react";
6
+ import { clamp as l } from "../common/math.js";
7
+ const i = (t) => {
8
+ var n;
9
+ return ((n = t == null ? void 0 : t.ownerDocument) == null ? void 0 : n.defaultView) || self;
10
+ }, a = (t, n) => {
11
+ const e = t.getBoundingClientRect();
12
+ return {
13
+ left: l(
14
+ (n.pageX - (e.left + i(t).pageXOffset)) / e.width,
15
+ 0,
16
+ 1
17
+ ),
18
+ top: l(
19
+ (n.pageY - (e.top + i(t).pageYOffset)) / e.height,
20
+ 0,
21
+ 1
22
+ )
23
+ };
24
+ };
25
+ class w extends f {
26
+ constructor(e) {
27
+ super(e);
28
+ s(this, "containerRef");
29
+ s(this, "handleMoveStart", (e) => {
30
+ const o = this.containerRef.current;
31
+ o && (e.preventDefault(), o.focus(), this.props.onMove(a(o, e)), this.toggleDocumentEvents(!0));
32
+ });
33
+ s(this, "handleMove", (e) => {
34
+ e.preventDefault(), e.buttons > 0 && this.containerRef.current ? this.props.onMove(a(this.containerRef.current, e)) : this.toggleDocumentEvents(!1);
35
+ });
36
+ s(this, "handleMoveEnd", () => {
37
+ this.toggleDocumentEvents(!1);
38
+ });
39
+ s(this, "handleKeyDown", (e) => {
40
+ const o = e.which || e.keyCode;
41
+ o < 37 || o > 40 || (e.preventDefault(), this.props.onKey({
42
+ left: o === 39 ? 0.05 : o === 37 ? -0.05 : 0,
43
+ top: o === 40 ? 0.05 : o === 38 ? -0.05 : 0
44
+ }));
45
+ });
46
+ s(this, "toggleDocumentEvents", (e) => {
47
+ const o = this.containerRef.current, r = i(o), c = e ? r.addEventListener.bind(r) : r.removeEventListener.bind(r);
48
+ c("mousemove", this.handleMove), c("mouseup", this.handleMoveEnd);
49
+ });
50
+ this.containerRef = g();
51
+ }
52
+ componentDidMount() {
53
+ this.toggleDocumentEvents(!0);
54
+ }
55
+ componentWillUnmount() {
56
+ this.toggleDocumentEvents(!1);
57
+ }
58
+ render() {
59
+ return /* @__PURE__ */ p(
60
+ "div",
61
+ {
62
+ ...this.props,
63
+ style: this.props.style,
64
+ ref: this.containerRef,
65
+ onMouseDown: this.handleMoveStart,
66
+ className: "react-colorful__interactive",
67
+ onKeyDown: this.handleKeyDown,
68
+ children: this.props.children
69
+ }
70
+ );
71
+ }
72
+ }
73
+ export {
74
+ w as Interactive
75
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ interface PointerProps {
3
+ className?: string;
4
+ top?: number;
5
+ left: number;
6
+ color: string;
7
+ }
8
+ export declare const Pointer: ({ className, color, left, top, }: PointerProps) => ReactNode;
9
+ export {};
@@ -0,0 +1,23 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { classes as a } from "../common/react.js";
3
+ const m = ({
4
+ className: r,
5
+ color: e,
6
+ left: t,
7
+ top: l = 0.5
8
+ }) => {
9
+ const s = a(["react-colorful__pointer", r]), c = {
10
+ top: `${l * 100}%`,
11
+ left: `${t * 100}%`
12
+ };
13
+ return /* @__PURE__ */ o("div", { className: s, style: c, children: /* @__PURE__ */ o(
14
+ "div",
15
+ {
16
+ className: "react-colorful__pointer-fill",
17
+ style: { backgroundColor: e }
18
+ }
19
+ ) });
20
+ };
21
+ export {
22
+ m as Pointer
23
+ };
@@ -21,6 +21,7 @@ export { Image } from './Image';
21
21
  export { ImageButton } from './ImageButton';
22
22
  export { InfinitePlane } from './InfinitePlane';
23
23
  export { Input } from './Input';
24
+ export { Interactive, type Interaction } from './Interactive';
24
25
  export { KeyListener } from './KeyListener';
25
26
  export { Knob } from './Knob';
26
27
  export { LabeledControls } from './LabeledControls';
@@ -29,6 +30,7 @@ export { MenuBar } from './MenuBar';
29
30
  export { Modal } from './Modal';
30
31
  export { NoticeBox } from './NoticeBox';
31
32
  export { NumberInput } from './NumberInput';
33
+ export { Pointer } from './Pointer';
32
34
  export { Popper } from './Popper';
33
35
  export { ProgressBar } from './ProgressBar';
34
36
  export { RestrictedInput } from './RestrictedInput';
@@ -2,7 +2,7 @@ import { AnimatedNumber as e } from "./AnimatedNumber.js";
2
2
  import { Autofocus as m } from "./Autofocus.js";
3
3
  import { Blink as x } from "./Blink.js";
4
4
  import { BlockQuote as i } from "./BlockQuote.js";
5
- import { Box as l } from "./Box.js";
5
+ import { Box as n } from "./Box.js";
6
6
  import { Button as u } from "./Button.js";
7
7
  import { ByondUi as c } from "./ByondUi.js";
8
8
  import { Chart as b } from "./Chart.js";
@@ -11,45 +11,47 @@ import { ColorBox as D } from "./ColorBox.js";
11
11
  import { Dialog as C } from "./Dialog.js";
12
12
  import { Dimmer as L } from "./Dimmer.js";
13
13
  import { Divider as y } from "./Divider.js";
14
- import { DmIcon as N } from "./DmIcon.js";
15
- import { DraggableControl as F } from "./DraggableControl.js";
16
- import { Dropdown as M } from "./Dropdown.js";
17
- import { FitText as h } from "./FitText.js";
14
+ import { DmIcon as A } from "./DmIcon.js";
15
+ import { DraggableControl as v } from "./DraggableControl.js";
16
+ import { Dropdown as K } from "./Dropdown.js";
17
+ import { FitText as R } from "./FitText.js";
18
18
  import { Flex as w } from "./Flex.js";
19
19
  import { Icon as O } from "./Icon.js";
20
20
  import { Image as U } from "./Image.js";
21
21
  import { ImageButton as j } from "./ImageButton.js";
22
22
  import { InfinitePlane as z } from "./InfinitePlane.js";
23
23
  import { Input as H } from "./Input.js";
24
- import { KeyListener as W } from "./KeyListener.js";
25
- import { Knob as Y } from "./Knob.js";
26
- import { LabeledControls as _ } from "./LabeledControls.js";
27
- import { LabeledList as oo } from "./LabeledList.js";
28
- import { MenuBar as eo } from "./MenuBar.js";
29
- import { Modal as mo } from "./Modal.js";
30
- import { NoticeBox as xo } from "./NoticeBox.js";
31
- import { NumberInput as io } from "./NumberInput.js";
32
- import { Popper as lo } from "./Popper.js";
33
- import { ProgressBar as uo } from "./ProgressBar.js";
34
- import { RestrictedInput as co } from "./RestrictedInput.js";
35
- import { RoundGauge as Bo } from "./RoundGauge.js";
36
- import { Section as go } from "./Section.js";
37
- import { Slider as To } from "./Slider.js";
38
- import { Stack as ko } from "./Stack.js";
39
- import { StyleableSection as So } from "./StyleableSection.js";
40
- import { Table as Ao } from "./Table.js";
41
- import { Tabs as Po } from "./Tabs.js";
42
- import { TextArea as Ko } from "./TextArea.js";
43
- import { TimeDisplay as Ro } from "./TimeDisplay.js";
44
- import { Tooltip as vo } from "./Tooltip.js";
45
- import { TrackOutsideClicks as Go } from "./TrackOutsideClicks.js";
46
- import { VirtualList as Qo } from "./VirtualList.js";
24
+ import { Interactive as W } from "./Interactive.js";
25
+ import { KeyListener as Y } from "./KeyListener.js";
26
+ import { Knob as _ } from "./Knob.js";
27
+ import { LabeledControls as oo } from "./LabeledControls.js";
28
+ import { LabeledList as eo } from "./LabeledList.js";
29
+ import { MenuBar as mo } from "./MenuBar.js";
30
+ import { Modal as xo } from "./Modal.js";
31
+ import { NoticeBox as io } from "./NoticeBox.js";
32
+ import { NumberInput as no } from "./NumberInput.js";
33
+ import { Pointer as uo } from "./Pointer.js";
34
+ import { Popper as co } from "./Popper.js";
35
+ import { ProgressBar as Bo } from "./ProgressBar.js";
36
+ import { RestrictedInput as go } from "./RestrictedInput.js";
37
+ import { RoundGauge as To } from "./RoundGauge.js";
38
+ import { Section as ko } from "./Section.js";
39
+ import { Slider as So } from "./Slider.js";
40
+ import { Stack as Po } from "./Stack.js";
41
+ import { StyleableSection as No } from "./StyleableSection.js";
42
+ import { Table as Fo } from "./Table.js";
43
+ import { Tabs as Mo } from "./Tabs.js";
44
+ import { TextArea as ho } from "./TextArea.js";
45
+ import { TimeDisplay as Go } from "./TimeDisplay.js";
46
+ import { Tooltip as Qo } from "./Tooltip.js";
47
+ import { TrackOutsideClicks as Vo } from "./TrackOutsideClicks.js";
48
+ import { VirtualList as qo } from "./VirtualList.js";
47
49
  export {
48
50
  e as AnimatedNumber,
49
51
  m as Autofocus,
50
52
  x as Blink,
51
53
  i as BlockQuote,
52
- l as Box,
54
+ n as Box,
53
55
  u as Button,
54
56
  c as ByondUi,
55
57
  b as Chart,
@@ -58,37 +60,39 @@ export {
58
60
  C as Dialog,
59
61
  L as Dimmer,
60
62
  y as Divider,
61
- N as DmIcon,
62
- F as DraggableControl,
63
- M as Dropdown,
64
- h as FitText,
63
+ A as DmIcon,
64
+ v as DraggableControl,
65
+ K as Dropdown,
66
+ R as FitText,
65
67
  w as Flex,
66
68
  O as Icon,
67
69
  U as Image,
68
70
  j as ImageButton,
69
71
  z as InfinitePlane,
70
72
  H as Input,
71
- W as KeyListener,
72
- Y as Knob,
73
- _ as LabeledControls,
74
- oo as LabeledList,
75
- eo as MenuBar,
76
- mo as Modal,
77
- xo as NoticeBox,
78
- io as NumberInput,
79
- lo as Popper,
80
- uo as ProgressBar,
81
- co as RestrictedInput,
82
- Bo as RoundGauge,
83
- go as Section,
84
- To as Slider,
85
- ko as Stack,
86
- So as StyleableSection,
87
- Ao as Table,
88
- Po as Tabs,
89
- Ko as TextArea,
90
- Ro as TimeDisplay,
91
- vo as Tooltip,
92
- Go as TrackOutsideClicks,
93
- Qo as VirtualList
73
+ W as Interactive,
74
+ Y as KeyListener,
75
+ _ as Knob,
76
+ oo as LabeledControls,
77
+ eo as LabeledList,
78
+ mo as MenuBar,
79
+ xo as Modal,
80
+ io as NoticeBox,
81
+ no as NumberInput,
82
+ uo as Pointer,
83
+ co as Popper,
84
+ Bo as ProgressBar,
85
+ go as RestrictedInput,
86
+ To as RoundGauge,
87
+ ko as Section,
88
+ So as Slider,
89
+ Po as Stack,
90
+ No as StyleableSection,
91
+ Fo as Table,
92
+ Mo as Tabs,
93
+ ho as TextArea,
94
+ Go as TimeDisplay,
95
+ Qo as Tooltip,
96
+ Vo as TrackOutsideClicks,
97
+ qo as VirtualList
94
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "TGUI core component library",
5
5
  "keywords": ["TGUI", "library", "typescript"],
6
6
  "files": ["dist"],