@rbxts/uiblox 0.2.0-alpha.4 → 0.2.0-alpha.6
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/ui/packages/alert/components/Alert.luau +34 -27
- package/out/ui/packages/alert/components/Alert.styles.d.ts +1 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +10 -2
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +1 -0
- package/out/ui/packages/chip/components/Chip.luau +37 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +1 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +29 -1
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +46 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +84 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +54 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +3 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +24 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +3 -0
- package/out/ui/packages/init.luau +9 -0
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +49 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Stack.d.ts +12 -0
- package/out/ui/packages/layout/components/Stack.luau +49 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
- package/out/ui/packages/layout/components/stackAlign.luau +29 -0
- package/out/ui/packages/layout/index.d.ts +7 -0
- package/out/ui/packages/layout/init.luau +2 -0
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +48 -23
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +48 -24
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -3
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
- package/out/ui/packages/speedDial/index.d.ts +2 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +239 -81
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
|
@@ -13,8 +13,10 @@ local function Alert(props)
|
|
|
13
13
|
local sx = _binding.sx
|
|
14
14
|
local id = _binding.id
|
|
15
15
|
local ref = _binding.ref
|
|
16
|
+
local dismissible = onClose ~= nil
|
|
16
17
|
local styles = useAlertStyles({
|
|
17
18
|
severity = severity,
|
|
19
|
+
dismissible = dismissible,
|
|
18
20
|
})
|
|
19
21
|
local _attributes = {}
|
|
20
22
|
local _condition = id
|
|
@@ -45,45 +47,50 @@ local function Alert(props)
|
|
|
45
47
|
local _attributes_3 = table.clone(styles.stroke)
|
|
46
48
|
setmetatable(_attributes_3, nil)
|
|
47
49
|
local _exp_2 = React.createElement("uistroke", _attributes_3)
|
|
48
|
-
local
|
|
49
|
-
setmetatable(_attributes_4, nil)
|
|
50
|
-
local _exp_3 = React.createElement("uilistlayout", _attributes_4)
|
|
51
|
-
local _condition_1 = title ~= nil and title ~= ""
|
|
50
|
+
local _condition_1 = dismissible
|
|
52
51
|
if _condition_1 then
|
|
53
|
-
local
|
|
54
|
-
key = "
|
|
52
|
+
local _attributes_4 = {
|
|
53
|
+
key = "Close",
|
|
55
54
|
}
|
|
56
|
-
for _k, _v in styles.
|
|
57
|
-
|
|
55
|
+
for _k, _v in styles.close do
|
|
56
|
+
_attributes_4[_k] = _v
|
|
58
57
|
end
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
_attributes_4.Image = tostring(Icons.Close)
|
|
59
|
+
_attributes_4.Event = {
|
|
60
|
+
Activated = function()
|
|
61
|
+
return onClose()
|
|
62
|
+
end,
|
|
63
|
+
}
|
|
64
|
+
_condition_1 = (React.createElement("imagebutton", _attributes_4))
|
|
61
65
|
end
|
|
62
|
-
local
|
|
63
|
-
key = "
|
|
66
|
+
local _attributes_4 = {
|
|
67
|
+
key = "Body",
|
|
64
68
|
}
|
|
65
|
-
for _k, _v in styles.
|
|
66
|
-
|
|
69
|
+
for _k, _v in styles.body do
|
|
70
|
+
_attributes_4[_k] = _v
|
|
67
71
|
end
|
|
68
|
-
_attributes_5
|
|
69
|
-
|
|
70
|
-
local
|
|
72
|
+
local _attributes_5 = table.clone(styles.layout)
|
|
73
|
+
setmetatable(_attributes_5, nil)
|
|
74
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_5)
|
|
75
|
+
local _condition_2 = title ~= nil and title ~= ""
|
|
71
76
|
if _condition_2 then
|
|
72
77
|
local _attributes_6 = {
|
|
73
|
-
key = "
|
|
78
|
+
key = "Title",
|
|
74
79
|
}
|
|
75
|
-
for _k, _v in styles.
|
|
80
|
+
for _k, _v in styles.title do
|
|
76
81
|
_attributes_6[_k] = _v
|
|
77
82
|
end
|
|
78
|
-
_attributes_6.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
_attributes_6.Text = title
|
|
84
|
+
_condition_2 = React.createElement("textlabel", _attributes_6)
|
|
85
|
+
end
|
|
86
|
+
local _attributes_6 = {
|
|
87
|
+
key = "Message",
|
|
88
|
+
}
|
|
89
|
+
for _k, _v in styles.message do
|
|
90
|
+
_attributes_6[_k] = _v
|
|
85
91
|
end
|
|
86
|
-
|
|
92
|
+
_attributes_6.Text = message
|
|
93
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _condition_1, React.createElement("frame", _attributes_4, _exp_3, _condition_2, React.createElement("textlabel", _attributes_6)))
|
|
87
94
|
end
|
|
88
95
|
local default = Alert
|
|
89
96
|
return {
|
|
@@ -6,7 +6,9 @@ local createStyles = _theme.createStyles
|
|
|
6
6
|
local alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverity
|
|
7
7
|
local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
8
8
|
local severity = _param.severity
|
|
9
|
+
local dismissible = _param.dismissible
|
|
9
10
|
local tone = theme.palette.status[alertSeverity(severity)]
|
|
11
|
+
local closeSize = theme.spacing.calc(2)
|
|
10
12
|
local _object = {
|
|
11
13
|
root = {
|
|
12
14
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -29,6 +31,12 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
29
31
|
Transparency = 0,
|
|
30
32
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
31
33
|
},
|
|
34
|
+
body = {
|
|
35
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
36
|
+
Size = UDim2.new(1, if dismissible == true then -(closeSize + theme.padding.calc(1)) else 0, 0, 0),
|
|
37
|
+
BackgroundTransparency = 1,
|
|
38
|
+
BorderSizePixel = 0,
|
|
39
|
+
},
|
|
32
40
|
layout = {
|
|
33
41
|
FillDirection = Enum.FillDirection.Vertical,
|
|
34
42
|
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
@@ -68,8 +76,8 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
68
76
|
_object_1.LayoutOrder = 2
|
|
69
77
|
_object[_left] = _object_1
|
|
70
78
|
_object.close = {
|
|
71
|
-
Size = UDim2.fromOffset(
|
|
72
|
-
Position = UDim2.new(1,
|
|
79
|
+
Size = UDim2.fromOffset(closeSize, closeSize),
|
|
80
|
+
Position = UDim2.new(1, 0, 0, 0),
|
|
73
81
|
AnchorPoint = Vector2.new(1, 0),
|
|
74
82
|
BackgroundTransparency = 1,
|
|
75
83
|
BorderSizePixel = 0,
|
|
@@ -13,6 +13,10 @@ local function Autocomplete(props)
|
|
|
13
13
|
local loading = _binding.loading
|
|
14
14
|
local placeholder = _binding.placeholder
|
|
15
15
|
local searchable = _binding.searchable
|
|
16
|
+
local defaultOpen = _binding.defaultOpen
|
|
17
|
+
local defaultQuery = _binding.defaultQuery
|
|
18
|
+
local emptyText = _binding.emptyText
|
|
19
|
+
local empty = _binding.empty
|
|
16
20
|
local reducedMotion = _binding.reducedMotion
|
|
17
21
|
local size = _binding.size
|
|
18
22
|
local className = _binding.className
|
|
@@ -28,6 +32,10 @@ local function Autocomplete(props)
|
|
|
28
32
|
loading = loading,
|
|
29
33
|
placeholder = placeholder,
|
|
30
34
|
searchable = autocompleteSearchable(searchable),
|
|
35
|
+
defaultOpen = defaultOpen,
|
|
36
|
+
defaultQuery = defaultQuery,
|
|
37
|
+
emptyText = emptyText,
|
|
38
|
+
empty = empty,
|
|
31
39
|
reducedMotion = reducedMotion,
|
|
32
40
|
size = size,
|
|
33
41
|
className = className,
|
|
@@ -2,4 +2,4 @@ export type CheckboxPointer = "rest" | "hover" | "press" | "focus";
|
|
|
2
2
|
export declare function checkboxMark(value: boolean, mixed?: boolean): "" | "–" | "✓";
|
|
3
3
|
export declare function checkboxPointer(hovering: boolean, pressed: boolean, focused: boolean): CheckboxPointer;
|
|
4
4
|
export declare function checkboxBoxTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 1 | 0 | 0.7 | 0.55 | 0.85;
|
|
5
|
-
export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.25 | 0.
|
|
5
|
+
export declare function checkboxStrokeTransparency(filled: boolean, disabled: boolean, pointer: CheckboxPointer): 0 | 0.25 | 0.45 | 0.55 | 0.2;
|
|
@@ -1,6 +1,7 @@
|
|
|
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
4
5
|
local useChipStyles = TS.import(script, script.Parent, "Chip.styles").default
|
|
5
6
|
local function Chip(props)
|
|
6
7
|
local _binding = props
|
|
@@ -8,13 +9,16 @@ local function Chip(props)
|
|
|
8
9
|
local selected = _binding.selected
|
|
9
10
|
local disabled = _binding.disabled
|
|
10
11
|
local onActivated = _binding.onActivated
|
|
12
|
+
local onDelete = _binding.onDelete
|
|
11
13
|
local className = _binding.className
|
|
12
14
|
local sx = _binding.sx
|
|
13
15
|
local id = _binding.id
|
|
14
16
|
local ref = _binding.ref
|
|
17
|
+
local deletable = onDelete ~= nil
|
|
15
18
|
local styles = useChipStyles({
|
|
16
19
|
selected = selected,
|
|
17
20
|
disabled = disabled,
|
|
21
|
+
deletable = deletable,
|
|
18
22
|
})
|
|
19
23
|
local _attributes = {}
|
|
20
24
|
local _condition = id
|
|
@@ -36,7 +40,7 @@ local function Chip(props)
|
|
|
36
40
|
_attributes[_k] = _v
|
|
37
41
|
end
|
|
38
42
|
end
|
|
39
|
-
_attributes.Text = label
|
|
43
|
+
_attributes.Text = if deletable then "" else label
|
|
40
44
|
_attributes.Event = {
|
|
41
45
|
Activated = function()
|
|
42
46
|
if disabled ~= true then
|
|
@@ -55,7 +59,38 @@ local function Chip(props)
|
|
|
55
59
|
local _exp_1 = React.createElement("uicorner", _attributes_2)
|
|
56
60
|
local _attributes_3 = table.clone(styles.stroke)
|
|
57
61
|
setmetatable(_attributes_3, nil)
|
|
58
|
-
|
|
62
|
+
local _exp_2 = React.createElement("uistroke", _attributes_3)
|
|
63
|
+
local _condition_1 = deletable
|
|
64
|
+
if _condition_1 then
|
|
65
|
+
local _attributes_4 = table.clone(styles.row)
|
|
66
|
+
setmetatable(_attributes_4, nil)
|
|
67
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_4)
|
|
68
|
+
local _attributes_5 = {
|
|
69
|
+
key = "Label",
|
|
70
|
+
}
|
|
71
|
+
for _k, _v in styles.label do
|
|
72
|
+
_attributes_5[_k] = _v
|
|
73
|
+
end
|
|
74
|
+
_attributes_5.Text = label
|
|
75
|
+
local _exp_4 = React.createElement("textlabel", _attributes_5)
|
|
76
|
+
local _attributes_6 = {
|
|
77
|
+
key = "Delete",
|
|
78
|
+
}
|
|
79
|
+
for _k, _v in styles.delete do
|
|
80
|
+
_attributes_6[_k] = _v
|
|
81
|
+
end
|
|
82
|
+
_attributes_6.Image = tostring(Icons.Close)
|
|
83
|
+
_attributes_6.Active = disabled ~= true
|
|
84
|
+
_attributes_6.Event = {
|
|
85
|
+
Activated = function()
|
|
86
|
+
if disabled ~= true then
|
|
87
|
+
onDelete()
|
|
88
|
+
end
|
|
89
|
+
end,
|
|
90
|
+
}
|
|
91
|
+
_condition_1 = (React.createElement(React.Fragment, nil, _exp_3, _exp_4, React.createElement("imagebutton", _attributes_6)))
|
|
92
|
+
end
|
|
93
|
+
return React.createElement("textbutton", _attributes, _exp, _exp_1, _exp_2, _condition_1)
|
|
59
94
|
end
|
|
60
95
|
local default = Chip
|
|
61
96
|
return {
|
|
@@ -12,6 +12,10 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
12
12
|
if disabled == nil then
|
|
13
13
|
disabled = false
|
|
14
14
|
end
|
|
15
|
+
local deletable = _param.deletable
|
|
16
|
+
if deletable == nil then
|
|
17
|
+
deletable = false
|
|
18
|
+
end
|
|
15
19
|
return createStyles({
|
|
16
20
|
root = {
|
|
17
21
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -29,7 +33,7 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
29
33
|
PaddingTop = UDim.new(0, theme.padding.calc(0.5)),
|
|
30
34
|
PaddingBottom = UDim.new(0, theme.padding.calc(0.5)),
|
|
31
35
|
PaddingLeft = UDim.new(0, theme.padding.calc(1.5)),
|
|
32
|
-
PaddingRight = UDim.new(0, theme.padding.calc(1.5)),
|
|
36
|
+
PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else 1.5)),
|
|
33
37
|
},
|
|
34
38
|
corner = {
|
|
35
39
|
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
@@ -39,6 +43,30 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
39
43
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
40
44
|
Transparency = if selected then 1 else 0,
|
|
41
45
|
},
|
|
46
|
+
row = {
|
|
47
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
48
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
49
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
50
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
51
|
+
},
|
|
52
|
+
label = {
|
|
53
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
54
|
+
Size = UDim2.fromScale(0, 0),
|
|
55
|
+
BackgroundTransparency = 1,
|
|
56
|
+
BorderSizePixel = 0,
|
|
57
|
+
TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
|
|
58
|
+
Font = theme.typography.fontFamilies.default,
|
|
59
|
+
TextSize = theme.typography.fontSizes.body,
|
|
60
|
+
LayoutOrder = 1,
|
|
61
|
+
},
|
|
62
|
+
delete = {
|
|
63
|
+
Size = UDim2.fromOffset(theme.spacing.calc(2), theme.spacing.calc(2)),
|
|
64
|
+
BackgroundTransparency = 1,
|
|
65
|
+
BorderSizePixel = 0,
|
|
66
|
+
AutoButtonColor = false,
|
|
67
|
+
ImageColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.secondary,
|
|
68
|
+
LayoutOrder = 2,
|
|
69
|
+
},
|
|
42
70
|
})
|
|
43
71
|
end)
|
|
44
72
|
local default = useChipStyles
|
|
@@ -10,6 +10,7 @@ local _motion = TS.import(script, script.Parent.Parent.Parent, "motion")
|
|
|
10
10
|
local arcKeys = _motion.arcKeys
|
|
11
11
|
local loopProperty = _motion.loopProperty
|
|
12
12
|
local progressSpin = _motion.progressSpin
|
|
13
|
+
local spinArcKeys = _motion.spinArcKeys
|
|
13
14
|
local function CircularProgress(props)
|
|
14
15
|
local _binding = props
|
|
15
16
|
local value = _binding.value
|
|
@@ -38,7 +39,17 @@ local function CircularProgress(props)
|
|
|
38
39
|
local shown = if indeterminate then (if motion == "spin" then nil else 0.25) else value
|
|
39
40
|
local _result
|
|
40
41
|
if shown == nil then
|
|
41
|
-
|
|
42
|
+
local _exp = spinArcKeys()
|
|
43
|
+
-- ▼ ReadonlyArray.map ▼
|
|
44
|
+
local _newValue = table.create(#_exp)
|
|
45
|
+
local _callback = function(key)
|
|
46
|
+
return NumberSequenceKeypoint.new(key.time, key.transparency)
|
|
47
|
+
end
|
|
48
|
+
for _k, _v in _exp do
|
|
49
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp)
|
|
50
|
+
end
|
|
51
|
+
-- ▲ ReadonlyArray.map ▲
|
|
52
|
+
_result = NumberSequence.new(_newValue)
|
|
42
53
|
else
|
|
43
54
|
local _exp = arcKeys(shown)
|
|
44
55
|
-- ▼ ReadonlyArray.map ▼
|
|
@@ -91,7 +102,7 @@ local function CircularProgress(props)
|
|
|
91
102
|
}), React.createElement("uistroke", {
|
|
92
103
|
Color = tint,
|
|
93
104
|
Thickness = thickness,
|
|
94
|
-
Transparency = if disabled then 0.
|
|
105
|
+
Transparency = if disabled then 0.85 else 0.82,
|
|
95
106
|
}), React.createElement("uistroke", {
|
|
96
107
|
Color = tint,
|
|
97
108
|
Thickness = thickness,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface FormHelperTextProps {
|
|
3
|
+
text: string;
|
|
4
|
+
hasError?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function FormHelperText(props: CustomizedProps<TextLabel, FormHelperTextProps>): JSX.Element;
|
|
8
|
+
export default FormHelperText;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 useFormTextStyles = TS.import(script, script.Parent, "FormText.styles").default
|
|
5
|
+
local function FormHelperText(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local text = _binding.text
|
|
8
|
+
local hasError = _binding.hasError
|
|
9
|
+
local disabled = _binding.disabled
|
|
10
|
+
local className = _binding.className
|
|
11
|
+
local sx = _binding.sx
|
|
12
|
+
local id = _binding.id
|
|
13
|
+
local ref = _binding.ref
|
|
14
|
+
local styles = useFormTextStyles({
|
|
15
|
+
hasError = hasError,
|
|
16
|
+
disabled = disabled,
|
|
17
|
+
})
|
|
18
|
+
local _attributes = {}
|
|
19
|
+
local _condition = id
|
|
20
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
|
+
_condition = "FormHelperText"
|
|
22
|
+
end
|
|
23
|
+
_attributes.key = _condition
|
|
24
|
+
_attributes.ref = ref
|
|
25
|
+
for _k, _v in styles.root do
|
|
26
|
+
_attributes[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
if className then
|
|
29
|
+
for _k, _v in className do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
if sx then
|
|
34
|
+
for _k, _v in sx do
|
|
35
|
+
_attributes[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
_attributes.Text = text
|
|
39
|
+
return React.createElement("textlabel", _attributes)
|
|
40
|
+
end
|
|
41
|
+
local default = FormHelperText
|
|
42
|
+
return {
|
|
43
|
+
default = default,
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface FormLabelProps {
|
|
3
|
+
text: string;
|
|
4
|
+
required?: boolean;
|
|
5
|
+
hasError?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function FormLabel(props: CustomizedProps<TextLabel, FormLabelProps>): JSX.Element;
|
|
9
|
+
export default FormLabel;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 useFormTextStyles = TS.import(script, script.Parent, "FormText.styles").default
|
|
5
|
+
local function FormLabel(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local text = _binding.text
|
|
8
|
+
local required = _binding.required
|
|
9
|
+
local hasError = _binding.hasError
|
|
10
|
+
local disabled = _binding.disabled
|
|
11
|
+
local className = _binding.className
|
|
12
|
+
local sx = _binding.sx
|
|
13
|
+
local id = _binding.id
|
|
14
|
+
local ref = _binding.ref
|
|
15
|
+
local styles = useFormTextStyles({
|
|
16
|
+
hasError = hasError,
|
|
17
|
+
disabled = disabled,
|
|
18
|
+
})
|
|
19
|
+
local caption = if required == true then `{text} *` else text
|
|
20
|
+
local _attributes = {}
|
|
21
|
+
local _condition = id
|
|
22
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
23
|
+
_condition = "FormLabel"
|
|
24
|
+
end
|
|
25
|
+
_attributes.key = _condition
|
|
26
|
+
_attributes.ref = ref
|
|
27
|
+
for _k, _v in styles.root do
|
|
28
|
+
_attributes[_k] = _v
|
|
29
|
+
end
|
|
30
|
+
if className then
|
|
31
|
+
for _k, _v in className do
|
|
32
|
+
_attributes[_k] = _v
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
if sx then
|
|
36
|
+
for _k, _v in sx do
|
|
37
|
+
_attributes[_k] = _v
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
_attributes.Text = caption
|
|
41
|
+
return React.createElement("textlabel", _attributes)
|
|
42
|
+
end
|
|
43
|
+
local default = FormLabel
|
|
44
|
+
return {
|
|
45
|
+
default = default,
|
|
46
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local createStyles = _theme.createStyles
|
|
6
|
+
local useFormTextStyles = componentStyles("FormText", function(theme, _param)
|
|
7
|
+
local hasError = _param.hasError
|
|
8
|
+
if hasError == nil then
|
|
9
|
+
hasError = false
|
|
10
|
+
end
|
|
11
|
+
local disabled = _param.disabled
|
|
12
|
+
if disabled == nil then
|
|
13
|
+
disabled = false
|
|
14
|
+
end
|
|
15
|
+
local color = if disabled then theme.palette.text.disabled elseif hasError then theme.palette.status.error.main else theme.palette.text.secondary
|
|
16
|
+
return createStyles({
|
|
17
|
+
root = {
|
|
18
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
19
|
+
Size = UDim2.fromScale(0, 0),
|
|
20
|
+
BackgroundTransparency = 1,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
TextColor3 = color,
|
|
23
|
+
Font = theme.typography.fontFamilies.default,
|
|
24
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
25
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
26
|
+
TextWrapped = true,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
end)
|
|
30
|
+
local default = useFormTextStyles
|
|
31
|
+
return {
|
|
32
|
+
default = default,
|
|
33
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.FormLabel = TS.import(script, script, "components", "FormLabel").default
|
|
5
|
+
exports.FormHelperText = TS.import(script, script, "components", "FormHelperText").default
|
|
6
|
+
return exports
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface ImageListItem {
|
|
3
|
+
src: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ImageListProps {
|
|
7
|
+
items: ImageListItem[];
|
|
8
|
+
cols?: number;
|
|
9
|
+
gap?: number;
|
|
10
|
+
itemSize?: number;
|
|
11
|
+
onItemActivated?: (index: number) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function ImageList(props: CustomizedProps<Frame, ImageListProps>): JSX.Element;
|
|
14
|
+
export default ImageList;
|
|
@@ -0,0 +1,84 @@
|
|
|
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 useImageListStyles = TS.import(script, script.Parent, "ImageList.styles").default
|
|
5
|
+
local function ImageList(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local items = _binding.items
|
|
8
|
+
local cols = _binding.cols
|
|
9
|
+
local gap = _binding.gap
|
|
10
|
+
local itemSize = _binding.itemSize
|
|
11
|
+
local onItemActivated = _binding.onItemActivated
|
|
12
|
+
local className = _binding.className
|
|
13
|
+
local sx = _binding.sx
|
|
14
|
+
local id = _binding.id
|
|
15
|
+
local ref = _binding.ref
|
|
16
|
+
local styles = useImageListStyles({
|
|
17
|
+
cols = cols,
|
|
18
|
+
gap = gap,
|
|
19
|
+
itemSize = itemSize,
|
|
20
|
+
})
|
|
21
|
+
local _attributes = {}
|
|
22
|
+
local _condition = id
|
|
23
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
24
|
+
_condition = "ImageList"
|
|
25
|
+
end
|
|
26
|
+
_attributes.key = _condition
|
|
27
|
+
_attributes.ref = ref
|
|
28
|
+
for _k, _v in styles.root do
|
|
29
|
+
_attributes[_k] = _v
|
|
30
|
+
end
|
|
31
|
+
if className then
|
|
32
|
+
for _k, _v in className do
|
|
33
|
+
_attributes[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
if sx then
|
|
37
|
+
for _k, _v in sx do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
local _attributes_1 = table.clone(styles.grid)
|
|
42
|
+
setmetatable(_attributes_1, nil)
|
|
43
|
+
local _exp = React.createElement("uigridlayout", _attributes_1)
|
|
44
|
+
-- ▼ ReadonlyArray.map ▼
|
|
45
|
+
local _newValue = table.create(#items)
|
|
46
|
+
local _callback = function(item, index)
|
|
47
|
+
local _attributes_2 = {
|
|
48
|
+
key = `Tile-{index}`,
|
|
49
|
+
}
|
|
50
|
+
for _k, _v in styles.tile do
|
|
51
|
+
_attributes_2[_k] = _v
|
|
52
|
+
end
|
|
53
|
+
_attributes_2.LayoutOrder = index
|
|
54
|
+
_attributes_2.Event = {
|
|
55
|
+
Activated = function()
|
|
56
|
+
local _result = onItemActivated
|
|
57
|
+
if _result ~= nil then
|
|
58
|
+
_result = _result(index)
|
|
59
|
+
end
|
|
60
|
+
return _result
|
|
61
|
+
end,
|
|
62
|
+
}
|
|
63
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
64
|
+
setmetatable(_attributes_3, nil)
|
|
65
|
+
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
66
|
+
local _attributes_4 = {
|
|
67
|
+
key = "Image",
|
|
68
|
+
}
|
|
69
|
+
for _k, _v in styles.image do
|
|
70
|
+
_attributes_4[_k] = _v
|
|
71
|
+
end
|
|
72
|
+
_attributes_4.Image = item.src
|
|
73
|
+
return React.createElement("imagebutton", _attributes_2, _exp_1, React.createElement("imagelabel", _attributes_4))
|
|
74
|
+
end
|
|
75
|
+
for _k, _v in items do
|
|
76
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
77
|
+
end
|
|
78
|
+
-- ▲ ReadonlyArray.map ▲
|
|
79
|
+
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
80
|
+
end
|
|
81
|
+
local default = ImageList
|
|
82
|
+
return {
|
|
83
|
+
default = default,
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local createStyles = _theme.createStyles
|
|
6
|
+
local _imageListLayout = TS.import(script, script.Parent, "imageListLayout")
|
|
7
|
+
local imageListCols = _imageListLayout.imageListCols
|
|
8
|
+
local imageListGap = _imageListLayout.imageListGap
|
|
9
|
+
local imageListItemSize = _imageListLayout.imageListItemSize
|
|
10
|
+
local useImageListStyles = componentStyles("ImageList", function(theme, _param)
|
|
11
|
+
local cols = _param.cols
|
|
12
|
+
local gap = _param.gap
|
|
13
|
+
local itemSize = _param.itemSize
|
|
14
|
+
local size = imageListItemSize(itemSize)
|
|
15
|
+
local pad = theme.spacing.calc(imageListGap(gap))
|
|
16
|
+
return createStyles({
|
|
17
|
+
root = {
|
|
18
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
19
|
+
Size = UDim2.fromScale(0, 0),
|
|
20
|
+
BackgroundTransparency = 1,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
},
|
|
23
|
+
grid = {
|
|
24
|
+
CellSize = UDim2.fromOffset(size, size),
|
|
25
|
+
CellPadding = UDim2.fromOffset(pad, pad),
|
|
26
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
27
|
+
FillDirectionMaxCells = imageListCols(cols),
|
|
28
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
29
|
+
StartCorner = Enum.StartCorner.TopLeft,
|
|
30
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
31
|
+
VerticalAlignment = Enum.VerticalAlignment.Top,
|
|
32
|
+
},
|
|
33
|
+
tile = {
|
|
34
|
+
Size = UDim2.fromOffset(size, size),
|
|
35
|
+
BackgroundColor3 = theme.palette.surface.input,
|
|
36
|
+
BorderSizePixel = 0,
|
|
37
|
+
AutoButtonColor = false,
|
|
38
|
+
Text = "",
|
|
39
|
+
},
|
|
40
|
+
corner = {
|
|
41
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
42
|
+
},
|
|
43
|
+
image = {
|
|
44
|
+
Size = UDim2.fromScale(1, 1),
|
|
45
|
+
BackgroundTransparency = 1,
|
|
46
|
+
BorderSizePixel = 0,
|
|
47
|
+
ScaleType = Enum.ScaleType.Crop,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
end)
|
|
51
|
+
local default = useImageListStyles
|
|
52
|
+
return {
|
|
53
|
+
default = default,
|
|
54
|
+
}
|