@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.
- package/out/Components/Chart/BarChart.d.ts +1 -0
- package/out/Components/Chart/BarChart.luau +149 -112
- package/out/Components/Chart/Pie.d.ts +1 -0
- package/out/Components/Chart/Pie.luau +21 -5
- package/out/Components/Decorator/BoxShadow.d.ts +1 -0
- package/out/Components/Decorator/BoxShadow.luau +12 -5
- package/out/Components/Decorator/Corners.d.ts +1 -0
- package/out/Components/Decorator/Corners.luau +8 -3
- package/out/Components/Decorator/Padding.d.ts +3 -1
- package/out/Components/Decorator/Padding.luau +11 -6
- package/out/Components/Input/Button.d.ts +1 -0
- package/out/Components/Input/Button.luau +44 -33
- package/out/Components/Input/Checkbox.d.ts +1 -0
- package/out/Components/Input/Checkbox.luau +22 -16
- package/out/Components/Input/HoverButton.d.ts +1 -0
- package/out/Components/Input/HoverButton.luau +44 -40
- package/out/Components/Input/Increment.d.ts +1 -0
- package/out/Components/Input/Increment.luau +10 -3
- package/out/Components/Input/Input.d.ts +3 -1
- package/out/Components/Input/Input.luau +85 -66
- package/out/Components/Input/Select.d.ts +9 -0
- package/out/Components/Input/Select.luau +311 -34
- package/out/Components/Input/Slider.luau +44 -29
- package/out/Components/Input/Switch.d.ts +9 -0
- package/out/Components/Input/Switch.luau +147 -0
- package/out/Components/Input/index.d.ts +1 -0
- package/out/Components/Input/init.luau +3 -0
- package/out/Components/Interaction/Modal.d.ts +14 -0
- package/out/Components/Interaction/Modal.luau +276 -0
- package/out/Components/Interaction/Toast.d.ts +2 -1
- package/out/Components/Interaction/Toast.luau +53 -28
- package/out/Components/Interaction/Tooltip.luau +36 -24
- package/out/Components/Interaction/index.d.ts +1 -0
- package/out/Components/Interaction/init.luau +3 -0
- package/out/Components/Layout/Accordion.d.ts +1 -0
- package/out/Components/Layout/Accordion.luau +51 -55
- package/out/Components/Layout/Column.d.ts +1 -0
- package/out/Components/Layout/Column.luau +11 -6
- package/out/Components/Layout/Container.d.ts +1 -0
- package/out/Components/Layout/Container.luau +22 -16
- package/out/Components/Layout/Draggable.luau +25 -3
- package/out/Components/Layout/Fieldset.d.ts +1 -0
- package/out/Components/Layout/Fieldset.luau +14 -42
- package/out/Components/Layout/FlexItem.luau +7 -0
- package/out/Components/Layout/Group.d.ts +1 -0
- package/out/Components/Layout/Group.luau +16 -33
- package/out/Components/Layout/HStack.d.ts +4 -0
- package/out/Components/Layout/HStack.luau +17 -10
- package/out/Components/Layout/Pagination.d.ts +32 -0
- package/out/Components/Layout/Pagination.luau +405 -0
- package/out/Components/Layout/Row.d.ts +1 -0
- package/out/Components/Layout/Row.luau +20 -48
- package/out/Components/Layout/Scroller.d.ts +1 -0
- package/out/Components/Layout/Scroller.luau +26 -34
- package/out/Components/Layout/Table.d.ts +31 -0
- package/out/Components/Layout/Table.luau +342 -0
- package/out/Components/Layout/Tabs.d.ts +18 -9
- package/out/Components/Layout/Tabs.luau +134 -119
- package/out/Components/Layout/VStack.d.ts +3 -0
- package/out/Components/Layout/VStack.luau +17 -10
- package/out/Components/Layout/index.d.ts +2 -0
- package/out/Components/Layout/init.luau +6 -0
- package/out/Components/Navigation/Menu.d.ts +1 -0
- package/out/Components/Navigation/Menu.luau +12 -3
- package/out/Components/Surface/Box.d.ts +1 -0
- package/out/Components/Surface/Box.luau +12 -4
- package/out/Components/Surface/Card.d.ts +1 -0
- package/out/Components/Surface/Card.luau +54 -51
- package/out/Components/Surface/Icon.d.ts +1 -0
- package/out/Components/Surface/Icon.luau +25 -16
- package/out/Components/Typography/Text.d.ts +1 -0
- package/out/Components/Typography/Text.luau +57 -47
- package/out/Contexts/index.d.ts +1 -0
- package/out/Contexts/init.luau +3 -0
- package/out/Contexts/modal.context.d.ts +15 -0
- package/out/Contexts/modal.context.luau +26 -0
- package/out/Contexts/toast.context.d.ts +1 -0
- package/out/Providers/app.provider.luau +2 -1
- package/out/Providers/index.d.ts +1 -0
- package/out/Providers/init.luau +3 -0
- package/out/Providers/modal.provider.d.ts +6 -0
- package/out/Providers/modal.provider.luau +86 -0
- package/out/Providers/overlay.provider.luau +1 -0
- package/out/Theme/theme.template.d.ts +85 -0
- package/out/Theme/themes/dark.theme.luau +103 -0
- package/out/Theme/themes/default.theme.luau +130 -0
- package/out/Theme/themes/sandstone.theme.luau +103 -0
- package/out/Theme/themes/wooden.theme.luau +122 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
14
|
-
|
|
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,
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
92
|
-
|
|
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
|
|
148
|
-
if
|
|
149
|
-
|
|
156
|
+
local _condition_1 = _result_2
|
|
157
|
+
if _condition_1 == nil then
|
|
158
|
+
_condition_1 = 0
|
|
150
159
|
end
|
|
151
|
-
_result_1 =
|
|
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
|
|
158
|
-
if
|
|
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
|
-
|
|
164
|
-
if
|
|
165
|
-
|
|
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 =
|
|
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
|
|
186
|
-
if
|
|
187
|
-
|
|
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 =
|
|
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
|
|
197
|
-
if
|
|
198
|
-
|
|
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 =
|
|
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
|
|
211
|
-
if
|
|
212
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
52
|
+
_condition_1 = "Checkbox"
|
|
61
53
|
end
|
|
62
|
-
_attributes.
|
|
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
|
|
80
|
-
if
|
|
81
|
-
|
|
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 =
|
|
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,
|
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
57
|
-
setmetatable(
|
|
58
|
-
local _exp_2 = React.createElement(Padding,
|
|
59
|
-
local
|
|
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
|
|
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 =
|
|
102
|
+
_condition_1 = props.placeholder
|
|
81
103
|
end
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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 =
|
|
112
|
+
_condition_2 = typography.transparency
|
|
105
113
|
end
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
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
|
-
|
|
169
|
-
return React.createElement("imagelabel", {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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,
|