tgui-core 1.1.19 → 1.1.21

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.
@@ -48,15 +48,15 @@ import '../assets/Button.css';const T = "_button_433yx_17", L = "_fa_433yx_34",
48
48
  content: Bo,
49
49
  textMargin: Io
50
50
  };
51
- function m(u) {
51
+ function g(u) {
52
52
  const {
53
53
  captureKeys: s = !0,
54
54
  children: a,
55
- circular: p,
55
+ circular: y,
56
56
  className: f,
57
57
  color: i,
58
- compact: g,
59
- content: y,
58
+ compact: b,
59
+ content: x,
60
60
  disabled: o,
61
61
  ellipsis: c,
62
62
  fluid: n,
@@ -65,13 +65,13 @@ function m(u) {
65
65
  iconPosition: v,
66
66
  iconRotation: w,
67
67
  iconSpin: N,
68
- onClick: b,
69
- selected: h,
70
- tooltip: x,
68
+ onClick: h,
69
+ selected: C,
70
+ tooltip: m,
71
71
  tooltipPosition: A,
72
- verticalAlignContent: C,
72
+ verticalAlignContent: k,
73
73
  ...B
74
- } = u, k = y || a;
74
+ } = u, p = x || a;
75
75
  let t = /* @__PURE__ */ l(
76
76
  "div",
77
77
  {
@@ -79,24 +79,24 @@ function m(u) {
79
79
  _.button,
80
80
  n && _.fluid,
81
81
  o && _.disabled,
82
- h && _.selected,
83
- p && _.circular,
84
- g && _.compact,
85
- C && _.flex,
86
- C && n && _.flex__fluid,
87
- C && _["verticalAlignContent__" + C],
82
+ C && _.selected,
83
+ y && _.circular,
84
+ b && _.compact,
85
+ k && _.flex,
86
+ k && n && _.flex__fluid,
87
+ k && _["verticalAlignContent__" + k],
88
88
  i && typeof i == "string" ? _["color__" + i] : _.color__default,
89
89
  f,
90
90
  j(B)
91
91
  ]),
92
92
  tabIndex: o ? void 0 : 0,
93
93
  onClick: (r) => {
94
- !o && b && b(r);
94
+ !o && h && h(r);
95
95
  },
96
96
  onKeyDown: (r) => {
97
97
  if (s) {
98
98
  if (r.key === I.Space || r.key === I.Enter) {
99
- r.preventDefault(), !o && b && b(r);
99
+ r.preventDefault(), !o && h && h(r);
100
100
  return;
101
101
  }
102
102
  r.key === I.Escape && r.preventDefault();
@@ -107,7 +107,7 @@ function m(u) {
107
107
  e && v !== "right" && /* @__PURE__ */ l(
108
108
  D,
109
109
  {
110
- mr: 1,
110
+ mr: p ? 1 : 0,
111
111
  name: e,
112
112
  color: d,
113
113
  rotation: w,
@@ -118,13 +118,13 @@ function m(u) {
118
118
  "span",
119
119
  {
120
120
  className: R([_.ellipsis, e && _.textMargin]),
121
- children: k
121
+ children: p
122
122
  }
123
- ) : k,
123
+ ) : p,
124
124
  e && v === "right" && /* @__PURE__ */ l(
125
125
  D,
126
126
  {
127
- ml: 1,
127
+ ml: p ? 1 : 0,
128
128
  name: e,
129
129
  color: d,
130
130
  rotation: w,
@@ -134,12 +134,12 @@ function m(u) {
134
134
  ] })
135
135
  }
136
136
  );
137
- return x && (t = /* @__PURE__ */ l(P, { content: x, position: A, children: t })), t;
137
+ return m && (t = /* @__PURE__ */ l(P, { content: m, position: A, children: t })), t;
138
138
  }
139
139
  function No(u) {
140
140
  const { checked: s, ...a } = u;
141
141
  return /* @__PURE__ */ l(
142
- m,
142
+ g,
143
143
  {
144
144
  color: "transparent",
145
145
  icon: s ? "check-square-o" : "square-o",
@@ -148,16 +148,16 @@ function No(u) {
148
148
  }
149
149
  );
150
150
  }
151
- m.Checkbox = No;
151
+ g.Checkbox = No;
152
152
  function Ro(u) {
153
153
  const {
154
154
  children: s,
155
155
  color: a,
156
- confirmColor: p = "bad",
156
+ confirmColor: y = "bad",
157
157
  confirmContent: f = "Confirm?",
158
158
  confirmIcon: i,
159
- ellipsis: g = !0,
160
- icon: y,
159
+ ellipsis: b = !0,
160
+ icon: x,
161
161
  onClick: o,
162
162
  ...c
163
163
  } = u, [n, e] = F(!1);
@@ -169,26 +169,26 @@ function Ro(u) {
169
169
  o == null || o(v), e(!1);
170
170
  }
171
171
  return /* @__PURE__ */ l(
172
- m,
172
+ g,
173
173
  {
174
- icon: n ? i : y,
175
- color: n ? p : a,
174
+ icon: n ? i : x,
175
+ color: n ? y : a,
176
176
  onClick: d,
177
177
  ...c,
178
178
  children: n ? f : s
179
179
  }
180
180
  );
181
181
  }
182
- m.Confirm = Ro;
182
+ g.Confirm = Ro;
183
183
  function Do(u) {
184
184
  const {
185
185
  children: s,
186
186
  color: a = "default",
187
- content: p,
187
+ content: y,
188
188
  currentValue: f,
189
189
  defaultValue: i,
190
- disabled: g,
191
- fluid: y,
190
+ disabled: b,
191
+ fluid: x,
192
192
  icon: o,
193
193
  iconRotation: c,
194
194
  iconSpin: n,
@@ -197,8 +197,8 @@ function Do(u) {
197
197
  placeholder: v,
198
198
  tooltip: w,
199
199
  tooltipPosition: N,
200
- ...b
201
- } = u, [h, x] = F(!1), A = K(), C = p || s;
200
+ ...h
201
+ } = u, [C, m] = F(!1), A = K(), k = y || s;
202
202
  function B(t) {
203
203
  const r = A.current;
204
204
  if (!r) return;
@@ -206,58 +206,58 @@ function Do(u) {
206
206
  }
207
207
  M(() => {
208
208
  const t = A.current;
209
- if (t && h) {
209
+ if (t && C) {
210
210
  t.value = f || "";
211
211
  try {
212
212
  t.focus(), t.select();
213
213
  } catch {
214
214
  }
215
215
  }
216
- }, [h, f]);
217
- let k = /* @__PURE__ */ E(
216
+ }, [C, f]);
217
+ let p = /* @__PURE__ */ E(
218
218
  O,
219
219
  {
220
220
  className: R([
221
221
  _.button,
222
- y && _.fluid,
222
+ x && _.fluid,
223
223
  _["color__" + a]
224
224
  ]),
225
- ...b,
226
- onClick: () => x(!0),
225
+ ...h,
226
+ onClick: () => m(!0),
227
227
  children: [
228
228
  o && /* @__PURE__ */ l(D, { name: o, rotation: c, spin: n }),
229
- /* @__PURE__ */ l("div", { children: C }),
229
+ /* @__PURE__ */ l("div", { children: k }),
230
230
  /* @__PURE__ */ l(
231
231
  "input",
232
232
  {
233
- disabled: !!g,
233
+ disabled: !!b,
234
234
  ref: A,
235
235
  className: "NumberInput__input",
236
236
  style: {
237
- display: h ? "" : "none",
237
+ display: C ? "" : "none",
238
238
  textAlign: "left"
239
239
  },
240
240
  onBlur: (t) => {
241
- h && (x(!1), B(t));
241
+ C && (m(!1), B(t));
242
242
  },
243
243
  onKeyDown: (t) => {
244
244
  if (t.key === I.Enter) {
245
- x(!1), B(t);
245
+ m(!1), B(t);
246
246
  return;
247
247
  }
248
- t.key === I.Escape && x(!1);
248
+ t.key === I.Escape && m(!1);
249
249
  }
250
250
  }
251
251
  )
252
252
  ]
253
253
  }
254
254
  );
255
- return w && (k = /* @__PURE__ */ l(P, { content: w, position: N, children: k })), k;
255
+ return w && (p = /* @__PURE__ */ l(P, { content: w, position: N, children: p })), p;
256
256
  }
257
- m.Input = Do;
257
+ g.Input = Do;
258
258
  function Eo(u) {
259
- const { accept: s, multiple: a, onSelectFiles: p, ...f } = u, i = V(null);
260
- async function g(o) {
259
+ const { accept: s, multiple: a, onSelectFiles: y, ...f } = u, i = V(null);
260
+ async function b(o) {
261
261
  const c = Array.from(o).map((n) => {
262
262
  const e = new FileReader();
263
263
  return new Promise((d) => {
@@ -266,15 +266,15 @@ function Eo(u) {
266
266
  });
267
267
  return await Promise.all(c);
268
268
  }
269
- async function y(o) {
269
+ async function x(o) {
270
270
  const c = o.target.files;
271
271
  if (c != null && c.length) {
272
- const n = await g(c);
273
- p(a ? n : n[0]);
272
+ const n = await b(c);
273
+ y(a ? n : n[0]);
274
274
  }
275
275
  }
276
276
  return /* @__PURE__ */ E(S, { children: [
277
- /* @__PURE__ */ l(m, { onClick: () => {
277
+ /* @__PURE__ */ l(g, { onClick: () => {
278
278
  var o;
279
279
  return (o = i.current) == null ? void 0 : o.click();
280
280
  }, ...f }),
@@ -286,13 +286,13 @@ function Eo(u) {
286
286
  ref: i,
287
287
  accept: s,
288
288
  multiple: a,
289
- onChange: y
289
+ onChange: x
290
290
  }
291
291
  )
292
292
  ] });
293
293
  }
294
- m.File = Eo;
294
+ g.File = Eo;
295
295
  export {
296
- m as Button,
296
+ g as Button,
297
297
  No as ButtonCheckbox
298
298
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tgui-core",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "description": "TGUI core component library",
5
5
  "keywords": [
6
6
  "TGUI",
@@ -15,9 +15,9 @@
15
15
  "import": "./dist/components/index.js",
16
16
  "require": "./dist/components/index.cjs"
17
17
  },
18
- "./styles": {
19
- "import": "./dist/styles/components/*.scss",
20
- "require": "./dist/styles/components/*.scss"
18
+ "./styles/*": {
19
+ "import": "./dist/assets/*.css",
20
+ "require": "./dist/assets/*.css"
21
21
  },
22
22
  "./*": {
23
23
  "import": "./dist/common/*.js",