@rbxts/uiblox 0.2.0-alpha.5 → 0.2.0-alpha.7
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/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.styles.luau +6 -3
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +2 -1
- package/out/ui/packages/chip/components/Chip.luau +2 -0
- package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +13 -7
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
- package/out/ui/packages/dialog/components/Dialog.luau +27 -18
- 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 +2 -0
- package/out/ui/packages/init.luau +6 -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/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +54 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/Grid.d.ts +1 -1
- 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/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/index.d.ts +7 -0
- package/out/ui/packages/layout/init.luau +3 -0
- package/out/ui/packages/modal/components/Modal.d.ts +1 -1
- package/out/ui/packages/modal/components/Modal.luau +55 -37
- 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/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -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/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/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +191 -85
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/tabs/components/Tabs.d.ts +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +10 -3
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +4 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +24 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.styles.luau +1 -1
- 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,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
export interface BackdropProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
invisible?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function Backdrop(props: CustomizedProps<TextButton, BackdropProps>): JSX.Element | undefined;
|
|
10
|
+
export default Backdrop;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 useBackdropStyles = TS.import(script, script.Parent, "Backdrop.styles").default
|
|
5
|
+
local function Backdrop(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local open = _binding.open
|
|
8
|
+
if open == nil then
|
|
9
|
+
open = true
|
|
10
|
+
end
|
|
11
|
+
local invisible = _binding.invisible
|
|
12
|
+
local onClick = _binding.onClick
|
|
13
|
+
local children = _binding.children
|
|
14
|
+
local className = _binding.className
|
|
15
|
+
local sx = _binding.sx
|
|
16
|
+
local id = _binding.id
|
|
17
|
+
local ref = _binding.ref
|
|
18
|
+
local styles = useBackdropStyles({
|
|
19
|
+
invisible = invisible,
|
|
20
|
+
})
|
|
21
|
+
if open ~= true then
|
|
22
|
+
return nil
|
|
23
|
+
end
|
|
24
|
+
local _attributes = {}
|
|
25
|
+
local _condition = id
|
|
26
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
27
|
+
_condition = "Backdrop"
|
|
28
|
+
end
|
|
29
|
+
_attributes.key = _condition
|
|
30
|
+
_attributes.ref = ref
|
|
31
|
+
for _k, _v in styles.root do
|
|
32
|
+
_attributes[_k] = _v
|
|
33
|
+
end
|
|
34
|
+
if className then
|
|
35
|
+
for _k, _v in className do
|
|
36
|
+
_attributes[_k] = _v
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
if sx then
|
|
40
|
+
for _k, _v in sx do
|
|
41
|
+
_attributes[_k] = _v
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
_attributes.Event = {
|
|
45
|
+
Activated = function()
|
|
46
|
+
local _result = onClick
|
|
47
|
+
if _result ~= nil then
|
|
48
|
+
_result = _result()
|
|
49
|
+
end
|
|
50
|
+
return _result
|
|
51
|
+
end,
|
|
52
|
+
}
|
|
53
|
+
return React.createElement("textbutton", _attributes, children)
|
|
54
|
+
end
|
|
55
|
+
local default = Backdrop
|
|
56
|
+
return {
|
|
57
|
+
default = default,
|
|
58
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 useBackdropStyles = componentStyles("Backdrop", function(theme, _param)
|
|
7
|
+
local invisible = _param.invisible
|
|
8
|
+
return createStyles({
|
|
9
|
+
root = {
|
|
10
|
+
Size = UDim2.fromScale(1, 1),
|
|
11
|
+
BackgroundColor3 = theme.palette.backdrop,
|
|
12
|
+
BackgroundTransparency = if invisible == true then 1 else 0.45,
|
|
13
|
+
BorderSizePixel = 0,
|
|
14
|
+
Text = "",
|
|
15
|
+
AutoButtonColor = false,
|
|
16
|
+
Selectable = false,
|
|
17
|
+
ZIndex = 30000,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
end)
|
|
21
|
+
local default = useBackdropStyles
|
|
22
|
+
return {
|
|
23
|
+
default = default,
|
|
24
|
+
}
|
|
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
|
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
6
|
local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
7
|
+
local diameter = theme.spacing.calc(2) + theme.padding.calc(1)
|
|
7
8
|
return createStyles({
|
|
8
9
|
root = {
|
|
9
10
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -14,13 +15,15 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
|
14
15
|
badge = {
|
|
15
16
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
16
17
|
Position = UDim2.fromScale(1, 0),
|
|
17
|
-
AutomaticSize = Enum.AutomaticSize.
|
|
18
|
-
Size = UDim2.fromOffset(
|
|
18
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
19
|
+
Size = UDim2.fromOffset(diameter, diameter),
|
|
19
20
|
BackgroundColor3 = theme.palette.status.error.main,
|
|
20
21
|
BorderSizePixel = 0,
|
|
21
22
|
Font = theme.typography.fontFamilies.default,
|
|
22
23
|
TextSize = theme.typography.fontSizes.caption,
|
|
23
24
|
TextColor3 = theme.palette.text.inverse,
|
|
25
|
+
TextXAlignment = Enum.TextXAlignment.Center,
|
|
26
|
+
TextYAlignment = Enum.TextYAlignment.Center,
|
|
24
27
|
ZIndex = 2,
|
|
25
28
|
},
|
|
26
29
|
padding = {
|
|
@@ -28,7 +31,7 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
|
28
31
|
PaddingRight = UDim.new(0, theme.padding.calc(0.5)),
|
|
29
32
|
},
|
|
30
33
|
corner = {
|
|
31
|
-
CornerRadius = UDim.new(
|
|
34
|
+
CornerRadius = UDim.new(0.5, 0),
|
|
32
35
|
},
|
|
33
36
|
})
|
|
34
37
|
end)
|
|
@@ -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,8 +1,9 @@
|
|
|
1
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
export interface ChipProps {
|
|
3
3
|
label: string;
|
|
4
4
|
selected?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
size?: ControlSize;
|
|
6
7
|
onActivated?: () => void;
|
|
7
8
|
onDelete?: () => void;
|
|
8
9
|
}
|
|
@@ -8,6 +8,7 @@ local function Chip(props)
|
|
|
8
8
|
local label = _binding.label
|
|
9
9
|
local selected = _binding.selected
|
|
10
10
|
local disabled = _binding.disabled
|
|
11
|
+
local size = _binding.size
|
|
11
12
|
local onActivated = _binding.onActivated
|
|
12
13
|
local onDelete = _binding.onDelete
|
|
13
14
|
local className = _binding.className
|
|
@@ -19,6 +20,7 @@ local function Chip(props)
|
|
|
19
20
|
selected = selected,
|
|
20
21
|
disabled = disabled,
|
|
21
22
|
deletable = deletable,
|
|
23
|
+
size = size,
|
|
22
24
|
})
|
|
23
25
|
local _attributes = {}
|
|
24
26
|
local _condition = id
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ControlSize } from "../../../../theme/index";
|
|
1
2
|
declare const useChipStyles: (props: {
|
|
2
3
|
selected?: boolean;
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
deletable?: boolean;
|
|
6
|
+
size?: ControlSize;
|
|
5
7
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
6
8
|
export default useChipStyles;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
|
+
local controlMetrics = _theme.controlMetrics
|
|
5
6
|
local createStyles = _theme.createStyles
|
|
6
7
|
local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
7
8
|
local selected = _param.selected
|
|
@@ -16,6 +17,11 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
16
17
|
if deletable == nil then
|
|
17
18
|
deletable = false
|
|
18
19
|
end
|
|
20
|
+
local size = _param.size
|
|
21
|
+
local metrics = controlMetrics(theme.density, size)
|
|
22
|
+
local padY = if size == "small" then 0.25 elseif size == "large" then 0.75 else 0.5
|
|
23
|
+
local padX = if size == "small" then 1 elseif size == "large" then 2 else 1.5
|
|
24
|
+
local deletePx = metrics.icon
|
|
19
25
|
return createStyles({
|
|
20
26
|
root = {
|
|
21
27
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -27,13 +33,13 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
27
33
|
Selectable = not disabled,
|
|
28
34
|
TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
|
|
29
35
|
Font = theme.typography.fontFamilies.default,
|
|
30
|
-
TextSize =
|
|
36
|
+
TextSize = metrics.font,
|
|
31
37
|
},
|
|
32
38
|
padding = {
|
|
33
|
-
PaddingTop = UDim.new(0, theme.padding.calc(
|
|
34
|
-
PaddingBottom = UDim.new(0, theme.padding.calc(
|
|
35
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(
|
|
36
|
-
PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else
|
|
39
|
+
PaddingTop = UDim.new(0, theme.padding.calc(padY)),
|
|
40
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(padY)),
|
|
41
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(padX)),
|
|
42
|
+
PaddingRight = UDim.new(0, theme.padding.calc(if deletable then 0.5 else padX)),
|
|
37
43
|
},
|
|
38
44
|
corner = {
|
|
39
45
|
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
@@ -56,11 +62,11 @@ local useChipStyles = componentStyles("Chip", function(theme, _param)
|
|
|
56
62
|
BorderSizePixel = 0,
|
|
57
63
|
TextColor3 = if disabled then theme.palette.text.disabled else theme.palette.text.primary,
|
|
58
64
|
Font = theme.typography.fontFamilies.default,
|
|
59
|
-
TextSize =
|
|
65
|
+
TextSize = metrics.font,
|
|
60
66
|
LayoutOrder = 1,
|
|
61
67
|
},
|
|
62
68
|
delete = {
|
|
63
|
-
Size = UDim2.fromOffset(
|
|
69
|
+
Size = UDim2.fromOffset(deletePx, deletePx),
|
|
64
70
|
BackgroundTransparency = 1,
|
|
65
71
|
BorderSizePixel = 0,
|
|
66
72
|
AutoButtonColor = false,
|
|
@@ -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,
|
|
@@ -12,6 +12,8 @@ local function Dialog(props)
|
|
|
12
12
|
local children = _binding.children
|
|
13
13
|
local actions = _binding.actions
|
|
14
14
|
local styles = useDialogStyles()
|
|
15
|
+
local hasTitle = title ~= nil and title ~= ""
|
|
16
|
+
local hasActions = actions ~= nil
|
|
15
17
|
local _attributes = {
|
|
16
18
|
key = "Column",
|
|
17
19
|
}
|
|
@@ -21,34 +23,41 @@ local function Dialog(props)
|
|
|
21
23
|
local _attributes_1 = table.clone(styles.columnList)
|
|
22
24
|
setmetatable(_attributes_1, nil)
|
|
23
25
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
24
|
-
local
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
local _condition = hasTitle
|
|
27
|
+
if _condition then
|
|
28
|
+
local _attributes_2 = {
|
|
29
|
+
key = "Title",
|
|
30
|
+
}
|
|
31
|
+
for _k, _v in styles.title do
|
|
32
|
+
_attributes_2[_k] = _v
|
|
33
|
+
end
|
|
34
|
+
_attributes_2.Text = title
|
|
35
|
+
_condition = React.createElement("textlabel", _attributes_2)
|
|
29
36
|
end
|
|
30
|
-
_attributes_2
|
|
31
|
-
local _exp_1 = React.createElement("textlabel", _attributes_2)
|
|
32
|
-
local _attributes_3 = {
|
|
37
|
+
local _attributes_2 = {
|
|
33
38
|
key = "Body",
|
|
34
39
|
}
|
|
35
40
|
for _k, _v in styles.body do
|
|
36
|
-
|
|
41
|
+
_attributes_2[_k] = _v
|
|
37
42
|
end
|
|
38
|
-
local
|
|
39
|
-
local
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
local _exp_1 = React.createElement("frame", _attributes_2, children)
|
|
44
|
+
local _condition_1 = hasActions
|
|
45
|
+
if _condition_1 then
|
|
46
|
+
local _attributes_3 = {
|
|
47
|
+
key = "Actions",
|
|
48
|
+
}
|
|
49
|
+
for _k, _v in styles.actions do
|
|
50
|
+
_attributes_3[_k] = _v
|
|
51
|
+
end
|
|
52
|
+
local _attributes_4 = table.clone(styles.actionList)
|
|
53
|
+
setmetatable(_attributes_4, nil)
|
|
54
|
+
_condition_1 = (React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), actions))
|
|
44
55
|
end
|
|
45
|
-
local _attributes_5 = table.clone(styles.actionList)
|
|
46
|
-
setmetatable(_attributes_5, nil)
|
|
47
56
|
return React.createElement(Modal, {
|
|
48
57
|
host = host,
|
|
49
58
|
open = open,
|
|
50
59
|
onClose = onClose,
|
|
51
|
-
}, React.createElement("frame", _attributes, _exp,
|
|
60
|
+
}, React.createElement("frame", _attributes, _exp, _condition, _exp_1, _condition_1))
|
|
52
61
|
end
|
|
53
62
|
local default = Dialog
|
|
54
63
|
return {
|
|
@@ -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
|
+
}
|