@rbxts/uiblox 0.2.0-alpha.20 → 0.2.0-alpha.22
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/bottomNavigation/components/BottomNavigation.luau +1 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +1 -1
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +1 -1
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +1 -1
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +1 -1
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +1 -1
- package/out/ui/packages/imageList/components/ImageList.styles.luau +0 -1
- package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
- package/out/ui/packages/layout/components/FlexItem.luau +49 -0
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
- package/out/ui/packages/layout/components/Grid.d.ts +5 -1
- package/out/ui/packages/layout/components/Grid.luau +35 -4
- package/out/ui/packages/layout/components/Stack.d.ts +2 -0
- package/out/ui/packages/layout/components/Stack.luau +4 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +2 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +34 -5
- package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
- package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
- package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
- package/out/ui/packages/layout/components/gridProps.luau +20 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +4 -2
- package/out/ui/packages/layout/components/stackAlign.luau +16 -2
- package/out/ui/packages/layout/index.d.ts +4 -0
- package/out/ui/packages/layout/init.luau +1 -0
- package/out/ui/packages/menu/components/Menu.luau +1 -1
- package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.luau +11 -2
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +17 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +1 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +1 -1
- package/out/ui/packages/rating/components/Rating.luau +1 -1
- package/out/ui/packages/rectEditor/components/RectEditor.luau +1 -1
- package/out/ui/packages/select/components/Select.luau +2 -39
- package/out/ui/packages/skeleton/components/Skeleton.luau +1 -1
- package/out/ui/packages/speedDial/components/SpeedDial.luau +1 -1
- package/out/ui/packages/splitPane/components/SplitPane.luau +1 -1
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.luau +244 -167
- package/out/ui/packages/stepper/components/Stepper.luau +1 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.luau +3 -3
- package/out/ui/packages/tabs/components/Tabs.luau +1 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +2 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +3 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +2 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +5 -1
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -1
- package/package.json +2 -2
- package/out/ui/packages/select/components/selectMotion.d.ts +0 -2
- package/out/ui/packages/select/components/selectMotion.luau +0 -12
|
@@ -84,7 +84,7 @@ local function BottomNavigation(props)
|
|
|
84
84
|
_newValue[_k] = _callback(_v, _k - 1, options)
|
|
85
85
|
end
|
|
86
86
|
-- ▲ ReadonlyArray.map ▲
|
|
87
|
-
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
87
|
+
return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
88
88
|
end
|
|
89
89
|
local default = BottomNavigation
|
|
90
90
|
return {
|
|
@@ -108,7 +108,7 @@ local function Breadcrumbs(props)
|
|
|
108
108
|
_newValue[_k] = _callback(_v, _k - 1, visible)
|
|
109
109
|
end
|
|
110
110
|
-- ▲ ReadonlyArray.map ▲
|
|
111
|
-
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
111
|
+
return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
112
112
|
end
|
|
113
113
|
local default = Breadcrumbs
|
|
114
114
|
return {
|
|
@@ -81,7 +81,7 @@ local function CFrameEditor(props)
|
|
|
81
81
|
_newValue[_k] = _callback(_v, _k - 1, _exp_1)
|
|
82
82
|
end
|
|
83
83
|
-- ▲ ReadonlyArray.map ▲
|
|
84
|
-
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
84
|
+
return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
85
85
|
end
|
|
86
86
|
local default = CFrameEditor
|
|
87
87
|
return {
|
|
@@ -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.55 | 0.45 | 0.2;
|
|
@@ -348,7 +348,7 @@ local function ColorPanel(props)
|
|
|
348
348
|
_newValue[_k] = _callback(_v, _k - 1, recents)
|
|
349
349
|
end
|
|
350
350
|
-- ▲ ReadonlyArray.map ▲
|
|
351
|
-
_condition = (React.createElement("frame", _attributes_20, _exp_14, _newValue))
|
|
351
|
+
_condition = (React.createElement("frame", _attributes_20, _exp_14, React.createElement(React.Fragment, nil, _newValue)))
|
|
352
352
|
end
|
|
353
353
|
return React.createElement("frame", _attributes, _exp, _exp_4, _exp_9, _exp_12, _exp_13, _condition)
|
|
354
354
|
end
|
|
@@ -150,7 +150,7 @@ local function ColorSequenceEditor(props)
|
|
|
150
150
|
_newValue[_k] = _callback(_v, _k - 1, stops)
|
|
151
151
|
end
|
|
152
152
|
-- ▲ ReadonlyArray.map ▲
|
|
153
|
-
local _exp_3 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, _newValue)
|
|
153
|
+
local _exp_3 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, React.createElement(React.Fragment, nil, _newValue))
|
|
154
154
|
local _exp_4 = React.createElement(ColorPicker, {
|
|
155
155
|
key = "StopColor",
|
|
156
156
|
value = current.color,
|
|
@@ -148,7 +148,7 @@ local function NumberSequenceEditor(props)
|
|
|
148
148
|
_newValue[_k] = _callback(_v, _k - 1, stops)
|
|
149
149
|
end
|
|
150
150
|
-- ▲ ReadonlyArray.map ▲
|
|
151
|
-
local _exp_3 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, _newValue)
|
|
151
|
+
local _exp_3 = React.createElement("frame", _attributes_2, _exp_1, _exp_2, React.createElement(React.Fragment, nil, _newValue))
|
|
152
152
|
local _attributes_4 = {
|
|
153
153
|
key = "Fields",
|
|
154
154
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { FlexItemAlign } from "./flexItemMode";
|
|
4
|
+
export interface FlexItemProps {
|
|
5
|
+
grow?: number;
|
|
6
|
+
shrink?: number;
|
|
7
|
+
fill?: boolean;
|
|
8
|
+
alignSelf?: FlexItemAlign;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function FlexItem(props: CustomizedProps<Frame, FlexItemProps>): JSX.Element;
|
|
12
|
+
export default FlexItem;
|
|
@@ -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 useFlexItemStyles = TS.import(script, script.Parent, "FlexItem.styles").default
|
|
5
|
+
local function FlexItem(props)
|
|
6
|
+
local _binding = props
|
|
7
|
+
local grow = _binding.grow
|
|
8
|
+
local shrink = _binding.shrink
|
|
9
|
+
local fill = _binding.fill
|
|
10
|
+
local alignSelf = _binding.alignSelf
|
|
11
|
+
local children = _binding.children
|
|
12
|
+
local className = _binding.className
|
|
13
|
+
local sx = _binding.sx
|
|
14
|
+
local id = _binding.id
|
|
15
|
+
local ref = _binding.ref
|
|
16
|
+
local styles = useFlexItemStyles({
|
|
17
|
+
grow = grow,
|
|
18
|
+
shrink = shrink,
|
|
19
|
+
fill = fill,
|
|
20
|
+
alignSelf = alignSelf,
|
|
21
|
+
})
|
|
22
|
+
local _attributes = {}
|
|
23
|
+
local _condition = id
|
|
24
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
25
|
+
_condition = "FlexItem"
|
|
26
|
+
end
|
|
27
|
+
_attributes.key = _condition
|
|
28
|
+
_attributes.ref = ref
|
|
29
|
+
for _k, _v in styles.root do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
if className then
|
|
33
|
+
for _k, _v in className do
|
|
34
|
+
_attributes[_k] = _v
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
if sx then
|
|
38
|
+
for _k, _v in sx do
|
|
39
|
+
_attributes[_k] = _v
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
local _attributes_1 = table.clone(styles.flex)
|
|
43
|
+
setmetatable(_attributes_1, nil)
|
|
44
|
+
return React.createElement("frame", _attributes, React.createElement("uiflexitem", _attributes_1), children)
|
|
45
|
+
end
|
|
46
|
+
local default = FlexItem
|
|
47
|
+
return {
|
|
48
|
+
default = default,
|
|
49
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexItemAlign } from "./flexItemMode";
|
|
2
|
+
declare const useFlexItemStyles: (props: {
|
|
3
|
+
grow?: number;
|
|
4
|
+
shrink?: number;
|
|
5
|
+
fill?: boolean;
|
|
6
|
+
alignSelf?: FlexItemAlign;
|
|
7
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
8
|
+
export default useFlexItemStyles;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 _flexItemMode = TS.import(script, script.Parent, "flexItemMode")
|
|
7
|
+
local flexItemAlignKey = _flexItemMode.flexItemAlignKey
|
|
8
|
+
local flexItemGrowRatio = _flexItemMode.flexItemGrowRatio
|
|
9
|
+
local flexItemMode = _flexItemMode.flexItemMode
|
|
10
|
+
local flexItemShrinkRatio = _flexItemMode.flexItemShrinkRatio
|
|
11
|
+
local function modeEnum(mode)
|
|
12
|
+
if mode == "grow" then
|
|
13
|
+
return Enum.UIFlexMode.Grow
|
|
14
|
+
end
|
|
15
|
+
if mode == "shrink" then
|
|
16
|
+
return Enum.UIFlexMode.Shrink
|
|
17
|
+
end
|
|
18
|
+
if mode == "fill" then
|
|
19
|
+
return Enum.UIFlexMode.Fill
|
|
20
|
+
end
|
|
21
|
+
if mode == "custom" then
|
|
22
|
+
return Enum.UIFlexMode.Custom
|
|
23
|
+
end
|
|
24
|
+
return Enum.UIFlexMode.None
|
|
25
|
+
end
|
|
26
|
+
local function alignEnum(align)
|
|
27
|
+
if align == "start" then
|
|
28
|
+
return Enum.ItemLineAlignment.Start
|
|
29
|
+
end
|
|
30
|
+
if align == "center" then
|
|
31
|
+
return Enum.ItemLineAlignment.Center
|
|
32
|
+
end
|
|
33
|
+
if align == "end" then
|
|
34
|
+
return Enum.ItemLineAlignment.End
|
|
35
|
+
end
|
|
36
|
+
if align == "stretch" then
|
|
37
|
+
return Enum.ItemLineAlignment.Stretch
|
|
38
|
+
end
|
|
39
|
+
return Enum.ItemLineAlignment.Automatic
|
|
40
|
+
end
|
|
41
|
+
local useFlexItemStyles = componentStyles("FlexItem", function(_, _param)
|
|
42
|
+
local grow = _param.grow
|
|
43
|
+
local shrink = _param.shrink
|
|
44
|
+
local fill = _param.fill
|
|
45
|
+
local alignSelf = _param.alignSelf
|
|
46
|
+
local mode = flexItemMode(grow, shrink, fill)
|
|
47
|
+
local align = flexItemAlignKey(alignSelf)
|
|
48
|
+
return createStyles({
|
|
49
|
+
root = {
|
|
50
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
51
|
+
Size = UDim2.fromScale(0, 0),
|
|
52
|
+
BackgroundTransparency = 1,
|
|
53
|
+
BorderSizePixel = 0,
|
|
54
|
+
},
|
|
55
|
+
flex = {
|
|
56
|
+
FlexMode = modeEnum(mode),
|
|
57
|
+
GrowRatio = flexItemGrowRatio(grow),
|
|
58
|
+
ShrinkRatio = flexItemShrinkRatio(shrink),
|
|
59
|
+
ItemLineAlignment = alignEnum(align),
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
end)
|
|
63
|
+
local default = useFlexItemStyles
|
|
64
|
+
return {
|
|
65
|
+
default = default,
|
|
66
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { GridCorner } from "./gridProps";
|
|
2
3
|
export interface GridProps {
|
|
3
4
|
cellPadding?: UDim2;
|
|
4
5
|
cellSize?: UDim2;
|
|
6
|
+
gap?: number;
|
|
7
|
+
columns?: number;
|
|
8
|
+
maxColumns?: number;
|
|
5
9
|
fillDirection?: Enum.FillDirection;
|
|
6
10
|
fillDirectionMaxCells?: number;
|
|
7
11
|
sortOrder?: Enum.SortOrder;
|
|
8
|
-
startCorner?: Enum.StartCorner;
|
|
12
|
+
startCorner?: Enum.StartCorner | GridCorner;
|
|
9
13
|
horizontalAlignment?: Enum.HorizontalAlignment;
|
|
10
14
|
verticalAlignment?: Enum.VerticalAlignment;
|
|
11
15
|
}
|
|
@@ -4,7 +4,32 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
6
|
local createStyles = _theme.createStyles
|
|
7
|
-
local
|
|
7
|
+
local _gridProps = TS.import(script, script.Parent, "gridProps")
|
|
8
|
+
local gridCornerKey = _gridProps.gridCornerKey
|
|
9
|
+
local gridMaxCells = _gridProps.gridMaxCells
|
|
10
|
+
local function cornerEnum(corner)
|
|
11
|
+
if corner == nil then
|
|
12
|
+
return nil
|
|
13
|
+
end
|
|
14
|
+
local _corner = corner
|
|
15
|
+
if not (type(_corner) == "string") then
|
|
16
|
+
return corner
|
|
17
|
+
end
|
|
18
|
+
local key = gridCornerKey(corner)
|
|
19
|
+
if key == "top-right" then
|
|
20
|
+
return Enum.StartCorner.TopRight
|
|
21
|
+
end
|
|
22
|
+
if key == "bottom-left" then
|
|
23
|
+
return Enum.StartCorner.BottomLeft
|
|
24
|
+
end
|
|
25
|
+
if key == "bottom-right" then
|
|
26
|
+
return Enum.StartCorner.BottomRight
|
|
27
|
+
end
|
|
28
|
+
return Enum.StartCorner.TopLeft
|
|
29
|
+
end
|
|
30
|
+
local useGridStyles = componentStyles("Grid", function(theme, props)
|
|
31
|
+
local cells = gridMaxCells(props.columns, props.maxColumns, props.fillDirectionMaxCells)
|
|
32
|
+
local pad = if props.gap ~= nil then UDim2.fromOffset(theme.spacing.calc(props.gap), theme.spacing.calc(props.gap)) else props.cellPadding
|
|
8
33
|
return createStyles({
|
|
9
34
|
baseGrid = {
|
|
10
35
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -13,12 +38,12 @@ local useGridStyles = componentStyles("Grid", function(_, props)
|
|
|
13
38
|
BorderSizePixel = 0,
|
|
14
39
|
},
|
|
15
40
|
baseLayout = {
|
|
16
|
-
CellPadding =
|
|
41
|
+
CellPadding = pad,
|
|
17
42
|
CellSize = props.cellSize,
|
|
18
43
|
FillDirection = props.fillDirection,
|
|
19
|
-
FillDirectionMaxCells =
|
|
44
|
+
FillDirectionMaxCells = cells,
|
|
20
45
|
SortOrder = props.sortOrder,
|
|
21
|
-
StartCorner = props.startCorner,
|
|
46
|
+
StartCorner = cornerEnum(props.startCorner),
|
|
22
47
|
HorizontalAlignment = props.horizontalAlignment,
|
|
23
48
|
VerticalAlignment = props.verticalAlignment,
|
|
24
49
|
},
|
|
@@ -34,6 +59,9 @@ local function Grid(props)
|
|
|
34
59
|
if cellSize == nil then
|
|
35
60
|
cellSize = UDim2.fromOffset(100, 100)
|
|
36
61
|
end
|
|
62
|
+
local gap = _binding.gap
|
|
63
|
+
local columns = _binding.columns
|
|
64
|
+
local maxColumns = _binding.maxColumns
|
|
37
65
|
local fillDirection = _binding.fillDirection
|
|
38
66
|
if fillDirection == nil then
|
|
39
67
|
fillDirection = Enum.FillDirection.Horizontal
|
|
@@ -66,6 +94,9 @@ local function Grid(props)
|
|
|
66
94
|
local _binding_1 = useGridStyles({
|
|
67
95
|
cellPadding = cellPadding,
|
|
68
96
|
cellSize = cellSize,
|
|
97
|
+
gap = gap,
|
|
98
|
+
columns = columns,
|
|
99
|
+
maxColumns = maxColumns,
|
|
69
100
|
fillDirection = fillDirection,
|
|
70
101
|
fillDirectionMaxCells = fillDirectionMaxCells,
|
|
71
102
|
sortOrder = sortOrder,
|
|
@@ -4,6 +4,8 @@ import { StackAlign, StackDirection, StackJustify } from "./stackAlign";
|
|
|
4
4
|
export interface StackProps {
|
|
5
5
|
direction?: StackDirection;
|
|
6
6
|
spacing?: number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
wrap?: boolean;
|
|
7
9
|
alignItems?: StackAlign;
|
|
8
10
|
justifyContent?: StackJustify;
|
|
9
11
|
children?: React.ReactNode;
|
|
@@ -6,6 +6,8 @@ local function Stack(props)
|
|
|
6
6
|
local _binding = props
|
|
7
7
|
local direction = _binding.direction
|
|
8
8
|
local spacing = _binding.spacing
|
|
9
|
+
local gap = _binding.gap
|
|
10
|
+
local wrap = _binding.wrap
|
|
9
11
|
local alignItems = _binding.alignItems
|
|
10
12
|
local justifyContent = _binding.justifyContent
|
|
11
13
|
local children = _binding.children
|
|
@@ -16,6 +18,8 @@ local function Stack(props)
|
|
|
16
18
|
local styles = useStackStyles({
|
|
17
19
|
direction = direction,
|
|
18
20
|
spacing = spacing,
|
|
21
|
+
gap = gap,
|
|
22
|
+
wrap = wrap,
|
|
19
23
|
alignItems = alignItems,
|
|
20
24
|
justifyContent = justifyContent,
|
|
21
25
|
})
|
|
@@ -2,6 +2,8 @@ import { StackAlign, StackDirection, StackJustify } from "./stackAlign";
|
|
|
2
2
|
declare const useStackStyles: (props: {
|
|
3
3
|
direction?: StackDirection;
|
|
4
4
|
spacing?: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
wrap?: boolean;
|
|
5
7
|
alignItems?: StackAlign;
|
|
6
8
|
justifyContent?: StackJustify;
|
|
7
9
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
@@ -8,6 +8,8 @@ local stackAlignKey = _stackAlign.stackAlignKey
|
|
|
8
8
|
local stackGap = _stackAlign.stackGap
|
|
9
9
|
local stackIsRow = _stackAlign.stackIsRow
|
|
10
10
|
local stackJustifyKey = _stackAlign.stackJustifyKey
|
|
11
|
+
local stackNeedsMainFill = _stackAlign.stackNeedsMainFill
|
|
12
|
+
local stackRootAutomaticSize = _stackAlign.stackRootAutomaticSize
|
|
11
13
|
local stackUsesFlex = _stackAlign.stackUsesFlex
|
|
12
14
|
local function horizontalAlign(key)
|
|
13
15
|
if key == "center" then
|
|
@@ -39,28 +41,55 @@ local function mainFlex(justify)
|
|
|
39
41
|
end
|
|
40
42
|
return Enum.UIFlexAlignment.None
|
|
41
43
|
end
|
|
44
|
+
local function lineAlign(align)
|
|
45
|
+
if align == "center" then
|
|
46
|
+
return Enum.ItemLineAlignment.Center
|
|
47
|
+
end
|
|
48
|
+
if align == "end" then
|
|
49
|
+
return Enum.ItemLineAlignment.End
|
|
50
|
+
end
|
|
51
|
+
if align == "stretch" then
|
|
52
|
+
return Enum.ItemLineAlignment.Stretch
|
|
53
|
+
end
|
|
54
|
+
return Enum.ItemLineAlignment.Start
|
|
55
|
+
end
|
|
56
|
+
local function automaticSize(key)
|
|
57
|
+
if key == "X" then
|
|
58
|
+
return Enum.AutomaticSize.X
|
|
59
|
+
end
|
|
60
|
+
if key == "Y" then
|
|
61
|
+
return Enum.AutomaticSize.Y
|
|
62
|
+
end
|
|
63
|
+
return Enum.AutomaticSize.XY
|
|
64
|
+
end
|
|
42
65
|
local useStackStyles = componentStyles("Stack", function(theme, _param)
|
|
43
66
|
local direction = _param.direction
|
|
44
67
|
local spacing = _param.spacing
|
|
68
|
+
local gap = _param.gap
|
|
69
|
+
local wrap = _param.wrap
|
|
45
70
|
local alignItems = _param.alignItems
|
|
46
71
|
local justifyContent = _param.justifyContent
|
|
47
72
|
local row = stackIsRow(direction)
|
|
48
73
|
local cross = stackAlignKey(alignItems)
|
|
49
74
|
local main = stackJustifyKey(justifyContent)
|
|
50
75
|
local flex = if stackUsesFlex(main) then mainFlex(main) else Enum.UIFlexAlignment.None
|
|
76
|
+
local fillMain = stackNeedsMainFill(wrap, main)
|
|
77
|
+
local auto = stackRootAutomaticSize(row, fillMain)
|
|
51
78
|
return createStyles({
|
|
52
79
|
root = {
|
|
53
|
-
AutomaticSize =
|
|
54
|
-
Size = UDim2.fromScale(0, 0),
|
|
80
|
+
AutomaticSize = automaticSize(auto),
|
|
81
|
+
Size = if fillMain then if row then UDim2.new(1, 0, 0, 0) else UDim2.new(0, 0, 1, 0) else UDim2.fromScale(0, 0),
|
|
55
82
|
BackgroundTransparency = 1,
|
|
56
83
|
BorderSizePixel = 0,
|
|
57
84
|
},
|
|
58
85
|
list = {
|
|
59
86
|
FillDirection = if row then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
|
|
60
87
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
61
|
-
Padding = UDim.new(0, theme.spacing.calc(stackGap(spacing))),
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
Padding = UDim.new(0, theme.spacing.calc(stackGap(spacing, gap))),
|
|
89
|
+
Wraps = wrap == true,
|
|
90
|
+
ItemLineAlignment = lineAlign(cross),
|
|
91
|
+
HorizontalAlignment = if row then horizontalAlign(main) else horizontalAlign(if cross == "stretch" then "start" else cross),
|
|
92
|
+
VerticalAlignment = if row then verticalAlign(if cross == "stretch" then "start" else cross) else verticalAlign(main),
|
|
64
93
|
HorizontalFlex = if row then flex else Enum.UIFlexAlignment.None,
|
|
65
94
|
VerticalFlex = if row then Enum.UIFlexAlignment.None else flex,
|
|
66
95
|
},
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type FlexItemAlign = "auto" | "start" | "center" | "end" | "stretch";
|
|
2
|
+
export type FlexItemModeName = "none" | "grow" | "shrink" | "fill" | "custom";
|
|
3
|
+
export declare function flexItemMode(grow?: number, shrink?: number, fill?: boolean): FlexItemModeName;
|
|
4
|
+
export declare function flexItemGrowRatio(grow?: number): number;
|
|
5
|
+
export declare function flexItemShrinkRatio(shrink?: number): number;
|
|
6
|
+
export declare function flexItemAlignKey(align?: FlexItemAlign): FlexItemAlign;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function flexItemMode(grow, shrink, fill)
|
|
3
|
+
if fill then
|
|
4
|
+
return "fill"
|
|
5
|
+
end
|
|
6
|
+
local g = grow ~= nil and grow > 0
|
|
7
|
+
local s = shrink ~= nil and shrink > 0
|
|
8
|
+
if g and s then
|
|
9
|
+
return "custom"
|
|
10
|
+
end
|
|
11
|
+
if g then
|
|
12
|
+
return "grow"
|
|
13
|
+
end
|
|
14
|
+
if s then
|
|
15
|
+
return "shrink"
|
|
16
|
+
end
|
|
17
|
+
return "none"
|
|
18
|
+
end
|
|
19
|
+
local function flexItemGrowRatio(grow)
|
|
20
|
+
return if grow == nil then 0 else grow
|
|
21
|
+
end
|
|
22
|
+
local function flexItemShrinkRatio(shrink)
|
|
23
|
+
return if shrink == nil then 0 else shrink
|
|
24
|
+
end
|
|
25
|
+
local function flexItemAlignKey(align)
|
|
26
|
+
if align == "start" or align == "center" or align == "end" or align == "stretch" then
|
|
27
|
+
return align
|
|
28
|
+
end
|
|
29
|
+
return "auto"
|
|
30
|
+
end
|
|
31
|
+
return {
|
|
32
|
+
flexItemMode = flexItemMode,
|
|
33
|
+
flexItemGrowRatio = flexItemGrowRatio,
|
|
34
|
+
flexItemShrinkRatio = flexItemShrinkRatio,
|
|
35
|
+
flexItemAlignKey = flexItemAlignKey,
|
|
36
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type GridCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
2
|
+
export declare function gridMaxCells(columns?: number, maxColumns?: number, fillDirectionMaxCells?: number): number;
|
|
3
|
+
export declare function gridCornerKey(corner?: GridCorner): GridCorner;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function gridMaxCells(columns, maxColumns, fillDirectionMaxCells)
|
|
3
|
+
if columns ~= nil then
|
|
4
|
+
return columns
|
|
5
|
+
end
|
|
6
|
+
if maxColumns ~= nil then
|
|
7
|
+
return maxColumns
|
|
8
|
+
end
|
|
9
|
+
return if fillDirectionMaxCells == nil then 0 else fillDirectionMaxCells
|
|
10
|
+
end
|
|
11
|
+
local function gridCornerKey(corner)
|
|
12
|
+
if corner == "top-right" or corner == "bottom-left" or corner == "bottom-right" then
|
|
13
|
+
return corner
|
|
14
|
+
end
|
|
15
|
+
return "top-left"
|
|
16
|
+
end
|
|
17
|
+
return {
|
|
18
|
+
gridMaxCells = gridMaxCells,
|
|
19
|
+
gridCornerKey = gridCornerKey,
|
|
20
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type StackDirection = "row" | "column";
|
|
2
|
-
export type StackAlign = "start" | "center" | "end";
|
|
2
|
+
export type StackAlign = "start" | "center" | "end" | "stretch";
|
|
3
3
|
export type StackJustify = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
|
|
4
4
|
export declare function stackIsRow(direction?: StackDirection): direction is "row";
|
|
5
|
-
export declare function stackGap(spacing?: number): number;
|
|
5
|
+
export declare function stackGap(spacing?: number, gap?: number): number;
|
|
6
6
|
export declare function stackUsesFlex(justify?: StackJustify): justify is "space-between" | "space-around" | "space-evenly";
|
|
7
|
+
export declare function stackNeedsMainFill(wrap?: boolean, justify?: StackJustify): boolean;
|
|
8
|
+
export declare function stackRootAutomaticSize(row: boolean, fillMain: boolean): "XY" | "X" | "Y";
|
|
7
9
|
export declare function stackAlignKey(align?: StackAlign): StackAlign;
|
|
8
10
|
export declare function stackJustifyKey(justify?: StackJustify): StackJustify;
|
|
@@ -2,14 +2,26 @@
|
|
|
2
2
|
local function stackIsRow(direction)
|
|
3
3
|
return direction == "row"
|
|
4
4
|
end
|
|
5
|
-
local function stackGap(spacing)
|
|
5
|
+
local function stackGap(spacing, gap)
|
|
6
|
+
if gap ~= nil then
|
|
7
|
+
return gap
|
|
8
|
+
end
|
|
6
9
|
return if spacing == nil then 1 else spacing
|
|
7
10
|
end
|
|
8
11
|
local function stackUsesFlex(justify)
|
|
9
12
|
return justify == "space-between" or justify == "space-around" or justify == "space-evenly"
|
|
10
13
|
end
|
|
14
|
+
local function stackNeedsMainFill(wrap, justify)
|
|
15
|
+
return wrap == true or stackUsesFlex(justify)
|
|
16
|
+
end
|
|
17
|
+
local function stackRootAutomaticSize(row, fillMain)
|
|
18
|
+
if not fillMain then
|
|
19
|
+
return "XY"
|
|
20
|
+
end
|
|
21
|
+
return if row then "Y" else "X"
|
|
22
|
+
end
|
|
11
23
|
local function stackAlignKey(align)
|
|
12
|
-
if align == "center" or align == "end" then
|
|
24
|
+
if align == "center" or align == "end" or align == "stretch" then
|
|
13
25
|
return align
|
|
14
26
|
end
|
|
15
27
|
return "start"
|
|
@@ -24,6 +36,8 @@ return {
|
|
|
24
36
|
stackIsRow = stackIsRow,
|
|
25
37
|
stackGap = stackGap,
|
|
26
38
|
stackUsesFlex = stackUsesFlex,
|
|
39
|
+
stackNeedsMainFill = stackNeedsMainFill,
|
|
40
|
+
stackRootAutomaticSize = stackRootAutomaticSize,
|
|
27
41
|
stackAlignKey = stackAlignKey,
|
|
28
42
|
stackJustifyKey = stackJustifyKey,
|
|
29
43
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Grid } from "./components/Grid";
|
|
2
2
|
export { GridProps } from "./components/Grid";
|
|
3
|
+
export { GridCorner } from "./components/gridProps";
|
|
3
4
|
export * from "./components/Grid";
|
|
4
5
|
export { default as List } from "./components/List";
|
|
5
6
|
export { ListProps } from "./components/List";
|
|
@@ -7,6 +8,9 @@ export * from "./components/List";
|
|
|
7
8
|
export { default as Stack } from "./components/Stack";
|
|
8
9
|
export { StackProps } from "./components/Stack";
|
|
9
10
|
export { StackAlign, StackDirection, StackJustify } from "./components/stackAlign";
|
|
11
|
+
export { default as FlexItem } from "./components/FlexItem";
|
|
12
|
+
export { FlexItemProps } from "./components/FlexItem";
|
|
13
|
+
export { FlexItemAlign, FlexItemModeName } from "./components/flexItemMode";
|
|
10
14
|
export { default as Box } from "./components/Box";
|
|
11
15
|
export { BoxProps } from "./components/Box";
|
|
12
16
|
export { BoxPad } from "./components/boxPad";
|
|
@@ -10,6 +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.FlexItem = TS.import(script, script, "components", "FlexItem").default
|
|
13
14
|
exports.Box = TS.import(script, script, "components", "Box").default
|
|
14
15
|
exports.Container = TS.import(script, script, "components", "Container").default
|
|
15
16
|
exports.containerMaxPx = TS.import(script, script, "components", "containerWidth").containerMaxPx
|
|
@@ -77,7 +77,7 @@ local function Menu(props)
|
|
|
77
77
|
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
78
78
|
end
|
|
79
79
|
-- ▲ ReadonlyArray.map ▲
|
|
80
|
-
_result = _newValue
|
|
80
|
+
_result = (React.createElement(React.Fragment, nil, _newValue))
|
|
81
81
|
end
|
|
82
82
|
return React.createElement(Popup, {
|
|
83
83
|
anchor = anchor,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { PaginationVariant } from "./Pagination.styles";
|
|
2
3
|
export interface PaginationProps {
|
|
3
4
|
count: number;
|
|
4
5
|
page: number;
|
|
@@ -6,6 +7,7 @@ export interface PaginationProps {
|
|
|
6
7
|
siblingCount?: number;
|
|
7
8
|
boundaryCount?: number;
|
|
8
9
|
size?: ControlSize;
|
|
10
|
+
variant?: PaginationVariant;
|
|
9
11
|
onChange: (page: number) => void;
|
|
10
12
|
}
|
|
11
13
|
declare function Pagination(props: CustomizedProps<Frame, PaginationProps>): JSX.Element;
|
|
@@ -12,6 +12,7 @@ local function Pagination(props)
|
|
|
12
12
|
local siblingCount = _binding.siblingCount
|
|
13
13
|
local boundaryCount = _binding.boundaryCount
|
|
14
14
|
local size = _binding.size
|
|
15
|
+
local variant = _binding.variant
|
|
15
16
|
local onChange = _binding.onChange
|
|
16
17
|
local className = _binding.className
|
|
17
18
|
local sx = _binding.sx
|
|
@@ -19,6 +20,7 @@ local function Pagination(props)
|
|
|
19
20
|
local ref = _binding.ref
|
|
20
21
|
local styles = usePaginationStyles({
|
|
21
22
|
size = size,
|
|
23
|
+
variant = variant,
|
|
22
24
|
})
|
|
23
25
|
local tokens = pageRange(count, page, siblingCount, boundaryCount)
|
|
24
26
|
local _attributes = {}
|
|
@@ -75,7 +77,14 @@ local function Pagination(props)
|
|
|
75
77
|
}
|
|
76
78
|
local _attributes_3 = table.clone(styles.corner)
|
|
77
79
|
setmetatable(_attributes_3, nil)
|
|
78
|
-
|
|
80
|
+
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
81
|
+
local _condition_1 = variant == "outlined"
|
|
82
|
+
if _condition_1 then
|
|
83
|
+
local _attributes_4 = table.clone((if item == page then styles.selectedStroke else styles.stroke))
|
|
84
|
+
setmetatable(_attributes_4, nil)
|
|
85
|
+
_condition_1 = React.createElement("uistroke", _attributes_4)
|
|
86
|
+
end
|
|
87
|
+
_result = (React.createElement("textbutton", _attributes_2, _exp_1, _condition_1))
|
|
79
88
|
end
|
|
80
89
|
return _result
|
|
81
90
|
end
|
|
@@ -83,7 +92,7 @@ local function Pagination(props)
|
|
|
83
92
|
_newValue[_k] = _callback(_v, _k - 1, tokens)
|
|
84
93
|
end
|
|
85
94
|
-- ▲ ReadonlyArray.map ▲
|
|
86
|
-
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
95
|
+
return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
87
96
|
end
|
|
88
97
|
local default = Pagination
|
|
89
98
|
return {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
export type PaginationVariant = "text" | "outlined";
|
|
2
3
|
declare const usePaginationStyles: (props: {
|
|
3
4
|
size?: ControlSize;
|
|
5
|
+
variant?: PaginationVariant;
|
|
4
6
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
5
7
|
export default usePaginationStyles;
|