tgui-core 3.2.0 → 3.3.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/README.md CHANGED
@@ -70,13 +70,13 @@ The release workflow will take care of setting the `package.json` version, build
70
70
 
71
71
  ### Development
72
72
 
73
- This project uses [pnpm](https://pnpm.io/installation) for its package manager.
73
+ This project uses [bun](https://bun.sh/docs/installation) for its package manager.
74
74
 
75
75
  To set up the repository:
76
- `pnpm install`
76
+ `bun install`
77
77
 
78
78
  To test your changes using [Storybook](https://storybook.js.org/docs) run:
79
- `pnpm run storybook`
79
+ `bun storybook`
80
80
 
81
81
  To run unit tests run
82
- `pnpm test`
82
+ `bun test`
@@ -11,10 +11,14 @@ interface UseFuzzySearchProps<T> {
11
11
  getSearchString: (item: T) => string;
12
12
  }
13
13
  /**
14
- * A simple hook prooviding fuzzy searching - approximate rather
14
+ * ## useFuzzySearch
15
+ *
16
+ * A simple hook providing fuzzy searching - uses approximate rather
15
17
  * than exact pattern matching.
18
+ *
19
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/hooks-usefuzzysearch--docs)
16
20
  */
17
- export declare function useFuzzySearch<T>({ searchArray, matchStrategy, getSearchString, }: UseFuzzySearchProps<T>): {
21
+ export declare function useFuzzySearch<T>(options: UseFuzzySearchProps<T>): {
18
22
  query: string;
19
23
  setQuery: (value: string) => void;
20
24
  results: T[];
@@ -1 +1 @@
1
- import*as t from"@nozbe/microfuzz";import*as e from"react";function r({searchArray:r,matchStrategy:a="smart",getSearchString:u}){let[o,i]=(0,e.useState)(""),[m,s]=(0,e.useState)([]),f=(0,e.useCallback)((0,t.default)(r,{getText:t=>[u(t)],strategy:a}),[r,u]);return{query:o,setQuery:function(t){if(i(t),""===t.trim())return void s([]);s(f(t).map(t=>t.item))},results:m}}export{r as useFuzzySearch};
1
+ import*as t from"@nozbe/microfuzz";import*as e from"react";function r(r){let{getSearchString:a,matchStrategy:u="smart",searchArray:o}=r,[i,m]=(0,e.useState)(""),[s,f]=(0,e.useState)([]),n=(0,e.useCallback)((0,t.default)(o,{getText:t=>[a(t)],strategy:u}),[o,a]);return{query:i,setQuery:function(t){if(m(t),""===t.trim())return void f([]);f(n(t).map(t=>t.item))},results:s}}export{r as useFuzzySearch};
@@ -1,7 +1,12 @@
1
- import { type PropsWithChildren } from 'react';
1
+ import { ReactNode } from 'react';
2
+ type Props = Partial<{
3
+ /** Optional child elements */
4
+ children: ReactNode;
5
+ }>;
2
6
  /**
3
7
  * ## Autofocus
4
8
  *
5
9
  * Used to force the window to steal focus on load. Children optional.
6
10
  */
7
- export declare function Autofocus(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Autofocus(props: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -1,17 +1,13 @@
1
- import { Component, type PropsWithChildren } from 'react';
2
- type Props = Partial<{
3
- /**
4
- * The interval between blinks, in milliseconds.
5
- */
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ /** Things that blink! */
4
+ children: ReactNode;
5
+ } & Partial<{
6
+ /** The interval between blinks, in milliseconds. */
6
7
  interval: number;
7
- /**
8
- * The time to wait before blinking again, in milliseconds.
9
- */
8
+ /** The time to wait before blinking again, in milliseconds. */
10
9
  time: number;
11
- }> & PropsWithChildren;
12
- type State = {
13
- hidden: boolean;
14
- };
10
+ }>;
15
11
  /**
16
12
  * ## Blink
17
13
  *
@@ -19,14 +15,5 @@ type State = {
19
15
  *
20
16
  * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-blink--docs)
21
17
  */
22
- export declare class Blink extends Component<Props, State> {
23
- interval: NodeJS.Timeout;
24
- timer: NodeJS.Timeout;
25
- constructor(props: any);
26
- createTimer(): void;
27
- componentDidMount(): void;
28
- componentDidUpdate(prevProps: any): void;
29
- componentWillUnmount(): void;
30
- render(): import("react/jsx-runtime").JSX.Element;
31
- }
18
+ export declare function Blink(props: Props): import("react/jsx-runtime").JSX.Element;
32
19
  export {};
@@ -1 +1 @@
1
- import*as t from"react/jsx-runtime";import*as e from"react";class i extends e.Component{interval;timer;constructor(t){super(t),this.state={hidden:!1}}createTimer(){let{interval:t=1e3,time:e=1e3}=this.props;clearInterval(this.interval),clearTimeout(this.timer),this.setState({hidden:!1}),this.interval=setInterval(()=>{this.setState({hidden:!0}),this.timer=setTimeout(()=>{this.setState({hidden:!1})},e)},t+e)}componentDidMount(){this.createTimer()}componentDidUpdate(t){(t.interval!==this.props.interval||t.time!==this.props.time)&&this.createTimer()}componentWillUnmount(){clearInterval(this.interval),clearTimeout(this.timer)}render(){return(0,t.jsx)("span",{style:{visibility:this.state.hidden?"hidden":"visible"},children:this.props.children})}}export{i as Blink};
1
+ import*as e from"react/jsx-runtime";import*as t from"react";function r(r){let{children:i,interval:s=1e3,time:n=1e3}=r,[l,a]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let e=setInterval(()=>{a(!0),setTimeout(()=>{a(!1)},n)},s+n);return()=>{clearInterval(e)}},[s,n]),(0,e.jsx)("span",{style:{visibility:l?"hidden":"visible"},children:i})}export{r as Blink};
@@ -1 +1 @@
1
- import*as e from"react";import*as o from"../common/ui.js";function m(m){let{as:s="div",className:t,children:a,tw:r,...c}=m,u=(0,e.useMemo)(()=>t?`${t} ${(0,o.computeBoxClassName)(c)}`:(0,o.computeBoxClassName)(c),[t,c]),p=(0,e.useMemo)(()=>(0,o.computeBoxProps)({...c,...(0,o.computeTwClass)(r)}),[c,r]);return(0,e.createElement)(s,{...p,className:u},a)}export{m as Box};
1
+ import*as o from"react";import*as e from"../common/ui.js";function m(m){let{as:t="div",className:s,children:a,tw:r,...c}=m,p=s?`${s} ${(0,e.computeBoxClassName)(c)}`:(0,e.computeBoxClassName)(c),u=(0,e.computeBoxProps)({...c,...(0,e.computeTwClass)(r)});return(0,o.createElement)(t,{...u,className:p},a)}export{m as Box};
@@ -2,15 +2,16 @@ import type { ReactNode } from 'react';
2
2
  type DialogProps = {
3
3
  /** The content of the dialog. */
4
4
  children: ReactNode;
5
- /** The height of the dialog. */
6
- height?: string;
7
5
  /** The function to call when close is clicked */
8
6
  onClose: () => void;
9
7
  /** The title of the dialog. */
10
8
  title: ReactNode;
9
+ } & Partial<{
10
+ /** The height of the dialog. */
11
+ height: string;
11
12
  /** The width of the dialog. */
12
- width?: string;
13
- };
13
+ width: string;
14
+ }>;
14
15
  /**
15
16
  * ## Dialog
16
17
  *
@@ -31,7 +32,7 @@ export declare namespace Dialog {
31
32
  var Button: typeof DialogButton;
32
33
  }
33
34
  type DialogButtonProps = {
34
- children: any;
35
+ children: ReactNode;
35
36
  onClick: () => void;
36
37
  };
37
38
  declare function DialogButton(props: DialogButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import*as T from"react/jsx-runtime";import*as r from"./Image.js";var S,e=((S={})[S.NORTH=1]="NORTH",S[S.SOUTH=2]="SOUTH",S[S.EAST=4]="EAST",S[S.WEST=8]="WEST",S[S.NORTHEAST=5]="NORTHEAST",S[S.NORTHWEST=9]="NORTHWEST",S[S.SOUTHEAST=6]="SOUTHEAST",S[S.SOUTHWEST=10]="SOUTHWEST",S);function t(S){let{className:e,direction:t=2,fallback:o,frame:E=1,icon_state:i,icon:m,movement:n=!1,...H}=S,O=Byond.iconRefMap?.[m];if(!O)return o;let a=`${O}?state=${i}&dir=${t}&movement=${!!n}&frame=${E}`;return(0,T.jsx)(r.Image,{fixErrors:!0,src:a,...H})}export{e as Direction,t as DmIcon};
1
+ import*as T from"react/jsx-runtime";import*as r from"./Image.js";var S,e=((S={})[S.NORTH=1]="NORTH",S[S.SOUTH=2]="SOUTH",S[S.EAST=4]="EAST",S[S.WEST=8]="WEST",S[S.NORTHEAST=5]="NORTHEAST",S[S.NORTHWEST=9]="NORTHWEST",S[S.SOUTHEAST=6]="SOUTHEAST",S[S.SOUTHWEST=10]="SOUTHWEST",S);function t(S){let{direction:e=2,fallback:t,frame:o=1,icon_state:E,icon:i,movement:m=!1,...n}=S,H=Byond.iconRefMap?.[i];if(!H)return t;let O=`${H}?state=${E}&dir=${e}&movement=${!!m}&frame=${o}`;return(0,T.jsx)(r.Image,{fixErrors:!0,src:O,...n})}export{e as Direction,t as DmIcon};
@@ -1,9 +1,11 @@
1
1
  import type { BoxProps } from './Box';
2
2
  type Props = Partial<{
3
- className: string;
4
- /** True is default, this fixes an ie thing */
3
+ /** True is default, this fixes DM icon rendering issues */
5
4
  fixBlur: boolean;
6
- /** False by default. Good if you're fetching images on UIs that do not auto update. This will attempt to fix the 'x' icon 5 times. */
5
+ /**
6
+ * False by default. Good if you're fetching images on UIs that do not auto
7
+ * update. This will attempt to fix the 'x' icon 5 times.
8
+ */
7
9
  fixErrors: boolean;
8
10
  /** Fill is default. */
9
11
  objectFit: 'contain' | 'cover';
@@ -1 +1 @@
1
- import*as e from"react/jsx-runtime";import*as A from"react";import*as t from"../common/ui.js";function r(r){let{fixBlur:o=!0,fixErrors:m=!1,objectFit:a="fill",src:i,...n}=r,s=(0,A.useRef)(0),u=(0,t.computeBoxProps)(n);return u.style={...u.style,"-ms-interpolation-mode":o?"nearest-neighbor":"auto",imageRendering:o?"pixelated":"auto",objectFit:a},(0,e.jsx)("img",{onError:e=>{if(m&&s.current<5){let A=e.currentTarget;setTimeout(()=>{A.src=`${i}?attempt=${s.current}`,s.current++},1e3)}},src:i||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",...u,alt:"dm icon"})}export{r as Image};
1
+ import*as A from"react/jsx-runtime";import*as e from"react";import*as r from"../common/ui.js";function t(t){let{fixBlur:o=!0,fixErrors:m=!1,objectFit:a="fill",src:i,...n}=t,s=(0,e.useRef)(0),c=(0,r.computeBoxProps)(n);return c.style={...c.style,imageRendering:o?"pixelated":"auto",objectFit:a},(0,A.jsx)("img",{onError:A=>{if(m&&s.current<5){let e=A.currentTarget;setTimeout(()=>{e.src=`${i}?attempt=${s.current}`,s.current++},1e3)}},src:i||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",...c,alt:"dm icon"})}export{t as Image};
@@ -10,6 +10,8 @@ type Props = {
10
10
  initialLeft: number;
11
11
  /** The initial top position of the image. */
12
12
  initialTop: number;
13
+ /** Padding applied to the right of the zoom controls */
14
+ zoomPadding: number;
13
15
  /** A callback function that is called when the background image is moved. */
14
16
  onBackgroundMoved: (newX: number, newY: number) => void;
15
17
  /** A callback function that is called when the zoom value changes. */
@@ -1 +1 @@
1
- import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../common/ui.js";import*as n from"./Button.js";import*as i from"./ProgressBar.js";import*as s from"./Stack.js";function r(n){let{backgroundImage:i,children:s,imageWidth:r,initialLeft:u=0,initialTop:c=0,onBackgroundMoved:l,onZoomChange:d,...m}=n,[p,f]=(0,t.useState)(0),[x,h]=(0,t.useState)(0),[j,g]=(0,t.useState)(0),[k,v]=(0,t.useState)(!1),[S,w]=(0,t.useState)(0),[b,M]=(0,t.useState)(1);function $(e){f(e.clientX-j),h(e.clientY-S),v(!0)}function B(e){if(!k)return;let t=e.clientX-p,o=e.clientY-x;l?.(t+u,o+c),g(t),w(o)}function y(){v(!1)}(0,t.useEffect)(()=>(window.addEventListener("mouseup",y),()=>{window.removeEventListener("mouseup",y)}),[]);let I=u+j,P=c+S;return(0,e.jsxs)("div",{...(0,o.computeBoxProps)({...m,style:{...m.style,height:"100%",overflow:"hidden",position:"relative",width:"100%"}}),children:[(0,e.jsx)("div",{onMouseDown:$,onMouseMove:B,style:{backgroundImage:`url("${i}")`,backgroundPosition:`${I}px ${P}px`,backgroundRepeat:"repeat",backgroundSize:`${b*r}px`,height:"100%",inset:0,position:"absolute",width:"100%"}}),(0,e.jsx)("div",{onMouseDown:$,onMouseMove:B,style:{height:"100%",inset:0,position:"absolute",transform:`translate(${I}px, ${P}px) scale(${b})`,transformOrigin:"top left",width:"100%"},children:s}),(0,e.jsx)(a,{onZoomClick:function(e){if("increase"===e&&b>=1.5||"decrease"===e&&b<=.5)return;let t=Math.round((b+("increase"===e?.1:-.1))*10)/10;M(t),d?.(t)},zoom:b})]})}function a(t){let{zoom:o,onZoomClick:r}=t;return(0,e.jsx)("div",{style:{left:5,position:"absolute",right:5,top:5},children:(0,e.jsxs)(s.Stack,{children:[(0,e.jsx)(s.Stack.Item,{children:(0,e.jsx)(n.Button,{disabled:o<=.5,icon:"minus",onClick:()=>r("decrease")})}),(0,e.jsx)(s.Stack.Item,{grow:!0,children:(0,e.jsxs)(i.ProgressBar,{maxValue:1.5,minValue:.5,value:o,children:[o,"x"]})}),(0,e.jsx)(s.Stack.Item,{children:(0,e.jsx)(n.Button,{disabled:o>=1.5,icon:"plus",onClick:()=>r("increase")})})]})})}export{r as InfinitePlane};
1
+ import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../common/ui.js";import*as n from"./Button.js";import*as i from"./ProgressBar.js";import*as s from"./Stack.js";function r(n){let{backgroundImage:i,children:s,imageWidth:r,zoomPadding:u=0,initialLeft:c=0,initialTop:l=0,onBackgroundMoved:d,onZoomChange:m,...p}=n,[f,x]=(0,t.useState)(0),[h,j]=(0,t.useState)(0),[g,v]=(0,t.useState)(0),[k,S]=(0,t.useState)(!1),[w,b]=(0,t.useState)(0),[M,$]=(0,t.useState)(1);function B(e){x(e.clientX-g),j(e.clientY-w),S(!0)}function y(e){if(!k)return;let t=e.clientX-f,o=e.clientY-h;d?.(t+c,o+l),v(t),b(o)}function I(){S(!1)}function P(e){if("increase"===e&&M>=1.5||"decrease"===e&&M<=.5)return;let t=Math.round((M+("increase"===e?.1:-.1))*10)/10;$(t),m?.(t)}(0,t.useEffect)(()=>(window.addEventListener("mouseup",I),()=>{window.removeEventListener("mouseup",I)}),[]);let Y=c+g,C=l+w;return(0,e.jsxs)("div",{...(0,o.computeBoxProps)({...p,style:{...p.style,height:"100%",overflow:"hidden",position:"relative",width:"100%"}}),children:[(0,e.jsx)("div",{onMouseDown:B,onMouseMove:y,onWheel:function(e){0!==e.deltaY&&(e.preventDefault(),P(e.deltaY>0?"increase":"decrease"))},style:{backgroundImage:`url("${i}")`,backgroundPosition:`${Y}px ${C}px`,backgroundRepeat:"repeat",backgroundSize:`${M*r}px`,height:"100%",inset:0,position:"absolute",width:"100%"}}),(0,e.jsx)("div",{onMouseDown:B,onMouseMove:y,style:{height:"100%",inset:0,position:"absolute",transform:`translate(${Y}px, ${C}px) scale(${M})`,transformOrigin:"top left",width:"100%"},children:s}),(0,e.jsx)(a,{padding:u,onZoomClick:P,zoom:M})]})}function a(t){let{zoom:o,padding:r,onZoomClick:a}=t;return(0,e.jsx)("div",{style:{left:5,position:"absolute",right:5+r,top:5},children:(0,e.jsxs)(s.Stack,{children:[(0,e.jsx)(s.Stack.Item,{children:(0,e.jsx)(n.Button,{disabled:o<=.5,icon:"minus",onClick:()=>a("decrease")})}),(0,e.jsx)(s.Stack.Item,{grow:!0,children:(0,e.jsxs)(i.ProgressBar,{maxValue:1.5,minValue:.5,value:o,children:[o,"x"]})}),(0,e.jsx)(s.Stack.Item,{children:(0,e.jsx)(n.Button,{disabled:o>=1.5,icon:"plus",onClick:()=>a("increase")})})]})})}export{r as InfinitePlane};
@@ -87,9 +87,7 @@ declare function LabeledListDivider(props: LabeledListDividerProps): import("rea
87
87
  * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-labeledlist--docs)
88
88
  */
89
89
  export declare namespace LabeledList {
90
- /**
91
- * Adds some empty space between LabeledList items.
92
- */
90
+ /** Adds some empty space between LabeledList items. */
93
91
  const Divider: typeof LabeledListDivider;
94
92
  const Item: typeof LabeledListItem;
95
93
  }
@@ -1,11 +1,11 @@
1
1
  import type { KeyboardEvent } from 'react';
2
2
  import type { BoxProps } from './Box';
3
- export type ModalProps = BoxProps & Partial<{
3
+ export type ModalProps = Partial<{
4
4
  /** Fires once the enter key is pressed */
5
5
  onEnter: (e: KeyboardEvent<HTMLInputElement>) => void;
6
6
  /** Fires once the escape key is pressed */
7
7
  onEscape: (e: KeyboardEvent<HTMLInputElement>) => void;
8
- }>;
8
+ }> & BoxProps;
9
9
  /**
10
10
  * ## Modal
11
11
  *
@@ -1,7 +1,7 @@
1
1
  import { type BoxProps } from './Box';
2
2
  type Props = ExclusiveProps & BoxProps;
3
3
  /** You MUST use only one or none */
4
- type NoticeType = 'info' | 'success' | 'warning' | 'danger';
4
+ type NoticeType = 'info' | 'success' | 'danger';
5
5
  type None = {
6
6
  [K in NoticeType]?: undefined;
7
7
  };
@@ -11,9 +11,6 @@ type ExclusiveProps = None | (Omit<None, 'info'> & {
11
11
  }) | (Omit<None, 'success'> & {
12
12
  /** Green notice */
13
13
  success: boolean;
14
- }) | (Omit<None, 'warning'> & {
15
- /** Orange notice */
16
- warning: boolean;
17
14
  }) | (Omit<None, 'danger'> & {
18
15
  /** Red notice */
19
16
  danger: boolean;
@@ -1 +1 @@
1
- import*as o from"react/jsx-runtime";import*as e from"../common/react.js";import*as t from"./Box.js";function c(c){let{className:s,color:r,info:i,success:x,warning:m,danger:a,...B}=c;return(0,o.jsx)(t.Box,{className:(0,e.classes)(["NoticeBox",r&&`NoticeBox--color--${r}`,i&&"NoticeBox--type--info",x&&"NoticeBox--type--success",a&&"NoticeBox--type--danger",s]),...B})}export{c as NoticeBox};
1
+ import*as o from"react/jsx-runtime";import*as e from"../common/react.js";import*as t from"./Box.js";function c(c){let{className:s,color:r,info:i,success:x,danger:m,...a}=c;return(0,o.jsx)(t.Box,{className:(0,e.classes)(["NoticeBox",r&&`NoticeBox--color--${r}`,i&&"NoticeBox--type--info",x&&"NoticeBox--type--success",m&&"NoticeBox--type--danger",s]),...a})}export{c as NoticeBox};
@@ -1,12 +1,34 @@
1
- import { Component, type PropsWithChildren } from 'react';
1
+ import { type ReactElement } from 'react';
2
2
  type Props = {
3
+ /** The excluded element that CAN be clicked */
4
+ children: ReactElement<HTMLElement>;
5
+ /** Callback that fires whenever the user clicks something else */
3
6
  onOutsideClick: () => void;
4
- } & PropsWithChildren;
5
- export declare class TrackOutsideClicks extends Component<Props> {
6
- ref: import("react").RefObject<HTMLDivElement | null>;
7
- constructor(props: any);
8
- componentWillUnmount(): void;
9
- handleOutsideClick(event: MouseEvent): void;
10
- render(): import("react/jsx-runtime").JSX.Element;
11
- }
7
+ };
8
+ /**
9
+ * ## TrackOutsideClicks
10
+ *
11
+ * Allows you to track when the user clicks outside of a specific element.
12
+ *
13
+ * Example:
14
+ *
15
+ * ```tsx
16
+ * import { TrackOutsideClicks } from 'tgui-core/components';
17
+ *
18
+ * function MyComponent() {
19
+ * const [isOpen, setIsOpen] = useState(false);
20
+ *
21
+ * return (
22
+ * <TrackOutsideClicks onOutsideClick={() => setIsOpen(false)}>
23
+ * <div>
24
+ * Hello world!
25
+ * </div>
26
+ * </TrackOutsideClicks>
27
+ * );
28
+ * }
29
+ * ```
30
+ *
31
+ * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-trackoutsideclicks--docs)
32
+ */
33
+ export declare function TrackOutsideClicks(props: Props): import("react/jsx-runtime").JSX.Element;
12
34
  export {};
@@ -1 +1 @@
1
- import*as e from"react/jsx-runtime";import*as t from"react";class i extends t.Component{ref=(0,t.createRef)();constructor(e){super(e),this.handleOutsideClick=this.handleOutsideClick.bind(this),document.addEventListener("click",this.handleOutsideClick)}componentWillUnmount(){document.removeEventListener("click",this.handleOutsideClick)}handleOutsideClick(e){e.target instanceof Node&&this.ref.current&&!this.ref.current.contains(e.target)&&this.props.onOutsideClick()}render(){return(0,e.jsx)("div",{ref:this.ref,children:this.props.children})}}export{i as TrackOutsideClicks};
1
+ import*as e from"react/jsx-runtime";import*as t from"react";function r(r){let{children:n,onOutsideClick:c}=r,i=(0,t.createRef)();function o(e){e.target instanceof Node&&i.current&&!i.current.contains(e.target)&&c()}return(0,t.useEffect)(()=>(document.addEventListener("click",o),()=>{document.removeEventListener("click",o)}),[]),(0,e.jsx)("div",{ref:i,style:{userSelect:"none"},children:n})}export{r as TrackOutsideClicks};
package/package.json CHANGED
@@ -6,22 +6,23 @@
6
6
  },
7
7
  "description": "TGUI core component library",
8
8
  "devDependencies": {
9
- "@biomejs/biome": "2.0.0-beta.2",
10
- "@rsbuild/core": "^1.3.18",
9
+ "@biomejs/biome": "^2.0.0-beta.5",
10
+ "@rsbuild/core": "^1.3.20",
11
11
  "@rsbuild/plugin-react": "^1.3.1",
12
12
  "@rsbuild/plugin-sass": "^1.3.1",
13
- "@rslib/core": "^0.6.9",
13
+ "@rslib/core": "^0.7.1",
14
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",
15
+ "@storybook/addon-essentials": "^8.6.14",
16
+ "@storybook/blocks": "^8.6.14",
17
+ "@storybook/react": "^8.6.14",
18
+ "@storybook/test": "^8.6.14",
19
+ "@storybook/theming": "^8.6.14",
20
+ "@types/bun": "^1.2.13",
21
+ "@types/react": "^19.1.4",
22
+ "@types/react-dom": "^19.1.5",
22
23
  "prettier": "^3.5.3",
23
- "sass": "^1.81.0",
24
- "storybook": "^8.6.12",
24
+ "sass": "^1.89.0",
25
+ "storybook": "^8.6.14",
25
26
  "storybook-addon-sass-postcss": "^0.3.2",
26
27
  "storybook-react-rsbuild": "^1.0.1",
27
28
  "typescript": "^5.8.3"
@@ -54,7 +55,7 @@
54
55
  ],
55
56
  "license": "MIT",
56
57
  "name": "tgui-core",
57
- "packageManager": "pnpm@10.10.0",
58
+ "packageManager": "bun@1.2.13",
58
59
  "peerDependencies": {
59
60
  "react": "^19.1.0",
60
61
  "react-dom": "^19.1.0"
@@ -64,13 +65,13 @@
64
65
  "url": "https://github.com/tgstation/tgui-core.git"
65
66
  },
66
67
  "scripts": {
67
- "build": "rslib build",
68
+ "build-rslib": "rslib build",
68
69
  "build-storybook": "storybook build",
69
70
  "lint": "biome check lib",
70
71
  "lint:fix": "prettier . --write && biome check . --fix",
71
72
  "storybook": "storybook dev -p 6006",
72
- "test": "node --experimental-strip-types --experimental-test-coverage --test ./tests/*.test.ts"
73
+ "test": "bun test"
73
74
  },
74
75
  "type": "module",
75
- "version": "3.2.0"
76
+ "version": "3.3.1"
76
77
  }