@rbxts/react-clean-ui 1.0.19 → 1.0.38

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 (99) hide show
  1. package/out/Components/Chart/BarChart.d.ts +47 -0
  2. package/out/Components/Chart/BarChart.luau +880 -0
  3. package/out/Components/Chart/Pie.luau +12 -12
  4. package/out/Components/Chart/index.d.ts +1 -0
  5. package/out/Components/Chart/init.luau +3 -0
  6. package/out/Components/Input/Button.d.ts +9 -0
  7. package/out/Components/Input/Button.luau +155 -46
  8. package/out/Components/Input/Checkbox.luau +21 -5
  9. package/out/Components/Input/Increment.d.ts +11 -0
  10. package/out/Components/Input/Increment.luau +107 -0
  11. package/out/Components/Input/Increment.step.d.ts +1 -0
  12. package/out/Components/Input/Increment.step.luau +25 -0
  13. package/out/Components/Input/Input.d.ts +4 -3
  14. package/out/Components/Input/Input.luau +124 -17
  15. package/out/Components/Input/Input.validation.d.ts +3 -0
  16. package/out/Components/Input/Input.validation.luau +21 -0
  17. package/out/Components/Input/Select.d.ts +4 -3
  18. package/out/Components/Input/Select.luau +23 -18
  19. package/out/Components/Input/Slider.d.ts +1 -1
  20. package/out/Components/Input/Slider.luau +68 -34
  21. package/out/Components/Input/index.d.ts +1 -0
  22. package/out/Components/Input/init.luau +3 -0
  23. package/out/Components/Interaction/Toast.d.ts +1 -1
  24. package/out/Components/Interaction/Toast.luau +4 -4
  25. package/out/Components/Interaction/Tooltip.d.ts +1 -1
  26. package/out/Components/Interaction/Tooltip.luau +8 -1
  27. package/out/Components/Layout/Accordion.d.ts +34 -0
  28. package/out/Components/Layout/Accordion.luau +431 -0
  29. package/out/Components/Layout/Container.d.ts +4 -2
  30. package/out/Components/Layout/Container.luau +32 -7
  31. package/out/Components/Layout/Draggable.luau +1 -1
  32. package/out/Components/Layout/Fieldset.d.ts +1 -1
  33. package/out/Components/Layout/FlexItem.d.ts +2 -1
  34. package/out/Components/Layout/FlexItem.luau +1 -0
  35. package/out/Components/Layout/HStack.d.ts +2 -1
  36. package/out/Components/Layout/HStack.luau +1 -2
  37. package/out/Components/Layout/Scroller.d.ts +1 -0
  38. package/out/Components/Layout/Scroller.luau +1 -1
  39. package/out/Components/Layout/Tabs.d.ts +1 -1
  40. package/out/Components/Layout/Tabs.luau +37 -7
  41. package/out/Components/Layout/VStack.d.ts +4 -1
  42. package/out/Components/Layout/VStack.luau +2 -2
  43. package/out/Components/Layout/index.d.ts +1 -0
  44. package/out/Components/Layout/init.luau +3 -0
  45. package/out/Components/Navigation/Menu.d.ts +1 -1
  46. package/out/Components/Surface/Box.d.ts +5 -3
  47. package/out/Components/Surface/Box.luau +12 -3
  48. package/out/Components/Surface/Card.d.ts +8 -6
  49. package/out/Components/Surface/Card.luau +430 -26
  50. package/out/Components/Surface/Icon.d.ts +1 -1
  51. package/out/Components/Surface/Icon.luau +43 -4
  52. package/out/Components/Typography/Text.d.ts +1 -0
  53. package/out/Components/Typography/Text.luau +135 -13
  54. package/out/Contexts/row.context.d.ts +1 -1
  55. package/out/Contexts/theme.context.d.ts +2 -2
  56. package/out/Helpers/color.helper.d.ts +5 -3
  57. package/out/Helpers/color.helper.luau +62 -34
  58. package/out/Helpers/create-ui-story.d.ts +8 -6
  59. package/out/Helpers/create-ui-story.luau +48 -5
  60. package/out/Helpers/css.helper.d.ts +28 -2
  61. package/out/Helpers/css.helper.luau +208 -0
  62. package/out/Helpers/index.d.ts +1 -0
  63. package/out/Helpers/init.luau +3 -0
  64. package/out/Helpers/size.helper.d.ts +3 -1
  65. package/out/Helpers/size.helper.luau +10 -9
  66. package/out/Helpers/spacing.helper.d.ts +3 -3
  67. package/out/Helpers/typography.helper.d.ts +2 -2
  68. package/out/Interfaces/css.types.d.ts +28 -0
  69. package/out/Interfaces/css.types.luau +17 -0
  70. package/out/Interfaces/element.props.d.ts +61 -0
  71. package/out/Interfaces/element.props.luau +1 -0
  72. package/out/Interfaces/index.d.ts +4 -2
  73. package/out/Interfaces/init.luau +9 -3
  74. package/out/Interfaces/responsive.types.d.ts +26 -0
  75. package/out/Interfaces/semantics.d.ts +3 -0
  76. package/out/Interfaces/semantics.luau +2 -0
  77. package/out/Providers/app.provider.d.ts +2 -2
  78. package/out/Providers/theme.provider.d.ts +2 -2
  79. package/out/Theme/index.d.ts +1 -0
  80. package/out/Theme/theme.factory.d.ts +3 -3
  81. package/out/Theme/theme.style.d.ts +48 -0
  82. package/out/Theme/theme.style.luau +1 -0
  83. package/out/Theme/theme.template.d.ts +90 -36
  84. package/out/Theme/themes/dark.theme.d.ts +1 -1
  85. package/out/Theme/themes/dark.theme.luau +73 -1
  86. package/out/Theme/themes/default.theme.d.ts +2 -2
  87. package/out/Theme/themes/default.theme.luau +122 -12
  88. package/out/Theme/themes/index.d.ts +1 -0
  89. package/out/Theme/themes/init.luau +3 -0
  90. package/out/Theme/themes/sandstone.theme.d.ts +1 -1
  91. package/out/Theme/themes/sandstone.theme.luau +81 -10
  92. package/out/Theme/themes/wooden.theme.d.ts +1 -0
  93. package/out/Theme/themes/wooden.theme.luau +443 -0
  94. package/out/index.d.ts +8 -8
  95. package/package.json +20 -6
  96. package/out/Interfaces/clean.element.props.d.ts +0 -114
  97. /package/out/{Interfaces/userinput.d.ts → Helpers/input.helper.d.ts} +0 -0
  98. /package/out/{Interfaces/userinput.luau → Helpers/input.helper.luau} +0 -0
  99. /package/out/Interfaces/{clean.element.props.luau → responsive.types.luau} +0 -0
@@ -0,0 +1,431 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local useTween = TS.import(script, TS.getModule(script, "@rbxts", "react-ripple").src).useTween
5
+ local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
6
+ local _Helpers = TS.import(script, script.Parent.Parent.Parent, "Helpers")
7
+ local ColorHelper = _Helpers.ColorHelper
8
+ local SizeHelper = _Helpers.SizeHelper
9
+ local SpacingHelper = _Helpers.SpacingHelper
10
+ local TypographyHelper = _Helpers.TypographyHelper
11
+ local _Decorator = TS.import(script, script.Parent.Parent, "Decorator")
12
+ local Corners = _Decorator.Corners
13
+ local Padding = _Decorator.Padding
14
+ local _HoverButton = TS.import(script, script.Parent.Parent, "Input", "HoverButton")
15
+ local HoverButton = _HoverButton.HoverButton
16
+ local HoverButtonContext = _HoverButton.HoverButtonContext
17
+ local Icon = TS.import(script, script.Parent.Parent, "Surface", "Icon").Icon
18
+ local Text = TS.import(script, script.Parent.Parent, "Typography").Text
19
+ local Container = TS.import(script, script.Parent, "Container").Container
20
+ local HStack = TS.import(script, script.Parent, "HStack").HStack
21
+ local VStack = TS.import(script, script.Parent, "VStack").VStack
22
+ local function AccordionItem(_props)
23
+ return nil
24
+ end
25
+ local function AccordionHeader(_props)
26
+ return nil
27
+ end
28
+ local function AccordionContent(_props)
29
+ return nil
30
+ end
31
+ local function AccordionHeaderVisual(props)
32
+ local theme = React.useContext(CleanThemeContext)
33
+ local hover = React.useContext(HoverButtonContext)
34
+ local _result
35
+ if props.disabled then
36
+ _result = "disabled"
37
+ else
38
+ local _result_1 = hover
39
+ if _result_1 ~= nil then
40
+ _result_1 = _result_1.isSelected
41
+ end
42
+ local _result_2
43
+ if _result_1 then
44
+ _result_2 = "focus"
45
+ else
46
+ local _result_3 = hover
47
+ if _result_3 ~= nil then
48
+ _result_3 = _result_3.hover
49
+ end
50
+ _result_2 = if _result_3 then "hover" else "default"
51
+ end
52
+ _result = _result_2
53
+ end
54
+ local state = _result
55
+ local colors = ColorHelper:getIntentColors(theme, "primary", state, theme.components.accordion.header.intents)
56
+ local rotation, rotationTween = useTween(if props.open then 180 else 0, {
57
+ duration = props.duration,
58
+ })
59
+ React.useEffect(function()
60
+ local goal = if props.open then 180 else 0
61
+ rotationTween:setGoal(goal, {
62
+ duration = props.duration,
63
+ })
64
+ if props.duration == 0 then
65
+ rotationTween:setPosition(goal)
66
+ end
67
+ rotationTween:start()
68
+ end, { props.duration, props.open, rotationTween })
69
+ local _condition = props.header.text == nil and props.header.children ~= nil
70
+ if _condition then
71
+ local _children = props.header.children
72
+ _condition = not (type(_children) == "string")
73
+ end
74
+ if _condition then
75
+ return props.header.children
76
+ end
77
+ local _exp = React.createElement(Padding, {
78
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.accordion.header.spacing),
79
+ })
80
+ local _exp_1 = props.header.icon ~= nil and React.createElement(Icon, {
81
+ icon = props.header.icon,
82
+ color = colors.textColor,
83
+ })
84
+ local _result_1
85
+ if props.header.text ~= nil then
86
+ _result_1 = React.createElement(Text, {
87
+ text = props.header.text,
88
+ TextColor3 = colors.textColor,
89
+ typography = TypographyHelper:getTypography(theme, nil, colors.typography or theme.components.accordion.header.typography),
90
+ })
91
+ else
92
+ local _children = props.header.children
93
+ _result_1 = if type(_children) == "string" then React.createElement(Text, {
94
+ text = props.header.children,
95
+ TextColor3 = colors.textColor,
96
+ typography = TypographyHelper:getTypography(theme, nil, colors.typography or theme.components.accordion.header.typography),
97
+ }) else props.header.children
98
+ end
99
+ return React.createElement(React.Fragment, nil, _exp, React.createElement(HStack, {
100
+ valign = "Center",
101
+ Wraps = false,
102
+ HorizontalFlex = Enum.UIFlexAlignment.Fill,
103
+ }, _exp_1, React.createElement(Container, {
104
+ Size = UDim2.new(1, theme.components.accordion.header.indicatorSize, 0, 0),
105
+ AutomaticSize = Enum.AutomaticSize.Y,
106
+ }, _result_1), React.createElement(Container, nil, React.createElement(Icon, {
107
+ icon = "chevron-down",
108
+ color = if props.disabled then colors.textColor else theme.components.accordion.header.indicatorColor,
109
+ Size = UDim2.fromOffset(theme.components.accordion.header.indicatorSize, theme.components.accordion.header.indicatorSize),
110
+ AnchorPoint = Vector2.new(0.5, 0.5),
111
+ Rotation = rotation,
112
+ }))))
113
+ end
114
+ local function RenderedAccordionItem(props)
115
+ local theme = React.useContext(CleanThemeContext)
116
+ local mounted, setMounted = React.useState(props.open)
117
+ local height, heightTween = useTween(0, {
118
+ duration = props.duration,
119
+ })
120
+ React.useEffect(function()
121
+ if props.open then
122
+ setMounted(true)
123
+ else
124
+ heightTween:setGoal(0, {
125
+ duration = props.duration,
126
+ })
127
+ if props.duration == 0 then
128
+ heightTween:setPosition(0)
129
+ end
130
+ heightTween:start()
131
+ if props.duration == 0 then
132
+ setMounted(false)
133
+ end
134
+ end
135
+ end, { props.duration, props.open, heightTween })
136
+ React.useEffect(function()
137
+ if props.duration == 0 then
138
+ heightTween:setPosition(heightTween:getGoal())
139
+ end
140
+ end, { props.duration, heightTween })
141
+ React.useEffect(function()
142
+ return heightTween:onComplete(function(value)
143
+ if value == 0 and not props.open then
144
+ setMounted(false)
145
+ end
146
+ end)
147
+ end, { heightTween, props.open })
148
+ local defaultColors = ColorHelper:getIntentColors(theme, "primary", if props.disabled then "disabled" else "default", theme.components.accordion.header.intents)
149
+ local hoverColors = ColorHelper:getIntentColors(theme, "primary", "hover", theme.components.accordion.header.intents)
150
+ local focusColors = ColorHelper:getIntentColors(theme, "primary", "focus", theme.components.accordion.header.intents)
151
+ local _condition = not props.first
152
+ if _condition then
153
+ local _attributes = {
154
+ BackgroundColor3 = theme.components.accordion.borderColor,
155
+ BackgroundTransparency = 0,
156
+ BorderSizePixel = 0,
157
+ }
158
+ local _exp = UDim2.fromOffset(0, theme.components.accordion.borderThickness)
159
+ local _arg0 = UDim2.fromScale(1, 0)
160
+ _attributes.Size = _exp + _arg0
161
+ _condition = (React.createElement("frame", _attributes))
162
+ end
163
+ local _attributes = {
164
+ isSelected = props.open,
165
+ }
166
+ local _object = {
167
+ Active = not props.disabled and (props.content ~= nil or props.contentText ~= nil),
168
+ Selectable = not props.disabled and (props.content ~= nil or props.contentText ~= nil),
169
+ AutoButtonColor = false,
170
+ AutomaticSize = Enum.AutomaticSize.Y,
171
+ Size = UDim2.fromScale(1, 0),
172
+ ImageTransparency = 1,
173
+ BackgroundColor3 = defaultColors.backgroundColor,
174
+ }
175
+ local _left = "BackgroundTransparency"
176
+ local _condition_1 = defaultColors.backgroundTransparency
177
+ if _condition_1 == nil then
178
+ _condition_1 = 0
179
+ end
180
+ _object[_left] = _condition_1
181
+ _object.BorderSizePixel = 0
182
+ _object.Event = {
183
+ Activated = props.onActivate,
184
+ }
185
+ _attributes.default = _object
186
+ local _object_1 = {
187
+ BackgroundColor3 = hoverColors.backgroundColor,
188
+ }
189
+ local _left_1 = "BackgroundTransparency"
190
+ local _condition_2 = hoverColors.backgroundTransparency
191
+ if _condition_2 == nil then
192
+ _condition_2 = 0
193
+ end
194
+ _object_1[_left_1] = _condition_2
195
+ _attributes.hover = _object_1
196
+ local _object_2 = {
197
+ BackgroundColor3 = focusColors.backgroundColor,
198
+ }
199
+ local _left_2 = "BackgroundTransparency"
200
+ local _condition_3 = focusColors.backgroundTransparency
201
+ if _condition_3 == nil then
202
+ _condition_3 = 0
203
+ end
204
+ _object_2[_left_2] = _condition_3
205
+ _attributes.focus = _object_2
206
+ return React.createElement(Container, {
207
+ width = "100%",
208
+ }, React.createElement(VStack, {
209
+ spacing = "None",
210
+ }, _condition, React.createElement(HoverButton, _attributes, props.first and (React.createElement("uicorner", {
211
+ TopLeftRadius = SizeHelper:toUDim(theme.components.accordion.cornerRadius),
212
+ TopRightRadius = SizeHelper:toUDim(theme.components.accordion.cornerRadius),
213
+ BottomLeftRadius = UDim.new(0, 0),
214
+ BottomRightRadius = UDim.new(0, 0),
215
+ })), React.createElement(AccordionHeaderVisual, {
216
+ header = props.header,
217
+ disabled = props.disabled,
218
+ duration = props.duration,
219
+ open = props.open,
220
+ })), mounted and (React.createElement("frame", {
221
+ BackgroundTransparency = 1,
222
+ ClipsDescendants = true,
223
+ Size = height:map(function(value)
224
+ local _exp = UDim2.fromScale(1, 0)
225
+ local _arg0 = UDim2.fromOffset(0, value)
226
+ return _exp + _arg0
227
+ end),
228
+ }, React.createElement("frame", {
229
+ BackgroundColor3 = theme.components.accordion.content.backgroundColor,
230
+ BackgroundTransparency = theme.components.accordion.content.backgroundTransparency,
231
+ Size = UDim2.fromScale(1, 0),
232
+ AutomaticSize = Enum.AutomaticSize.Y,
233
+ Change = {
234
+ AbsoluteSize = function(instance)
235
+ if props.open then
236
+ heightTween:setGoal(instance.AbsoluteSize.Y, {
237
+ duration = props.duration,
238
+ })
239
+ if props.duration == 0 then
240
+ heightTween:setPosition(instance.AbsoluteSize.Y)
241
+ end
242
+ heightTween:start()
243
+ end
244
+ end,
245
+ },
246
+ }, React.createElement(Padding, {
247
+ resolvedPadding = SpacingHelper:GetResolvedPadding(theme, {}, theme.components.accordion.content.spacing),
248
+ }), if props.contentText ~= nil then React.createElement(Text, {
249
+ text = props.contentText,
250
+ }) else props.content)))))
251
+ end
252
+ local Accordion = React.forwardRef(function(props, ref)
253
+ local theme = React.useContext(CleanThemeContext)
254
+ local items = React.useMemo(function()
255
+ local parsed = {}
256
+ local seen = {}
257
+ React.Children.forEach(props.children, function(child)
258
+ if not React.isValidElement(child) or child.type ~= AccordionItem then
259
+ return nil
260
+ end
261
+ local item = child
262
+ local _value = item.props.value
263
+ if seen[_value] ~= nil then
264
+ return nil
265
+ end
266
+ local header
267
+ local contentText
268
+ local content
269
+ React.Children.forEach(item.props.children, function(itemChild)
270
+ if not React.isValidElement(itemChild) then
271
+ return nil
272
+ end
273
+ if itemChild.type == AccordionHeader and header == nil then
274
+ header = itemChild.props
275
+ end
276
+ if itemChild.type == AccordionContent and content == nil then
277
+ local contentProps = itemChild.props
278
+ contentText = contentProps.text
279
+ content = contentProps.children
280
+ end
281
+ end)
282
+ if header ~= nil then
283
+ local _value_1 = item.props.value
284
+ seen[_value_1] = true
285
+ local _object = {
286
+ value = item.props.value,
287
+ }
288
+ local _left = "disabled"
289
+ local _condition = item.props.disabled
290
+ if _condition == nil then
291
+ _condition = false
292
+ end
293
+ _object[_left] = _condition
294
+ _object.header = header
295
+ _object.contentText = contentText
296
+ _object.content = content
297
+ table.insert(parsed, _object)
298
+ end
299
+ end)
300
+ return parsed
301
+ end, { props.children })
302
+ local initial = if props.defaultValue ~= nil then { props.defaultValue } else {}
303
+ local uncontrolled, setUncontrolled = React.useState(initial)
304
+ local supplied = if props.value ~= nil then { props.value } else uncontrolled
305
+ local _set = {}
306
+ -- ▼ ReadonlyArray.map ▼
307
+ local _newValue = table.create(#items)
308
+ local _callback = function(item)
309
+ return item.value
310
+ end
311
+ for _k, _v in items do
312
+ _newValue[_k] = _callback(_v, _k - 1, items)
313
+ end
314
+ -- ▲ ReadonlyArray.map ▲
315
+ for _, _v in _newValue do
316
+ _set[_v] = true
317
+ end
318
+ local available = _set
319
+ -- ▼ ReadonlyArray.filter ▼
320
+ local _newValue_1 = {}
321
+ local _callback_1 = function(value)
322
+ local _value = value
323
+ return available[_value] ~= nil
324
+ end
325
+ local _length = 0
326
+ for _k, _v in supplied do
327
+ if _callback_1(_v, _k - 1, supplied) == true then
328
+ _length += 1
329
+ _newValue_1[_length] = _v
330
+ end
331
+ end
332
+ -- ▲ ReadonlyArray.filter ▲
333
+ local openValues = _newValue_1
334
+ React.useEffect(function()
335
+ local _condition = props.value == nil
336
+ if _condition then
337
+ local _condition_1 = #uncontrolled ~= #openValues
338
+ if not _condition_1 then
339
+ -- ▼ ReadonlyArray.some ▼
340
+ local _result = false
341
+ local _callback_2 = function(value)
342
+ local _value = value
343
+ return not (available[_value] ~= nil)
344
+ end
345
+ for _k, _v in uncontrolled do
346
+ if _callback_2(_v, _k - 1, uncontrolled) then
347
+ _result = true
348
+ break
349
+ end
350
+ end
351
+ -- ▲ ReadonlyArray.some ▲
352
+ _condition_1 = _result
353
+ end
354
+ _condition = _condition_1
355
+ end
356
+ if _condition then
357
+ setUncontrolled(openValues)
358
+ end
359
+ end, { items, props.value })
360
+ local activate = function(item)
361
+ if item.disabled or (item.content == nil and item.contentText == nil) then
362
+ return nil
363
+ end
364
+ local _value = item.value
365
+ local isOpen = table.find(openValues, _value) ~= nil
366
+ local nextValues
367
+ if isOpen then
368
+ if not props.collapsible then
369
+ return nil
370
+ end
371
+ nextValues = {}
372
+ else
373
+ nextValues = { item.value }
374
+ end
375
+ if props.value == nil then
376
+ setUncontrolled(nextValues)
377
+ end
378
+ local _result = props.onValueChange
379
+ if _result ~= nil then
380
+ _result(nextValues[1])
381
+ end
382
+ end
383
+ local _exp = React.createElement(Corners, {
384
+ radius = theme.components.accordion.cornerRadius,
385
+ })
386
+ local _exp_1 = React.createElement("uistroke", {
387
+ Color = theme.components.accordion.borderColor,
388
+ Thickness = theme.components.accordion.borderThickness,
389
+ BorderStrokePosition = Enum.BorderStrokePosition.Outer,
390
+ })
391
+ -- ▼ ReadonlyArray.map ▼
392
+ local _newValue_2 = table.create(#items)
393
+ local _callback_2 = function(item, index)
394
+ local _attributes = {
395
+ key = item.value,
396
+ }
397
+ for _k, _v in item do
398
+ _attributes[_k] = _v
399
+ end
400
+ _attributes.first = index == 0
401
+ local _value = item.value
402
+ _attributes.open = table.find(openValues, _value) ~= nil
403
+ local _condition = props.animationDuration
404
+ if _condition == nil then
405
+ _condition = theme.components.accordion.animation.duration
406
+ end
407
+ _attributes.duration = _condition
408
+ _attributes.onActivate = function()
409
+ return activate(item)
410
+ end
411
+ return React.createElement(RenderedAccordionItem, _attributes)
412
+ end
413
+ for _k, _v in items do
414
+ _newValue_2[_k] = _callback_2(_v, _k - 1, items)
415
+ end
416
+ -- ▲ ReadonlyArray.map ▲
417
+ return React.createElement(Container, {
418
+ ref = ref,
419
+ width = "100%",
420
+ height = "100%",
421
+ ClipsDescendants = true,
422
+ }, _exp, _exp_1, React.createElement(VStack, {
423
+ Padding = UDim.new(0, SpacingHelper:GetPadding(theme, props.scale, theme.components.accordion.spacing)),
424
+ }, _newValue_2))
425
+ end)
426
+ Accordion.Item = AccordionItem
427
+ Accordion.Header = AccordionHeader
428
+ Accordion.Content = AccordionContent
429
+ return {
430
+ Accordion = Accordion,
431
+ }
@@ -1,6 +1,8 @@
1
1
  import React from "@rbxts/react";
2
2
  import { PositionElementProps, SizeElementProps, ZIndexElementProps } from "../../Interfaces/";
3
- export interface ContainerProps extends SizeElementProps, PositionElementProps, ZIndexElementProps, React.InstanceProps<Frame> {
3
+ import { CssBackgroundImage } from "../../Theme";
4
+ export interface ContainerProps extends SizeElementProps, PositionElementProps, ZIndexElementProps, React.InstanceProps<ImageLabel> {
4
5
  group?: boolean;
6
+ backgroundImage?: Partial<CssBackgroundImage>;
5
7
  }
6
- export declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<Frame>>;
8
+ export declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<ImageLabel>>;
@@ -1,19 +1,25 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
- local SizeHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SizeHelper
4
+ local _ = TS.import(script, script.Parent.Parent.Parent, "Helpers")
5
+ local SizeHelper = _.SizeHelper
6
+ local CssHelper = _.CssHelper
5
7
  local _Group = TS.import(script, script.Parent, "Group")
6
8
  local Group = _Group.Group
7
9
  local GroupContext = _Group.GroupContext
8
10
  local Container = React.forwardRef(function(props, ref)
9
11
  local group = React.useContext(GroupContext)
12
+ local autoSize = SizeHelper:GetAutoSize(props)
13
+ local isAutoSizeActive = autoSize ~= Enum.AutomaticSize.None and autoSize ~= "None"
14
+ local centerViaLayout = props.center == true and props.Position == nil and props.AnchorPoint == nil and isAutoSizeActive
15
+ local backgroundImage = CssHelper:resolveBackgroundImage(props.backgroundImage)
10
16
  local _attributes = {
11
17
  ref = ref,
12
18
  Archivable = props.Archivable,
13
19
  Tag = props.Tag,
14
20
  Active = props.Active,
15
- AnchorPoint = SizeHelper:GetAnchor(props),
16
- AutomaticSize = SizeHelper:GetAutoSize(props),
21
+ AnchorPoint = if centerViaLayout then Vector2.zero else SizeHelper:GetAnchor(props),
22
+ AutomaticSize = autoSize,
17
23
  BackgroundColor3 = props.BackgroundColor3,
18
24
  }
19
25
  local _condition = props.BackgroundTransparency
@@ -31,7 +37,7 @@ local Container = React.forwardRef(function(props, ref)
31
37
  _attributes.NextSelectionLeft = props.NextSelectionLeft
32
38
  _attributes.NextSelectionRight = props.NextSelectionRight
33
39
  _attributes.NextSelectionUp = props.NextSelectionUp
34
- _attributes.Position = SizeHelper:GetPosition(props)
40
+ _attributes.Position = if centerViaLayout then UDim2.fromOffset(0, 0) else SizeHelper:GetPosition(props)
35
41
  _attributes.Rotation = props.Rotation
36
42
  _attributes.Selectable = props.Selectable
37
43
  _attributes.SelectionGroup = props.SelectionGroup
@@ -61,12 +67,31 @@ local Container = React.forwardRef(function(props, ref)
61
67
  _attributes.ZIndex = props.ZIndex
62
68
  _attributes.AutoLocalize = props.AutoLocalize
63
69
  _attributes.RootLocalizationTable = props.RootLocalizationTable
64
- _attributes.Style = props.Style
70
+ _attributes.Image = backgroundImage.Image
71
+ _attributes.ImageColor3 = backgroundImage.ImageColor3
72
+ _attributes.ImageTransparency = backgroundImage.ImageTransparency
73
+ _attributes.ScaleType = backgroundImage.ScaleType
74
+ _attributes.SliceCenter = backgroundImage.SliceCenter
75
+ _attributes.SliceScale = backgroundImage.SliceScale
76
+ _attributes.TileSize = backgroundImage.TileSize
65
77
  _attributes.Change = props.Change
66
78
  _attributes.Event = props.Event
67
- return React.createElement("frame", _attributes, React.createElement(Group.Element, {
79
+ local content = (React.createElement("imagelabel", _attributes, React.createElement(Group.Element, {
68
80
  enabled = props.group,
69
- }, props.children))
81
+ }, props.children)))
82
+ if not centerViaLayout then
83
+ return content
84
+ end
85
+ return React.createElement("frame", {
86
+ Size = UDim2.fromScale(1, 1),
87
+ BackgroundTransparency = 1,
88
+ ZIndex = props.ZIndex,
89
+ LayoutOrder = props.LayoutOrder,
90
+ }, React.createElement("uilistlayout", {
91
+ FillDirection = Enum.FillDirection.Horizontal,
92
+ HorizontalAlignment = Enum.HorizontalAlignment.Center,
93
+ VerticalAlignment = Enum.VerticalAlignment.Center,
94
+ }), content)
70
95
  end)
71
96
  return {
72
97
  Container = Container,
@@ -12,7 +12,7 @@ local DraggableContext = _Contexts.DraggableContext
12
12
  local OverlayConsumer = _Contexts.OverlayConsumer
13
13
  local createPortal = TS.import(script, TS.getModule(script, "@rbxts", "react-roblox")).createPortal
14
14
  local Corners = TS.import(script, script.Parent.Parent, "Decorator").Corners
15
- local CustomInputService = TS.import(script, script.Parent.Parent.Parent, "Interfaces").CustomInputService
15
+ local CustomInputService = TS.import(script, script.Parent.Parent.Parent, "Helpers").CustomInputService
16
16
  local function DragHandle(_param)
17
17
  local children = _param.children
18
18
  local draggable = React.useContext(DraggableContext)
@@ -16,7 +16,7 @@ interface FieldsetSlotProps {
16
16
  }
17
17
  declare function FieldsetLabel(props: FieldsetSlotProps): React.JSX.Element;
18
18
  declare function FieldsetControl(props: FieldsetSlotProps): React.JSX.Element;
19
- type FieldsetComponent = React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<Frame>> & {
19
+ type FieldsetComponent = React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<ImageLabel>> & {
20
20
  Label: typeof FieldsetLabel;
21
21
  Control: typeof FieldsetControl;
22
22
  };
@@ -6,6 +6,7 @@ interface FlexItemProps extends ContainerProps {
6
6
  mode?: Enum.UIFlexMode | "Grow" | "None" | "Shrink" | "Fill" | "Custom" | Binding<Enum.UIFlexMode>;
7
7
  GrowRatio?: number;
8
8
  ShrinkRatio?: number;
9
+ HorizontalFlex?: Enum.UIFlexAlignment | "None" | "SpaceAround" | "Fill" | Binding<Enum.UIFlexAlignment>;
9
10
  }
10
- export declare const FlexItem: React.ForwardRefExoticComponent<Omit<FlexItemProps, "ref"> & React.RefAttributes<Frame>>;
11
+ export declare const FlexItem: React.ForwardRefExoticComponent<Omit<FlexItemProps, "ref"> & React.RefAttributes<ImageLabel>>;
11
12
  export {};
@@ -11,6 +11,7 @@ local FlexItem = React.forwardRef(function(props, ref)
11
11
  GrowRatio = props.GrowRatio,
12
12
  ShrinkRatio = props.ShrinkRatio,
13
13
  }), React.createElement("uilistlayout", {
14
+ HorizontalFlex = props.HorizontalFlex,
14
15
  FillDirection = Enum.FillDirection.Horizontal,
15
16
  HorizontalAlignment = props.align,
16
17
  }), props.children)
@@ -1,4 +1,4 @@
1
- import React from "@rbxts/react";
1
+ import React, { Binding } from "@rbxts/react";
2
2
  import { SpacedElementProps } from "../../Interfaces";
3
3
  interface HStackProps extends SpacedElementProps {
4
4
  children?: React.ReactNode;
@@ -7,6 +7,7 @@ interface HStackProps extends SpacedElementProps {
7
7
  HorizontalFlex?: Enum.UIFlexAlignment;
8
8
  Event?: React.InstanceEvent<UIListLayout>;
9
9
  Change?: React.InstanceChangeEvent<UIListLayout>;
10
+ Padding?: UDim | Binding<UDim>;
10
11
  }
11
12
  export declare function HStack(props: HStackProps): React.JSX.Element;
12
13
  export {};
@@ -5,12 +5,11 @@ local CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contex
5
5
  local SpacingHelper = TS.import(script, script.Parent.Parent.Parent, "Helpers").SpacingHelper
6
6
  local function HStack(props)
7
7
  local theme = React.useContext(CleanThemeContext)
8
- local padding = UDim.new(0, math.ceil(SpacingHelper:GetPadding(theme, props.spacing) / 2))
9
8
  return React.createElement(React.Fragment, nil, React.createElement("uilistlayout", {
10
9
  FillDirection = Enum.FillDirection.Horizontal,
11
10
  HorizontalFlex = props.HorizontalFlex,
12
11
  VerticalAlignment = props.valign,
13
- Padding = padding,
12
+ Padding = props.Padding or UDim.new(0, math.ceil(SpacingHelper:GetPadding(theme, props.spacing) / 2)),
14
13
  Wraps = if props.Wraps == nil then true else props.Wraps,
15
14
  Change = props.Change,
16
15
  Event = props.Event,
@@ -2,6 +2,7 @@ import React from "@rbxts/react";
2
2
  import { PositionElementProps, SizeElementProps, SpacedElementProps } from "../../Interfaces";
3
3
  interface ScrollerProps extends SizeElementProps, SpacedElementProps, PositionElementProps {
4
4
  children?: React.ReactNode;
5
+ AutomaticSizeParent?: boolean;
5
6
  }
6
7
  export declare function Scroller(props: ScrollerProps): React.JSX.Element;
7
8
  export {};
@@ -41,7 +41,7 @@ local function Scroller(props)
41
41
  ScrollBarThickness = thickness,
42
42
  VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
43
43
  AutomaticCanvasSize = Enum.AutomaticSize.Y,
44
- }, React.createElement("uilistlayout", {
44
+ }, props.AutomaticSizeParent and React.createElement("uilistlayout", {
45
45
  FillDirection = Enum.FillDirection.Horizontal,
46
46
  }), React.createElement("frame", {
47
47
  Size = UDim2.new(1, if isScrolling then -thickness - spacing else 0, 0, 0),
@@ -14,7 +14,7 @@ interface TabContentProps {
14
14
  declare function TabContent(props: TabContentProps): undefined;
15
15
  interface TabsProps extends ScalableElementProps {
16
16
  }
17
- type TabsComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<Frame>> & {
17
+ type TabsComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<ImageLabel>> & {
18
18
  Tab: typeof Tab;
19
19
  Title: typeof TabTitle;
20
20
  Content: typeof TabContent;