tgui-core 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +1,56 @@
1
- import { jsxs as f, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as t } from "react/jsx-runtime";
2
2
  import { classes as l } from "../common/react.js";
3
- import { computeBoxProps as B } from "./Box.js";
3
+ import { computeBoxProps as A } from "./Box.js";
4
4
  import { DmIcon as D } from "./DmIcon.js";
5
5
  import { Icon as F } from "./Icon.js";
6
6
  import { Image as j } from "./Image.js";
7
- import { Stack as I } from "./Stack.js";
7
+ import { Stack as y } from "./Stack.js";
8
8
  import { Tooltip as z } from "./Tooltip.js";
9
- function H(k) {
9
+ function H(N) {
10
10
  const {
11
- asset: h,
11
+ asset: f,
12
12
  base64: r,
13
13
  buttons: m,
14
- buttonsAlt: g,
14
+ buttonsAlt: h,
15
15
  children: i,
16
- className: w,
16
+ className: k,
17
17
  color: e,
18
18
  disabled: a,
19
- dmFallback: b,
20
- dmIcon: x,
21
- dmIconState: C,
19
+ dmFallback: I,
20
+ dmIcon: b,
21
+ dmIconState: x,
22
22
  fluid: c,
23
23
  imageSize: o = 64,
24
24
  imageSrc: d,
25
25
  onClick: s,
26
- onRightClick: p,
27
- selected: _,
28
- title: $,
29
- tooltip: y,
30
- tooltipPosition: v,
31
- ...S
32
- } = k;
33
- function N(n, A) {
34
- return /* @__PURE__ */ t(I, { height: `${o}px`, width: `${o}px`, children: /* @__PURE__ */ t(I.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
26
+ onRightClick: u,
27
+ selected: B,
28
+ title: C,
29
+ tooltip: _,
30
+ tooltipPosition: w,
31
+ ...v
32
+ } = N;
33
+ function $(n, S) {
34
+ return /* @__PURE__ */ t(y, { height: `${o}px`, width: `${o}px`, children: /* @__PURE__ */ t(y.Item, { grow: !0, textAlign: "center", align: "center", children: /* @__PURE__ */ t(
35
35
  F,
36
36
  {
37
- spin: A,
37
+ spin: S,
38
38
  name: n,
39
39
  color: "gray",
40
40
  style: { fontSize: `calc(${o}px * 0.75)` }
41
41
  }
42
42
  ) }) });
43
43
  }
44
- let u = /* @__PURE__ */ f(
44
+ let p = /* @__PURE__ */ g(
45
45
  "div",
46
46
  {
47
47
  className: l([
48
48
  "container",
49
49
  m && "hasButtons",
50
- !s && !p && "noAction",
51
- _ && "selected",
52
- a && "disabled",
53
- e && typeof e == "string" ? `color__${e}` : "color__default"
50
+ !s && !u && "noAction",
51
+ B && "ImageButton--selected",
52
+ a && "ImageButton--disabled",
53
+ e && typeof e == "string" ? `ImageButton--color__${e}` : "ImageButton--color__default"
54
54
  ]),
55
55
  tabIndex: a ? void 0 : 0,
56
56
  onClick: (n) => {
@@ -60,39 +60,39 @@ function H(k) {
60
60
  n.key === "Enter" && !a && s && s(n);
61
61
  },
62
62
  onContextMenu: (n) => {
63
- n.preventDefault(), !a && p && p(n);
63
+ n.preventDefault(), !a && u && u(n);
64
64
  },
65
65
  style: { width: c ? "auto" : `calc(${o}px + 0.5em + 2px)` },
66
66
  children: [
67
- /* @__PURE__ */ t("div", { className: "image", children: r || h || d ? /* @__PURE__ */ t(
67
+ /* @__PURE__ */ t("div", { className: "image", children: r || f || d ? /* @__PURE__ */ t(
68
68
  j,
69
69
  {
70
- className: l(!r && !d && h || []),
70
+ className: l(!r && !d && f || []),
71
71
  src: r ? `data:image/png;base64,${r}` : d,
72
72
  height: `${o}px`,
73
73
  width: `${o}px`
74
74
  }
75
- ) : x && C ? /* @__PURE__ */ t(
75
+ ) : b && x ? /* @__PURE__ */ t(
76
76
  D,
77
77
  {
78
- icon: x,
79
- icon_state: C,
80
- fallback: b || N("spinner", !0),
78
+ icon: b,
79
+ icon_state: x,
80
+ fallback: I || $("spinner", !0),
81
81
  height: `${o}px`,
82
82
  width: `${o}px`
83
83
  }
84
- ) : N("question", !1) }),
85
- c ? /* @__PURE__ */ f("div", { className: "info", children: [
86
- $ && /* @__PURE__ */ t("span", { className: l(["title", i && "divider"]), children: $ }),
84
+ ) : $("question", !1) }),
85
+ c ? /* @__PURE__ */ g("div", { className: "info", children: [
86
+ C && /* @__PURE__ */ t("span", { className: l(["title", i && "divider"]), children: C }),
87
87
  i && /* @__PURE__ */ t("span", { className: "contentFluid", children: i })
88
88
  ] }) : i && /* @__PURE__ */ t(
89
89
  "span",
90
90
  {
91
91
  className: l([
92
92
  "content",
93
- _ && "contentSelected",
94
- a && "contentDisabled",
95
- e && typeof e == "string" ? `contentColor__${e}` : "contentColor__default"
93
+ B && "ImageButton--contentSelected",
94
+ a && "ImageButton--contentDisabled",
95
+ e && typeof e == "string" ? `ImageButton--contentColor__${e}` : "ImageButton--contentColor__default"
96
96
  ]),
97
97
  children: i
98
98
  }
@@ -100,24 +100,28 @@ function H(k) {
100
100
  ]
101
101
  }
102
102
  );
103
- return y && (u = /* @__PURE__ */ t(z, { content: y, position: v, children: u })), /* @__PURE__ */ f(
103
+ return _ && (p = /* @__PURE__ */ t(z, { content: _, position: w, children: p })), /* @__PURE__ */ g(
104
104
  "div",
105
105
  {
106
- className: l(["ImageButton", c && "fluid", w]),
107
- ...B(S),
106
+ className: l([
107
+ "ImageButton",
108
+ c && "ImageButton--fluid",
109
+ k
110
+ ]),
111
+ ...A(v),
108
112
  children: [
109
- u,
113
+ p,
110
114
  m && /* @__PURE__ */ t(
111
115
  "div",
112
116
  {
113
117
  className: l([
114
118
  "buttonsContainer",
115
- g && "buttonsAltContainer",
119
+ h && "buttonsAltContainer",
116
120
  !i && "buttonsEmpty",
117
- c && e && typeof e == "string" ? `buttonsContainerColor__${e}` : c && "buttonsContainerColor__default"
121
+ c && e && typeof e == "string" ? `ImageButton--buttonsContainerColor__${e}` : c && "ImageButton--buttonsContainerColor__default"
118
122
  ]),
119
123
  style: {
120
- width: g ? `calc(${o}px + 0.5em)` : "auto"
124
+ width: h ? `calc(${o}px + 0.5em)` : "auto"
121
125
  },
122
126
  children: m
123
127
  }
@@ -7,9 +7,9 @@ function G(m) {
7
7
  const {
8
8
  buttons: n,
9
9
  children: f,
10
- className: _,
10
+ className: S,
11
11
  fill: u,
12
- fitted: S,
12
+ fitted: _,
13
13
  flexGrow: p,
14
14
  noTopPadding: N,
15
15
  onScroll: h,
@@ -33,11 +33,11 @@ function G(m) {
33
33
  className: a([
34
34
  "Section",
35
35
  u && "Section--fill",
36
- S && "Section--fitted",
36
+ _ && "Section--fitted",
37
37
  c && "Section--scrollable",
38
38
  l && "Section--scrollableHorizontal",
39
- p && "Section__flex",
40
- _,
39
+ p && "Section--flex",
40
+ S,
41
41
  j(i)
42
42
  ]),
43
43
  ...z(i),
@@ -51,8 +51,8 @@ function G(m) {
51
51
  {
52
52
  className: a([
53
53
  "Section__content",
54
- !!b && "content__stretchContents",
55
- !!N && "content__noTopPadding"
54
+ b && "Section__content--stretchContents",
55
+ N && "Section__content--noTopPadding"
56
56
  ]),
57
57
  onScroll: h,
58
58
  ref: e,
package/package.json CHANGED
@@ -1,15 +1,9 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "TGUI core component library",
5
- "keywords": [
6
- "TGUI",
7
- "library",
8
- "typescript"
9
- ],
10
- "files": [
11
- "dist"
12
- ],
5
+ "keywords": ["TGUI", "library", "typescript"],
6
+ "files": ["dist"],
13
7
  "exports": {
14
8
  "./components": {
15
9
  "import": "./dist/components/index.js",
@@ -28,14 +22,24 @@
28
22
  "dev": "vite",
29
23
  "build": "tsc --noEmit && vite build",
30
24
  "lint": "biome check lib",
31
- "lint:fix": "prettier . --write && biome check . --fix"
25
+ "lint:fix": "prettier . --write && biome check . --fix",
26
+ "storybook": "storybook dev -p 6006",
27
+ "build-storybook": "storybook build"
32
28
  },
33
29
  "author": "jlsnow301",
34
30
  "license": "MIT",
35
31
  "type": "module",
36
32
  "devDependencies": {
37
33
  "@biomejs/biome": "1.9.4",
34
+ "@chromatic-com/storybook": "3.2.2",
38
35
  "@popperjs/core": "^2.11.8",
36
+ "@storybook/addon-essentials": "8.4.4",
37
+ "@storybook/addon-interactions": "8.4.4",
38
+ "@storybook/addon-onboarding": "8.4.4",
39
+ "@storybook/blocks": "8.4.4",
40
+ "@storybook/react": "8.4.4",
41
+ "@storybook/react-vite": "8.4.4",
42
+ "@storybook/test": "8.4.4",
39
43
  "@types/node": "^22.9.0",
40
44
  "@types/react": "^18.3.3",
41
45
  "@types/react-dom": "^18.3.0",
@@ -44,6 +48,10 @@
44
48
  "glob": "^11.0.0",
45
49
  "prettier": "^3.3.3",
46
50
  "react-popper": "^2.3.0",
51
+ "sass": "^1.81.0",
52
+ "storybook": "8.4.4",
53
+ "storybook-addon-sass-postcss": "^0.3.2",
54
+ "tgui-styles": "^0.0.8",
47
55
  "typescript": "^5.6.3",
48
56
  "vite": "^5.4.11",
49
57
  "vite-plugin-dts": "^4.3.0"