@rbxts/react-clean-ui 1.1.0 → 1.2.4
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 -6
- 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/Gradient.d.ts +8 -0
- package/out/Components/Decorator/Gradient.luau +23 -0
- package/out/Components/Decorator/Padding.d.ts +3 -1
- package/out/Components/Decorator/Padding.luau +11 -6
- package/out/Components/Decorator/index.d.ts +1 -0
- package/out/Components/Decorator/init.luau +3 -0
- package/out/Components/Input/Button.d.ts +1 -0
- package/out/Components/Input/Button.luau +49 -34
- package/out/Components/Input/Checkbox.d.ts +1 -0
- package/out/Components/Input/Checkbox.luau +28 -18
- package/out/Components/Input/HoverButton.d.ts +1 -0
- package/out/Components/Input/HoverButton.luau +44 -42
- 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 +89 -68
- package/out/Components/Input/Select.d.ts +11 -1
- package/out/Components/Input/Select.luau +315 -39
- package/out/Components/Input/Slider.luau +44 -53
- package/out/Components/Input/Switch.d.ts +9 -0
- package/out/Components/Input/Switch.luau +145 -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 +262 -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 -25
- 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 +3 -0
- package/out/Components/Layout/Container.luau +26 -17
- 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/Grid.d.ts +10 -0
- package/out/Components/Layout/Grid.luau +172 -0
- package/out/Components/Layout/Group.d.ts +1 -0
- package/out/Components/Layout/Group.luau +48 -60
- 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 +400 -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 +20 -10
- package/out/Components/Layout/Tabs.luau +113 -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 +3 -0
- package/out/Components/Layout/init.luau +9 -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 +3 -1
- package/out/Components/Surface/Box.luau +15 -4
- package/out/Components/Surface/Card.d.ts +1 -0
- package/out/Components/Surface/Card.luau +56 -154
- package/out/Components/Surface/Icon.d.ts +1 -0
- package/out/Components/Surface/Icon.luau +25 -16
- package/out/Components/Surface/ProgressBar.d.ts +14 -0
- package/out/Components/Surface/ProgressBar.luau +230 -0
- package/out/Components/Surface/index.d.ts +1 -0
- package/out/Components/Surface/init.luau +3 -0
- package/out/Components/Typography/Text.d.ts +1 -0
- package/out/Components/Typography/Text.luau +57 -53
- 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 +23 -0
- package/out/Contexts/toast.context.d.ts +1 -0
- package/out/Helpers/color.helper.luau +28 -0
- package/out/Helpers/css.helper.d.ts +4 -1
- package/out/Helpers/css.helper.luau +76 -6
- package/out/Helpers/gui.helper.luau +0 -3
- package/out/Helpers/size.helper.luau +0 -2
- package/out/Helpers/spacing.helper.luau +0 -3
- package/out/Helpers/typography.helper.luau +0 -2
- package/out/Interfaces/css.types.d.ts +7 -0
- package/out/Interfaces/css.types.luau +0 -20
- 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/Providers/registry.provider.luau +0 -2
- package/out/Theme/theme.style.d.ts +2 -1
- package/out/Theme/theme.template.d.ts +126 -1
- package/out/Theme/themes/dark.theme.luau +225 -0
- package/out/Theme/themes/default.theme.luau +210 -0
- package/out/Theme/themes/sandstone.theme.luau +173 -0
- package/out/Theme/themes/wooden.theme.luau +195 -0
- package/package.json +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
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 CleanThemeContext = TS.import(script, script.Parent.Parent.Parent, "Contexts").CleanThemeContext
|
|
5
|
+
local _ = TS.import(script, script.Parent.Parent.Parent, "Helpers")
|
|
6
|
+
local BreakpointHelper = _.BreakpointHelper
|
|
7
|
+
local SizeHelper = _.SizeHelper
|
|
8
|
+
local SpacingHelper = _.SpacingHelper
|
|
9
|
+
local SETTLE_POLL_FRAMES = 10
|
|
10
|
+
local function GridCell(props)
|
|
11
|
+
local measurementRef = React.useRef()
|
|
12
|
+
local reportMeasurement = React.useCallback(function()
|
|
13
|
+
local instance = measurementRef.current
|
|
14
|
+
if instance ~= nil then
|
|
15
|
+
props.onMeasured(props.measureKey, props.index, instance.AbsoluteSize.Y)
|
|
16
|
+
end
|
|
17
|
+
end, { props.onMeasured, props.measureKey, props.index })
|
|
18
|
+
React.useEffect(function()
|
|
19
|
+
if props.locked then
|
|
20
|
+
return nil
|
|
21
|
+
end
|
|
22
|
+
local mounted = true
|
|
23
|
+
reportMeasurement()
|
|
24
|
+
task.spawn(function()
|
|
25
|
+
for frame = 0, SETTLE_POLL_FRAMES - 1 do
|
|
26
|
+
task.wait()
|
|
27
|
+
if not mounted then
|
|
28
|
+
return nil
|
|
29
|
+
end
|
|
30
|
+
reportMeasurement()
|
|
31
|
+
end
|
|
32
|
+
end)
|
|
33
|
+
return function()
|
|
34
|
+
mounted = false
|
|
35
|
+
end
|
|
36
|
+
end, { props.locked, props.measureKey, reportMeasurement })
|
|
37
|
+
return React.createElement("frame", {
|
|
38
|
+
key = "GridCell",
|
|
39
|
+
ref = measurementRef,
|
|
40
|
+
LayoutOrder = props.index,
|
|
41
|
+
Size = UDim2.new(props.width, UDim.new(0, if props.locked then props.height else 0)),
|
|
42
|
+
AutomaticSize = if props.locked then Enum.AutomaticSize.None else Enum.AutomaticSize.Y,
|
|
43
|
+
BackgroundTransparency = 1,
|
|
44
|
+
ClipsDescendants = true,
|
|
45
|
+
Change = if props.locked then nil else {
|
|
46
|
+
AbsoluteSize = reportMeasurement,
|
|
47
|
+
},
|
|
48
|
+
}, props.children)
|
|
49
|
+
end
|
|
50
|
+
local Grid = React.forwardRef(function(props, ref)
|
|
51
|
+
local theme = React.useContext(CleanThemeContext)
|
|
52
|
+
local width, setWidth = React.useState(0)
|
|
53
|
+
local heights, setHeights = React.useState({
|
|
54
|
+
key = "",
|
|
55
|
+
values = {},
|
|
56
|
+
})
|
|
57
|
+
local lock, setLock = React.useState(nil)
|
|
58
|
+
local breakpoints = props.breakpoints or theme.breakpoints
|
|
59
|
+
local breakpoint = BreakpointHelper:getBreakpoint(width, breakpoints)
|
|
60
|
+
local _condition = SizeHelper:resolveResponsiveValue(props.cols, breakpoint)
|
|
61
|
+
if _condition == nil then
|
|
62
|
+
_condition = 1
|
|
63
|
+
end
|
|
64
|
+
local cols = math.max(_condition, 1)
|
|
65
|
+
local gap = SpacingHelper:GetPadding(theme, props.gap)
|
|
66
|
+
local cellWidthScale = 1 / cols
|
|
67
|
+
local cellWidthOffset = math.floor(-gap * (cols - 1) / cols)
|
|
68
|
+
local cellWidth = UDim.new(cellWidthScale, cellWidthOffset)
|
|
69
|
+
local childCount = React.Children.count(props.children)
|
|
70
|
+
local measureKey = `{width}:{cols}:{gap}:{childCount}`
|
|
71
|
+
local locked = lock ~= nil and lock.key == measureKey
|
|
72
|
+
local lockedHeight = if locked then lock.height else 0
|
|
73
|
+
React.useEffect(function()
|
|
74
|
+
local _condition_1 = locked or heights.key ~= measureKey
|
|
75
|
+
if not _condition_1 then
|
|
76
|
+
-- ▼ ReadonlyMap.size ▼
|
|
77
|
+
local _size = 0
|
|
78
|
+
for _1 in heights.values do
|
|
79
|
+
_size += 1
|
|
80
|
+
end
|
|
81
|
+
-- ▲ ReadonlyMap.size ▲
|
|
82
|
+
_condition_1 = _size < childCount
|
|
83
|
+
end
|
|
84
|
+
if _condition_1 then
|
|
85
|
+
return nil
|
|
86
|
+
end
|
|
87
|
+
local cancelled = false
|
|
88
|
+
task.spawn(function()
|
|
89
|
+
task.wait()
|
|
90
|
+
task.wait()
|
|
91
|
+
if cancelled then
|
|
92
|
+
return nil
|
|
93
|
+
end
|
|
94
|
+
local max = 0
|
|
95
|
+
for _1, height in heights.values do
|
|
96
|
+
max = math.max(max, height)
|
|
97
|
+
end
|
|
98
|
+
setLock({
|
|
99
|
+
key = measureKey,
|
|
100
|
+
height = max,
|
|
101
|
+
})
|
|
102
|
+
end)
|
|
103
|
+
return function()
|
|
104
|
+
cancelled = true
|
|
105
|
+
end
|
|
106
|
+
end, { heights, locked, measureKey, childCount })
|
|
107
|
+
local reportHeight = React.useCallback(function(reportKey, index, height)
|
|
108
|
+
setHeights(function(current)
|
|
109
|
+
local values = if current.key == reportKey then current.values else {}
|
|
110
|
+
local updated = {}
|
|
111
|
+
for key, value in values do
|
|
112
|
+
updated[key] = value
|
|
113
|
+
end
|
|
114
|
+
local _index = index
|
|
115
|
+
local _height = height
|
|
116
|
+
updated[_index] = _height
|
|
117
|
+
return {
|
|
118
|
+
key = reportKey,
|
|
119
|
+
values = updated,
|
|
120
|
+
}
|
|
121
|
+
end)
|
|
122
|
+
end, {})
|
|
123
|
+
local cellIndex = 0
|
|
124
|
+
local _attributes = {}
|
|
125
|
+
local _condition_1 = props.name
|
|
126
|
+
if _condition_1 == nil then
|
|
127
|
+
_condition_1 = "Grid"
|
|
128
|
+
end
|
|
129
|
+
_attributes.key = _condition_1
|
|
130
|
+
_attributes.ref = ref
|
|
131
|
+
_attributes.Size = SizeHelper:GetSize(props, UDim2.fromScale(1, 1))
|
|
132
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
133
|
+
_attributes.BackgroundTransparency = 1
|
|
134
|
+
_attributes.Change = {
|
|
135
|
+
AbsoluteSize = function(instance)
|
|
136
|
+
local nextWidth = instance.AbsoluteSize.X
|
|
137
|
+
setWidth(function(currentWidth)
|
|
138
|
+
return if currentWidth == nextWidth then currentWidth else nextWidth
|
|
139
|
+
end)
|
|
140
|
+
end,
|
|
141
|
+
}
|
|
142
|
+
return React.createElement("frame", _attributes, if locked then (React.createElement("uigridlayout", {
|
|
143
|
+
key = "GridLayout",
|
|
144
|
+
CellSize = UDim2.new(cellWidthScale, cellWidthOffset, 0, lockedHeight),
|
|
145
|
+
CellPadding = UDim2.new(0, gap, 0, gap),
|
|
146
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
147
|
+
FillDirectionMaxCells = cols,
|
|
148
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
149
|
+
})) else (React.createElement("uilistlayout", {
|
|
150
|
+
key = "GridMeasureLayout",
|
|
151
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
152
|
+
Wraps = true,
|
|
153
|
+
Padding = UDim.new(0, gap),
|
|
154
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
155
|
+
})), React.Children.map(props.children, function(child)
|
|
156
|
+
local _original = cellIndex
|
|
157
|
+
cellIndex += 1
|
|
158
|
+
local index = _original
|
|
159
|
+
return React.createElement(GridCell, {
|
|
160
|
+
key = index,
|
|
161
|
+
index = index,
|
|
162
|
+
width = cellWidth,
|
|
163
|
+
height = lockedHeight,
|
|
164
|
+
locked = locked,
|
|
165
|
+
measureKey = measureKey,
|
|
166
|
+
onMeasured = reportHeight,
|
|
167
|
+
}, child)
|
|
168
|
+
end))
|
|
169
|
+
end)
|
|
170
|
+
return {
|
|
171
|
+
Grid = Grid,
|
|
172
|
+
}
|
|
@@ -11,6 +11,7 @@ interface GroupElementProps {
|
|
|
11
11
|
enabled?: boolean;
|
|
12
12
|
padding?: ResolvedPadding;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
+
name?: string;
|
|
14
15
|
}
|
|
15
16
|
declare function GroupElement(props: GroupElementProps): boolean | ReadonlyMap<React.Key, React.ReactNode> | {
|
|
16
17
|
readonly [key: string]: React.ReactNode;
|
|
@@ -1,27 +1,32 @@
|
|
|
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
|
-
-- import { HttpService } from "@rbxts/services";
|
|
5
4
|
local RegistryContext = TS.import(script, script.Parent.Parent.Parent, "Providers").RegistryContext
|
|
6
5
|
local GroupContext = React.createContext(nil)
|
|
6
|
+
local nextFallbackElementId = 0
|
|
7
7
|
local function GroupElement(props)
|
|
8
8
|
local registry = React.useContext(RegistryContext)
|
|
9
9
|
local context = React.useContext(GroupContext)
|
|
10
|
-
local
|
|
11
|
-
if
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
local idRef = React.useRef()
|
|
11
|
+
if idRef.current == nil then
|
|
12
|
+
nextFallbackElementId += 1
|
|
13
|
+
local _result = registry
|
|
14
|
+
if _result ~= nil then
|
|
15
|
+
_result = _result.GetNextId()
|
|
16
|
+
end
|
|
17
|
+
local _condition = _result
|
|
18
|
+
if _condition == nil then
|
|
19
|
+
_condition = `group-element-{nextFallbackElementId}`
|
|
20
|
+
end
|
|
21
|
+
idRef.current = _condition
|
|
17
22
|
end
|
|
18
|
-
local id =
|
|
23
|
+
local id = idRef.current
|
|
19
24
|
local enabled = props.enabled == true and context ~= nil
|
|
20
25
|
local _exp = function()
|
|
21
26
|
if not enabled then
|
|
22
|
-
local
|
|
23
|
-
if
|
|
24
|
-
|
|
27
|
+
local _result = context
|
|
28
|
+
if _result ~= nil then
|
|
29
|
+
_result.removeElement(id)
|
|
25
30
|
end
|
|
26
31
|
return nil
|
|
27
32
|
end
|
|
@@ -29,79 +34,62 @@ local function GroupElement(props)
|
|
|
29
34
|
context.removeElement(id)
|
|
30
35
|
end
|
|
31
36
|
end
|
|
32
|
-
local
|
|
37
|
+
local _result = context
|
|
38
|
+
if _result ~= nil then
|
|
39
|
+
_result = _result.removeElement
|
|
40
|
+
end
|
|
41
|
+
React.useEffect(_exp, { enabled, _result })
|
|
42
|
+
if not enabled then
|
|
43
|
+
return props.children
|
|
44
|
+
end
|
|
45
|
+
local _result_1 = props.padding
|
|
33
46
|
if _result_1 ~= nil then
|
|
34
|
-
_result_1 = _result_1.
|
|
47
|
+
_result_1 = _result_1.left
|
|
48
|
+
end
|
|
49
|
+
local _condition = _result_1
|
|
50
|
+
if _condition == nil then
|
|
51
|
+
_condition = 0
|
|
35
52
|
end
|
|
36
|
-
React.useEffect(_exp, { enabled, _result_1 })
|
|
37
|
-
local elementRef = React.useRef()
|
|
38
53
|
local _result_2 = props.padding
|
|
39
54
|
if _result_2 ~= nil then
|
|
40
|
-
_result_2 = _result_2.
|
|
55
|
+
_result_2 = _result_2.right
|
|
41
56
|
end
|
|
42
57
|
local _condition_1 = _result_2
|
|
43
58
|
if _condition_1 == nil then
|
|
44
59
|
_condition_1 = 0
|
|
45
60
|
end
|
|
61
|
+
local horizontalPadding = _condition + _condition_1
|
|
46
62
|
local _result_3 = props.padding
|
|
47
63
|
if _result_3 ~= nil then
|
|
48
|
-
_result_3 = _result_3.
|
|
64
|
+
_result_3 = _result_3.top
|
|
49
65
|
end
|
|
50
66
|
local _condition_2 = _result_3
|
|
51
67
|
if _condition_2 == nil then
|
|
52
68
|
_condition_2 = 0
|
|
53
69
|
end
|
|
54
|
-
local horizontalPadding = _condition_1 + _condition_2
|
|
55
70
|
local _result_4 = props.padding
|
|
56
71
|
if _result_4 ~= nil then
|
|
57
|
-
_result_4 = _result_4.
|
|
72
|
+
_result_4 = _result_4.bottom
|
|
58
73
|
end
|
|
59
74
|
local _condition_3 = _result_4
|
|
60
75
|
if _condition_3 == nil then
|
|
61
76
|
_condition_3 = 0
|
|
62
77
|
end
|
|
63
|
-
local
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
end
|
|
67
|
-
local _condition_4 = _result_5
|
|
78
|
+
local verticalPadding = _condition_2 + _condition_3
|
|
79
|
+
local _attributes = {}
|
|
80
|
+
local _condition_4 = props.name
|
|
68
81
|
if _condition_4 == nil then
|
|
69
|
-
_condition_4 =
|
|
82
|
+
_condition_4 = "GroupElement"
|
|
70
83
|
end
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-- Some renderers (e.g. the browser-based Loom scene preview) don't
|
|
81
|
-
-- back this ref with an instance that supports property-changed
|
|
82
|
-
-- signals, so guard the subscription instead of throwing and
|
|
83
|
-
-- losing size reporting.
|
|
84
|
-
local conn
|
|
85
|
-
pcall(function()
|
|
86
|
-
conn = frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
|
|
87
|
-
context.reportSize(id, Vector2.new(frame.AbsoluteSize.X + horizontalPadding, frame.AbsoluteSize.Y + verticalPadding))
|
|
88
|
-
end)
|
|
89
|
-
end)
|
|
90
|
-
return function()
|
|
91
|
-
local _result_6 = conn
|
|
92
|
-
if _result_6 ~= nil then
|
|
93
|
-
_result_6:Disconnect()
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end, { enabled, context, id, horizontalPadding, verticalPadding })
|
|
97
|
-
if not enabled then
|
|
98
|
-
return props.children
|
|
99
|
-
end
|
|
100
|
-
return React.createElement("frame", {
|
|
101
|
-
ref = elementRef,
|
|
102
|
-
BackgroundTransparency = 1,
|
|
103
|
-
AutomaticSize = Enum.AutomaticSize.XY,
|
|
104
|
-
}, props.children)
|
|
84
|
+
_attributes.key = _condition_4
|
|
85
|
+
_attributes.BackgroundTransparency = 1
|
|
86
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.XY
|
|
87
|
+
_attributes.Change = {
|
|
88
|
+
AbsoluteSize = function(instance)
|
|
89
|
+
context.reportSize(id, Vector2.new(instance.AbsoluteSize.X + horizontalPadding, instance.AbsoluteSize.Y + verticalPadding))
|
|
90
|
+
end,
|
|
91
|
+
}
|
|
92
|
+
return React.createElement("frame", _attributes, props.children)
|
|
105
93
|
end
|
|
106
94
|
local function getMaxVector2(map)
|
|
107
95
|
local max
|
|
@@ -3,11 +3,15 @@ import { SpacedElementProps } from "../../Interfaces";
|
|
|
3
3
|
interface HStackProps extends SpacedElementProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
valign?: Enum.VerticalAlignment | "Center" | "Top" | "Bottom" | React.Binding<Enum.VerticalAlignment> | undefined;
|
|
6
|
+
VerticalAlignment?: Enum.VerticalAlignment;
|
|
6
7
|
Wraps?: boolean;
|
|
8
|
+
HorizontalAlignment?: Enum.HorizontalAlignment;
|
|
7
9
|
HorizontalFlex?: Enum.UIFlexAlignment;
|
|
10
|
+
VerticalFlex?: Enum.UIFlexAlignment;
|
|
8
11
|
Event?: React.InstanceEvent<UIListLayout>;
|
|
9
12
|
Change?: React.InstanceChangeEvent<UIListLayout>;
|
|
10
13
|
Padding?: UDim | Binding<UDim>;
|
|
14
|
+
name?: string;
|
|
11
15
|
}
|
|
12
16
|
export declare function HStack(props: HStackProps): React.JSX.Element;
|
|
13
17
|
export {};
|
|
@@ -5,16 +5,23 @@ 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
local _attributes = {}
|
|
9
|
+
local _condition = props.name
|
|
10
|
+
if _condition == nil then
|
|
11
|
+
_condition = "HStack"
|
|
12
|
+
end
|
|
13
|
+
_attributes.key = _condition
|
|
14
|
+
_attributes.FillDirection = Enum.FillDirection.Horizontal
|
|
15
|
+
_attributes.HorizontalFlex = props.HorizontalFlex
|
|
16
|
+
_attributes.HorizontalAlignment = props.HorizontalAlignment
|
|
17
|
+
_attributes.VerticalAlignment = props.valign or props.VerticalAlignment
|
|
18
|
+
_attributes.VerticalFlex = props.VerticalFlex
|
|
19
|
+
_attributes.Padding = props.Padding or UDim.new(0, math.ceil(SpacingHelper:GetPadding(theme, props.spacing) / 2))
|
|
20
|
+
_attributes.Wraps = if props.Wraps == nil then true else props.Wraps
|
|
21
|
+
_attributes.SortOrder = Enum.SortOrder.LayoutOrder
|
|
22
|
+
_attributes.Change = props.Change
|
|
23
|
+
_attributes.Event = props.Event
|
|
24
|
+
return React.createElement(React.Fragment, nil, React.createElement("uilistlayout", _attributes), props.children)
|
|
18
25
|
end
|
|
19
26
|
return {
|
|
20
27
|
HStack = HStack,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { PaddingProps } from "../../Interfaces";
|
|
3
|
+
export interface PaginationItemProps extends PaddingProps {
|
|
4
|
+
value: number;
|
|
5
|
+
layoutOrder?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function PaginationItem(props: PaginationItemProps): React.JSX.Element;
|
|
8
|
+
declare function PaginationPrev(): React.JSX.Element;
|
|
9
|
+
declare function PaginationNext(): React.JSX.Element;
|
|
10
|
+
declare function PaginationEllipsis(props: {
|
|
11
|
+
layoutOrder?: number;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
export interface PaginationListProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare function PaginationList(props: PaginationListProps): React.JSX.Element;
|
|
17
|
+
export interface PaginationProps {
|
|
18
|
+
page: number;
|
|
19
|
+
totalPages: number;
|
|
20
|
+
siblingCount?: number;
|
|
21
|
+
onPageChange: (page: number) => void;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
type PaginationComponent = React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<Frame>> & {
|
|
25
|
+
Prev: typeof PaginationPrev;
|
|
26
|
+
Next: typeof PaginationNext;
|
|
27
|
+
Item: typeof PaginationItem;
|
|
28
|
+
Ellipsis: typeof PaginationEllipsis;
|
|
29
|
+
List: typeof PaginationList;
|
|
30
|
+
};
|
|
31
|
+
declare const Pagination: PaginationComponent;
|
|
32
|
+
export { Pagination };
|