@rbxts/react-clean-ui 1.1.0 → 1.2.2

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 (89) hide show
  1. package/out/Components/Chart/BarChart.d.ts +1 -0
  2. package/out/Components/Chart/BarChart.luau +149 -112
  3. package/out/Components/Chart/Pie.d.ts +1 -0
  4. package/out/Components/Chart/Pie.luau +21 -5
  5. package/out/Components/Decorator/BoxShadow.d.ts +1 -0
  6. package/out/Components/Decorator/BoxShadow.luau +12 -5
  7. package/out/Components/Decorator/Corners.d.ts +1 -0
  8. package/out/Components/Decorator/Corners.luau +8 -3
  9. package/out/Components/Decorator/Padding.d.ts +3 -1
  10. package/out/Components/Decorator/Padding.luau +11 -6
  11. package/out/Components/Input/Button.d.ts +1 -0
  12. package/out/Components/Input/Button.luau +44 -33
  13. package/out/Components/Input/Checkbox.d.ts +1 -0
  14. package/out/Components/Input/Checkbox.luau +22 -16
  15. package/out/Components/Input/HoverButton.d.ts +1 -0
  16. package/out/Components/Input/HoverButton.luau +44 -40
  17. package/out/Components/Input/Increment.d.ts +1 -0
  18. package/out/Components/Input/Increment.luau +10 -3
  19. package/out/Components/Input/Input.d.ts +3 -1
  20. package/out/Components/Input/Input.luau +85 -66
  21. package/out/Components/Input/Select.d.ts +9 -0
  22. package/out/Components/Input/Select.luau +311 -34
  23. package/out/Components/Input/Slider.luau +44 -29
  24. package/out/Components/Input/Switch.d.ts +9 -0
  25. package/out/Components/Input/Switch.luau +147 -0
  26. package/out/Components/Input/index.d.ts +1 -0
  27. package/out/Components/Input/init.luau +3 -0
  28. package/out/Components/Interaction/Modal.d.ts +14 -0
  29. package/out/Components/Interaction/Modal.luau +276 -0
  30. package/out/Components/Interaction/Toast.d.ts +2 -1
  31. package/out/Components/Interaction/Toast.luau +53 -28
  32. package/out/Components/Interaction/Tooltip.luau +36 -24
  33. package/out/Components/Interaction/index.d.ts +1 -0
  34. package/out/Components/Interaction/init.luau +3 -0
  35. package/out/Components/Layout/Accordion.d.ts +1 -0
  36. package/out/Components/Layout/Accordion.luau +51 -55
  37. package/out/Components/Layout/Column.d.ts +1 -0
  38. package/out/Components/Layout/Column.luau +11 -6
  39. package/out/Components/Layout/Container.d.ts +1 -0
  40. package/out/Components/Layout/Container.luau +22 -16
  41. package/out/Components/Layout/Draggable.luau +25 -3
  42. package/out/Components/Layout/Fieldset.d.ts +1 -0
  43. package/out/Components/Layout/Fieldset.luau +14 -42
  44. package/out/Components/Layout/FlexItem.luau +7 -0
  45. package/out/Components/Layout/Group.d.ts +1 -0
  46. package/out/Components/Layout/Group.luau +16 -33
  47. package/out/Components/Layout/HStack.d.ts +4 -0
  48. package/out/Components/Layout/HStack.luau +17 -10
  49. package/out/Components/Layout/Pagination.d.ts +32 -0
  50. package/out/Components/Layout/Pagination.luau +405 -0
  51. package/out/Components/Layout/Row.d.ts +1 -0
  52. package/out/Components/Layout/Row.luau +20 -48
  53. package/out/Components/Layout/Scroller.d.ts +1 -0
  54. package/out/Components/Layout/Scroller.luau +26 -34
  55. package/out/Components/Layout/Table.d.ts +31 -0
  56. package/out/Components/Layout/Table.luau +342 -0
  57. package/out/Components/Layout/Tabs.d.ts +18 -9
  58. package/out/Components/Layout/Tabs.luau +134 -119
  59. package/out/Components/Layout/VStack.d.ts +3 -0
  60. package/out/Components/Layout/VStack.luau +17 -10
  61. package/out/Components/Layout/index.d.ts +2 -0
  62. package/out/Components/Layout/init.luau +6 -0
  63. package/out/Components/Navigation/Menu.d.ts +1 -0
  64. package/out/Components/Navigation/Menu.luau +12 -3
  65. package/out/Components/Surface/Box.d.ts +1 -0
  66. package/out/Components/Surface/Box.luau +12 -4
  67. package/out/Components/Surface/Card.d.ts +1 -0
  68. package/out/Components/Surface/Card.luau +54 -51
  69. package/out/Components/Surface/Icon.d.ts +1 -0
  70. package/out/Components/Surface/Icon.luau +25 -16
  71. package/out/Components/Typography/Text.d.ts +1 -0
  72. package/out/Components/Typography/Text.luau +57 -47
  73. package/out/Contexts/index.d.ts +1 -0
  74. package/out/Contexts/init.luau +3 -0
  75. package/out/Contexts/modal.context.d.ts +15 -0
  76. package/out/Contexts/modal.context.luau +26 -0
  77. package/out/Contexts/toast.context.d.ts +1 -0
  78. package/out/Providers/app.provider.luau +2 -1
  79. package/out/Providers/index.d.ts +1 -0
  80. package/out/Providers/init.luau +3 -0
  81. package/out/Providers/modal.provider.d.ts +6 -0
  82. package/out/Providers/modal.provider.luau +86 -0
  83. package/out/Providers/overlay.provider.luau +1 -0
  84. package/out/Theme/theme.template.d.ts +85 -0
  85. package/out/Theme/themes/dark.theme.luau +103 -0
  86. package/out/Theme/themes/default.theme.luau +130 -0
  87. package/out/Theme/themes/sandstone.theme.luau +103 -0
  88. package/out/Theme/themes/wooden.theme.luau +122 -0
  89. package/package.json +1 -1
@@ -2,6 +2,7 @@ import React from "@rbxts/react";
2
2
  import { CssSize } from "../../Interfaces/";
3
3
  interface CornerProps {
4
4
  radius?: CssSize;
5
+ name?: string;
5
6
  }
6
7
  export declare function Corners(props: CornerProps): React.JSX.Element | undefined;
7
8
  export {};
@@ -10,9 +10,14 @@ local function Corners(props)
10
10
  if radius.Scale == 0 and radius.Offset == 0 then
11
11
  return nil
12
12
  end
13
- return React.createElement("uicorner", {
14
- CornerRadius = radius,
15
- })
13
+ local _attributes = {}
14
+ local _condition = props.name
15
+ if _condition == nil then
16
+ _condition = "Corners"
17
+ end
18
+ _attributes.key = _condition
19
+ _attributes.CornerRadius = radius
20
+ return React.createElement("uicorner", _attributes)
16
21
  end
17
22
  return {
18
23
  Corners = Corners,
@@ -1,3 +1,5 @@
1
1
  import React from "@rbxts/react";
2
2
  import { PaddingProps } from "../../Interfaces/";
3
- export declare function Padding(props: PaddingProps): React.JSX.Element;
3
+ export declare function Padding(props: PaddingProps & {
4
+ name?: string;
5
+ }): React.JSX.Element;
@@ -6,12 +6,17 @@ local SpacingHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").
6
6
  local function Padding(props)
7
7
  local theme = React.useContext(CleanThemeContext)
8
8
  local padding = SpacingHelper:GetResolvedPadding(theme, props)
9
- return React.createElement("uipadding", {
10
- PaddingTop = UDim.new(0, padding.top),
11
- PaddingBottom = UDim.new(0, padding.bottom),
12
- PaddingLeft = UDim.new(0, padding.left),
13
- PaddingRight = UDim.new(0, padding.right),
14
- })
9
+ local _attributes = {}
10
+ local _condition = props.name
11
+ if _condition == nil then
12
+ _condition = "Padding"
13
+ end
14
+ _attributes.key = _condition
15
+ _attributes.PaddingTop = UDim.new(0, padding.top)
16
+ _attributes.PaddingBottom = UDim.new(0, padding.bottom)
17
+ _attributes.PaddingLeft = UDim.new(0, padding.left)
18
+ _attributes.PaddingRight = UDim.new(0, padding.right)
19
+ return React.createElement("uipadding", _attributes)
15
20
  end
16
21
  return {
17
22
  Padding = Padding,
@@ -12,6 +12,7 @@ export interface ButtonProps extends SpacedElementProps, ShadowElementProps, ZIn
12
12
  disabled?: boolean;
13
13
  LayoutOrder?: number;
14
14
  styleOverride?: ButtonStyleOverride;
15
+ name?: string;
15
16
  }
16
17
  export interface ButtonTextProps extends ScalableElementProps, IntentElementProps {
17
18
  children?: string;
@@ -20,6 +20,7 @@ local GroupContext = _.GroupContext
20
20
  local function ButtonText(props)
21
21
  local theme = React.useContext(CleanThemeContext)
22
22
  local _attributes = {
23
+ name = "ButtonText",
23
24
  text = props.text,
24
25
  }
25
26
  local _exp = props.scale
@@ -52,12 +53,16 @@ local function ButtonText(props)
52
53
  end
53
54
  local function ButtonIcon(props)
54
55
  local theme = React.useContext(CleanThemeContext)
55
- local _attributes = {
56
- scale = props.scale,
57
- icon = props.icon,
58
- spinning = props.spinning,
59
- speed = props.speed,
60
- }
56
+ local _attributes = {}
57
+ local _condition = props.name
58
+ if _condition == nil then
59
+ _condition = "ButtonIcon"
60
+ end
61
+ _attributes.name = _condition
62
+ _attributes.scale = props.scale
63
+ _attributes.icon = props.icon
64
+ _attributes.spinning = props.spinning
65
+ _attributes.speed = props.speed
61
66
  local _exp = props.intent
62
67
  local _exp_1 = if props.disabled then "disabled" else "default"
63
68
  local _exp_2 = theme.components.button.intents
@@ -87,10 +92,14 @@ local Button = React.forwardRef(function(props, ref)
87
92
  end
88
93
  local intentColors = ColorHelper:getIntentColors(theme, _exp, state, _exp_1, _result)
89
94
  local backgroundImage = CssHelper:resolveBackgroundImage(intentColors.backgroundImage)
90
- local _attributes = {
91
- ref = ref,
92
- Active = not props.disabled,
93
- }
95
+ local _attributes = {}
96
+ local _condition = props.name
97
+ if _condition == nil then
98
+ _condition = "Button"
99
+ end
100
+ _attributes.key = _condition
101
+ _attributes.ref = ref
102
+ _attributes.Active = not props.disabled
94
103
  local _object = {}
95
104
  local _spread = props.Event
96
105
  if _spread then
@@ -144,28 +153,28 @@ local Button = React.forwardRef(function(props, ref)
144
153
  _result_2 = _result_2.X
145
154
  end
146
155
  end
147
- local _condition = _result_2
148
- if _condition == nil then
149
- _condition = 0
156
+ local _condition_1 = _result_2
157
+ if _condition_1 == nil then
158
+ _condition_1 = 0
150
159
  end
151
- _result_1 = _condition
160
+ _result_1 = _condition_1
152
161
  else
153
162
  _result_1 = 0
154
163
  end
155
164
  _attributes.Size = UDim2.fromOffset(_result_1, 0)
156
165
  _attributes.AutomaticSize = Enum.AutomaticSize.XY
157
- local _condition = props.BackgroundTransparency
158
- if _condition == nil then
166
+ local _condition_1 = props.BackgroundTransparency
167
+ if _condition_1 == nil then
159
168
  local _result_2 = props.styleOverride
160
169
  if _result_2 ~= nil then
161
170
  _result_2 = _result_2.backgroundTransparency
162
171
  end
163
- _condition = _result_2
164
- if _condition == nil then
165
- _condition = theme.components.button.backgroundTransparency
172
+ _condition_1 = _result_2
173
+ if _condition_1 == nil then
174
+ _condition_1 = theme.components.button.backgroundTransparency
166
175
  end
167
176
  end
168
- _attributes.BackgroundTransparency = _condition
177
+ _attributes.BackgroundTransparency = _condition_1
169
178
  _attributes.BackgroundColor3 = intentColors.backgroundColor
170
179
  _attributes.AutoButtonColor = false
171
180
  _attributes.LayoutOrder = props.LayoutOrder
@@ -182,22 +191,24 @@ local Button = React.forwardRef(function(props, ref)
182
191
  if _result_2 ~= nil then
183
192
  _result_2 = _result_2.cornerRadius
184
193
  end
185
- local _condition_1 = _result_2
186
- if _condition_1 == nil then
187
- _condition_1 = theme.components.button.cornerRadius
194
+ local _condition_2 = _result_2
195
+ if _condition_2 == nil then
196
+ _condition_2 = theme.components.button.cornerRadius
188
197
  end
189
- _attributes_1.radius = _condition_1
198
+ _attributes_1.radius = _condition_2
190
199
  local _exp_2 = React.createElement(Corners, _attributes_1)
191
- local _attributes_2 = {}
200
+ local _attributes_2 = {
201
+ key = "Stroke",
202
+ }
192
203
  local _result_3 = props.styleOverride
193
204
  if _result_3 ~= nil then
194
205
  _result_3 = _result_3.borderThickness
195
206
  end
196
- local _condition_2 = _result_3
197
- if _condition_2 == nil then
198
- _condition_2 = theme.components.button.borderThickness
207
+ local _condition_3 = _result_3
208
+ if _condition_3 == nil then
209
+ _condition_3 = theme.components.button.borderThickness
199
210
  end
200
- _attributes_2.Thickness = _condition_2
211
+ _attributes_2.Thickness = _condition_3
201
212
  _attributes_2.BorderStrokePosition = Enum.BorderStrokePosition.Inner
202
213
  _attributes_2.Color = intentColors.borderColor
203
214
  local _exp_3 = React.createElement("uistroke", _attributes_2)
@@ -207,11 +218,11 @@ local Button = React.forwardRef(function(props, ref)
207
218
  if _result_4 ~= nil then
208
219
  _result_4 = _result_4.boxShadow
209
220
  end
210
- local _condition_3 = _result_4
211
- if _condition_3 == nil then
212
- _condition_3 = theme.components.button.boxShadow
221
+ local _condition_4 = _result_4
222
+ if _condition_4 == nil then
223
+ _condition_4 = theme.components.button.boxShadow
213
224
  end
214
- _attributes_3.value = _condition_3
225
+ _attributes_3.value = _condition_4
215
226
  local _exp_4 = React.createElement(BoxShadow, _attributes_3)
216
227
  local _attributes_4 = table.clone(props)
217
228
  setmetatable(_attributes_4, nil)
@@ -7,6 +7,7 @@ interface CheckboxProps extends IntentElementProps, PaddingProps, BackgroundElem
7
7
  'icon-unchecked'?: IconName;
8
8
  'intent-checked'?: Intent;
9
9
  'intent-unchecked'?: Intent;
10
+ name?: string;
10
11
  }
11
12
  export declare function Checkbox(props: CheckboxProps): React.JSX.Element;
12
13
  export {};
@@ -46,20 +46,24 @@ local function Checkbox(props)
46
46
  end
47
47
  end, { checked })
48
48
  local backgroundImage = CssHelper:resolveBackgroundImage(theme.components.checkbox.backgroundImage)
49
- local _attributes = {
50
- Size = UDim2.fromOffset(0, 0),
51
- AutomaticSize = Enum.AutomaticSize.XY,
52
- Event = {
53
- Activated = function()
54
- setChecked(not checked)
55
- end,
56
- },
57
- }
58
- local _condition_1 = props.BackgroundTransparency
49
+ local _attributes = {}
50
+ local _condition_1 = props.name
59
51
  if _condition_1 == nil then
60
- _condition_1 = theme.components.button.backgroundTransparency
52
+ _condition_1 = "Checkbox"
61
53
  end
62
- _attributes.BackgroundTransparency = _condition_1
54
+ _attributes.key = _condition_1
55
+ _attributes.Size = UDim2.fromOffset(0, 0)
56
+ _attributes.AutomaticSize = Enum.AutomaticSize.XY
57
+ _attributes.Event = {
58
+ Activated = function()
59
+ setChecked(not checked)
60
+ end,
61
+ }
62
+ local _condition_2 = props.BackgroundTransparency
63
+ if _condition_2 == nil then
64
+ _condition_2 = theme.components.button.backgroundTransparency
65
+ end
66
+ _attributes.BackgroundTransparency = _condition_2
63
67
  _attributes.BackgroundColor3 = ColorHelper:getIntentColors(theme, props.intent, "default", theme.components.button.intents).backgroundColor
64
68
  _attributes.AutoButtonColor = false
65
69
  _attributes.Image = backgroundImage.Image
@@ -73,18 +77,20 @@ local function Checkbox(props)
73
77
  radius = theme.components.checkbox.cornerRadius,
74
78
  })
75
79
  local _attributes_1 = {
80
+ key = "Stroke",
76
81
  Thickness = theme.components.checkbox.borderThickness,
77
82
  BorderStrokePosition = Enum.BorderStrokePosition.Inner,
78
83
  }
79
- local _condition_2 = theme.components.checkbox.borderTransparency
80
- if _condition_2 == nil then
81
- _condition_2 = 0
84
+ local _condition_3 = theme.components.checkbox.borderTransparency
85
+ if _condition_3 == nil then
86
+ _condition_3 = 0
82
87
  end
83
- _attributes_1.Transparency = _condition_2
88
+ _attributes_1.Transparency = _condition_3
84
89
  _attributes_1.Color = ColorHelper:getIntentColors(theme, if checked then props["intent-checked"] or "success" else props["intent-unchecked"] or "primary", "default", theme.components.checkbox.intents).borderColor
85
90
  return React.createElement("imagebutton", _attributes, _exp, React.createElement("uistroke", _attributes_1), React.createElement(Padding, {
86
91
  resolvedPadding = SpacingHelper:GetResolvedPadding(theme, props, theme.components.checkbox.spacing, theme.components.checkbox.padding),
87
92
  }), React.createElement(Icon, {
93
+ name = "CheckboxIcon",
88
94
  scale = props.scale,
89
95
  icon = if checked then props["icon-checked"] or "check" else props["icon-unchecked"],
90
96
  color = ColorHelper:getIntentColors(theme, if checked then props["intent-checked"] or "success" else props["intent-unchecked"] or "primary", "default", theme.components.checkbox.intents).textColor,
@@ -11,6 +11,7 @@ interface HoverButtonProps {
11
11
  focus?: ImageButtonProps;
12
12
  isSelected?: boolean;
13
13
  children?: React.ReactNode;
14
+ name?: string;
14
15
  }
15
16
  export declare function HoverButton(propSet: HoverButtonProps): React.JSX.Element;
16
17
  export {};
@@ -22,46 +22,50 @@ local function HoverButton(propSet)
22
22
  _stateEvents = _stateEvents.Event
23
23
  end
24
24
  local stateEvents = _stateEvents
25
- local _attributes = {
26
- Active = props.Active,
27
- AnchorPoint = props.AnchorPoint,
28
- Archivable = props.Archivable,
29
- AutoButtonColor = props.AutoButtonColor,
30
- AutomaticSize = props.AutomaticSize,
31
- BackgroundColor3 = props.BackgroundColor3,
32
- BackgroundTransparency = props.BackgroundTransparency,
33
- BorderColor3 = props.BorderColor3,
34
- BorderMode = props.BorderMode,
35
- BorderSizePixel = props.BorderSizePixel,
36
- ClipsDescendants = props.ClipsDescendants,
37
- LayoutOrder = props.LayoutOrder,
38
- NextSelectionDown = props.NextSelectionDown,
39
- NextSelectionLeft = props.NextSelectionLeft,
40
- NextSelectionRight = props.NextSelectionRight,
41
- NextSelectionUp = props.NextSelectionUp,
42
- Position = props.Position,
43
- Rotation = props.Rotation,
44
- Selectable = props.Selectable,
45
- SelectionBehaviorDown = props.SelectionBehaviorDown,
46
- SelectionBehaviorLeft = props.SelectionBehaviorLeft,
47
- SelectionBehaviorRight = props.SelectionBehaviorRight,
48
- SelectionBehaviorUp = props.SelectionBehaviorUp,
49
- SelectionGroup = props.SelectionGroup,
50
- Size = props.Size,
51
- SizeConstraint = props.SizeConstraint,
52
- Visible = props.Visible,
53
- ZIndex = props.ZIndex,
54
- Image = props.Image,
55
- ImageColor3 = props.ImageColor3,
56
- ImageRectOffset = props.ImageRectOffset,
57
- ImageRectSize = props.ImageRectSize,
58
- ImageTransparency = props.ImageTransparency,
59
- ResampleMode = props.ResampleMode,
60
- ScaleType = props.ScaleType,
61
- SliceCenter = props.SliceCenter,
62
- SliceScale = props.SliceScale,
63
- TileSize = props.TileSize,
64
- }
25
+ local _attributes = {}
26
+ local _condition = propSet.name
27
+ if _condition == nil then
28
+ _condition = "HoverButton"
29
+ end
30
+ _attributes.key = _condition
31
+ _attributes.Active = props.Active
32
+ _attributes.AnchorPoint = props.AnchorPoint
33
+ _attributes.Archivable = props.Archivable
34
+ _attributes.AutoButtonColor = props.AutoButtonColor
35
+ _attributes.AutomaticSize = props.AutomaticSize
36
+ _attributes.BackgroundColor3 = props.BackgroundColor3
37
+ _attributes.BackgroundTransparency = props.BackgroundTransparency
38
+ _attributes.BorderColor3 = props.BorderColor3
39
+ _attributes.BorderMode = props.BorderMode
40
+ _attributes.BorderSizePixel = props.BorderSizePixel
41
+ _attributes.ClipsDescendants = props.ClipsDescendants
42
+ _attributes.LayoutOrder = props.LayoutOrder
43
+ _attributes.NextSelectionDown = props.NextSelectionDown
44
+ _attributes.NextSelectionLeft = props.NextSelectionLeft
45
+ _attributes.NextSelectionRight = props.NextSelectionRight
46
+ _attributes.NextSelectionUp = props.NextSelectionUp
47
+ _attributes.Position = props.Position
48
+ _attributes.Rotation = props.Rotation
49
+ _attributes.Selectable = props.Selectable
50
+ _attributes.SelectionBehaviorDown = props.SelectionBehaviorDown
51
+ _attributes.SelectionBehaviorLeft = props.SelectionBehaviorLeft
52
+ _attributes.SelectionBehaviorRight = props.SelectionBehaviorRight
53
+ _attributes.SelectionBehaviorUp = props.SelectionBehaviorUp
54
+ _attributes.SelectionGroup = props.SelectionGroup
55
+ _attributes.Size = props.Size
56
+ _attributes.SizeConstraint = props.SizeConstraint
57
+ _attributes.Visible = props.Visible
58
+ _attributes.ZIndex = props.ZIndex
59
+ _attributes.Image = props.Image
60
+ _attributes.ImageColor3 = props.ImageColor3
61
+ _attributes.ImageRectOffset = props.ImageRectOffset
62
+ _attributes.ImageRectSize = props.ImageRectSize
63
+ _attributes.ImageTransparency = props.ImageTransparency
64
+ _attributes.ResampleMode = props.ResampleMode
65
+ _attributes.ScaleType = props.ScaleType
66
+ _attributes.SliceCenter = props.SliceCenter
67
+ _attributes.SliceScale = props.SliceScale
68
+ _attributes.TileSize = props.TileSize
65
69
  local _object_1 = {}
66
70
  if defaultEvents then
67
71
  for _k, _v in defaultEvents do
@@ -7,5 +7,6 @@ export interface IncrementProps extends ScalableElementProps, SpacedElementProps
7
7
  min?: number;
8
8
  max?: number;
9
9
  controlled?: boolean;
10
+ name?: string;
10
11
  }
11
12
  export declare const Increment: React.ForwardRefExoticComponent<Omit<IncrementProps, "ref"> & React.RefAttributes<ImageLabel>>;
@@ -34,9 +34,13 @@ local Increment = React.forwardRef(function(props, ref)
34
34
  _result(nextValue)
35
35
  end
36
36
  end
37
- local _attributes = {
38
- ref = ref,
39
- }
37
+ local _attributes = {}
38
+ local _condition_1 = props.name
39
+ if _condition_1 == nil then
40
+ _condition_1 = "Increment"
41
+ end
42
+ _attributes.name = _condition_1
43
+ _attributes.ref = ref
40
44
  for _k, _v in props do
41
45
  _attributes[_k] = _v
42
46
  end
@@ -47,6 +51,7 @@ local Increment = React.forwardRef(function(props, ref)
47
51
  valign = "Center",
48
52
  spacing = props.spacing,
49
53
  }, React.createElement(Button, {
54
+ name = "DecrementButton",
50
55
  icon = "minus",
51
56
  intent = props.intent,
52
57
  scale = props.scale,
@@ -67,6 +72,7 @@ local Increment = React.forwardRef(function(props, ref)
67
72
  HorizontalFlex = "Fill",
68
73
  LayoutOrder = 1,
69
74
  }, React.createElement(Input, {
75
+ name = "IncrementInput",
70
76
  Size = UDim2.fromScale(0, 0),
71
77
  scale = props.scale,
72
78
  spacing = props.spacing,
@@ -84,6 +90,7 @@ local Increment = React.forwardRef(function(props, ref)
84
90
  applyValue(parsed)
85
91
  end,
86
92
  })), React.createElement(Button, {
93
+ name = "IncrementButton",
87
94
  icon = "plus",
88
95
  intent = props.intent,
89
96
  scale = props.scale,
@@ -1,5 +1,5 @@
1
1
  import React from "@rbxts/react";
2
- import { ScalableElementProps, SpacedElementProps } from "../../Interfaces";
2
+ import { IconName, ScalableElementProps, SpacedElementProps } from "../../Interfaces";
3
3
  export interface InputProps extends ScalableElementProps, SpacedElementProps, React.InstanceProps<TextBox> {
4
4
  value: string;
5
5
  placeholder?: string;
@@ -9,5 +9,7 @@ export interface InputProps extends ScalableElementProps, SpacedElementProps, Re
9
9
  onChange?: (value: string) => void;
10
10
  Event?: React.InstanceEvent<TextBox>;
11
11
  controlled?: boolean;
12
+ icon?: IconName;
13
+ name?: string;
12
14
  }
13
15
  export declare function Input(props: InputProps): React.JSX.Element;
@@ -11,7 +11,11 @@ local TypographyHelper = _Helpers.TypographyHelper
11
11
  local _Decorator = TS.import(script, script.Parent.Parent, "Decorator")
12
12
  local Corners = _Decorator.Corners
13
13
  local Padding = _Decorator.Padding
14
- local FieldsetContext = TS.import(script, script.Parent.Parent, "Layout").FieldsetContext
14
+ local _Layout = TS.import(script, script.Parent.Parent, "Layout")
15
+ local FieldsetContext = _Layout.FieldsetContext
16
+ local FlexItem = _Layout.FlexItem
17
+ local HStack = _Layout.HStack
18
+ local Icon = TS.import(script, script.Parent.Parent, "Surface").Icon
15
19
  local _Input_validation = TS.import(script, script.Parent, "Input.validation")
16
20
  local resolveClampedText = _Input_validation.resolveClampedText
17
21
  local resolveValidatedText = _Input_validation.resolveValidatedText
@@ -45,7 +49,29 @@ local function Input(props)
45
49
  return connection:Disconnect()
46
50
  end
47
51
  end, { labelActivated, ref })
52
+ local _attributes = {}
53
+ local _condition = props.name
54
+ if _condition == nil then
55
+ _condition = "Input"
56
+ end
57
+ _attributes.key = _condition
58
+ _attributes.Size = props.Size or UDim2.fromScale(1, 0)
59
+ _attributes.AutomaticSize = Enum.AutomaticSize.Y
60
+ _attributes.BackgroundTransparency = 1
61
+ _attributes.AnchorPoint = props.AnchorPoint
62
+ _attributes.Position = props.Position
63
+ _attributes.LayoutOrder = props.LayoutOrder
64
+ _attributes.Visible = props.Visible
65
+ _attributes.ZIndex = props.ZIndex
66
+ _attributes.Image = backgroundImage.Image
67
+ _attributes.ImageColor3 = backgroundImage.ImageColor3
68
+ _attributes.ImageTransparency = backgroundImage.ImageTransparency
69
+ _attributes.ScaleType = backgroundImage.ScaleType
70
+ _attributes.SliceCenter = backgroundImage.SliceCenter
71
+ _attributes.SliceScale = backgroundImage.SliceScale
72
+ _attributes.TileSize = backgroundImage.TileSize
48
73
  local _exp = React.createElement("uistroke", {
74
+ key = "Stroke",
49
75
  Thickness = theme.components.input.borderThickness,
50
76
  BorderStrokePosition = Enum.BorderStrokePosition.Inner,
51
77
  Color = theme.components.input.borderColor,
@@ -53,10 +79,16 @@ local function Input(props)
53
79
  local _exp_1 = React.createElement(Corners, {
54
80
  radius = theme.components.input.cornerRadius,
55
81
  })
56
- local _attributes = table.clone(props)
57
- setmetatable(_attributes, nil)
58
- local _exp_2 = React.createElement(Padding, _attributes)
59
- local _attributes_1 = {
82
+ local _attributes_1 = table.clone(props)
83
+ setmetatable(_attributes_1, nil)
84
+ local _exp_2 = React.createElement(Padding, _attributes_1)
85
+ local _exp_3 = props.icon ~= nil and (React.createElement(Icon, {
86
+ name = "InputIcon",
87
+ icon = props.icon,
88
+ color = theme.components.input.iconColor,
89
+ }))
90
+ local _attributes_2 = {
91
+ key = "TextBox",
60
92
  ref = ref,
61
93
  Size = UDim2.fromScale(1, 0),
62
94
  BackgroundTransparency = 1,
@@ -65,52 +97,52 @@ local function Input(props)
65
97
  FontFace = Font.fromName(typography.font.Name, typography.weight or Enum.FontWeight.Regular),
66
98
  FontSize = typography.size,
67
99
  }
68
- local _condition = props.PlaceholderText
69
- if _condition == nil then
70
- _condition = props.placeholder
71
- end
72
- _attributes_1.PlaceholderText = _condition
73
- _attributes_1.PlaceholderColor3 = props.PlaceholderColor3 or placeholderTypography.color
74
- _attributes_1.TextScaled = props.TextScaled
75
- _attributes_1.LineHeight = typography.lineHeight
76
- _attributes_1.Text = if props.controlled then props.value else value
77
- _attributes_1.TextColor3 = props.TextColor3 or typography.color or theme.colors.intents.primary.default.textColor
78
- local _condition_1 = props.TextTransparency
100
+ local _condition_1 = props.PlaceholderText
79
101
  if _condition_1 == nil then
80
- _condition_1 = typography.transparency
102
+ _condition_1 = props.placeholder
81
103
  end
82
- _attributes_1.TextTransparency = _condition_1
83
- _attributes_1.Active = props.Active
84
- _attributes_1.Archivable = props.Archivable
85
- _attributes_1.BorderColor3 = props.BorderColor3
86
- _attributes_1.BorderMode = props.BorderMode
87
- _attributes_1.BorderSizePixel = props.BorderSizePixel
88
- _attributes_1.ClipsDescendants = props.ClipsDescendants
89
- _attributes_1.Rotation = props.Rotation
90
- _attributes_1.Selectable = props.Selectable
91
- _attributes_1.SelectionImageObject = props.SelectionImageObject
92
- _attributes_1.SizeConstraint = props.SizeConstraint
93
- _attributes_1.Tag = props.Tag
94
- _attributes_1.AutoLocalize = props.AutoLocalize
95
- _attributes_1.RootLocalizationTable = props.RootLocalizationTable
96
- _attributes_1.NextSelectionDown = props.NextSelectionDown
97
- _attributes_1.NextSelectionLeft = props.NextSelectionLeft
98
- _attributes_1.NextSelectionRight = props.NextSelectionRight
99
- _attributes_1.NextSelectionUp = props.NextSelectionUp
100
- _attributes_1.SelectionGroup = props.SelectionGroup
101
- _attributes_1.SelectionOrder = props.SelectionOrder
102
- local _condition_2 = props.ClearTextOnFocus
104
+ _attributes_2.PlaceholderText = _condition_1
105
+ _attributes_2.PlaceholderColor3 = props.PlaceholderColor3 or placeholderTypography.color
106
+ _attributes_2.TextScaled = props.TextScaled
107
+ _attributes_2.LineHeight = typography.lineHeight
108
+ _attributes_2.Text = if props.controlled then props.value else value
109
+ _attributes_2.TextColor3 = props.TextColor3 or typography.color or theme.colors.intents.primary.default.textColor
110
+ local _condition_2 = props.TextTransparency
103
111
  if _condition_2 == nil then
104
- _condition_2 = false
112
+ _condition_2 = typography.transparency
105
113
  end
106
- _attributes_1.ClearTextOnFocus = _condition_2
107
- _attributes_1.CursorPosition = props.CursorPosition
108
- _attributes_1.MultiLine = props.MultiLine
109
- _attributes_1.SelectionStart = props.SelectionStart
110
- _attributes_1.ShowNativeInput = props.ShowNativeInput
111
- _attributes_1.TextEditable = props.TextEditable
112
- _attributes_1.TextTruncate = props.TextTruncate
113
- _attributes_1.RichText = props.RichText
114
+ _attributes_2.TextTransparency = _condition_2
115
+ _attributes_2.Active = props.Active
116
+ _attributes_2.Archivable = props.Archivable
117
+ _attributes_2.BorderColor3 = props.BorderColor3
118
+ _attributes_2.BorderMode = props.BorderMode
119
+ _attributes_2.BorderSizePixel = props.BorderSizePixel
120
+ _attributes_2.ClipsDescendants = props.ClipsDescendants
121
+ _attributes_2.Rotation = props.Rotation
122
+ _attributes_2.Selectable = props.Selectable
123
+ _attributes_2.SelectionImageObject = props.SelectionImageObject
124
+ _attributes_2.SizeConstraint = props.SizeConstraint
125
+ _attributes_2.Tag = props.Tag
126
+ _attributes_2.AutoLocalize = props.AutoLocalize
127
+ _attributes_2.RootLocalizationTable = props.RootLocalizationTable
128
+ _attributes_2.NextSelectionDown = props.NextSelectionDown
129
+ _attributes_2.NextSelectionLeft = props.NextSelectionLeft
130
+ _attributes_2.NextSelectionRight = props.NextSelectionRight
131
+ _attributes_2.NextSelectionUp = props.NextSelectionUp
132
+ _attributes_2.SelectionGroup = props.SelectionGroup
133
+ _attributes_2.SelectionOrder = props.SelectionOrder
134
+ local _condition_3 = props.ClearTextOnFocus
135
+ if _condition_3 == nil then
136
+ _condition_3 = false
137
+ end
138
+ _attributes_2.ClearTextOnFocus = _condition_3
139
+ _attributes_2.CursorPosition = props.CursorPosition
140
+ _attributes_2.MultiLine = props.MultiLine
141
+ _attributes_2.SelectionStart = props.SelectionStart
142
+ _attributes_2.ShowNativeInput = props.ShowNativeInput
143
+ _attributes_2.TextEditable = props.TextEditable
144
+ _attributes_2.TextTruncate = props.TextTruncate
145
+ _attributes_2.RichText = props.RichText
114
146
  local _object = {}
115
147
  local _spread = props.Event
116
148
  if _spread then
@@ -137,7 +169,7 @@ local function Input(props)
137
169
  end
138
170
  end
139
171
  end
140
- _attributes_1.Event = _object
172
+ _attributes_2.Event = _object
141
173
  local _object_1 = {}
142
174
  local _spread_1 = props.Change
143
175
  if _spread_1 then
@@ -165,24 +197,11 @@ local function Input(props)
165
197
  end
166
198
  end
167
199
  end
168
- _attributes_1.Change = _object_1
169
- return React.createElement("imagelabel", {
170
- Size = props.Size or UDim2.fromScale(1, 0),
171
- AutomaticSize = Enum.AutomaticSize.Y,
172
- BackgroundTransparency = 1,
173
- AnchorPoint = props.AnchorPoint,
174
- Position = props.Position,
175
- LayoutOrder = props.LayoutOrder,
176
- Visible = props.Visible,
177
- ZIndex = props.ZIndex,
178
- Image = backgroundImage.Image,
179
- ImageColor3 = backgroundImage.ImageColor3,
180
- ImageTransparency = backgroundImage.ImageTransparency,
181
- ScaleType = backgroundImage.ScaleType,
182
- SliceCenter = backgroundImage.SliceCenter,
183
- SliceScale = backgroundImage.SliceScale,
184
- TileSize = backgroundImage.TileSize,
185
- }, _exp, _exp_1, _exp_2, React.createElement("textbox", _attributes_1))
200
+ _attributes_2.Change = _object_1
201
+ return React.createElement("imagelabel", _attributes, _exp, _exp_1, _exp_2, React.createElement(HStack, {
202
+ valign = "Center",
203
+ Wraps = false,
204
+ }, _exp_3, React.createElement(FlexItem, nil, React.createElement("textbox", _attributes_2))))
186
205
  end
187
206
  return {
188
207
  Input = Input,