tgui-core 1.8.4 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) 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 +8 -6
  18. package/dist/components/Dropdown.js +137 -129
  19. package/dist/components/FitText.d.ts +1 -1
  20. package/dist/components/Floating.d.ts +75 -0
  21. package/dist/components/Floating.js +2235 -0
  22. package/dist/components/ImageButton.d.ts +2 -3
  23. package/dist/components/ImageButton.js +88 -98
  24. package/dist/components/InfinitePlane.d.ts +35 -32
  25. package/dist/components/InfinitePlane.js +123 -133
  26. package/dist/components/Knob.d.ts +22 -6
  27. package/dist/components/Knob.js +45 -46
  28. package/dist/components/MenuBar.js +81 -97
  29. package/dist/components/Modal.js +12 -12
  30. package/dist/components/NumberInput.d.ts +1 -1
  31. package/dist/components/Popper.d.ts +5 -1
  32. package/dist/components/Popper.js +1026 -121
  33. package/dist/components/ProgressBar.js +3 -3
  34. package/dist/components/RoundGauge.js +30 -30
  35. package/dist/components/Section.js +7 -7
  36. package/dist/components/Slider.d.ts +22 -6
  37. package/dist/components/Slider.js +55 -56
  38. package/dist/components/Stack.js +3 -3
  39. package/dist/components/Table.js +7 -7
  40. package/dist/components/Tabs.js +7 -7
  41. package/dist/components/TextArea.d.ts +17 -0
  42. package/dist/components/TextArea.js +35 -33
  43. package/dist/components/Tooltip.d.ts +3 -34
  44. package/dist/components/Tooltip.js +14 -77
  45. package/dist/components/TrackOutsideClicks.d.ts +1 -1
  46. package/dist/components/index.d.ts +1 -0
  47. package/dist/components/index.js +64 -62
  48. package/package.json +26 -27
  49. package/styles/base.scss +13 -11
  50. package/styles/colors.scss +63 -67
  51. package/styles/components/BlockQuote.scss +5 -8
  52. package/styles/components/Button.scss +123 -99
  53. package/styles/components/Dialog.scss +23 -30
  54. package/styles/components/Dimmer.scss +3 -8
  55. package/styles/components/Divider.scss +6 -7
  56. package/styles/components/Dropdown.scss +103 -51
  57. package/styles/components/Flex.scss +0 -1
  58. package/styles/components/Floating.scss +60 -0
  59. package/styles/components/ImageButton.scss +136 -192
  60. package/styles/components/Input.scss +24 -26
  61. package/styles/components/Knob.scss +37 -41
  62. package/styles/components/LabeledList.scss +8 -6
  63. package/styles/components/MenuBar.scss +17 -21
  64. package/styles/components/Modal.scss +8 -7
  65. package/styles/components/NoticeBox.scss +22 -26
  66. package/styles/components/NumberInput.scss +30 -28
  67. package/styles/components/ProgressBar.scss +27 -19
  68. package/styles/components/RoundGauge.scss +46 -26
  69. package/styles/components/Section.scss +17 -32
  70. package/styles/components/Slider.scss +18 -15
  71. package/styles/components/Stack.scss +8 -48
  72. package/styles/components/Table.scss +2 -2
  73. package/styles/components/Tabs.scss +92 -66
  74. package/styles/components/TextArea.scss +32 -36
  75. package/styles/components/Tooltip.scss +10 -13
  76. package/styles/functions.scss +1 -62
  77. package/styles/main.scss +6 -1
  78. package/styles/reset.scss +7 -11
  79. package/styles/vars-colors.scss +108 -0
  80. package/styles/vars-components.scss +162 -0
  81. package/styles/vars-values.scss +110 -0
  82. package/dist/popper-CiqSDJTE.js +0 -906
@@ -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';
@@ -66,14 +66,13 @@ type Props = Partial<{
66
66
  title: string;
67
67
  /** A fancy, boxy tooltip, which appears when hovering over the button */
68
68
  tooltip: ReactNode;
69
- /** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
69
+ /** Position of the tooltip. Does not guarantee the position is respected. */
70
70
  tooltipPosition: Placement;
71
71
  }> & BoxProps;
72
72
  /**
73
73
  * Stylized button, with the ability to easily and simply insert any picture into it.
74
74
  * - Without image, will be default question icon.
75
75
  * - If an image is specified but for some reason cannot be displayed, there will be a spinner fallback until it is loaded.
76
- * - Component has no **hover** effects, if `onClick` or `onRightClick` is not specified.
77
76
  */
78
77
  export declare function ImageButton(props: Props): import("react/jsx-runtime").JSX.Element;
79
78
  export {};
@@ -1,161 +1,151 @@
1
- import { jsxs as I, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
2
  import { classes as c } from "../common/react.js";
3
- import { computeBoxProps as A } from "../common/ui.js";
4
- import { DmIcon as D } from "./DmIcon.js";
5
- import { Icon as E } from "./Icon.js";
3
+ import { computeBoxProps as D } from "../common/ui.js";
4
+ import { DmIcon as j } from "./DmIcon.js";
5
+ import { Icon as A } from "./Icon.js";
6
6
  import { Image as y } from "./Image.js";
7
7
  import { Stack as N } from "./Stack.js";
8
8
  import { Tooltip as F } from "./Tooltip.js";
9
- function W(d) {
9
+ function W(r) {
10
10
  const {
11
- asset: m,
11
+ asset: l,
12
12
  assetSize: u = 32,
13
- base64: a,
14
- buttons: p,
15
- buttonsAlt: g,
16
- children: s,
13
+ base64: o,
14
+ buttons: _,
15
+ buttonsAlt: h,
16
+ children: n,
17
17
  className: k,
18
- color: e,
19
- disabled: i,
18
+ color: d,
19
+ disabled: a,
20
20
  dmFallback: v,
21
- dmIcon: b,
22
- dmIconState: x,
23
- fluid: o,
24
- imageSize: n = 64,
25
- imageSrc: B,
26
- onClick: r,
27
- onRightClick: f,
28
- selected: $,
29
- title: C,
30
- tooltip: _,
21
+ dmIcon: I,
22
+ dmIconState: f,
23
+ fluid: s,
24
+ imageSize: e = 64,
25
+ imageSrc: x,
26
+ onClick: m,
27
+ onRightClick: B,
28
+ selected: z,
29
+ title: b,
30
+ tooltip: $,
31
31
  tooltipPosition: S,
32
- ...z
33
- } = d;
34
- let h = /* @__PURE__ */ I(
32
+ ...C
33
+ } = r;
34
+ let p = /* @__PURE__ */ g(
35
35
  "div",
36
36
  {
37
- className: c([
38
- "container",
39
- o && (!!p || !!g) && "hasButtons",
40
- !r && !f && "noAction",
41
- $ && "ImageButton--selected",
42
- i && "ImageButton--disabled",
43
- e && typeof e == "string" ? `ImageButton--color__${e}` : "ImageButton--color__default"
44
- ]),
45
- tabIndex: i ? void 0 : 0,
46
- onClick: (l) => {
47
- !i && r && r(l);
37
+ className: "ImageButton__container",
38
+ tabIndex: a ? void 0 : 0,
39
+ onClick: (i) => {
40
+ !a && m && m(i);
48
41
  },
49
- onKeyDown: (l) => {
50
- l.key === "Enter" && !i && r && r(l);
42
+ onKeyDown: (i) => {
43
+ i.key === "Enter" && !a && m && m(i);
51
44
  },
52
- onContextMenu: (l) => {
53
- l.preventDefault(), !i && f && f(l);
45
+ onContextMenu: (i) => {
46
+ i.preventDefault(), !a && B && B(i);
54
47
  },
55
- style: { width: o ? "auto" : `calc(${n}px + 0.5em + 2px)` },
48
+ style: { width: s ? "auto" : `calc(${e}px + 0.5em + 2px)` },
56
49
  children: [
57
- /* @__PURE__ */ t("div", { className: "image", children: a || B ? /* @__PURE__ */ t(
50
+ /* @__PURE__ */ t("div", { className: "ImageButton__image", children: o || x ? /* @__PURE__ */ t(
58
51
  y,
59
52
  {
60
- src: a ? `data:image/png;base64,${a}` : B,
61
- height: `${n}px`,
62
- width: `${n}px`
53
+ src: o ? `data:image/png;base64,${o}` : x,
54
+ height: `${e}px`,
55
+ width: `${e}px`
63
56
  }
64
- ) : b && x ? /* @__PURE__ */ t(
65
- D,
57
+ ) : I && f ? /* @__PURE__ */ t(
58
+ j,
66
59
  {
67
- icon: b,
68
- icon_state: x,
69
- fallback: v || /* @__PURE__ */ t(w, { icon: "spinner", spin: !0, size: n }),
70
- height: `${n}px`,
71
- width: `${n}px`
60
+ icon: I,
61
+ icon_state: f,
62
+ fallback: v || /* @__PURE__ */ t(w, { icon: "spinner", spin: !0, size: e }),
63
+ height: `${e}px`,
64
+ width: `${e}px`
72
65
  }
73
- ) : m ? /* @__PURE__ */ t(
66
+ ) : l ? /* @__PURE__ */ t(
74
67
  y,
75
68
  {
76
- className: c(m || []),
77
- height: `${n}px`,
78
- width: `${n}px`,
69
+ className: c(l || []),
70
+ height: `${e}px`,
71
+ width: `${e}px`,
79
72
  style: {
80
- transform: `scale(${n / u})`,
73
+ transform: `scale(${e / u})`,
81
74
  transformOrigin: "top left"
82
75
  }
83
76
  }
84
- ) : /* @__PURE__ */ t(w, { icon: "question", size: n }) }),
85
- o ? /* @__PURE__ */ I("div", { className: "info", children: [
86
- C && /* @__PURE__ */ t("span", { className: c(["title", s && "divider"]), children: C }),
87
- s && /* @__PURE__ */ t("span", { className: "contentFluid", children: s })
88
- ] }) : s && /* @__PURE__ */ t(
89
- "span",
90
- {
91
- className: c([
92
- "content",
93
- $ && "ImageButton--contentSelected",
94
- i && "ImageButton--contentDisabled",
95
- e && typeof e == "string" ? `ImageButton--contentColor__${e}` : "ImageButton--contentColor__default"
96
- ]),
97
- children: s
98
- }
99
- )
77
+ ) : /* @__PURE__ */ t(w, { icon: "question", size: e }) }),
78
+ s ? /* @__PURE__ */ g("div", { className: "ImageButton__content", children: [
79
+ b && /* @__PURE__ */ t(
80
+ "span",
81
+ {
82
+ className: c([
83
+ "ImageButton__content--title",
84
+ !!n && "ImageButton__content--divider"
85
+ ]),
86
+ children: b
87
+ }
88
+ ),
89
+ n && /* @__PURE__ */ t("span", { className: "ImageButton__content--text", children: n })
90
+ ] }) : !!n && /* @__PURE__ */ t("span", { className: "ImageButton__content", children: n })
100
91
  ]
101
92
  }
102
93
  );
103
- return _ && (h = /* @__PURE__ */ t(F, { content: _, position: S, children: h })), /* @__PURE__ */ I(
94
+ return $ && (p = /* @__PURE__ */ t(F, { content: $, position: S, children: p })), /* @__PURE__ */ g(
104
95
  "div",
105
96
  {
106
97
  className: c([
107
98
  "ImageButton",
108
- o && "ImageButton--fluid",
99
+ s && "ImageButton--fluid",
100
+ z && "ImageButton--selected",
101
+ a && "ImageButton--disabled",
102
+ d && typeof d == "string" ? `ImageButton__color--${d}` : "ImageButton__color--default",
109
103
  k
110
104
  ]),
111
- ...A(z),
105
+ ...D(C),
112
106
  children: [
113
- h,
114
- p && /* @__PURE__ */ t(
107
+ p,
108
+ _ && /* @__PURE__ */ t(
115
109
  "div",
116
110
  {
117
111
  className: c([
118
- "buttonsContainer",
119
- !s && "buttonsEmpty",
120
- o && i && "ImageButton--disabled",
121
- o && e && typeof e == "string" ? `ImageButton--buttonsContainerColor__${e}` : o && "ImageButton--buttonsContainerColor__default"
112
+ "ImageButton__buttons",
113
+ !n && "ImageButton__buttons--empty"
122
114
  ]),
123
115
  style: {
124
116
  width: "auto"
125
117
  },
126
- children: p
118
+ children: _
127
119
  }
128
120
  ),
129
- g && /* @__PURE__ */ t(
121
+ h && /* @__PURE__ */ t(
130
122
  "div",
131
123
  {
132
124
  className: c([
133
- "buttonsContainer",
134
- "buttonsAltContainer",
135
- !s && "buttonsEmpty",
136
- o && i && "ImageButton--disabled",
137
- o && e && typeof e == "string" ? `ImageButton--buttonsContainerColor__${e}` : o && "ImageButton--buttonsContainerColor__default"
125
+ "ImageButton__buttons",
126
+ "ImageButton__buttons--alt",
127
+ !n && "ImageButton__buttons--empty"
138
128
  ]),
139
129
  style: {
140
- width: `calc(${n}px + ${o ? 0 : 0.5}em)`,
141
- maxWidth: o ? "auto" : `calc(${n}px + 0.5em)`
130
+ width: `calc(${e}px + ${s ? 0 : 0.5}em)`,
131
+ maxWidth: s ? "auto" : `calc(${e}px + 0.5em)`
142
132
  },
143
- children: g
133
+ children: h
144
134
  }
145
135
  )
146
136
  ]
147
137
  }
148
138
  );
149
139
  }
150
- function w(d) {
151
- const { icon: m, spin: u = !1, size: a = 64 } = d;
152
- return /* @__PURE__ */ t(N, { height: `${a}px`, width: `${a}px`, children: /* @__PURE__ */ t(N.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
153
- E,
140
+ function w(r) {
141
+ const { icon: l, spin: u = !1, size: o = 64 } = r;
142
+ return /* @__PURE__ */ t(N, { height: `${o}px`, width: `${o}px`, children: /* @__PURE__ */ t(N.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
143
+ A,
154
144
  {
155
145
  spin: u,
156
- name: m,
146
+ name: l,
157
147
  color: "gray",
158
- style: { fontSize: `calc(${a}px * 0.75)` }
148
+ style: { fontSize: `calc(${o}px * 0.75)` }
159
149
  }
160
150
  ) }) });
161
151
  }
@@ -1,35 +1,38 @@
1
- import { Component, PropsWithChildren } from 'react';
1
+ import { PropsWithChildren } from 'react';
2
2
  import { BoxProps } from './Box';
3
- export type InfinitePlaneProps = PropsWithChildren<{
4
- onZoomChange?: (newZoomValue: number) => void;
5
- onBackgroundMoved?: (newX: number, newY: number) => void;
6
- initialLeft?: number;
7
- initialTop?: number;
8
- backgroundImage?: string;
3
+ type Props = {
4
+ /** The width of the image to display. */
9
5
  imageWidth: number;
10
- } & BoxProps>;
11
- type InfinitePlaneState = {
12
- mouseDown: boolean;
13
- left: number;
14
- top: number;
15
- lastLeft: number;
16
- lastTop: number;
17
- zoom: number;
18
- };
19
- export type MouseEventExtension = {
20
- screenZoomX: number;
21
- screenZoomY: number;
22
- };
23
- export declare class InfinitePlane extends Component<InfinitePlaneProps, InfinitePlaneState> {
24
- constructor(props: InfinitePlaneProps);
25
- componentDidMount(): void;
26
- componentWillUnmount(): void;
27
- doOffsetMouse: (event: MouseEvent & MouseEventExtension) => void;
28
- handleMouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
29
- onMouseUp: () => void;
30
- handleZoomIncrease: (_event: any) => void;
31
- handleZoomDecrease: (_event: any) => void;
32
- handleMouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
33
- render(): import("react/jsx-runtime").JSX.Element;
34
- }
6
+ } & Partial<{
7
+ /** The background image to display. */
8
+ backgroundImage: string;
9
+ /** The initial left position of the image. */
10
+ initialLeft: number;
11
+ /** The initial top position of the image. */
12
+ initialTop: number;
13
+ /** A callback function that is called when the background image is moved. */
14
+ onBackgroundMoved: (newX: number, newY: number) => void;
15
+ /** A callback function that is called when the zoom value changes. */
16
+ onZoomChange: (newZoomValue: number) => void;
17
+ }> & BoxProps & PropsWithChildren;
18
+ /**
19
+ * ## InfinitePlane
20
+ * Creates a scrolling infinite plane using a background image.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <InfinitePlane imageWidth={100} backgroundImage="https://example.com/image.png">
25
+ * <Box position="absolute" top={0} left={0}>
26
+ * Hello, world!
27
+ * </Box>
28
+ * <Box position="absolute" top={0} left={100}>
29
+ * Hello, world!
30
+ * </Box>
31
+ * <Box position="absolute" top={0} left={200}>
32
+ * Hello, world!
33
+ * </Box>
34
+ * </InfinitePlane>
35
+ * ```
36
+ */
37
+ export declare function InfinitePlane(props: Props): import("react/jsx-runtime").JSX.Element;
35
38
  export {};
@@ -1,143 +1,133 @@
1
- var x = Object.defineProperty;
2
- var O = (a, s, o) => s in a ? x(a, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[s] = o;
3
- var i = (a, s, o) => O(a, typeof s != "symbol" ? s + "" : s, o);
4
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
5
- import { Component as Z } from "react";
6
- import { computeBoxProps as D } from "../common/ui.js";
7
- import { Button as w } from "./Button.js";
8
- import { ProgressBar as E } from "./ProgressBar.js";
9
- import { Stack as h } from "./Stack.js";
10
- const M = 0.5, v = 1.5, g = 0.1;
11
- class b extends Z {
12
- constructor(o) {
13
- super(o);
14
- // This is really, REALLY cursed and basically overrides a built-in browser event via propagation rules
15
- i(this, "doOffsetMouse", (o) => {
16
- const { zoom: e } = this.state;
17
- o.screenZoomX = o.screenX * e ** -1, o.screenZoomY = o.screenY * e ** -1;
18
- });
19
- i(this, "handleMouseDown", (o) => {
20
- this.setState((e) => ({
21
- mouseDown: !0,
22
- lastLeft: o.clientX - e.left,
23
- lastTop: o.clientY - e.top
24
- }));
25
- });
26
- i(this, "onMouseUp", () => {
27
- this.setState({
28
- mouseDown: !1
29
- });
30
- });
31
- i(this, "handleZoomIncrease", (o) => {
32
- const { onZoomChange: e } = this.props, { zoom: n } = this.state, t = Math.min(n + g, v);
33
- this.setState({
34
- zoom: t
35
- }), e && e(t);
36
- });
37
- i(this, "handleZoomDecrease", (o) => {
38
- const { onZoomChange: e } = this.props, { zoom: n } = this.state, t = Math.max(n - g, M);
39
- this.setState({
40
- zoom: t
41
- }), e && e(t);
42
- });
43
- i(this, "handleMouseMove", (o) => {
44
- const { onBackgroundMoved: e, initialLeft: n = 0, initialTop: t = 0 } = this.props;
45
- if (this.state.mouseDown) {
46
- let l, m;
47
- this.setState((d) => (l = o.clientX - d.lastLeft, m = o.clientY - d.lastTop, e && e(l + n, m + t), {
48
- left: l,
49
- top: m
50
- }));
51
- }
52
- });
53
- this.state = {
54
- mouseDown: !1,
55
- left: 0,
56
- top: 0,
57
- lastLeft: 0,
58
- lastTop: 0,
59
- zoom: 1
60
- };
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import { useState as i, useEffect as z } from "react";
3
+ import { computeBoxProps as A } from "../common/ui.js";
4
+ import { Button as O } from "./Button.js";
5
+ import { ProgressBar as N } from "./ProgressBar.js";
6
+ import { Stack as c } from "./Stack.js";
7
+ const f = 0.5, p = 1.5, S = 0.1;
8
+ function F(l) {
9
+ const {
10
+ backgroundImage: t,
11
+ children: r,
12
+ imageWidth: $,
13
+ initialLeft: h = 0,
14
+ initialTop: w = 0,
15
+ onBackgroundMoved: a,
16
+ onZoomChange: u,
17
+ ...M
18
+ } = l, [E, T] = i(0), [y, C] = i(0), [g, D] = i(0), [_, v] = i(!1), [x, P] = i(0), [n, V] = i(1);
19
+ function L(e) {
20
+ T(e.clientX - g), C(e.clientY - x), v(!0);
61
21
  }
62
- componentDidMount() {
63
- window.addEventListener("mouseup", this.onMouseUp), window.addEventListener("mousedown", this.doOffsetMouse), window.addEventListener("mousemove", this.doOffsetMouse), window.addEventListener("mouseup", this.doOffsetMouse);
22
+ function b(e) {
23
+ if (!_) return;
24
+ const m = e.clientX - E, s = e.clientY - y;
25
+ a == null || a(m + h, s + w), D(m), P(s);
64
26
  }
65
- componentWillUnmount() {
66
- window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousedown", this.doOffsetMouse), window.removeEventListener("mousemove", this.doOffsetMouse), window.removeEventListener("mouseup", this.doOffsetMouse);
27
+ function k() {
28
+ v(!1);
67
29
  }
68
- render() {
69
- const {
70
- children: o,
71
- backgroundImage: e,
72
- imageWidth: n,
73
- initialLeft: t = 0,
74
- initialTop: l = 0,
75
- ...m
76
- } = this.props, { left: d, top: L, zoom: u } = this.state, p = t + d, f = l + L;
77
- return /* @__PURE__ */ c(
78
- "div",
79
- {
80
- ...D({
81
- ...m,
82
- style: {
83
- ...m.style,
84
- overflow: "hidden",
85
- position: "relative"
30
+ function X(e) {
31
+ if (e === "increase" && n >= p || e === "decrease" && n <= f) return;
32
+ const s = Math.round((n + (e === "increase" ? S : -0.1)) * 10) / 10;
33
+ V(s), u == null || u(s);
34
+ }
35
+ z(() => (window.addEventListener("mouseup", k), () => {
36
+ window.removeEventListener("mouseup", k);
37
+ }), []);
38
+ const I = h + g, Z = w + x;
39
+ return /* @__PURE__ */ d(
40
+ "div",
41
+ {
42
+ ...A({
43
+ ...M,
44
+ style: {
45
+ ...M.style,
46
+ height: "100%",
47
+ overflow: "hidden",
48
+ position: "relative",
49
+ width: "100%"
50
+ }
51
+ }),
52
+ children: [
53
+ /* @__PURE__ */ o(
54
+ "div",
55
+ {
56
+ onMouseDown: L,
57
+ onMouseMove: b,
58
+ style: {
59
+ backgroundImage: `url("${t}")`,
60
+ backgroundPosition: `${I}px ${Z}px`,
61
+ backgroundRepeat: "repeat",
62
+ backgroundSize: `${n * $}px`,
63
+ height: "100%",
64
+ inset: 0,
65
+ position: "absolute",
66
+ width: "100%"
67
+ }
86
68
  }
87
- }),
69
+ ),
70
+ /* @__PURE__ */ o(
71
+ "div",
72
+ {
73
+ onMouseDown: L,
74
+ onMouseMove: b,
75
+ style: {
76
+ height: "100%",
77
+ inset: 0,
78
+ pointerEvents: "none",
79
+ position: "absolute",
80
+ transform: `translate(${I}px, ${Z}px) scale(${n})`,
81
+ transformOrigin: "top left",
82
+ width: "100%"
83
+ },
84
+ children: r
85
+ }
86
+ ),
87
+ /* @__PURE__ */ o(Y, { zoom: n, onZoomClick: X })
88
+ ]
89
+ }
90
+ );
91
+ }
92
+ function Y(l) {
93
+ const { zoom: t, onZoomClick: r } = l;
94
+ return /* @__PURE__ */ o("div", { style: { position: "absolute", top: 5, left: 5, right: 5 }, children: /* @__PURE__ */ d(c, { children: [
95
+ /* @__PURE__ */ o(c.Item, { children: /* @__PURE__ */ o(
96
+ O,
97
+ {
98
+ icon: "minus",
99
+ disabled: t <= f,
100
+ onClick: () => r(
101
+ "decrease"
102
+ /* Decrease */
103
+ )
104
+ }
105
+ ) }),
106
+ /* @__PURE__ */ o(c.Item, { grow: !0, children: /* @__PURE__ */ d(
107
+ N,
108
+ {
109
+ minValue: f,
110
+ value: t,
111
+ maxValue: p,
88
112
  children: [
89
- /* @__PURE__ */ r(
90
- "div",
91
- {
92
- onMouseDown: this.handleMouseDown,
93
- onMouseMove: this.handleMouseMove,
94
- style: {
95
- position: "fixed",
96
- height: "100%",
97
- width: "100%",
98
- backgroundImage: `url("${e}")`,
99
- backgroundPosition: `${p}px ${f}px`,
100
- backgroundRepeat: "repeat",
101
- backgroundSize: `${u * n}px`
102
- }
103
- }
104
- ),
105
- /* @__PURE__ */ r(
106
- "div",
107
- {
108
- onMouseDown: this.handleMouseDown,
109
- onMouseMove: this.handleMouseMove,
110
- style: {
111
- position: "fixed",
112
- transform: `translate(${p}px, ${f}px) scale(${u})`,
113
- transformOrigin: "top left",
114
- height: "100%",
115
- width: "100%"
116
- },
117
- children: o
118
- }
119
- ),
120
- /* @__PURE__ */ c(h, { position: "absolute", width: "100%", children: [
121
- /* @__PURE__ */ r(h.Item, { children: /* @__PURE__ */ r(w, { icon: "minus", onClick: this.handleZoomDecrease }) }),
122
- /* @__PURE__ */ r(h.Item, { grow: 1, children: /* @__PURE__ */ c(
123
- E,
124
- {
125
- minValue: M,
126
- value: u,
127
- maxValue: v,
128
- children: [
129
- u,
130
- "x"
131
- ]
132
- }
133
- ) }),
134
- /* @__PURE__ */ r(h.Item, { children: /* @__PURE__ */ r(w, { icon: "plus", onClick: this.handleZoomIncrease }) })
135
- ] })
113
+ t,
114
+ "x"
136
115
  ]
137
116
  }
138
- );
139
- }
117
+ ) }),
118
+ /* @__PURE__ */ o(c.Item, { children: /* @__PURE__ */ o(
119
+ O,
120
+ {
121
+ icon: "plus",
122
+ disabled: t >= p,
123
+ onClick: () => r(
124
+ "increase"
125
+ /* Increase */
126
+ )
127
+ }
128
+ ) })
129
+ ] }) });
140
130
  }
141
131
  export {
142
- b as InfinitePlane
132
+ F as InfinitePlane
143
133
  };
@@ -10,7 +10,10 @@ type Props = {
10
10
  bipolar: boolean;
11
11
  /** Color of the outer ring around the knob. */
12
12
  color: string | BooleanLike;
13
- /** If set, this value will be used to set the fill percentage of the outer ring independently of the main value. */
13
+ /**
14
+ * If set, this value will be used to set the fill percentage of the outer
15
+ * ring independently of the main value.
16
+ */
14
17
  fillValue: number;
15
18
  /** Format value using this function before displaying it. */
16
19
  format: (value: number) => string;
@@ -20,18 +23,31 @@ type Props = {
20
23
  minValue: number;
21
24
  /** Adjust value by this amount when dragging the input. */
22
25
  onChange: (event: Event, value: number) => void;
23
- /** An event, which fires about every 500ms when you drag the input up and down, on release and on manual editing. */
26
+ /**
27
+ * An event, which fires about every 500ms when you drag the input up and
28
+ * down, on release and on manual editing.
29
+ */
24
30
  onDrag: (event: Event, value: number) => void;
25
- /** Applies a `color` to the outer ring around the knob based on whether the value lands in the range between `from` and `to`. */
31
+ /**
32
+ * Applies a `color` to the outer ring around the knob based on whether the
33
+ * value lands in the range between `from` and `to`.
34
+ */
26
35
  ranges: Record<string, [number, number]>;
27
- /** Relative size of the knob. `1` is normal size, `2` is two times bigger. Fractional numbers are supported. */
36
+ /**
37
+ * Relative size of the knob. `1` is normal size, `2` is two times bigger.
38
+ * Fractional numbers are supported.
39
+ */
28
40
  size: number;
29
41
  /** Adjust value by this amount when dragging the input. */
30
42
  step: number;
31
43
  /** Screen distance mouse needs to travel to adjust value by one `step`. */
32
44
  stepPixelSize: number;
33
- /** A number in milliseconds, for which the input will hold off from updating while events propagate through the backend. Default is about 250ms, increase it if you still see flickering. */
34
- suppressFlicker: boolean;
45
+ /**
46
+ * A number in milliseconds, for which the input will hold off from updating
47
+ * while events propagate through the backend. Default is about 250ms,
48
+ * increase it if you still see flickering.
49
+ */
50
+ suppressFlicker: number;
35
51
  /** Whether to clamp the value to the range. */
36
52
  unclamped: boolean;
37
53
  /** Unit to display to the right of value. */