tgui-core 3.1.5 → 3.2.0

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 (72) hide show
  1. package/dist/common/constants.d.ts +42 -42
  2. package/dist/common/constants.js +1 -1
  3. package/dist/common/fp.d.ts +2 -1
  4. package/dist/common/fuzzysearch.d.ts +22 -0
  5. package/dist/common/fuzzysearch.js +1 -0
  6. package/dist/common/string.d.ts +14 -7
  7. package/dist/common/string.js +1 -1
  8. package/dist/common/type-utils.d.ts +2 -1
  9. package/dist/common/ui.js +1 -1
  10. package/dist/common/uuid.d.ts +2 -1
  11. package/dist/components/AnimatedNumber.d.ts +3 -0
  12. package/dist/components/Autofocus.d.ts +5 -1
  13. package/dist/components/Blink.d.ts +7 -0
  14. package/dist/components/BlockQuote.d.ts +3 -0
  15. package/dist/components/Box.d.ts +7 -2
  16. package/dist/components/Button.d.ts +3 -0
  17. package/dist/components/Button.js +1 -1
  18. package/dist/components/ByondUi.d.ts +5 -2
  19. package/dist/components/Chart.js +1 -1
  20. package/dist/components/Collapsible.d.ts +3 -0
  21. package/dist/components/Collapsible.js +1 -1
  22. package/dist/components/ColorBox.d.ts +3 -0
  23. package/dist/components/Dialog.d.ts +5 -1
  24. package/dist/components/Dialog.js +1 -1
  25. package/dist/components/Dimmer.d.ts +3 -0
  26. package/dist/components/Divider.d.ts +3 -0
  27. package/dist/components/DmIcon.d.ts +1 -0
  28. package/dist/components/DraggableControl.js +1 -1
  29. package/dist/components/Dropdown.d.ts +3 -0
  30. package/dist/components/Dropdown.js +1 -1
  31. package/dist/components/Flex.d.ts +5 -1
  32. package/dist/components/Flex.js +1 -1
  33. package/dist/components/Floating.d.ts +1 -0
  34. package/dist/components/Floating.js +1 -1
  35. package/dist/components/Icon.d.ts +10 -3
  36. package/dist/components/Image.d.ts +1 -0
  37. package/dist/components/ImageButton.d.ts +4 -0
  38. package/dist/components/ImageButton.js +1 -1
  39. package/dist/components/InfinitePlane.d.ts +5 -1
  40. package/dist/components/InfinitePlane.js +1 -1
  41. package/dist/components/Input.d.ts +1 -1
  42. package/dist/components/KeyListener.d.ts +3 -0
  43. package/dist/components/Knob.d.ts +3 -0
  44. package/dist/components/Knob.js +1 -1
  45. package/dist/components/LabeledControls.d.ts +6 -2
  46. package/dist/components/LabeledControls.js +1 -1
  47. package/dist/components/LabeledList.d.ts +7 -2
  48. package/dist/components/LabeledList.js +1 -1
  49. package/dist/components/MenuBar.js +1 -1
  50. package/dist/components/Modal.d.ts +7 -2
  51. package/dist/components/NoticeBox.d.ts +3 -0
  52. package/dist/components/NumberInput.d.ts +3 -0
  53. package/dist/components/NumberInput.js +1 -1
  54. package/dist/components/Popper.d.ts +3 -0
  55. package/dist/components/Popper.js +1 -1
  56. package/dist/components/ProgressBar.d.ts +3 -0
  57. package/dist/components/RestrictedInput.d.ts +2 -2
  58. package/dist/components/RoundGauge.d.ts +4 -1
  59. package/dist/components/RoundGauge.js +1 -1
  60. package/dist/components/Section.d.ts +7 -0
  61. package/dist/components/Section.js +1 -1
  62. package/dist/components/Slider.d.ts +5 -1
  63. package/dist/components/Slider.js +1 -1
  64. package/dist/components/Stack.d.ts +8 -3
  65. package/dist/components/Table.d.ts +5 -1
  66. package/dist/components/Tabs.d.ts +12 -6
  67. package/dist/components/TextArea.d.ts +1 -1
  68. package/dist/components/TimeDisplay.d.ts +7 -0
  69. package/dist/components/Tooltip.d.ts +16 -0
  70. package/dist/components/Tooltip.js +1 -1
  71. package/dist/components/VirtualList.d.ts +4 -0
  72. package/package.json +48 -39
@@ -23,11 +23,13 @@ type CellProps = Partial<{
23
23
  declare function TableCell(props: CellProps): import("react/jsx-runtime").JSX.Element;
24
24
  /**
25
25
  * ## Table
26
+ *
26
27
  * A straight forward mapping to a standard html table, which is slightly
27
28
  * simplified (does not need a `<tbody>` tag) and with sane default styles
28
29
  * (e.g. table width is 100% by default).
29
30
  *
30
- * @example
31
+ * Example:
32
+ *
31
33
  * ```tsx
32
34
  * <Table>
33
35
  * <Table.Row>
@@ -38,6 +40,8 @@ declare function TableCell(props: CellProps): import("react/jsx-runtime").JSX.El
38
40
  * </Table.Row>
39
41
  * </Table>
40
42
  * ```
43
+ *
44
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-table--docs)
41
45
  */
42
46
  export declare namespace Table {
43
47
  /**
@@ -30,12 +30,14 @@ type TabProps = Partial<{
30
30
  }> & BoxProps;
31
31
  declare function TabItem(props: TabProps): import("react/jsx-runtime").JSX.Element;
32
32
  /**
33
- * ## Tabs
33
+ * ## Tabs
34
+ *
34
35
  * Tabs make it easy to explore and switch between different views.
35
36
  *
36
37
  * Here is an example of how you would construct a simple tabbed view:
37
38
  *
38
- * @example
39
+ * Example:
40
+ *
39
41
  * ```tsx
40
42
  * <Tabs>
41
43
  * <Tabs.Tab
@@ -59,10 +61,11 @@ declare function TabItem(props: TabProps): import("react/jsx-runtime").JSX.Eleme
59
61
  * a lot of flexibility in regards to how you can layout your tabs.
60
62
  *
61
63
  * Tabs also support a vertical configuration. This is usually paired with
62
- * [Stack](https://github.com/tgstation/tgui-core/tree/main/lib/components/Stack.tsx)
64
+ * [Stack](https://tgstation.github.io/tgui-core/?path=/docs/components-stack--docs)
63
65
  * to render tab content to the right.
64
66
  *
65
- * @example
67
+ * Example:
68
+ *
66
69
  * ```tsx
67
70
  * <Stack>
68
71
  * <Stack.Item>
@@ -76,16 +79,19 @@ declare function TabItem(props: TabProps): import("react/jsx-runtime").JSX.Eleme
76
79
  *
77
80
  * If you need to combine a tab section with other elements, or if you want to
78
81
  * add scrollable functionality to tabs, pair them with the
79
- * [Section](https://github.com/tgstation/tgui-core/tree/main/lib/components/Section.tsx)
82
+ * [Section](https://tgstation.github.io/tgui-core/?path=/docs/components-section--docs)
80
83
  * component:
81
84
  *
82
- * @example
85
+ * Example:
86
+ *
83
87
  * ```tsx
84
88
  * <Section fill fitted scrollable width="128px">
85
89
  * <Tabs vertical>...</Tabs>
86
90
  * ... other things ...
87
91
  * </Section>
88
92
  * ```
93
+ *
94
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-tabs--docs)
89
95
  */
90
96
  export declare namespace Tabs {
91
97
  /**
@@ -18,7 +18,7 @@ type Props = Partial<{
18
18
  * An input for larger amounts of text. Use this when you want inputs larger
19
19
  * than one row.
20
20
  *
21
- * @see https://github.com/tgstation/tgui-core/blob/main/lib/components/TextArea.tsx
21
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-textarea--docs)
22
22
  */
23
23
  export declare function TextArea(props: Props): import("react/jsx-runtime").JSX.Element;
24
24
  export {};
@@ -7,5 +7,12 @@ type TimeDisplayProps = {
7
7
  /** An optional function to format the value */
8
8
  format: (value: number) => string;
9
9
  }>;
10
+ /**
11
+ * ## TimeDisplay
12
+ *
13
+ * A simple component to format and display time values.
14
+ *
15
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-timedisplay--docs)
16
+ */
10
17
  export declare function TimeDisplay(props: TimeDisplayProps): string | number | null;
11
18
  export {};
@@ -9,5 +9,21 @@ type Props = {
9
9
  /** Where to place the tooltip relative to the reference element */
10
10
  position: Placement;
11
11
  }>;
12
+ /**
13
+ * ## Tooltip
14
+ *
15
+ * Displays a tooltip when hovering over the element. The tooltip
16
+ * can be customized with a custom content and position.
17
+ *
18
+ * Example:
19
+ *
20
+ * ```tsx
21
+ * <Tooltip content="This is a tooltip" position="top">
22
+ * <Box>Hover over me</Box>
23
+ * </Tooltip>
24
+ * ```
25
+ *
26
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-tooltip--docs)
27
+ */
12
28
  export declare function Tooltip(props: Props): import("react/jsx-runtime").JSX.Element;
13
29
  export {};
@@ -1 +1 @@
1
- import*as t from"react/jsx-runtime";import*as o from"./Floating.js";function e(e){let{content:n,children:r,position:i}=e;return(0,t.jsx)(o.Floating,{hoverOpen:!0,content:n,contentClasses:"Tooltip",placement:i,children:r})}export{e as Tooltip};
1
+ import*as t from"react/jsx-runtime";import*as o from"./Floating.js";function e(e){let{content:n,children:r,position:i}=e;return(0,t.jsx)(o.Floating,{content:n,contentClasses:"Tooltip",hoverOpen:!0,placement:i,children:r})}export{e as Tooltip};
@@ -1,7 +1,11 @@
1
1
  import { type PropsWithChildren } from 'react';
2
2
  /**
3
+ * ## VirtualList
4
+ *
3
5
  * A vertical list that renders items to fill space up to the extents of the
4
6
  * current window, and then defers rendering of other items until they come
5
7
  * into view.
8
+ *
9
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-virtuallist--docs)
6
10
  */
7
11
  export declare function VirtualList(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,10 +1,36 @@
1
1
  {
2
- "name": "tgui-core",
3
- "version": "3.1.5",
2
+ "author": "jlsnow301",
3
+ "dependencies": {
4
+ "@floating-ui/react": "^0.27.8",
5
+ "@nozbe/microfuzz": "^1.0.0"
6
+ },
4
7
  "description": "TGUI core component library",
5
- "keywords": ["TGUI", "library", "typescript"],
6
- "files": ["dist", "styles"],
8
+ "devDependencies": {
9
+ "@biomejs/biome": "2.0.0-beta.2",
10
+ "@rsbuild/core": "^1.3.18",
11
+ "@rsbuild/plugin-react": "^1.3.1",
12
+ "@rsbuild/plugin-sass": "^1.3.1",
13
+ "@rslib/core": "^0.6.9",
14
+ "@storybook/addon-console": "^3.0.0",
15
+ "@storybook/addon-essentials": "^8.6.12",
16
+ "@storybook/blocks": "^8.6.12",
17
+ "@storybook/react": "^8.6.12",
18
+ "@storybook/theming": "^8.6.12",
19
+ "@types/node": "^22.15.17",
20
+ "@types/react": "^19.1.3",
21
+ "@types/react-dom": "^19.1.3",
22
+ "prettier": "^3.5.3",
23
+ "sass": "^1.81.0",
24
+ "storybook": "^8.6.12",
25
+ "storybook-addon-sass-postcss": "^0.3.2",
26
+ "storybook-react-rsbuild": "^1.0.1",
27
+ "typescript": "^5.8.3"
28
+ },
7
29
  "exports": {
30
+ "./*": {
31
+ "import": "./dist/common/*.js",
32
+ "require": "./dist/common/*.cjs"
33
+ },
8
34
  "./components": {
9
35
  "import": "./dist/components/index.js",
10
36
  "require": "./dist/components/index.cjs"
@@ -15,53 +41,36 @@
15
41
  },
16
42
  "./styles/components/*": {
17
43
  "sass": "./styles/components/*"
18
- },
19
- "./*": {
20
- "import": "./dist/common/*.js",
21
- "require": "./dist/common/*.cjs"
22
44
  }
23
45
  },
46
+ "files": [
47
+ "dist",
48
+ "styles"
49
+ ],
50
+ "keywords": [
51
+ "TGUI",
52
+ "library",
53
+ "typescript"
54
+ ],
55
+ "license": "MIT",
56
+ "name": "tgui-core",
57
+ "packageManager": "pnpm@10.10.0",
58
+ "peerDependencies": {
59
+ "react": "^19.1.0",
60
+ "react-dom": "^19.1.0"
61
+ },
24
62
  "repository": {
25
63
  "type": "git",
26
64
  "url": "https://github.com/tgstation/tgui-core.git"
27
65
  },
28
66
  "scripts": {
29
67
  "build": "rslib build",
68
+ "build-storybook": "storybook build",
30
69
  "lint": "biome check lib",
31
70
  "lint:fix": "prettier . --write && biome check . --fix",
32
71
  "storybook": "storybook dev -p 6006",
33
- "build-storybook": "storybook build",
34
72
  "test": "node --experimental-strip-types --experimental-test-coverage --test ./tests/*.test.ts"
35
73
  },
36
- "author": "jlsnow301",
37
- "license": "MIT",
38
74
  "type": "module",
39
- "dependencies": {
40
- "@floating-ui/react": "^0.27.6"
41
- },
42
- "devDependencies": {
43
- "@biomejs/biome": "1.9.4",
44
- "@rsbuild/core": "^1.3.5",
45
- "@rsbuild/plugin-react": "^1.2.0",
46
- "@rsbuild/plugin-sass": "^1.3.1",
47
- "@rslib/core": "^0.6.2",
48
- "@storybook/addon-console": "^3.0.0",
49
- "@storybook/addon-essentials": "^8.6.12",
50
- "@storybook/react": "^8.6.12",
51
- "@storybook/theming": "^8.6.12",
52
- "@types/node": "^22.14.0",
53
- "@types/react": "^19.1.0",
54
- "@types/react-dom": "^19.1.1",
55
- "prettier": "^3.5.3",
56
- "sass": "^1.81.0",
57
- "storybook": "^8.6.12",
58
- "storybook-addon-sass-postcss": "^0.3.2",
59
- "storybook-react-rsbuild": "^1.0.1",
60
- "typescript": "^5.8.3"
61
- },
62
- "peerDependencies": {
63
- "react": "^19.1.0",
64
- "react-dom": "^19.1.0"
65
- },
66
- "packageManager": "pnpm@10.7.0"
75
+ "version": "3.2.0"
67
76
  }