tgui-core 1.1.2 → 1.1.4

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.
@@ -5,17 +5,20 @@
5
5
  * Handles modifier keys (Shift, Alt, Control) and arrow keys.
6
6
  *
7
7
  * For alphabetical keys, use the actual character (e.g. 'a') instead of the key code.
8
+ * Don't access Esc or Escape directly, use isEscape() instead
8
9
  *
9
10
  * Something isn't here that you want? Just add it:
10
11
  * @url https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
11
12
  * @usage
12
13
  * ```ts
13
- * import { KEY } from 'tgui/keys';
14
+ * import { KEY } from 'tgui/common/keys';
14
15
  *
15
16
  * if (event.key === KEY.Enter) {
16
17
  * // do something
17
18
  * }
18
19
  * ```
20
+ *
21
+ *
19
22
  */
20
23
  export declare enum KEY {
21
24
  Alt = "Alt",
@@ -25,6 +28,7 @@ export declare enum KEY {
25
28
  Down = "ArrowDown",
26
29
  End = "End",
27
30
  Enter = "Enter",
31
+ Esc = "Esc",
28
32
  Escape = "Escape",
29
33
  Home = "Home",
30
34
  Insert = "Insert",
@@ -37,3 +41,15 @@ export declare enum KEY {
37
41
  Tab = "Tab",
38
42
  Up = "ArrowUp"
39
43
  }
44
+ /**
45
+ * ### isEscape
46
+ *
47
+ * Checks if the user has hit the 'ESC' key on their keyboard.
48
+ * There's a weirdness in BYOND where this could be either the string
49
+ * 'Escape' or 'Esc' depending on the browser. This function handles
50
+ * both cases.
51
+ *
52
+ * @param key - the key to check, typically from event.key
53
+ * @returns true if key is Escape or Esc, false otherwise
54
+ */
55
+ export declare function isEscape(key: string): boolean;
@@ -1,4 +1,8 @@
1
- var r = /* @__PURE__ */ ((e) => (e.Alt = "Alt", e.Backspace = "Backspace", e.Control = "Control", e.Delete = "Delete", e.Down = "ArrowDown", e.End = "End", e.Enter = "Enter", e.Escape = "Escape", e.Home = "Home", e.Insert = "Insert", e.Left = "ArrowLeft", e.PageDown = "PageDown", e.PageUp = "PageUp", e.Right = "ArrowRight", e.Shift = "Shift", e.Space = " ", e.Tab = "Tab", e.Up = "ArrowUp", e))(r || {});
1
+ var r = /* @__PURE__ */ ((e) => (e.Alt = "Alt", e.Backspace = "Backspace", e.Control = "Control", e.Delete = "Delete", e.Down = "ArrowDown", e.End = "End", e.Enter = "Enter", e.Esc = "Esc", e.Escape = "Escape", e.Home = "Home", e.Insert = "Insert", e.Left = "ArrowLeft", e.PageDown = "PageDown", e.PageUp = "PageUp", e.Right = "ArrowRight", e.Shift = "Shift", e.Space = " ", e.Tab = "Tab", e.Up = "ArrowUp", e))(r || {});
2
+ function t(e) {
3
+ return e === "Esc" || e === "Escape";
4
+ }
2
5
  export {
3
- r as KEY
6
+ r as KEY,
7
+ t as isEscape
4
8
  };
@@ -1,6 +1,6 @@
1
1
  import { Component } from 'react';
2
2
 
3
- export type AnimatedNumberProps = {
3
+ type Props = {
4
4
  /**
5
5
  * If provided, a function that formats the inner string. By default,
6
6
  * attempts to match the numeric precision of `value`.
@@ -21,7 +21,7 @@ export type AnimatedNumberProps = {
21
21
  * An animated number label. Shows a number, formatted with an optionally
22
22
  * provided function, and animates it towards its target value.
23
23
  */
24
- export declare class AnimatedNumber extends Component<AnimatedNumberProps> {
24
+ export declare class AnimatedNumber extends Component<Props> {
25
25
  /**
26
26
  * The inner `<span/>` being updated sixty times per second.
27
27
  */
@@ -34,10 +34,10 @@ export declare class AnimatedNumber extends Component<AnimatedNumberProps> {
34
34
  * The current value. This values approaches the target value.
35
35
  */
36
36
  currentValue: number;
37
- constructor(props: AnimatedNumberProps);
37
+ constructor(props: Props);
38
38
  componentDidMount(): void;
39
39
  componentWillUnmount(): void;
40
- shouldComponentUpdate(newProps: AnimatedNumberProps): boolean;
40
+ shouldComponentUpdate(newProps: Props): boolean;
41
41
  /**
42
42
  * Starts animating the inner span. If the inner span is already animating,
43
43
  * this is a no-op.
@@ -57,3 +57,4 @@ export declare class AnimatedNumber extends Component<AnimatedNumberProps> {
57
57
  getText(): string;
58
58
  render(): import("react/jsx-runtime").JSX.Element;
59
59
  }
60
+ export {};
@@ -1,4 +1,4 @@
1
- import { KeyboardEventHandler, MouseEventHandler, ReactNode, UIEventHandler } from 'react';
1
+ import { CSSProperties, KeyboardEventHandler, MouseEventHandler, ReactNode, UIEventHandler } from 'react';
2
2
  import { BooleanLike } from '../common/react';
3
3
 
4
4
  type BooleanProps = Partial<Record<keyof typeof booleanStyleMap, boolean>>;
@@ -19,7 +19,7 @@ export type BoxProps = Partial<{
19
19
  as: string;
20
20
  children: ReactNode;
21
21
  className: string | BooleanLike;
22
- style: Partial<CSSStyleDeclaration>;
22
+ style: CSSProperties;
23
23
  }> & BooleanProps & StringProps & EventHandlers;
24
24
  type DangerDoNotUse = {
25
25
  dangerouslySetInnerHTML?: {
@@ -13,6 +13,7 @@ type EllipsisUnion = {
13
13
  children: string;
14
14
  /** @deprecated use children instead */
15
15
  content?: never;
16
+ /** Cuts off text with an ellipsis */
16
17
  ellipsis: true;
17
18
  } | Partial<{
18
19
  children: ReactNode;
@@ -21,20 +22,35 @@ type EllipsisUnion = {
21
22
  ellipsis: undefined;
22
23
  }>;
23
24
  type Props = Partial<{
25
+ /** Captures keyboard events */
24
26
  captureKeys: boolean;
27
+ /** Makes the button circular */
25
28
  circular: boolean;
29
+ /** Reduces the padding of the button */
26
30
  compact: boolean;
31
+ /** Disables and greys out the button */
27
32
  disabled: BooleanLike;
33
+ /** Fill all available horizontal space */
28
34
  fluid: boolean;
35
+ /** Adds an icon to the button */
29
36
  icon: string | false;
37
+ /** Icon color */
30
38
  iconColor: string;
39
+ /** Icon position */
31
40
  iconPosition: string;
41
+ /** Icon rotation */
32
42
  iconRotation: number;
43
+ /** Makes the icon spin */
33
44
  iconSpin: BooleanLike;
45
+ /** Called when element is clicked */
34
46
  onClick: (e: any) => void;
47
+ /** Activates the button (gives it a green color) */
35
48
  selected: BooleanLike;
49
+ /** A fancy, boxy tooltip, which appears when hovering over the button */
36
50
  tooltip: ReactNode;
51
+ /** Position of the tooltip. See [`Popper`](#Popper) for valid options. */
37
52
  tooltipPosition: Placement;
53
+ /** Align content vertically using flex. Use lineHeight if the height is static. */
38
54
  verticalAlignContent: string;
39
55
  }> & EllipsisUnion & BoxProps;
40
56
  /** Clickable button. Comes with variants. Read more in the documentation. */
@@ -2,9 +2,13 @@ import { ReactNode } from 'react';
2
2
  import { BoxProps } from './Box';
3
3
 
4
4
  type Props = Partial<{
5
+ /** Buttons or other content to render inline with the button */
5
6
  buttons: ReactNode;
7
+ /** Icon to display with the collapsible */
6
8
  icon: string;
9
+ /** Whether the collapsible is open */
7
10
  open: boolean;
11
+ /** Text to display on the button for collapsing */
8
12
  title: ReactNode;
9
13
  }> & BoxProps;
10
14
  export declare function Collapsible(props: Props): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { BooleanLike } from '../common/react';
2
3
  import { BoxProps } from './Box';
3
4
 
4
5
  declare enum Direction {
@@ -24,7 +25,7 @@ type Props = {
24
25
  /** Frame number. Default is 1 */
25
26
  frame: number;
26
27
  /** Movement state. Default is false */
27
- movement: boolean;
28
+ movement: BooleanLike;
28
29
  }> & BoxProps;
29
30
  export declare function DmIcon(props: Props): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
30
31
  export {};
@@ -1,28 +1,28 @@
1
- import { jsx as $ } from "react/jsx-runtime";
2
- import { useState as R, useEffect as d } from "react";
3
- import { resolveAsset as j } from "../common/assets.js";
4
- import { fetchRetry as v } from "../common/http.js";
5
- import { Image as x } from "./Image.js";
6
- let e;
7
- function b(n) {
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useState as R, useEffect as u } from "react";
3
+ import { resolveAsset as l } from "../common/assets.js";
4
+ import { fetchRetry as A } from "../common/http.js";
5
+ import { Image as N } from "./Image.js";
6
+ let s;
7
+ function x(t) {
8
8
  const {
9
- className: y,
10
- direction: f = 2,
11
- fallback: a,
12
- frame: c = 1,
13
- icon_state: m,
14
- icon: t,
15
- movement: i = !1,
16
- ...p
17
- } = n, [o, r] = R(""), u = `${o}?state=${m}&dir=${f}&movement=${i}&frame=${c}`;
18
- return d(() => {
19
- async function l() {
20
- const s = await (await v(j("icon_ref_map.json"))).json();
21
- e = s, r(s[t]);
9
+ className: c,
10
+ direction: m = 2,
11
+ fallback: r,
12
+ frame: S = 1,
13
+ icon_state: o,
14
+ icon: e,
15
+ movement: E = !1,
16
+ ...H
17
+ } = t, [T, f] = R(""), O = `${T}?state=${o}&dir=${m}&movement=${E}&frame=${S}`;
18
+ return u(() => {
19
+ async function n() {
20
+ const a = await (await A(l("icon_ref_map.json"))).json();
21
+ s = a, f(a[e]);
22
22
  }
23
- e ? r(e[t]) : l();
24
- }, []), o ? /* @__PURE__ */ $(x, { fixErrors: !0, src: u, ...p }) : a;
23
+ s ? f(s[e]) : n();
24
+ }, []), T ? /* @__PURE__ */ p(N, { fixErrors: !0, src: O, ...H }) : r;
25
25
  }
26
26
  export {
27
- b as DmIcon
27
+ x as DmIcon
28
28
  };
@@ -1,73 +1,73 @@
1
- import { jsx as o, jsxs as m, Fragment as W } from "react/jsx-runtime";
2
- import { useState as F, useRef as L, useEffect as q } from "react";
3
- import { classes as y } from "../common/react.js";
4
- import { unit as z } from "./Box.js";
5
- import { Button as D } from "./Button.js";
6
- import { Icon as b } from "./Icon.js";
7
- import { Popper as A } from "./Popper.js";
1
+ import { jsx as r, jsxs as m, Fragment as L } from "react/jsx-runtime";
2
+ import { useState as R, useRef as q, useEffect as z } from "react";
3
+ import { classes as N } from "../common/react.js";
4
+ import { unit as A } from "./Box.js";
5
+ import { Button as b } from "./Button.js";
6
+ import { Icon as D } from "./Icon.js";
7
+ import { Popper as E } from "./Popper.js";
8
8
  const G = -1;
9
9
  function f(d) {
10
10
  return typeof d == "string" ? d : d.value;
11
11
  }
12
12
  function Y(d) {
13
13
  const {
14
- autoScroll: w = !0,
15
- buttons: I,
16
- className: O,
17
- clipSelectedText: k = !0,
18
- color: B = "default",
14
+ autoScroll: x = !0,
15
+ buttons: k,
16
+ className: B,
17
+ clipSelectedText: C = !0,
18
+ color: O = "default",
19
19
  disabled: a,
20
- displayText: C,
21
- icon: x,
22
- iconRotation: T,
23
- iconSpin: j,
24
- menuWidth: R = "15rem",
25
- noChevron: S,
20
+ displayText: j,
21
+ icon: w,
22
+ iconRotation: I,
23
+ iconSpin: P,
24
+ menuWidth: S = "15rem",
25
+ noChevron: T,
26
26
  onClick: p,
27
27
  onSelected: i,
28
- options: r = [],
28
+ options: o = [],
29
29
  over: g,
30
- placeholder: E = "Select...",
30
+ placeholder: V = "Select...",
31
31
  selected: u,
32
- width: P = "15rem"
33
- } = d, [l, h] = F(!1), V = g ? !l : l, v = L(null), s = r.findIndex((e) => f(e) === u) || 0;
32
+ width: W = "15rem"
33
+ } = d, [s, h] = R(!1), F = g ? !s : s, v = q(null), l = o.findIndex((e) => f(e) === u) || 0;
34
34
  function _(e) {
35
35
  var c;
36
36
  let t = e;
37
- e < s ? t = e < 2 ? 0 : e - 2 : t = e > r.length - 3 ? r.length - 1 : e - 2;
37
+ e < l ? t = e < 2 ? 0 : e - 2 : t = e > o.length - 3 ? o.length - 1 : e - 2;
38
38
  const n = (c = v.current) == null ? void 0 : c.children[t];
39
39
  n == null || n.scrollIntoView({ block: "nearest" });
40
40
  }
41
- function N(e) {
42
- if (r.length < 1 || a)
41
+ function y(e) {
42
+ if (o.length < 1 || a)
43
43
  return;
44
- const t = 0, n = r.length - 1;
44
+ const t = 0, n = o.length - 1;
45
45
  let c;
46
- s < 0 ? c = e === "next" ? n : t : e === "next" ? c = s === n ? t : s + 1 : c = s === t ? n : s - 1, l && w && _(c), i == null || i(f(r[c]));
46
+ l < 0 ? c = e === "next" ? n : t : e === "next" ? c = l === n ? t : l + 1 : c = l === t ? n : l - 1, s && x && _(c), i == null || i(f(o[c]));
47
47
  }
48
- return q(() => {
48
+ return z(() => {
49
49
  var e;
50
- l && (w && s !== G && _(s), (e = v.current) == null || e.focus());
51
- }, [l]), /* @__PURE__ */ o(
52
- A,
50
+ s && (x && l !== G && _(l), (e = v.current) == null || e.focus());
51
+ }, [s]), /* @__PURE__ */ r(
52
+ E,
53
53
  {
54
- isOpen: l,
54
+ isOpen: s,
55
55
  onClickOutside: () => h(!1),
56
56
  placement: g ? "top-start" : "bottom-start",
57
57
  content: /* @__PURE__ */ m(
58
58
  "div",
59
59
  {
60
60
  className: "Layout Dropdown__menu",
61
- style: { minWidth: R },
61
+ style: { minWidth: S },
62
62
  ref: v,
63
63
  children: [
64
- r.length === 0 && /* @__PURE__ */ o("div", { className: "Dropdown__menuentry", children: "No options" }),
65
- r.map((e, t) => {
64
+ o.length === 0 && /* @__PURE__ */ r("div", { className: "Dropdown__menuentry", children: "No options" }),
65
+ o.map((e, t) => {
66
66
  const n = f(e);
67
- return /* @__PURE__ */ o(
67
+ return /* @__PURE__ */ r(
68
68
  "div",
69
69
  {
70
- className: y([
70
+ className: N([
71
71
  "Dropdown__menuentry",
72
72
  u === n && "selected"
73
73
  ]),
@@ -82,60 +82,60 @@ function Y(d) {
82
82
  ]
83
83
  }
84
84
  ),
85
- children: /* @__PURE__ */ m("div", { className: "Dropdown", style: { width: z(P) }, children: [
85
+ children: /* @__PURE__ */ m("div", { className: "Dropdown", style: { width: A(W) }, children: [
86
86
  /* @__PURE__ */ m(
87
87
  "div",
88
88
  {
89
- className: y([
89
+ className: N([
90
90
  "Dropdown__control",
91
91
  "Button",
92
92
  "Button--dropdown",
93
- "Button--color--" + B,
93
+ "Button--color--" + O,
94
94
  a && "Button--disabled",
95
- O
95
+ B
96
96
  ]),
97
97
  onClick: (e) => {
98
- a && !l || (h(!l), p == null || p(e));
98
+ a && !s || (h(!s), p == null || p(e));
99
99
  },
100
100
  children: [
101
- x && /* @__PURE__ */ o(b, { mr: 1, name: x, rotation: T, spin: j }),
102
- /* @__PURE__ */ o(
101
+ w && /* @__PURE__ */ r(D, { mr: 1, name: w, rotation: I, spin: P }),
102
+ /* @__PURE__ */ r(
103
103
  "span",
104
104
  {
105
105
  className: "Dropdown__selected-text",
106
106
  style: {
107
- overflow: k ? "hidden" : "visible"
107
+ overflow: C ? "hidden" : "visible"
108
108
  },
109
- children: C || u && f(u) || E
109
+ children: j || u && f(u) || V
110
110
  }
111
111
  ),
112
- !S && /* @__PURE__ */ o("span", { className: "Dropdown__arrow-button", children: /* @__PURE__ */ o(b, { name: V ? "chevron-up" : "chevron-down" }) })
112
+ !T && /* @__PURE__ */ r("span", { className: "Dropdown__arrow-button", children: /* @__PURE__ */ r(D, { name: F ? "chevron-up" : "chevron-down" }) })
113
113
  ]
114
114
  }
115
115
  ),
116
- I && /* @__PURE__ */ m(W, { children: [
117
- /* @__PURE__ */ o(
118
- D,
116
+ k && /* @__PURE__ */ m(L, { children: [
117
+ /* @__PURE__ */ r(
118
+ b,
119
119
  {
120
120
  disabled: a,
121
121
  height: 1.8,
122
122
  icon: "chevron-left",
123
123
  onClick: () => {
124
- N(
124
+ y(
125
125
  "previous"
126
126
  /* Previous */
127
127
  );
128
128
  }
129
129
  }
130
130
  ),
131
- /* @__PURE__ */ o(
132
- D,
131
+ /* @__PURE__ */ r(
132
+ b,
133
133
  {
134
134
  disabled: a,
135
135
  height: 1.8,
136
136
  icon: "chevron-right",
137
137
  onClick: () => {
138
- N(
138
+ y(
139
139
  "next"
140
140
  /* Next */
141
141
  );
@@ -1,13 +1,57 @@
1
- import { CSSProperties } from 'react';
2
1
  import { BoxProps } from './Box';
3
2
 
4
3
  export type FlexProps = Partial<{
4
+ /**
5
+ * Default alignment of all children.
6
+ *
7
+ * - `stretch` (default) - stretch to fill the container.
8
+ * - `start` - items are placed at the start of the cross axis.
9
+ * - `end` - items are placed at the end of the cross axis.
10
+ * - `center` - items are centered on the cross axis.
11
+ * - `baseline` - items are aligned such as their baselines align.
12
+ */
5
13
  align: string | boolean;
14
+ /**
15
+ * This establishes the main-axis, thus defining the direction flex items are placed in the flex container.
16
+ *
17
+ * - `row` (default) - left to right.
18
+ * - `row-reverse` - right to left.
19
+ * - `column` - top to bottom.
20
+ * - `column-reverse` - bottom to top.
21
+ */
6
22
  direction: string;
23
+ /** Makes flexbox container inline, with similar behavior to an `inline` property on a `Box`. */
7
24
  inline: boolean;
25
+ /**
26
+ * This defines the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are
27
+ * inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow
28
+ * the line.
29
+ *
30
+ * - `flex-start` (default) - items are packed toward the start of the
31
+ * flex-direction.
32
+ * - `flex-end` - items are packed toward the end of the flex-direction.
33
+ * - `space-between` - items are evenly distributed in the line; first item is
34
+ * on the start line, last item on the end line
35
+ * - `space-around` - items are evenly distributed in the line with equal space
36
+ * around them. Note that visually the spaces aren't equal, since all the items
37
+ * have equal space on both sides. The first item will have one unit of space
38
+ * against the container edge, but two units of space between the next item
39
+ * because that next item has its own spacing that applies.
40
+ * - `space-evenly` - items are distributed so that the spacing between any two
41
+ * items (and the space to the edges) is equal.
42
+ */
8
43
  justify: string;
44
+ /** By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property. */
9
45
  scrollable: boolean;
10
- style: CSSProperties;
46
+ /**
47
+ * This defines the alignment along the cross axis. It helps distribute extra free space leftover when either all the flex items on a line are
48
+ * inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow
49
+ * the line.
50
+ *
51
+ * - `nowrap` (default) - all flex items will be on one line
52
+ * - `wrap` - flex items will wrap onto multiple lines, from top to bottom.
53
+ * - `wrap-reverse` - flex items will wrap onto multiple lines from bottom to top.
54
+ */
11
55
  wrap: string | boolean;
12
56
  }> & BoxProps;
13
57
  export declare function computeFlexClassName(props: FlexProps): string;
@@ -16,14 +60,34 @@ export declare function Flex(props: any): import("react/jsx-runtime").JSX.Elemen
16
60
  export declare namespace Flex {
17
61
  var Item: typeof FlexItem;
18
62
  }
19
- export type FlexItemProps = BoxProps & Partial<{
63
+ export type FlexItemProps = Partial<{
64
+ /** This allows the default alignment (or the one specified by align-items) to be overridden for individual flex items. */
20
65
  align: string | boolean;
66
+ /**
67
+ * This defines the default size of an element
68
+ * before any flex-related calculations are done. Has to be a length
69
+ * (e.g. `20%`, `5rem`), an `auto` or `content` keyword.
70
+ *
71
+ * - **Important:** IE11 flex is buggy, and auto width/height calculations
72
+ * can sometimes end up in a circular dependency. This usually happens, when
73
+ * working with tables inside flex (they have wacky internal widths and such).
74
+ * Setting basis to `0` breaks the loop and fixes all of the problems.
75
+ */
21
76
  basis: string | number;
77
+ /**
78
+ * This defines the ability for a flex item to grow if necessary. It accepts a unitless value that serves as a proportion.
79
+ * It dictates what amount of the available space inside the flex container the item should take up.
80
+ * This number is unit-less and is relative to other siblings.
81
+ */
22
82
  grow: number | boolean;
83
+ /**
84
+ * By default, flex items are laid out in the source order. However, the order property controls the order in which they appear in the
85
+ * flex container
86
+ */
23
87
  order: number;
88
+ /** This defines the ability for a flex item to shrink if necessary. Inverse of `grow`. */
24
89
  shrink: number | boolean;
25
- style: Partial<HTMLDivElement['style']>;
26
- }>;
90
+ }> & BoxProps;
27
91
  export declare function computeFlexItemProps(props: FlexItemProps): Record<string, any>;
28
92
  declare function FlexItem(props: any): import("react/jsx-runtime").JSX.Element;
29
93
  export {};
@@ -2,17 +2,22 @@ import { CSSProperties, ReactNode } from 'react';
2
2
  import { BooleanLike } from '../common/react';
3
3
  import { BoxProps } from './Box';
4
4
 
5
- type IconPropsUnique = {
5
+ type Props = {
6
+ /** Icon name. See [icon list](https://fontawesome.com/v5/search?o=r&m=free) */
6
7
  name: string;
7
8
  } & Partial<{
9
+ /** Custom CSS class. */
8
10
  className: string;
11
+ /** Icon rotation, in degrees. */
9
12
  rotation: number;
13
+ /** Icon size. `1` is normal size, `2` is two times bigger. Fractional numbers are supported. */
10
14
  size: number;
15
+ /** Whether an icon should be spinning. Good for load indicators. */
11
16
  spin: BooleanLike;
17
+ /** Custom CSS. */
12
18
  style: CSSProperties;
13
- }>;
14
- export type IconProps = IconPropsUnique & BoxProps;
15
- export declare function Icon(props: IconProps): import("react/jsx-runtime").JSX.Element;
19
+ }> & BoxProps;
20
+ export declare function Icon(props: Props): import("react/jsx-runtime").JSX.Element;
16
21
  export declare namespace Icon {
17
22
  var Stack: typeof IconStack;
18
23
  }
@@ -10,6 +10,5 @@ type Props = Partial<{
10
10
  objectFit: 'contain' | 'cover';
11
11
  src: string;
12
12
  }> & BoxProps;
13
- /** Image component. Use this instead of Box as="img". */
14
13
  export declare function Image(props: Props): import("react/jsx-runtime").JSX.Element;
15
14
  export {};
@@ -1,5 +1,5 @@
1
1
  import { jsx as _, jsxs as j } from "react/jsx-runtime";
2
- import { keyOfMatchingRange as E, scale as s } from "../common/math.js";
2
+ import { scale as s, keyOfMatchingRange as E } from "../common/math.js";
3
3
  import { classes as e } from "../common/react.js";
4
4
  import { computeBoxClassName as K, computeBoxProps as I } from "./Box.js";
5
5
  import { DraggableControl as O } from "./DraggableControl.js";
@@ -7,22 +7,50 @@ export declare namespace LabeledList {
7
7
  var Divider: typeof LabeledListDivider;
8
8
  }
9
9
  type LabeledListItemProps = Partial<{
10
+ /** Buttons to render aside the content. */
10
11
  buttons: ReactNode;
12
+ /** Content of this labeled item. */
11
13
  children: ReactNode;
14
+ /** Applies a CSS class to the element. */
12
15
  className: string | BooleanLike;
16
+ /** Sets the color of the content text. */
13
17
  color: string;
14
18
  /** @deprecated */
15
19
  content: any;
20
+ /**
21
+ * Sometimes this does not properly register in TS.
22
+ * See [react key docs](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) for more info.
23
+ */
16
24
  key: string | number;
17
- label: string | ReactNode | BooleanLike;
25
+ /** Item label. Appends a colon at the end. */
26
+ label: ReactNode;
27
+ /** Sets the color of the label. */
18
28
  labelColor: string;
29
+ /** Lets the label wrap and makes it not take the minimum width. */
19
30
  labelWrap: boolean;
31
+ /**
32
+ * Align the content text.
33
+ *
34
+ * - `left` (default)
35
+ * - `center`
36
+ * - `right`
37
+ */
20
38
  textAlign: string;
39
+ /** Tooltip text. */
21
40
  tooltip: string;
41
+ /**
42
+ * Align both the label and the content vertically.
43
+ *
44
+ * - `baseline` (default)
45
+ * - `top`
46
+ * - `middle`
47
+ * - `bottom`
48
+ */
22
49
  verticalAlign: string;
23
50
  }>;
24
51
  declare function LabeledListItem(props: LabeledListItemProps): import("react/jsx-runtime").JSX.Element;
25
52
  type LabeledListDividerProps = {
53
+ /** Size of the divider. */
26
54
  size?: number;
27
55
  };
28
56
  declare function LabeledListDivider(props: LabeledListDividerProps): import("react/jsx-runtime").JSX.Element;
@@ -73,6 +73,7 @@ function z(e) {
73
73
  a && /* @__PURE__ */ l("td", { className: i([o.cell, o.buttons]), children: a })
74
74
  ] });
75
75
  }
76
+ p.Item = z;
76
77
  function A(e) {
77
78
  const t = e.size ? g(Math.max(0, e.size - 1)) : 0;
78
79
  return /* @__PURE__ */ l("tr", { className: "LabeledList__row", children: /* @__PURE__ */ l(
@@ -87,7 +88,6 @@ function A(e) {
87
88
  }
88
89
  ) });
89
90
  }
90
- p.Item = z;
91
91
  p.Divider = A;
92
92
  export {
93
93
  p as LabeledList
@@ -7,10 +7,13 @@ type None = {
7
7
  [K in NoticeType]?: undefined;
8
8
  };
9
9
  type ExclusiveProps = None | (Omit<None, 'info'> & {
10
+ /** Blue notice */
10
11
  info: boolean;
11
12
  }) | (Omit<None, 'success'> & {
13
+ /** Green notice */
12
14
  success: boolean;
13
15
  }) | (Omit<None, 'danger'> & {
16
+ /** Red notice */
14
17
  danger: boolean;
15
18
  });
16
19
  export declare function NoticeBox(props: Props): import("react/jsx-runtime").JSX.Element;