tgui-core 3.1.5 → 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 +4 -4
- package/dist/common/constants.d.ts +42 -42
- package/dist/common/constants.js +1 -1
- package/dist/common/fp.d.ts +2 -1
- package/dist/common/fuzzysearch.d.ts +26 -0
- package/dist/common/fuzzysearch.js +1 -0
- package/dist/common/string.d.ts +14 -7
- package/dist/common/string.js +1 -1
- package/dist/common/type-utils.d.ts +2 -1
- package/dist/common/ui.js +1 -1
- package/dist/common/uuid.d.ts +2 -1
- package/dist/components/AnimatedNumber.d.ts +3 -0
- package/dist/components/Autofocus.d.ts +12 -3
- package/dist/components/Blink.d.ts +16 -22
- package/dist/components/Blink.js +1 -1
- package/dist/components/BlockQuote.d.ts +3 -0
- package/dist/components/Box.d.ts +7 -2
- package/dist/components/Box.js +1 -1
- package/dist/components/Button.d.ts +3 -0
- package/dist/components/Button.js +1 -1
- package/dist/components/ByondUi.d.ts +5 -2
- package/dist/components/Chart.js +1 -1
- package/dist/components/Collapsible.d.ts +3 -0
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/ColorBox.d.ts +3 -0
- package/dist/components/Dialog.d.ts +11 -6
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Dimmer.d.ts +3 -0
- package/dist/components/Divider.d.ts +3 -0
- package/dist/components/DmIcon.d.ts +1 -0
- package/dist/components/DmIcon.js +1 -1
- package/dist/components/DraggableControl.js +1 -1
- package/dist/components/Dropdown.d.ts +3 -0
- package/dist/components/Dropdown.js +1 -1
- package/dist/components/Flex.d.ts +5 -1
- package/dist/components/Flex.js +1 -1
- package/dist/components/Floating.d.ts +1 -0
- package/dist/components/Floating.js +1 -1
- package/dist/components/Icon.d.ts +10 -3
- package/dist/components/Image.d.ts +6 -3
- package/dist/components/Image.js +1 -1
- package/dist/components/ImageButton.d.ts +4 -0
- package/dist/components/ImageButton.js +1 -1
- package/dist/components/InfinitePlane.d.ts +7 -1
- package/dist/components/InfinitePlane.js +1 -1
- package/dist/components/Input.d.ts +1 -1
- package/dist/components/KeyListener.d.ts +3 -0
- package/dist/components/Knob.d.ts +3 -0
- package/dist/components/Knob.js +1 -1
- package/dist/components/LabeledControls.d.ts +6 -2
- package/dist/components/LabeledControls.js +1 -1
- package/dist/components/LabeledList.d.ts +8 -5
- package/dist/components/LabeledList.js +1 -1
- package/dist/components/MenuBar.js +1 -1
- package/dist/components/Modal.d.ts +9 -4
- package/dist/components/NoticeBox.d.ts +4 -4
- package/dist/components/NoticeBox.js +1 -1
- package/dist/components/NumberInput.d.ts +3 -0
- package/dist/components/NumberInput.js +1 -1
- package/dist/components/Popper.d.ts +3 -0
- package/dist/components/Popper.js +1 -1
- package/dist/components/ProgressBar.d.ts +3 -0
- package/dist/components/RestrictedInput.d.ts +2 -2
- package/dist/components/RoundGauge.d.ts +4 -1
- package/dist/components/RoundGauge.js +1 -1
- package/dist/components/Section.d.ts +7 -0
- package/dist/components/Section.js +1 -1
- package/dist/components/Slider.d.ts +5 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/Stack.d.ts +8 -3
- package/dist/components/Table.d.ts +5 -1
- package/dist/components/Tabs.d.ts +12 -6
- package/dist/components/TextArea.d.ts +1 -1
- package/dist/components/TimeDisplay.d.ts +7 -0
- package/dist/components/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TrackOutsideClicks.d.ts +31 -9
- package/dist/components/TrackOutsideClicks.js +1 -1
- package/dist/components/VirtualList.d.ts +4 -0
- package/package.json +51 -41
|
@@ -45,7 +45,10 @@ type Props = {
|
|
|
45
45
|
}> & BoxProps & PropsWithChildren;
|
|
46
46
|
/**
|
|
47
47
|
* ## ProgressBar
|
|
48
|
+
*
|
|
48
49
|
* Progress indicators inform users about the status of ongoing processes.
|
|
50
|
+
*
|
|
51
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-progressbar--docs)
|
|
49
52
|
*/
|
|
50
53
|
export declare function ProgressBar(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
51
54
|
export {};
|
|
@@ -61,9 +61,9 @@ type Props = Partial<{
|
|
|
61
61
|
*
|
|
62
62
|
* Creates a numerical input which rejects improper keys.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
64
|
+
* Has a special event for changes in validation states - `onValidationChange`.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-restrictedinput--docs)
|
|
67
67
|
*/
|
|
68
68
|
export declare function RestrictedInput(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
export {};
|
|
@@ -25,10 +25,12 @@ type Props = {
|
|
|
25
25
|
}> & BoxProps;
|
|
26
26
|
/**
|
|
27
27
|
* ## RoundGauge
|
|
28
|
+
*
|
|
28
29
|
* The RoundGauge component provides a visual representation of a single metric, as well as being capable of showing
|
|
29
30
|
* informational or cautionary boundaries related to that metric.
|
|
30
31
|
*
|
|
31
|
-
*
|
|
32
|
+
* Example:
|
|
33
|
+
*
|
|
32
34
|
* ```tsx
|
|
33
35
|
* <RoundGauge
|
|
34
36
|
* size={1.75}
|
|
@@ -48,6 +50,7 @@ type Props = {
|
|
|
48
50
|
* The alert on the gauge is optional, and will only be shown if the `alertAfter` prop is defined. When defined, the alert
|
|
49
51
|
* will begin to flash the respective color upon which the needle currently rests, as defined in the `ranges` prop.
|
|
50
52
|
*
|
|
53
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-roundgauge--docs)
|
|
51
54
|
*/
|
|
52
55
|
export declare function RoundGauge(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
53
56
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as a from"../common/math.js";import*as s from"../common/react.js";import*as r from"../common/ui.js";import*as o from"./AnimatedNumber.js";function c(c){let{alertAfter:l,alertBefore:t,className:n,format:m,maxValue:i=1,minValue:u=1,ranges:d,size:x=1,style:g,value:j,...C}=c,p=(0,a.scale)(j,u,i),_=(0,a.clamp01)(p),f=d?{}:{primary:[0,1]};if(d)for(let e in d){let s=d[e];f[e]=[(0,a.scale)(s[0],u,i),(0,a.scale)(s[1],u,i)]}let h=(!!l&&!!t&&!!(j>l)&&!!(j<t)||!!l&&!!(j>l)||!!t&&!!(j<t))&&(0,a.keyOfMatchingRange)(_,f);return(0,e.jsxs)("div",{className:"RoundGauge__wrapper",children:[(0,e.jsx)("div",{className:(0,s.classes)(["RoundGauge",n,(0,r.computeBoxClassName)(C)]),...(0,r.computeBoxProps)({style:{fontSize:`${x}em`,...g},...C}),children:(0,e.jsxs)("svg",{viewBox:"0 0 100 50",children:[(l||t)&&(0,e.jsx)("g",{className:(0,s.classes)(["RoundGauge__alert",h?`active RoundGauge__alert--${h}`:""]),children:(0,e.jsx)("path",{d:"M48.211,14.578C48.55,13.9 49.242,13.472 50,13.472C50.758,13.472 51.45,13.9 51.789,14.578C54.793,20.587 60.795,32.589 63.553,38.106C63.863,38.726 63.83,39.462 63.465,40.051C63.101,40.641 62.457,41 61.764,41C55.996,41 44.004,41 38.236,41C37.543,41 36.899,40.641 36.535,40.051C36.17,39.462 36.137,38.726 36.447,38.106C39.205,32.589 45.207,20.587 48.211,14.578ZM50,34.417C51.426,34.417 52.583,35.574 52.583,37C52.583,38.426 51.426,39.583 50,39.583C48.574,39.583 47.417,38.426 47.417,37C47.417,35.574 48.574,34.417 50,34.417ZM50,32.75C50,32.75 53,31.805 53,22.25C53,20.594 51.656,19.25 50,19.25C48.344,19.25 47,20.594 47,22.25C47,31.805 50,32.75 50,32.75Z"})}),(0,e.jsx)("g",{children:(0,e.jsx)("circle",{className:"RoundGauge__ringTrack",cx:"50",cy:"50",r:"45"})}),(0,e.jsx)("g",{children:Object.keys(f).map((a,s)=>{let r=f[a];return(0,e.jsx)("circle",{className:`RoundGauge__ringFill RoundGauge--color--${a}`,style:{strokeDashoffset:Math.max((2-(r[1]-r[0]))*Math.PI*50,0)},transform:`rotate(${180+180*r[0]} 50 50)
|
|
1
|
+
import*as e from"react/jsx-runtime";import*as a from"../common/math.js";import*as s from"../common/react.js";import*as r from"../common/ui.js";import*as o from"./AnimatedNumber.js";function c(c){let{alertAfter:l,alertBefore:t,className:n,format:m,maxValue:i=1,minValue:u=1,ranges:d,size:x=1,style:g,value:j,...C}=c,p=(0,a.scale)(j,u,i),_=(0,a.clamp01)(p),f=d?{}:{primary:[0,1]};if(d)for(let e in d){let s=d[e];f[e]=[(0,a.scale)(s[0],u,i),(0,a.scale)(s[1],u,i)]}let h=(!!l&&!!t&&!!(j>l)&&!!(j<t)||!!l&&!!(j>l)||!!t&&!!(j<t))&&(0,a.keyOfMatchingRange)(_,f);return(0,e.jsxs)("div",{className:"RoundGauge__wrapper",children:[(0,e.jsx)("div",{className:(0,s.classes)(["RoundGauge",n,(0,r.computeBoxClassName)(C)]),...(0,r.computeBoxProps)({style:{fontSize:`${x}em`,...g},...C}),children:(0,e.jsxs)("svg",{viewBox:"0 0 100 50",children:[(l||t)&&(0,e.jsx)("g",{className:(0,s.classes)(["RoundGauge__alert",h?`active RoundGauge__alert--${h}`:""]),children:(0,e.jsx)("path",{d:"M48.211,14.578C48.55,13.9 49.242,13.472 50,13.472C50.758,13.472 51.45,13.9 51.789,14.578C54.793,20.587 60.795,32.589 63.553,38.106C63.863,38.726 63.83,39.462 63.465,40.051C63.101,40.641 62.457,41 61.764,41C55.996,41 44.004,41 38.236,41C37.543,41 36.899,40.641 36.535,40.051C36.17,39.462 36.137,38.726 36.447,38.106C39.205,32.589 45.207,20.587 48.211,14.578ZM50,34.417C51.426,34.417 52.583,35.574 52.583,37C52.583,38.426 51.426,39.583 50,39.583C48.574,39.583 47.417,38.426 47.417,37C47.417,35.574 48.574,34.417 50,34.417ZM50,32.75C50,32.75 53,31.805 53,22.25C53,20.594 51.656,19.25 50,19.25C48.344,19.25 47,20.594 47,22.25C47,31.805 50,32.75 50,32.75Z"})}),(0,e.jsx)("g",{children:(0,e.jsx)("circle",{className:"RoundGauge__ringTrack",cx:"50",cy:"50",r:"45"})}),(0,e.jsx)("g",{children:Object.keys(f).map((a,s)=>{let r=f[a];return(0,e.jsx)("circle",{className:`RoundGauge__ringFill RoundGauge--color--${a}`,cx:"50",cy:"50",r:"45",style:{strokeDashoffset:Math.max((2-(r[1]-r[0]))*Math.PI*50,0)},transform:`rotate(${180+180*r[0]} 50 50)`},s)})}),(0,e.jsxs)("g",{className:"RoundGauge__needle",transform:`rotate(${180*_-90} 50 50)`,children:[(0,e.jsx)("polygon",{className:"RoundGauge__needleLine",points:"46,50 50,0 54,50"}),(0,e.jsx)("circle",{className:"RoundGauge__needleMiddle",cx:"50",cy:"50",r:"8"})]}),(0,e.jsx)("title",{children:"alert"})]})}),(0,e.jsx)(o.AnimatedNumber,{format:m,value:j})]})}export{c as RoundGauge};
|
|
@@ -28,6 +28,7 @@ type Props = Partial<{
|
|
|
28
28
|
}> & BoxProps;
|
|
29
29
|
/**
|
|
30
30
|
* ## Section
|
|
31
|
+
*
|
|
31
32
|
* Section is a surface that displays content and actions on a single topic.
|
|
32
33
|
*
|
|
33
34
|
* They should be easy to scan for relevant and actionable information.
|
|
@@ -40,6 +41,8 @@ type Props = Partial<{
|
|
|
40
41
|
*
|
|
41
42
|
* Section can also be titled to clearly define its purpose.
|
|
42
43
|
*
|
|
44
|
+
* Example:
|
|
45
|
+
*
|
|
43
46
|
* ```tsx
|
|
44
47
|
* <Section title="Cargo">Here you can order supply crates.</Section>
|
|
45
48
|
* ```
|
|
@@ -47,11 +50,15 @@ type Props = Partial<{
|
|
|
47
50
|
* If you want to have a button on the right side of an section title
|
|
48
51
|
* (for example, to perform some sort of action), there is a way to do that:
|
|
49
52
|
*
|
|
53
|
+
* Example:
|
|
54
|
+
*
|
|
50
55
|
* ```tsx
|
|
51
56
|
* <Section title="Cargo" buttons={<Button>Send shuttle</Button>}>
|
|
52
57
|
* Here you can order supply crates.
|
|
53
58
|
* </Section>
|
|
54
59
|
* ```
|
|
60
|
+
*
|
|
61
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-section--docs)
|
|
55
62
|
*/
|
|
56
63
|
export declare function Section(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
57
64
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../common/events.js";import*as c from"../common/react.js";import*as n from"../common/ui.js";function s(s){let{buttons:r,children:i,className:l,container_id:a="",fill:m,fitted:d,flexGrow:S,noTopPadding:u,onScroll:_,ref:f,scrollable:x,scrollableHorizontal:p,stretchContents:j,title:N,...h}=s,v=(0,c.canRender)(N)||(0,c.canRender)(r),b=(0,t.useRef)(null),R=f??b;return(0,t.useEffect)(()=>(R.current&&(x||p)&&(0,o.addScrollableNode)(R.current),()=>{R.current&&(0,o.removeScrollableNode)(R.current)}),[]),(0,e.jsxs)("div",{
|
|
1
|
+
import*as e from"react/jsx-runtime";import*as t from"react";import*as o from"../common/events.js";import*as c from"../common/react.js";import*as n from"../common/ui.js";function s(s){let{buttons:r,children:i,className:l,container_id:a="",fill:m,fitted:d,flexGrow:S,noTopPadding:u,onScroll:_,ref:f,scrollable:x,scrollableHorizontal:p,stretchContents:j,title:N,...h}=s,v=(0,c.canRender)(N)||(0,c.canRender)(r),b=(0,t.useRef)(null),R=f??b;return(0,t.useEffect)(()=>(R.current&&(x||p)&&(0,o.addScrollableNode)(R.current),()=>{R.current&&(0,o.removeScrollableNode)(R.current)}),[]),(0,e.jsxs)("div",{className:(0,c.classes)(["Section",m&&"Section--fill",d&&"Section--fitted",x&&"Section--scrollable",p&&"Section--scrollableHorizontal",S&&"Section--flex",l,(0,n.computeBoxClassName)(h)]),id:a,...(0,n.computeBoxProps)(h),children:[v&&(0,e.jsxs)("div",{className:"Section__title",children:[(0,e.jsx)("span",{className:"Section__titleText",children:N}),(0,e.jsx)("div",{className:"Section__buttons",children:r})]}),(0,e.jsx)("div",{className:"Section__rest",children:(0,e.jsx)("div",{className:(0,c.classes)(["Section__content",j&&"Section__content--stretchContents",u&&"Section__content--noTopPadding"]),onScroll:_,ref:R,children:i})})]})}export{s as Section};
|
|
@@ -47,10 +47,14 @@ type Props = {
|
|
|
47
47
|
}> & BoxProps & PropsWithChildren;
|
|
48
48
|
/**
|
|
49
49
|
* ## Slider
|
|
50
|
-
*
|
|
50
|
+
*
|
|
51
|
+
* A horizontal,
|
|
52
|
+
* [ProgressBar](https://tgstation.github.io/tgui-core/?path=/docs/components-progressbar--docs)-like
|
|
51
53
|
* control which allows dialing * in precise values by dragging it left and right.
|
|
52
54
|
*
|
|
53
55
|
* Single click opens an input box to manually type in a number.
|
|
56
|
+
*
|
|
57
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-slider--docs)
|
|
54
58
|
*/
|
|
55
59
|
export declare function Slider(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
56
60
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as s from"react/jsx-runtime";import*as r from"../common/math.js";import*as e from"../common/react.js";import*as a from"../common/ui.js";import*as l from"./DraggableControl.js";function o(o){let{animated:i,format:t,maxValue:c,minValue:m,onChange:d,onDrag:n,step:p,stepPixelSize:_,unit:j,value:u,className:x,fillValue:f,color:g,ranges:h={},children:v,...N}=o,B=void 0!==v;return(0,s.jsx)(l.DraggableControl,{dragMatrix:[1,0],animated:i,format:t,maxValue:c,minValue:m,onChange:d,onDrag:n,step:p,stepPixelSize:_,unit:j,value:u,children:l=>{let{displayElement:o,displayValue:i,dragging:t,handleDragStart:d,inputElement:n}=l,p=null!=f,_=(0,r.scale)(f??i,m,c),j=(0,r.scale)(i,m,c),P=g||(0,r.keyOfMatchingRange)(f??u,h)||"default";return(0,s.jsxs)("div",{className:(0,e.classes)(["Slider","ProgressBar",`ProgressBar--color--${P}`,x,(0,a.computeBoxClassName)(N)]),...(0,a.computeBoxProps)(N),onMouseDown:d,children:[(0,s.jsx)("div",{className:(0,e.classes)(["ProgressBar__fill",p&&"ProgressBar__fill--animated"]),style:{width:`${100*(0,r.clamp01)(_)}
|
|
1
|
+
import*as s from"react/jsx-runtime";import*as r from"../common/math.js";import*as e from"../common/react.js";import*as a from"../common/ui.js";import*as l from"./DraggableControl.js";function o(o){let{animated:i,format:t,maxValue:c,minValue:m,onChange:d,onDrag:n,step:p,stepPixelSize:_,unit:j,value:u,className:x,fillValue:f,color:g,ranges:h={},children:v,...N}=o,B=void 0!==v;return(0,s.jsx)(l.DraggableControl,{dragMatrix:[1,0],animated:i,format:t,maxValue:c,minValue:m,onChange:d,onDrag:n,step:p,stepPixelSize:_,unit:j,value:u,children:l=>{let{displayElement:o,displayValue:i,dragging:t,handleDragStart:d,inputElement:n}=l,p=null!=f,_=(0,r.scale)(f??i,m,c),j=(0,r.scale)(i,m,c),P=g||(0,r.keyOfMatchingRange)(f??u,h)||"default";return(0,s.jsxs)("div",{className:(0,e.classes)(["Slider","ProgressBar",`ProgressBar--color--${P}`,x,(0,a.computeBoxClassName)(N)]),...(0,a.computeBoxProps)(N),onMouseDown:d,children:[(0,s.jsx)("div",{className:(0,e.classes)(["ProgressBar__fill",p&&"ProgressBar__fill--animated"]),style:{opacity:.4,width:`${100*(0,r.clamp01)(_)}%`}}),(0,s.jsx)("div",{className:"ProgressBar__fill",style:{width:`${100*(0,r.clamp01)(Math.min(_,j))}%`}}),(0,s.jsxs)("div",{className:"Slider__cursorOffset",style:{width:`${100*(0,r.clamp01)(j)}%`},children:[(0,s.jsx)("div",{className:"Slider__cursor"}),(0,s.jsx)("div",{className:"Slider__pointer"}),t&&(0,s.jsx)("div",{className:"Slider__popupValue",children:o})]}),(0,s.jsx)("div",{className:"ProgressBar__content",children:B?v:o}),n]})}})}export{o as Slider};
|
|
@@ -12,8 +12,9 @@ type Props = Partial<{
|
|
|
12
12
|
}> & FlexProps;
|
|
13
13
|
/**
|
|
14
14
|
* ## Stack
|
|
15
|
+
*
|
|
15
16
|
* A higher-level component that is based on
|
|
16
|
-
* [Flex](https://github.
|
|
17
|
+
* [Flex](https://tgstation.github.io/tgui-core/?path=/docs/components-flex--docs).
|
|
17
18
|
*
|
|
18
19
|
* The main difference from `Flex`, is that this component automatically adds
|
|
19
20
|
* spacing between all stack items, reducing the boilerplate that you have to write!
|
|
@@ -22,7 +23,8 @@ type Props = Partial<{
|
|
|
22
23
|
*
|
|
23
24
|
* Stacks can be vertical by adding a `vertical` property.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
+
* Example:
|
|
27
|
+
*
|
|
26
28
|
* ```tsx
|
|
27
29
|
* <Stack vertical>
|
|
28
30
|
* <Stack.Item grow>Button description</Stack.Item>
|
|
@@ -36,7 +38,8 @@ type Props = Partial<{
|
|
|
36
38
|
* Stacks can be used for high level window layout.
|
|
37
39
|
* Make sure to use the `fill` property.
|
|
38
40
|
*
|
|
39
|
-
*
|
|
41
|
+
* Example:
|
|
42
|
+
*
|
|
40
43
|
* ```tsx
|
|
41
44
|
* <Window>
|
|
42
45
|
* <Window.Content>
|
|
@@ -60,6 +63,8 @@ type Props = Partial<{
|
|
|
60
63
|
* </Window.Content>
|
|
61
64
|
* </Window>
|
|
62
65
|
* ```
|
|
66
|
+
*
|
|
67
|
+
* - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-stack--docs)
|
|
63
68
|
*/
|
|
64
69
|
export declare function Stack(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
65
70
|
export declare namespace Stack {
|
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
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
|
-
*
|
|
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.
|
|
82
|
+
* [Section](https://tgstation.github.io/tgui-core/?path=/docs/components-section--docs)
|
|
80
83
|
* component:
|
|
81
84
|
*
|
|
82
|
-
*
|
|
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
|
-
*
|
|
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,{
|
|
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,12 +1,34 @@
|
|
|
1
|
-
import {
|
|
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
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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";
|
|
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};
|
|
@@ -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,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
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
|
-
"
|
|
6
|
-
|
|
8
|
+
"devDependencies": {
|
|
9
|
+
"@biomejs/biome": "^2.0.0-beta.5",
|
|
10
|
+
"@rsbuild/core": "^1.3.20",
|
|
11
|
+
"@rsbuild/plugin-react": "^1.3.1",
|
|
12
|
+
"@rsbuild/plugin-sass": "^1.3.1",
|
|
13
|
+
"@rslib/core": "^0.7.1",
|
|
14
|
+
"@storybook/addon-console": "^3.0.0",
|
|
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",
|
|
23
|
+
"prettier": "^3.5.3",
|
|
24
|
+
"sass": "^1.89.0",
|
|
25
|
+
"storybook": "^8.6.14",
|
|
26
|
+
"storybook-addon-sass-postcss": "^0.3.2",
|
|
27
|
+
"storybook-react-rsbuild": "^1.0.1",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
|
+
},
|
|
7
30
|
"exports": {
|
|
31
|
+
"./*": {
|
|
32
|
+
"import": "./dist/common/*.js",
|
|
33
|
+
"require": "./dist/common/*.cjs"
|
|
34
|
+
},
|
|
8
35
|
"./components": {
|
|
9
36
|
"import": "./dist/components/index.js",
|
|
10
37
|
"require": "./dist/components/index.cjs"
|
|
@@ -15,53 +42,36 @@
|
|
|
15
42
|
},
|
|
16
43
|
"./styles/components/*": {
|
|
17
44
|
"sass": "./styles/components/*"
|
|
18
|
-
},
|
|
19
|
-
"./*": {
|
|
20
|
-
"import": "./dist/common/*.js",
|
|
21
|
-
"require": "./dist/common/*.cjs"
|
|
22
45
|
}
|
|
23
46
|
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"styles"
|
|
50
|
+
],
|
|
51
|
+
"keywords": [
|
|
52
|
+
"TGUI",
|
|
53
|
+
"library",
|
|
54
|
+
"typescript"
|
|
55
|
+
],
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"name": "tgui-core",
|
|
58
|
+
"packageManager": "bun@1.2.13",
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^19.1.0",
|
|
61
|
+
"react-dom": "^19.1.0"
|
|
62
|
+
},
|
|
24
63
|
"repository": {
|
|
25
64
|
"type": "git",
|
|
26
65
|
"url": "https://github.com/tgstation/tgui-core.git"
|
|
27
66
|
},
|
|
28
67
|
"scripts": {
|
|
29
|
-
"build": "rslib build",
|
|
68
|
+
"build-rslib": "rslib build",
|
|
69
|
+
"build-storybook": "storybook build",
|
|
30
70
|
"lint": "biome check lib",
|
|
31
71
|
"lint:fix": "prettier . --write && biome check . --fix",
|
|
32
72
|
"storybook": "storybook dev -p 6006",
|
|
33
|
-
"
|
|
34
|
-
"test": "node --experimental-strip-types --experimental-test-coverage --test ./tests/*.test.ts"
|
|
73
|
+
"test": "bun test"
|
|
35
74
|
},
|
|
36
|
-
"author": "jlsnow301",
|
|
37
|
-
"license": "MIT",
|
|
38
75
|
"type": "module",
|
|
39
|
-
"
|
|
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"
|
|
76
|
+
"version": "3.3.1"
|
|
67
77
|
}
|