@rbxts/uiblox 0.2.0-alpha.11 → 0.2.0-alpha.13
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.d.ts +1 -0
- package/out/ui/packages/alert/components/Alert.luau +2 -0
- package/out/ui/packages/alert/components/Alert.styles.d.ts +1 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +7 -6
- package/out/ui/packages/badge/components/Badge.d.ts +1 -0
- package/out/ui/packages/badge/components/Badge.luau +18 -8
- package/out/ui/packages/badge/components/Badge.styles.d.ts +3 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +9 -5
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +8 -2
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/menu/components/Menu.d.ts +1 -0
- package/out/ui/packages/menu/components/Menu.luau +6 -2
- package/out/ui/packages/rating/components/Rating.d.ts +2 -1
- package/out/ui/packages/rating/components/Rating.luau +5 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +2 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +7 -2
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +2 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +12 -3
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +4 -1
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +9 -4
- package/out/ui/packages/speedDial/index.d.ts +1 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.luau +261 -199
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +7 -1
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +4 -1
- package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
- package/out/ui/packages/table/components/Table.styles.luau +10 -6
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +3 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +10 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +2 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +11 -4
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ local function Alert(props)
|
|
|
9
9
|
local title = _binding.title
|
|
10
10
|
local message = _binding.message
|
|
11
11
|
local onClose = _binding.onClose
|
|
12
|
+
local filled = _binding.filled
|
|
12
13
|
local className = _binding.className
|
|
13
14
|
local sx = _binding.sx
|
|
14
15
|
local id = _binding.id
|
|
@@ -17,6 +18,7 @@ local function Alert(props)
|
|
|
17
18
|
local styles = useAlertStyles({
|
|
18
19
|
severity = severity,
|
|
19
20
|
dismissible = dismissible,
|
|
21
|
+
filled = filled,
|
|
20
22
|
})
|
|
21
23
|
local _attributes = {}
|
|
22
24
|
local _condition = id
|
|
@@ -7,13 +7,14 @@ local alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverit
|
|
|
7
7
|
local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
8
8
|
local severity = _param.severity
|
|
9
9
|
local dismissible = _param.dismissible
|
|
10
|
+
local filled = _param.filled
|
|
10
11
|
local tone = theme.palette.status[alertSeverity(severity)]
|
|
11
12
|
local closeSize = theme.spacing.calc(2)
|
|
12
13
|
local _object = {
|
|
13
14
|
root = {
|
|
14
15
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
15
16
|
Size = UDim2.new(1, 0, 0, 0),
|
|
16
|
-
BackgroundColor3 = tone.surface,
|
|
17
|
+
BackgroundColor3 = if filled == true then tone.main else tone.surface,
|
|
17
18
|
BorderSizePixel = 0,
|
|
18
19
|
},
|
|
19
20
|
padding = {
|
|
@@ -26,9 +27,9 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
26
27
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
27
28
|
},
|
|
28
29
|
stroke = {
|
|
29
|
-
Color = tone.border,
|
|
30
|
+
Color = if filled == true then tone.main else tone.border,
|
|
30
31
|
Thickness = 1,
|
|
31
|
-
Transparency = 0,
|
|
32
|
+
Transparency = if filled == true then 1 else 0,
|
|
32
33
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
33
34
|
},
|
|
34
35
|
body = {
|
|
@@ -51,7 +52,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
51
52
|
BorderSizePixel = 0,
|
|
52
53
|
Font = theme.typography.fontFamilies.default,
|
|
53
54
|
TextSize = theme.typography.fontSizes.body,
|
|
54
|
-
TextColor3 = tone.main,
|
|
55
|
+
TextColor3 = if filled == true then tone.on else tone.main,
|
|
55
56
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
56
57
|
LayoutOrder = 1,
|
|
57
58
|
},
|
|
@@ -70,7 +71,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
70
71
|
_condition = theme.typography.fontSizes.body
|
|
71
72
|
end
|
|
72
73
|
_object_1[_left_1] = _condition
|
|
73
|
-
_object_1.TextColor3 = theme.palette.text.primary
|
|
74
|
+
_object_1.TextColor3 = if filled == true then tone.on else theme.palette.text.primary
|
|
74
75
|
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
75
76
|
_object_1.TextWrapped = true
|
|
76
77
|
_object_1.LayoutOrder = 2
|
|
@@ -81,7 +82,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
|
|
|
81
82
|
AnchorPoint = Vector2.new(1, 0),
|
|
82
83
|
BackgroundTransparency = 1,
|
|
83
84
|
BorderSizePixel = 0,
|
|
84
|
-
ImageColor3 = theme.palette.text.secondary,
|
|
85
|
+
ImageColor3 = if filled == true then tone.on else theme.palette.text.secondary,
|
|
85
86
|
ScaleType = Enum.ScaleType.Fit,
|
|
86
87
|
ZIndex = 2,
|
|
87
88
|
}
|
|
@@ -17,13 +17,20 @@ local function Badge(props)
|
|
|
17
17
|
if invisible == nil then
|
|
18
18
|
invisible = false
|
|
19
19
|
end
|
|
20
|
+
local variant = _binding.variant
|
|
21
|
+
if variant == nil then
|
|
22
|
+
variant = "standard"
|
|
23
|
+
end
|
|
20
24
|
local children = _binding.children
|
|
21
25
|
local className = _binding.className
|
|
22
26
|
local sx = _binding.sx
|
|
23
27
|
local id = _binding.id
|
|
24
28
|
local ref = _binding.ref
|
|
25
|
-
local styles = useBadgeStyles(
|
|
26
|
-
|
|
29
|
+
local styles = useBadgeStyles({
|
|
30
|
+
variant = variant,
|
|
31
|
+
})
|
|
32
|
+
local isDot = variant == "dot"
|
|
33
|
+
local shown = not invisible and (isDot or count > 0)
|
|
27
34
|
local _attributes = {}
|
|
28
35
|
local _condition = id
|
|
29
36
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
@@ -53,13 +60,16 @@ local function Badge(props)
|
|
|
53
60
|
for _k, _v in styles.badge do
|
|
54
61
|
_attributes_1[_k] = _v
|
|
55
62
|
end
|
|
56
|
-
_attributes_1.Text = badgeText(count, max)
|
|
57
|
-
local
|
|
63
|
+
_attributes_1.Text = if isDot then "" else badgeText(count, max)
|
|
64
|
+
local _condition_2 = isDot ~= true
|
|
65
|
+
if _condition_2 then
|
|
66
|
+
local _attributes_2 = table.clone(styles.padding)
|
|
67
|
+
setmetatable(_attributes_2, nil)
|
|
68
|
+
_condition_2 = React.createElement("uipadding", _attributes_2)
|
|
69
|
+
end
|
|
70
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
58
71
|
setmetatable(_attributes_2, nil)
|
|
59
|
-
|
|
60
|
-
local _attributes_3 = table.clone(styles.corner)
|
|
61
|
-
setmetatable(_attributes_3, nil)
|
|
62
|
-
_condition_1 = (React.createElement("textlabel", _attributes_1, _exp_1, React.createElement("uicorner", _attributes_3)))
|
|
72
|
+
_condition_1 = (React.createElement("textlabel", _attributes_1, _condition_2, React.createElement("uicorner", _attributes_2)))
|
|
63
73
|
end
|
|
64
74
|
return React.createElement("frame", _attributes, _exp, _condition_1)
|
|
65
75
|
end
|
|
@@ -3,8 +3,12 @@ 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
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
7
|
-
local
|
|
6
|
+
local useBadgeStyles = componentStyles("Badge", function(theme, _param)
|
|
7
|
+
local variant = _param.variant
|
|
8
|
+
if variant == nil then
|
|
9
|
+
variant = "standard"
|
|
10
|
+
end
|
|
11
|
+
local diameter = if variant == "dot" then theme.spacing.calc(1) else theme.spacing.calc(2) + theme.padding.calc(1)
|
|
8
12
|
return createStyles({
|
|
9
13
|
root = {
|
|
10
14
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -15,7 +19,7 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
|
15
19
|
badge = {
|
|
16
20
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
17
21
|
Position = UDim2.fromScale(1, 0),
|
|
18
|
-
AutomaticSize = Enum.AutomaticSize.X,
|
|
22
|
+
AutomaticSize = if variant == "dot" then Enum.AutomaticSize.None else Enum.AutomaticSize.X,
|
|
19
23
|
Size = UDim2.fromOffset(diameter, diameter),
|
|
20
24
|
BackgroundColor3 = theme.palette.status.error.main,
|
|
21
25
|
BorderSizePixel = 0,
|
|
@@ -27,8 +31,8 @@ local useBadgeStyles = componentStyles("Badge", function(theme)
|
|
|
27
31
|
ZIndex = 2,
|
|
28
32
|
},
|
|
29
33
|
padding = {
|
|
30
|
-
PaddingLeft = UDim.new(0, theme.padding.calc(0.5)),
|
|
31
|
-
PaddingRight = UDim.new(0, theme.padding.calc(0.5)),
|
|
34
|
+
PaddingLeft = UDim.new(0, if variant == "dot" then 0 else theme.padding.calc(0.5)),
|
|
35
|
+
PaddingRight = UDim.new(0, if variant == "dot" then 0 else theme.padding.calc(0.5)),
|
|
32
36
|
},
|
|
33
37
|
corner = {
|
|
34
38
|
CornerRadius = UDim.new(0.5, 0),
|
|
@@ -5,6 +5,7 @@ export interface BottomNavigationProps<T> {
|
|
|
5
5
|
options: ChoiceOption<T>[];
|
|
6
6
|
onChange: (value: T) => void;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
showLabels?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare function BottomNavigation<T>(props: CustomizedProps<Frame, BottomNavigationProps<T>>): JSX.Element;
|
|
10
11
|
export default BottomNavigation;
|
|
@@ -10,11 +10,17 @@ local function BottomNavigation(props)
|
|
|
10
10
|
local options = _binding.options
|
|
11
11
|
local onChange = _binding.onChange
|
|
12
12
|
local disabled = _binding.disabled
|
|
13
|
+
local showLabels = _binding.showLabels
|
|
14
|
+
if showLabels == nil then
|
|
15
|
+
showLabels = true
|
|
16
|
+
end
|
|
13
17
|
local className = _binding.className
|
|
14
18
|
local sx = _binding.sx
|
|
15
19
|
local id = _binding.id
|
|
16
20
|
local ref = _binding.ref
|
|
17
|
-
local styles = useBottomNavigationStyles(
|
|
21
|
+
local styles = useBottomNavigationStyles({
|
|
22
|
+
showLabels = showLabels,
|
|
23
|
+
})
|
|
18
24
|
local count = math.max(#options, 1)
|
|
19
25
|
local _attributes = {}
|
|
20
26
|
local _condition = id
|
|
@@ -51,7 +57,7 @@ local function BottomNavigation(props)
|
|
|
51
57
|
_attributes_2[_k] = _v
|
|
52
58
|
end
|
|
53
59
|
_attributes_2.Size = UDim2.new(1 / count, 0, 1, 0)
|
|
54
|
-
_attributes_2.Text = choice.label
|
|
60
|
+
_attributes_2.Text = if showLabels == false then "" else choice.label
|
|
55
61
|
_attributes_2.LayoutOrder = index
|
|
56
62
|
_attributes_2.Active = active
|
|
57
63
|
_attributes_2.Selectable = active
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const useBottomNavigationStyles: (
|
|
1
|
+
declare const useBottomNavigationStyles: (props: {
|
|
2
|
+
showLabels?: boolean;
|
|
3
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
4
|
export default useBottomNavigationStyles;
|
|
@@ -3,10 +3,14 @@ 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
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme)
|
|
6
|
+
local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme, _param)
|
|
7
|
+
local showLabels = _param.showLabels
|
|
8
|
+
if showLabels == nil then
|
|
9
|
+
showLabels = true
|
|
10
|
+
end
|
|
7
11
|
local _object = {
|
|
8
12
|
root = {
|
|
9
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(7)),
|
|
13
|
+
Size = UDim2.new(1, 0, 0, theme.spacing.calc(if showLabels == false then 5 else 7)),
|
|
10
14
|
BackgroundColor3 = theme.palette.surface.elevated,
|
|
11
15
|
BorderSizePixel = 0,
|
|
12
16
|
ZIndex = 11000,
|
|
@@ -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;
|
|
@@ -6,6 +6,7 @@ local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
|
6
6
|
local EmptyListHint = TS.import(script, script.Parent.Parent.Parent, "virtualList").EmptyListHint
|
|
7
7
|
local useMenuStyles = TS.import(script, script.Parent, "Menu.styles").default
|
|
8
8
|
local ROW = 28
|
|
9
|
+
local ROW_DENSE = 22
|
|
9
10
|
local function Menu(props)
|
|
10
11
|
local _binding = props
|
|
11
12
|
local anchor = _binding.anchor
|
|
@@ -15,12 +16,14 @@ local function Menu(props)
|
|
|
15
16
|
local onClose = _binding.onClose
|
|
16
17
|
local emptyText = _binding.emptyText
|
|
17
18
|
local empty = _binding.empty
|
|
19
|
+
local dense = _binding.dense
|
|
18
20
|
local styles = useMenuStyles()
|
|
19
21
|
if not open then
|
|
20
22
|
return nil
|
|
21
23
|
end
|
|
22
24
|
local vacant = #items == 0
|
|
23
|
-
local
|
|
25
|
+
local row = if dense == true then ROW_DENSE else ROW
|
|
26
|
+
local height = if vacant then row else #items * row
|
|
24
27
|
local _attributes = {
|
|
25
28
|
key = "Surface",
|
|
26
29
|
}
|
|
@@ -46,7 +49,7 @@ local function Menu(props)
|
|
|
46
49
|
_condition_1 = "No options"
|
|
47
50
|
end
|
|
48
51
|
_attributes_4.text = _condition_1
|
|
49
|
-
_attributes_4.height =
|
|
52
|
+
_attributes_4.height = row
|
|
50
53
|
_condition = React.createElement(EmptyListHint, _attributes_4)
|
|
51
54
|
end
|
|
52
55
|
_result = _condition
|
|
@@ -58,6 +61,7 @@ local function Menu(props)
|
|
|
58
61
|
key = item.id,
|
|
59
62
|
text = item.text,
|
|
60
63
|
disabled = item.disabled,
|
|
64
|
+
dense = dense,
|
|
61
65
|
onActivated = function()
|
|
62
66
|
if item.disabled == true then
|
|
63
67
|
return nil
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
export interface RatingProps {
|
|
3
3
|
value: number;
|
|
4
4
|
max?: number;
|
|
5
|
+
size?: ControlSize;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
onChange: (value: number) => void;
|
|
7
8
|
}
|
|
@@ -11,6 +11,10 @@ local function Rating(props)
|
|
|
11
11
|
if max == nil then
|
|
12
12
|
max = 5
|
|
13
13
|
end
|
|
14
|
+
local size = _binding.size
|
|
15
|
+
if size == nil then
|
|
16
|
+
size = "medium"
|
|
17
|
+
end
|
|
14
18
|
local disabled = _binding.disabled
|
|
15
19
|
local onChange = _binding.onChange
|
|
16
20
|
local className = _binding.className
|
|
@@ -19,6 +23,7 @@ local function Rating(props)
|
|
|
19
23
|
local ref = _binding.ref
|
|
20
24
|
local styles = useRatingStyles({
|
|
21
25
|
disabled = disabled,
|
|
26
|
+
size = size,
|
|
22
27
|
})
|
|
23
28
|
local active = canActivate(disabled)
|
|
24
29
|
local stars = {}
|
|
@@ -8,6 +8,11 @@ local useRatingStyles = componentStyles("Rating", function(theme, _param)
|
|
|
8
8
|
if disabled == nil then
|
|
9
9
|
disabled = false
|
|
10
10
|
end
|
|
11
|
+
local size = _param.size
|
|
12
|
+
if size == nil then
|
|
13
|
+
size = "medium"
|
|
14
|
+
end
|
|
15
|
+
local star = if size == "small" then theme.spacing.calc(2) elseif size == "large" then theme.spacing.calc(4) else theme.spacing.calc(3)
|
|
11
16
|
return createStyles({
|
|
12
17
|
root = {
|
|
13
18
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -20,10 +25,10 @@ local useRatingStyles = componentStyles("Rating", function(theme, _param)
|
|
|
20
25
|
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
21
26
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
22
27
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
23
|
-
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
28
|
+
Padding = UDim.new(0, theme.padding.calc(if size == "small" then 0.25 else 0.5)),
|
|
24
29
|
},
|
|
25
30
|
star = {
|
|
26
|
-
Size = UDim2.fromOffset(
|
|
31
|
+
Size = UDim2.fromOffset(star, star),
|
|
27
32
|
BackgroundTransparency = 1,
|
|
28
33
|
BorderSizePixel = 0,
|
|
29
34
|
AutoButtonColor = false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
import { Icons } from "../../../enums/index";
|
|
3
|
+
import { SpeedDialDirection } from "./SpeedDial.styles";
|
|
3
4
|
export interface SpeedDialAction {
|
|
4
5
|
icon: Icons;
|
|
5
6
|
disabled?: boolean;
|
|
@@ -12,6 +13,7 @@ export interface SpeedDialProps {
|
|
|
12
13
|
icon?: Icons;
|
|
13
14
|
openIcon?: Icons;
|
|
14
15
|
disabled?: boolean;
|
|
16
|
+
direction?: SpeedDialDirection;
|
|
15
17
|
}
|
|
16
18
|
declare function SpeedDial(props: CustomizedProps<Frame, SpeedDialProps>): JSX.Element;
|
|
17
19
|
export default SpeedDial;
|
|
@@ -18,11 +18,20 @@ local function SpeedDial(props)
|
|
|
18
18
|
openIcon = Icons.Close
|
|
19
19
|
end
|
|
20
20
|
local disabled = _binding.disabled
|
|
21
|
+
local direction = _binding.direction
|
|
22
|
+
if direction == nil then
|
|
23
|
+
direction = "up"
|
|
24
|
+
end
|
|
21
25
|
local className = _binding.className
|
|
22
26
|
local sx = _binding.sx
|
|
23
27
|
local id = _binding.id
|
|
24
28
|
local ref = _binding.ref
|
|
25
|
-
local styles = useSpeedDialStyles(
|
|
29
|
+
local styles = useSpeedDialStyles({
|
|
30
|
+
direction = direction,
|
|
31
|
+
})
|
|
32
|
+
local mainFirst = direction == "down" or direction == "right"
|
|
33
|
+
local mainOrder = if mainFirst then 0 else 1000
|
|
34
|
+
local actionBase = if mainFirst then 1 else 0
|
|
26
35
|
local _attributes = {}
|
|
27
36
|
local _condition = id
|
|
28
37
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
@@ -64,7 +73,7 @@ local function SpeedDial(props)
|
|
|
64
73
|
onOpenChange(false)
|
|
65
74
|
end,
|
|
66
75
|
className = {
|
|
67
|
-
LayoutOrder = index,
|
|
76
|
+
LayoutOrder = actionBase + index,
|
|
68
77
|
},
|
|
69
78
|
})
|
|
70
79
|
end
|
|
@@ -82,7 +91,7 @@ local function SpeedDial(props)
|
|
|
82
91
|
return onOpenChange(not open)
|
|
83
92
|
end,
|
|
84
93
|
className = {
|
|
85
|
-
LayoutOrder =
|
|
94
|
+
LayoutOrder = mainOrder,
|
|
86
95
|
},
|
|
87
96
|
}))
|
|
88
97
|
end
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export type SpeedDialDirection = "up" | "down" | "left" | "right";
|
|
2
|
+
declare const useSpeedDialStyles: (props: {
|
|
3
|
+
direction?: SpeedDialDirection;
|
|
4
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
5
|
export default useSpeedDialStyles;
|
|
@@ -3,7 +3,12 @@ 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
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useSpeedDialStyles = componentStyles("SpeedDial", function(theme)
|
|
6
|
+
local useSpeedDialStyles = componentStyles("SpeedDial", function(theme, _param)
|
|
7
|
+
local direction = _param.direction
|
|
8
|
+
if direction == nil then
|
|
9
|
+
direction = "up"
|
|
10
|
+
end
|
|
11
|
+
local vertical = direction == "up" or direction == "down"
|
|
7
12
|
return createStyles({
|
|
8
13
|
root = {
|
|
9
14
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -12,9 +17,9 @@ local useSpeedDialStyles = componentStyles("SpeedDial", function(theme)
|
|
|
12
17
|
BorderSizePixel = 0,
|
|
13
18
|
},
|
|
14
19
|
list = {
|
|
15
|
-
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
-
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
17
|
-
VerticalAlignment = Enum.VerticalAlignment.Bottom,
|
|
20
|
+
FillDirection = if vertical then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
21
|
+
HorizontalAlignment = if direction == "left" then Enum.HorizontalAlignment.Right elseif direction == "right" then Enum.HorizontalAlignment.Left else Enum.HorizontalAlignment.Center,
|
|
22
|
+
VerticalAlignment = if direction == "up" then Enum.VerticalAlignment.Bottom elseif direction == "down" then Enum.VerticalAlignment.Top else Enum.VerticalAlignment.Center,
|
|
18
23
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
19
24
|
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
20
25
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SplitPointer = "rest" | "hover" | "press";
|
|
2
2
|
export declare function splitPointer(hovering: boolean, pressed: boolean): SplitPointer;
|
|
3
|
-
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.25 | 0.
|
|
3
|
+
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.25 | 0.35 | 0.7 | 0.55;
|
|
4
4
|
export declare function splitMarkTransparency(pointer: SplitPointer, disabled?: boolean): 0 | 0.55 | 0.1;
|
|
5
5
|
export declare function splitHitTransparency(pointer: SplitPointer, disabled?: boolean): 1 | 0.9 | 0.94;
|