@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function imageListCols(cols)
|
|
3
|
+
if cols == nil or cols < 1 then
|
|
4
|
+
return 3
|
|
5
|
+
end
|
|
6
|
+
return math.floor(cols)
|
|
7
|
+
end
|
|
8
|
+
local function imageListGap(gap)
|
|
9
|
+
if gap == nil or gap < 0 then
|
|
10
|
+
return 1
|
|
11
|
+
end
|
|
12
|
+
return gap
|
|
13
|
+
end
|
|
14
|
+
local function imageListItemSize(itemSize)
|
|
15
|
+
if itemSize == nil or itemSize < 1 then
|
|
16
|
+
return 96
|
|
17
|
+
end
|
|
18
|
+
return math.floor(itemSize)
|
|
19
|
+
end
|
|
20
|
+
return {
|
|
21
|
+
imageListCols = imageListCols,
|
|
22
|
+
imageListGap = imageListGap,
|
|
23
|
+
imageListItemSize = imageListItemSize,
|
|
24
|
+
}
|
|
@@ -3,6 +3,7 @@ export * from "./skeleton/index";
|
|
|
3
3
|
export * from "./divider/index";
|
|
4
4
|
export * from "./errorBoundary/index";
|
|
5
5
|
export * from "./icon/index";
|
|
6
|
+
export * from "./imageList/index";
|
|
6
7
|
export * from "./iconButton/index";
|
|
7
8
|
export * from "./input/index";
|
|
8
9
|
export * from "./formText/index";
|
|
@@ -31,6 +32,7 @@ export * from "./cframeEditor/index";
|
|
|
31
32
|
export * from "./enumPicker/index";
|
|
32
33
|
export * from "./popup/index";
|
|
33
34
|
export * from "./modal/index";
|
|
35
|
+
export * from "./backdrop/index";
|
|
34
36
|
export * from "./dialog/index";
|
|
35
37
|
export * from "./paper/index";
|
|
36
38
|
export * from "./card/index";
|
|
@@ -16,6 +16,9 @@ end
|
|
|
16
16
|
for _k, _v in TS.import(script, script, "icon") or {} do
|
|
17
17
|
exports[_k] = _v
|
|
18
18
|
end
|
|
19
|
+
for _k, _v in TS.import(script, script, "imageList") or {} do
|
|
20
|
+
exports[_k] = _v
|
|
21
|
+
end
|
|
19
22
|
for _k, _v in TS.import(script, script, "iconButton") or {} do
|
|
20
23
|
exports[_k] = _v
|
|
21
24
|
end
|
|
@@ -100,6 +103,9 @@ end
|
|
|
100
103
|
for _k, _v in TS.import(script, script, "modal") or {} do
|
|
101
104
|
exports[_k] = _v
|
|
102
105
|
end
|
|
106
|
+
for _k, _v in TS.import(script, script, "backdrop") or {} do
|
|
107
|
+
exports[_k] = _v
|
|
108
|
+
end
|
|
103
109
|
for _k, _v in TS.import(script, script, "dialog") or {} do
|
|
104
110
|
exports[_k] = _v
|
|
105
111
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { BoxPad } from "./boxPad";
|
|
4
|
+
import { BoxBg } from "./Box.styles";
|
|
5
|
+
export interface BoxProps {
|
|
6
|
+
padding?: BoxPad;
|
|
7
|
+
bgcolor?: BoxBg;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function Box(props: CustomizedProps<Frame, BoxProps>): JSX.Element;
|
|
11
|
+
export default Box;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 useBoxStyles = TS.import(script, script.Parent, "Box.styles").default
|
|
5
|
+
local function Box(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local padding = _binding.padding
|
|
8
|
+
local bgcolor = _binding.bgcolor
|
|
9
|
+
local children = _binding.children
|
|
10
|
+
local className = _binding.className
|
|
11
|
+
local sx = _binding.sx
|
|
12
|
+
local id = _binding.id
|
|
13
|
+
local ref = _binding.ref
|
|
14
|
+
local styles = useBoxStyles({
|
|
15
|
+
padding = padding,
|
|
16
|
+
bgcolor = bgcolor,
|
|
17
|
+
})
|
|
18
|
+
local _attributes = {}
|
|
19
|
+
local _condition = id
|
|
20
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
|
+
_condition = "Box"
|
|
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
|
+
local _condition_1 = padding ~= nil
|
|
39
|
+
if _condition_1 then
|
|
40
|
+
local _attributes_1 = table.clone(styles.padding)
|
|
41
|
+
setmetatable(_attributes_1, nil)
|
|
42
|
+
_condition_1 = React.createElement("uipadding", _attributes_1)
|
|
43
|
+
end
|
|
44
|
+
return React.createElement("frame", _attributes, _condition_1, children)
|
|
45
|
+
end
|
|
46
|
+
local default = Box
|
|
47
|
+
return {
|
|
48
|
+
default = default,
|
|
49
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BoxPad } from "./boxPad";
|
|
2
|
+
export type BoxBg = "transparent" | "paper" | "elevated" | "input";
|
|
3
|
+
declare const useBoxStyles: (props: {
|
|
4
|
+
padding?: BoxPad;
|
|
5
|
+
bgcolor?: BoxBg;
|
|
6
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
7
|
+
export default useBoxStyles;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 boxPadSides = TS.import(script, script.Parent, "boxPad").boxPadSides
|
|
7
|
+
local useBoxStyles = componentStyles("Box", function(theme, _param)
|
|
8
|
+
local padding = _param.padding
|
|
9
|
+
local bgcolor = _param.bgcolor
|
|
10
|
+
if bgcolor == nil then
|
|
11
|
+
bgcolor = "transparent"
|
|
12
|
+
end
|
|
13
|
+
local sides = boxPadSides(padding)
|
|
14
|
+
local fill = if bgcolor == "paper" then theme.palette.surface.paper elseif bgcolor == "elevated" then theme.palette.surface.elevated elseif bgcolor == "input" then theme.palette.surface.input else theme.palette.surface.paper
|
|
15
|
+
return createStyles({
|
|
16
|
+
root = {
|
|
17
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
18
|
+
Size = UDim2.fromScale(0, 0),
|
|
19
|
+
BackgroundColor3 = fill,
|
|
20
|
+
BackgroundTransparency = if bgcolor == "transparent" then 1 else 0,
|
|
21
|
+
BorderSizePixel = 0,
|
|
22
|
+
},
|
|
23
|
+
padding = {
|
|
24
|
+
PaddingTop = UDim.new(0, theme.spacing.calc(sides.top)),
|
|
25
|
+
PaddingRight = UDim.new(0, theme.spacing.calc(sides.right)),
|
|
26
|
+
PaddingBottom = UDim.new(0, theme.spacing.calc(sides.bottom)),
|
|
27
|
+
PaddingLeft = UDim.new(0, theme.spacing.calc(sides.left)),
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
end)
|
|
31
|
+
local default = useBoxStyles
|
|
32
|
+
return {
|
|
33
|
+
default = default,
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { ContainerMaxWidth } from "./containerWidth";
|
|
4
|
+
export interface ContainerProps {
|
|
5
|
+
maxWidth?: ContainerMaxWidth;
|
|
6
|
+
disableGutters?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function Container(props: CustomizedProps<Frame, ContainerProps>): JSX.Element;
|
|
10
|
+
export default Container;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 useContainerStyles = TS.import(script, script.Parent, "Container.styles").default
|
|
5
|
+
local function Container(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local maxWidth = _binding.maxWidth
|
|
8
|
+
local disableGutters = _binding.disableGutters
|
|
9
|
+
local children = _binding.children
|
|
10
|
+
local className = _binding.className
|
|
11
|
+
local sx = _binding.sx
|
|
12
|
+
local id = _binding.id
|
|
13
|
+
local ref = _binding.ref
|
|
14
|
+
local styles = useContainerStyles({
|
|
15
|
+
maxWidth = maxWidth,
|
|
16
|
+
disableGutters = disableGutters,
|
|
17
|
+
})
|
|
18
|
+
local _attributes = {}
|
|
19
|
+
local _condition = id
|
|
20
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
21
|
+
_condition = "Container"
|
|
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
|
+
local _attributes_1 = {
|
|
39
|
+
key = "Inner",
|
|
40
|
+
}
|
|
41
|
+
for _k, _v in styles.inner do
|
|
42
|
+
_attributes_1[_k] = _v
|
|
43
|
+
end
|
|
44
|
+
local _attributes_2 = table.clone(styles.constraint)
|
|
45
|
+
setmetatable(_attributes_2, nil)
|
|
46
|
+
local _exp = React.createElement("uisizeconstraint", _attributes_2)
|
|
47
|
+
local _attributes_3 = table.clone(styles.gutter)
|
|
48
|
+
setmetatable(_attributes_3, nil)
|
|
49
|
+
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, React.createElement("uipadding", _attributes_3), children))
|
|
50
|
+
end
|
|
51
|
+
local default = Container
|
|
52
|
+
return {
|
|
53
|
+
default = default,
|
|
54
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 containerMaxPx = TS.import(script, script.Parent, "containerWidth").containerMaxPx
|
|
7
|
+
local useContainerStyles = componentStyles("Container", function(theme, _param)
|
|
8
|
+
local maxWidth = _param.maxWidth
|
|
9
|
+
local disableGutters = _param.disableGutters
|
|
10
|
+
local maxPx = containerMaxPx(maxWidth)
|
|
11
|
+
local gutter = theme.spacing.calc(2)
|
|
12
|
+
return createStyles({
|
|
13
|
+
root = {
|
|
14
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
15
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
16
|
+
BackgroundTransparency = 1,
|
|
17
|
+
BorderSizePixel = 0,
|
|
18
|
+
},
|
|
19
|
+
inner = {
|
|
20
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
21
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
22
|
+
Position = UDim2.new(0.5, 0, 0, 0),
|
|
23
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
24
|
+
BackgroundTransparency = 1,
|
|
25
|
+
BorderSizePixel = 0,
|
|
26
|
+
},
|
|
27
|
+
constraint = {
|
|
28
|
+
MaxSize = if maxPx ~= nil then Vector2.new(maxPx, math.huge) else Vector2.new(math.huge, math.huge),
|
|
29
|
+
},
|
|
30
|
+
gutter = {
|
|
31
|
+
PaddingTop = UDim.new(0, 0),
|
|
32
|
+
PaddingBottom = UDim.new(0, 0),
|
|
33
|
+
PaddingLeft = UDim.new(0, if disableGutters == true then 0 else gutter),
|
|
34
|
+
PaddingRight = UDim.new(0, if disableGutters == true then 0 else gutter),
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
end)
|
|
38
|
+
local default = useContainerStyles
|
|
39
|
+
return {
|
|
40
|
+
default = default,
|
|
41
|
+
}
|
|
@@ -5,7 +5,7 @@ export interface GridProps {
|
|
|
5
5
|
fillDirection?: Enum.FillDirection;
|
|
6
6
|
fillDirectionMaxCells?: number;
|
|
7
7
|
sortOrder?: Enum.SortOrder;
|
|
8
|
-
startCorner
|
|
8
|
+
startCorner?: Enum.StartCorner;
|
|
9
9
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
10
10
|
verticalAlignment?: Enum.VerticalAlignment;
|
|
11
11
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BoxPad = number | {
|
|
2
|
+
x?: number;
|
|
3
|
+
y?: number;
|
|
4
|
+
top?: number;
|
|
5
|
+
right?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
left?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function boxPadSides(padding?: BoxPad): {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function boxPadSides(padding)
|
|
3
|
+
if padding == nil then
|
|
4
|
+
return {
|
|
5
|
+
top = 0,
|
|
6
|
+
right = 0,
|
|
7
|
+
bottom = 0,
|
|
8
|
+
left = 0,
|
|
9
|
+
}
|
|
10
|
+
end
|
|
11
|
+
local _padding = padding
|
|
12
|
+
if type(_padding) == "number" then
|
|
13
|
+
return {
|
|
14
|
+
top = padding,
|
|
15
|
+
right = padding,
|
|
16
|
+
bottom = padding,
|
|
17
|
+
left = padding,
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
local _condition = padding.x
|
|
21
|
+
if _condition == nil then
|
|
22
|
+
_condition = 0
|
|
23
|
+
end
|
|
24
|
+
local x = _condition
|
|
25
|
+
local _condition_1 = padding.y
|
|
26
|
+
if _condition_1 == nil then
|
|
27
|
+
_condition_1 = 0
|
|
28
|
+
end
|
|
29
|
+
local y = _condition_1
|
|
30
|
+
local _object = {}
|
|
31
|
+
local _left = "top"
|
|
32
|
+
local _condition_2 = padding.top
|
|
33
|
+
if _condition_2 == nil then
|
|
34
|
+
_condition_2 = y
|
|
35
|
+
end
|
|
36
|
+
_object[_left] = _condition_2
|
|
37
|
+
local _left_1 = "right"
|
|
38
|
+
local _condition_3 = padding.right
|
|
39
|
+
if _condition_3 == nil then
|
|
40
|
+
_condition_3 = x
|
|
41
|
+
end
|
|
42
|
+
_object[_left_1] = _condition_3
|
|
43
|
+
local _left_2 = "bottom"
|
|
44
|
+
local _condition_4 = padding.bottom
|
|
45
|
+
if _condition_4 == nil then
|
|
46
|
+
_condition_4 = y
|
|
47
|
+
end
|
|
48
|
+
_object[_left_2] = _condition_4
|
|
49
|
+
local _left_3 = "left"
|
|
50
|
+
local _condition_5 = padding.left
|
|
51
|
+
if _condition_5 == nil then
|
|
52
|
+
_condition_5 = x
|
|
53
|
+
end
|
|
54
|
+
_object[_left_3] = _condition_5
|
|
55
|
+
return _object
|
|
56
|
+
end
|
|
57
|
+
return {
|
|
58
|
+
boxPadSides = boxPadSides,
|
|
59
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local WIDTHS = {
|
|
3
|
+
xs = 444,
|
|
4
|
+
sm = 600,
|
|
5
|
+
md = 900,
|
|
6
|
+
lg = 1200,
|
|
7
|
+
xl = 1536,
|
|
8
|
+
}
|
|
9
|
+
local function containerMaxPx(maxWidth)
|
|
10
|
+
if maxWidth == false then
|
|
11
|
+
return nil
|
|
12
|
+
end
|
|
13
|
+
return WIDTHS[maxWidth or "lg"]
|
|
14
|
+
end
|
|
15
|
+
return {
|
|
16
|
+
containerMaxPx = containerMaxPx,
|
|
17
|
+
}
|
|
@@ -7,3 +7,10 @@ export * from "./components/List";
|
|
|
7
7
|
export { default as Stack } from "./components/Stack";
|
|
8
8
|
export { StackProps } from "./components/Stack";
|
|
9
9
|
export { StackAlign, StackDirection, StackJustify } from "./components/stackAlign";
|
|
10
|
+
export { default as Box } from "./components/Box";
|
|
11
|
+
export { BoxProps } from "./components/Box";
|
|
12
|
+
export { BoxPad } from "./components/boxPad";
|
|
13
|
+
export { BoxBg } from "./components/Box.styles";
|
|
14
|
+
export { default as Container } from "./components/Container";
|
|
15
|
+
export { ContainerProps } from "./components/Container";
|
|
16
|
+
export { ContainerMaxWidth, containerMaxPx } from "./components/containerWidth";
|
|
@@ -10,4 +10,7 @@ for _k, _v in TS.import(script, script, "components", "List") or {} do
|
|
|
10
10
|
exports[_k] = _v
|
|
11
11
|
end
|
|
12
12
|
exports.Stack = TS.import(script, script, "components", "Stack").default
|
|
13
|
+
exports.Box = TS.import(script, script, "components", "Box").default
|
|
14
|
+
exports.Container = TS.import(script, script, "components", "Container").default
|
|
15
|
+
exports.containerMaxPx = TS.import(script, script, "components", "containerWidth").containerMaxPx
|
|
13
16
|
return exports
|
|
@@ -4,10 +4,13 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
|
+
local useState = _react.useState
|
|
7
8
|
local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
|
|
8
9
|
local GuiService = _services.GuiService
|
|
9
10
|
local UserInputService = _services.UserInputService
|
|
10
|
-
local
|
|
11
|
+
local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
|
|
12
|
+
local Portal = _popup.Portal
|
|
13
|
+
local portalTarget = _popup.portalTarget
|
|
11
14
|
local isDismissInput = TS.import(script, script.Parent, "dismissInput").isDismissInput
|
|
12
15
|
local _focusTrap = TS.import(script, script.Parent, "focusTrap")
|
|
13
16
|
local isFocusable = _focusTrap.isFocusable
|
|
@@ -22,7 +25,14 @@ local function Modal(props)
|
|
|
22
25
|
local styles = useModalStyles()
|
|
23
26
|
local close = useRef(onClose)
|
|
24
27
|
local surface = useRef()
|
|
28
|
+
local anchor = useRef()
|
|
29
|
+
local layer, setLayer = useState(function()
|
|
30
|
+
return portalTarget(host)
|
|
31
|
+
end)
|
|
25
32
|
close.current = onClose
|
|
33
|
+
useEffect(function()
|
|
34
|
+
setLayer(portalTarget(host or anchor.current))
|
|
35
|
+
end, { host, open })
|
|
26
36
|
useEffect(function()
|
|
27
37
|
if not open then
|
|
28
38
|
return nil
|
|
@@ -53,43 +63,51 @@ local function Modal(props)
|
|
|
53
63
|
GuiService.SelectedObject = previous
|
|
54
64
|
end
|
|
55
65
|
end
|
|
56
|
-
end, { open })
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
end, { open, layer })
|
|
67
|
+
local _exp = React.createElement("frame", {
|
|
68
|
+
key = "ModalAnchor",
|
|
69
|
+
ref = anchor,
|
|
70
|
+
Size = UDim2.fromOffset(0, 0),
|
|
71
|
+
BackgroundTransparency = 1,
|
|
72
|
+
BorderSizePixel = 0,
|
|
73
|
+
})
|
|
74
|
+
local _condition = open and layer ~= nil
|
|
75
|
+
if _condition then
|
|
76
|
+
local _attributes = {
|
|
77
|
+
key = "Modal",
|
|
78
|
+
}
|
|
79
|
+
for _k, _v in styles.root do
|
|
80
|
+
_attributes[_k] = _v
|
|
81
|
+
end
|
|
82
|
+
local _attributes_1 = {
|
|
83
|
+
key = "Backdrop",
|
|
84
|
+
}
|
|
85
|
+
for _k, _v in styles.backdrop do
|
|
86
|
+
_attributes_1[_k] = _v
|
|
87
|
+
end
|
|
88
|
+
_attributes_1.Event = {
|
|
89
|
+
Activated = function()
|
|
90
|
+
return close.current()
|
|
91
|
+
end,
|
|
92
|
+
}
|
|
93
|
+
local _exp_1 = React.createElement("textbutton", _attributes_1)
|
|
94
|
+
local _attributes_2 = {
|
|
95
|
+
key = "Surface",
|
|
96
|
+
ref = surface,
|
|
97
|
+
}
|
|
98
|
+
for _k, _v in styles.surface do
|
|
99
|
+
_attributes_2[_k] = _v
|
|
100
|
+
end
|
|
101
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
102
|
+
setmetatable(_attributes_3, nil)
|
|
103
|
+
local _exp_2 = React.createElement("uipadding", _attributes_3)
|
|
104
|
+
local _attributes_4 = table.clone(styles.corner)
|
|
105
|
+
setmetatable(_attributes_4, nil)
|
|
106
|
+
_condition = (React.createElement(Portal, {
|
|
107
|
+
host = layer,
|
|
108
|
+
}, React.createElement("frame", _attributes, _exp_1, React.createElement("frame", _attributes_2, _exp_2, React.createElement("uicorner", _attributes_4), children))))
|
|
84
109
|
end
|
|
85
|
-
|
|
86
|
-
setmetatable(_attributes_3, nil)
|
|
87
|
-
local _exp_1 = React.createElement("uipadding", _attributes_3)
|
|
88
|
-
local _attributes_4 = table.clone(styles.corner)
|
|
89
|
-
setmetatable(_attributes_4, nil)
|
|
90
|
-
return React.createElement(Portal, {
|
|
91
|
-
host = host,
|
|
92
|
-
}, React.createElement("frame", _attributes, _exp, React.createElement("frame", _attributes_2, _exp_1, React.createElement("uicorner", _attributes_4), children)))
|
|
110
|
+
return React.createElement(React.Fragment, nil, _exp, _condition)
|
|
93
111
|
end
|
|
94
112
|
local default = Modal
|
|
95
113
|
return {
|
|
@@ -2,4 +2,4 @@ export { loopProperty } from "./loop";
|
|
|
2
2
|
export { motionDuration, assignGoal } from "./duration";
|
|
3
3
|
export { playProperty } from "./play";
|
|
4
4
|
export { resolveReduced } from "./resolveReduced";
|
|
5
|
-
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys } from "./unit";
|
|
5
|
+
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys, spinArcKeys } from "./unit";
|
|
@@ -6,3 +6,8 @@ export declare function arcKeys(value: number): {
|
|
|
6
6
|
time: number;
|
|
7
7
|
transparency: number;
|
|
8
8
|
}[];
|
|
9
|
+
/** Indeterminate ring: long clear trail, bright head — reads as a sweep. */
|
|
10
|
+
export declare function spinArcKeys(): {
|
|
11
|
+
time: number;
|
|
12
|
+
transparency: number;
|
|
13
|
+
}[];
|
|
@@ -71,10 +71,33 @@ local function arcKeys(value)
|
|
|
71
71
|
transparency = 1,
|
|
72
72
|
} }
|
|
73
73
|
end
|
|
74
|
+
--* Indeterminate ring: long clear trail, bright head — reads as a sweep.
|
|
75
|
+
local function spinArcKeys()
|
|
76
|
+
return { {
|
|
77
|
+
time = 0,
|
|
78
|
+
transparency = 1,
|
|
79
|
+
}, {
|
|
80
|
+
time = 0.45,
|
|
81
|
+
transparency = 1,
|
|
82
|
+
}, {
|
|
83
|
+
time = 0.7,
|
|
84
|
+
transparency = 0.55,
|
|
85
|
+
}, {
|
|
86
|
+
time = 0.88,
|
|
87
|
+
transparency = 0,
|
|
88
|
+
}, {
|
|
89
|
+
time = 0.96,
|
|
90
|
+
transparency = 0.35,
|
|
91
|
+
}, {
|
|
92
|
+
time = 1,
|
|
93
|
+
transparency = 1,
|
|
94
|
+
} }
|
|
95
|
+
end
|
|
74
96
|
return {
|
|
75
97
|
clampUnit = clampUnit,
|
|
76
98
|
stopOnce = stopOnce,
|
|
77
99
|
progressUnit = progressUnit,
|
|
78
100
|
progressSpin = progressSpin,
|
|
79
101
|
arcKeys = arcKeys,
|
|
102
|
+
spinArcKeys = spinArcKeys,
|
|
80
103
|
}
|
|
@@ -2,3 +2,4 @@ export { default as Popup } from "./components/Popup";
|
|
|
2
2
|
export { PopupProps } from "./components/Popup";
|
|
3
3
|
export { default as Portal } from "./components/Portal";
|
|
4
4
|
export { PortalProps } from "./components/Portal";
|
|
5
|
+
export { portalTarget } from "./components/portalTarget";
|
|
@@ -3,4 +3,5 @@ local TS = _G[script]
|
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Popup = TS.import(script, script, "components", "Popup").default
|
|
5
5
|
exports.Portal = TS.import(script, script, "components", "Portal").default
|
|
6
|
+
exports.portalTarget = TS.import(script, script, "components", "portalTarget").portalTarget
|
|
6
7
|
return exports
|
|
@@ -11,6 +11,7 @@ export interface RadioGroupProps<T> {
|
|
|
11
11
|
onChange: (value: T) => void;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
size?: ControlSize;
|
|
14
|
+
row?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare function RadioGroup<T>(props: CustomizedProps<Frame, RadioGroupProps<T>>): JSX.Element;
|
|
16
17
|
export default RadioGroup;
|
|
@@ -10,17 +10,19 @@ local function RadioGroup(props)
|
|
|
10
10
|
local onChange = _binding.onChange
|
|
11
11
|
local disabled = _binding.disabled
|
|
12
12
|
local size = _binding.size
|
|
13
|
+
local row = _binding.row
|
|
13
14
|
local className = _binding.className
|
|
14
15
|
local sx = _binding.sx
|
|
15
16
|
local id = _binding.id
|
|
16
17
|
local ref = _binding.ref
|
|
17
18
|
local _binding_1 = useRadioGroupStyles({
|
|
18
19
|
size = size,
|
|
20
|
+
row = row,
|
|
19
21
|
})
|
|
20
22
|
local root = _binding_1.root
|
|
21
23
|
local list = _binding_1.list
|
|
22
24
|
local option = _binding_1.option
|
|
23
|
-
local
|
|
25
|
+
local optionRow = _binding_1.optionRow
|
|
24
26
|
local ring = _binding_1.ring
|
|
25
27
|
local dot = _binding_1.dot
|
|
26
28
|
local stroke = _binding_1.stroke
|
|
@@ -70,7 +72,7 @@ local function RadioGroup(props)
|
|
|
70
72
|
end
|
|
71
73
|
end,
|
|
72
74
|
}
|
|
73
|
-
local _attributes_3 = table.clone(
|
|
75
|
+
local _attributes_3 = table.clone(optionRow)
|
|
74
76
|
setmetatable(_attributes_3, nil)
|
|
75
77
|
local _exp_1 = React.createElement("uilistlayout", _attributes_3)
|
|
76
78
|
local _attributes_4 = table.clone(ring)
|