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.
- package/dist/common/constants.d.ts +4 -0
- package/dist/common/constants.js +17 -0
- package/dist/common/hotkeys.js +48 -48
- package/dist/common/ui.d.ts +6 -0
- package/dist/common/ui.js +63 -59
- package/dist/components/AnimatedNumber.d.ts +1 -1
- package/dist/components/Button.d.ts +3 -3
- package/dist/components/Button.js +21 -22
- package/dist/components/Chart.d.ts +3 -15
- package/dist/components/Chart.js +68 -86
- package/dist/components/ColorBox.js +3 -3
- package/dist/components/Dialog.d.ts +16 -0
- package/dist/components/Dialog.js +5 -5
- package/dist/components/DmIcon.d.ts +1 -1
- package/dist/components/DraggableControl.d.ts +56 -0
- package/dist/components/DraggableControl.js +126 -176
- package/dist/components/Dropdown.d.ts +8 -6
- package/dist/components/Dropdown.js +137 -129
- package/dist/components/FitText.d.ts +1 -1
- package/dist/components/Floating.d.ts +75 -0
- package/dist/components/Floating.js +2235 -0
- package/dist/components/ImageButton.d.ts +2 -3
- package/dist/components/ImageButton.js +88 -98
- package/dist/components/InfinitePlane.d.ts +35 -32
- package/dist/components/InfinitePlane.js +123 -133
- package/dist/components/Knob.d.ts +22 -6
- package/dist/components/Knob.js +45 -46
- package/dist/components/MenuBar.js +81 -97
- package/dist/components/Modal.js +12 -12
- package/dist/components/NumberInput.d.ts +1 -1
- package/dist/components/Popper.d.ts +5 -1
- package/dist/components/Popper.js +1026 -121
- package/dist/components/ProgressBar.js +3 -3
- package/dist/components/RoundGauge.js +30 -30
- package/dist/components/Section.js +7 -7
- package/dist/components/Slider.d.ts +22 -6
- package/dist/components/Slider.js +55 -56
- package/dist/components/Stack.js +3 -3
- package/dist/components/Table.js +7 -7
- package/dist/components/Tabs.js +7 -7
- package/dist/components/TextArea.d.ts +17 -0
- package/dist/components/TextArea.js +35 -33
- package/dist/components/Tooltip.d.ts +3 -34
- package/dist/components/Tooltip.js +14 -77
- package/dist/components/TrackOutsideClicks.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +64 -62
- package/package.json +26 -27
- package/styles/base.scss +13 -11
- package/styles/colors.scss +63 -67
- package/styles/components/BlockQuote.scss +5 -8
- package/styles/components/Button.scss +123 -99
- package/styles/components/Dialog.scss +23 -30
- package/styles/components/Dimmer.scss +3 -8
- package/styles/components/Divider.scss +6 -7
- package/styles/components/Dropdown.scss +103 -51
- package/styles/components/Flex.scss +0 -1
- package/styles/components/Floating.scss +60 -0
- package/styles/components/ImageButton.scss +136 -192
- package/styles/components/Input.scss +24 -26
- package/styles/components/Knob.scss +37 -41
- package/styles/components/LabeledList.scss +8 -6
- package/styles/components/MenuBar.scss +17 -21
- package/styles/components/Modal.scss +8 -7
- package/styles/components/NoticeBox.scss +22 -26
- package/styles/components/NumberInput.scss +30 -28
- package/styles/components/ProgressBar.scss +27 -19
- package/styles/components/RoundGauge.scss +46 -26
- package/styles/components/Section.scss +17 -32
- package/styles/components/Slider.scss +18 -15
- package/styles/components/Stack.scss +8 -48
- package/styles/components/Table.scss +2 -2
- package/styles/components/Tabs.scss +92 -66
- package/styles/components/TextArea.scss +32 -36
- package/styles/components/Tooltip.scss +10 -13
- package/styles/functions.scss +1 -62
- package/styles/main.scss +6 -1
- package/styles/reset.scss +7 -11
- package/styles/vars-colors.scss +108 -0
- package/styles/vars-components.scss +162 -0
- package/styles/vars-values.scss +110 -0
- package/dist/popper-CiqSDJTE.js +0 -906
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as B, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { CSS_COLORS as C } from "../common/constants.js";
|
|
3
|
-
import { keyOfMatchingRange as P, toFixed as h,
|
|
3
|
+
import { keyOfMatchingRange as P, toFixed as h, clamp01 as x, scale as _ } from "../common/math.js";
|
|
4
4
|
import { classes as v } from "../common/react.js";
|
|
5
5
|
import { computeBoxProps as y, computeBoxClassName as N } from "../common/ui.js";
|
|
6
6
|
function j(n) {
|
|
@@ -13,8 +13,8 @@ function j(n) {
|
|
|
13
13
|
ranges: p = {},
|
|
14
14
|
children: r,
|
|
15
15
|
...l
|
|
16
|
-
} = n, a =
|
|
17
|
-
width: `${
|
|
16
|
+
} = n, a = _(o, d, f), g = r !== void 0, s = u || P(o, p) || "default", e = y(l), t = ["ProgressBar", m, N(l)], c = {
|
|
17
|
+
width: `${x(a) * 100}%`
|
|
18
18
|
};
|
|
19
19
|
return C.includes(s) || s === "default" ? t.push(`ProgressBar--color--${s}`) : (e.style = { ...e.style, borderColor: s }, c.backgroundColor = s), /* @__PURE__ */ B("div", { className: v(t), ...e, children: [
|
|
20
20
|
/* @__PURE__ */ i(
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { scale as d, keyOfMatchingRange as M, clamp01 as
|
|
2
|
+
import { scale as d, keyOfMatchingRange as M, clamp01 as v } from "../common/math.js";
|
|
3
3
|
import { classes as p } from "../common/react.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AnimatedNumber as
|
|
6
|
-
|
|
7
|
-
function z(h) {
|
|
4
|
+
import { computeBoxProps as k, computeBoxClassName as $ } from "../common/ui.js";
|
|
5
|
+
import { AnimatedNumber as B } from "./AnimatedNumber.js";
|
|
6
|
+
function b(_) {
|
|
8
7
|
const {
|
|
9
8
|
alertAfter: a,
|
|
10
9
|
alertBefore: t,
|
|
11
|
-
className:
|
|
10
|
+
className: h,
|
|
12
11
|
format: R,
|
|
13
12
|
maxValue: c = 1,
|
|
14
|
-
minValue:
|
|
13
|
+
minValue: u = 1,
|
|
15
14
|
ranges: n,
|
|
16
15
|
size: y = 1,
|
|
17
|
-
style:
|
|
16
|
+
style: G,
|
|
18
17
|
value: r,
|
|
19
18
|
...g
|
|
20
|
-
} =
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
} = _, N = d(r, u, c), f = v(N), s = n ? {} : { primary: [0, 1] };
|
|
20
|
+
if (n)
|
|
21
|
+
for (const o in n) {
|
|
22
|
+
const l = n[o];
|
|
23
|
+
s[o] = [
|
|
24
|
+
d(l[0], u, c),
|
|
25
|
+
d(l[1], u, c)
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
function x() {
|
|
29
29
|
return !!(a && t && r > a && r < t || a && r > a || t && r < t);
|
|
30
30
|
}
|
|
31
|
-
const C =
|
|
32
|
-
return /* @__PURE__ */ m(
|
|
31
|
+
const C = x() && M(f, s);
|
|
32
|
+
return /* @__PURE__ */ m("div", { className: "RoundGauge__wrapper", children: [
|
|
33
33
|
/* @__PURE__ */ e(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
36
|
className: p([
|
|
37
37
|
"RoundGauge",
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
h,
|
|
39
|
+
$(g)
|
|
40
40
|
]),
|
|
41
|
-
...
|
|
41
|
+
...k({
|
|
42
42
|
style: {
|
|
43
43
|
fontSize: `${y}em`,
|
|
44
|
-
...
|
|
44
|
+
...G
|
|
45
45
|
},
|
|
46
46
|
...g
|
|
47
47
|
}),
|
|
@@ -57,24 +57,24 @@ function z(h) {
|
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
59
|
/* @__PURE__ */ e("g", { children: /* @__PURE__ */ e("circle", { className: "RoundGauge__ringTrack", cx: "50", cy: "50", r: "45" }) }),
|
|
60
|
-
/* @__PURE__ */ e("g", { children: Object.keys(
|
|
61
|
-
const
|
|
60
|
+
/* @__PURE__ */ e("g", { children: Object.keys(s).map((o, l) => {
|
|
61
|
+
const i = s[o];
|
|
62
62
|
return /* @__PURE__ */ e(
|
|
63
63
|
"circle",
|
|
64
64
|
{
|
|
65
65
|
className: `RoundGauge__ringFill RoundGauge--color--${o}`,
|
|
66
66
|
style: {
|
|
67
67
|
strokeDashoffset: Math.max(
|
|
68
|
-
(2 - (
|
|
68
|
+
(2 - (i[1] - i[0])) * Math.PI * 50,
|
|
69
69
|
0
|
|
70
70
|
)
|
|
71
71
|
},
|
|
72
|
-
transform: `rotate(${180 + 180 *
|
|
72
|
+
transform: `rotate(${180 + 180 * i[0]} 50 50)`,
|
|
73
73
|
cx: "50",
|
|
74
74
|
cy: "50",
|
|
75
75
|
r: "45"
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
l
|
|
78
78
|
);
|
|
79
79
|
}) }),
|
|
80
80
|
/* @__PURE__ */ m(
|
|
@@ -106,9 +106,9 @@ function z(h) {
|
|
|
106
106
|
] })
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
|
-
/* @__PURE__ */ e(
|
|
109
|
+
/* @__PURE__ */ e(B, { value: r, format: R })
|
|
110
110
|
] });
|
|
111
111
|
}
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
b as RoundGauge
|
|
114
114
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as C, useRef as P, useEffect as g } from "react";
|
|
3
3
|
import { addScrollableNode as j, removeScrollableNode as w } from "../common/events.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { canRender as s, classes as a } from "../common/react.js";
|
|
5
|
+
import { computeBoxProps as z, computeBoxClassName as B } from "../common/ui.js";
|
|
6
6
|
const q = C(
|
|
7
7
|
(d, m) => {
|
|
8
8
|
const {
|
|
@@ -20,14 +20,14 @@ const q = C(
|
|
|
20
20
|
stretchContents: x,
|
|
21
21
|
title: r,
|
|
22
22
|
...l
|
|
23
|
-
} = d, v = P(null), e = m || v, T =
|
|
23
|
+
} = d, v = P(null), e = m || v, T = s(r) || s(o);
|
|
24
24
|
return g(() => (e != null && e.current && (n || c) && j(e.current), () => {
|
|
25
25
|
e != null && e.current && w(e.current);
|
|
26
26
|
}), []), /* @__PURE__ */ i(
|
|
27
27
|
"div",
|
|
28
28
|
{
|
|
29
29
|
id: _,
|
|
30
|
-
className:
|
|
30
|
+
className: a([
|
|
31
31
|
"Section",
|
|
32
32
|
u && "Section--fill",
|
|
33
33
|
p && "Section--fitted",
|
|
@@ -35,9 +35,9 @@ const q = C(
|
|
|
35
35
|
c && "Section--scrollableHorizontal",
|
|
36
36
|
N && "Section--flex",
|
|
37
37
|
S,
|
|
38
|
-
|
|
38
|
+
B(l)
|
|
39
39
|
]),
|
|
40
|
-
...
|
|
40
|
+
...z(l),
|
|
41
41
|
children: [
|
|
42
42
|
T && /* @__PURE__ */ i("div", { className: "Section__title", children: [
|
|
43
43
|
/* @__PURE__ */ t("span", { className: "Section__titleText", children: r }),
|
|
@@ -46,7 +46,7 @@ const q = C(
|
|
|
46
46
|
/* @__PURE__ */ t("div", { className: "Section__rest", children: /* @__PURE__ */ t(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
|
-
className:
|
|
49
|
+
className: a([
|
|
50
50
|
"Section__content",
|
|
51
51
|
x && "Section__content--stretchContents",
|
|
52
52
|
h && "Section__content--noTopPadding"
|
|
@@ -16,22 +16,38 @@ type Props = {
|
|
|
16
16
|
color: string;
|
|
17
17
|
/** Disables the slider. */
|
|
18
18
|
disabled: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* If set, this value will be used to set the fill percentage of the
|
|
21
|
+
* progress bar filler independently of the main value.
|
|
22
|
+
*/
|
|
20
23
|
fillValue: number;
|
|
21
24
|
/** Format value using this function before displaying it. */
|
|
22
25
|
format: (value: number) => string;
|
|
23
26
|
/** Adjust value by this amount when dragging the input. */
|
|
24
27
|
onChange: (event: Event, value: number) => void;
|
|
25
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* An event which fires when you release the input or successfully enter
|
|
30
|
+
* a number.
|
|
31
|
+
*/
|
|
26
32
|
onDrag: (event: Event, value: number) => void;
|
|
27
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Applies a `color` to the slider based on whether the value lands in the
|
|
35
|
+
* range between `from` and `to`.
|
|
36
|
+
*/
|
|
28
37
|
ranges: Record<string, [number, number]>;
|
|
29
38
|
/** Screen distance mouse needs to travel to adjust value by one `step`. */
|
|
30
39
|
step: number;
|
|
31
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* The sensitivity of the slider. Adjust this if it feels too slow/fast
|
|
42
|
+
* while dragging. Use higher for larger sliders. Default is 1.
|
|
43
|
+
*/
|
|
32
44
|
stepPixelSize: number;
|
|
33
|
-
/**
|
|
34
|
-
|
|
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
|
/** Unit to display to the right of value. */
|
|
36
52
|
unit: string;
|
|
37
53
|
}> & BoxProps & PropsWithChildren;
|
|
@@ -1,80 +1,79 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { keyOfMatchingRange as
|
|
3
|
-
import { classes as
|
|
4
|
-
import {
|
|
5
|
-
import { DraggableControl as
|
|
6
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { keyOfMatchingRange as E, clamp01 as r, scale as u } from "../common/math.js";
|
|
3
|
+
import { classes as g } from "../common/react.js";
|
|
4
|
+
import { computeBoxProps as O, computeBoxClassName as b } from "../common/ui.js";
|
|
5
|
+
import { DraggableControl as z } from "./DraggableControl.js";
|
|
6
|
+
function I(f) {
|
|
7
7
|
const {
|
|
8
8
|
// Draggable props (passthrough)
|
|
9
|
-
animated:
|
|
10
|
-
format:
|
|
11
|
-
maxValue:
|
|
12
|
-
minValue:
|
|
13
|
-
onChange:
|
|
14
|
-
onDrag:
|
|
15
|
-
step:
|
|
16
|
-
stepPixelSize:
|
|
17
|
-
suppressFlicker:
|
|
18
|
-
unit:
|
|
19
|
-
value:
|
|
9
|
+
animated: _,
|
|
10
|
+
format: h,
|
|
11
|
+
maxValue: a,
|
|
12
|
+
minValue: l,
|
|
13
|
+
onChange: v,
|
|
14
|
+
onDrag: N,
|
|
15
|
+
step: x,
|
|
16
|
+
stepPixelSize: y,
|
|
17
|
+
suppressFlicker: B,
|
|
18
|
+
unit: P,
|
|
19
|
+
value: i,
|
|
20
20
|
// Own props
|
|
21
21
|
className: S,
|
|
22
|
-
fillValue:
|
|
22
|
+
fillValue: s,
|
|
23
23
|
color: V,
|
|
24
24
|
ranges: C = {},
|
|
25
|
-
children:
|
|
26
|
-
...
|
|
27
|
-
} =
|
|
25
|
+
children: o,
|
|
26
|
+
...t
|
|
27
|
+
} = f, D = o !== void 0;
|
|
28
28
|
return /* @__PURE__ */ e(
|
|
29
|
-
|
|
29
|
+
z,
|
|
30
30
|
{
|
|
31
31
|
dragMatrix: [1, 0],
|
|
32
|
-
animated:
|
|
33
|
-
format:
|
|
34
|
-
maxValue:
|
|
35
|
-
minValue:
|
|
36
|
-
onChange:
|
|
37
|
-
onDrag:
|
|
38
|
-
step:
|
|
39
|
-
stepPixelSize:
|
|
40
|
-
suppressFlicker:
|
|
41
|
-
unit:
|
|
42
|
-
value:
|
|
32
|
+
animated: _,
|
|
33
|
+
format: h,
|
|
34
|
+
maxValue: a,
|
|
35
|
+
minValue: l,
|
|
36
|
+
onChange: v,
|
|
37
|
+
onDrag: N,
|
|
38
|
+
step: x,
|
|
39
|
+
stepPixelSize: y,
|
|
40
|
+
suppressFlicker: B,
|
|
41
|
+
unit: P,
|
|
42
|
+
value: i,
|
|
43
43
|
children: (w) => {
|
|
44
44
|
const {
|
|
45
|
-
displayElement:
|
|
46
|
-
displayValue:
|
|
45
|
+
displayElement: n,
|
|
46
|
+
displayValue: c,
|
|
47
47
|
dragging: M,
|
|
48
48
|
handleDragStart: $,
|
|
49
|
-
inputElement: F
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return /* @__PURE__ */ m(
|
|
49
|
+
inputElement: F
|
|
50
|
+
} = w, j = s != null, d = u(
|
|
51
|
+
s ?? c,
|
|
52
|
+
l,
|
|
53
|
+
a
|
|
54
|
+
), m = u(c, l, a), k = V || E(s ?? i, C) || "default";
|
|
55
|
+
return /* @__PURE__ */ p(
|
|
57
56
|
"div",
|
|
58
57
|
{
|
|
59
|
-
className:
|
|
58
|
+
className: g([
|
|
60
59
|
"Slider",
|
|
61
60
|
"ProgressBar",
|
|
62
|
-
`ProgressBar--color--${
|
|
61
|
+
`ProgressBar--color--${k}`,
|
|
63
62
|
S,
|
|
64
|
-
b(
|
|
63
|
+
b(t)
|
|
65
64
|
]),
|
|
66
|
-
...
|
|
65
|
+
...O(t),
|
|
67
66
|
onMouseDown: $,
|
|
68
67
|
children: [
|
|
69
68
|
/* @__PURE__ */ e(
|
|
70
69
|
"div",
|
|
71
70
|
{
|
|
72
|
-
className:
|
|
71
|
+
className: g([
|
|
73
72
|
"ProgressBar__fill",
|
|
74
|
-
|
|
73
|
+
j && "ProgressBar__fill--animated"
|
|
75
74
|
]),
|
|
76
75
|
style: {
|
|
77
|
-
width: `${r(
|
|
76
|
+
width: `${r(d) * 100}%`,
|
|
78
77
|
opacity: 0.4
|
|
79
78
|
}
|
|
80
79
|
}
|
|
@@ -84,25 +83,25 @@ function J(g) {
|
|
|
84
83
|
{
|
|
85
84
|
className: "ProgressBar__fill",
|
|
86
85
|
style: {
|
|
87
|
-
width: `${r(Math.min(
|
|
86
|
+
width: `${r(Math.min(d, m)) * 100}%`
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ p(
|
|
92
91
|
"div",
|
|
93
92
|
{
|
|
94
93
|
className: "Slider__cursorOffset",
|
|
95
94
|
style: {
|
|
96
|
-
width: `${r(
|
|
95
|
+
width: `${r(m) * 100}%`
|
|
97
96
|
},
|
|
98
97
|
children: [
|
|
99
98
|
/* @__PURE__ */ e("div", { className: "Slider__cursor" }),
|
|
100
99
|
/* @__PURE__ */ e("div", { className: "Slider__pointer" }),
|
|
101
|
-
M && /* @__PURE__ */ e("div", { className: "Slider__popupValue", children:
|
|
100
|
+
M && /* @__PURE__ */ e("div", { className: "Slider__popupValue", children: n })
|
|
102
101
|
]
|
|
103
102
|
}
|
|
104
103
|
),
|
|
105
|
-
/* @__PURE__ */ e("div", { className: "ProgressBar__content", children: D ?
|
|
104
|
+
/* @__PURE__ */ e("div", { className: "ProgressBar__content", children: D ? o : n }),
|
|
106
105
|
F
|
|
107
106
|
]
|
|
108
107
|
}
|
|
@@ -112,5 +111,5 @@ function J(g) {
|
|
|
112
111
|
);
|
|
113
112
|
}
|
|
114
113
|
export {
|
|
115
|
-
|
|
114
|
+
I as Slider
|
|
116
115
|
};
|
package/dist/components/Stack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { classes as a } from "../common/react.js";
|
|
3
3
|
import { computeBoxClassName as o } from "../common/ui.js";
|
|
4
|
-
import {
|
|
4
|
+
import { computeFlexProps as k, computeFlexClassName as v, computeFlexItemProps as m } from "./Flex.js";
|
|
5
5
|
function n(r) {
|
|
6
6
|
const { className: c, vertical: e, fill: t, reverse: s, zebra: l, ...d } = r, f = e ? "column" : "row", S = s ? "-reverse" : "";
|
|
7
7
|
return /* @__PURE__ */ i(
|
|
@@ -14,9 +14,9 @@ function n(r) {
|
|
|
14
14
|
l && "Stack--zebra",
|
|
15
15
|
s && `Stack--reverse${e ? "--vertical" : ""}`,
|
|
16
16
|
c,
|
|
17
|
-
|
|
17
|
+
v(r)
|
|
18
18
|
]),
|
|
19
|
-
...
|
|
19
|
+
...k({
|
|
20
20
|
direction: `${f}${S}`,
|
|
21
21
|
...d
|
|
22
22
|
})
|
package/dist/components/Table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { classes as r } from "../common/react.js";
|
|
3
|
-
import {
|
|
3
|
+
import { computeBoxProps as t, computeBoxClassName as n } from "../common/ui.js";
|
|
4
4
|
function m(e) {
|
|
5
5
|
const { className: l, collapsing: a, children: s, ...o } = e;
|
|
6
6
|
return /* @__PURE__ */ c(
|
|
@@ -10,9 +10,9 @@ function m(e) {
|
|
|
10
10
|
"Table",
|
|
11
11
|
a && "Table--collapsing",
|
|
12
12
|
l,
|
|
13
|
-
|
|
13
|
+
n(o)
|
|
14
14
|
]),
|
|
15
|
-
...
|
|
15
|
+
...t(o),
|
|
16
16
|
children: /* @__PURE__ */ c("tbody", { children: s })
|
|
17
17
|
}
|
|
18
18
|
);
|
|
@@ -26,9 +26,9 @@ function b(e) {
|
|
|
26
26
|
"Table__row",
|
|
27
27
|
a && "Table__row--header",
|
|
28
28
|
l,
|
|
29
|
-
|
|
29
|
+
n(e)
|
|
30
30
|
]),
|
|
31
|
-
...
|
|
31
|
+
...t(s)
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
@@ -42,10 +42,10 @@ function _(e) {
|
|
|
42
42
|
a && "Table__cell--collapsing",
|
|
43
43
|
o && "Table__cell--header",
|
|
44
44
|
l,
|
|
45
|
-
|
|
45
|
+
n(e)
|
|
46
46
|
]),
|
|
47
47
|
colSpan: s,
|
|
48
|
-
...
|
|
48
|
+
...t(i)
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as N, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { canRender as d, classes as f } from "../common/react.js";
|
|
3
|
+
import { computeBoxProps as h, computeBoxClassName as p } from "../common/ui.js";
|
|
4
4
|
import { Icon as v } from "./Icon.js";
|
|
5
5
|
function T(e) {
|
|
6
6
|
const { className: i, vertical: c, fill: o, fluid: s, children: r, ...l } = e;
|
|
@@ -13,9 +13,9 @@ function T(e) {
|
|
|
13
13
|
o && "Tabs--fill",
|
|
14
14
|
s && "Tabs--fluid",
|
|
15
15
|
i,
|
|
16
|
-
|
|
16
|
+
p(l)
|
|
17
17
|
]),
|
|
18
|
-
...
|
|
18
|
+
...h(l),
|
|
19
19
|
children: r
|
|
20
20
|
}
|
|
21
21
|
);
|
|
@@ -45,10 +45,10 @@ function x(e) {
|
|
|
45
45
|
`Tab--color--${o}`,
|
|
46
46
|
c && "Tab--selected",
|
|
47
47
|
i,
|
|
48
|
-
|
|
48
|
+
p(m)
|
|
49
49
|
]),
|
|
50
50
|
onClick: _,
|
|
51
|
-
...
|
|
51
|
+
...h(m),
|
|
52
52
|
children: [
|
|
53
53
|
d(l) && /* @__PURE__ */ a("div", { className: "Tab__left", children: l }) || !!s && /* @__PURE__ */ a("div", { className: "Tab__left", children: /* @__PURE__ */ a(v, { name: s, spin: r }) }),
|
|
54
54
|
/* @__PURE__ */ a("div", { className: "Tab__text", children: u }),
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { SyntheticEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ## Textarea
|
|
4
|
+
*
|
|
5
|
+
* An input for larger amounts of text. Use this when you want inputs larger
|
|
6
|
+
* than one row.
|
|
7
|
+
*/
|
|
2
8
|
export declare const TextArea: import('react').ForwardRefExoticComponent<Partial<{
|
|
9
|
+
/** Automatically focus the textarea on mount */
|
|
3
10
|
autoFocus: boolean;
|
|
11
|
+
/** Selects all text on mount */
|
|
4
12
|
autoSelect: boolean;
|
|
13
|
+
/** The value to display in the textarea */
|
|
5
14
|
displayedValue: string;
|
|
15
|
+
/** Don't use tab for indent */
|
|
6
16
|
dontUseTabForIndent: boolean;
|
|
17
|
+
/** Sets width to 100% */
|
|
7
18
|
fluid: boolean;
|
|
19
|
+
/** Maximum length of the textarea */
|
|
8
20
|
maxLength: number;
|
|
21
|
+
/** Removes the border. */
|
|
9
22
|
noborder: boolean;
|
|
10
23
|
/** Fires when user is 'done typing': Clicked out, blur, enter key (but not shift+enter) */
|
|
11
24
|
onChange: (event: SyntheticEvent<HTMLTextAreaElement>, value: string) => void;
|
|
@@ -15,11 +28,15 @@ export declare const TextArea: import('react').ForwardRefExoticComponent<Partial
|
|
|
15
28
|
onEscape: (event: SyntheticEvent<HTMLTextAreaElement>) => void;
|
|
16
29
|
/** Fires on each key press / value change. Used for searching */
|
|
17
30
|
onInput: (event: SyntheticEvent<HTMLTextAreaElement>, value: string) => void;
|
|
31
|
+
/** Dummy text inside the textarea when it's empty */
|
|
18
32
|
placeholder: string;
|
|
33
|
+
/** Whether the textarea is scrollable when it has more content than height */
|
|
19
34
|
scrollbar: boolean;
|
|
35
|
+
/** Clears the textarea when the enter key is pressed */
|
|
20
36
|
selfClear: boolean;
|
|
21
37
|
/** Provides a Record with key: markupChar entries which can be used for ctrl + key combinations to surround a selected text with the markup character */
|
|
22
38
|
userMarkup: Record<string, string>;
|
|
39
|
+
/** The value of the textarea */
|
|
23
40
|
value: string;
|
|
24
41
|
}> & Partial<{
|
|
25
42
|
as: string;
|