tgui-core 5.5.2 → 5.5.9

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 (145) hide show
  1. package/package.json +2 -1
  2. package/dist/common/collections.d.ts +0 -10
  3. package/dist/common/collections.js +0 -1
  4. package/dist/common/color.d.ts +0 -76
  5. package/dist/common/color.js +0 -1
  6. package/dist/common/constants.d.ts +0 -106
  7. package/dist/common/constants.js +0 -1
  8. package/dist/common/eventbus.d.ts +0 -68
  9. package/dist/common/eventbus.js +0 -1
  10. package/dist/common/events.d.ts +0 -32
  11. package/dist/common/events.js +0 -1
  12. package/dist/common/exhaustive.d.ts +0 -17
  13. package/dist/common/exhaustive.js +0 -1
  14. package/dist/common/format.d.ts +0 -10
  15. package/dist/common/format.js +0 -1
  16. package/dist/common/fp.d.ts +0 -18
  17. package/dist/common/fp.js +0 -1
  18. package/dist/common/fuzzysearch.d.ts +0 -26
  19. package/dist/common/fuzzysearch.js +0 -1
  20. package/dist/common/hotkeys.d.ts +0 -31
  21. package/dist/common/hotkeys.js +0 -1
  22. package/dist/common/http.d.ts +0 -2
  23. package/dist/common/http.js +0 -1
  24. package/dist/common/keycodes.d.ts +0 -95
  25. package/dist/common/keycodes.js +0 -1
  26. package/dist/common/keys.d.ts +0 -118
  27. package/dist/common/keys.js +0 -1
  28. package/dist/common/math.d.ts +0 -47
  29. package/dist/common/math.js +0 -1
  30. package/dist/common/random.d.ts +0 -16
  31. package/dist/common/random.js +0 -1
  32. package/dist/common/react.d.ts +0 -16
  33. package/dist/common/react.js +0 -1
  34. package/dist/common/string.d.ts +0 -87
  35. package/dist/common/string.js +0 -1
  36. package/dist/common/timer.d.ts +0 -18
  37. package/dist/common/timer.js +0 -1
  38. package/dist/common/type-utils.d.ts +0 -10
  39. package/dist/common/type-utils.js +0 -1
  40. package/dist/common/ui.d.ts +0 -123
  41. package/dist/common/ui.js +0 -1
  42. package/dist/common/uuid.d.ts +0 -10
  43. package/dist/common/uuid.js +0 -1
  44. package/dist/common/vector.d.ts +0 -18
  45. package/dist/common/vector.js +0 -1
  46. package/dist/components/AnimatedNumber.d.ts +0 -24
  47. package/dist/components/AnimatedNumber.js +0 -1
  48. package/dist/components/Autofocus.d.ts +0 -12
  49. package/dist/components/Autofocus.js +0 -1
  50. package/dist/components/Blink.d.ts +0 -19
  51. package/dist/components/Blink.js +0 -1
  52. package/dist/components/BlockQuote.d.ts +0 -11
  53. package/dist/components/BlockQuote.js +0 -1
  54. package/dist/components/Box.d.ts +0 -104
  55. package/dist/components/Box.js +0 -1
  56. package/dist/components/Button.d.ts +0 -123
  57. package/dist/components/Button.js +0 -1
  58. package/dist/components/ByondUi.d.ts +0 -61
  59. package/dist/components/ByondUi.js +0 -1
  60. package/dist/components/Chart.d.ts +0 -24
  61. package/dist/components/Chart.js +0 -1
  62. package/dist/components/Collapsible.d.ts +0 -28
  63. package/dist/components/Collapsible.js +0 -1
  64. package/dist/components/ColorBox.d.ts +0 -19
  65. package/dist/components/ColorBox.js +0 -1
  66. package/dist/components/Dialog.d.ts +0 -39
  67. package/dist/components/Dialog.js +0 -1
  68. package/dist/components/Dimmer.d.ts +0 -11
  69. package/dist/components/Dimmer.js +0 -1
  70. package/dist/components/Divider.d.ts +0 -17
  71. package/dist/components/Divider.js +0 -1
  72. package/dist/components/DmIcon.d.ts +0 -35
  73. package/dist/components/DmIcon.js +0 -1
  74. package/dist/components/DraggableControl.d.ts +0 -57
  75. package/dist/components/DraggableControl.js +0 -1
  76. package/dist/components/Dropdown.d.ts +0 -60
  77. package/dist/components/Dropdown.js +0 -1
  78. package/dist/components/FitText.d.ts +0 -21
  79. package/dist/components/FitText.js +0 -1
  80. package/dist/components/Flex.d.ts +0 -130
  81. package/dist/components/Flex.js +0 -1
  82. package/dist/components/Floating.d.ts +0 -87
  83. package/dist/components/Floating.js +0 -1
  84. package/dist/components/Icon.d.ts +0 -53
  85. package/dist/components/Icon.js +0 -1
  86. package/dist/components/Image.d.ts +0 -30
  87. package/dist/components/Image.js +0 -1
  88. package/dist/components/ImageButton.d.ts +0 -90
  89. package/dist/components/ImageButton.js +0 -1
  90. package/dist/components/InfinitePlane.d.ts +0 -64
  91. package/dist/components/InfinitePlane.js +0 -1
  92. package/dist/components/Input.d.ts +0 -98
  93. package/dist/components/Input.js +0 -1
  94. package/dist/components/Interactive.d.ts +0 -39
  95. package/dist/components/Interactive.js +0 -1
  96. package/dist/components/KeyListener.d.ts +0 -16
  97. package/dist/components/KeyListener.js +0 -1
  98. package/dist/components/Knob.d.ts +0 -65
  99. package/dist/components/Knob.js +0 -1
  100. package/dist/components/LabeledControls.d.ts +0 -31
  101. package/dist/components/LabeledControls.js +0 -1
  102. package/dist/components/LabeledList.d.ts +0 -95
  103. package/dist/components/LabeledList.js +0 -1
  104. package/dist/components/MenuBar.d.ts +0 -42
  105. package/dist/components/MenuBar.js +0 -1
  106. package/dist/components/Modal.d.ts +0 -21
  107. package/dist/components/Modal.js +0 -1
  108. package/dist/components/NoticeBox.d.ts +0 -27
  109. package/dist/components/NoticeBox.js +0 -1
  110. package/dist/components/NumberInput.d.ts +0 -60
  111. package/dist/components/NumberInput.js +0 -1
  112. package/dist/components/Pointer.d.ts +0 -20
  113. package/dist/components/Pointer.js +0 -1
  114. package/dist/components/Popper.d.ts +0 -33
  115. package/dist/components/Popper.js +0 -1
  116. package/dist/components/ProgressBar.d.ts +0 -57
  117. package/dist/components/ProgressBar.js +0 -1
  118. package/dist/components/RestrictedInput.d.ts +0 -72
  119. package/dist/components/RestrictedInput.js +0 -1
  120. package/dist/components/RoundGauge.d.ts +0 -57
  121. package/dist/components/RoundGauge.js +0 -1
  122. package/dist/components/Section.d.ts +0 -65
  123. package/dist/components/Section.js +0 -1
  124. package/dist/components/Slider.d.ts +0 -61
  125. package/dist/components/Slider.js +0 -1
  126. package/dist/components/Stack.d.ts +0 -83
  127. package/dist/components/Stack.js +0 -1
  128. package/dist/components/StyleableSection.d.ts +0 -10
  129. package/dist/components/StyleableSection.js +0 -1
  130. package/dist/components/Table.d.ts +0 -59
  131. package/dist/components/Table.js +0 -1
  132. package/dist/components/Tabs.d.ts +0 -110
  133. package/dist/components/Tabs.js +0 -1
  134. package/dist/components/TextArea.d.ts +0 -25
  135. package/dist/components/TextArea.js +0 -1
  136. package/dist/components/TimeDisplay.d.ts +0 -18
  137. package/dist/components/TimeDisplay.js +0 -1
  138. package/dist/components/Tooltip.d.ts +0 -29
  139. package/dist/components/Tooltip.js +0 -1
  140. package/dist/components/TrackOutsideClicks.d.ts +0 -34
  141. package/dist/components/TrackOutsideClicks.js +0 -1
  142. package/dist/components/VirtualList.d.ts +0 -11
  143. package/dist/components/VirtualList.js +0 -1
  144. package/dist/components/index.d.ts +0 -49
  145. package/dist/components/index.js +0 -1
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{clamp as t}from"../common/math.js";import{KEY as n,isArrow as r}from"../common/keys.js";function o(e){return e?.ownerDocument?.defaultView||self}function i(e,n){let r=e.getBoundingClientRect();return{left:t((n.pageX-(r.left+o(e).pageXOffset))/r.width,0,1),top:t((n.pageY-(r.top+o(e).pageYOffset))/r.height,0,1)}}function f(t){let{onMove:o,onKey:f,children:u,containerRef:a,style:c,...p}=t;return e("div",{...p,className:"react-colorful__interactive",onKeyDown:function(e){let t=e.key;r(t)&&(e.preventDefault(),f({left:t===n.Right?.05:t===n.Left?-.05:0,top:t===n.Down?.05:t===n.Up?-.05:0}))},onPointerDown:function(e){let t=a.current;t&&(e.preventDefault(),t.focus(),t.setPointerCapture(e.pointerId),o(i(t,e.nativeEvent)))},onPointerMove:function(e){e.preventDefault(),a.current?.hasPointerCapture(e.pointerId)&&o(i(a.current,e.nativeEvent))},onPointerUp:function(e){a.current?.releasePointerCapture(e.pointerId)},ref:a,role:"slider",style:c,tabIndex:0,children:u})}export{f as Interactive};
@@ -1,16 +0,0 @@
1
- import type { KeyEvent } from '../common/events.ts';
2
- type Props = Partial<{
3
- onKey: (key: KeyEvent) => void;
4
- onKeyDown: (key: KeyEvent) => void;
5
- onKeyUp: (key: KeyEvent) => void;
6
- }>;
7
- /**
8
- * ## KeyListener
9
- *
10
- * A component that listens for keyboard events and calls the provided
11
- * callbacks.
12
- *
13
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-keylistener--docs)
14
- */
15
- export declare function KeyListener(props: Props): null;
16
- export {};
@@ -1 +0,0 @@
1
- import{listenForKeyEvents as o}from"../common/hotkeys.js";import{useEffect as n}from"react";function e(e){return n(()=>{let n=o(o=>{e.onKey&&e.onKey(o),o.isDown()&&e.onKeyDown&&e.onKeyDown(o),o.isUp()&&e.onKeyUp&&e.onKeyUp(o)});return()=>{n()}},[]),null}export{e as KeyListener};
@@ -1,65 +0,0 @@
1
- import { type BooleanLike } from '../common/react.ts';
2
- import type { Placement } from '@floating-ui/react';
3
- import type { BoxProps } from './Box';
4
- type Props = {
5
- /** Value itself, controls the position of the cursor. */
6
- value: number;
7
- } & Partial<{
8
- /** Animates the value if it was changed externally. */
9
- animated: boolean;
10
- /** Knob can be bipolar or unipolar. */
11
- bipolar: boolean;
12
- /** Color of the outer ring around the knob. */
13
- color: string | BooleanLike;
14
- /** onChange also fires every 500ms while dragging the input. */
15
- tickWhileDragging: boolean;
16
- /**
17
- * If set, this value will be used to set the fill percentage of the outer
18
- * ring independently of the main value.
19
- */
20
- fillValue: number;
21
- /** Format value using this function before displaying it. */
22
- format: (value: number) => string;
23
- /** Highest possible value. */
24
- maxValue: number;
25
- /** Lowest possible value. */
26
- minValue: number;
27
- /**
28
- * An event which fires when release the knob or enter a number. This is the
29
- * default value event for controls.
30
- */
31
- onChange: (event: Event, value: number) => void;
32
- /**
33
- * Applies a `color` to the outer ring around the knob based on whether the
34
- * value lands in the range between `from` and `to`.
35
- */
36
- ranges: Record<string, [number, number]>;
37
- /**
38
- * Relative size of the knob. `1` is normal size, `2` is two times bigger.
39
- * Fractional numbers are supported.
40
- */
41
- size: number;
42
- /** Adjust value by this amount when dragging the input. */
43
- step: number;
44
- /** Screen distance mouse needs to travel to adjust value by one `step`. */
45
- stepPixelSize: number;
46
- /** Whether to clamp the value to the range. */
47
- unclamped: boolean;
48
- /** Unit to display to the right of value. */
49
- unit: string;
50
- /** Value popup placement, like on tooltips. */
51
- popupPosition: Placement;
52
- }> & BoxProps;
53
- /**
54
- * ## Knob
55
- *
56
- * A radial control which allows dialing in precise values by dragging it
57
- * up and down.
58
- *
59
- * Single click opens an input box to manually type in a number.
60
- *
61
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-knob--docs)
62
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
63
- */
64
- export declare function Knob(props: Props): import("react/jsx-runtime").JSX.Element;
65
- export {};
@@ -1 +0,0 @@
1
- import{jsx as o,jsxs as r}from"react/jsx-runtime";import{keyOfMatchingRange as e,scale as n}from"../common/math.js";import{classes as t}from"../common/react.js";import{computeBoxClassName as i,computeBoxProps as l}from"../common/ui.js";import{DraggableControl as c}from"./DraggableControl.js";import{Floating as a}from"./Floating.js";function s(s){let{animated:m,tickWhileDragging:_,format:d,maxValue:b,minValue:h,onChange:p,step:K,stepPixelSize:f,unclamped:g,unit:u,value:v,bipolar:x,popupPosition:N,className:j,color:y,fillValue:M,ranges:k={},size:P=1,style:w,...B}=s;return o(c,{dragMatrix:[0,-1],animated:m,tickWhileDragging:_,format:d,maxValue:b,minValue:h,onChange:p,step:K,stepPixelSize:f,unclamped:g,unit:u,value:v,children:c=>{let{displayElement:s,displayValue:m,dragging:_,handleDragStart:d,inputElement:p}=c,K=n(M??m,h,b),f=n(m,h,b),g=y||e(M??v,k)||"default",u=Math.min((f-.5)*270,225);return o(a,{content:s,contentClasses:"Knob__popupValue",handleOpen:_,placement:N||"top",preventPortal:!0,children:r("div",{className:t(["Knob",`Knob--color--${g}`,x&&"Knob--bipolar",j,i(B)]),...l({style:{fontSize:`${P}em`,...w},...B}),onMouseDown:d,children:[o("div",{className:"Knob__circle",children:o("div",{className:"Knob__cursorBox",style:{transform:`rotate(${u}deg)`},children:o("div",{className:"Knob__cursor"})})}),r("svg",{className:"Knob__ring Knob__ringTrackPivot",viewBox:"0 0 100 100",children:[o("circle",{className:"Knob__ringTrack",cx:"50",cy:"50",r:"50"}),o("title",{children:"track"})]}),r("svg",{className:"Knob__ring Knob__ringFillPivot",viewBox:"0 0 100 100",children:[o("title",{children:"fill"}),o("circle",{className:"Knob__ringFill",cx:"50",cy:"50",r:"50",style:{strokeDashoffset:Math.max(((x?2.75:2)-1.5*K)*Math.PI*50,0)}})]}),p]})})}})}export{s as Knob};
@@ -1,31 +0,0 @@
1
- import { type FlexProps } from './Flex';
2
- /**
3
- * ## LabeledControls
4
- *
5
- * LabeledControls is a horizontal grid that is designed to hold various
6
- * controls, like [Knobs](https://github.com/tgstation/tgui-core/tree/main/lib/components/Knob.tsx)
7
- * or small [Buttons](https://github.com/tgstation/tgui-core/tree/main/lib/components/Button.tsx).
8
- *
9
- * Every item in this grid is labeled at the bottom.
10
- *
11
- * Example:
12
- *
13
- * ```tsx
14
- * <LabeledControls>
15
- * <LabeledControls.Item label="Temperature"><Knob /></LabeledControls.Item>
16
- * <LabeledControls.Item label="Submit"><Button /></LabeledControls.Item>
17
- * </LabeledControls>
18
- * ```
19
- *
20
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-labeledcontrols--docs)
21
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
22
- */
23
- export declare function LabeledControls(props: FlexProps): import("react/jsx-runtime").JSX.Element;
24
- export declare namespace LabeledControls {
25
- var Item: typeof LabeledControlsItem;
26
- }
27
- type ItemProps = {
28
- label: string;
29
- } & FlexProps;
30
- declare function LabeledControlsItem(props: ItemProps): import("react/jsx-runtime").JSX.Element;
31
- export {};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Flex as r}from"./Flex.js";function n(t){let{children:n,wrap:i,...l}=t;return e(r,{align:"stretch",justify:"space-between",mx:-.5,wrap:i,...l,children:n})}n.Item=function(n){let{label:i,children:l,mx:c=1,...m}=n;return e(r.Item,{mx:c,children:t(r,{align:"center",direction:"column",height:"100%",justify:"space-between",textAlign:"center",...m,children:[e(r.Item,{}),e(r.Item,{children:l}),e(r.Item,{color:"label",children:i})]})})};export{n as LabeledControls};
@@ -1,95 +0,0 @@
1
- import { type BooleanLike } from '../common/react.ts';
2
- import type { Placement } from '@floating-ui/react';
3
- import type { PropsWithChildren, ReactNode } from 'react';
4
- export declare function LabeledList(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
5
- type LabeledListItemProps = Partial<{
6
- /** Buttons to render aside the content. */
7
- buttons: ReactNode;
8
- /** Content of this labeled item. */
9
- children: ReactNode;
10
- /** Applies a CSS class to the element. */
11
- className: string | BooleanLike;
12
- /** Sets the color of the content text. */
13
- color: string;
14
- /** @deprecated */
15
- content: any;
16
- /**
17
- * Sometimes this does not properly register in TS.
18
- * See [react key docs](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) for more info.
19
- */
20
- key: string | number;
21
- /** Item label. Appends a colon at the end. */
22
- label: ReactNode;
23
- /** Sets the color of the label. */
24
- labelColor: string;
25
- /** Lets the label wrap and makes it not take the minimum width. */
26
- labelWrap: boolean;
27
- /**
28
- * Align the content text.
29
- *
30
- * - `left` (default)
31
- * - `center`
32
- * - `right`
33
- */
34
- textAlign: string;
35
- /** Tooltip text. */
36
- tooltip: string;
37
- /** Tooltip position. See Tooltip for valid values. */
38
- tooltipPosition: Placement;
39
- /**
40
- * Align both the label and the content vertically.
41
- *
42
- * - `baseline` (default)
43
- * - `top`
44
- * - `middle`
45
- * - `bottom`
46
- */
47
- verticalAlign: string;
48
- /** Preserves line-breaks and spacing in Labeled.Item text. */
49
- preserveWhitespace: boolean;
50
- }>;
51
- declare function LabeledListItem(props: LabeledListItemProps): import("react/jsx-runtime").JSX.Element;
52
- type LabeledListDividerProps = {
53
- /** Size of the divider. */
54
- size?: number;
55
- };
56
- declare function LabeledListDivider(props: LabeledListDividerProps): import("react/jsx-runtime").JSX.Element;
57
- /**
58
- * ## LabeledList
59
- *
60
- * LabeledList is a continuous, vertical list of text and other content, where
61
- * every item is labeled.
62
- *
63
- * It works just like a two column table, where first column is labels, and
64
- * second column is content.
65
- *
66
- * Example:
67
- *
68
- * ```tsx
69
- * <LabeledList>
70
- * <LabeledList.Item label="Item">Content</LabeledList.Item>
71
- * </LabeledList>
72
- * ```
73
- *
74
- * If you want to have a button on the right side of an item (for example,
75
- * to perform some sort of action), there is a way to do that:
76
- *
77
- * Example:
78
- *
79
- * ```tsx
80
- * <LabeledList>
81
- * <LabeledList.Item label="Item" buttons={<Button>Click me!</Button>}>
82
- * Content
83
- * </LabeledList.Item>
84
- * </LabeledList>
85
- * ```
86
- *
87
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-labeledlist--docs)
88
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
89
- */
90
- export declare namespace LabeledList {
91
- /** Adds some empty space between LabeledList items. */
92
- const Divider: typeof LabeledListDivider;
93
- const Item: typeof LabeledListItem;
94
- }
95
- export {};
@@ -1 +0,0 @@
1
- var e;import{jsx as t,jsxs as l}from"react/jsx-runtime";import{classes as i}from"../common/react.js";import{unit as r}from"../common/ui.js";import{Box as o}from"./Box.js";import{Divider as a}from"./Divider.js";import{Tooltip as s}from"./Tooltip.js";function d(e){let{children:l}=e;return t("table",{className:"LabeledList",children:t("tbody",{children:l})})}(e=d||(d={})).Divider=function(e){let l=e.size?r(Math.max(0,e.size-1)):0;return t("tr",{className:"LabeledList__row",children:t("td",{colSpan:3,style:{paddingBottom:l,paddingTop:l},children:t(a,{})})})},e.Item=function(e){let r,{className:a,label:d,labelColor:n="label",labelWrap:c,color:m,textAlign:L,buttons:p,content:b,children:_,verticalAlign:h="baseline",preserveWhitespace:f,tooltip:u,tooltipPosition:v}=e;d&&(r=d,"string"==typeof d&&(r+=":")),void 0!==u&&(r=t(s,{content:u,position:v,children:t(o,{as:"span",style:{borderBottom:"2px dotted rgba(255, 255, 255, 0.8)"},children:r})}));let g=t(o,{as:"td",className:i(["LabeledList__cell",!c&&"LabeledList__label--nowrap"]),color:n,preserveWhitespace:f,verticalAlign:h,children:r});return l("tr",{className:i(["LabeledList__row",a]),children:[g,l(o,{as:"td",className:"LabeledList__cell",color:m,colSpan:p?void 0:2,textAlign:L,verticalAlign:h,children:[b,_]}),p&&t("td",{className:"LabeledList__cell LabeledList__buttons",children:p})]})};export{d as LabeledList};
@@ -1,42 +0,0 @@
1
- import { type BooleanLike } from '../common/react.ts';
2
- import { type PropsWithChildren, type ReactNode } from 'react';
3
- type MenuBarItemProps = {
4
- children: ReactNode;
5
- className?: string;
6
- disabled?: boolean;
7
- display: ReactNode;
8
- entry: string;
9
- openMenuBar: string | null;
10
- openOnHover: boolean;
11
- openWidth: string;
12
- setOpenMenuBar: (entry: string | null) => void;
13
- setOpenOnHover: (flag: boolean) => void;
14
- };
15
- declare function MenuDropdown(props: MenuBarItemProps): import("react/jsx-runtime").JSX.Element;
16
- declare namespace MenuDropdown {
17
- var MenuItem: (props: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
18
- var MenuItemToggle: (props: MenuItemToggleProps) => import("react/jsx-runtime").JSX.Element;
19
- var Submenu: typeof MenuItemSubmenu;
20
- var Separator: () => import("react/jsx-runtime").JSX.Element;
21
- }
22
- type MenuItemProps = Partial<{
23
- value: any;
24
- displayText: ReactNode;
25
- disabled: BooleanLike;
26
- onClick: (value: any) => void;
27
- }>;
28
- type MenuItemToggleProps = MenuItemProps & Partial<{
29
- checked: BooleanLike;
30
- }>;
31
- type MenuItemSubmenuProps = PropsWithChildren<Omit<MenuItemProps, 'value' | 'onClick'> & Partial<{
32
- openWidth: string;
33
- }>>;
34
- declare function MenuItemSubmenu(props: MenuItemSubmenuProps): import("react/jsx-runtime").JSX.Element;
35
- type MenuBarProps = {
36
- children: ReactNode;
37
- };
38
- export declare function MenuBar(props: MenuBarProps): import("react/jsx-runtime").JSX.Element;
39
- export declare namespace MenuBar {
40
- var Dropdown: typeof MenuDropdown;
41
- }
42
- export {};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import{classes as r}from"../common/react.js";import{useRef as a,useState as t}from"react";import{Box as u}from"./Box.js";import{Floating as o}from"./Floating.js";import{Icon as l}from"./Icon.js";function i(n){let{children:t,className:l,disabled:i,display:_,onClick:c,onMouseOver:s,open:m,openWidth:M,onOutsideClick:d,...B}=n,h=a(null);return e(o,{placement:"bottom-start",allowedOutsideClasses:".Menubar_inner",content:e("div",{className:"MenuBar__menu",style:{width:M},children:t}),children:e("div",{className:"Menubar_inner",ref:h,children:e(u,{className:r(["MenuBar__MenuBarButton",i&&"MenuBar__disabled","MenuBar__font","MenuBar__hover",l]),...B,onClick:i?()=>null:c,onMouseOver:s,children:e("span",{className:"MenuBar__MenuBarButton-text",children:_})})})})}function _(n){let{entry:r,children:a,openWidth:t,display:u,setOpenMenuBar:o,openMenuBar:l,setOpenOnHover:_,openOnHover:c,disabled:s,className:m}=n;return e(i,{className:m,disabled:s,display:u,onClick:()=>{o(l===r?null:r),_(!c)},onMouseOver:()=>{c&&o(r)},onOutsideClick:()=>{o(null),_(!1)},open:l===r,openWidth:t,children:a})}function c(n){let{children:r}=n;return e(u,{className:"MenuBar",children:r})}c.Dropdown=_,_.MenuItem=function(n){let{value:a,disabled:t,displayText:o,onClick:l}=n;return e(u,{className:r(["MenuBar__font",t&&"MenuBar__disabled","MenuBar__MenuItem","MenuBar__hover"]),onClick:()=>l?.(a),children:o})},_.MenuItemToggle=function(a){let{value:t,disabled:o,displayText:i,onClick:_,checked:c}=a;return n(u,{className:r(["MenuBar__font",o&&"MenuBar__disabled","MenuBar__MenuItem","MenuBar__MenuItemToggle","MenuBar__hover"]),onClick:()=>_?.(t),children:[e("div",{className:"MenuBar__MenuItemToggle__check",children:e(l,{name:c?"check":"",size:1.3})}),i]})},_.Submenu=function(a){let{displayText:i,disabled:_,openWidth:c,children:s}=a,[m,M]=t(!1);return e(o,{hoverOpen:!0,hoverDelay:250,hoverSafePolygon:!0,contentOffset:0,disabled:_,placement:"right-start",onOpenChange:M,content:e("div",{className:"MenuBar__menu",style:{width:c},children:s}),children:n(u,{className:r(["MenuBar__font",_&&"MenuBar__disabled","MenuBar__MenuItem","MenuBar__MenuItemSubmenu",m&&"MenuBar__MenuItemSubmenu__Open","MenuBar__hover"]),children:[i,e(l,{name:"chevron-right"})]})})},_.Separator=function(){return e("div",{className:"MenuBar__Separator"})};export{c as MenuBar};
@@ -1,21 +0,0 @@
1
- import type { BoxProps } from './Box';
2
- export type ModalProps = Partial<{
3
- /** Fires once the enter key is pressed */
4
- onEnter: (e: React.KeyboardEvent<HTMLInputElement>) => void;
5
- /** Fires once the escape key is pressed */
6
- onEscape: (e: React.KeyboardEvent<HTMLInputElement>) => void;
7
- }> & BoxProps;
8
- /**
9
- * ## Modal
10
- *
11
- * A modal window. Uses a
12
- * [Dimmer](https://tgstation.github.io/tgui-core/?path=/docs/components-dimmer--docs)
13
- * under the hood, and dynamically adjusts its own size to fit the content
14
- * you're trying to display.
15
- *
16
- * Must be a direct child of a layout component (e.g. `Window`).
17
- *
18
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-modal--docs)
19
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
20
- */
21
- export declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{KEY as m,isEscape as r}from"../common/keys.js";import{classes as e}from"../common/react.js";import{computeBoxClassName as i,computeBoxProps as n}from"../common/ui.js";import{Dimmer as t}from"./Dimmer.js";function c(c){let{className:s,children:a,onEnter:l,onEscape:d,...f}=c;return o(t,{className:"Modal__dimmer",onKeyDown:function(o){o.key===m.Enter&&l?.(o),r(o.key)&&d?.(o)},children:o("div",{className:e(["Modal",s,i(f)]),...n(f),children:a})})}export{c as Modal};
@@ -1,27 +0,0 @@
1
- import { type BoxProps } from './Box';
2
- type Props = ExclusiveProps & BoxProps;
3
- /** You MUST use only one or none */
4
- type NoticeType = 'info' | 'success' | 'danger';
5
- type None = {
6
- [K in NoticeType]?: undefined;
7
- };
8
- type ExclusiveProps = None | (Omit<None, 'info'> & {
9
- /** Blue notice */
10
- info: boolean;
11
- }) | (Omit<None, 'success'> & {
12
- /** Green notice */
13
- success: boolean;
14
- }) | (Omit<None, 'danger'> & {
15
- /** Red notice */
16
- danger: boolean;
17
- });
18
- /**
19
- * ## NoticeBox
20
- *
21
- * A notice box which warns you about something very important.
22
- *
23
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-noticebox--docs)
24
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
25
- */
26
- export declare function NoticeBox(props: Props): import("react/jsx-runtime").JSX.Element;
27
- export {};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{classes as t}from"../common/react.js";import{Box as e}from"./Box.js";function c(c){let{className:r,color:i,info:m,success:x,danger:s,...n}=c;return o(e,{className:t(["NoticeBox",i&&`NoticeBox--color--${i}`,m&&"NoticeBox--type--info",x&&"NoticeBox--type--success",s&&"NoticeBox--type--danger",r]),...n})}export{c as NoticeBox};
@@ -1,60 +0,0 @@
1
- import { type BooleanLike } from '../common/react.ts';
2
- import { Component, type FocusEventHandler, type KeyboardEventHandler } from 'react';
3
- import { type BoxProps } from './Box';
4
- type Props = Required<{
5
- /** Highest possible value. */
6
- maxValue: number;
7
- /** Lowest possible value. */
8
- minValue: number;
9
- /** Adjust value by this amount when dragging the input. */
10
- step: number;
11
- /** Value itself. */
12
- value: number | string;
13
- }> & Partial<{
14
- /** Animates the value if it was changed externally. */
15
- animated: boolean;
16
- /** Makes the input field uneditable & non draggable to prevent user changes */
17
- disabled: boolean;
18
- /** onChange also fires about every 500ms when you drag the input up and down. */
19
- tickWhileDragging: boolean;
20
- /** Format value using this function before displaying it. */
21
- format: (value: number) => string;
22
- /** Adjusts the width to 100% of its parent container */
23
- fluid: boolean;
24
- /** An event which fires when you release the input or successfully enter a number. */
25
- onChange: (value: number) => void;
26
- /** Screen distance mouse needs to travel to adjust value by one `step`. */
27
- stepPixelSize: number;
28
- /** Unit to display to the right of value. */
29
- unit: string;
30
- }> & BoxProps;
31
- type State = {
32
- currentValue: number;
33
- dragging: BooleanLike;
34
- editing: BooleanLike;
35
- origin: number;
36
- previousValue: number;
37
- };
38
- /**
39
- * ## NumberInput
40
- *
41
- * A fancy, interactive number input, which you can either drag up and down
42
- * to fine tune the value, or single click it to manually type a number.
43
- *
44
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-numberinput--docs)
45
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
46
- */
47
- export declare class NumberInput extends Component<Props, State> {
48
- inputRef: import("react").RefObject<HTMLInputElement | null>;
49
- dragTimeout: NodeJS.Timeout;
50
- dragInterval: NodeJS.Timeout;
51
- state: State;
52
- componentDidMount(): void;
53
- handleDragStart: React.MouseEventHandler<HTMLDivElement>;
54
- handleDragMove: (event: MouseEvent) => void;
55
- handleDragEnd: (_event: MouseEvent) => void;
56
- handleBlur: FocusEventHandler<HTMLInputElement>;
57
- handleKeyDown: KeyboardEventHandler<HTMLInputElement>;
58
- render(): import("react/jsx-runtime").JSX.Element;
59
- }
60
- export {};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{KEY as r,isEscape as i}from"../common/keys.js";import{clamp as s,round as n}from"../common/math.js";import{classes as a}from"../common/react.js";import{Component as o,createRef as u}from"react";import{AnimatedNumber as l}from"./AnimatedNumber.js";import{Box as m}from"./Box.js";class h extends o{inputRef=u();dragTimeout;dragInterval;state={currentValue:0,dragging:!1,editing:!1,origin:0,previousValue:0};componentDidMount(){let e=Number.parseFloat(this.props.value.toString());this.setState({currentValue:e,previousValue:e})}handleDragStart=e=>{let{value:t,disabled:r}=this.props,{editing:i}=this.state;if(r||i)return;document.body.style["pointer-events"]="none";let s=Number.parseFloat(t.toString());this.setState({currentValue:s,dragging:!1,origin:e.screenY,previousValue:s}),this.dragTimeout=setTimeout(()=>{this.setState({dragging:!0})},250),this.dragInterval=setInterval(()=>{let{dragging:e,currentValue:t,previousValue:r}=this.state,{onChange:i,tickWhileDragging:s}=this.props;e&&s&&t!==r&&(this.setState({previousValue:t}),i?.(t))},400),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd)};handleDragMove=e=>{let{minValue:t,maxValue:r,step:i,stepPixelSize:a,disabled:o}=this.props;o||this.setState(o=>{let u={...o},l=u.origin-e.screenY;if(o.dragging){let o=a||1,m=s(u.currentValue+l*i/o,t-i,r+i);Math.abs(m-u.currentValue)>=i?(u.currentValue=s(n(m/i,0)*i,t,r),u.origin=e.screenY):Math.abs(l)>o&&(u.origin=e.screenY)}else Math.abs(l)>4&&(u.dragging=!0);return u})};handleDragEnd=e=>{let{dragging:t,currentValue:r}=this.state,{onChange:i,disabled:s}=this.props;if(!s){if(document.body.style["pointer-events"]="auto",clearInterval(this.dragInterval),clearTimeout(this.dragTimeout),this.setState({dragging:!1,editing:!t,previousValue:r}),t)i?.(r);else if(this.inputRef){let e=this.inputRef.current;e&&(e.value=`${r}`,setTimeout(()=>{e.focus(),e.select()},10))}document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd)}};handleBlur=e=>{let{editing:t,previousValue:r}=this.state,{minValue:i,maxValue:n,onChange:a,disabled:o}=this.props;if(o||!t)return;let u=s(Number.parseFloat(e.target.value),i,n);Number.isNaN(u)?this.setState({editing:!1}):(this.setState({currentValue:u,editing:!1,previousValue:u}),r!==u&&a?.(u))};handleKeyDown=e=>{let{minValue:t,maxValue:n,onChange:a,disabled:o}=this.props;if(o)return;let{previousValue:u}=this.state;if(e.key===r.Enter){let r=s(Number.parseFloat(e.currentTarget.value),t,n);if(Number.isNaN(r))return void this.setState({editing:!1});this.setState({currentValue:r,editing:!1,previousValue:r}),u!==r&&a?.(r)}else i(e.key)&&this.setState({editing:!1})};render(){let{dragging:r,editing:i,currentValue:n}=this.state,{className:o,fluid:u,animated:h,unit:d,value:p,minValue:g,maxValue:c,height:v,width:f,lineHeight:N,fontSize:b,format:S}=this.props,V=Number.parseFloat(p.toString());r&&(V=n);let y=t("div",{className:"NumberInput__content",children:[h&&!r?e(l,{format:S,value:V}):S?S(V):V,d?` ${d}`:""]});return t(m,{className:a(["NumberInput",u&&"NumberInput--fluid",o]),fontSize:b,lineHeight:N,minHeight:v,minWidth:f,onMouseDown:this.handleDragStart,children:[e("div",{className:"NumberInput__barContainer",children:e("div",{className:"NumberInput__bar",style:{height:`${s((V-g)/(c-g)*100,0,100)}%`}})}),y,e("input",{className:"NumberInput__input",onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:this.inputRef,style:{display:i?"inline":"none",fontSize:b,height:v,lineHeight:N}})]})}}export{h as NumberInput};
@@ -1,20 +0,0 @@
1
- /**
2
- * MIT License
3
- * https://github.com/omgovich/react-colorful/
4
- *
5
- * Copyright (c) 2020 Vlad Shilov <omgovich@ya.ru>
6
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
7
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12
- * SOFTWARE.
13
- */
14
- export type PointerProps = {
15
- className?: string;
16
- top?: number;
17
- left: number;
18
- color: string;
19
- };
20
- export declare function Pointer(props: PointerProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- import{jsx as r}from"react/jsx-runtime";import{classes as o}from"../common/react.js";function t(t){let{className:e,color:l,left:c,top:i=.5}=t;return r("div",{className:o(["react-colorful__pointer",e]),style:{top:`${100*i}%`,left:`${100*c}%`},children:r("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:l}})})}export{t as Pointer};
@@ -1,33 +0,0 @@
1
- import type { Placement } from '@floating-ui/react';
2
- import type { PropsWithChildren, ReactNode } from 'react';
3
- type Props = {
4
- /** The content to display in the popper */
5
- content: ReactNode;
6
- /** Whether the popper is open */
7
- isOpen: boolean;
8
- } & Partial<{
9
- /**
10
- * Base z-index of the popper div
11
- * @default 5
12
- */
13
- baseZIndex: number;
14
- /** Called when the user clicks outside the popper */
15
- onClickOutside: () => void;
16
- /** Where to place the popper relative to the reference element */
17
- placement: Placement;
18
- }> & PropsWithChildren;
19
- /**
20
- * ## Popper
21
- *
22
- * Popper lets you position elements so that they don't go out of the bounds of the window.
23
- *
24
- * @deprecated - Use
25
- * [Floating](https://github.com/tgstation/tgui-core/tree/main/lib/components/Floating.tsx)
26
- * instead.
27
- *
28
- * This will serve as a wrapper for floating ui until replaced.
29
- *
30
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-popper--docs)
31
- */
32
- export declare function Popper(props: Props): import("react/jsx-runtime").JSX.Element;
33
- export {};
@@ -1 +0,0 @@
1
- import{Fragment as e,jsx as r,jsxs as n}from"react/jsx-runtime";import{autoUpdate as t,flip as i,offset as o,shift as l,useDismiss as d,useFloating as c,useInteractions as f}from"@floating-ui/react";function m(m){let{baseZIndex:p=5,children:a,content:h,isOpen:s,onClickOutside:u,placement:g}=m,{refs:x,floatingStyles:v,context:w}=c({middleware:[o(5),i(),l()],onOpenChange:u,open:s,placement:g,whileElementsMounted:t}),{getReferenceProps:j,getFloatingProps:y}=f([d(w)]);return n(e,{children:[r("div",{ref:x.setReference,...j(),children:a}),s&&r("div",{ref:x.setFloating,style:{...v,zIndex:p},...y(),children:h})]})}export{m as Popper};
@@ -1,57 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- import type { BoxProps } from './Box';
3
- type Props = {
4
- /**
5
- * Current progress as a floating point number between `minValue` (default: 0) and `maxValue` (default: 1).
6
- * Determines the percentage and how filled the bar is.
7
- */
8
- value: number;
9
- } & Partial<{
10
- /**
11
- * Color of the progress bar. Can take any of the following formats:
12
- * - `#ffffff` - Hex format
13
- * - `rgb(r,g,b) / rgba(r,g,b,a)` - RGB format
14
- * - `<name>` - the name of a `color-<name>` CSS class. See `CSS_COLORS` in `constants.js`.
15
- * - `<name>` - the name of a base CSS color, if not overridden by the definitions above.
16
- */
17
- color: string;
18
- /** Highest possible value. */
19
- maxValue: number;
20
- /** Lowest possible value. */
21
- minValue: number;
22
- /**
23
- * Applies a `color` to the progress bar based on whether the value lands in the range between `from` and `to`.
24
- * This takes an object with the following format:
25
- * ```tsx
26
- * {
27
- * (colorname): [from, to]
28
- * }
29
- * ```
30
- * For example:
31
- * ```tsx
32
- * <ProgressBar
33
- * value={0.5}
34
- * ranges={{
35
- * bad: [0, 0.5],
36
- * good: [0.5, 1],
37
- * }}
38
- * />
39
- * ```
40
- *
41
- */
42
- ranges: Readonly<Record<string, Readonly<[number, number]>>>;
43
- /** Removes progress percentage text, makes no sense if children are present */
44
- empty: boolean;
45
- /** The number of digits to appear after the percent's decimal point. */
46
- fractionDigits: number;
47
- }> & BoxProps & PropsWithChildren;
48
- /**
49
- * ## ProgressBar
50
- *
51
- * Progress indicators inform users about the status of ongoing processes.
52
- *
53
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-progressbar--docs)
54
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
55
- */
56
- export declare function ProgressBar(props: Props): import("react/jsx-runtime").JSX.Element;
57
- export {};
@@ -1 +0,0 @@
1
- import{jsx as r,jsxs as o}from"react/jsx-runtime";import{CSS_COLORS as s}from"../common/constants.js";import{clamp01 as e,keyOfMatchingRange as t,scale as m}from"../common/math.js";import{classes as a}from"../common/react.js";import{computeBoxClassName as i,computeBoxProps as l}from"../common/ui.js";function c(c){let{className:n,value:d,minValue:f=0,maxValue:u=1,color:g,ranges:p={},empty:B,children:P,fractionDigits:_=0,...h}=c,j=m(d,f,u),v=void 0!==P,x=g||t(d,p)||"default",y=l(h),N=["ProgressBar",n,i(h)],$={width:`${100*e(j)}%`};return s.includes(x)||"default"===x?N.push(`ProgressBar--color--${x}`):(y.style={...y.style,borderColor:x},$.backgroundColor=x),o("div",{className:a(N),...y,children:[r("div",{className:"ProgressBar__fill ProgressBar__fill--animated",style:$}),r("div",{className:"ProgressBar__content",children:v?P:!B&&`${(100*j).toFixed(_)}%`})]})}export{c as ProgressBar};
@@ -1,72 +0,0 @@
1
- import type { BaseInputProps } from './Input';
2
- type Props = Partial<{
3
- /** Restricted inputs round by default. */
4
- allowFloats: boolean;
5
- /** Max value. 10,000 by default. */
6
- maxValue: number;
7
- /** Min value. 0 by default. */
8
- minValue: number;
9
- /** Fires each time focus leaves the input, including if Esc or Enter are pressed */
10
- onBlur: (value: number) => void;
11
- /** Fires each time the input has been changed */
12
- onChange: (value: number) => void;
13
- /** Fires once the enter key is pressed */
14
- onEnter: (value: number) => void;
15
- /** Fires once the escape key is pressed */
16
- onEscape: (value: number) => void;
17
- /** Fires on input validation change */
18
- onValidationChange: (isValid: boolean) => void;
19
- /**
20
- * Generally, input can handle its own state value. You might not NEED this.
21
- *
22
- * Use this if you want to hold the value in the parent for external
23
- * manipulation. For instance:
24
- *
25
- * Clearing the input
26
- *
27
- * ```tsx
28
- * const [value, setValue] = useState(1);
29
- *
30
- * return (
31
- * <>
32
- * <Button onClick={() => act('inputVal', {inputVal: value})}>
33
- * Submit
34
- * </Button>
35
- * <RestrictedInput
36
- * value={value}
37
- * onChange={setValue} />
38
- * <Button onClick={() => setValue(1)}>
39
- * Clear
40
- * </Button>
41
- * </>
42
- * )
43
- * ```
44
- *
45
- * Updating the value from the backend
46
- *
47
- * ```tsx
48
- * const { data } = useBackend<Data>();
49
- * const { valveSetting } = data;
50
- *
51
- * return (
52
- * <RestrictedInput
53
- * value={valveSetting}
54
- * onEnter={(value) => act('submit', { valveSetting: value })}
55
- * />
56
- * )
57
- * ```
58
- */
59
- value: number;
60
- }> & BaseInputProps;
61
- /**
62
- * ## RestrictedInput
63
- *
64
- * Creates a numerical input which rejects improper keys.
65
- *
66
- * Has a special event for changes in validation states - `onValidationChange`.
67
- *
68
- * - [View documentation on tgui core](https://tgstation.github.io/tgui-core/?path=/docs/components-restrictedinput--docs)
69
- * - [View inherited Box props](https://tgstation.github.io/tgui-core/?path=/docs/components-box--docs)
70
- */
71
- export declare function RestrictedInput(props: Props): import("react/jsx-runtime").JSX.Element;
72
- export {};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{KEY as t,isEscape as r}from"../common/keys.js";import{classes as n}from"../common/react.js";import{debounce as u}from"../common/timer.js";import{computeBoxClassName as o,computeBoxProps as i}from"../common/ui.js";import{useEffect as m,useRef as c,useState as l}from"react";let a=u(e=>e(),250);function f(u){let{allowFloats:f,autoFocus:p,autoSelect:s,className:d,disabled:v,expensive:y,fluid:I,maxValue:b=1e4,minValue:j=0,monospace:k,onBlur:D,onChange:x,onEnter:C,onEscape:R,onKeyDown:g,onValidationChange:h,value:E,...N}=u,T=c(null),[w,B]=l(E??j),[K,M]=l(!0);function q(e){x&&(y?a(()=>x(e)):x(e))}m(()=>{let e;return(p||s)&&(e=setTimeout(()=>{T.current?.focus(),s&&T.current?.select()},1)),()=>clearTimeout(e)},[]),m(()=>{if(T.current){let e=T.current.validity.valid;K!==e&&(M(e),h?.(e))}},[w]),m(()=>{T.current&&document.activeElement!==T.current&&E!==w&&B(E??j)},[E]);let z=i(N),A=n(["Input","RestrictedInput",v&&"Input--disabled",I&&"Input--fluid",k&&"Input--monospace",o(N),d,!K&&"RestrictedInput--invalid"]);return e("input",{...z,autoComplete:"off",className:A,disabled:v,max:b,min:j,onBlur:function(e){D?.(w)},onChange:function(e){let t=Number(e.target.value);B(t),q(t)},onKeyDown:function(e){if(g?.(e),e.key===t.Enter){e.preventDefault(),C?.(w),T.current?.blur();return}if(r(e.key)){e.preventDefault(),R?.(w),T.current?.blur();return}if(e.key===t.Minus){e.preventDefault();let t=-1*w;B(t),q(t);return}},ref:T,spellCheck:!1,step:f?"any":"1",type:"number",value:w})}export{f as RestrictedInput};