@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
|
@@ -103,50 +103,61 @@ local function TooltipPopup(props)
|
|
|
103
103
|
until true
|
|
104
104
|
local intent = ColorHelper:getIntentColors(theme, props.intent, "default", theme.components.tooltip.intents)
|
|
105
105
|
local padding = SpacingHelper:ResolveNumberPadding(SpacingHelper:GetPadding(theme, props.spacing, theme.components.tooltip.spacing))
|
|
106
|
+
local _attributes = {}
|
|
107
|
+
local _condition = props.name
|
|
108
|
+
if _condition == nil then
|
|
109
|
+
_condition = "Tooltip"
|
|
110
|
+
end
|
|
111
|
+
_attributes.key = _condition
|
|
112
|
+
_attributes.Position = UDim2.fromOffset(position.X, position.Y)
|
|
113
|
+
_attributes.AnchorPoint = anchor
|
|
114
|
+
_attributes.Size = UDim2.fromOffset(0, 0)
|
|
115
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.XY
|
|
116
|
+
_attributes.GroupTransparency = groupTransparency
|
|
117
|
+
_attributes.BackgroundTransparency = 1
|
|
106
118
|
local _exp_1 = React.createElement(Padding, {
|
|
107
119
|
resolvedPadding = resolvedPadding,
|
|
108
120
|
})
|
|
109
|
-
local
|
|
110
|
-
setmetatable(
|
|
111
|
-
|
|
112
|
-
local _exp_2 = React.createElement(BoxShadow,
|
|
121
|
+
local _attributes_1 = table.clone(props)
|
|
122
|
+
setmetatable(_attributes_1, nil)
|
|
123
|
+
_attributes_1.value = theme.components.tooltip.boxShadow
|
|
124
|
+
local _exp_2 = React.createElement(BoxShadow, _attributes_1)
|
|
113
125
|
local _exp_3 = React.createElement(Corners, {
|
|
114
126
|
radius = theme.components.button.cornerRadius,
|
|
115
127
|
})
|
|
116
|
-
local
|
|
117
|
-
setmetatable(
|
|
118
|
-
|
|
119
|
-
local _exp_4 = React.createElement(Padding,
|
|
120
|
-
local
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
local _attributes_2 = table.clone(props)
|
|
129
|
+
setmetatable(_attributes_2, nil)
|
|
130
|
+
_attributes_2.resolvedPadding = padding
|
|
131
|
+
local _exp_4 = React.createElement(Padding, _attributes_2)
|
|
132
|
+
local _attributes_3 = {
|
|
133
|
+
key = "Stroke",
|
|
134
|
+
}
|
|
135
|
+
local _condition_1 = props["border-thickness"]
|
|
136
|
+
if _condition_1 == nil then
|
|
137
|
+
_condition_1 = theme.components.box.borderThickness
|
|
124
138
|
end
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
local _exp_5 = React.createElement("uistroke",
|
|
139
|
+
_attributes_3.Thickness = _condition_1
|
|
140
|
+
_attributes_3.BorderStrokePosition = Enum.BorderStrokePosition.Inner
|
|
141
|
+
_attributes_3.Color = props["border-color"] or intent.borderColor
|
|
142
|
+
local _exp_5 = React.createElement("uistroke", _attributes_3)
|
|
129
143
|
local _content = props.content
|
|
130
|
-
return React.createElement("canvasgroup", {
|
|
131
|
-
|
|
132
|
-
AnchorPoint = anchor,
|
|
133
|
-
Size = UDim2.fromOffset(0, 0),
|
|
134
|
-
AutomaticSize = Enum.AutomaticSize.XY,
|
|
135
|
-
GroupTransparency = groupTransparency,
|
|
136
|
-
BackgroundTransparency = 1,
|
|
137
|
-
}, React.createElement("frame", {
|
|
144
|
+
return React.createElement("canvasgroup", _attributes, React.createElement("frame", {
|
|
145
|
+
key = "ShadowPadding",
|
|
138
146
|
Size = UDim2.fromOffset(0, 0),
|
|
139
147
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
140
148
|
BackgroundTransparency = 1,
|
|
141
149
|
}, _exp_1, React.createElement("frame", {
|
|
150
|
+
key = "Content",
|
|
142
151
|
Size = UDim2.fromOffset(0, 0),
|
|
143
152
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
144
153
|
BackgroundColor3 = intent.backgroundColor,
|
|
145
154
|
BackgroundTransparency = intent.backgroundTransparency,
|
|
146
155
|
}, _exp_2, _exp_3, _exp_4, _exp_5, if type(_content) == "string" then React.createElement(Text, {
|
|
156
|
+
name = "TooltipText",
|
|
147
157
|
text = props.content,
|
|
148
158
|
TextColor3 = intent.textColor,
|
|
149
159
|
}) else props.content)), pointerSize > 0 and React.createElement("frame", {
|
|
160
|
+
key = "Pointer",
|
|
150
161
|
Size = UDim2.fromOffset(pointerSize, pointerSize),
|
|
151
162
|
AnchorPoint = pointerAnchor,
|
|
152
163
|
Position = pointerPosition,
|
|
@@ -156,6 +167,7 @@ local function TooltipPopup(props)
|
|
|
156
167
|
BackgroundTransparency = intent.backgroundTransparency,
|
|
157
168
|
Rotation = 45,
|
|
158
169
|
}, React.createElement("uigradient", {
|
|
170
|
+
key = "Gradient",
|
|
159
171
|
Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.4999, 1), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(1, 0) }),
|
|
160
172
|
Rotation = pointerRotation,
|
|
161
173
|
})))
|
|
@@ -24,6 +24,7 @@ export interface AccordionProps extends ScalableElementProps {
|
|
|
24
24
|
defaultValue?: string;
|
|
25
25
|
value?: string;
|
|
26
26
|
onValueChange?: (value: string | undefined) => void;
|
|
27
|
+
name?: string;
|
|
27
28
|
}
|
|
28
29
|
type AccordionComponent = React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<ImageLabel>> & {
|
|
29
30
|
Item: typeof AccordionItem;
|
|
@@ -79,12 +79,14 @@ local function AccordionHeaderVisual(props)
|
|
|
79
79
|
resolvedPadding = SpacingHelper:GetResolvedPadding(theme, props.header, theme.components.accordion.header.spacing, theme.components.accordion.header.padding),
|
|
80
80
|
})
|
|
81
81
|
local _exp_1 = props.header.icon ~= nil and React.createElement(Icon, {
|
|
82
|
+
name = "AccordionHeaderIcon",
|
|
82
83
|
icon = props.header.icon,
|
|
83
84
|
color = colors.textColor,
|
|
84
85
|
})
|
|
85
86
|
local _result_1
|
|
86
87
|
if props.header.text ~= nil then
|
|
87
88
|
_result_1 = React.createElement(Text, {
|
|
89
|
+
name = "AccordionHeaderText",
|
|
88
90
|
text = props.header.text,
|
|
89
91
|
TextColor3 = colors.textColor,
|
|
90
92
|
typography = TypographyHelper:getTypography(theme, nil, colors.typography or theme.components.accordion.header.typography),
|
|
@@ -92,6 +94,7 @@ local function AccordionHeaderVisual(props)
|
|
|
92
94
|
else
|
|
93
95
|
local _children = props.header.children
|
|
94
96
|
_result_1 = if type(_children) == "string" then React.createElement(Text, {
|
|
97
|
+
name = "AccordionHeaderText",
|
|
95
98
|
text = props.header.children,
|
|
96
99
|
TextColor3 = colors.textColor,
|
|
97
100
|
typography = TypographyHelper:getTypography(theme, nil, colors.typography or theme.components.accordion.header.typography),
|
|
@@ -102,9 +105,13 @@ local function AccordionHeaderVisual(props)
|
|
|
102
105
|
Wraps = false,
|
|
103
106
|
HorizontalFlex = Enum.UIFlexAlignment.Fill,
|
|
104
107
|
}, _exp_1, React.createElement(Container, {
|
|
108
|
+
name = "AccordionHeaderTextContainer",
|
|
105
109
|
Size = UDim2.new(1, theme.components.accordion.header.indicatorSize, 0, 0),
|
|
106
110
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
107
|
-
}, _result_1), React.createElement(Container,
|
|
111
|
+
}, _result_1), React.createElement(Container, {
|
|
112
|
+
name = "AccordionChevronContainer",
|
|
113
|
+
}, React.createElement(Icon, {
|
|
114
|
+
name = "AccordionChevronIcon",
|
|
108
115
|
icon = "chevron-down",
|
|
109
116
|
color = if props.disabled then colors.textColor else theme.components.accordion.header.indicatorColor,
|
|
110
117
|
Size = UDim2.fromOffset(theme.components.accordion.header.indicatorSize, theme.components.accordion.header.indicatorSize),
|
|
@@ -118,43 +125,6 @@ local function RenderedAccordionItem(props)
|
|
|
118
125
|
local height, heightTween = useTween(0, {
|
|
119
126
|
duration = props.duration,
|
|
120
127
|
})
|
|
121
|
-
local contentRef = React.useRef()
|
|
122
|
-
local onContentSizeRef = React.useRef()
|
|
123
|
-
onContentSizeRef.current = function(instance)
|
|
124
|
-
if props.open then
|
|
125
|
-
heightTween:setGoal(instance.AbsoluteSize.Y, {
|
|
126
|
-
duration = props.duration,
|
|
127
|
-
})
|
|
128
|
-
if props.duration == 0 then
|
|
129
|
-
heightTween:setPosition(instance.AbsoluteSize.Y)
|
|
130
|
-
end
|
|
131
|
-
heightTween:start()
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
React.useEffect(function()
|
|
135
|
-
local frame = contentRef.current
|
|
136
|
-
if not frame then
|
|
137
|
-
return nil
|
|
138
|
-
end
|
|
139
|
-
-- Some renderers (e.g. the browser-based Loom scene preview) don't back
|
|
140
|
-
-- this ref with an instance that supports property-changed signals, so
|
|
141
|
-
-- guard the subscription instead of throwing and losing height tracking.
|
|
142
|
-
local conn
|
|
143
|
-
pcall(function()
|
|
144
|
-
conn = frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
|
|
145
|
-
local _result = onContentSizeRef.current
|
|
146
|
-
if _result ~= nil then
|
|
147
|
-
_result(frame)
|
|
148
|
-
end
|
|
149
|
-
end)
|
|
150
|
-
end)
|
|
151
|
-
return function()
|
|
152
|
-
local _result = conn
|
|
153
|
-
if _result ~= nil then
|
|
154
|
-
_result:Disconnect()
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
end, { mounted })
|
|
158
128
|
React.useEffect(function()
|
|
159
129
|
if props.open then
|
|
160
130
|
setMounted(true)
|
|
@@ -192,6 +162,7 @@ local function RenderedAccordionItem(props)
|
|
|
192
162
|
local _condition = not props.first
|
|
193
163
|
if _condition then
|
|
194
164
|
local _attributes = {
|
|
165
|
+
key = "Divider",
|
|
195
166
|
BackgroundColor3 = theme.components.accordion.borderColor,
|
|
196
167
|
BackgroundTransparency = 0,
|
|
197
168
|
BorderSizePixel = 0,
|
|
@@ -202,6 +173,7 @@ local function RenderedAccordionItem(props)
|
|
|
202
173
|
_condition = (React.createElement("frame", _attributes))
|
|
203
174
|
end
|
|
204
175
|
local _attributes = {
|
|
176
|
+
name = `AccordionHeaderButton-{props.value}`,
|
|
205
177
|
isSelected = props.open,
|
|
206
178
|
}
|
|
207
179
|
local _object = {
|
|
@@ -265,10 +237,12 @@ local function RenderedAccordionItem(props)
|
|
|
265
237
|
_object_2.TileSize = focusBackgroundImage.TileSize
|
|
266
238
|
_attributes.focus = _object_2
|
|
267
239
|
return React.createElement(Container, {
|
|
240
|
+
name = `AccordionItem-{props.value}`,
|
|
268
241
|
width = "100%",
|
|
269
242
|
}, React.createElement(VStack, {
|
|
270
243
|
spacing = "None",
|
|
271
244
|
}, _condition, React.createElement(HoverButton, _attributes, props.first and (React.createElement("uicorner", {
|
|
245
|
+
key = "Corners",
|
|
272
246
|
TopLeftRadius = SizeHelper:toUDim(theme.components.accordion.cornerRadius),
|
|
273
247
|
TopRightRadius = SizeHelper:toUDim(theme.components.accordion.cornerRadius),
|
|
274
248
|
BottomLeftRadius = UDim.new(0, 0),
|
|
@@ -279,6 +253,7 @@ local function RenderedAccordionItem(props)
|
|
|
279
253
|
duration = props.duration,
|
|
280
254
|
open = props.open,
|
|
281
255
|
})), mounted and (React.createElement("frame", {
|
|
256
|
+
key = "ContentClip",
|
|
282
257
|
BackgroundTransparency = 1,
|
|
283
258
|
ClipsDescendants = true,
|
|
284
259
|
Size = height:map(function(value)
|
|
@@ -287,14 +262,28 @@ local function RenderedAccordionItem(props)
|
|
|
287
262
|
return _exp + _arg0
|
|
288
263
|
end),
|
|
289
264
|
}, React.createElement("frame", {
|
|
290
|
-
|
|
265
|
+
key = "Content",
|
|
291
266
|
BackgroundColor3 = theme.components.accordion.content.backgroundColor,
|
|
292
267
|
BackgroundTransparency = theme.components.accordion.content.backgroundTransparency,
|
|
293
268
|
Size = UDim2.fromScale(1, 0),
|
|
294
269
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
270
|
+
Change = {
|
|
271
|
+
AbsoluteSize = function(instance)
|
|
272
|
+
if props.open then
|
|
273
|
+
heightTween:setGoal(instance.AbsoluteSize.Y, {
|
|
274
|
+
duration = props.duration,
|
|
275
|
+
})
|
|
276
|
+
if props.duration == 0 then
|
|
277
|
+
heightTween:setPosition(instance.AbsoluteSize.Y)
|
|
278
|
+
end
|
|
279
|
+
heightTween:start()
|
|
280
|
+
end
|
|
281
|
+
end,
|
|
282
|
+
},
|
|
295
283
|
}, React.createElement(Padding, {
|
|
296
284
|
resolvedPadding = SpacingHelper:GetResolvedPadding(theme, props.contentProps, theme.components.accordion.content.spacing, theme.components.accordion.content.padding),
|
|
297
285
|
}), if props.contentText ~= nil then React.createElement(Text, {
|
|
286
|
+
name = "AccordionContentText",
|
|
298
287
|
text = props.contentText,
|
|
299
288
|
}) else props.content)))))
|
|
300
289
|
end
|
|
@@ -431,10 +420,22 @@ local Accordion = React.forwardRef(function(props, ref)
|
|
|
431
420
|
_result(nextValues[1])
|
|
432
421
|
end
|
|
433
422
|
end
|
|
423
|
+
local _attributes = {
|
|
424
|
+
ref = ref,
|
|
425
|
+
}
|
|
426
|
+
local _condition = props.name
|
|
427
|
+
if _condition == nil then
|
|
428
|
+
_condition = "Accordion"
|
|
429
|
+
end
|
|
430
|
+
_attributes.name = _condition
|
|
431
|
+
_attributes.width = "100%"
|
|
432
|
+
_attributes.height = "100%"
|
|
433
|
+
_attributes.ClipsDescendants = true
|
|
434
434
|
local _exp = React.createElement(Corners, {
|
|
435
435
|
radius = theme.components.accordion.cornerRadius,
|
|
436
436
|
})
|
|
437
437
|
local _exp_1 = React.createElement("uistroke", {
|
|
438
|
+
key = "Stroke",
|
|
438
439
|
Color = theme.components.accordion.borderColor,
|
|
439
440
|
Thickness = theme.components.accordion.borderThickness,
|
|
440
441
|
BorderStrokePosition = Enum.BorderStrokePosition.Outer,
|
|
@@ -442,35 +443,30 @@ local Accordion = React.forwardRef(function(props, ref)
|
|
|
442
443
|
-- ▼ ReadonlyArray.map ▼
|
|
443
444
|
local _newValue_2 = table.create(#items)
|
|
444
445
|
local _callback_2 = function(item, index)
|
|
445
|
-
local
|
|
446
|
+
local _attributes_1 = {
|
|
446
447
|
key = item.value,
|
|
447
448
|
}
|
|
448
449
|
for _k, _v in item do
|
|
449
|
-
|
|
450
|
+
_attributes_1[_k] = _v
|
|
450
451
|
end
|
|
451
|
-
|
|
452
|
+
_attributes_1.first = index == 0
|
|
452
453
|
local _value = item.value
|
|
453
|
-
|
|
454
|
-
local
|
|
455
|
-
if
|
|
456
|
-
|
|
454
|
+
_attributes_1.open = table.find(openValues, _value) ~= nil
|
|
455
|
+
local _condition_1 = props.animationDuration
|
|
456
|
+
if _condition_1 == nil then
|
|
457
|
+
_condition_1 = theme.components.accordion.animation.duration
|
|
457
458
|
end
|
|
458
|
-
|
|
459
|
-
|
|
459
|
+
_attributes_1.duration = _condition_1
|
|
460
|
+
_attributes_1.onActivate = function()
|
|
460
461
|
return activate(item)
|
|
461
462
|
end
|
|
462
|
-
return React.createElement(RenderedAccordionItem,
|
|
463
|
+
return React.createElement(RenderedAccordionItem, _attributes_1)
|
|
463
464
|
end
|
|
464
465
|
for _k, _v in items do
|
|
465
466
|
_newValue_2[_k] = _callback_2(_v, _k - 1, items)
|
|
466
467
|
end
|
|
467
468
|
-- ▲ ReadonlyArray.map ▲
|
|
468
|
-
return React.createElement(Container, {
|
|
469
|
-
ref = ref,
|
|
470
|
-
width = "100%",
|
|
471
|
-
height = "100%",
|
|
472
|
-
ClipsDescendants = true,
|
|
473
|
-
}, _exp, _exp_1, React.createElement(VStack, {
|
|
469
|
+
return React.createElement(Container, _attributes, _exp, _exp_1, React.createElement(VStack, {
|
|
474
470
|
Padding = UDim.new(0, SpacingHelper:GetPadding(theme, props.scale, theme.components.accordion.spacing)),
|
|
475
471
|
}, _newValue_2))
|
|
476
472
|
end)
|
|
@@ -2,6 +2,7 @@ import React from "@rbxts/react";
|
|
|
2
2
|
import { ResponsiveGridSpan } from "../../Interfaces/";
|
|
3
3
|
interface ColumnProps {
|
|
4
4
|
span?: ResponsiveGridSpan | number | `${number}`;
|
|
5
|
+
name?: string;
|
|
5
6
|
}
|
|
6
7
|
export declare const Column: React.ForwardRefExoticComponent<ColumnProps & React.RefAttributes<Frame>>;
|
|
7
8
|
export {};
|
|
@@ -28,12 +28,17 @@ local Column = React.forwardRef(function(props, ref)
|
|
|
28
28
|
local padding = context.padding
|
|
29
29
|
local widthScale = fraction + ((fraction - 1) * padding.Scale)
|
|
30
30
|
local widthOffset = (fraction - 1) * padding.Offset
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
local _attributes = {}
|
|
32
|
+
local _condition = props.name
|
|
33
|
+
if _condition == nil then
|
|
34
|
+
_condition = "Column"
|
|
35
|
+
end
|
|
36
|
+
_attributes.key = _condition
|
|
37
|
+
_attributes.ref = ref
|
|
38
|
+
_attributes.Size = UDim2.new(widthScale, widthOffset, 0, 0)
|
|
39
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.Y
|
|
40
|
+
_attributes.BackgroundTransparency = 1
|
|
41
|
+
return React.createElement("frame", _attributes, props.children)
|
|
37
42
|
end)
|
|
38
43
|
return {
|
|
39
44
|
Column = Column,
|
|
@@ -4,5 +4,6 @@ import { CssBackgroundImage } from "../../Theme";
|
|
|
4
4
|
export interface ContainerProps extends SizeElementProps, PositionElementProps, ZIndexElementProps, React.InstanceProps<ImageLabel> {
|
|
5
5
|
group?: boolean;
|
|
6
6
|
backgroundImage?: Partial<CssBackgroundImage>;
|
|
7
|
+
name?: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const Container: React.ForwardRefExoticComponent<Omit<ContainerProps, "ref"> & React.RefAttributes<ImageLabel>>;
|
|
@@ -13,20 +13,24 @@ local Container = React.forwardRef(function(props, ref)
|
|
|
13
13
|
local isAutoSizeActive = autoSize ~= Enum.AutomaticSize.None and autoSize ~= "None"
|
|
14
14
|
local centerViaLayout = props.center == true and props.Position == nil and props.AnchorPoint == nil and isAutoSizeActive
|
|
15
15
|
local backgroundImage = CssHelper:resolveBackgroundImage(props.backgroundImage)
|
|
16
|
-
local _attributes = {
|
|
17
|
-
|
|
18
|
-
Archivable = props.Archivable,
|
|
19
|
-
Tag = props.Tag,
|
|
20
|
-
Active = props.Active,
|
|
21
|
-
AnchorPoint = if centerViaLayout then Vector2.zero else SizeHelper:GetAnchor(props),
|
|
22
|
-
AutomaticSize = autoSize,
|
|
23
|
-
BackgroundColor3 = props.BackgroundColor3,
|
|
24
|
-
}
|
|
25
|
-
local _condition = props.BackgroundTransparency
|
|
16
|
+
local _attributes = {}
|
|
17
|
+
local _condition = props.name
|
|
26
18
|
if _condition == nil then
|
|
27
|
-
_condition =
|
|
19
|
+
_condition = "Container"
|
|
28
20
|
end
|
|
29
|
-
_attributes.
|
|
21
|
+
_attributes.key = _condition
|
|
22
|
+
_attributes.ref = ref
|
|
23
|
+
_attributes.Archivable = props.Archivable
|
|
24
|
+
_attributes.Tag = props.Tag
|
|
25
|
+
_attributes.Active = props.Active
|
|
26
|
+
_attributes.AnchorPoint = if centerViaLayout then Vector2.zero else SizeHelper:GetAnchor(props)
|
|
27
|
+
_attributes.AutomaticSize = autoSize
|
|
28
|
+
_attributes.BackgroundColor3 = props.BackgroundColor3
|
|
29
|
+
local _condition_1 = props.BackgroundTransparency
|
|
30
|
+
if _condition_1 == nil then
|
|
31
|
+
_condition_1 = 1
|
|
32
|
+
end
|
|
33
|
+
_attributes.BackgroundTransparency = _condition_1
|
|
30
34
|
_attributes.BorderColor3 = props.BorderColor3
|
|
31
35
|
_attributes.BorderMode = props.BorderMode
|
|
32
36
|
_attributes.BorderSizePixel = props.BorderSizePixel
|
|
@@ -53,11 +57,11 @@ local Container = React.forwardRef(function(props, ref)
|
|
|
53
57
|
_result_1 = _result_1.X
|
|
54
58
|
end
|
|
55
59
|
end
|
|
56
|
-
local
|
|
57
|
-
if
|
|
58
|
-
|
|
60
|
+
local _condition_2 = _result_1
|
|
61
|
+
if _condition_2 == nil then
|
|
62
|
+
_condition_2 = 0
|
|
59
63
|
end
|
|
60
|
-
_result =
|
|
64
|
+
_result = _condition_2
|
|
61
65
|
else
|
|
62
66
|
_result = 0
|
|
63
67
|
end
|
|
@@ -83,11 +87,13 @@ local Container = React.forwardRef(function(props, ref)
|
|
|
83
87
|
return content
|
|
84
88
|
end
|
|
85
89
|
return React.createElement("frame", {
|
|
90
|
+
key = if props.name ~= nil then `{props.name}CenterWrapper` else "ContainerCenterWrapper",
|
|
86
91
|
Size = UDim2.fromScale(1, 1),
|
|
87
92
|
BackgroundTransparency = 1,
|
|
88
93
|
ZIndex = props.ZIndex,
|
|
89
94
|
LayoutOrder = props.LayoutOrder,
|
|
90
95
|
}, React.createElement("uilistlayout", {
|
|
96
|
+
key = "CenterLayout",
|
|
91
97
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
92
98
|
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
93
99
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
@@ -13,6 +13,23 @@ 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
15
|
local CustomInputService = TS.import(script, script.Parent.Parent.Parent, "Helpers").CustomInputService
|
|
16
|
+
local function isInteractiveDescendantAtInput(handle, input)
|
|
17
|
+
local point = Vector2.new(input.Position.X, input.Position.Y)
|
|
18
|
+
local _exp = GuiHelper:getGuiObjectsAtPosition(handle, point)
|
|
19
|
+
-- ▼ ReadonlyArray.some ▼
|
|
20
|
+
local _result = false
|
|
21
|
+
local _callback = function(guiObject)
|
|
22
|
+
return guiObject ~= handle and guiObject:IsDescendantOf(handle) and (guiObject:IsA("GuiButton") or guiObject:IsA("TextBox"))
|
|
23
|
+
end
|
|
24
|
+
for _k, _v in _exp do
|
|
25
|
+
if _callback(_v, _k - 1, _exp) then
|
|
26
|
+
_result = true
|
|
27
|
+
break
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
-- ▲ ReadonlyArray.some ▲
|
|
31
|
+
return _result
|
|
32
|
+
end
|
|
16
33
|
local function DragHandle(_param)
|
|
17
34
|
local children = _param.children
|
|
18
35
|
local draggable = React.useContext(DraggableContext)
|
|
@@ -53,7 +70,7 @@ local function DragHandle(_param)
|
|
|
53
70
|
_result(instance, input)
|
|
54
71
|
end
|
|
55
72
|
end
|
|
56
|
-
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
|
|
73
|
+
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and not isInteractiveDescendantAtInput(instance, input) then
|
|
57
74
|
draggable.beginDrag(input, instance)
|
|
58
75
|
end
|
|
59
76
|
end
|
|
@@ -62,11 +79,16 @@ local function DragHandle(_param)
|
|
|
62
79
|
end
|
|
63
80
|
local function Placeholder(props)
|
|
64
81
|
local theme = React.useContext(CleanThemeContext)
|
|
65
|
-
local _attributes =
|
|
66
|
-
|
|
82
|
+
local _attributes = {
|
|
83
|
+
key = "DraggablePlaceholder",
|
|
84
|
+
}
|
|
85
|
+
for _k, _v in props do
|
|
86
|
+
_attributes[_k] = _v
|
|
87
|
+
end
|
|
67
88
|
_attributes.BackgroundTransparency = theme.components.draggable.placeholder.backgroundTransparency
|
|
68
89
|
_attributes.BackgroundColor3 = theme.components.draggable.placeholder.backgroundColor
|
|
69
90
|
return React.createElement("frame", _attributes, React.createElement("uistroke", {
|
|
91
|
+
key = "Stroke",
|
|
70
92
|
Thickness = theme.components.draggable.placeholder.borderThickness,
|
|
71
93
|
BorderStrokePosition = Enum.BorderStrokePosition.Inner,
|
|
72
94
|
Color = theme.components.draggable.placeholder.borderColor,
|
|
@@ -16,6 +16,7 @@ local function FieldsetLabel(props)
|
|
|
16
16
|
ShrinkRatio = 0,
|
|
17
17
|
GrowRatio = 0,
|
|
18
18
|
}, React.createElement("imagebutton", {
|
|
19
|
+
key = "FieldsetLabelButton",
|
|
19
20
|
Size = UDim2.fromOffset(0, 0),
|
|
20
21
|
BackgroundTransparency = 1,
|
|
21
22
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -45,45 +46,6 @@ local Fieldset = React.forwardRef(function(props, ref)
|
|
|
45
46
|
labelActivated:Destroy()
|
|
46
47
|
end
|
|
47
48
|
end, {})
|
|
48
|
-
local containerRef = React.useRef()
|
|
49
|
-
local setContainerRef = function(instance)
|
|
50
|
-
containerRef.current = instance
|
|
51
|
-
local _ref = ref
|
|
52
|
-
if type(_ref) == "function" then
|
|
53
|
-
ref(instance)
|
|
54
|
-
else
|
|
55
|
-
local _condition = ref ~= nil
|
|
56
|
-
if _condition then
|
|
57
|
-
local _ref_1 = ref
|
|
58
|
-
_condition = type(_ref_1) == "table"
|
|
59
|
-
end
|
|
60
|
-
if _condition then
|
|
61
|
-
ref.current = instance
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
React.useEffect(function()
|
|
66
|
-
local frame = containerRef.current
|
|
67
|
-
if not frame then
|
|
68
|
-
return nil
|
|
69
|
-
end
|
|
70
|
-
-- Some renderers (e.g. the browser-based Loom scene preview) don't
|
|
71
|
-
-- back this ref with an instance that supports property-changed
|
|
72
|
-
-- signals, so guard the subscription instead of throwing and
|
|
73
|
-
-- losing breakpoint width tracking.
|
|
74
|
-
local conn
|
|
75
|
-
pcall(function()
|
|
76
|
-
conn = frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
|
|
77
|
-
return setWidth(frame.AbsoluteSize.X)
|
|
78
|
-
end)
|
|
79
|
-
end)
|
|
80
|
-
return function()
|
|
81
|
-
local _result = conn
|
|
82
|
-
if _result ~= nil then
|
|
83
|
-
_result:Disconnect()
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
end, {})
|
|
87
49
|
local fieldsetContext = React.useMemo(function()
|
|
88
50
|
local _object = {}
|
|
89
51
|
local _left = "disabled"
|
|
@@ -104,11 +66,21 @@ local Fieldset = React.forwardRef(function(props, ref)
|
|
|
104
66
|
local breakpoints = props.breakpoints or theme.breakpoints
|
|
105
67
|
local breakpoint = BreakpointHelper:getBreakpoint(width, breakpoints)
|
|
106
68
|
local wrap = BreakpointHelper:compare(breakpoint, "<=", props.wrap or "lg")
|
|
69
|
+
local _attributes = {}
|
|
70
|
+
local _condition = props.name
|
|
71
|
+
if _condition == nil then
|
|
72
|
+
_condition = "Fieldset"
|
|
73
|
+
end
|
|
74
|
+
_attributes.name = _condition
|
|
75
|
+
_attributes.ref = ref
|
|
76
|
+
_attributes.Change = {
|
|
77
|
+
AbsoluteSize = function(instance)
|
|
78
|
+
setWidth(instance.AbsoluteSize.X)
|
|
79
|
+
end,
|
|
80
|
+
}
|
|
107
81
|
return React.createElement(FieldsetContext.Provider, {
|
|
108
82
|
value = fieldsetContext,
|
|
109
|
-
}, React.createElement(Container, {
|
|
110
|
-
ref = setContainerRef,
|
|
111
|
-
}, React.createElement(HStack, {
|
|
83
|
+
}, React.createElement(Container, _attributes, React.createElement(HStack, {
|
|
112
84
|
Wraps = wrap,
|
|
113
85
|
valign = "Center",
|
|
114
86
|
HorizontalFlex = Enum.UIFlexAlignment.Fill,
|
|
@@ -6,11 +6,18 @@ local FlexItem = React.forwardRef(function(props, ref)
|
|
|
6
6
|
local _attributes = table.clone(props)
|
|
7
7
|
setmetatable(_attributes, nil)
|
|
8
8
|
_attributes.ref = ref
|
|
9
|
+
local _condition = props.name
|
|
10
|
+
if _condition == nil then
|
|
11
|
+
_condition = "FlexItem"
|
|
12
|
+
end
|
|
13
|
+
_attributes.name = _condition
|
|
9
14
|
return React.createElement(Container, _attributes, React.createElement("uiflexitem", {
|
|
15
|
+
key = "FlexItemConstraint",
|
|
10
16
|
FlexMode = props.mode or "Grow",
|
|
11
17
|
GrowRatio = props.GrowRatio,
|
|
12
18
|
ShrinkRatio = props.ShrinkRatio,
|
|
13
19
|
}), React.createElement("uilistlayout", {
|
|
20
|
+
key = "FlexItemLayout",
|
|
14
21
|
HorizontalFlex = props.HorizontalFlex,
|
|
15
22
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
16
23
|
HorizontalAlignment = props.align,
|
|
@@ -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;
|
|
@@ -34,7 +34,9 @@ local function GroupElement(props)
|
|
|
34
34
|
_result_1 = _result_1.removeElement
|
|
35
35
|
end
|
|
36
36
|
React.useEffect(_exp, { enabled, _result_1 })
|
|
37
|
-
|
|
37
|
+
if not enabled then
|
|
38
|
+
return props.children
|
|
39
|
+
end
|
|
38
40
|
local _result_2 = props.padding
|
|
39
41
|
if _result_2 ~= nil then
|
|
40
42
|
_result_2 = _result_2.left
|
|
@@ -69,39 +71,20 @@ local function GroupElement(props)
|
|
|
69
71
|
_condition_4 = 0
|
|
70
72
|
end
|
|
71
73
|
local verticalPadding = _condition_3 + _condition_4
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
local frame = elementRef.current
|
|
77
|
-
if not frame or not context then
|
|
78
|
-
return nil
|
|
79
|
-
end
|
|
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
|
|
74
|
+
local _attributes = {}
|
|
75
|
+
local _condition_5 = props.name
|
|
76
|
+
if _condition_5 == nil then
|
|
77
|
+
_condition_5 = "GroupElement"
|
|
99
78
|
end
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
79
|
+
_attributes.key = _condition_5
|
|
80
|
+
_attributes.BackgroundTransparency = 1
|
|
81
|
+
_attributes.AutomaticSize = Enum.AutomaticSize.XY
|
|
82
|
+
_attributes.Change = {
|
|
83
|
+
AbsoluteSize = function(instance)
|
|
84
|
+
context.reportSize(id, Vector2.new(instance.AbsoluteSize.X + horizontalPadding, instance.AbsoluteSize.Y + verticalPadding))
|
|
85
|
+
end,
|
|
86
|
+
}
|
|
87
|
+
return React.createElement("frame", _attributes, props.children)
|
|
105
88
|
end
|
|
106
89
|
local function getMaxVector2(map)
|
|
107
90
|
local max
|