tgui-core 1.1.8 → 1.1.9

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 (291) hide show
  1. package/lib/common/assets.ts +38 -0
  2. package/lib/common/collections.ts +27 -0
  3. package/lib/common/color.ts +88 -0
  4. package/lib/common/constants.ts +349 -0
  5. package/lib/common/events.ts +262 -0
  6. package/{dist/common/exhaustive.d.ts → lib/common/exhaustive.ts} +3 -1
  7. package/lib/common/format.ts +167 -0
  8. package/{dist/common/fp.d.ts → lib/common/fp.ts} +16 -2
  9. package/lib/common/hotkeys.ts +207 -0
  10. package/lib/common/http.ts +16 -0
  11. package/lib/common/keycodes.ts +86 -0
  12. package/{dist/common/keys.d.ts → lib/common/keys.ts} +24 -21
  13. package/lib/common/math.ts +76 -0
  14. package/lib/common/perf.ts +72 -0
  15. package/lib/common/random.ts +32 -0
  16. package/lib/common/react.ts +59 -0
  17. package/lib/common/redux.ts +187 -0
  18. package/lib/common/storage.ts +207 -0
  19. package/lib/common/string.ts +169 -0
  20. package/lib/common/timer.ts +63 -0
  21. package/lib/common/type-utils.ts +41 -0
  22. package/lib/common/types.d.ts +12 -0
  23. package/lib/common/uuid.ts +18 -0
  24. package/lib/components/AnimatedNumber.tsx +180 -0
  25. package/lib/components/Autofocus.tsx +23 -0
  26. package/lib/components/Blink.tsx +91 -0
  27. package/lib/components/BlockQuote.tsx +9 -0
  28. package/lib/components/BodyZoneSelector.tsx +149 -0
  29. package/lib/components/Box.tsx +252 -0
  30. package/lib/components/Button.tsx +425 -0
  31. package/lib/components/ByondUi.jsx +110 -0
  32. package/lib/components/Chart.tsx +155 -0
  33. package/lib/components/Collapsible.tsx +43 -0
  34. package/lib/components/ColorBox.tsx +29 -0
  35. package/lib/components/Dialog.tsx +81 -0
  36. package/lib/components/Dimmer.tsx +13 -0
  37. package/lib/components/Divider.tsx +20 -0
  38. package/lib/components/DmIcon.tsx +86 -0
  39. package/lib/components/DraggableControl.jsx +276 -0
  40. package/lib/components/Dropdown.tsx +246 -0
  41. package/lib/components/FakeTerminal.jsx +52 -0
  42. package/lib/components/FitText.tsx +99 -0
  43. package/lib/components/Flex.tsx +159 -0
  44. package/lib/components/Icon.tsx +95 -0
  45. package/lib/components/Image.tsx +54 -0
  46. package/lib/components/InfinitePlane.jsx +192 -0
  47. package/lib/components/Input.tsx +176 -0
  48. package/lib/components/KeyListener.tsx +40 -0
  49. package/lib/components/Knob.tsx +178 -0
  50. package/lib/components/LabeledControls.tsx +44 -0
  51. package/lib/components/LabeledList.tsx +154 -0
  52. package/lib/components/MenuBar.tsx +228 -0
  53. package/lib/components/Modal.tsx +23 -0
  54. package/lib/components/NoticeBox.tsx +45 -0
  55. package/lib/components/NumberInput.tsx +328 -0
  56. package/lib/components/Popper.tsx +100 -0
  57. package/lib/components/ProgressBar.tsx +105 -0
  58. package/lib/components/RestrictedInput.jsx +301 -0
  59. package/lib/components/RoundGauge.tsx +180 -0
  60. package/lib/components/Section.tsx +120 -0
  61. package/lib/components/Slider.tsx +169 -0
  62. package/lib/components/Stack.tsx +96 -0
  63. package/lib/components/StyleableSection.tsx +33 -0
  64. package/lib/components/Table.tsx +84 -0
  65. package/lib/components/Tabs.tsx +89 -0
  66. package/lib/components/TextArea.tsx +182 -0
  67. package/lib/components/TimeDisplay.jsx +64 -0
  68. package/lib/components/Tooltip.tsx +152 -0
  69. package/lib/components/TrackOutsideClicks.tsx +35 -0
  70. package/lib/components/VirtualList.tsx +69 -0
  71. package/lib/styles/atomic/candystripe.scss +8 -0
  72. package/lib/styles/atomic/centered-image.scss +7 -0
  73. package/lib/styles/atomic/color.scss +21 -0
  74. package/lib/styles/atomic/debug-layout.scss +17 -0
  75. package/lib/styles/atomic/fit-text.scss +14 -0
  76. package/lib/styles/atomic/links.scss +12 -0
  77. package/lib/styles/atomic/outline.scss +47 -0
  78. package/lib/styles/atomic/text.scss +44 -0
  79. package/lib/styles/base.scss +32 -0
  80. package/lib/styles/colors.scss +92 -0
  81. package/lib/styles/components/BlockQuote.module.scss +20 -0
  82. package/lib/styles/components/BlockQuote.module.scss.d.ts +4 -0
  83. package/lib/styles/components/Button.module.scss +157 -0
  84. package/lib/styles/components/Button.module.scss.d.ts +46 -0
  85. package/lib/styles/components/ColorBox.module.scss +12 -0
  86. package/lib/styles/components/ColorBox.module.scss.d.ts +4 -0
  87. package/lib/styles/components/Dialog.module.scss +60 -0
  88. package/lib/styles/components/Dialog.module.scss.d.ts +10 -0
  89. package/lib/styles/components/Dimmer.module.scss +22 -0
  90. package/lib/styles/components/Dimmer.module.scss.d.ts +4 -0
  91. package/lib/styles/components/Divider.module.scss +27 -0
  92. package/lib/styles/components/Divider.module.scss.d.ts +6 -0
  93. package/lib/styles/components/Dropdown.scss +72 -0
  94. package/lib/styles/components/Flex.module.scss +13 -0
  95. package/lib/styles/components/Flex.module.scss.d.ts +5 -0
  96. package/lib/styles/components/Icon.module.scss +25 -0
  97. package/lib/styles/components/Icon.module.scss.d.ts +5 -0
  98. package/lib/styles/components/Input.module.scss +64 -0
  99. package/lib/styles/components/Input.module.scss.d.ts +8 -0
  100. package/lib/styles/components/Knob.module.scss +131 -0
  101. package/lib/styles/components/Knob.module.scss.d.ts +33 -0
  102. package/lib/styles/components/LabeledList.module.scss +49 -0
  103. package/lib/styles/components/LabeledList.module.scss.d.ts +8 -0
  104. package/lib/styles/components/MenuBar.module.scss +75 -0
  105. package/lib/styles/components/MenuBar.module.scss.d.ts +14 -0
  106. package/lib/styles/components/Modal.module.scss +14 -0
  107. package/lib/styles/components/Modal.module.scss.d.ts +4 -0
  108. package/lib/styles/components/NoticeBox.module.scss +65 -0
  109. package/lib/styles/components/NoticeBox.module.scss.d.ts +27 -0
  110. package/lib/styles/components/NumberInput.module.scss +71 -0
  111. package/lib/styles/components/NumberInput.module.scss.d.ts +9 -0
  112. package/lib/styles/components/ProgressBar.module.scss +63 -0
  113. package/lib/styles/components/ProgressBar.module.scss.d.ts +27 -0
  114. package/lib/styles/components/RoundGauge.module.scss +85 -0
  115. package/lib/styles/components/RoundGauge.module.scss.d.ts +49 -0
  116. package/lib/styles/components/Section.module.scss +130 -0
  117. package/lib/styles/components/Section.module.scss.d.ts +13 -0
  118. package/lib/styles/components/Slider.module.scss +54 -0
  119. package/lib/styles/components/Slider.module.scss.d.ts +8 -0
  120. package/lib/styles/components/Stack.module.scss +60 -0
  121. package/lib/styles/components/Stack.module.scss.d.ts +12 -0
  122. package/lib/styles/components/Table.module.scss +44 -0
  123. package/lib/styles/components/Table.module.scss.d.ts +10 -0
  124. package/lib/styles/components/Tabs.module.scss +144 -0
  125. package/lib/styles/components/Tabs.module.scss.d.ts +35 -0
  126. package/lib/styles/components/TextArea.module.scss +86 -0
  127. package/lib/styles/components/TextArea.module.scss.d.ts +11 -0
  128. package/lib/styles/components/Tooltip.module.scss +24 -0
  129. package/lib/styles/components/Tooltip.module.scss.d.ts +4 -0
  130. package/lib/styles/functions.scss +79 -0
  131. package/lib/styles/input.scss +9 -0
  132. package/lib/styles/main.scss +20 -0
  133. package/lib/styles/reset.scss +68 -0
  134. package/package.json +6 -6
  135. package/dist/ProgressBar.module-BkAFfFy0.js +0 -29
  136. package/dist/Section.module-CLVHJ4yA.js +0 -15
  137. package/dist/assets/BlockQuote.css +0 -1
  138. package/dist/assets/Button.css +0 -1
  139. package/dist/assets/ColorBox.css +0 -1
  140. package/dist/assets/Dialog.css +0 -1
  141. package/dist/assets/Dimmer.css +0 -1
  142. package/dist/assets/Divider.css +0 -1
  143. package/dist/assets/Flex.css +0 -1
  144. package/dist/assets/Icon.css +0 -6
  145. package/dist/assets/Input.css +0 -1
  146. package/dist/assets/Knob.css +0 -1
  147. package/dist/assets/LabeledList.css +0 -1
  148. package/dist/assets/MenuBar.css +0 -1
  149. package/dist/assets/Modal.css +0 -1
  150. package/dist/assets/NoticeBox.css +0 -1
  151. package/dist/assets/NumberInput.css +0 -1
  152. package/dist/assets/ProgressBar.css +0 -1
  153. package/dist/assets/RoundGauge.css +0 -1
  154. package/dist/assets/Section.css +0 -1
  155. package/dist/assets/Slider.css +0 -1
  156. package/dist/assets/Stack.css +0 -1
  157. package/dist/assets/Table.css +0 -1
  158. package/dist/assets/Tabs.css +0 -1
  159. package/dist/assets/TextArea.css +0 -1
  160. package/dist/assets/Tooltip.css +0 -1
  161. package/dist/common/assets.d.ts +0 -4
  162. package/dist/common/assets.js +0 -25
  163. package/dist/common/collections.d.ts +0 -10
  164. package/dist/common/collections.js +0 -15
  165. package/dist/common/color.d.ts +0 -25
  166. package/dist/common/color.js +0 -69
  167. package/dist/common/constants.d.ts +0 -102
  168. package/dist/common/constants.js +0 -312
  169. package/dist/common/events.d.ts +0 -33
  170. package/dist/common/events.js +0 -147
  171. package/dist/common/exhaustive.js +0 -6
  172. package/dist/common/format.d.ts +0 -11
  173. package/dist/common/format.js +0 -114
  174. package/dist/common/fp.js +0 -9
  175. package/dist/common/hotkeys.d.ts +0 -25
  176. package/dist/common/hotkeys.js +0 -112
  177. package/dist/common/http.d.ts +0 -4
  178. package/dist/common/http.js +0 -10
  179. package/dist/common/keycodes.d.ts +0 -85
  180. package/dist/common/keycodes.js +0 -88
  181. package/dist/common/keys.js +0 -8
  182. package/dist/common/math.d.ts +0 -39
  183. package/dist/common/math.js +0 -41
  184. package/dist/common/perf.d.ts +0 -24
  185. package/dist/common/perf.js +0 -33
  186. package/dist/common/random.d.ts +0 -16
  187. package/dist/common/random.js +0 -18
  188. package/dist/common/react.d.ts +0 -23
  189. package/dist/common/react.js +0 -30
  190. package/dist/common/redux.d.ts +0 -64
  191. package/dist/common/redux.js +0 -72
  192. package/dist/common/storage.js +0 -124
  193. package/dist/common/string.d.ts +0 -65
  194. package/dist/common/string.js +0 -83
  195. package/dist/common/timer.d.ts +0 -18
  196. package/dist/common/timer.js +0 -28
  197. package/dist/common/type-utils.d.ts +0 -9
  198. package/dist/common/type-utils.js +0 -25
  199. package/dist/common/uuid.d.ts +0 -9
  200. package/dist/common/uuid.js +0 -10
  201. package/dist/components/AnimatedNumber.d.ts +0 -60
  202. package/dist/components/AnimatedNumber.js +0 -76
  203. package/dist/components/Autofocus.d.ts +0 -4
  204. package/dist/components/Autofocus.js +0 -17
  205. package/dist/components/Blink.d.ts +0 -26
  206. package/dist/components/Blink.js +0 -56
  207. package/dist/components/BlockQuote.d.ts +0 -3
  208. package/dist/components/BlockQuote.js +0 -13
  209. package/dist/components/BodyZoneSelector.d.ts +0 -28
  210. package/dist/components/BodyZoneSelector.js +0 -115
  211. package/dist/components/Box.d.ts +0 -91
  212. package/dist/components/Box.js +0 -133
  213. package/dist/components/Button.d.ts +0 -93
  214. package/dist/components/Button.js +0 -298
  215. package/dist/components/ByondUi.js +0 -73
  216. package/dist/components/Chart.d.ts +0 -28
  217. package/dist/components/Chart.js +0 -95
  218. package/dist/components/Collapsible.d.ts +0 -15
  219. package/dist/components/Collapsible.js +0 -27
  220. package/dist/components/ColorBox.d.ts +0 -8
  221. package/dist/components/ColorBox.js +0 -24
  222. package/dist/components/Dialog.d.ts +0 -24
  223. package/dist/components/Dialog.js +0 -67
  224. package/dist/components/Dimmer.d.ts +0 -3
  225. package/dist/components/Dimmer.js +0 -13
  226. package/dist/components/Divider.d.ts +0 -6
  227. package/dist/components/Divider.js +0 -22
  228. package/dist/components/DmIcon.d.ts +0 -31
  229. package/dist/components/DmIcon.js +0 -34
  230. package/dist/components/DraggableControl.js +0 -176
  231. package/dist/components/Dropdown.d.ts +0 -48
  232. package/dist/components/Dropdown.js +0 -152
  233. package/dist/components/FakeTerminal.js +0 -38
  234. package/dist/components/FitText.d.ts +0 -22
  235. package/dist/components/FitText.js +0 -63
  236. package/dist/components/Flex.d.ts +0 -93
  237. package/dist/components/Flex.js +0 -72
  238. package/dist/components/Icon.d.ts +0 -30
  239. package/dist/components/Icon.js +0 -51
  240. package/dist/components/Image.d.ts +0 -14
  241. package/dist/components/Image.js +0 -35
  242. package/dist/components/InfinitePlane.js +0 -139
  243. package/dist/components/Input.d.ts +0 -61
  244. package/dist/components/Input.js +0 -89
  245. package/dist/components/KeyListener.d.ts +0 -15
  246. package/dist/components/KeyListener.js +0 -23
  247. package/dist/components/Knob.d.ts +0 -49
  248. package/dist/components/Knob.js +0 -162
  249. package/dist/components/LabeledControls.d.ts +0 -11
  250. package/dist/components/LabeledControls.js +0 -39
  251. package/dist/components/LabeledList.d.ts +0 -57
  252. package/dist/components/LabeledList.js +0 -94
  253. package/dist/components/MenuBar.d.ts +0 -28
  254. package/dist/components/MenuBar.js +0 -174
  255. package/dist/components/Modal.d.ts +0 -3
  256. package/dist/components/Modal.js +0 -25
  257. package/dist/components/NoticeBox.d.ts +0 -20
  258. package/dist/components/NoticeBox.js +0 -49
  259. package/dist/components/NumberInput.d.ts +0 -45
  260. package/dist/components/NumberInput.js +0 -221
  261. package/dist/components/Popper.d.ts +0 -27
  262. package/dist/components/Popper.js +0 -177
  263. package/dist/components/ProgressBar.d.ts +0 -46
  264. package/dist/components/ProgressBar.js +0 -37
  265. package/dist/components/RestrictedInput.js +0 -155
  266. package/dist/components/RoundGauge.d.ts +0 -53
  267. package/dist/components/RoundGauge.js +0 -147
  268. package/dist/components/Section.d.ts +0 -63
  269. package/dist/components/Section.js +0 -62
  270. package/dist/components/Slider.d.ts +0 -46
  271. package/dist/components/Slider.js +0 -124
  272. package/dist/components/Stack.d.ts +0 -27
  273. package/dist/components/Stack.js +0 -67
  274. package/dist/components/StyleableSection.d.ts +0 -11
  275. package/dist/components/StyleableSection.js +0 -16
  276. package/dist/components/Table.d.ts +0 -29
  277. package/dist/components/Table.js +0 -67
  278. package/dist/components/Tabs.d.ts +0 -23
  279. package/dist/components/Tabs.js +0 -89
  280. package/dist/components/TextArea.d.ts +0 -39
  281. package/dist/components/TextArea.js +0 -118
  282. package/dist/components/TimeDisplay.js +0 -34
  283. package/dist/components/Tooltip.d.ts +0 -29
  284. package/dist/components/Tooltip.js +0 -83
  285. package/dist/components/TrackOutsideClicks.d.ts +0 -13
  286. package/dist/components/TrackOutsideClicks.js +0 -24
  287. package/dist/components/VirtualList.d.ts +0 -8
  288. package/dist/components/VirtualList.js +0 -34
  289. package/dist/components/index.js +0 -92
  290. package/dist/popper-CiqSDJTE.js +0 -906
  291. /package/{dist/components/index.d.ts → lib/components/index.ts} +0 -0
@@ -1,26 +0,0 @@
1
- import { Component, PropsWithChildren } from 'react';
2
-
3
- type Props = Partial<{
4
- /**
5
- * The interval between blinks, in milliseconds.
6
- */
7
- interval: number;
8
- /**
9
- * The time to wait before blinking again, in milliseconds.
10
- */
11
- time: number;
12
- }> & PropsWithChildren;
13
- type State = {
14
- hidden: boolean;
15
- };
16
- export declare class Blink extends Component<Props, State> {
17
- interval: NodeJS.Timeout;
18
- timer: NodeJS.Timeout;
19
- constructor(props: any);
20
- createTimer(): void;
21
- componentDidMount(): void;
22
- componentDidUpdate(prevProps: any): void;
23
- componentWillUnmount(): void;
24
- render(): import("react/jsx-runtime").JSX.Element;
25
- }
26
- export {};
@@ -1,56 +0,0 @@
1
- var n = Object.defineProperty;
2
- var a = (i, e, t) => e in i ? n(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var s = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { jsx as l } from "react/jsx-runtime";
5
- import { Component as o } from "react";
6
- const h = 1e3, m = 1e3;
7
- class v extends o {
8
- constructor(t) {
9
- super(t);
10
- s(this, "interval");
11
- s(this, "timer");
12
- this.state = {
13
- hidden: !1
14
- };
15
- }
16
- createTimer() {
17
- const {
18
- interval: t = h,
19
- time: r = m
20
- } = this.props;
21
- clearInterval(this.interval), clearTimeout(this.timer), this.setState({
22
- hidden: !1
23
- }), this.interval = setInterval(() => {
24
- this.setState({
25
- hidden: !0
26
- }), this.timer = setTimeout(() => {
27
- this.setState({
28
- hidden: !1
29
- });
30
- }, r);
31
- }, t + r);
32
- }
33
- componentDidMount() {
34
- this.createTimer();
35
- }
36
- componentDidUpdate(t) {
37
- (t.interval !== this.props.interval || t.time !== this.props.time) && this.createTimer();
38
- }
39
- componentWillUnmount() {
40
- clearInterval(this.interval), clearTimeout(this.timer);
41
- }
42
- render() {
43
- return /* @__PURE__ */ l(
44
- "span",
45
- {
46
- style: {
47
- visibility: this.state.hidden ? "hidden" : "visible"
48
- },
49
- children: this.props.children
50
- }
51
- );
52
- }
53
- }
54
- export {
55
- v as Blink
56
- };
@@ -1,3 +0,0 @@
1
- import { BoxProps } from './Box';
2
-
3
- export declare function BlockQuote(props: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { classes as e } from "../common/react.js";
3
- import { Box as r } from "./Box.js";
4
- import '../assets/BlockQuote.css';const l = "_blockQuote_14fvy_13", m = {
5
- blockQuote: l
6
- };
7
- function f(o) {
8
- const { className: t, ...s } = o;
9
- return /* @__PURE__ */ c(r, { className: e([m.blockQuote, t]), ...s });
10
- }
11
- export {
12
- f as BlockQuote
13
- };
@@ -1,28 +0,0 @@
1
- import { Component } from 'react';
2
-
3
- export declare enum BodyZone {
4
- Chest = "chest",
5
- Eyes = "eyes",
6
- Groin = "groin",
7
- Head = "head",
8
- LeftArm = "l_arm",
9
- LeftLeg = "l_leg",
10
- Mouth = "mouth",
11
- RightArm = "r_arm",
12
- RightLeg = "r_leg"
13
- }
14
- type BodyZoneSelectorProps = {
15
- onClick?: (zone: BodyZone) => void;
16
- scale?: number;
17
- selectedZone: BodyZone | null;
18
- theme?: string;
19
- };
20
- type BodyZoneSelectorState = {
21
- hoverZone: BodyZone | null;
22
- };
23
- export declare class BodyZoneSelector extends Component<BodyZoneSelectorProps, BodyZoneSelectorState> {
24
- ref: import('react').RefObject<HTMLDivElement>;
25
- state: BodyZoneSelectorState;
26
- render(): import("react/jsx-runtime").JSX.Element;
27
- }
28
- export {};
@@ -1,115 +0,0 @@
1
- var g = Object.defineProperty;
2
- var _ = (e, t, s) => t in e ? g(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var l = (e, t, s) => _(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { jsxs as d, jsx as h } from "react/jsx-runtime";
5
- import { Component as v, createRef as $ } from "react";
6
- import { resolveAsset as p } from "../common/assets.js";
7
- import { Image as f } from "./Image.js";
8
- var b = /* @__PURE__ */ ((e) => (e.Chest = "chest", e.Eyes = "eyes", e.Groin = "groin", e.Head = "head", e.LeftArm = "l_arm", e.LeftLeg = "l_leg", e.Mouth = "mouth", e.RightArm = "r_arm", e.RightLeg = "r_leg", e))(b || {});
9
- const C = (e, t) => {
10
- if (t < 1)
11
- return null;
12
- if (t < 10) {
13
- if (e > 10 && e < 15)
14
- return "r_leg";
15
- if (e > 17 && e < 22)
16
- return "l_leg";
17
- } else if (t < 13) {
18
- if (e > 8 && e < 11)
19
- return "r_arm";
20
- if (e > 12 && e < 20)
21
- return "groin";
22
- if (e > 21 && e < 24)
23
- return "l_arm";
24
- } else if (t < 22) {
25
- if (e > 8 && e < 11)
26
- return "r_arm";
27
- if (e > 12 && e < 20)
28
- return "chest";
29
- if (e > 21 && e < 24)
30
- return "l_arm";
31
- } else if (t < 30 && e > 12 && e < 20)
32
- return t > 23 && t < 24 && e > 15 && e < 17 ? "mouth" : t > 25 && t < 27 && e > 14 && e < 18 ? "eyes" : "head";
33
- return null;
34
- };
35
- class A extends v {
36
- constructor() {
37
- super(...arguments);
38
- l(this, "ref", $());
39
- l(this, "state", {
40
- hoverZone: null
41
- });
42
- }
43
- render() {
44
- const { hoverZone: s } = this.state, { scale: r = 3, selectedZone: n, theme: c = "midnight" } = this.props;
45
- return /* @__PURE__ */ d(
46
- "div",
47
- {
48
- ref: this.ref,
49
- style: {
50
- width: `${32 * r}px`,
51
- height: `${32 * r}px`,
52
- position: "relative"
53
- },
54
- children: [
55
- /* @__PURE__ */ h(
56
- f,
57
- {
58
- src: p(`body_zones.base_${c}.png`),
59
- onClick: () => {
60
- const i = this.props.onClick;
61
- i && this.state.hoverZone && i(this.state.hoverZone);
62
- },
63
- onMouseMove: (i) => {
64
- var u;
65
- if (!this.props.onClick)
66
- return;
67
- const o = (u = this.ref.current) == null ? void 0 : u.getBoundingClientRect();
68
- if (!o)
69
- return;
70
- const a = i.clientX - o.left, m = 32 * r - (i.clientY - o.top);
71
- this.setState({
72
- hoverZone: C(a / r, m / r)
73
- });
74
- },
75
- style: {
76
- position: "absolute",
77
- width: `${32 * r}px`,
78
- height: `${32 * r}px`
79
- }
80
- }
81
- ),
82
- n && /* @__PURE__ */ h(
83
- f,
84
- {
85
- src: p(`body_zones.${n}.png`),
86
- style: {
87
- pointerEvents: "none",
88
- position: "absolute",
89
- width: `${32 * r}px`,
90
- height: `${32 * r}px`
91
- }
92
- }
93
- ),
94
- s && s !== n && /* @__PURE__ */ h(
95
- f,
96
- {
97
- src: p(`body_zones.${s}.png`),
98
- style: {
99
- opacity: "0.5",
100
- pointerEvents: "none",
101
- position: "absolute",
102
- width: `${32 * r}px`,
103
- height: `${32 * r}px`
104
- }
105
- }
106
- )
107
- ]
108
- }
109
- );
110
- }
111
- }
112
- export {
113
- b as BodyZone,
114
- A as BodyZoneSelector
115
- };
@@ -1,91 +0,0 @@
1
- import { CSSProperties, KeyboardEventHandler, MouseEventHandler, ReactNode, UIEventHandler } from 'react';
2
- import { BooleanLike } from '../common/react';
3
-
4
- type BooleanProps = Partial<Record<keyof typeof booleanStyleMap, boolean>>;
5
- type StringProps = Partial<Record<keyof typeof stringStyleMap, string | BooleanLike>>;
6
- export type EventHandlers = Partial<{
7
- onClick: MouseEventHandler<HTMLDivElement>;
8
- onContextMenu: MouseEventHandler<HTMLDivElement>;
9
- onDoubleClick: MouseEventHandler<HTMLDivElement>;
10
- onKeyDown: KeyboardEventHandler<HTMLDivElement>;
11
- onKeyUp: KeyboardEventHandler<HTMLDivElement>;
12
- onMouseDown: MouseEventHandler<HTMLDivElement>;
13
- onMouseMove: MouseEventHandler<HTMLDivElement>;
14
- onMouseOver: MouseEventHandler<HTMLDivElement>;
15
- onMouseUp: MouseEventHandler<HTMLDivElement>;
16
- onScroll: UIEventHandler<HTMLDivElement>;
17
- }>;
18
- export type BoxProps = Partial<{
19
- as: string;
20
- children: ReactNode;
21
- className: string | BooleanLike;
22
- style: CSSProperties;
23
- }> & BooleanProps & StringProps & EventHandlers;
24
- type DangerDoNotUse = {
25
- dangerouslySetInnerHTML?: {
26
- __html: any;
27
- };
28
- };
29
- /**
30
- * Coverts our rem-like spacing unit into a CSS unit.
31
- */
32
- export declare function unit(value: unknown): string | undefined;
33
- /**
34
- * Same as `unit`, but half the size for integers numbers.
35
- */
36
- export declare function halfUnit(value: unknown): string | undefined;
37
- declare const stringStyleMap: {
38
- readonly align: (style: any, value: any) => void;
39
- readonly bottom: (style: any, value: any) => void;
40
- readonly fontFamily: (style: any, value: any) => void;
41
- readonly fontSize: (style: any, value: any) => void;
42
- readonly fontWeight: (style: any, value: any) => void;
43
- readonly height: (style: any, value: any) => void;
44
- readonly left: (style: any, value: any) => void;
45
- readonly maxHeight: (style: any, value: any) => void;
46
- readonly maxWidth: (style: any, value: any) => void;
47
- readonly minHeight: (style: any, value: any) => void;
48
- readonly minWidth: (style: any, value: any) => void;
49
- readonly opacity: (style: any, value: any) => void;
50
- readonly overflow: (style: any, value: any) => void;
51
- readonly overflowX: (style: any, value: any) => void;
52
- readonly overflowY: (style: any, value: any) => void;
53
- readonly position: (style: any, value: any) => void;
54
- readonly right: (style: any, value: any) => void;
55
- readonly textAlign: (style: any, value: any) => void;
56
- readonly top: (style: any, value: any) => void;
57
- readonly verticalAlign: (style: any, value: any) => void;
58
- readonly width: (style: any, value: any) => void;
59
- readonly lineHeight: (style: any, value: any) => void;
60
- readonly m: (style: any, value: any) => void;
61
- readonly mb: (style: any, value: any) => void;
62
- readonly ml: (style: any, value: any) => void;
63
- readonly mr: (style: any, value: any) => void;
64
- readonly mt: (style: any, value: any) => void;
65
- readonly mx: (style: any, value: any) => void;
66
- readonly my: (style: any, value: any) => void;
67
- readonly p: (style: any, value: any) => void;
68
- readonly pb: (style: any, value: any) => void;
69
- readonly pl: (style: any, value: any) => void;
70
- readonly pr: (style: any, value: any) => void;
71
- readonly pt: (style: any, value: any) => void;
72
- readonly px: (style: any, value: any) => void;
73
- readonly py: (style: any, value: any) => void;
74
- readonly color: (style: any, value: any) => void;
75
- readonly textColor: (style: any, value: any) => void;
76
- readonly backgroundColor: (style: any, value: any) => void;
77
- };
78
- declare const booleanStyleMap: {
79
- readonly bold: (style: any, value: any) => void;
80
- readonly fillPositionedParent: (style: any, value: any) => void;
81
- readonly inline: (style: any, value: any) => void;
82
- readonly italic: (style: any, value: any) => void;
83
- readonly nowrap: (style: any, value: any) => void;
84
- readonly preserveWhitespace: (style: any, value: any) => void;
85
- };
86
- export declare function computeBoxProps(props: any): Record<string, any>;
87
- export declare function computeBoxClassName(props: BoxProps): string;
88
- export declare function Box(props: BoxProps & DangerDoNotUse): import('react').ReactElement<{
89
- className: string;
90
- }, string | import('react').JSXElementConstructor<any>>;
91
- export {};
@@ -1,133 +0,0 @@
1
- import { createElement as y } from "react";
2
- import { CSS_COLORS as b } from "../common/constants.js";
3
- import { classes as u } from "../common/react.js";
4
- function p(o) {
5
- if (typeof o == "string")
6
- return o.endsWith("px") ? parseFloat(o) / 12 + "rem" : o;
7
- if (typeof o == "number")
8
- return o + "rem";
9
- }
10
- function r(o) {
11
- if (typeof o == "string")
12
- return p(o);
13
- if (typeof o == "number")
14
- return p(o * 0.5);
15
- }
16
- function x(o) {
17
- return !a(o);
18
- }
19
- function a(o) {
20
- return typeof o == "string" && b.includes(o);
21
- }
22
- const m = (o) => (t, i) => {
23
- (typeof i == "number" || typeof i == "string") && (t[o] = i);
24
- }, n = (o, t) => (i, e) => {
25
- (typeof e == "number" || typeof e == "string") && (i[o] = t(e));
26
- }, l = (o, t) => (i, e) => {
27
- e && (i[o] = t);
28
- }, g = (o, t, i) => (e, f) => {
29
- if (typeof f == "number" || typeof f == "string")
30
- for (let c = 0; c < i.length; c++)
31
- e[o + "-" + i[c]] = t(f);
32
- }, s = (o) => (t, i) => {
33
- x(i) && (t[o] = i);
34
- }, C = {
35
- align: m("textAlign"),
36
- bottom: n("bottom", p),
37
- fontFamily: m("fontFamily"),
38
- fontSize: n("fontSize", p),
39
- fontWeight: m("fontWeight"),
40
- height: n("height", p),
41
- left: n("left", p),
42
- maxHeight: n("maxHeight", p),
43
- maxWidth: n("maxWidth", p),
44
- minHeight: n("minHeight", p),
45
- minWidth: n("minWidth", p),
46
- opacity: m("opacity"),
47
- overflow: m("overflow"),
48
- overflowX: m("overflowX"),
49
- overflowY: m("overflowY"),
50
- position: m("position"),
51
- right: n("right", p),
52
- textAlign: m("textAlign"),
53
- top: n("top", p),
54
- verticalAlign: m("verticalAlign"),
55
- width: n("width", p),
56
- lineHeight: (o, t) => {
57
- typeof t == "number" ? o.lineHeight = t : typeof t == "string" && (o.lineHeight = p(t));
58
- },
59
- // Margin
60
- m: g("margin", r, [
61
- "Top",
62
- "Bottom",
63
- "Left",
64
- "Right"
65
- ]),
66
- mb: n("marginBottom", r),
67
- ml: n("marginLeft", r),
68
- mr: n("marginRight", r),
69
- mt: n("marginTop", r),
70
- mx: g("margin", r, ["Left", "Right"]),
71
- my: g("margin", r, ["Top", "Bottom"]),
72
- // Padding
73
- p: g("padding", r, [
74
- "Top",
75
- "Bottom",
76
- "Left",
77
- "Right"
78
- ]),
79
- pb: n("paddingBottom", r),
80
- pl: n("paddingLeft", r),
81
- pr: n("paddingRight", r),
82
- pt: n("paddingTop", r),
83
- px: g("padding", r, ["Left", "Right"]),
84
- py: g("padding", r, ["Top", "Bottom"]),
85
- // Color props
86
- color: s("color"),
87
- textColor: s("color"),
88
- backgroundColor: s("backgroundColor")
89
- }, w = {
90
- bold: l("fontWeight", "bold"),
91
- fillPositionedParent: (o, t) => {
92
- t && (o.position = "absolute", o.top = 0, o.bottom = 0, o.left = 0, o.right = 0);
93
- },
94
- inline: l("display", "inline-block"),
95
- italic: l("fontStyle", "italic"),
96
- nowrap: l("whiteSpace", "nowrap"),
97
- preserveWhitespace: l("whiteSpace", "pre-wrap")
98
- };
99
- function S(o) {
100
- const t = {}, i = {};
101
- for (const e of Object.keys(o)) {
102
- if (e === "style")
103
- continue;
104
- const f = o[e], c = C[e] || w[e];
105
- c ? c(i, f) : t[e] = f;
106
- }
107
- return t.style = { ...i, ...o.style }, t;
108
- }
109
- function d(o) {
110
- const t = o.textColor || o.color, i = o.backgroundColor;
111
- return u([
112
- a(t) && "color-" + t,
113
- a(i) && "color-bg-" + i
114
- ]);
115
- }
116
- function W(o) {
117
- const { as: t = "div", className: i, children: e, ...f } = o, c = i ? `${i} ${d(f)}` : d(f), h = S(f);
118
- return y(
119
- typeof t == "string" ? t : "div",
120
- {
121
- ...h,
122
- className: c
123
- },
124
- e
125
- );
126
- }
127
- export {
128
- W as Box,
129
- d as computeBoxClassName,
130
- S as computeBoxProps,
131
- r as halfUnit,
132
- p as unit
133
- };
@@ -1,93 +0,0 @@
1
- import { Placement } from '@popperjs/core';
2
- import { ReactNode } from 'react';
3
- import { BooleanLike } from '../common/react';
4
- import { BoxProps } from './Box';
5
-
6
- /**
7
- * Getting ellipses to work requires that you use:
8
- * 1. A string rather than a node
9
- * 2. A fixed width here or in a parent
10
- * 3. Children prop rather than content
11
- */
12
- type EllipsisUnion = {
13
- children: string;
14
- /** @deprecated use children instead */
15
- content?: never;
16
- /** Cuts off text with an ellipsis */
17
- ellipsis: true;
18
- } | Partial<{
19
- children: ReactNode;
20
- /** @deprecated use children instead */
21
- content: ReactNode;
22
- ellipsis: undefined;
23
- }>;
24
- type Props = Partial<{
25
- /** Captures keyboard events */
26
- captureKeys: boolean;
27
- /** Makes the button circular */
28
- circular: boolean;
29
- /** Reduces the padding of the button */
30
- compact: boolean;
31
- /** Disables and greys out the button */
32
- disabled: BooleanLike;
33
- /** Fill all available horizontal space */
34
- fluid: boolean;
35
- /** Adds an icon to the button */
36
- icon: string | false;
37
- /** Icon color */
38
- iconColor: string;
39
- /** Icon position */
40
- iconPosition: string;
41
- /** Icon rotation */
42
- iconRotation: number;
43
- /** Makes the icon spin */
44
- iconSpin: BooleanLike;
45
- /** Called when element is clicked */
46
- onClick: (e: any) => void;
47
- /** Activates the button (gives it a green color) */
48
- selected: BooleanLike;
49
- /** A fancy, boxy tooltip, which appears when hovering over the button */
50
- tooltip: ReactNode;
51
- /** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
52
- tooltipPosition: Placement;
53
- /** Align content vertically using flex. Use lineHeight if the height is static. */
54
- verticalAlignContent: string;
55
- }> & EllipsisUnion & BoxProps;
56
- /** Clickable button. Comes with variants. Read more in the documentation. */
57
- export declare function Button(props: Props): import("react/jsx-runtime").JSX.Element;
58
- export declare namespace Button {
59
- var Checkbox: typeof ButtonCheckbox;
60
- var Confirm: typeof ButtonConfirm;
61
- var Input: typeof ButtonInput;
62
- var File: typeof ButtonFile;
63
- }
64
- type CheckProps = Partial<{
65
- checked: BooleanLike;
66
- }> & Props;
67
- /** Visually toggles between checked and unchecked states. */
68
- export declare function ButtonCheckbox(props: CheckProps): import("react/jsx-runtime").JSX.Element;
69
- type ConfirmProps = Partial<{
70
- confirmColor: string;
71
- confirmContent: ReactNode;
72
- confirmIcon: string;
73
- }> & Props;
74
- /** Requires user confirmation before triggering its action. */
75
- declare function ButtonConfirm(props: ConfirmProps): import("react/jsx-runtime").JSX.Element;
76
- type InputProps = Partial<{
77
- currentValue: string;
78
- defaultValue: string;
79
- fluid: boolean;
80
- maxLength: number;
81
- onCommit: (e: any, value: string) => void;
82
- placeholder: string;
83
- }> & Props;
84
- /** Accepts and handles user input. */
85
- declare function ButtonInput(props: InputProps): import("react/jsx-runtime").JSX.Element;
86
- type FileProps = {
87
- accept: string;
88
- multiple?: boolean;
89
- onSelectFiles: (files: string | string[]) => void;
90
- } & Props;
91
- /** Accepts file input */
92
- declare function ButtonFile(props: FileProps): import("react/jsx-runtime").JSX.Element;
93
- export {};